using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BiomeLords.Config; using BiomeLords.Data; using BiomeLords.Patches; using BiomeLords.Phase1B; using BiomeLords.Phase1C; using BiomeLords.Phase1D; using BiomeLords.Util; using HarmonyLib; using Jotunn; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; [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("BiomeLords")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0+03cc5aea47c17c0d9e1df4356b602e888acbc7b1")] [assembly: AssemblyProduct("BiomeLords")] [assembly: AssemblyTitle("BiomeLords")] [assembly: AssemblyVersion("0.1.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BiomeLords { [BepInPlugin("com.taeguk.BiomeLords", "BiomeLords", "0.6.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string ModGUID = "com.taeguk.BiomeLords"; public const string ModName = "BiomeLords"; public const string ModVersion = "0.6.0"; internal static Plugin Instance; private Harmony _harmony; private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) Instance = this; LordConfig.Bind(((BaseUnityPlugin)this).Config); _harmony = new Harmony("com.taeguk.BiomeLords"); int num = 0; int num2 = 0; Type[] types = typeof(Plugin).Assembly.GetTypes(); foreach (Type type in types) { try { new PatchClassProcessor(_harmony, type).Patch(); num++; } catch (Exception ex) { num2++; ((BaseUnityPlugin)this).Logger.LogError((object)("[BiomeLords] Patch class " + type.FullName + " failed: " + ex.Message)); } } ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[BiomeLords] Harmony: {num} patch classes applied, {num2} skipped."); PrefabManager.OnVanillaPrefabsAvailable += OnVanillaPrefabsAvailable; ((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("{0} {1} loaded. {2} Lords registered.", "BiomeLords", "0.6.0", LordRegistry.All.Count)); } private void OnVanillaPrefabsAvailable() { try { StatusEffectFactory.RegisterAll(); GuardianPowerFactory.RegisterAll(); SubEffectFactory.RegisterAll(); TrophyFactory.RegisterAll(); CreatureFactory.RegisterAll(); ItemFactory.RegisterAll(); PedestalFactory.RegisterAll(); DebugCommands.RegisterAll(); ObjectDB_Awake_BiomeLordsInject.InjectAll(); } catch (Exception arg) { ((BaseUnityPlugin)this).Logger.LogError((object)$"[BiomeLords] Registration failed: {arg}"); } finally { PrefabManager.OnVanillaPrefabsAvailable -= OnVanillaPrefabsAvailable; } } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } } namespace BiomeLords.Util { public sealed class ConfigurationManagerAttributes { public bool? IsAdminOnly; public bool? Browsable; public string Category; public string DispName; public int? Order; public bool? ReadOnly; public Action CustomDrawer; } public static class FeatherweightInventory { public const int BaseWidth = 8; public const int BaseHeight = 4; private static int _seHash; private static readonly FieldRef HeightRef = AccessTools.FieldRefAccess("m_height"); public static int ExtraRows => Mathf.Max(0, LordConfig.FallerValkyrieExtraRows?.Value ?? 0); public static int ExpandedHeight => 4 + ExtraRows; public static int LoadCeiling => 4 + Mathf.Max(ExtraRows, 4); public static int SeHash { get { if (_seHash == 0) { _seHash = StringExtensionMethods.GetStableHashCode("SE_FallerValkyrieLordSpirit"); } return _seHash; } } public static bool HasBlessing(Player p) { if ((Object)(object)p == (Object)null) { return false; } SEMan sEMan = ((Character)p).GetSEMan(); if (sEMan != null) { return sEMan.HaveStatusEffect(SeHash); } return false; } public static bool IsPlayerInventory(Inventory inv) { if (inv != null && inv.GetName() == "Inventory") { return inv.GetWidth() == 8; } return false; } public static void GrowForLoad(Inventory inv) { if (inv != null && HeightRef.Invoke(inv) < LoadCeiling) { HeightRef.Invoke(inv) = LoadCeiling; } } public static void Reconcile(Player p) { if (!((Object)(object)p == (Object)null)) { int target = ((HasBlessing(p) && ExtraRows > 0) ? ExpandedHeight : 4); SetHeight(p, target); } } public static void Collapse(Player p) { SetHeight(p, 4); } private static void SetHeight(Player p, int target) { Inventory inventory = ((Humanoid)p).GetInventory(); if (inventory != null) { List list = (from it in inventory.GetAllItems() where it.m_gridPos.y >= target select it).ToList(); if (list.Count > 0) { SpillToCrate(p, inventory, list); } HeightRef.Invoke(inventory) = target; } } private static void SpillToCrate(Player p, Inventory inv, List items) { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) GameObject cratePrefab = GetCratePrefab(); Container val = null; int num = 0; int num2 = 0; foreach (ItemData item in items) { bool flag = false; if ((Object)(object)cratePrefab != (Object)null) { if ((Object)(object)val == (Object)null) { val = SpawnCrate(p, cratePrefab, num++); } flag = (Object)(object)val != (Object)null && val.GetInventory().AddItem(item); if (!flag && (Object)(object)val != (Object)null) { val = SpawnCrate(p, cratePrefab, num++); flag = (Object)(object)val != (Object)null && val.GetInventory().AddItem(item); } } if (!flag) { ItemDrop.DropItem(item, item.m_stack, ((Component)p).transform.position + Vector3.up * 0.5f, Quaternion.identity); num2++; } inv.RemoveItem(item); } ((Character)p).Message((MessageType)2, (num > 0) ? "$biomelords_featherweight_crate" : "$biomelords_featherweight_dropped", 0, (Sprite)null); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)($"[BiomeLords] Featherweight collapse: {items.Count} item(s) cleared from extra rows " + $"({num} crate(s), ground-dropped={num2}).")); } } private static Container SpawnCrate(Player p, GameObject prefab, int index) { //IL_0021: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0068: 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) if ((Object)(object)prefab == (Object)null) { return null; } float num = (float)(index - 1) * 25f; Vector3 val = Quaternion.Euler(0f, num, 0f) * ((Component)p).transform.forward; Vector3 val2 = ((Component)p).transform.position + val * 1.5f + Vector3.up * 0.5f; GameObject val3 = Object.Instantiate(prefab, val2, Quaternion.identity); if (!((Object)(object)val3 != (Object)null)) { return null; } return val3.GetComponent(); } private static GameObject GetCratePrefab() { ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null) { return null; } GameObject prefab = instance.GetPrefab("CargoCrate"); if ((Object)(object)prefab != (Object)null) { return prefab; } GameObject prefab2 = instance.GetPrefab("Cart"); Container val = (((Object)(object)prefab2 != (Object)null) ? prefab2.GetComponentInChildren() : null); if (!((Object)(object)val != (Object)null)) { return null; } return val.m_destroyedLootPrefab; } } public static class FxLibrary { private static bool _dumped; public static GameObject TrySpawn(string name, Vector3 pos, Quaternion? rot = null, Transform parent = null) { //IL_0022: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(name)) { return null; } GameObject prefab = PrefabManager.Instance.GetPrefab(name); if ((Object)(object)prefab == (Object)null) { return null; } GameObject val = Object.Instantiate(prefab, pos, (Quaternion)(((??)rot) ?? Quaternion.identity)); if ((Object)(object)parent != (Object)null) { val.transform.SetParent(parent, true); } return val; } public static GameObject TrySpawnTimed(string name, Vector3 pos, float lifetime) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) GameObject val = TrySpawn(name, pos); if ((Object)(object)val != (Object)null && lifetime > 0f) { Object.Destroy((Object)(object)val, lifetime); } return val; } public static GameObject TrySpawnFirst(IEnumerable names, Vector3 pos) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) foreach (string name in names) { GameObject val = TrySpawn(name, pos); if ((Object)(object)val != (Object)null) { return val; } } return null; } public static void DumpFxNamesOnce() { if (_dumped) { return; } ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null || instance.m_prefabs == null) { return; } _dumped = true; int num = 0; foreach (GameObject prefab in instance.m_prefabs) { if (!((Object)(object)prefab == (Object)null)) { string name = ((Object)prefab).name; if (name.StartsWith("fx_") || name.StartsWith("vfx_") || name.Contains("ummon")) { Logger.LogInfo((object)("[BiomeLords.FxDump] " + name)); num++; } } } Logger.LogInfo((object)$"[BiomeLords.FxDump] {num} candidate FX prefabs dumped."); } } public static class IconAssignment { private static readonly Dictionary Map = new Dictionary { { "GP_TidesGrace", new string[3] { "Harpoon", "FishingRod", "Wet" } }, { "GP_ForestsEmbrace", new string[4] { "Sapling_Birch", "Sapling_Beech", "BeechSeeds", "Wood" } }, { "GP_PlagueBearer", new string[4] { "Poison", "Ooze", "BloodPudding", "Entrails" } }, { "GP_HowlOfThePack", new string[2] { "WolfFang", "FreezeGland" } }, { "GP_BullRush", new string[3] { "ShieldWood", "ShieldBronzeBuckler", "ShieldIronTower" } }, { "GP_HiveSense", new string[3] { "Wisplight", "Wisp", "Eitr" } }, { "GP_ValkyrieAscension", new string[1] { "Feathers" } }, { "SE_NeckLordSpirit", new string[2] { "FishingBait", "Fish1" } }, { "SE_GreydwarfLordSpirit", new string[2] { "Carrot", "CarrotSeeds" } }, { "SE_DraugrLordSpirit", new string[2] { "IronScrap", "Iron" } }, { "SE_FenringLordSpirit", new string[3] { "WolfPelt", "WolfFang", "TrophyWolf" } }, { "SE_LoxLordSpirit", new string[3] { "CookedLoxMeat", "LoxMeat", "Barley" } }, { "SE_SeekerLordSpirit", new string[3] { "Coal", "Bronze", "Iron" } }, { "SE_FallerValkyrieLordSpirit", new string[1] { "Feathers" } }, { "SE_ForestSitting", new string[3] { "Sheltered", "Shelter", "Rested" } } }; public static void AssignAll() { int num = 0; int num2 = 0; foreach (KeyValuePair item in Map) { StatusEffect val = ResolveSE(item.Key); if ((Object)(object)val == (Object)null) { num2++; continue; } Sprite val2 = FindFirstItemIcon(item.Value); if ((Object)(object)val2 != (Object)null) { val.m_icon = val2; num++; } else { num2++; } } Sprite featherFallIcon = GetFeatherFallIcon(); if ((Object)(object)featherFallIcon != (Object)null) { StatusEffect val3 = ResolveSE("SE_FallerValkyrieLordSpirit"); if ((Object)(object)val3 != (Object)null) { val3.m_icon = featherFallIcon; } StatusEffect val4 = ResolveSE("GP_ValkyrieAscension"); if ((Object)(object)val4 != (Object)null) { val4.m_icon = featherFallIcon; } } else { Logger.LogWarning((object)"[BiomeLords] IconAssignment: Feather fall icon not found; Valkyrie SEs kept their fallback icons."); } Logger.LogInfo((object)$"[BiomeLords] IconAssignment: {num} SEs got icons, {num2} missed."); } private static Sprite GetFeatherFallIcon() { GameObject prefab = PrefabManager.Instance.GetPrefab("CapeFeather"); StatusEffect val = ((prefab != null) ? prefab.GetComponent() : null)?.m_itemData?.m_shared?.m_equipStatusEffect; if ((Object)(object)val != (Object)null && (Object)(object)val.m_icon != (Object)null) { return val.m_icon; } return FindFirstItemIcon(new string[1] { "Feathers" }); } private static StatusEffect ResolveSE(string name) { if (GuardianPowerFactory.ByName.TryGetValue(name, out var value)) { return value; } if (StatusEffectFactory.ByName.TryGetValue(name, out var value2)) { return value2; } if (SubEffectFactory.ByName.TryGetValue(name, out var value3)) { return value3; } return null; } private static Sprite FindFirstItemIcon(string[] candidates) { ObjectDB instance = ObjectDB.instance; foreach (string text in candidates) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); Sprite[] array = ((prefab != null) ? prefab.GetComponent() : null)?.m_itemData?.m_shared?.m_icons; if (array != null && array.Length != 0 && (Object)(object)array[0] != (Object)null) { return array[0]; } if (!((Object)(object)instance != (Object)null) || instance.m_StatusEffects == null) { continue; } foreach (StatusEffect statusEffect in instance.m_StatusEffects) { if (!((Object)(object)statusEffect == (Object)null) && !((Object)(object)statusEffect.m_icon == (Object)null) && ((Object)statusEffect).name == text) { return statusEffect.m_icon; } } } return null; } } public static class KillStore { private const string Prefix = "BiomeLords.kills."; public static int Get(Player p, string prefabName) { if ((Object)(object)p == (Object)null || string.IsNullOrEmpty(prefabName)) { return 0; } if (!p.m_customData.TryGetValue("BiomeLords.kills." + prefabName, out var value) || !int.TryParse(value, out var result)) { return 0; } return result; } public static void Set(Player p, string prefabName, int value) { if (!((Object)(object)p == (Object)null) && !string.IsNullOrEmpty(prefabName)) { p.m_customData["BiomeLords.kills." + prefabName] = value.ToString(); } } public static int Increment(Player p, string prefabName) { if ((Object)(object)p == (Object)null || string.IsNullOrEmpty(prefabName)) { return 0; } string key = "BiomeLords.kills." + prefabName; int num = ((p.m_customData.TryGetValue(key, out var value) && int.TryParse(value, out var result)) ? result : 0); num++; p.m_customData[key] = num.ToString(); return num; } public static int SumFor(Player p, IEnumerable prefabNames) { int num = 0; foreach (string prefabName in prefabNames) { num += Get(p, prefabName); } return num; } } public struct DamageProfile { public float Blunt; public float Slash; public float Pierce; public float Fire; public float Frost; public float Lightning; public float Poison; public float Spirit; } public static class LordAttackProfile { private static readonly Dictionary Profiles = new Dictionary { { "neck_lord", new DamageProfile { Slash = 6f } }, { "greydwarf_lord", new DamageProfile { Slash = 17f } }, { "draugr_lord", new DamageProfile { Slash = 58f } }, { "fenring_lord", new DamageProfile { Slash = 85f } }, { "lox_lord", new DamageProfile { Slash = 130f } }, { "seeker_lord", new DamageProfile { Pierce = 120f } }, { "faller_valkyrie_lord", new DamageProfile { Pierce = 160f } } }; private static readonly DamageProfile[] ByTier = new DamageProfile[8] { default(DamageProfile), new DamageProfile { Blunt = 6f }, new DamageProfile { Blunt = 17f }, new DamageProfile { Blunt = 58f }, new DamageProfile { Blunt = 85f }, new DamageProfile { Blunt = 130f }, new DamageProfile { Blunt = 120f }, new DamageProfile { Blunt = 160f } }; public static bool TryGet(string lordId, out DamageProfile profile) { if (!string.IsNullOrEmpty(lordId) && Profiles.TryGetValue(lordId, out profile)) { return true; } profile = default(DamageProfile); return false; } public static bool TryGetByTier(int tier, out DamageProfile profile) { if (tier >= 1 && tier <= 7) { profile = ByTier[tier]; return true; } profile = default(DamageProfile); return false; } public static float TierMagnitude(int tier) { if (!TryGetByTier(tier, out var profile)) { return 0f; } return profile.Blunt + profile.Slash + profile.Pierce + profile.Fire + profile.Frost + profile.Lightning + profile.Poison + profile.Spirit; } public static DamageProfile Resolve(string lordId, int nativeTier, int effectiveTier) { TryGet(lordId, out var profile); if (effectiveTier <= nativeTier || !TryGetByTier(effectiveTier, out var profile2)) { return profile; } DamageProfile result = new DamageProfile { Fire = profile.Fire + profile2.Fire, Frost = profile.Frost + profile2.Frost, Lightning = profile.Lightning + profile2.Lightning, Poison = profile.Poison + profile2.Poison, Spirit = profile.Spirit + profile2.Spirit }; float num = profile2.Blunt + profile2.Slash + profile2.Pierce; if (profile.Pierce >= profile.Blunt && profile.Pierce >= profile.Slash && profile.Pierce > 0f) { result.Pierce = ((num > 0f) ? num : profile.Pierce); } else if (profile.Blunt >= profile.Slash && profile.Blunt > 0f) { result.Blunt = ((num > 0f) ? num : profile.Blunt); } else if (profile.Slash > 0f) { result.Slash = ((num > 0f) ? num : profile.Slash); } return result; } } public static class LordBaseStats { private static readonly Dictionary BaseHp = new Dictionary { { "neck_lord", 500f }, { "greydwarf_lord", 2500f }, { "draugr_lord", 5000f }, { "fenring_lord", 7500f }, { "lox_lord", 10000f }, { "seeker_lord", 12500f }, { "faller_valkyrie_lord", 25000f } }; public static float HpFor(string lordId, int tier) { if (!string.IsNullOrEmpty(lordId) && BaseHp.TryGetValue(lordId, out var value)) { return value; } return TierTable.HpFor(tier); } } public static class LordDamageRegistry { private static readonly Dictionary _mults = new Dictionary(); public static void Set(Character c, float multiplier) { if (!((Object)(object)c == (Object)null)) { _mults[((Object)c).GetInstanceID()] = multiplier; } } public static float Get(Character c, float fallback = 1f) { if ((Object)(object)c == (Object)null) { return fallback; } if (!_mults.TryGetValue(((Object)c).GetInstanceID(), out var value)) { return fallback; } return value; } public static bool Has(Character c) { if ((Object)(object)c == (Object)null) { return false; } return _mults.ContainsKey(((Object)c).GetInstanceID()); } public static void Clear(Character c) { if (!((Object)(object)c == (Object)null)) { _mults.Remove(((Object)c).GetInstanceID()); } } } public static class LordDefeatStore { private const string KeyPrefix = "biomelords_defeated_"; public static void RecordDefeat(string lordId) { if (string.IsNullOrEmpty(lordId)) { return; } if (LordConfig.GlobalLordDefeats != null && LordConfig.GlobalLordDefeats.Value) { if (!((Object)(object)ZoneSystem.instance == (Object)null)) { ZoneSystem.instance.SetGlobalKey("biomelords_defeated_" + lordId); Logger.LogInfo((object)("[BiomeLords] Recorded Lord defeat: " + lordId + " (global key — all players affected).")); } return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { ((Humanoid)localPlayer).AddUniqueKey("biomelords_defeated_" + lordId); Logger.LogInfo((object)("[BiomeLords] Recorded Lord defeat: " + lordId + " (player key — " + localPlayer.GetPlayerName() + " only).")); } } public static int HighestDefeatedTier() { int num = 0; if (LordConfig.GlobalLordDefeats != null && LordConfig.GlobalLordDefeats.Value) { if ((Object)(object)ZoneSystem.instance == (Object)null) { return 0; } foreach (BiomeLordDef item in LordRegistry.All) { if (ZoneSystem.instance.GetGlobalKey("biomelords_defeated_" + item.Id) && item.Tier > num) { num = item.Tier; } } } else { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return 0; } foreach (BiomeLordDef item2 in LordRegistry.All) { if (((Humanoid)localPlayer).HaveUniqueKey("biomelords_defeated_" + item2.Id) && item2.Tier > num) { num = item2.Tier; } } } return num; } } public static class LordIntrinsic { private static readonly Dictionary DamageMult = new Dictionary { { "neck_lord", 1f }, { "greydwarf_lord", 1f }, { "draugr_lord", 1f }, { "fenring_lord", 1f }, { "lox_lord", 1f }, { "seeker_lord", 1f }, { "faller_valkyrie_lord", 1f } }; private static readonly Dictionary Defaults = new Dictionary(DamageMult); public static IEnumerable Ids => Defaults.Keys; public static float DamageMultiplier(string lordId) { if (lordId == null) { return 1f; } if (!DamageMult.TryGetValue(lordId, out var value)) { return 1f; } return value; } public static bool IsKnown(string lordId) { if (!string.IsNullOrEmpty(lordId)) { return Defaults.ContainsKey(lordId); } return false; } public static float Set(string lordId, float value) { if (!IsKnown(lordId)) { return -1f; } float value2; float result = (DamageMult.TryGetValue(lordId, out value2) ? value2 : 1f); DamageMult[lordId] = value; return result; } public static bool Reset(string lordId) { if (!Defaults.TryGetValue(lordId, out var value)) { return false; } DamageMult[lordId] = value; return true; } public static int ResetAll() { foreach (KeyValuePair @default in Defaults) { DamageMult[@default.Key] = @default.Value; } return Defaults.Count; } public static float DefaultFor(string lordId) { if (!Defaults.TryGetValue(lordId, out var value)) { return 1f; } return value; } } public static class LordProfileRegistry { private static readonly Dictionary _profiles = new Dictionary(); public static void Set(Character c, DamageProfile profile) { if (!((Object)(object)c == (Object)null)) { _profiles[((Object)c).GetInstanceID()] = profile; } } public static bool TryGet(Character c, out DamageProfile profile) { if ((Object)(object)c != (Object)null && _profiles.TryGetValue(((Object)c).GetInstanceID(), out profile)) { return true; } profile = default(DamageProfile); return false; } public static void Clear(Character c) { if (!((Object)(object)c == (Object)null)) { _profiles.Remove(((Object)c).GetInstanceID()); } } } public static class RegisteredLords { public static readonly HashSet PrefabNames = new HashSet(); public static readonly Dictionary EventByPrefab = new Dictionary(); public static readonly Dictionary LordIdByPrefab = new Dictionary(); public static void Register(string prefabName, string eventName = null, string lordId = null) { if (!string.IsNullOrEmpty(prefabName)) { PrefabNames.Add(prefabName); if (!string.IsNullOrEmpty(eventName)) { EventByPrefab[prefabName] = eventName; } if (!string.IsNullOrEmpty(lordId)) { LordIdByPrefab[prefabName] = lordId; } } } public static string LordIdFor(Character c) { if ((Object)(object)c == (Object)null) { return null; } if (!LordIdByPrefab.TryGetValue(StripClone(((Object)((Component)c).gameObject).name), out var value)) { return null; } return value; } public static bool IsLord(Character c) { if ((Object)(object)c == (Object)null) { return false; } return PrefabNames.Contains(StripClone(((Object)((Component)c).gameObject).name)); } public static string EventFor(Character c) { if ((Object)(object)c == (Object)null) { return null; } if (!EventByPrefab.TryGetValue(StripClone(((Object)((Component)c).gameObject).name), out var value)) { return null; } return value; } private static string StripClone(string n) { if (string.IsNullOrEmpty(n)) { return n; } if (!n.EndsWith("(Clone)")) { return n; } return n.Substring(0, n.Length - "(Clone)".Length); } } public static class SpriteTinter { public static Sprite Tint(Sprite source, Color targetHueColor) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)source == (Object)null) { return null; } try { Texture2D texture = source.texture; if ((Object)(object)texture == (Object)null) { return source; } RenderTexture temporary = RenderTexture.GetTemporary(((Texture)texture).width, ((Texture)texture).height, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)0); RenderTexture active = RenderTexture.active; Graphics.Blit((Texture)(object)texture, temporary); RenderTexture.active = temporary; Texture2D val = new Texture2D(((Texture)texture).width, ((Texture)texture).height, (TextureFormat)4, false); val.ReadPixels(new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), 0, 0); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(targetHueColor, ref num, ref num2, ref num3); Color[] pixels = val.GetPixels(); float num4 = default(float); float num5 = default(float); for (int i = 0; i < pixels.Length; i++) { Color val2 = pixels[i]; if (!(val2.a < 0.02f)) { Color.RGBToHSV(val2, ref num3, ref num4, ref num5); float num6 = Mathf.Max(num4, 0.75f); Color val3 = Color.HSVToRGB(num, num6, num5); val3.a = val2.a; pixels[i] = val3; } } val.SetPixels(pixels); val.Apply(); return Sprite.Create(val, source.rect, new Vector2(0.5f, 0.5f), source.pixelsPerUnit); } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] SpriteTinter failed: " + ex.Message)); return source; } } } public static class TierTable { public const int MinTier = 1; public const int MaxTier = 7; private static readonly float[] HpByTier = new float[8] { 0f, 500f, 2500f, 5000f, 7500f, 10000f, 12500f, 25000f }; public static int Clamp(int tier) { if (tier >= 1) { if (tier <= 7) { return tier; } return 7; } return 1; } public static float HpFor(int tier) { return HpByTier[Clamp(tier)]; } } } namespace BiomeLords.Phase1D { public static class DebugCommands { private class ResetCooldowns : ConsoleCommand { public override string Name => "biomelords_reset_cooldowns"; public override string Help => "Resets BiomeLords Forsaken Power and pedestal blessing cooldowns for the local player."; public override bool IsCheat => true; public override bool IsNetwork => false; public override void Run(string[] args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { Console instance = Console.instance; if (instance != null) { instance.Print("BiomeLords: no local player."); } return; } localPlayer.m_guardianPowerCooldown = 0f; if (localPlayer.m_customData != null) { List list = localPlayer.m_customData.Keys.Where((string k) => k.StartsWith("BiomeLords.bless.next.")).ToList(); foreach (string item in list) { localPlayer.m_customData.Remove(item); } Console instance2 = Console.instance; if (instance2 != null) { instance2.Print($"BiomeLords: cleared {list.Count} blessing cooldown(s) + GP cooldown."); } } else { Console instance3 = Console.instance; if (instance3 != null) { instance3.Print("BiomeLords: GP cooldown cleared."); } } } } private class CropTimes : ConsoleCommand { public override string Name => "biomelords_crop_times"; public override string Help => "Toggles hover-text display of remaining grow time on planted crops (debug)."; public override bool IsCheat => true; public override bool IsNetwork => false; public override void Run(string[] args) { bool value = LordConfig.ShowCropGrowTimes.Value; LordConfig.ShowCropGrowTimes.Value = !value; bool value2 = LordConfig.ShowCropGrowTimes.Value; Console instance = Console.instance; if (instance != null) { instance.Print($"BiomeLords: crop grow-time display {value} -> {value2}."); } if (value2 == value) { Console instance2 = Console.instance; if (instance2 != null) { instance2.Print(" (Write may have been blocked. Edit the config file directly: BepInEx/config/com.taeguk.BiomeLords.cfg → [General] ShowCropGrowTimes = true)"); } } else { Console instance3 = Console.instance; if (instance3 != null) { instance3.Print(" Hover over a planted crop to see remaining / total grow time in cyan."); } } } } private class Intrinsic : ConsoleCommand { public override string Name => "biomelords_intrinsic"; public override string Help => "Read/write per-Lord intrinsic damage multiplier. Usage: biomelords_intrinsic [ [|reset] | reset]. No args = list all. Changes are session-only."; public override bool IsCheat => true; public override bool IsNetwork => false; public override void Run(string[] args) { if (args == null || args.Length == 0) { PrintAll(); return; } if (args.Length == 1 && args[0].Equals("reset", StringComparison.OrdinalIgnoreCase)) { int num = LordIntrinsic.ResetAll(); RefreshAllLordInstances(); Console instance = Console.instance; if (instance != null) { instance.Print($"BiomeLords: reset {num} Lord intrinsics to defaults."); } return; } string text = args[0].ToLowerInvariant(); if (!LordIntrinsic.IsKnown(text)) { Console instance2 = Console.instance; if (instance2 != null) { instance2.Print("BiomeLords: unknown lord_id '" + text + "'. Known: " + string.Join(", ", LordIntrinsic.Ids)); } } else if (args.Length == 1) { PrintOne(text); } else if (args.Length == 2 && args[1].Equals("reset", StringComparison.OrdinalIgnoreCase)) { float num2 = LordIntrinsic.DamageMultiplier(text); LordIntrinsic.Reset(text); float num3 = LordIntrinsic.DamageMultiplier(text); RefreshLordInstances(text); Console instance3 = Console.instance; if (instance3 != null) { instance3.Print($"BiomeLords: {text} intrinsic {num2:F2} -> {num3:F2} (default)."); } } else { if (args.Length < 2) { return; } if (!float.TryParse(args[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { Console instance4 = Console.instance; if (instance4 != null) { instance4.Print("BiomeLords: '" + args[1] + "' is not a number. Examples: 1.0, 0.35, 2.5"); } return; } if (result < 0f) { Console instance5 = Console.instance; if (instance5 != null) { instance5.Print("BiomeLords: value must be >= 0."); } return; } float num4 = LordIntrinsic.Set(text, result); int num5 = RefreshLordInstances(text); Console instance6 = Console.instance; if (instance6 != null) { instance6.Print($"BiomeLords: {text} intrinsic {num4:F2} -> {result:F2} " + $"(refreshed {num5} live instance(s); next spawns use the new value)."); } } } private static void PrintAll() { Console instance = Console.instance; if (instance != null) { instance.Print("BiomeLords intrinsic damage multipliers (current / default):"); } foreach (string id in LordIntrinsic.Ids) { float num = LordIntrinsic.DamageMultiplier(id); float num2 = LordIntrinsic.DefaultFor(id); string text = ((Math.Abs(num - num2) > 0.0001f) ? " *" : ""); Console instance2 = Console.instance; if (instance2 != null) { instance2.Print($" {id,-16} {num:F2} / {num2:F2}{text}"); } } Console instance3 = Console.instance; if (instance3 != null) { instance3.Print("Set: biomelords_intrinsic | Reset: biomelords_intrinsic [] reset"); } } private static void PrintOne(string lordId) { float num = LordIntrinsic.DamageMultiplier(lordId); float num2 = LordIntrinsic.DefaultFor(lordId); Console instance = Console.instance; if (instance != null) { instance.Print($"BiomeLords: {lordId} intrinsic = {num:F2} (default {num2:F2})."); } } private static int RefreshLordInstances(string lordId) { int num = 0; BiomeLordDef biomeLordDef = LordRegistry.ById(lordId); if (biomeLordDef == null) { return 0; } int effectiveTier = Math.Max(biomeLordDef.Tier, LordDefeatStore.HighestDefeatedTier()); DamageProfile profile = LordAttackProfile.Resolve(biomeLordDef.Id, biomeLordDef.Tier, effectiveTier); float num2 = LordConfig.DamageMultiplier(biomeLordDef.Id); float num3 = LordIntrinsic.DamageMultiplier(biomeLordDef.Id); float multiplier = num2 * num3; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !val.IsDead() && !(RegisteredLords.LordIdFor(val) != lordId)) { LordDamageRegistry.Set(val, multiplier); LordProfileRegistry.Set(val, profile); num++; } } return num; } private static void RefreshAllLordInstances() { foreach (string id in LordIntrinsic.Ids) { RefreshLordInstances(id); } } } private class TameTime : ConsoleCommand { private const float DefaultRadius = 10f; public override string Name => "biomelords_tame_time"; public override string Help => "Shows remaining tame time for untamed tameable creatures near the local player. Usage: biomelords_tame_time [radius] (default radius = 10 m)"; public override bool IsCheat => true; public override bool IsNetwork => false; public override void Run(string[] args) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { Console instance = Console.instance; if (instance != null) { instance.Print("BiomeLords: no local player."); } return; } float result = 10f; if (args != null && args.Length >= 1 && (!float.TryParse(args[0], NumberStyles.Float, CultureInfo.InvariantCulture, out result) || result <= 0f)) { Console instance2 = Console.instance; if (instance2 != null) { instance2.Print("BiomeLords: invalid radius. Usage: biomelords_tame_time [radius]"); } return; } Vector3 position = ((Component)localPlayer).transform.position; List list = new List(); List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !val.IsDead() && !(Vector3.Distance(((Component)val).transform.position, position) > result)) { Tameable component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null) && !val.IsTamed()) { float tamingTime = component.m_tamingTime; ZNetView component2 = ((Component)val).GetComponent(); float num = (((Object)(object)component2 != (Object)null && component2.GetZDO() != null) ? component2.GetZDO().GetFloat(ZDOVars.s_tameTimeLeft, tamingTime) : tamingTime); float num2 = ((tamingTime > 0f) ? ((1f - num / tamingTime) * 100f) : 100f); int num3 = (int)(num / 60f); int num4 = (int)(num % 60f); string arg = ((Localization.instance != null) ? Localization.instance.Localize(val.m_name) : val.m_name); float num5 = Vector3.Distance(((Component)val).transform.position, position); list.Add($" {arg} ({num5:F1}m away): " + $"{num3}m {num4}s left ({num2:F0}% tamed, " + $"total {tamingTime / 60f:F1}m)"); } } } if (list.Count == 0) { Console instance3 = Console.instance; if (instance3 != null) { instance3.Print($"BiomeLords: no untamed tameable creatures within {result:F0} m."); } return; } Console instance4 = Console.instance; if (instance4 != null) { instance4.Print($"BiomeLords: {list.Count} untamed tameable creature(s) within {result:F0} m:"); } foreach (string item in list) { Console instance5 = Console.instance; if (instance5 != null) { instance5.Print(item); } } } } private class DumpAttacks : ConsoleCommand { private static readonly string[] BasePrefabs = new string[7] { "Neck", "Greydwarf_Shaman", "Draugr_Elite", "Fenring", "Lox", "Seeker", "FallenValkyrie" }; public override string Name => "biomelords_dump_attacks"; public override string Help => "Dumps vanilla melee attack damage values for all 7 Lord base prefabs to the log."; public override bool IsCheat => true; public override bool IsNetwork => false; public override void Run(string[] args) { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: 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_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: 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_030f: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("[BiomeLords] === Vanilla attack damage dump ==="); string[] basePrefabs = BasePrefabs; List itemSets; foreach (string text in basePrefabs) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); if ((Object)(object)prefab == (Object)null) { stringBuilder.AppendLine(" " + text + ": PREFAB NOT FOUND"); continue; } stringBuilder.AppendLine("\n [" + text + "]"); Humanoid component = prefab.GetComponent(); if ((Object)(object)component == (Object)null) { stringBuilder.AppendLine(" (no Humanoid component)"); continue; } itemSets = new List(); CollectArray(component.m_defaultItems); CollectArray(component.m_randomWeapon); CollectArray(component.m_randomShield); if (itemSets.Count == 0) { stringBuilder.AppendLine(" (no default items found)"); continue; } foreach (ItemData item in itemSets) { if (item.m_shared != null) { DamageTypes damages = item.m_shared.m_damages; StringBuilder stringBuilder2 = new StringBuilder(" " + item.m_shared.m_name + ": "); if (damages.m_damage > 0f) { stringBuilder2.Append($"damage={damages.m_damage} "); } if (damages.m_blunt > 0f) { stringBuilder2.Append($"blunt={damages.m_blunt} "); } if (damages.m_slash > 0f) { stringBuilder2.Append($"slash={damages.m_slash} "); } if (damages.m_pierce > 0f) { stringBuilder2.Append($"pierce={damages.m_pierce} "); } if (damages.m_chop > 0f) { stringBuilder2.Append($"chop={damages.m_chop} "); } if (damages.m_pickaxe > 0f) { stringBuilder2.Append($"pickaxe={damages.m_pickaxe} "); } if (damages.m_fire > 0f) { stringBuilder2.Append($"fire={damages.m_fire} "); } if (damages.m_frost > 0f) { stringBuilder2.Append($"frost={damages.m_frost} "); } if (damages.m_lightning > 0f) { stringBuilder2.Append($"lightning={damages.m_lightning} "); } if (damages.m_poison > 0f) { stringBuilder2.Append($"poison={damages.m_poison} "); } if (damages.m_spirit > 0f) { stringBuilder2.Append($"spirit={damages.m_spirit} "); } stringBuilder.AppendLine(stringBuilder2.ToString().TrimEnd()); } } void CollectArray(GameObject[] arr) { if (arr != null) { foreach (GameObject val in arr) { if (!((Object)(object)val == (Object)null)) { ItemDrop component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { Collect(component2.m_itemData); } } } } } } stringBuilder.AppendLine("\n[BiomeLords] === End dump ==="); string text2 = stringBuilder.ToString(); Logger.LogInfo((object)text2); Console instance = Console.instance; if (instance != null) { instance.Print(text2); } void Collect(ItemData item) { if (item != null) { itemSets.Add(item); } } } } private class DumpQueenAttackFx : ConsoleCommand { public override string Name => "biomelords_dump_queen_attack"; public override string Help => "Dumps vanilla SeekerQueen attack-item projectile/trail prefab names to the log."; public override bool IsCheat => true; public override bool IsNetwork => false; public override void Run(string[] args) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) StringBuilder sb = new StringBuilder(); sb.AppendLine("[BiomeLords] === SeekerQueen attack FX dump ==="); GameObject prefab = PrefabManager.Instance.GetPrefab("SeekerQueen"); List itemSets; if ((Object)(object)prefab == (Object)null) { sb.AppendLine(" SeekerQueen: PREFAB NOT FOUND"); } else { Humanoid component = prefab.GetComponent(); itemSets = new List(); if ((Object)(object)component != (Object)null) { CollectArray(component.m_defaultItems); CollectArray(component.m_randomWeapon); } foreach (ItemData item in itemSets) { Attack val = item?.m_shared?.m_attack; if (val == null) { continue; } sb.AppendLine($" Attack item: {item.m_shared.m_name} (type={val.m_attackType})"); sb.AppendLine(" m_attackProjectile = " + (((Object)(object)val.m_attackProjectile != (Object)null) ? ((Object)val.m_attackProjectile).name : "(none)")); DumpEffectList("m_trailStartEffect", val.m_trailStartEffect); DumpEffectList("m_hitEffect", val.m_hitEffect); DumpEffectList("m_startEffect (launch vfx+sfx)", val.m_startEffect); if ((Object)(object)val.m_attackProjectile != (Object)null) { Projectile component2 = val.m_attackProjectile.GetComponent(); if ((Object)(object)component2 != (Object)null) { sb.AppendLine(" projectile.m_visual = " + (((Object)(object)component2.m_visual != (Object)null) ? ((Object)component2.m_visual).name : "(none)")); sb.AppendLine(" projectile.m_spawnOnHit = " + (((Object)(object)component2.m_spawnOnHit != (Object)null) ? ((Object)component2.m_spawnOnHit).name : "(none)")); DumpEffectList(" projectile.m_hitEffects (impact vfx+sfx)", component2.m_hitEffects); DumpEffectList(" projectile.m_spawnOnHitEffects", component2.m_spawnOnHitEffects); } } } if (itemSets.Count == 0) { sb.AppendLine(" (no attack items found on SeekerQueen)"); } } sb.AppendLine("\n[BiomeLords] === End dump ==="); string text = sb.ToString(); Logger.LogInfo((object)text); Console instance = Console.instance; if (instance != null) { instance.Print(text); } void Collect(ItemData item) { if (item != null) { itemSets.Add(item); } } void CollectArray(GameObject[] arr) { if (arr != null) { foreach (GameObject val2 in arr) { if (!((Object)(object)val2 == (Object)null)) { ItemDrop component3 = val2.GetComponent(); if ((Object)(object)component3 != (Object)null) { Collect(component3.m_itemData); } } } } } void DumpEffectList(string label, EffectList list) { if (list?.m_effectPrefabs != null && list.m_effectPrefabs.Length != 0) { EffectData[] effectPrefabs = list.m_effectPrefabs; foreach (EffectData val2 in effectPrefabs) { if ((Object)(object)val2?.m_prefab != (Object)null) { sb.AppendLine(" " + label + " = " + ((Object)val2.m_prefab).name); } } } } } } public static void RegisterAll() { CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new ResetCooldowns()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new CropTimes()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new Intrinsic()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new DumpAttacks()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new TameTime()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new DumpQueenAttackFx()); Logger.LogInfo((object)"[BiomeLords] Registered debug console commands."); } } public class DraugrLordBrain : MonoBehaviour { private const float CleaveCooldown = 30f; private const float CleaveRange = 5f; private const float WoundDuration = 60f; private const float WoundTickDamage = 5f; private const float WoundTickInterval = 1f; private const float SurgeHpFraction = 0.4f; private const float SurgeHealPerKill = 500f; private const float SurgeAbsorbRadius = 60f; private const float MinionCooldown = 60f; private const int MaxNearbyMinions = 3; private const int MinionsPerSummon = 2; private const float MinionDetectRadius = 12f; private const float CloudHpFraction = 0.6f; private const float DeathThroesHpFrac = 0.25f; private const float DeathThroesSpeed = 1.5f; private const float WetTickInterval = 2f; private const float WetTouchRadius = 3f; private const string MinionPrefab = "Draugr"; private Character _character; private Humanoid _humanoid; private ZNetView _nview; private float _baseSpeed; private float _baseRunSpeed; private bool _cloudFired; private bool _surgeFired; private bool _surgeActive; private bool _deathThroes; private float _nextCleaveTime; private float _nextMinionTime; private float _nextWetTouch; private float _nextDeathThroesPulse; private static GameObject _cachedMinion; private static StatusEffect _cachedWetSE; private static SE_DraugrWound _woundProto; private static readonly HashSet _cleaveWindowLords = new HashSet(); public static bool IsCleaving(int instanceId) { return _cleaveWindowLords.Contains(instanceId); } private void Awake() { _character = ((Component)this).GetComponent(); _humanoid = ((Component)this).GetComponent(); _nview = ((Component)this).GetComponent(); if ((Object)(object)_character != (Object)null) { _baseSpeed = _character.m_speed; _baseRunSpeed = _character.m_runSpeed; } _nextCleaveTime = Time.time + 8f; _nextMinionTime = Time.time + 15f; } private void Update() { if (!((Object)(object)_nview == (Object)null) && _nview.IsValid() && _nview.IsOwner() && !((Object)(object)_character == (Object)null) && !_character.IsDead()) { TryPlagueCloud(); TryUndyingSurge(); TryDeathThroes(); TryRottenCleave(); TrySummonMinions(); TickWetTouch(); TickDeathThroesAura(); } } private void TryPlagueCloud() { //IL_0035: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if (!_cloudFired && !(_character.GetHealth() / _character.GetMaxHealth() > 0.6f)) { _cloudFired = true; Vector3 val = ((Component)this).transform.position + Vector3.up * 0.5f; FxLibrary.TrySpawnTimed("vfx_blob_attack", val, 3f); FxLibrary.TrySpawnTimed("vfx_blob_attack", val, 4f); for (int i = 0; i < 6; i++) { float num = (float)i * 60f; Vector3 val2 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.6f; FxLibrary.TrySpawnTimed("vfx_blob_attack", val + val2, 3f); } GameObject val3 = new GameObject("BiomeLords_PlagueCloud"); val3.transform.position = ((Component)this).transform.position; val3.AddComponent().Attacker = _character; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)2, "$biomelords_plague_cloud", 0, (Sprite)null); } Logger.LogInfo((object)"[BiomeLords] Draugr Lord released a plague cloud."); } } private void TryDeathThroes() { //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) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_00a9: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) if (_deathThroes || _character.GetHealth() / _character.GetMaxHealth() > 0.25f) { return; } _deathThroes = true; _character.m_speed = _baseSpeed * 1.5f; _character.m_runSpeed = _baseRunSpeed * 1.5f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawnTimed("vfx_blob_attack", val, 3f); FxLibrary.TrySpawn("vfx_corpse_destruction_small", val); FxLibrary.TrySpawn("fx_redlightning_burst", val); for (int i = 0; i < 8; i++) { float num = (float)i * 45f; Vector3 val2 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.4f; FxLibrary.TrySpawn("vfx_HitSparks", val + val2); } Transform val3 = ((Component)this).transform.Find("BiomeLords_Aura"); if ((Object)(object)val3 != (Object)null) { Light component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { component.color = new Color(1f, 0.15f, 0.1f); component.intensity = 4f; component.range = 7f; } } Logger.LogInfo((object)"[BiomeLords] Draugr Lord entered Death Throes."); } private void TickDeathThroesAura() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0047: 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) if (_deathThroes && !(Time.time < _nextDeathThroesPulse)) { _nextDeathThroesPulse = Time.time + 0.6f; Vector3 pos = ((Component)this).transform.position + Vector3.up * 1.2f; if (Random.value < 0.5f) { FxLibrary.TrySpawn("fx_redlightning_burst", pos); } } } private void TryRottenCleave() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (!_surgeActive && !(Time.time < _nextCleaveTime)) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead() && !(Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position) > 5f)) { _nextCleaveTime = Time.time + 30f; ((MonoBehaviour)this).StartCoroutine(CleaveRoutine()); } } } private IEnumerator CleaveRoutine() { _character.m_speed = 0f; _character.m_runSpeed = 0f; Vector3 pos = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("fx_GP_Activation", pos); yield return (object)new WaitForSeconds(1f); int cleaveId = ((Object)_character).GetInstanceID(); _cleaveWindowLords.Add(cleaveId); Player localPlayer = Player.m_localPlayer; if ((Object)(object)_humanoid != (Object)null && (Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead()) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { ((Component)this).transform.rotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized); } ((Character)_humanoid).StartAttack((Character)(object)localPlayer, false); } yield return (object)new WaitForSeconds(0.4f); Vector3 pos2 = ((Component)this).transform.position + ((Component)this).transform.forward * 1.5f + Vector3.up * 1.2f; FxLibrary.TrySpawnFirst(new string[4] { "vfx_cut", "vfx_swing_sledge", "vfx_player_hit_blood", "vfx_HitSparks" }, pos2); yield return (object)new WaitForSeconds(0.4f); _cleaveWindowLords.Remove(cleaveId); float num = (_deathThroes ? 1.5f : 1f); _character.m_speed = _baseSpeed * num; _character.m_runSpeed = _baseRunSpeed * num; } public static void ApplyWound(Player p) { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_woundProto == (Object)null) { _woundProto = ScriptableObject.CreateInstance(); ((Object)_woundProto).name = "SE_DraugrWound"; ((StatusEffect)_woundProto).m_name = "$se_draugrwound"; ((StatusEffect)_woundProto).m_ttl = 60f; _woundProto.DamagePerTick = 5f; _woundProto.TickInterval = 1f; ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance != (Object)null) { StatusEffect statusEffect = instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Poison")); if ((Object)(object)statusEffect != (Object)null && (Object)(object)statusEffect.m_icon != (Object)null) { ((StatusEffect)_woundProto).m_icon = statusEffect.m_icon; } else if (instance.m_StatusEffects != null) { foreach (StatusEffect statusEffect2 in instance.m_StatusEffects) { if ((Object)(object)statusEffect2 != (Object)null && (Object)(object)statusEffect2.m_icon != (Object)null) { ((StatusEffect)_woundProto).m_icon = statusEffect2.m_icon; break; } } } } } ((Character)p).GetSEMan().AddStatusEffect((StatusEffect)(object)_woundProto, true, 0, 0f); FxLibrary.TrySpawnFirst(new string[3] { "vfx_BloodHit", "vfx_player_hit_blood", "vfx_HitSparks" }, ((Component)p).transform.position + Vector3.up * 1f); } private void TryUndyingSurge() { if (!_surgeFired && !(_character.GetHealth() / _character.GetMaxHealth() > 0.4f)) { _surgeFired = true; _surgeActive = true; ((MonoBehaviour)this).StartCoroutine(UndyingSurgeRoutine()); } } private IEnumerator UndyingSurgeRoutine() { _character.m_speed = 0f; _character.m_runSpeed = 0f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_HealthUpgrade", val); FxLibrary.TrySpawnTimed("vfx_Potion_health_medium", val, 4f); for (int i = 0; i < 6; i++) { float num = (float)i * 60f; Vector3 val2 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.4f; FxLibrary.TrySpawnTimed("vfx_Potion_health_medium", val + val2, 3f); } Player localPlayer = Player.m_localPlayer; if (localPlayer != null) { ((Character)localPlayer).Message((MessageType)2, "$biomelords_undying_surge", 0, (Sprite)null); } Logger.LogInfo((object)"[BiomeLords] Draugr Lord triggered Undying Surge."); yield return (object)new WaitForSeconds(1.5f); int num2 = 0; float num3 = 3600f; Vector3 position = ((Component)this).transform.position; List allCharacters = Character.GetAllCharacters(); for (int j = 0; j < allCharacters.Count; j++) { Character val3 = allCharacters[j]; if (!((Object)(object)val3 == (Object)null) && !((Object)(object)val3 == (Object)(object)_character) && !val3.IsDead() && !val3.IsPlayer()) { Vector3 val4 = ((Component)val3).transform.position - position; if (!(((Vector3)(ref val4)).sqrMagnitude > num3)) { FxLibrary.TrySpawn("vfx_HitSparks", ((Component)val3).transform.position + Vector3.up * 1f); float num4 = val3.GetMaxHealth() * 100f + 10000f; HitData val5 = new HitData(); val5.m_damage.m_blunt = num4; val5.m_damage.m_slash = num4; val5.m_damage.m_pierce = num4; val5.m_damage.m_fire = num4; val5.m_hitType = (HitType)1; val5.m_point = ((Component)val3).transform.position; val3.Damage(val5); num2++; } } } if (num2 > 0) { _character.Heal((float)num2 * 500f, true); Logger.LogInfo((object)$"[BiomeLords] Draugr Lord Undying Surge drained {num2} creature(s)."); } else { Player localPlayer2 = Player.m_localPlayer; if (localPlayer2 != null) { ((Character)localPlayer2).Message((MessageType)2, "$biomelords_undying_surge_fail", 0, (Sprite)null); } Logger.LogInfo((object)"[BiomeLords] Draugr Lord Undying Surge found no prey — failed."); } yield return (object)new WaitForSeconds(1.5f); float num5 = (_deathThroes ? 1.5f : 1f); _character.m_speed = _baseSpeed * num5; _character.m_runSpeed = _baseRunSpeed * num5; _surgeActive = false; } private void TrySummonMinions() { if (!_surgeActive && !(Time.time < _nextMinionTime)) { if (CountNearbyMinions() >= 3) { _nextMinionTime = Time.time + 15f; return; } DoSpawnMinions(); _nextMinionTime = Time.time + 60f; } } private void DoSpawnMinions() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) EnsurePrefabs(); if (!((Object)(object)_cachedMinion == (Object)null)) { int num = CountNearbyMinions(); int num2 = Math.Min(2, 3 - num); for (int i = 0; i < num2; i++) { float num3 = (float)i * (360f / (float)Math.Max(1, num2)) + Random.Range(-25f, 25f); Vector3 val = Quaternion.Euler(0f, num3, 0f) * Vector3.forward; Vector3 val2 = ((Component)this).transform.position + val * 3.5f + Vector3.up * 0.2f; Object.Instantiate(_cachedMinion, val2, Quaternion.LookRotation(-val)); FxLibrary.TrySpawn("vfx_spawn", val2); } } } private void TickWetTouch() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) if (!_deathThroes || Time.time < _nextWetTouch) { return; } _nextWetTouch = Time.time + 2f; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude > 9f)) { if ((Object)(object)_cachedWetSE == (Object)null) { ObjectDB instance = ObjectDB.instance; _cachedWetSE = ((instance != null) ? instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode("Wet")) : null); } if ((Object)(object)_cachedWetSE != (Object)null) { ((Character)localPlayer).GetSEMan().AddStatusEffect(_cachedWetSE, true, 0, 0f); } } } private int CountNearbyMinions() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) int num = 0; Vector3 position = ((Component)this).transform.position; float num2 = 144f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)_character) && !val.IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num2) && ((Object)((Component)val).gameObject).name.StartsWith("Draugr")) { num++; } } } return num; } private static void EnsurePrefabs() { if ((Object)(object)_cachedMinion == (Object)null) { _cachedMinion = PrefabManager.Instance.GetPrefab("Draugr"); } } } public class FallerValkyrieLordBrain : MonoBehaviour { private const float AbilityTellDelay = 0.5f; private const float DiveCooldown = 13f; private const float DiveRange = 20f; private const float DiveRadius = 4f; private const float DiveHpThreshold = 0.8f; private const float DiveAscend = 0.6f; private const float DiveDescend = 0.5f; private const float DiveSkyHeight = 10f; private const float DivePushForce = 70f; private const float GustCooldown = 16f; private const float GustTriggerRange = 7f; private const float GustRadius = 6f; private const float GustPushForce = 50f; private const float GustTelegraph = 0.4f; private const float HarvestCooldown = 30f; private const float HarvestTriggerRange = 12f; private const float HarvestRadius = 10f; private const float HarvestDuration = 6f; private const float HarvestTickInterval = 0.5f; private const float HarvestDrainPerTick = 6f; private const float HarvestArmThreshold = 0.3f; private const float HarvestDisarmThreshold = 0.5f; private const float RageHpFraction = 0.3f; private const float RageSpeedFactor = 1.5f; private Character _character; private ZNetView _nview; private MonsterAI _monsterAI; private float _baseSpeed; private float _baseRunSpeed; private bool _raging; private bool _inSpecial; private bool _harvestArmed; private float _nextDiveTime; private float _nextGustTime; private float _nextHarvestTime; private float _nextRagePulse; private void Awake() { _character = ((Component)this).GetComponent(); _nview = ((Component)this).GetComponent(); _monsterAI = ((Component)this).GetComponent(); if ((Object)(object)_character != (Object)null) { _baseSpeed = _character.m_speed; _baseRunSpeed = _character.m_runSpeed; } _nextDiveTime = Time.time + 8f; _nextGustTime = Time.time + 6f; _nextHarvestTime = Time.time + 12f; } private void Update() { if (!((Object)(object)_nview == (Object)null) && _nview.IsValid() && _nview.IsOwner() && !((Object)(object)_character == (Object)null) && !_character.IsDead()) { TryRage(); UpdateHarvestArming(); TryDiveBombSlam(); TryWindGustKnockback(); TrySoulHarvest(); TickRageAura(); } } private float HealthFrac() { float maxHealth = _character.GetMaxHealth(); if (!(maxHealth > 0f)) { return 1f; } return _character.GetHealth() / maxHealth; } private void SpawnAbilityTell() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0041: 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) Vector3 pos = ((Component)this).transform.position + Vector3.up * 1.5f; FxLibrary.TrySpawn("fx_fallenvalkyrie_alert", pos); FxLibrary.TrySpawn("fx_fallenvalkyrie_taunt", ((Component)this).transform.position); FxLibrary.TrySpawn("fx_himminafl_aoe", pos); } private void TryRage() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (_raging || HealthFrac() > 0.3f) { return; } _raging = true; _character.m_speed = _baseSpeed * 1.5f; _character.m_runSpeed = _baseRunSpeed * 1.5f; Transform val = ((Component)this).transform.Find("BiomeLords_Aura"); if ((Object)(object)val != (Object)null) { Light component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.color = new Color(1f, 0.95f, 0.75f); component.intensity = 5f; component.range = 8.5f; } } Vector3 pos = ((Component)this).transform.position + Vector3.up * 1.2f; FxLibrary.TrySpawn("fx_fallenvalkyrie_screech", pos); FxLibrary.TrySpawn("fx_himminafl_aoe", pos); FxLibrary.TrySpawn("vfx_corpse_destruction_small", pos); FxLibrary.TrySpawn("fx_redlightning_burst", pos); Logger.LogInfo((object)"[BiomeLords] Fallen Valkyrie Lord entered Rage."); } private void UpdateHarvestArming() { float num = HealthFrac(); if (num < 0.3f) { _harvestArmed = true; } else if (num > 0.5f) { _harvestArmed = false; } } private void TryDiveBombSlam() { //IL_0043: 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) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (!_inSpecial && !(HealthFrac() >= 0.8f) && !(Time.time < _nextDiveTime)) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead() && !(Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position) > 20f)) { _nextDiveTime = Time.time + (_raging ? 7.8f : 13f); ((MonoBehaviour)this).StartCoroutine(DiveBombSlamRoutine(((Component)localPlayer).transform.position)); } } } private IEnumerator DiveBombSlamRoutine(Vector3 targetPos) { //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) _inSpecial = true; if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = false; } SpawnAbilityTell(); yield return (object)new WaitForSeconds(0.5f); _character.TakeOff(); Vector3 skyPos = targetPos + Vector3.up * 10f; Vector3 startPos = ((Component)this).transform.position; float t = 0f; while (t < 0.6f) { float num = t / 0.6f; ((Component)this).transform.position = Vector3.Lerp(startPos, skyPos, num); FxLibrary.TrySpawn("fx_valkyrie_flapwing", ((Component)this).transform.position); t += Time.deltaTime; yield return null; } ((Component)this).transform.position = skyPos; ((Component)this).transform.rotation = Quaternion.LookRotation(Vector3.down); FxLibrary.TrySpawn("fx_redlightning_burst", targetPos); for (int i = 0; i < 6; i++) { float num2 = (float)i * 60f; Vector3 val = Quaternion.Euler(0f, num2, 0f) * Vector3.forward * 1.2f; FxLibrary.TrySpawn("vfx_HitSparks", targetPos + val); } yield return (object)new WaitForSeconds(0.3f); t = 0f; while (t < 0.5f) { float num3 = t / 0.5f; ((Component)this).transform.position = Vector3.Lerp(skyPos, targetPos, num3); t += Time.deltaTime; yield return null; } ((Component)this).transform.position = targetPos; FxLibrary.TrySpawn("fx_fallenvalkyrie_attack_claw", targetPos); FxLibrary.TrySpawn("fx_himminafl_aoe", targetPos); FxLibrary.TrySpawn("vfx_corpse_destruction_small", targetPos); FxLibrary.TrySpawnTimed("vfx_meteor_explosion", targetPos, 3f); float num4 = 16f; List allCharacters = Character.GetAllCharacters(); for (int j = 0; j < allCharacters.Count; j++) { Character obj = allCharacters[j]; Player val2 = (Player)(object)((obj is Player) ? obj : null); if (val2 != null && !((Character)val2).IsDead()) { Vector3 val3 = ((Component)val2).transform.position - targetPos; if (!(((Vector3)(ref val3)).sqrMagnitude > num4)) { HitData val4 = new HitData(); val4.m_pushForce = 70f; val4.m_point = targetPos; val4.m_dir = ((((Vector3)(ref val3)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val3)).normalized : Vector3.up); val4.m_hitType = (HitType)1; val4.m_blockable = true; val4.m_dodgeable = true; val4.SetAttacker(_character); ((Character)val2).Damage(val4); } } } _character.Land(); if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = true; } _inSpecial = false; } private void TryWindGustKnockback() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (_inSpecial || Time.time < _nextGustTime) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude > 49f)) { _nextGustTime = Time.time + (_raging ? 9.6f : 16f); ((MonoBehaviour)this).StartCoroutine(WindGustKnockbackRoutine()); } } } private IEnumerator WindGustKnockbackRoutine() { _inSpecial = true; SpawnAbilityTell(); yield return (object)new WaitForSeconds(0.5f); Vector3 center = ((Component)this).transform.position; FxLibrary.TrySpawn("fx_fallenvalkyrie_attack_spin_charge", center); FxLibrary.TrySpawn("fx_valkyrie_flapwing", center + Vector3.up * 1f); for (int i = 0; i < 8; i++) { float num = (float)i * 45f; Vector3 val = Quaternion.Euler(0f, num, 0f) * Vector3.forward * (2.5f - (float)i * 0.1f); FxLibrary.TrySpawn("vfx_HitSparks", center + val + Vector3.up * 1f); } FxLibrary.TrySpawn("fx_himminafl_aoe", center); yield return (object)new WaitForSeconds(0.4f); FxLibrary.TrySpawn("fx_fallenvalkyrie_attack_spin_release", center + Vector3.up * 1f); FxLibrary.TrySpawn("fx_redlightning_burst", center + Vector3.up * 1f); for (int j = 0; j < 12; j++) { float num2 = (float)j * 30f; Vector3 val2 = Quaternion.Euler(0f, num2, 0f) * Vector3.forward * 6f; FxLibrary.TrySpawn("vfx_HitSparks", center + val2 + Vector3.up * 0.5f); } float num3 = 36f; List allCharacters = Character.GetAllCharacters(); for (int k = 0; k < allCharacters.Count; k++) { Character obj = allCharacters[k]; Player val3 = (Player)(object)((obj is Player) ? obj : null); if (val3 != null && !((Character)val3).IsDead()) { Vector3 val4 = ((Component)val3).transform.position - center; if (!(((Vector3)(ref val4)).sqrMagnitude > num3)) { HitData val5 = new HitData(); val5.m_pushForce = 50f; val5.m_point = ((Component)val3).transform.position; val5.m_dir = ((((Vector3)(ref val4)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val4)).normalized : Vector3.forward); val5.m_hitType = (HitType)1; val5.m_blockable = true; val5.m_dodgeable = true; val5.SetAttacker(_character); ((Character)val3).Damage(val5); } } } _inSpecial = false; } private void TrySoulHarvest() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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) //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (_inSpecial || !_harvestArmed || Time.time < _nextHarvestTime) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude > 144f)) { _nextHarvestTime = Time.time + (_raging ? 18f : 30f); ((MonoBehaviour)this).StartCoroutine(SoulHarvestRoutine()); } } } private IEnumerator SoulHarvestRoutine() { _inSpecial = true; if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = false; } SpawnAbilityTell(); yield return (object)new WaitForSeconds(0.5f); _character.TakeOff(); FxLibrary.TrySpawn("fx_fallenvalkyrie_attack_spit_charge", ((Component)this).transform.position); FxLibrary.TrySpawn("fx_himminafl_aoe", ((Component)this).transform.position); float elapsed = 0f; float nextTick = 0f; float nextFlap = 0f; while (elapsed < 6f) { _character.SetMoveDir(Vector3.up * 0.15f); if (elapsed >= nextFlap) { nextFlap = elapsed + 0.8f; FxLibrary.TrySpawn("fx_valkyrie_flapwing", ((Component)this).transform.position); } if (elapsed >= nextTick) { nextTick = elapsed + 0.5f; DrainTick(); } elapsed += Time.deltaTime; yield return null; } _character.Land(); if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = true; } _inSpecial = false; } private void DrainTick() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //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_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; float num = 100f; List allCharacters = Character.GetAllCharacters(); float num2 = 0f; for (int i = 0; i < allCharacters.Count; i++) { Character obj = allCharacters[i]; Player val = (Player)(object)((obj is Player) ? obj : null); if (val != null && !((Character)val).IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { HitData val3 = new HitData(); val3.m_damage.m_spirit = 6f; val3.m_point = ((Component)val).transform.position; val3.m_dir = ((Vector3)(ref val2)).normalized; val3.m_hitType = (HitType)2; val3.SetAttacker(_character); ((Character)val).Damage(val3); SpawnTether(position, ((Component)val).transform.position + Vector3.up * 1f); num2 += 6f; } } } if (num2 > 0f) { _character.Heal(num2, true); } } private void SpawnTether(Vector3 from, Vector3 to) { //IL_0005: 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_0024: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) FxLibrary.TrySpawn("fx_fallenvalkyrie_attack_spit_projectile", from); for (int i = 0; i <= 5; i++) { float num = (float)i / 5f; Vector3 pos = Vector3.Lerp(from, to, num); FxLibrary.TrySpawn("vfx_HitSparks", pos); } FxLibrary.TrySpawn("fx_fallenvalkyrie_attack_spit_projectile_impact", to); } private void TickRageAura() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0047: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (_raging && !(Time.time < _nextRagePulse)) { _nextRagePulse = Time.time + 0.4f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_HitSparks", val); if (Random.value < 0.5f) { FxLibrary.TrySpawn("fx_himminafl_aoe", val + Vector3.up * 0.3f); } } } } public class FenringLordBrain : MonoBehaviour { private const float BatSummonCooldown = 60f; private const int MaxNearbyBats = 4; private const int BatsPerSummon = 2; private const float BatDetectRadius = 16f; private const string BatPrefab = "Bat"; private const float VampHpTrigger = 0.8f; private const float VampCooldown = 40f; public const float VampHealFraction = 0.8f; private const float VampDuration = 60f; private const float InvisHpTrigger = 0.6f; private const float InvisCooldown = 60f; private const float InvisDuration = 12f; private const float InvisPreDelay = 1f; private const float FrenzyHpFraction = 0.3f; private const float FrenzySpeedFactor = 1.5f; private const float FrenzyJumpFactor = 0.2f; private const float FrenzyAttackFactor = 0.3f; private Character _character; private ZNetView _nview; private MonsterAI _monsterAI; private float _baseSpeed; private float _baseRunSpeed; private float _baseJumpInterval; private float _baseAttackInterval; private bool _frenzied; private float _nextBatSummonTime; private float _nextVampTime; private float _vampEndTime = -1f; private float _nextInvisTime; private float _nextFrenzyPulse; private Light _auraLight; private Color _auraOrigColor; private float _auraOrigIntensity; private float _auraOrigRange; private static GameObject _cachedBat; private Animator _animator; public bool IsVampActive => Time.time < _vampEndTime; private void Awake() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) _character = ((Component)this).GetComponent(); _nview = ((Component)this).GetComponent(); _monsterAI = ((Component)this).GetComponent(); _animator = ((Component)this).GetComponentInChildren(); if ((Object)(object)_character != (Object)null) { _baseSpeed = _character.m_speed; _baseRunSpeed = _character.m_runSpeed; } if ((Object)(object)_monsterAI != (Object)null) { _baseJumpInterval = ((BaseAI)_monsterAI).m_jumpInterval; _baseAttackInterval = _monsterAI.m_minAttackInterval; } Transform val = ((Component)this).transform.Find("BiomeLords_Aura"); if ((Object)(object)val != (Object)null) { _auraLight = ((Component)val).GetComponent(); if ((Object)(object)_auraLight != (Object)null) { _auraOrigColor = _auraLight.color; _auraOrigIntensity = _auraLight.intensity; _auraOrigRange = _auraLight.range; } } _nextBatSummonTime = Time.time + 15f; _nextVampTime = Time.time + 10f; _nextInvisTime = Time.time + 20f; } private void Update() { if (!((Object)(object)_nview == (Object)null) && _nview.IsValid() && _nview.IsOwner() && !((Object)(object)_character == (Object)null) && !_character.IsDead()) { TryFrenzy(); TryBatSummon(); TryVampiricStrike(); TryInvisibility(); TickFrenzyAura(); } } private void TryFrenzy() { //IL_00ab: 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) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //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) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) if (!_frenzied && !(_character.GetHealth() / _character.GetMaxHealth() > 0.3f)) { _frenzied = true; _character.m_speed = _baseSpeed * 1.5f; _character.m_runSpeed = _baseRunSpeed * 1.5f; if ((Object)(object)_monsterAI != (Object)null) { ((BaseAI)_monsterAI).m_jumpInterval = _baseJumpInterval * 0.2f; _monsterAI.m_minAttackInterval = _baseAttackInterval * 0.3f; } ApplyFrenzyAttackBias(); UpdateAura(); Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_corpse_destruction_small", val); FxLibrary.TrySpawn("fx_redlightning_burst", val); for (int i = 0; i < 8; i++) { float num = (float)i * 45f; Vector3 val2 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.4f; FxLibrary.TrySpawn("vfx_HitSparks", val + val2); } Logger.LogInfo((object)"[BiomeLords] Fenring Lord entered Blood Frenzy."); } } private void TryBatSummon() { if (!(Time.time < _nextBatSummonTime)) { if (CountNearbyBats() >= 4) { _nextBatSummonTime = Time.time + 15f; return; } PlayTaunt(); SpawnBats(2); _nextBatSummonTime = Time.time + 60f; } } private void TryVampiricStrike() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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) if (!_frenzied && !IsVampActive && !(Time.time < _nextVampTime) && !(_character.GetHealth() / _character.GetMaxHealth() > 0.8f)) { _vampEndTime = Time.time + 60f; _nextVampTime = _vampEndTime + 40f; Vector3 pos = ((Component)this).transform.position + Vector3.up * 1.5f; FxLibrary.TrySpawn("fx_GP_Activation", pos); UpdateAura(); ((MonoBehaviour)this).StartCoroutine(VampExpireCoroutine()); Logger.LogInfo((object)"[BiomeLords] Fenring Lord activated Vampiric Strike."); } } private IEnumerator VampExpireCoroutine() { yield return (object)new WaitForSeconds(60f); UpdateAura(); } private void TryInvisibility() { //IL_004b: 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_0060: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextInvisTime || _character.GetHealth() / _character.GetMaxHealth() > 0.6f) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude > 400f)) { _nextInvisTime = Time.time + 60f; ((MonoBehaviour)this).StartCoroutine(InvisibilityRoutine()); } } } private IEnumerator InvisibilityRoutine() { PlayTaunt(); SpawnBats(2); Vector3 pos = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_mist_puff", pos); FxLibrary.TrySpawn("vfx_spawn", pos); yield return (object)new WaitForSeconds(1f); Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(false); List hidden = new List(componentsInChildren.Length); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { if (!(val is ParticleSystemRenderer)) { val.enabled = false; hidden.Add(val); } } yield return (object)new WaitForSeconds(12f); foreach (Renderer item in hidden) { if ((Object)(object)item != (Object)null) { item.enabled = true; } } FxLibrary.TrySpawn("vfx_spawn", ((Component)this).transform.position + Vector3.up * 1f); } private void TickFrenzyAura() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0047: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (_frenzied && !(Time.time < _nextFrenzyPulse)) { _nextFrenzyPulse = Time.time + 0.5f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_HitSparks", val); if (Random.value < 0.4f) { FxLibrary.TrySpawn("fx_redlightning_burst", val + Vector3.up * 0.3f); } } } private void ApplyFrenzyAttackBias() { Humanoid component = ((Component)this).GetComponent(); if (!((Object)(object)component == (Object)null) && !(BiasArray(component.m_defaultItems) | BiasArray(component.m_randomWeapon))) { Logger.LogWarning((object)"[BiomeLords] Fenring Lord frenzy: no jump-attack item found — attack bias not applied. Check the attack-animation names in the log."); } } private static bool BiasArray(GameObject[] items) { if (items == null || items.Length == 0) { return false; } bool flag = false; GameObject[] array = items; foreach (GameObject val in array) { if ((Object)(object)val != (Object)null && IsJumpAttack(val)) { flag = true; break; } } if (!flag) { return false; } array = items; foreach (GameObject val2 in array) { if ((Object)(object)val2 == (Object)null) { continue; } SharedData val3 = val2.GetComponent()?.m_itemData?.m_shared; if (val3 != null) { if (IsJumpAttack(val2)) { val3.m_aiAttackInterval = Mathf.Max(0.5f, val3.m_aiAttackInterval * 0.15f); val3.m_aiPrioritized = true; } else { val3.m_aiAttackInterval *= 5f; val3.m_aiPrioritized = false; } } } return true; } private static bool IsJumpAttack(GameObject go) { return ((Object)go).name.IndexOf("jump", StringComparison.OrdinalIgnoreCase) >= 0; } private void UpdateAura() { //IL_002c: 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_0074: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_auraLight == (Object)null)) { if (_frenzied) { _auraLight.color = new Color(1f, 0.15f, 0.1f); _auraLight.intensity = 4f; _auraLight.range = 6.5f; } else if (IsVampActive) { _auraLight.color = new Color(0.75f, 0f, 0.15f); _auraLight.intensity = 3.5f; _auraLight.range = 5.5f; } else { _auraLight.color = _auraOrigColor; _auraLight.intensity = _auraOrigIntensity; _auraLight.range = _auraOrigRange; } } } private void SpawnBats(int requested) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) EnsurePrefabs(); if (!((Object)(object)_cachedBat == (Object)null)) { int num = CountNearbyBats(); int num2 = Math.Min(requested, 4 - num); for (int i = 0; i < num2; i++) { float num3 = (float)i * (360f / (float)Math.Max(1, num2)) + Random.Range(-25f, 25f); Vector3 val = Quaternion.Euler(0f, num3, 0f) * Vector3.forward; Vector3 val2 = ((Component)this).transform.position + val * 3f + Vector3.up * 1.5f; Object.Instantiate(_cachedBat, val2, Quaternion.LookRotation(-val)); FxLibrary.TrySpawn("vfx_spawn", val2); } } } private int CountNearbyBats() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) int num = 0; Vector3 position = ((Component)this).transform.position; float num2 = 256f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)_character) && !val.IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num2) && ((Object)((Component)val).gameObject).name.StartsWith("Bat")) { num++; } } } return num; } private void PlayTaunt() { Animator animator = _animator; if (animator != null) { animator.SetTrigger("Taunt"); } } private static void EnsurePrefabs() { if ((Object)(object)_cachedBat == (Object)null) { _cachedBat = PrefabManager.Instance.GetPrefab("Bat"); } } } public static class ForestEmbraceService { private const float TickSeconds = 3f; private const float TreeRadius = 3f; private const float MonsterCheckRadius = 30f; private const float SitSecondsRequired = 60f; private static float _nextTick; private static int _embraceHash; private static float _sitSecondsAccumulated; private static readonly (string prefix, int heal, int comfort)[] TreeTable = new(string, int, int)[10] { ("CharredTree", 6, 3), ("Yggashoot", 5, 3), ("YggaShoot", 5, 3), ("SwampTree", 4, 1), ("Oak", 3, 2), ("Pine", 2, 1), ("FirTree", 2, 1), ("Fir", 2, 1), ("Beech", 1, 1), ("Birch", 1, 1) }; private static StatusEffect _restedTemplate; private static int _sittingHash; private static int _restedHash; private static FieldInfo _comfortLevelField; public static int CurrentTreeComfort { get; private set; } public static bool IsNearQualifyingTree { get; private set; } public static void Tick() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextTick) { return; } _nextTick = Time.time + 3f; CurrentTreeComfort = 0; IsNearQualifyingTree = false; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null) { return; } if (_embraceHash == 0) { _embraceHash = StringExtensionMethods.GetStableHashCode("GP_ForestsEmbrace"); } if (!sEMan.HaveStatusEffect(_embraceHash)) { _sitSecondsAccumulated = 0f; RemoveSitting(sEMan); if (LordConfig.DebugLogging != null && LordConfig.DebugLogging.Value && localPlayer.GetGuardianPowerName() == "GP_ForestsEmbrace" && localPlayer.m_guardianPowerCooldown > 0f) { Logger.LogInfo((object)"[BiomeLords] ForestEmbrace: GP equipped + on cooldown but marker SE missing from SEMan."); } return; } var (num, num2) = FindStrongestTreeNearby(((Component)localPlayer).transform.position); if (num <= 0) { _sitSecondsAccumulated = 0f; RemoveSitting(sEMan); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)"[BiomeLords] ForestEmbrace: SE active, no tree within 3m."); } return; } IsNearQualifyingTree = true; if (AnyHostileWithin(((Component)localPlayer).transform.position, 30f, localPlayer)) { _sitSecondsAccumulated = 0f; RemoveSitting(sEMan); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)$"[BiomeLords] ForestEmbrace: tree found (heal={num}, comfort={num2}) but hostile within 30m."); } return; } if (!((Character)localPlayer).InEmote() && !((Character)localPlayer).IsAttached()) { _sitSecondsAccumulated = 0f; RemoveSitting(sEMan); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)"[BiomeLords] ForestEmbrace: sheltered but not seated. Sit to heal and earn Rested."); } return; } ((Character)localPlayer).Heal((float)num, false); FxLibrary.TrySpawn("vfx_lootspawn", ((Component)localPlayer).transform.position + Vector3.up * 0.5f); _sitSecondsAccumulated += 3f; if (_sitSecondsAccumulated < 60f) { ApplySitting(sEMan); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)$"[BiomeLords] ForestEmbrace: sitting {_sitSecondsAccumulated:F0}/{60f:F0}s, healed {num}."); } return; } RemoveSitting(sEMan); CurrentTreeComfort = num2; ApplyVanillaRested(localPlayer, sEMan, num2); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)$"[BiomeLords] ForestEmbrace tick: healed {num}, comfort+={num2}, Rested applied."); } } private static void ApplySitting(SEMan seman) { if (SubEffectFactory.ByName.TryGetValue("SE_ForestSitting", out var value) && !((Object)(object)value == (Object)null)) { SubEffectFactory.EnsureIcon(value, "Rested"); seman.AddStatusEffect(value, true, 0, 0f); } } private static void RemoveSitting(SEMan seman) { if (_sittingHash == 0) { _sittingHash = StringExtensionMethods.GetStableHashCode("SE_ForestSitting"); } if (seman.HaveStatusEffect(_sittingHash)) { seman.RemoveStatusEffect(_sittingHash, false); } } private static void ApplyVanillaRested(Player p, SEMan seman, int treeComfort) { if ((Object)(object)_restedTemplate == (Object)null) { ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance == (Object)null) { return; } if (_restedHash == 0) { _restedHash = StringExtensionMethods.GetStableHashCode("Rested"); } _restedTemplate = instance.GetStatusEffect(_restedHash); if ((Object)(object)_restedTemplate == (Object)null) { Logger.LogWarning((object)"[BiomeLords] Could not find vanilla 'Rested' SE in ObjectDB."); return; } } if (_comfortLevelField == null) { _comfortLevelField = AccessTools.Field(typeof(Player), "m_comfortLevel"); } if (_comfortLevelField != null) { int num = (int)(_comfortLevelField.GetValue(p) ?? ((object)0)); if (treeComfort > num) { _comfortLevelField.SetValue(p, treeComfort); } } seman.AddStatusEffect(_restedTemplate, true, 0, 0f); StatusEffect statusEffect = seman.GetStatusEffect(_restedHash); SE_Rested val = (SE_Rested)(object)((statusEffect is SE_Rested) ? statusEffect : null); if ((Object)(object)val != (Object)null) { float num2 = val.m_baseTTL + (float)treeComfort * val.m_TTLPerComfortLevel; if (((StatusEffect)val).m_ttl < num2) { ((StatusEffect)val).m_ttl = num2; } if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)$"[BiomeLords] Rested applied: m_ttl={((StatusEffect)val).m_ttl:F0}s (base {val.m_baseTTL}, +{treeComfort}*{val.m_TTLPerComfortLevel})."); } } else if (LordConfig.DebugLogging.Value) { Logger.LogWarning((object)"[BiomeLords] Rested apply returned null — SEMan rejected."); } } private static bool AnyHostileWithin(Vector3 center, float r, Player self) { //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) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) float num = r * r; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !val.IsDead() && !((Object)(object)val == (Object)(object)self) && !(val is Player) && !val.IsTamed()) { Vector3 val2 = ((Component)val).transform.position - center; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { return true; } } } return false; } private static (int heal, int comfort) FindStrongestTreeNearby(Vector3 pos) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) int num = 0; int item = 0; Collider[] array = Physics.OverlapSphere(pos, 3f); foreach (Collider val in array) { if ((Object)(object)val == (Object)null) { continue; } string name = ((Object)((Component)val).transform.root).name; if (!IsMatureTree(name)) { continue; } (string, int, int)[] treeTable = TreeTable; for (int j = 0; j < treeTable.Length; j++) { (string, int, int) tuple = treeTable[j]; if (name.StartsWith(tuple.Item1)) { if (tuple.Item2 > num) { num = tuple.Item2; item = tuple.Item3; } break; } } } return (heal: num, comfort: item); } private static bool IsMatureTree(string rootName) { if (string.IsNullOrEmpty(rootName)) { return false; } StringComparison comparisonType = StringComparison.OrdinalIgnoreCase; if (rootName.IndexOf("Sapling", comparisonType) >= 0) { return false; } if (rootName.IndexOf("small", comparisonType) >= 0) { return false; } if (rootName.IndexOf("log", comparisonType) >= 0) { return false; } if (rootName.IndexOf("stub", comparisonType) >= 0) { return false; } if (rootName.IndexOf("stump", comparisonType) >= 0) { return false; } if (rootName.IndexOf("dead", comparisonType) >= 0) { return false; } return true; } } public class GreydwarfLordBrain : MonoBehaviour { private const float MinionCooldown = 60f; private const float MinionDetectRadius = 12f; private const int MaxNearbyMinions = 3; private const int MinionsPerSummon = 2; private const float RootCooldown = 40f; private const float RootLifetime = 30f; private const float RootMaxRange = 25f; private const float RootMinRange = 4f; private const int RootFrenzyCount = 3; private const float RootRingRadius = 5f; private const float RootRingJitter = 18f; private const float NovaPoisonBonus = 18f; private const float HealCooldown = 15f; private const float HealCastDelay = 0.6f; private const float HealAmount = 60f; private const float FrenzyHpFraction = 0.3f; private const float NovaHpFraction = 0.5f; private const float NovaRange = 10f; private const float FrenzySpeedFactor = 1.5f; private const string MinionPrefab = "Greydwarf"; private static readonly string[] RootPrefabCandidates = new string[4] { "TentaRoot", "gd_king_root", "gdking_root", "Root" }; private Character _character; private ZNetView _nview; private ZSyncAnimation _zanim; private float _baseSpeed; private float _baseRunSpeed; private bool _frenzied; private bool _novaFired; private float _nextMinionTime; private float _nextRootTime; private float _nextHealTime; private float _nextFrenzyPulse; private readonly List _activeRoots = new List(); private static GameObject _cachedMinion; private static GameObject _cachedRoot; private static string _healAnimTrigger; private static GameObject[] _healEffects; public static void ConfigureHeal(string animTrigger, GameObject[] effects) { _healAnimTrigger = animTrigger; _healEffects = effects; } private void Awake() { _character = ((Component)this).GetComponent(); _nview = ((Component)this).GetComponent(); _zanim = ((Component)this).GetComponent(); if ((Object)(object)_character != (Object)null) { _baseSpeed = _character.m_speed; _baseRunSpeed = _character.m_runSpeed; } _nextMinionTime = Time.time + 15f; _nextRootTime = Time.time + 8f; _nextHealTime = Time.time + 6f; } private void Update() { if (!((Object)(object)_nview == (Object)null) && _nview.IsValid() && _nview.IsOwner() && !((Object)(object)_character == (Object)null) && !_character.IsDead()) { TryPoisonNova(); TryFrenzy(); TrySummonMinions(); TryRootSpawn(); TryHealingResonance(); TickFrenzyAura(); } } private void TryPoisonNova() { //IL_0035: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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 (_novaFired || _character.GetHealth() / _character.GetMaxHealth() > 0.5f) { return; } _novaFired = true; Vector3 position = ((Component)this).transform.position; FxLibrary.TrySpawnTimed("vfx_blob_attack", position, 4f); FxLibrary.TrySpawnTimed("fx_gdking_rootspawn", position, 4f); if (!LordProfileRegistry.TryGet(_character, out var profile)) { LordAttackProfile.TryGet("greydwarf_lord", out profile); } profile.Poison += 18f; LordProfileRegistry.Set(_character, profile); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead()) { Vector3 val = ((Component)localPlayer).transform.position - position; if (((Vector3)(ref val)).sqrMagnitude < 100f) { ((Character)localPlayer).Message((MessageType)2, "The Shaman seethes.", 0, (Sprite)null); } } } private void TryFrenzy() { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) if (_frenzied || _character.GetHealth() / _character.GetMaxHealth() > 0.3f) { return; } _frenzied = true; _character.m_speed = _baseSpeed * 1.5f; _character.m_runSpeed = _baseRunSpeed * 1.5f; Color val = default(Color); ((Color)(ref val))..ctor(0.45f, 1f, 0.2f, 1f); Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val2 in materials) { if (!((Object)(object)val2 == (Object)null)) { if (val2.HasProperty("_Color")) { val2.color = val; } if (val2.HasProperty("_EmissionColor")) { val2.SetColor("_EmissionColor", val * 0.9f); } } } } Vector3 val3 = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_gdking_stomp", val3); FxLibrary.TrySpawn("vfx_corpse_destruction_small", val3); FxLibrary.TrySpawn("fx_redlightning_burst", val3); for (int k = 0; k < 6; k++) { float num = (float)k * 60f; Vector3 val4 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.2f; FxLibrary.TrySpawn("vfx_HitSparks", val3 + val4); } Logger.LogInfo((object)"[BiomeLords] Greydwarf Shaman Lord entered frenzy."); } private void TrySummonMinions() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextMinionTime) { return; } int num = CountNearbyMinions(); if (num >= 3) { _nextMinionTime = Time.time + 15f; return; } EnsurePrefabs(); if (!((Object)(object)_cachedMinion == (Object)null)) { int num2 = Math.Min(2, 3 - num); for (int i = 0; i < num2; i++) { float num3 = (float)i * (360f / (float)Math.Max(1, num2)) + Random.Range(-25f, 25f); Vector3 val = Quaternion.Euler(0f, num3, 0f) * Vector3.forward; Vector3 val2 = ((Component)this).transform.position + val * 3.5f + Vector3.up * 0.2f; Object.Instantiate(_cachedMinion, val2, Quaternion.LookRotation(-val)); FxLibrary.TrySpawn("vfx_spawn", val2); } _nextMinionTime = Time.time + 60f; } } private void TryRootSpawn() { //IL_0049: 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_0089: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextRootTime) { return; } if (!_frenzied) { PruneActiveRoots(); if (_activeRoots.Count > 0) { return; } } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position); if (!(num < 4f) && !(num > 25f)) { _nextRootTime = Time.time + 40f; ((MonoBehaviour)this).StartCoroutine(RootSpawnRoutine(((Component)localPlayer).transform.position, _frenzied)); } } } private IEnumerator RootSpawnRoutine(Vector3 targetPos, bool frenzy) { //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) FxLibrary.TrySpawn("fx_gdking_rootspawn", targetPos); yield return (object)new WaitForSeconds(0.6f); EnsurePrefabs(); if ((Object)(object)_cachedRoot == (Object)null) { yield break; } int num = ((!frenzy) ? 1 : 3); float num2 = Random.Range(0f, 360f); float y = default(float); for (int i = 0; i < num; i++) { Vector3 val2; if (frenzy) { float num3 = num2 + (float)i * (360f / (float)num) + Random.Range(-18f, 18f); Vector3 val = Quaternion.Euler(0f, num3, 0f) * Vector3.forward; val2 = targetPos + val * 5f; } else { val2 = targetPos; } if ((Object)(object)ZoneSystem.instance != (Object)null && ZoneSystem.instance.GetGroundHeight(val2, ref y)) { val2.y = y; } FxLibrary.TrySpawn("vfx_gdking_stomp", val2); FxLibrary.TrySpawn("fx_greenroots_projectile_hit", val2); GameObject val3 = Object.Instantiate(_cachedRoot, val2, Quaternion.identity); _activeRoots.Add(val3); ((MonoBehaviour)this).StartCoroutine(DespawnRootAfter(val3, 30f)); Logger.LogInfo((object)$"[BiomeLords] Greydwarf Lord spawned root '{((Object)_cachedRoot).name}' at {val2}."); } } private void PruneActiveRoots() { _activeRoots.RemoveAll((GameObject r) => (Object)(object)r == (Object)null || !r.activeInHierarchy); } private IEnumerator DespawnRootAfter(GameObject root, float delay) { yield return (object)new WaitForSeconds(delay); if ((Object)(object)root != (Object)null) { _activeRoots.Remove(root); Object.Destroy((Object)(object)root); } } private void TryHealingResonance() { if (!_frenzied && !(Time.time < _nextHealTime)) { _nextHealTime = Time.time + 15f; ((MonoBehaviour)this).StartCoroutine(HealRoutine()); } } private IEnumerator HealRoutine() { if ((Object)(object)_zanim != (Object)null && !string.IsNullOrEmpty(_healAnimTrigger)) { _zanim.SetTrigger(_healAnimTrigger); } yield return (object)new WaitForSeconds(0.6f); if ((Object)(object)_character == (Object)null || _character.IsDead()) { yield break; } SpawnHealEffects(((Component)this).transform.position + Vector3.up * 1.2f); if (_character.GetHealth() < _character.GetMaxHealth()) { _character.Heal(60f, true); } Vector3 position = ((Component)this).transform.position; float num = 144f; int num2 = 0; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)_character) && !val.IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num) && ((Object)((Component)val).gameObject).name.StartsWith("Greydwarf") && !(val.GetHealth() >= val.GetMaxHealth())) { val.Heal(60f, true); SpawnHealEffects(((Component)val).transform.position + Vector3.up * 0.5f); num2++; } } } if (LordConfig.DebugLogging != null && LordConfig.DebugLogging.Value) { Logger.LogInfo((object)$"[BiomeLords] Greydwarf Lord Healing Resonance: healed {num2} greydwarf(s) + self-check for {60f}."); } } private void SpawnHealEffects(Vector3 pos) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (_healEffects == null) { return; } GameObject[] healEffects = _healEffects; foreach (GameObject val in healEffects) { if (!((Object)(object)val == (Object)null)) { GameObject val2 = Object.Instantiate(val, pos, Quaternion.identity); Aoe[] componentsInChildren = val2.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren.Length; j++) { Object.Destroy((Object)(object)componentsInChildren[j]); } Projectile[] componentsInChildren2 = val2.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { Object.Destroy((Object)(object)componentsInChildren2[j]); } Object.Destroy((Object)(object)val2, 6f); } } } private void TickFrenzyAura() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0047: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (_frenzied && !(Time.time < _nextFrenzyPulse)) { _nextFrenzyPulse = Time.time + 0.4f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_HitSparks", val); if (Random.value < 0.4f) { FxLibrary.TrySpawn("fx_redlightning_burst", val + Vector3.up * 0.3f); } } } private int CountNearbyMinions() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) int num = 0; Vector3 position = ((Component)this).transform.position; float num2 = 144f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)_character) && !val.IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num2) && ((Object)((Component)val).gameObject).name.StartsWith("Greydwarf")) { num++; } } } return num; } private static void EnsurePrefabs() { if ((Object)(object)_cachedMinion == (Object)null) { _cachedMinion = PrefabManager.Instance.GetPrefab("Greydwarf"); } if (!((Object)(object)_cachedRoot == (Object)null)) { return; } string[] rootPrefabCandidates = RootPrefabCandidates; foreach (string text in rootPrefabCandidates) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); if ((Object)(object)prefab != (Object)null) { _cachedRoot = prefab; Logger.LogInfo((object)("[BiomeLords] Greydwarf Lord root prefab resolved: '" + text + "'.")); break; } } if ((Object)(object)_cachedRoot == (Object)null) { Logger.LogWarning((object)("[BiomeLords] Greydwarf Lord: no root prefab found among candidates [" + string.Join(", ", RootPrefabCandidates) + "] — Root Spawn disabled.")); } } } public static class HiveSightService { public const float Range = 80f; public const float RefreshInterval = 1f; public const float PulseInterval = 1.5f; private static int _gpHash; private static float _nextRefresh; private static float _nextPulse; private static readonly Dictionary Pins = new Dictionary(); private static MethodInfo _addPinMethod; private static bool _addPinResolved; public static void Tick() { if (_gpHash == 0) { _gpHash = StringExtensionMethods.GetStableHashCode("GP_HiveSense"); } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { ClearAll(); return; } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null || !sEMan.HaveStatusEffect(_gpHash)) { ClearAll(); return; } if (Time.time >= _nextRefresh) { _nextRefresh = Time.time + 1f; RefreshPins(localPlayer); } if (Time.time >= _nextPulse) { _nextPulse = Time.time + 1.5f; PulseSparks(localPlayer); } } private static void RefreshPins(Player p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)p).transform.position; float num = 6400f; Minimap instance = Minimap.instance; if ((Object)(object)instance == (Object)null) { return; } List allCharacters = Character.GetAllCharacters(); HashSet hashSet = new HashSet(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!IsRelevantHostile(val, p)) { continue; } Vector3 val2 = ((Component)val).transform.position - position; if (((Vector3)(ref val2)).sqrMagnitude > num) { continue; } hashSet.Add(val); if (Pins.TryGetValue(val, out var value)) { value.m_pos = ((Component)val).transform.position; continue; } PinData val3 = AddPinViaReflection(instance, ((Component)val).transform.position); if (val3 != null) { Pins[val] = val3; } } List list = new List(); foreach (KeyValuePair pin in Pins) { Character key = pin.Key; if ((Object)(object)key == (Object)null || key.IsDead() || !hashSet.Contains(key)) { list.Add(key); } } for (int j = 0; j < list.Count; j++) { Character key2 = list[j]; if (Pins.TryGetValue(key2, out var value2) && value2 != null) { instance.RemovePin(value2); } Pins.Remove(key2); } } private static void PulseSparks(Player p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_005e: 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_006d: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)p).transform.position; float num = 6400f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (IsRelevantHostile(val, p)) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { FxLibrary.TrySpawn("vfx_HitSparks", ((Component)val).transform.position + Vector3.up * 1.4f); } } } } private static bool IsRelevantHostile(Character c, Player p) { if ((Object)(object)c == (Object)null || c.IsDead()) { return false; } if ((Object)(object)c == (Object)(object)p) { return false; } if (c.IsTamed()) { return false; } if (c.IsPlayer()) { return false; } if (!(c.GetBaseAI() is MonsterAI)) { return (Object)(object)c.GetBaseAI() != (Object)null; } return true; } private static PinData AddPinViaReflection(Minimap map, Vector3 pos) { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if (!_addPinResolved) { _addPinResolved = true; MethodInfo addPinMethod = null; int num = int.MaxValue; MethodInfo[] methods = typeof(Minimap).GetMethods(BindingFlags.Instance | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { if (!(methodInfo.Name != "AddPin")) { ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameters.Length >= 5 && !(parameters[0].ParameterType != typeof(Vector3)) && !(parameters[2].ParameterType != typeof(string)) && parameters.Length < num) { addPinMethod = methodInfo; num = parameters.Length; } } } _addPinMethod = addPinMethod; } if (_addPinMethod == null) { return null; } ParameterInfo[] parameters2 = _addPinMethod.GetParameters(); object[] array = new object[parameters2.Length]; array[0] = pos; array[1] = (object)(PinType)13; array[2] = ""; array[3] = false; array[4] = false; for (int j = 5; j < array.Length; j++) { Type parameterType = parameters2[j].ParameterType; if (parameters2[j].HasDefaultValue) { array[j] = parameters2[j].DefaultValue; } else if (parameterType.IsValueType) { array[j] = Activator.CreateInstance(parameterType); } else { array[j] = null; } } try { object? obj = _addPinMethod.Invoke(map, array); return (PinData)((obj is PinData) ? obj : null); } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] HiveSight AddPin failed: " + ex.Message)); return null; } } public static void ClearAll() { Minimap instance = Minimap.instance; if ((Object)(object)instance != (Object)null) { foreach (KeyValuePair pin in Pins) { if (pin.Value != null) { instance.RemovePin(pin.Value); } } } Pins.Clear(); } } public class HowlAura : MonoBehaviour { public float Lifetime = 60f; public Color AuraColor = new Color(1f, 0.4f, 0.1f); public float AuraIntensity = 2.5f; public float AuraRange = 2.5f; private float _spawnTime; private GameObject _auraGO; private int _gpHash; private void Awake() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_0108: Unknown result type (might be due to invalid IL or missing references) _spawnTime = Time.time; _gpHash = StringExtensionMethods.GetStableHashCode("GP_HowlOfThePack"); _auraGO = new GameObject("BiomeLords_HowlAura"); _auraGO.transform.SetParent(((Component)this).transform, false); _auraGO.transform.localPosition = new Vector3(0f, 0.8f, 0f); Light obj = _auraGO.AddComponent(); obj.type = (LightType)2; obj.color = AuraColor; obj.intensity = AuraIntensity; obj.range = AuraRange; string[] array = new string[3] { "fx_firepit", "vfx_firewisp", "fx_torch_basic" }; foreach (string text in array) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); if (!((Object)(object)prefab == (Object)null)) { GameObject obj2 = Object.Instantiate(prefab, _auraGO.transform); obj2.transform.localPosition = Vector3.zero; obj2.transform.localScale = Vector3.one * 0.4f; ((Object)obj2).name = "BiomeLords_HowlAuraFx"; ZNetView component = obj2.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } break; } } FxLibrary.TrySpawn("vfx_HitSparks", ((Component)this).transform.position + Vector3.up * 0.5f); } private void Update() { if (Time.time - _spawnTime >= Lifetime) { Cleanup(); return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { Cleanup(); return; } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null || !sEMan.HaveStatusEffect(_gpHash)) { Cleanup(); } } private void OnDestroy() { if ((Object)(object)_auraGO != (Object)null) { Object.Destroy((Object)(object)_auraGO); } } private void Cleanup() { if ((Object)(object)_auraGO != (Object)null) { Object.Destroy((Object)(object)_auraGO); } Object.Destroy((Object)(object)this); } } public class LoxLordBrain : MonoBehaviour { private const float BellowHpFraction = 0.5f; private const float BellowRadius = 15f; private const float BellowPushForce = 100f; private const float RageHpFraction = 0.3f; private const float RageSpeedFactor = 1.5f; private const float ShieldDetectRadius = 5f; private const float ShieldDuration = 2.5f; private const float ShieldInterCooldown = 18f; private const float UnyieldingHpFraction = 0.4f; private const float UnyieldingDuration = 5f; private const float UnyieldingHealFrac = 0.2f; private Character _character; private ZNetView _nview; private float _baseSpeed; private float _baseRunSpeed; private bool _bellowFired; private bool _raging; private float _nextRagePulse; private float _nextShieldTime; private float _shieldEndTime; private bool _unyieldingFired; private float _unyieldingEndTime; private float _unyieldingHealPerSecond; public bool IsShielded { get; private set; } public bool IsLastStand { get; private set; } private void Awake() { _character = ((Component)this).GetComponent(); _nview = ((Component)this).GetComponent(); if ((Object)(object)_character != (Object)null) { _baseSpeed = _character.m_speed; _baseRunSpeed = _character.m_runSpeed; } _nextShieldTime = Time.time + 6f; } private void Update() { if (!((Object)(object)_nview == (Object)null) && _nview.IsValid() && _nview.IsOwner() && !((Object)(object)_character == (Object)null) && !_character.IsDead()) { TryRoaringBellow(); TryRage(); TryUnyieldingBulwark(); TickUnyieldingBulwark(); TryShield(); TickShield(); TickRageAura(); } } private void TryRoaringBellow() { //IL_0035: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_00b5: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) if (_bellowFired || _character.GetHealth() / _character.GetMaxHealth() > 0.5f) { return; } _bellowFired = true; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("fx_Fader_Roar", val); FxLibrary.TrySpawn("fx_himminafl_aoe", val); FxLibrary.TrySpawn("vfx_corpse_destruction_small", val); for (int i = 0; i < 12; i++) { float num = (float)i * 30f; Vector3 val2 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 2.5f; FxLibrary.TrySpawn("vfx_HitSparks", val + val2); } float num2 = 225f; List allCharacters = Character.GetAllCharacters(); for (int j = 0; j < allCharacters.Count; j++) { Character obj = allCharacters[j]; Player val3 = (Player)(object)((obj is Player) ? obj : null); if (val3 != null && !((Character)val3).IsDead()) { Vector3 val4 = ((Component)val3).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val4)).sqrMagnitude > num2)) { HitData val5 = new HitData(); val5.m_pushForce = 100f; val5.m_point = ((Component)val3).transform.position; val5.m_dir = ((Vector3)(ref val4)).normalized; val5.m_hitType = (HitType)1; val5.m_blockable = true; val5.m_dodgeable = true; val5.SetAttacker(_character); ((Character)val3).Damage(val5); } } } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)2, "$biomelords_lox_bellow", 0, (Sprite)null); } Logger.LogInfo((object)"[BiomeLords] Lox Lord released Roaring Bellow."); } private void TryRage() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (_raging || _character.GetHealth() / _character.GetMaxHealth() > 0.3f) { return; } _raging = true; _character.m_speed = _baseSpeed * 1.5f; _character.m_runSpeed = _baseRunSpeed * 1.5f; Transform val = ((Component)this).transform.Find("BiomeLords_Aura"); if ((Object)(object)val != (Object)null) { Light component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.color = new Color(1f, 0.15f, 0.1f); component.intensity = 4.5f; component.range = 7.5f; } } Vector3 pos = ((Component)this).transform.position + Vector3.up * 1.2f; FxLibrary.TrySpawn("vfx_corpse_destruction_small", pos); FxLibrary.TrySpawn("fx_redlightning_burst", pos); Logger.LogInfo((object)"[BiomeLords] Lox Lord entered Rage."); } private void TryUnyieldingBulwark() { //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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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) if (!_unyieldingFired && !(_character.GetHealth() / _character.GetMaxHealth() > 0.4f)) { _unyieldingFired = true; IsLastStand = true; _unyieldingEndTime = Time.time + 5f; _unyieldingHealPerSecond = _character.GetMaxHealth() * 0.2f / 5f; _character.m_speed = 0f; _character.m_runSpeed = 0f; Vector3 pos = ((Component)this).transform.position + Vector3.up * 1.2f; FxLibrary.TrySpawn("fx_guardstone_activate", pos); FxLibrary.TrySpawn("vfx_corpse_destruction_small", pos); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)2, "$biomelords_lox_bulwark", 0, (Sprite)null); } Logger.LogInfo((object)"[BiomeLords] Lox Lord dug in for Unyielding Bulwark."); } } private void TickUnyieldingBulwark() { if (IsLastStand) { _character.m_speed = 0f; _character.m_runSpeed = 0f; if (_character.GetHealth() < _character.GetMaxHealth()) { _character.Heal(_unyieldingHealPerSecond * Time.deltaTime, false); } if (!(Time.time < _unyieldingEndTime)) { IsLastStand = false; _character.m_speed = (_raging ? (_baseSpeed * 1.5f) : _baseSpeed); _character.m_runSpeed = (_raging ? (_baseRunSpeed * 1.5f) : _baseRunSpeed); } } } private void TryShield() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (IsLastStand || IsShielded || Time.time < _nextShieldTime) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude > 25f)) { IsShielded = true; _shieldEndTime = Time.time + 2.5f; _nextShieldTime = _shieldEndTime + (_raging ? 10.8f : 18f); FxLibrary.TrySpawn("fx_guardstone_activate", ((Component)this).transform.position + Vector3.up * 1.2f); Logger.LogInfo((object)"[BiomeLords] Lox Lord raised Bone Bulwark."); } } } private void TickShield() { if (IsShielded && Time.time >= _shieldEndTime) { IsShielded = false; } } private void TickRageAura() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0047: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (_raging && !(Time.time < _nextRagePulse)) { _nextRagePulse = Time.time + 0.5f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_HitSparks", val); if (Random.value < 0.4f) { FxLibrary.TrySpawn("fx_redlightning_burst", val + Vector3.up * 0.3f); } } } } public class PhantomWolf : MonoBehaviour { public float Lifetime = 60f; public bool Invulnerable; private float _spawnTime; private ZNetView _nview; private void Awake() { _spawnTime = Time.time; _nview = ((Component)this).GetComponent(); } private void Update() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Player.m_localPlayer != (Object)null) || !(Time.time - _spawnTime < Lifetime)) { Vector3 pos = ((Component)this).transform.position + Vector3.up * 0.5f; FxLibrary.TrySpawn("vfx_corpse_destruction_small", pos); FxLibrary.TrySpawn("vfx_HitSparks", pos); Despawn(); } } private void Despawn() { if ((Object)(object)_nview != (Object)null && _nview.IsValid() && (Object)(object)ZNetScene.instance != (Object)null) { ZNetScene.instance.Destroy(((Component)this).gameObject); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class PlagueCloud : MonoBehaviour { public float Radius = 5f; public float Duration = 25f; public float PoisonPerSecond = 5f; public float TickInterval = 1f; public float VisualInterval = 0.5f; public Character Attacker; private float _spawnTime; private float _nextTick; private float _nextVisual; private void Awake() { _spawnTime = Time.time; _nextTick = Time.time + TickInterval; _nextVisual = Time.time; } private void Update() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_010a: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) if (Time.time - _spawnTime >= Duration) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } if (Time.time >= _nextVisual) { _nextVisual = Time.time + VisualInterval; FxLibrary.TrySpawnTimed("vfx_blob_attack", ((Component)this).transform.position, 3f); if (Random.value < 0.3f) { FxLibrary.TrySpawnTimed("vfx_blob_attack", ((Component)this).transform.position + Vector3.up * 0.6f, 4f); } } if (!(Time.time >= _nextTick)) { return; } _nextTick = Time.time + TickInterval; Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { float num = Radius * Radius; Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude > num)) { HitData val2 = new HitData(); val2.m_damage.m_poison = PoisonPerSecond * TickInterval; val2.m_point = ((Component)this).transform.position; val2.m_hitType = (HitType)1; val2.m_blockable = true; val2.m_dodgeable = true; ((Character)localPlayer).Damage(val2); } } } } public static class PowerEffectsService { private static int _tidesHash; private static int _howlHash; private static StatusEffect _lastSeenHowlMarker; private const float SwimStaminaPerSecond = 25f; private static float _nextRipple; private const float HowlPackRange = 30f; private const float HowlAuraLifetime = 60f; private const float HowlAuraSynergyLife = 120f; private static int _packBlessingHash; public static int TidesHash { get { EnsureHashes(); return _tidesHash; } } public static void Tick() { EnsureHashes(); Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan != null) { TickTidesGrace(localPlayer, sEMan); TickHowlOfThePack(localPlayer, sEMan); HiveSightService.Tick(); ValkyrieRallyService.Tick(); } } } private static void TickHowlOfThePack(Player p, SEMan seman) { StatusEffect statusEffect = seman.GetStatusEffect(_howlHash); if ((Object)(object)statusEffect == (Object)null) { if ((Object)(object)_lastSeenHowlMarker != (Object)null) { _lastSeenHowlMarker = null; } } else { if ((Object)(object)statusEffect == (Object)(object)_lastSeenHowlMarker) { return; } _lastSeenHowlMarker = statusEffect; if (_packBlessingHash == 0) { _packBlessingHash = StringExtensionMethods.GetStableHashCode("SE_FenringLordSpirit"); } bool flag = seman.HaveStatusEffect(_packBlessingHash); float num = (flag ? 120f : 60f); EmpowerNearbyTames(p, num); int num2 = 1; if (flag) { float num3 = (((Object)(object)((Character)p).GetSkills() != (Object)null) ? ((Character)p).GetSkills().GetSkillLevel((SkillType)10) : 0f); if (num3 >= 100f) { num2 = 3; } else if (num3 >= 50f) { num2 = 2; } } SpawnPhantomPack(p, num, num2, flag); string text = (flag ? "$gp_howlofthepack_phantom_synergy" : "$gp_howlofthepack_phantom"); ((Character)p).Message((MessageType)2, text, 0, (Sprite)null); Logger.LogInfo((object)($"[BiomeLords] Howl of the Pack: pack rallied (synergy={flag}, " + $"wolves={num2}, invuln={flag}, lifetime={num:F0}s).")); } } private static void EmpowerNearbyTames(Player p, float lifetime) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)p).transform.position; float num = 900f; List allCharacters = Character.GetAllCharacters(); int num2 = 0; int num3 = 0; for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if ((Object)(object)val == (Object)null || val.IsDead() || !val.IsTamed() || val.IsPlayer()) { continue; } Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { float num4 = val.GetMaxHealth() - val.GetHealth(); if (num4 > 0f) { val.Heal(num4, true); num2++; } if ((Object)(object)((Component)val).GetComponent() == (Object)null) { ((Component)val).gameObject.AddComponent().Lifetime = lifetime; num3++; } } } if (num2 + num3 > 0) { Logger.LogInfo((object)$"[BiomeLords] Howl of the Pack: healed {num2} tames, marked {num3}."); } } private static void SpawnPhantomPack(Player p, float lifetime, int count, bool invulnerable) { GameObject prefab = PrefabManager.Instance.GetPrefab("Wolf"); if ((Object)(object)prefab == (Object)null) { Logger.LogWarning((object)"[BiomeLords] Howl of the Pack: Wolf prefab not found."); return; } for (int i = 0; i < count; i++) { SpawnPhantomWolf(p, prefab, lifetime, invulnerable, count, i); } } private static void SpawnPhantomWolf(Player p, GameObject wolfPrefab, float lifetime, bool invulnerable, int count, int index) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) float num = ((count > 1) ? ((float)index - (float)(count - 1) * 0.5f) : 0f); Vector3 val = ((Component)p).transform.position + ((Component)p).transform.right * (1.5f + num) + ((Component)p).transform.forward * 0.5f + Vector3.up * 0.3f; GameObject obj = Object.Instantiate(wolfPrefab, val, Quaternion.LookRotation(((Component)p).transform.forward)); ((Object)obj).name = "PhantomWolf"; ZNetView component = obj.GetComponent(); if ((Object)(object)component != (Object)null && component.IsValid()) { component.GetZDO().Persistent = false; } Character component2 = obj.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.SetTamed(true); component2.m_name = "$enemy_phantomwolf"; } Humanoid component3 = obj.GetComponent(); if ((Object)(object)component3 != (Object)null) { ((Character)component3).m_name = "$enemy_phantomwolf"; } Tameable component4 = obj.GetComponent(); if ((Object)(object)component4 != (Object)null) { component4.m_commandable = false; } Procreation component5 = obj.GetComponent(); if ((Object)(object)component5 != (Object)null) { Object.Destroy((Object)(object)component5); } MonsterAI component6 = obj.GetComponent(); if ((Object)(object)component6 != (Object)null) { component6.SetFollowTarget(((Component)p).gameObject); } ApplyPhantomTint(obj); HowlAura howlAura = obj.AddComponent(); howlAura.Lifetime = lifetime; howlAura.AuraColor = new Color(0.55f, 0.35f, 1f); howlAura.AuraIntensity = 4f; howlAura.AuraRange = 4f; PhantomWolf phantomWolf = obj.AddComponent(); phantomWolf.Lifetime = lifetime; phantomWolf.Invulnerable = invulnerable; FxLibrary.TrySpawn("vfx_HitSparks", val + Vector3.up * 0.5f); FxLibrary.TrySpawn("fx_redlightning_burst", val); } private static void ApplyPhantomTint(GameObject go) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(0.55f, 0.35f, 1f, 1f); Renderer[] componentsInChildren = go.GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren) { Material[] sharedMaterials = val2.sharedMaterials; if (sharedMaterials == null || sharedMaterials.Length == 0) { continue; } Material[] array = (Material[])(object)new Material[sharedMaterials.Length]; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null)) { Material val3 = new Material(sharedMaterials[j]); if (val3.HasProperty("_Color")) { val3.color = val; } if (val3.HasProperty("_EmissionColor")) { val3.SetColor("_EmissionColor", val * 0.5f); } array[j] = val3; } } val2.sharedMaterials = array; } } private static void TickTidesGrace(Player p, SEMan seman) { if (seman.HaveStatusEffect(_tidesHash) && ((Character)p).IsSwimming()) { ((Character)p).AddStamina(25f * Time.deltaTime); PulseRipple(p); } } private static void PulseRipple(Player p) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!(Time.time < _nextRipple)) { _nextRipple = Time.time + 0.8f; FxLibrary.TrySpawn("vfx_MeadSplash", ((Component)p).transform.position); } } private static void EnsureHashes() { if (_tidesHash == 0) { _tidesHash = StringExtensionMethods.GetStableHashCode("GP_TidesGrace"); } if (_howlHash == 0) { _howlHash = StringExtensionMethods.GetStableHashCode("GP_HowlOfThePack"); } } } public class SeekerLordBrain : MonoBehaviour { private const float AcidSpitCooldown = 24f; private const float SpitTriggerRange = 22f; private const float SpitRadius = 3.5f; private const float SpitHpThreshold = 0.8f; private const float SpitInaccuracy = 4f; private const float FacingDotThreshold = 0.55f; private const float FlightAscendDuration = 1.3f; private const float FlightHoverDuration = 7f; private const float FlightDescendDuration = 1.1f; private const float VolleyInterval = 2.2f; private const float HoverStandoffDistance = 16f; private const float HoverStandoffTolerance = 2.5f; private const float MaxRepositionTime = 2.5f; private const float ProjectileSize = 0.6f; private const float ProjectileTravelTime = 0.7f; private const float ProjectileArcHeight = 2f; private const float BurrowHpThreshold = 0.6f; private const float BurrowCooldown = 22f; private const float BurrowMinRange = 6f; private const float BurrowMaxRange = 25f; private const float BurrowTelegraph = 0.6f; private const float BurrowTravelSpeed = 13f; private const float BurrowTravelMaxTime = 1.8f; private const float BurrowArriveDist = 2.5f; private const float EruptTelegraph = 0.4f; private const float EruptRadius = 4f; private const float EruptPushForce = 50f; private const float MinionCooldown = 60f; private const int MaxNearbyMinions = 3; private const int MinionsPerSummon = 2; private const float MinionDetectRadius = 16f; private const string MinionPrefab = "SeekerBrood"; private const float FrenzyHpFraction = 0.3f; private const float FrenzySpeedFactor = 1.5f; private static readonly string[] QueenSpitImpactNames = new string[2] { "vfx_blob_attack", "vfx_HitSparks" }; private Character _character; private ZNetView _nview; private MonsterAI _monsterAI; private float _baseSpeed; private float _baseRunSpeed; private bool _frenzied; private bool _inSpecial; private float _nextSpitTime; private float _nextBurrowTime; private float _nextMinionTime; private float _nextFrenzyPulse; private static GameObject _cachedMinion; private static readonly Color AcidGreen = new Color(0.55f, 0.85f, 0.15f, 1f); private static readonly Color AcidGreenDark = new Color(0.2f, 0.4f, 0.05f, 1f); private static Material _acidMaterial; private static bool _spitAssetsResolved; private static EffectList _spitLaunchEffects; private static EffectList _spitHitEffects; private void Awake() { _character = ((Component)this).GetComponent(); _nview = ((Component)this).GetComponent(); _monsterAI = ((Component)this).GetComponent(); if ((Object)(object)_character != (Object)null) { _baseSpeed = _character.m_speed; _baseRunSpeed = _character.m_runSpeed; } _nextSpitTime = Time.time + 6f; _nextBurrowTime = Time.time + 12f; _nextMinionTime = Time.time + 15f; } private void Update() { if (!((Object)(object)_nview == (Object)null) && _nview.IsValid() && _nview.IsOwner() && !((Object)(object)_character == (Object)null) && !_character.IsDead()) { TryFrenzy(); TryAcidSpit(); TryBurrowAmbush(); TrySummonBrood(); TickFrenzyAura(); } } private float HealthFrac() { float maxHealth = _character.GetMaxHealth(); if (!(maxHealth > 0f)) { return 1f; } return _character.GetHealth() / maxHealth; } private void TryFrenzy() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (_frenzied || HealthFrac() > 0.3f) { return; } _frenzied = true; _character.m_speed = _baseSpeed * 1.5f; _character.m_runSpeed = _baseRunSpeed * 1.5f; Transform val = ((Component)this).transform.Find("BiomeLords_Aura"); if ((Object)(object)val != (Object)null) { Light component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.color = new Color(1f, 0.15f, 0.1f); component.intensity = 4.5f; component.range = 7.5f; } } Vector3 pos = ((Component)this).transform.position + Vector3.up * 1.2f; FxLibrary.TrySpawn("vfx_corpse_destruction_small", pos); FxLibrary.TrySpawn("fx_redlightning_burst", pos); Logger.LogInfo((object)"[BiomeLords] Seeker Lord entered Hive Frenzy."); } private void TryAcidSpit() { //IL_0043: 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) if (!_inSpecial && !(HealthFrac() >= 0.8f) && !(Time.time < _nextSpitTime)) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead() && !(Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position) > 22f) && (!((Object)(object)_monsterAI != (Object)null) || ((BaseAI)_monsterAI).CanSeeTarget((Character)(object)localPlayer))) { _nextSpitTime = Time.time + (_frenzied ? 14.400001f : 24f); ((MonoBehaviour)this).StartCoroutine(AerialAcidSpitRoutine()); } } } private IEnumerator AerialAcidSpitRoutine() { _inSpecial = true; if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = false; } _character.TakeOff(); float t = 0f; Vector3 val; while (t < 1.3f) { Character character = _character; val = StandoffSeekDir() * 0.7f + Vector3.up; character.SetMoveDir(((Vector3)(ref val)).normalized); t += Time.deltaTime; yield return null; } float repo = 0f; while (repo < 2.5f && !AtStandoff()) { _character.SetMoveDir(StandoffSeekDir()); repo += Time.deltaTime; yield return null; } float hoverElapsed = 0f; float nextVolley = 0f; float hoverDuration = (_frenzied ? 4.2000003f : 7f); float volleyInterval = (_frenzied ? 1.32f : 2.2f); while (hoverElapsed < hoverDuration && _character.IsFlying()) { Vector3 val2 = StandoffSeekDir(); _character.SetMoveDir(val2 * 0.6f); if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { FacePlayerHorizontally(); } if (hoverElapsed >= nextVolley) { nextVolley = hoverElapsed + volleyInterval; Player localPlayer = Player.m_localPlayer; if (_character.IsFlying() && (Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead() && ((Object)(object)_monsterAI == (Object)null || ((BaseAI)_monsterAI).CanSeeTarget((Character)(object)localPlayer)) && !TooCloseToSpit(localPlayer) && IsFacingPlayer(localPlayer)) { ((MonoBehaviour)this).StartCoroutine(SpitVolley(((Component)this).transform.position, ((Component)localPlayer).transform.position)); } } hoverElapsed += Time.deltaTime; yield return null; } t = 0f; while (t < 1.1f) { Character character2 = _character; val = StandoffSeekDir() * 0.2f + Vector3.down; character2.SetMoveDir(((Vector3)(ref val)).normalized); t += Time.deltaTime; yield return null; } _character.Land(); if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = true; } _inSpecial = false; } private bool AtStandoff() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return true; } Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; val.y = 0f; return ((Vector3)(ref val)).magnitude >= 13.5f; } private bool TooCloseToSpit(Player target) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)target).transform.position - ((Component)this).transform.position; val.y = 0f; return ((Vector3)(ref val)).magnitude < 11f; } private void FacePlayerHorizontally() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude < 0.01f)) { ((Component)this).transform.rotation = Quaternion.RotateTowards(((Component)this).transform.rotation, Quaternion.LookRotation(((Vector3)(ref val)).normalized), 360f * Time.deltaTime); } } } private bool IsFacingPlayer(Player target) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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) //IL_001b: 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_0045: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)target).transform.position - ((Component)this).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { return true; } return Vector3.Dot(((Component)this).transform.forward, ((Vector3)(ref val)).normalized) >= 0.55f; } private Vector3 StandoffSeekDir() { //IL_001b: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005a: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return Vector3.zero; } Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; val.y = 0f; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude < 0.01f) { return Vector3.zero; } Vector3 val2 = val / magnitude; if (magnitude > 18.5f) { return val2; } if (magnitude < 13.5f) { return -val2; } return Vector3.zero; } private IEnumerator SpitVolley(Vector3 sourcePos, Vector3 targetPos) { //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) //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) Vector2 val = Random.insideUnitCircle * 4f; targetPos += new Vector3(val.x, 0f, val.y); ResolveSpitAssets(); FxLibrary.TrySpawn("vfx_seeker_attack", sourcePos); if (_spitLaunchEffects != null) { _spitLaunchEffects.Create(sourcePos, Quaternion.identity, (Transform)null, 1f, -1); } GameObject proj = BuildSpitProjectile(sourcePos); float t = 0f; while (t < 0.7f) { if ((Object)(object)proj != (Object)null) { float num = t / 0.7f; Vector3 position = Vector3.Lerp(sourcePos, targetPos, num); position.y += Mathf.Sin(num * MathF.PI) * 2f; proj.transform.position = position; } t += Time.deltaTime; yield return null; } if ((Object)(object)proj != (Object)null) { Object.Destroy((Object)(object)proj); } if (_spitHitEffects != null) { _spitHitEffects.Create(targetPos, Quaternion.identity, (Transform)null, 1f, -1); } else { FxLibrary.TrySpawnFirst(QueenSpitImpactNames, targetPos); } FxLibrary.TrySpawnTimed("vfx_blob_attack", targetPos, 3f); float num2 = 12.25f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character obj = allCharacters[i]; Player val2 = (Player)(object)((obj is Player) ? obj : null); if (val2 != null && !((Character)val2).IsDead()) { Vector3 val3 = ((Component)val2).transform.position - targetPos; if (!(((Vector3)(ref val3)).sqrMagnitude > num2)) { HitData val4 = new HitData(); val4.m_pushForce = 25f; val4.m_point = targetPos; val4.m_dir = ((Vector3)(ref val3)).normalized; val4.m_hitType = (HitType)1; val4.m_blockable = true; val4.m_dodgeable = true; val4.SetAttacker(_character); ((Character)val2).Damage(val4); } } } } private static bool HasFx(EffectList l) { if (l != null && l.m_effectPrefabs != null) { return l.m_effectPrefabs.Length != 0; } return false; } private static void ResolveSpitAssets() { if (_spitAssetsResolved) { return; } _spitAssetsResolved = true; string[] array = new string[3] { "Gjall", "SeekerQueen", "Seeker" }; foreach (string text in array) { try { GameObject prefab = PrefabManager.Instance.GetPrefab(text); Humanoid val = (((Object)(object)prefab != (Object)null) ? prefab.GetComponent() : null); if ((Object)(object)val == (Object)null) { continue; } GameObject[][] array2 = new GameObject[2][] { val.m_defaultItems, val.m_randomWeapon }; foreach (GameObject[] array3 in array2) { if (array3 == null) { continue; } GameObject[] array4 = array3; foreach (GameObject val2 in array4) { Attack val3 = ((!((Object)(object)val2 != (Object)null)) ? null : val2.GetComponent()?.m_itemData?.m_shared?.m_attack); if (val3 == null) { continue; } string text2 = (((Object)(object)val3.m_attackProjectile != (Object)null) ? ((Object)val3.m_attackProjectile).name : ""); if (text2.IndexOf("teleport", StringComparison.OrdinalIgnoreCase) >= 0) { continue; } EffectList startEffect = val3.m_startEffect; EffectList val4 = null; if ((Object)(object)val3.m_attackProjectile != (Object)null) { Projectile component = val3.m_attackProjectile.GetComponent(); if ((Object)(object)component != (Object)null) { val4 = component.m_hitEffects; } } if (!HasFx(val4)) { val4 = val3.m_hitEffect; } if (HasFx(startEffect) || HasFx(val4)) { _spitLaunchEffects = (HasFx(startEffect) ? startEffect : null); _spitHitEffects = (HasFx(val4) ? val4 : null); Logger.LogInfo((object)("[BiomeLords] Seeker Lord spit FX/SFX sourced from '" + text + "'" + ((text2 != "") ? (" (projectile '" + text2 + "').") : " (melee effect)."))); return; } } } } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] Spit asset resolve from '" + text + "' failed: " + ex.Message)); } } Logger.LogInfo((object)"[BiomeLords] No vanilla spit FX/SFX resolved — using code FX only."); } private GameObject BuildSpitProjectile(Vector3 pos) { //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_0044: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val).name = "SeekerLord_AcidSpit"; Collider component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } val.transform.position = pos; val.transform.localScale = Vector3.one * 0.6f; MeshRenderer component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Renderer)component2).sharedMaterial = AcidMaterial(); ((Renderer)component2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component2).receiveShadows = false; } AddAcidTrail(val); AddProjectileFx(val); return val; } private void AddProjectileFx(GameObject go) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("AcidGlow"); val.transform.SetParent(go.transform, false); Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = AcidGreen; obj.intensity = 5f; obj.range = 7f; GameObject val2 = new GameObject("AcidSpray"); val2.transform.SetParent(go.transform, false); ParticleSystem val3 = val2.AddComponent(); val3.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val3.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(AcidGreen); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.32f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(1.1f); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.55f); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0.4f); ((MainModule)(ref main)).maxParticles = 250; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(70f); ShapeModule shape = val3.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.25f; ColorOverLifetimeModule colorOverLifetime = val3.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val4 = new Gradient(); val4.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(AcidGreen, 0f), new GradientColorKey(AcidGreenDark, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.9f, 0f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val4); SizeOverLifetimeModule sizeOverLifetime = val3.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 1f, 1f, 0f)); ParticleSystemRenderer component = val2.GetComponent(); ((Renderer)component).material = AcidMaterial(); ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; val3.Play(); } private Material AcidMaterial() { //IL_0019: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0049: 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) if ((Object)(object)_acidMaterial != (Object)null) { return _acidMaterial; } _acidMaterial = new Material(ResolveVisibleShader()) { color = AcidGreen }; if (_acidMaterial.HasProperty("_Color")) { _acidMaterial.SetColor("_Color", AcidGreen); } if (_acidMaterial.HasProperty("_EmissionColor")) { _acidMaterial.EnableKeyword("_EMISSION"); _acidMaterial.SetColor("_EmissionColor", AcidGreen); } return _acidMaterial; } private Shader ResolveVisibleShader() { Shader val = Shader.Find("Particles/Standard Unlit") ?? Shader.Find("Sprites/Default") ?? Shader.Find("Standard") ?? Shader.Find("Unlit/Color"); if ((Object)(object)val != (Object)null) { return val; } Renderer componentInChildren = ((Component)this).GetComponentInChildren(); if (!((Object)(object)componentInChildren != (Object)null) || !((Object)(object)componentInChildren.sharedMaterial != (Object)null)) { return null; } return componentInChildren.sharedMaterial.shader; } private void AddAcidTrail(GameObject go) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) TrailRenderer val = go.AddComponent(); val.time = 0.4f; val.startWidth = 0.45f; val.endWidth = 0.05f; val.numCapVertices = 4; ((Renderer)val).sharedMaterial = AcidMaterial(); ((Renderer)val).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val).receiveShadows = false; Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(AcidGreen, 0f), new GradientColorKey(AcidGreenDark, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.85f, 0f), new GradientAlphaKey(0f, 1f) }); val.colorGradient = val2; } private void TryBurrowAmbush() { //IL_005e: 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) if (_inSpecial || HealthFrac() >= 0.6f || _character.IsFlying() || !_character.IsOnGround() || Time.time < _nextBurrowTime) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { float num = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position); if (!(num < 6f) && !(num > 25f) && (!((Object)(object)_monsterAI != (Object)null) || ((BaseAI)_monsterAI).CanSeeTarget((Character)(object)localPlayer))) { _nextBurrowTime = Time.time + (_frenzied ? 13.200001f : 22f); ((MonoBehaviour)this).StartCoroutine(BurrowAmbushRoutine()); } } } private IEnumerator BurrowAmbushRoutine() { _inSpecial = true; if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = false; } SpawnDigBurst(((Component)this).transform.position); yield return (object)new WaitForSeconds(0.6f); List hidden = new List(); Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(false); foreach (Renderer val in componentsInChildren) { if (!(val is ParticleSystemRenderer)) { val.enabled = false; hidden.Add(val); } } float origRun = _character.m_runSpeed; _character.m_runSpeed = 13f; _character.SetRun(true); float elapsed = 0f; float nextDust = 0f; while (elapsed < 1.8f) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { break; } Vector3 val2 = ((Component)localPlayer).transform.position - ((Component)this).transform.position; val2.y = 0f; if (((Vector3)(ref val2)).magnitude <= 2.5f) { break; } _character.SetMoveDir(((Vector3)(ref val2)).normalized); if (elapsed >= nextDust) { nextDust = elapsed + 0.1f; FxLibrary.TrySpawn("vfx_corpse_destruction_small", ((Component)this).transform.position); FxLibrary.TrySpawn("vfx_HitSparks", ((Component)this).transform.position); } elapsed += Time.deltaTime; yield return null; } _character.SetMoveDir(Vector3.zero); _character.m_runSpeed = origRun; _character.SetRun(false); Vector3 center = ((Component)this).transform.position; SpawnDigBurst(center); foreach (Renderer item in hidden) { if ((Object)(object)item != (Object)null) { item.enabled = true; } } yield return (object)new WaitForSeconds(0.4f); FxLibrary.TrySpawn("vfx_gdking_stomp", center); FxLibrary.TrySpawn("fx_himminafl_aoe", center); FxLibrary.TrySpawn("vfx_corpse_destruction_small", center); FxLibrary.TrySpawn("vfx_HitSparks", center); FxLibrary.TrySpawn("fx_redlightning_burst", center + Vector3.up * 0.5f); float num = 16f; List allCharacters = Character.GetAllCharacters(); for (int j = 0; j < allCharacters.Count; j++) { Character obj = allCharacters[j]; Player val3 = (Player)(object)((obj is Player) ? obj : null); if (val3 != null && !((Character)val3).IsDead()) { Vector3 val4 = ((Component)val3).transform.position - center; val4.y = 0f; if (!(((Vector3)(ref val4)).sqrMagnitude > num)) { Vector3 val5 = ((((Vector3)(ref val4)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val4)).normalized : Vector3.zero) + Vector3.up * 2f; HitData val6 = new HitData(); val6.m_pushForce = 50f; val6.m_point = ((Component)val3).transform.position; val6.m_dir = ((Vector3)(ref val5)).normalized; val6.m_hitType = (HitType)1; val6.m_blockable = true; val6.m_dodgeable = true; val6.SetAttacker(_character); ((Character)val3).Damage(val6); } } } if ((Object)(object)_monsterAI != (Object)null) { ((Behaviour)_monsterAI).enabled = true; } _inSpecial = false; } private void SpawnDigBurst(Vector3 center) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_0079: 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_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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) FxLibrary.TrySpawn("vfx_gdking_stomp", center); FxLibrary.TrySpawn("vfx_corpse_destruction_small", center); FxLibrary.TrySpawn("vfx_mist_puff", center + Vector3.up * 0.5f); FxLibrary.TrySpawn("vfx_HitSparks", center); for (int i = 0; i < 6; i++) { float num = (float)i * 60f; Vector3 pos = center + Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.6f; FxLibrary.TrySpawn("vfx_corpse_destruction_small", pos); } } private void TrySummonBrood() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextMinionTime) { return; } int num = CountNearbyBrood(); if (num >= 3) { _nextMinionTime = Time.time + 15f; return; } EnsurePrefabs(); if (!((Object)(object)_cachedMinion == (Object)null)) { int num2 = Math.Min(2, 3 - num); for (int i = 0; i < num2; i++) { float num3 = (float)i * (360f / (float)Math.Max(1, num2)) + Random.Range(-25f, 25f); Vector3 val = Quaternion.Euler(0f, num3, 0f) * Vector3.forward; Vector3 val2 = ((Component)this).transform.position + val * 3.5f + Vector3.up * 0.5f; Object.Instantiate(_cachedMinion, val2, Quaternion.LookRotation(-val)); FxLibrary.TrySpawn("vfx_spawn", val2); } _nextMinionTime = Time.time + 60f; } } private void TickFrenzyAura() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0047: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (_frenzied && !(Time.time < _nextFrenzyPulse)) { _nextFrenzyPulse = Time.time + 0.5f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_HitSparks", val); if (Random.value < 0.4f) { FxLibrary.TrySpawn("fx_redlightning_burst", val + Vector3.up * 0.3f); } } } private int CountNearbyBrood() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) int num = 0; Vector3 position = ((Component)this).transform.position; float num2 = 256f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)_character) && !val.IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num2) && ((Object)((Component)val).gameObject).name.StartsWith("Seeker")) { num++; } } } return num; } private static void EnsurePrefabs() { if ((Object)(object)_cachedMinion == (Object)null) { _cachedMinion = PrefabManager.Instance.GetPrefab("SeekerBrood"); } } } public class SE_DraugrWound : StatusEffect { public float DamagePerTick = 5f; public float TickInterval = 1f; private float _nextTick; public override void Setup(Character character) { ((StatusEffect)this).Setup(character); _nextTick = TickInterval; } public override void UpdateStatusEffect(float dt) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) ((StatusEffect)this).UpdateStatusEffect(dt); if (!((Object)(object)base.m_character == (Object)null) && !base.m_character.IsDead() && !(base.m_time < _nextTick)) { _nextTick = base.m_time + TickInterval; HitData val = new HitData(); val.m_damage.m_damage = DamagePerTick; val.m_point = ((Component)base.m_character).transform.position + Vector3.up; val.m_hitType = (HitType)1; base.m_character.Damage(val); FxLibrary.TrySpawnFirst(new string[3] { "vfx_BloodHit", "vfx_player_hit_blood", "vfx_HitSparks" }, ((Component)base.m_character).transform.position + Vector3.up * 1f); } } } public static class ValkyrieRallyService { public const string RpcName = "BiomeLords_ValkyrieRally"; private static int _gpHash; private static StatusEffect _lastSeenMarker; private static FieldInfo _trinketField; private static bool _shieldResolved; private static int _shieldHash; private static int _shieldItemLevel = 1; private static ZRoutedRpc _registeredOn; public static void RegisterRpc() { ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null && instance != _registeredOn) { instance.Register("BiomeLords_ValkyrieRally", (Action)OnRallyRpc); _registeredOn = instance; Logger.LogInfo((object)"[BiomeLords] Valkyrie's Rally RPC registered."); } } public static void Tick() { if (_gpHash == 0) { _gpHash = StringExtensionMethods.GetStableHashCode("GP_ValkyrieAscension"); } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { _lastSeenMarker = null; return; } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null) { _lastSeenMarker = null; return; } StatusEffect statusEffect = sEMan.GetStatusEffect(_gpHash); if ((Object)(object)statusEffect == (Object)null) { _lastSeenMarker = null; } else if (!((Object)(object)statusEffect == (Object)(object)_lastSeenMarker)) { _lastSeenMarker = statusEffect; BroadcastRally(localPlayer); } } private static void BroadcastRally(Player caster) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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) //IL_007c: 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) Vector3 position = ((Component)caster).transform.position; FxLibrary.TrySpawn("fx_himminafl_aoe", position + Vector3.up * 0.5f); FxLibrary.TrySpawn("vfx_lootspawn", position + Vector3.up * 1.2f); ZRoutedRpc instance = ZRoutedRpc.instance; if (instance != null) { instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "BiomeLords_ValkyrieRally", new object[1] { position }); } else { ApplyRally(caster); } Logger.LogInfo((object)("[BiomeLords] Valkyrie's Rally broadcast from " + $"{caster.GetPlayerName()} at {position}.")); } private static void OnRallyRpc(long sender, Vector3 center) { //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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { float value = LordConfig.ValkyrieRallyRadius.Value; Vector3 val = ((Component)localPlayer).transform.position - center; if (!(((Vector3)(ref val)).sqrMagnitude > value * value)) { ApplyRally(localPlayer); } } } private static void ApplyRally(Player p) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) SEMan sEMan = ((Character)p).GetSEMan(); if (sEMan != null) { float num = ((Character)p).GetMaxHealth() - ((Character)p).GetHealth(); if (num > 0f) { ((Character)p).Heal(num, true); } ((Character)p).AddStamina(((Character)p).GetMaxStamina()); ((Character)p).AddEitr(((Character)p).GetMaxEitr()); if (HasTrinket(p)) { ((Character)p).AddAdrenaline(((Character)p).GetMaxAdrenaline()); } GrantMaxStaffShield(sEMan); GrantRested(sEMan); FxLibrary.TrySpawn("vfx_HitSparks", ((Component)p).transform.position + Vector3.up * 0.5f); ((Character)p).Message((MessageType)2, "$gp_valkyrieascension_rallied", 0, (Sprite)null); } } private static bool HasTrinket(Player p) { if (_trinketField == null) { _trinketField = AccessTools.Field(typeof(Humanoid), "m_trinketItem"); } if (_trinketField == null) { return false; } return _trinketField.GetValue(p) != null; } private static void GrantMaxStaffShield(SEMan seman) { EnsureShieldData(); if (_shieldResolved && _shieldHash != 0) { seman.RemoveStatusEffect(_shieldHash, true); seman.AddStatusEffect(_shieldHash, true, _shieldItemLevel, 100f); } } private static void EnsureShieldData() { if (!_shieldResolved) { _shieldResolved = true; GameObject prefab = PrefabManager.Instance.GetPrefab("StaffShield"); SharedData val = ((prefab != null) ? prefab.GetComponent() : null)?.m_itemData?.m_shared; StatusEffect val2 = val?.m_attackStatusEffect; if ((Object)(object)val2 == (Object)null) { Logger.LogWarning((object)"[BiomeLords] Valkyrie's Rally: StaffShield status effect not found — shield half disabled."); return; } _shieldHash = StringExtensionMethods.GetStableHashCode(((Object)val2).name); _shieldItemLevel = Mathf.Max(1, val.m_maxQuality); } } private static void GrantRested(SEMan seman) { int stableHashCode = StringExtensionMethods.GetStableHashCode("Rested"); seman.RemoveStatusEffect(stableHashCode, true); StatusEffect val = seman.AddStatusEffect(stableHashCode, true, 0, 0f); if ((Object)(object)val != (Object)null) { val.m_ttl = LordConfig.ValkyrieRallyRestedSeconds.Value; } else { Logger.LogWarning((object)"[BiomeLords] Valkyrie's Rally: vanilla 'Rested' status effect not found — rested half skipped."); } } } } namespace BiomeLords.Phase1C { public static class BlessingSystem { private const string ChargesZDOKey = "biomelords.charges"; private const string CooldownZDOKey = "biomelords.bless_next"; public const double CooldownSeconds = 10.0; public const string ActiveBlessingKey = "biomelords.blessing"; private static readonly Dictionary ByTrophy = new Dictionary { { "TrophyNeckLord", ("neck_lord", "SE_NeckLordSpirit", "GP_TidesGrace") }, { "TrophyGreydwarfShamanLord", ("greydwarf_lord", "SE_GreydwarfLordSpirit", "GP_ForestsEmbrace") }, { "TrophyDraugrEliteLord", ("draugr_lord", "SE_DraugrLordSpirit", "GP_PlagueBearer") }, { "TrophyFenringLord", ("fenring_lord", "SE_FenringLordSpirit", "GP_HowlOfThePack") }, { "TrophyLoxLord", ("lox_lord", "SE_LoxLordSpirit", "GP_BullRush") }, { "TrophySeekerLord", ("seeker_lord", "SE_SeekerLordSpirit", "GP_HiveSense") }, { "TrophyFallerValkyrieLord", ("faller_valkyrie_lord", "SE_FallerValkyrieLordSpirit", "GP_ValkyrieAscension") } }; public static int MaxCharges => LordConfig.BlessingChargesPerTrophy.Value; public static bool TryGetGuardianPower(string attached, out string gpName) { gpName = null; if (string.IsNullOrEmpty(attached)) { return false; } if (ByTrophy.TryGetValue(attached, out (string, string, string) value)) { gpName = value.Item3; return true; } string key = attached.TrimStart('$'); if (ByTrophy.TryGetValue(key, out value)) { gpName = value.Item3; return true; } return false; } public static bool TryResolve(string attached, out string lordId, out string seName) { lordId = (seName = null); if (string.IsNullOrEmpty(attached)) { return false; } if (ByTrophy.TryGetValue(attached, out (string, string, string) value)) { (lordId, seName, _) = value; return true; } string key = attached.TrimStart('$'); if (ByTrophy.TryGetValue(key, out value)) { (lordId, seName, _) = value; return true; } return false; } private static ZDO Zdo(ItemStand stand) { if ((Object)(object)stand == (Object)null) { return null; } ZNetView component = ((Component)stand).GetComponent(); if ((Object)(object)component == (Object)null || !component.IsValid()) { return null; } return component.GetZDO(); } public static int GetCharges(ItemStand stand) { ZDO val = Zdo(stand); if (val == null) { return 0; } return val.GetInt("biomelords.charges", LordConfig.BlessingChargesPerTrophy.Value); } public static void ResetCharges(ItemStand stand) { ZDO val = Zdo(stand); if (val != null && val.GetInt("biomelords.charges", -1) <= 0) { val.Set("biomelords.charges", LordConfig.BlessingChargesPerTrophy.Value); } } public static void SetCharges(ItemStand stand, int value) { ZDO obj = Zdo(stand); if (obj != null) { obj.Set("biomelords.charges", value); } } public static double CooldownRemaining(ItemStand stand) { ZDO val = Zdo(stand); if (val == null || (Object)(object)ZNet.instance == (Object)null) { return 0.0; } double num = val.GetFloat("biomelords.bless_next", 0f); return Math.Max(0.0, num - ZNet.instance.GetTimeSeconds()); } private static void StartCooldown(ItemStand stand) { ZDO val = Zdo(stand); if (val != null && !((Object)(object)ZNet.instance == (Object)null)) { val.Set("biomelords.bless_next", (float)(ZNet.instance.GetTimeSeconds() + 10.0)); } } public static bool TryGrant(Player p, ItemStand stand, string trophyAttached) { if ((Object)(object)p == (Object)null || (Object)(object)stand == (Object)null) { return false; } if (!TryResolve(trophyAttached, out var lordId, out var seName)) { ((Character)p).Message((MessageType)2, "$biomelords_pedestal_unknown_trophy", 0, (Sprite)null); return false; } int charges = GetCharges(stand); if (charges <= 0) { ((Character)p).Message((MessageType)2, "$biomelords_blessing_spent", 0, (Sprite)null); return false; } double num = CooldownRemaining(stand); if (num > 0.0) { ((Character)p).Message((MessageType)2, $"$biomelords_blessing_cooldown ({(int)Math.Ceiling(num)}s)", 0, (Sprite)null); return false; } if (!StatusEffectFactory.ByName.TryGetValue(seName, out var value) || (Object)(object)value == (Object)null) { Logger.LogWarning((object)("[BiomeLords] Blessing SE " + seName + " missing from registry.")); return false; } RemoveOtherBlessings(p, value); ((Character)p).GetSEMan().AddStatusEffect(value, true, 0, 0f); SetActiveBlessing(p, seName); if (seName == "SE_FallerValkyrieLordSpirit") { FeatherweightInventory.Reconcile(p); } int num2 = charges - 1; SetCharges(stand, num2); StartCooldown(stand); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)$"[BiomeLords] Granted {seName}. Charges: {charges} -> {num2}."); } if (num2 == 0) { ConsumeTrophy(p, stand, lordId); } return true; } private static void RemoveOtherBlessings(Player p, StatusEffect keep) { SEMan sEMan = ((Character)p).GetSEMan(); if (sEMan == null) { return; } int num = keep.NameHash(); int seHash = FeatherweightInventory.SeHash; if (num != seHash && sEMan.HaveStatusEffect(seHash)) { FeatherweightInventory.Collapse(p); } foreach (int blessingHash in StatusEffectFactory.BlessingHashes) { if (blessingHash != num && sEMan.HaveStatusEffect(blessingHash)) { sEMan.RemoveStatusEffect(blessingHash, false); } } } public static string GetActiveBlessing(Player p) { if (p?.m_customData != null && p.m_customData.TryGetValue("biomelords.blessing", out var value) && !string.IsNullOrEmpty(value)) { return value; } return null; } private static void SetActiveBlessing(Player p, string seName) { if (p?.m_customData != null) { p.m_customData["biomelords.blessing"] = seName; } } private static void ConsumeTrophy(Player p, ItemStand stand, string lordId) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) Vector3 pos = ((Component)stand).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_corpse_destruction_small", pos); FxLibrary.TrySpawn("vfx_lootspawn", pos); FxLibrary.TrySpawn("fx_redlightning_burst", pos); stand.DestroyAttachment(); ((Character)p).Message((MessageType)2, "$biomelords_blessing_lastuse", 0, (Sprite)null); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] Trophy consumed (lord=" + lordId + "). Pedestal cleared.")); } } } public static class GuardianPowerFactory { public const string NeckLordGP = "GP_TidesGrace"; public const string GreydwarfLordGP = "GP_ForestsEmbrace"; public const string DraugrLordGP = "GP_PlagueBearer"; public const string FenringLordGP = "GP_HowlOfThePack"; public const string LoxLordGP = "GP_BullRush"; public const string SeekerLordGP = "GP_HiveSense"; public const string FallerValkyrieLordGP = "GP_ValkyrieAscension"; public const float ActiveDuration = 600f; public const float Cooldown = 1200f; public const float InstantWindow = 4f; public static readonly Dictionary ByName = new Dictionary(); public static void RegisterAll() { Register("GP_TidesGrace", "gp_tidesgrace", ConfigureTidesGrace); Register("GP_ForestsEmbrace", "gp_forestsembrace", ConfigureForestsEmbrace); Register("GP_PlagueBearer", "gp_plaguebearer", ConfigurePlagueBearer); Register("GP_HowlOfThePack", "gp_howlofthepack", ConfigureHowlOfThePack); Register("GP_BullRush", "gp_bullrush", ConfigureBullRush); Register("GP_HiveSense", "gp_hivesight", ConfigureHiveSight); Register("GP_ValkyrieAscension", "gp_valkyrieascension", ConfigureValkyrieAscension, 4f); } private static void Register(string seName, string locKey, Action configure, float ttl = 600f) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = seName; ((StatusEffect)val).m_name = "$" + locKey; ((StatusEffect)val).m_tooltip = "$" + locKey + "_tooltip"; ((StatusEffect)val).m_ttl = ttl; ((StatusEffect)val).m_cooldown = 1200f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$" + locKey + "_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$" + locKey + "_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[4] { "vfx_lootspawn", "fx_himminafl_aoe", "vfx_HitSparks", "fx_Fader_Roar" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[2] { "vfx_corpse_destruction_small", "vfx_HitSparks" }); configure(val); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName[seName] = (StatusEffect)(object)val; Logger.LogInfo((object)("[BiomeLords] Registered guardian power: " + seName)); } private static void ConfigureTidesGrace(SE_Stats se) { } private static void ConfigureForestsEmbrace(SE_Stats se) { } private static void ConfigurePlagueBearer(SE_Stats se) { //IL_0009: 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) //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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) se.m_mods = new List { new DamageModPair { m_type = (DamageType)256, m_modifier = (DamageModifier)3 } }; se.m_percentigeDamageModifiers = new DamageTypes { m_poison = 0.75f }; se.m_healthRegenMultiplier = 1.5f; } private static void ConfigureHowlOfThePack(SE_Stats se) { } private static void ConfigureBullRush(SE_Stats se) { se.m_staggerModifier = -1f; se.m_adrenalineModifier = 1f; se.m_attackStaminaUseModifier = -0.5f; } private static void ConfigureHiveSight(SE_Stats se) { } private static void ConfigureValkyrieAscension(SE_Stats se) { } private static EffectList BuildEffects(string[] prefabNames) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown List list = new List(); foreach (string text in prefabNames) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); if (!((Object)(object)prefab == (Object)null)) { list.Add(new EffectData { m_prefab = prefab, m_enabled = true, m_attach = false, m_follow = false, m_scale = false, m_randomRotation = true }); } } return new EffectList { m_effectPrefabs = list.ToArray() }; } public static void EnsureIcon(StatusEffect se, string trophyPrefabName) { if ((Object)(object)se == (Object)null || (Object)(object)se.m_icon != (Object)null) { return; } GameObject prefab = PrefabManager.Instance.GetPrefab(trophyPrefabName); Sprite[] array = ((prefab != null) ? prefab.GetComponent() : null)?.m_itemData?.m_shared?.m_icons; if (array != null && array.Length != 0 && (Object)(object)array[0] != (Object)null) { se.m_icon = array[0]; return; } ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance == (Object)null || instance.m_StatusEffects == null) { return; } foreach (StatusEffect statusEffect in instance.m_StatusEffects) { if (!((Object)(object)statusEffect == (Object)null) && !((Object)(object)statusEffect.m_icon == (Object)null)) { se.m_icon = statusEffect.m_icon; break; } } } } public class LordsPedestalTag : MonoBehaviour { public static readonly List Active = new List(); public ItemStand Stand { get; private set; } private void Awake() { Stand = ((Component)this).GetComponent(); Active.Add(this); } private void OnDestroy() { Active.Remove(this); } } public static class PedestalFactory { public const string PedestalPrefab = "LordsPedestal"; private static bool _registered; private static readonly string[] AltarCandidates = new string[2] { "itemstandh", "itemstandv" }; public static void RegisterAll() { //IL_0032: 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_0042: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Expected O, but got Unknown if (_registered) { return; } string text = FindBasePrefab(); if (text == null) { Logger.LogError((object)"[BiomeLords] Could not find Yagluth altar prefab — pedestal not registered."); return; } Logger.LogInfo((object)("[BiomeLords] Hall of the Lords base prefab: " + text)); CustomPiece val = new CustomPiece("LordsPedestal", text, new PieceConfig { Name = "$piece_lordspedestal", Description = "$piece_lordspedestal_desc", PieceTable = "Hammer", Category = "Misc", Requirements = ParseRecipe(LordConfig.HallRecipe.Value) }); GameObject piecePrefab = val.PiecePrefab; if ((Object)(object)piecePrefab != (Object)null) { ApplyVisualTreatment(piecePrefab); int num = 0; ItemStand[] componentsInChildren = piecePrefab.GetComponentsInChildren(true); foreach (ItemStand val2 in componentsInChildren) { if ((Object)(object)((Component)val2).gameObject.GetComponent() == (Object)null) { ((Component)val2).gameObject.AddComponent(); num++; } } Logger.LogInfo((object)$"[BiomeLords] Lord's Pedestal: tagged {num} trophy slot(s)."); TryRenderPieceIcon(val); } PieceManager.Instance.AddPiece(val); _registered = true; Logger.LogInfo((object)"[BiomeLords] Registered piece: LordsPedestal"); } private static void ApplyVisualTreatment(GameObject prefab) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_010b: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) prefab.transform.localScale = Vector3.one * 1.8f; Color color = default(Color); ((Color)(ref color))..ctor(0.95f, 0.65f, 0.3f, 1f); Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { Material[] sharedMaterials = val.sharedMaterials; if (sharedMaterials == null || sharedMaterials.Length == 0) { continue; } Material[] array = (Material[])(object)new Material[sharedMaterials.Length]; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null)) { Material val2 = new Material(sharedMaterials[j]); if (val2.HasProperty("_Color")) { val2.color = color; } array[j] = val2; } } val.sharedMaterials = array; } ItemStand component = prefab.GetComponent(); if ((Object)(object)component != (Object)null) { component.m_name = "$piece_lordspedestal"; } GameObject val3 = new GameObject("LordsPedestal_Aura"); val3.transform.SetParent(prefab.transform, false); val3.transform.localPosition = new Vector3(0f, 1f, 0f); Light obj = val3.AddComponent(); obj.type = (LightType)2; obj.color = new Color(1f, 0.75f, 0.3f); obj.intensity = 1.6f; obj.range = 4f; TryAttachAuraParticle(prefab.transform, new string[4] { "vfx_smoke", "fx_smoke", "vfx_swamp_mist", "fx_fader_arena_fissure_smoke" }); } private static void TryAttachAuraParticle(Transform parent, string[] candidates) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) foreach (string text in candidates) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); if (!((Object)(object)prefab == (Object)null)) { GameObject obj = Object.Instantiate(prefab, parent); obj.transform.localPosition = new Vector3(0f, 0.5f, 0f); obj.transform.localScale = Vector3.one * 0.6f; ((Object)obj).name = "LordsPedestal_AuraFx"; ZNetView[] componentsInChildren = obj.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren.Length; j++) { Object.DestroyImmediate((Object)(object)componentsInChildren[j]); } Logger.LogInfo((object)("[BiomeLords] Pedestal aura particle: " + text)); break; } } } private static void TryRenderPieceIcon(CustomPiece piece) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { RenderRequest val = new RenderRequest(piece.PiecePrefab) { Width = 64, Height = 64, UseCache = true }; Sprite val2 = RenderManager.Instance.Render(val); if ((Object)(object)val2 != (Object)null && (Object)(object)piece.Piece != (Object)null) { piece.Piece.m_icon = val2; Logger.LogInfo((object)"[BiomeLords] Lord's Pedestal: custom icon rendered."); } } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] Pedestal icon render failed: " + ex.Message)); } } private static string FindBasePrefab() { string[] altarCandidates = AltarCandidates; foreach (string text in altarCandidates) { if ((Object)(object)PrefabManager.Instance.GetPrefab(text) != (Object)null) { return text; } } return null; } private static RequirementConfig[] ParseRecipe(string csv) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00f8: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_011d: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //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_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_008f: Expected O, but got Unknown List list = new List(); if (!string.IsNullOrWhiteSpace(csv)) { string[] array = csv.Split(','); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); if (string.IsNullOrEmpty(text)) { continue; } string[] array2 = text.Split(':'); if (array2.Length == 2) { string text2 = array2[0].Trim(); if (!string.IsNullOrEmpty(text2) && int.TryParse(array2[1].Trim(), out var result) && result > 0) { list.Add(new RequirementConfig { Item = text2, Amount = result, Recover = true }); } } } } if (list.Count == 0) { Logger.LogWarning((object)"[BiomeLords] Hall recipe empty / unparseable — falling back to defaults."); list.Add(new RequirementConfig { Item = "Stone", Amount = 40, Recover = true }); list.Add(new RequirementConfig { Item = "FineWood", Amount = 20, Recover = true }); list.Add(new RequirementConfig { Item = "Flint", Amount = 10, Recover = true }); list.Add(new RequirementConfig { Item = "SurtlingCore", Amount = 3, Recover = true }); } return list.ToArray(); } } public static class PowerClaimSystem { private static readonly Dictionary LordToGP = new Dictionary { { "neck_lord", "GP_TidesGrace" }, { "greydwarf_lord", "GP_ForestsEmbrace" }, { "draugr_lord", "GP_PlagueBearer" }, { "fenring_lord", "GP_HowlOfThePack" }, { "lox_lord", "GP_BullRush" }, { "seeker_lord", "GP_HiveSense" }, { "faller_valkyrie_lord", "GP_ValkyrieAscension" } }; public static string DefeatKey(string lordId) { return "biomelords_defeated_" + lordId; } public static bool HasDefeated(Player p, string lordId) { if ((Object)(object)p != (Object)null && !string.IsNullOrEmpty(lordId)) { return ((Humanoid)p).HaveUniqueKey(DefeatKey(lordId)); } return false; } public static void GrantOnDefeat(Player killer, string lordId) { if ((Object)(object)killer == (Object)null || string.IsNullOrEmpty(lordId) || !LordToGP.TryGetValue(lordId, out var value)) { return; } killer.SetGuardianPower(value); if (killer.GetGuardianPowerName() != value) { Logger.LogWarning((object)("[BiomeLords] SetGuardianPower(" + value + ") didn't stick at Lord-defeat time.")); return; } PlayAwardFx(killer); ((Character)killer).Message((MessageType)2, "$biomelords_power_awarded", 0, (Sprite)null); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] Auto-granted GP " + value + " to " + killer.GetPlayerName() + ".")); } } private static void PlayAwardFx(Player player) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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) //IL_0065: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_011f: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)player).transform.position; FxLibrary.TrySpawn("fx_himminafl_aoe", position + Vector3.up * 1.5f); FxLibrary.TrySpawn("fx_redlightning_burst", position + Vector3.up * 2f); FxLibrary.TrySpawn("vfx_MeadSplash", position); FxLibrary.TrySpawnTimed("vfx_water_surface", position, 4f); for (int i = 0; i < 12; i++) { float num = (float)i * 30f; Vector3 val = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.8f; FxLibrary.TrySpawn("vfx_HitSparks", position + val + Vector3.up * 0.5f); } FxLibrary.TrySpawn("fx_Fader_Roar", position); FxLibrary.TrySpawn("vfx_lootspawn", position + Vector3.up * 1.2f); } } public static class StatusEffectFactory { public const string NeckLordSpiritSE = "SE_NeckLordSpirit"; public const string GreydwarfLordSpiritSE = "SE_GreydwarfLordSpirit"; public const string DraugrLordSpiritSE = "SE_DraugrLordSpirit"; public const string FenringLordSpiritSE = "SE_FenringLordSpirit"; public const string LoxLordSpiritSE = "SE_LoxLordSpirit"; public const string SeekerLordSpiritSE = "SE_SeekerLordSpirit"; public const string FallerValkyrieLordSpiritSE = "SE_FallerValkyrieLordSpirit"; public static readonly Dictionary ByName = new Dictionary(); public static readonly HashSet BlessingHashes = new HashSet(); public static void RegisterAll() { //IL_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = "SE_NeckLordSpirit"; ((StatusEffect)val).m_name = "$se_necklordspirit"; ((StatusEffect)val).m_tooltip = "$se_necklordspirit_tooltip"; ((StatusEffect)val).m_ttl = 0f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$se_necklordspirit_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$se_necklordspirit_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[3] { "vfx_lootspawn", "vfx_HitSparks", "fx_himminafl_aoe" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[1] { "vfx_corpse_destruction_small" }); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName["SE_NeckLordSpirit"] = (StatusEffect)(object)val; BlessingHashes.Add(StringExtensionMethods.GetStableHashCode("SE_NeckLordSpirit")); Logger.LogInfo((object)"[BiomeLords] Registered status effect: SE_NeckLordSpirit"); BuildGreydwarfLordSpirit(); BuildDraugrLordSpirit(); BuildFenringLordSpirit(); BuildLoxLordSpirit(); BuildSeekerLordSpirit(); BuildFallerValkyrieLordSpirit(); } private static void BuildFallerValkyrieLordSpirit() { //IL_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = "SE_FallerValkyrieLordSpirit"; ((StatusEffect)val).m_name = "$se_fallervalkyrielordspirit"; ((StatusEffect)val).m_tooltip = "$se_fallervalkyrielordspirit_tooltip"; ((StatusEffect)val).m_ttl = 0f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$se_fallervalkyrielordspirit_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$se_fallervalkyrielordspirit_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[3] { "vfx_lootspawn", "vfx_HitSparks", "fx_himminafl_aoe" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[1] { "vfx_corpse_destruction_small" }); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName["SE_FallerValkyrieLordSpirit"] = (StatusEffect)(object)val; BlessingHashes.Add(StringExtensionMethods.GetStableHashCode("SE_FallerValkyrieLordSpirit")); Logger.LogInfo((object)"[BiomeLords] Registered status effect: SE_FallerValkyrieLordSpirit"); } private static void BuildSeekerLordSpirit() { //IL_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = "SE_SeekerLordSpirit"; ((StatusEffect)val).m_name = "$se_seekerlordspirit"; ((StatusEffect)val).m_tooltip = "$se_seekerlordspirit_tooltip"; ((StatusEffect)val).m_ttl = 0f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$se_seekerlordspirit_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$se_seekerlordspirit_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[3] { "vfx_lootspawn", "vfx_HitSparks", "vfx_seeker_attack" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[1] { "vfx_corpse_destruction_small" }); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName["SE_SeekerLordSpirit"] = (StatusEffect)(object)val; BlessingHashes.Add(StringExtensionMethods.GetStableHashCode("SE_SeekerLordSpirit")); Logger.LogInfo((object)"[BiomeLords] Registered status effect: SE_SeekerLordSpirit"); } private static void BuildLoxLordSpirit() { //IL_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = "SE_LoxLordSpirit"; ((StatusEffect)val).m_name = "$se_loxlordspirit"; ((StatusEffect)val).m_tooltip = "$se_loxlordspirit_tooltip"; ((StatusEffect)val).m_ttl = 0f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$se_loxlordspirit_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$se_loxlordspirit_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[3] { "vfx_lootspawn", "vfx_HitSparks", "vfx_gdking_stomp" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[1] { "vfx_corpse_destruction_small" }); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName["SE_LoxLordSpirit"] = (StatusEffect)(object)val; BlessingHashes.Add(StringExtensionMethods.GetStableHashCode("SE_LoxLordSpirit")); Logger.LogInfo((object)"[BiomeLords] Registered status effect: SE_LoxLordSpirit"); } private static void BuildFenringLordSpirit() { //IL_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = "SE_FenringLordSpirit"; ((StatusEffect)val).m_name = "$se_fenringlordspirit"; ((StatusEffect)val).m_tooltip = "$se_fenringlordspirit_tooltip"; ((StatusEffect)val).m_ttl = 0f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$se_fenringlordspirit_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$se_fenringlordspirit_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[3] { "vfx_lootspawn", "vfx_HitSparks", "fx_himminafl_aoe" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[1] { "vfx_corpse_destruction_small" }); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName["SE_FenringLordSpirit"] = (StatusEffect)(object)val; BlessingHashes.Add(StringExtensionMethods.GetStableHashCode("SE_FenringLordSpirit")); Logger.LogInfo((object)"[BiomeLords] Registered status effect: SE_FenringLordSpirit"); } private static void BuildDraugrLordSpirit() { //IL_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = "SE_DraugrLordSpirit"; ((StatusEffect)val).m_name = "$se_draugrlordspirit"; ((StatusEffect)val).m_tooltip = "$se_draugrlordspirit_tooltip"; ((StatusEffect)val).m_ttl = 0f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$se_draugrlordspirit_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$se_draugrlordspirit_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[3] { "vfx_lootspawn", "vfx_HitSparks", "vfx_swamp_mist" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[1] { "vfx_corpse_destruction_small" }); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName["SE_DraugrLordSpirit"] = (StatusEffect)(object)val; BlessingHashes.Add(StringExtensionMethods.GetStableHashCode("SE_DraugrLordSpirit")); Logger.LogInfo((object)"[BiomeLords] Registered status effect: SE_DraugrLordSpirit"); } private static void BuildGreydwarfLordSpirit() { //IL_0034: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = "SE_GreydwarfLordSpirit"; ((StatusEffect)val).m_name = "$se_greydwarflordspirit"; ((StatusEffect)val).m_tooltip = "$se_greydwarflordspirit_tooltip"; ((StatusEffect)val).m_ttl = 0f; ((StatusEffect)val).m_startMessageType = (MessageType)2; ((StatusEffect)val).m_startMessage = "$se_greydwarflordspirit_start"; ((StatusEffect)val).m_stopMessageType = (MessageType)2; ((StatusEffect)val).m_stopMessage = "$se_greydwarflordspirit_stop"; ((StatusEffect)val).m_startEffects = BuildEffects(new string[3] { "vfx_lootspawn", "vfx_HitSparks", "fx_gdking_rootspawn" }); ((StatusEffect)val).m_stopEffects = BuildEffects(new string[1] { "vfx_corpse_destruction_small" }); CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName["SE_GreydwarfLordSpirit"] = (StatusEffect)(object)val; BlessingHashes.Add(StringExtensionMethods.GetStableHashCode("SE_GreydwarfLordSpirit")); Logger.LogInfo((object)"[BiomeLords] Registered status effect: SE_GreydwarfLordSpirit"); } private static EffectList BuildEffects(string[] prefabNames) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown List list = new List(); foreach (string text in prefabNames) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); if (!((Object)(object)prefab == (Object)null)) { list.Add(new EffectData { m_prefab = prefab, m_enabled = true, m_attach = false, m_follow = false, m_scale = false, m_randomRotation = true }); } } return new EffectList { m_effectPrefabs = list.ToArray() }; } public static void RefreshIcon(StatusEffect se, string trophyPrefabName) { if (!((Object)(object)se == (Object)null)) { GameObject prefab = PrefabManager.Instance.GetPrefab(trophyPrefabName); Sprite[] array = ((prefab != null) ? prefab.GetComponent() : null)?.m_itemData?.m_shared?.m_icons; if (array != null && array.Length != 0 && (Object)(object)array[0] != (Object)null) { se.m_icon = array[0]; } } } public static void EnsureIcon(StatusEffect se, string trophyPrefabName) { if ((Object)(object)se == (Object)null || (Object)(object)se.m_icon != (Object)null) { return; } GameObject prefab = PrefabManager.Instance.GetPrefab(trophyPrefabName); Sprite[] array = ((prefab != null) ? prefab.GetComponent() : null)?.m_itemData?.m_shared?.m_icons; if (array != null && array.Length != 0 && (Object)(object)array[0] != (Object)null) { se.m_icon = array[0]; return; } ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance == (Object)null || instance.m_StatusEffects == null) { return; } foreach (StatusEffect statusEffect in instance.m_StatusEffects) { if (!((Object)(object)statusEffect == (Object)null) && !((Object)(object)statusEffect.m_icon == (Object)null)) { se.m_icon = statusEffect.m_icon; break; } } } } public static class SubEffectFactory { public const string ForestSitSE = "SE_ForestSitting"; public static readonly Dictionary ByName = new Dictionary(); public static void RegisterAll() { RegisterMarker("SE_ForestSitting", "se_forestsit", "Rested", 0f); } private static void RegisterMarker(string seName, string locKey, string iconHint, float ttl = 5f) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown SE_Stats val = ScriptableObject.CreateInstance(); ((Object)val).name = seName; ((StatusEffect)val).m_name = "$" + locKey; ((StatusEffect)val).m_tooltip = "$" + locKey + "_tooltip"; ((StatusEffect)val).m_ttl = ttl; CustomStatusEffect val2 = new CustomStatusEffect((StatusEffect)(object)val, false); ItemManager.Instance.AddStatusEffect(val2); ByName[seName] = (StatusEffect)(object)val; } public static void EnsureIcon(StatusEffect se, string hint) { if ((Object)(object)se == (Object)null || (Object)(object)se.m_icon != (Object)null) { return; } if (!string.IsNullOrEmpty(hint)) { GameObject prefab = PrefabManager.Instance.GetPrefab(hint); Sprite[] array = ((prefab != null) ? prefab.GetComponent() : null)?.m_itemData?.m_shared?.m_icons; if (array != null && array.Length != 0 && (Object)(object)array[0] != (Object)null) { se.m_icon = array[0]; return; } } ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance == (Object)null || instance.m_StatusEffects == null) { return; } if (!string.IsNullOrEmpty(hint)) { foreach (StatusEffect statusEffect in instance.m_StatusEffects) { if (!((Object)(object)statusEffect == (Object)null) && !((Object)(object)statusEffect.m_icon == (Object)null) && ((Object)statusEffect).name == hint) { se.m_icon = statusEffect.m_icon; return; } } } foreach (StatusEffect statusEffect2 in instance.m_StatusEffects) { if ((Object)(object)statusEffect2 != (Object)null && (Object)(object)statusEffect2.m_icon != (Object)null) { se.m_icon = statusEffect2.m_icon; break; } } } } public static class TrophyFactory { public const string NeckLordTrophy = "TrophyNeckLord"; public const string GreydwarfLordTrophy = "TrophyGreydwarfShamanLord"; public const string DraugrLordTrophy = "TrophyDraugrEliteLord"; public const string FenringLordTrophy = "TrophyFenringLord"; public const string LoxLordTrophy = "TrophyLoxLord"; public const string SeekerLordTrophy = "TrophySeekerLord"; public const string FallerValkyrieLordTrophy = "TrophyFallerValkyrieLord"; public static void RegisterAll() { BuildNeckLordTrophy(); BuildGreydwarfShamanLordTrophy(); BuildDraugrEliteLordTrophy(); BuildFenringLordTrophy(); BuildLoxLordTrophy(); BuildSeekerLordTrophy(); BuildFallerValkyrieLordTrophy(); } private static void BuildFallerValkyrieLordTrophy() { //IL_000a: 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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) CustomItem val = new CustomItem("TrophyFallerValkyrieLord", "TrophyFallenValkyrie", new ItemConfig { Name = "$item_trophyfallervalkyrielord", Description = "$item_trophyfallervalkyrielord_desc" }); ItemDrop component = val.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData?.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_itemType = (ItemType)13; shared.m_maxStackSize = 1; shared.m_questItem = false; } TintAndRenderIcon(val.ItemPrefab, component, new Color(1f, 0.95f, 0.75f)); ApplyTrophyAura(val.ItemPrefab, new Color(1f, 0.95f, 0.75f), 1f); ItemManager.Instance.AddItem(val); Logger.LogInfo((object)"[BiomeLords] Registered trophy: TrophyFallerValkyrieLord"); } private static void BuildSeekerLordTrophy() { //IL_000a: 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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) CustomItem val = new CustomItem("TrophySeekerLord", "TrophySeeker", new ItemConfig { Name = "$item_trophyseekerlord", Description = "$item_trophyseekerlord_desc" }); ItemDrop component = val.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData?.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_itemType = (ItemType)13; shared.m_maxStackSize = 1; shared.m_questItem = false; } TintAndRenderIcon(val.ItemPrefab, component, new Color(0.55f, 0.3f, 1f)); ApplyTrophyAura(val.ItemPrefab, new Color(0.55f, 0.3f, 1f), 1f); ItemManager.Instance.AddItem(val); Logger.LogInfo((object)"[BiomeLords] Registered trophy: TrophySeekerLord"); } private static void BuildLoxLordTrophy() { //IL_000a: 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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) CustomItem val = new CustomItem("TrophyLoxLord", "TrophyLox", new ItemConfig { Name = "$item_trophyloxlord", Description = "$item_trophyloxlord_desc" }); ItemDrop component = val.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData?.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_itemType = (ItemType)13; shared.m_maxStackSize = 1; shared.m_questItem = false; } TintAndRenderIcon(val.ItemPrefab, component, new Color(1f, 0.85f, 0.45f)); ApplyTrophyAura(val.ItemPrefab, new Color(1f, 0.85f, 0.45f), 1f); ItemManager.Instance.AddItem(val); Logger.LogInfo((object)"[BiomeLords] Registered trophy: TrophyLoxLord"); } private static void BuildFenringLordTrophy() { //IL_000a: 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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) CustomItem val = new CustomItem("TrophyFenringLord", "TrophyFenring", new ItemConfig { Name = "$item_trophyfenringlord", Description = "$item_trophyfenringlord_desc" }); ItemDrop component = val.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData?.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_itemType = (ItemType)13; shared.m_maxStackSize = 1; shared.m_questItem = false; } TintAndRenderIcon(val.ItemPrefab, component, new Color(0.65f, 0.85f, 1f)); ApplyTrophyAura(val.ItemPrefab, new Color(0.65f, 0.85f, 1f), 1f); ItemManager.Instance.AddItem(val); Logger.LogInfo((object)"[BiomeLords] Registered trophy: TrophyFenringLord"); } private static void BuildNeckLordTrophy() { //IL_000a: 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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) CustomItem val = new CustomItem("TrophyNeckLord", "TrophyNeck", new ItemConfig { Name = "$item_trophynecklord", Description = "$item_trophynecklord_desc" }); ItemDrop component = val.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData?.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_itemType = (ItemType)13; shared.m_maxStackSize = 1; shared.m_questItem = false; } Color body = default(Color); ((Color)(ref body))..ctor(0.85f, 0.2f, 0.2f, 1f); Color emission = default(Color); ((Color)(ref emission))..ctor(1f, 0.3f, 0.1f, 1f); RetintPrefab(val.ItemPrefab, body, emission); TintAndRenderIcon(val.ItemPrefab, component, new Color(0.9f, 0.2f, 0.2f)); ItemManager.Instance.AddItem(val); Logger.LogInfo((object)"[BiomeLords] Registered trophy: TrophyNeckLord"); } private static void BuildGreydwarfShamanLordTrophy() { //IL_000a: 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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) CustomItem val = new CustomItem("TrophyGreydwarfShamanLord", "TrophyGreydwarfShaman", new ItemConfig { Name = "$item_trophygreydwarflord", Description = "$item_trophygreydwarflord_desc" }); ItemDrop component = val.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData?.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_itemType = (ItemType)13; shared.m_maxStackSize = 1; shared.m_questItem = false; } ApplyTrophyAura(val.ItemPrefab, new Color(0.3f, 1f, 0.2f), 1f); TintAndRenderIcon(val.ItemPrefab, component, new Color(0.3f, 0.9f, 0.25f)); ItemManager.Instance.AddItem(val); Logger.LogInfo((object)"[BiomeLords] Registered trophy: TrophyGreydwarfShamanLord"); } private static void BuildDraugrEliteLordTrophy() { //IL_000a: 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) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) CustomItem val = new CustomItem("TrophyDraugrEliteLord", "TrophyDraugrElite", new ItemConfig { Name = "$item_trophydraugrlord", Description = "$item_trophydraugrlord_desc" }); ItemDrop component = val.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData?.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_itemType = (ItemType)13; shared.m_maxStackSize = 1; shared.m_questItem = false; } TintAndRenderIcon(val.ItemPrefab, component, new Color(0.45f, 0.95f, 0.2f)); ApplyTrophyAura(val.ItemPrefab, new Color(0.45f, 0.95f, 0.2f), 1f); ItemManager.Instance.AddItem(val); Logger.LogInfo((object)"[BiomeLords] Registered trophy: TrophyDraugrEliteLord"); } private static void TintAndRenderIcon(GameObject prefab, ItemDrop drop, Color tint) { //IL_00a6: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prefab == (Object)null || drop?.m_itemData?.m_shared == null) { return; } Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { Material[] sharedMaterials = val.sharedMaterials; if (sharedMaterials == null || sharedMaterials.Length == 0) { continue; } Material[] array = (Material[])(object)new Material[sharedMaterials.Length]; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null)) { Material val2 = new Material(sharedMaterials[j]); if (val2.HasProperty("_Color")) { val2.color = tint; } array[j] = val2; } } val.sharedMaterials = array; } try { RenderRequest val3 = new RenderRequest(prefab) { Width = 64, Height = 64, UseCache = true }; Sprite val4 = RenderManager.Instance.Render(val3); if ((Object)(object)val4 != (Object)null) { drop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val4 }; } } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] Trophy icon render failed: " + ex.Message)); } } private static void ApplyTrophyAura(GameObject prefab, Color lightColor, float scale) { //IL_0010: 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) //IL_0025: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) if (!((Object)(object)prefab == (Object)null)) { prefab.transform.localScale = Vector3.one * scale; GameObject val = new GameObject("BiomeLords_TrophyAura"); val.transform.SetParent(prefab.transform, false); val.transform.localPosition = new Vector3(0f, 0.4f, 0f); Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = lightColor; obj.intensity = 1.5f; obj.range = 2.5f; } } private static void RetintPrefab(GameObject prefab, Color body, Color emission) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prefab == (Object)null) { return; } Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { Material[] sharedMaterials = val.sharedMaterials; if (sharedMaterials == null || sharedMaterials.Length == 0) { continue; } Material[] array = (Material[])(object)new Material[sharedMaterials.Length]; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null)) { Material val2 = new Material(sharedMaterials[j]); if (val2.HasProperty("_Color")) { val2.color = body; } if (val2.HasProperty("_MainColor")) { val2.SetColor("_MainColor", body); } if (val2.HasProperty("_EmissionColor")) { val2.SetColor("_EmissionColor", emission); } array[j] = val2; } } val.sharedMaterials = array; } } } } namespace BiomeLords.Phase1B { public static class CreatureFactory { public const string NeckLordPrefab = "NeckLord"; public const string GreydwarfShamanLordPrefab = "GreydwarfShamanLord"; public const string DraugrEliteLordPrefab = "DraugrEliteLord"; public const string FenringLordPrefab = "FenringLord"; public const string LoxLordPrefab = "LoxLord"; public const string SeekerLordPrefab = "SeekerLord"; public const string FallerValkyrieLordPrefab = "FallerValkyrieLord"; public static void RegisterAll() { BuildNeckLord(); BuildGreydwarfShamanLord(); BuildDraugrEliteLord(); BuildFenringLord(); BuildLoxLord(); BuildSeekerLord(); BuildFallerValkyrieLord(); } private static void BuildNeckLord() { //IL_002f: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown //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_00b9: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Expected O, but got Unknown GameObject val = PrefabManager.Instance.CreateClonedPrefab("NeckLord", "Neck"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[BiomeLords] Failed to clone Neck prefab."); return; } val.transform.localScale = Vector3.one * 1.6f; Color val2 = default(Color); ((Color)(ref val2))..ctor(0.9f, 0.25f, 0.25f, 1f); Renderer[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val3 in materials) { if (!((Object)(object)val3 == (Object)null)) { if (val3.HasProperty("_Color")) { val3.color = val2; } if (val3.HasProperty("_EmissionColor")) { val3.SetColor("_EmissionColor", val2 * 0.4f); } } } } Humanoid component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).m_health = 500f; ((Character)component).m_name = "$enemy_necklord"; } Character component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.m_boss = true; } MonsterAI component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { ((BaseAI)component3).m_avoidFire = false; } CharacterDrop component4 = val.GetComponent(); if ((Object)(object)component4 != (Object)null) { component4.m_drops.Clear(); component4.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Copper"), m_amountMin = 3, m_amountMax = 5, m_chance = 1f, m_onePerPlayer = false, m_levelMultiplier = false }); component4.m_drops.Add(new Drop { m_prefab = (PrefabManager.Instance.GetPrefab("TrophyNeckLord") ?? PrefabManager.Instance.GetPrefab("TrophyNeck")), m_amountMin = 1, m_amountMax = 1, m_chance = 1f, m_onePerPlayer = true, m_levelMultiplier = false }); } val.AddComponent(); CustomCreature val4 = new CustomCreature(val, true); CreatureManager.Instance.AddCreature(val4); RegisteredLords.Register("NeckLord", "biomelords_neck", "neck_lord"); Logger.LogInfo((object)"[BiomeLords] Registered creature: NeckLord"); } private static void BuildGreydwarfShamanLord() { //IL_002f: 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_0053: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Expected O, but got Unknown //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0110: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_0192: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: 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_01cb: Expected O, but got Unknown GameObject val = PrefabManager.Instance.CreateClonedPrefab("GreydwarfShamanLord", "Greydwarf_Shaman"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[BiomeLords] Failed to clone Greydwarf_Shaman prefab."); return; } val.transform.localScale = Vector3.one * 1.7f; AttachLordAura(val, new Color(0.35f, 1f, 0.3f)); Humanoid component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).m_health = 2500f; ((Character)component).m_name = "$enemy_greydwarflord"; } Character component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.m_boss = true; } CharacterDrop component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.m_drops.Clear(); component3.m_drops.Add(new Drop { m_prefab = (PrefabManager.Instance.GetPrefab("TrophyGreydwarfShamanLord") ?? PrefabManager.Instance.GetPrefab("TrophyGreydwarfShaman")), m_amountMin = 1, m_amountMax = 1, m_chance = 1f, m_onePerPlayer = true }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Bronze"), m_amountMin = 3, m_amountMax = 5, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("SurtlingCore"), m_amountMin = 1, m_amountMax = 2, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Coal"), m_amountMin = 5, m_amountMax = 10, m_chance = 1f }); } if ((Object)(object)component != (Object)null) { GameObject val2 = null; GameObject[] defaultItems = component.m_defaultItems; foreach (GameObject val3 in defaultItems) { if ((Object)(object)val3 != (Object)null && ((Object)val3).name.IndexOf("heal", StringComparison.OrdinalIgnoreCase) >= 0) { val2 = val3; break; } } if ((Object)(object)val2 != (Object)null) { ItemDrop component4 = val2.GetComponent(); if ((Object)(object)component4 != (Object)null && component4.m_itemData != null && component4.m_itemData.m_shared != null) { SharedData shared = component4.m_itemData.m_shared; string text = ((shared.m_attack != null) ? shared.m_attack.m_attackAnimation : null); List list = new List(); CollectEffects(shared.m_hitEffect, list); CollectEffects(shared.m_startEffect, list); CollectEffects(shared.m_triggerEffect, list); if (shared.m_attack != null && (Object)(object)shared.m_attack.m_attackProjectile != (Object)null) { list.Add(shared.m_attack.m_attackProjectile); } GreydwarfLordBrain.ConfigureHeal(text, list.ToArray()); Logger.LogInfo((object)$"[BiomeLords] Captured shaman heal cast: anim='{text}', {list.Count} effect(s)."); } } List list2 = new List(); defaultItems = component.m_defaultItems; foreach (GameObject val4 in defaultItems) { if (!((Object)(object)val4 == (Object)null) && ((Object)val4).name.IndexOf("heal", StringComparison.OrdinalIgnoreCase) < 0) { list2.Add(val4); } } component.m_defaultItems = list2.ToArray(); } val.AddComponent(); CustomCreature val5 = new CustomCreature(val, true); CreatureManager.Instance.AddCreature(val5); RegisteredLords.Register("GreydwarfShamanLord", "biomelords_greydwarf", "greydwarf_lord"); Logger.LogInfo((object)"[BiomeLords] Registered creature: GreydwarfShamanLord"); } private static void BuildDraugrEliteLord() { //IL_002f: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0110: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: 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_020a: Expected O, but got Unknown GameObject val = PrefabManager.Instance.CreateClonedPrefab("DraugrEliteLord", "Draugr_Elite"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[BiomeLords] Failed to clone Draugr_Elite prefab."); return; } val.transform.localScale = Vector3.one * 1.3f; AttachLordAura(val, new Color(0.45f, 0.95f, 0.2f)); Humanoid component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).m_health = 5000f; ((Character)component).m_name = "$enemy_draugrlord"; } Character component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.m_boss = true; } CharacterDrop component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.m_drops.Clear(); component3.m_drops.Add(new Drop { m_prefab = (PrefabManager.Instance.GetPrefab("TrophyDraugrEliteLord") ?? PrefabManager.Instance.GetPrefab("TrophyDraugrElite")), m_amountMin = 1, m_amountMax = 1, m_chance = 1f, m_onePerPlayer = true }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Iron"), m_amountMin = 2, m_amountMax = 4, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Coal"), m_amountMin = 5, m_amountMax = 10, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("BoneFragments"), m_amountMin = 5, m_amountMax = 10, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Entrails"), m_amountMin = 3, m_amountMax = 5, m_chance = 1f }); } val.AddComponent(); CustomCreature val2 = new CustomCreature(val, true); CreatureManager.Instance.AddCreature(val2); RegisteredLords.Register("DraugrEliteLord", "biomelords_draugr", "draugr_lord"); Logger.LogInfo((object)"[BiomeLords] Registered creature: DraugrEliteLord"); } private static void BuildFenringLord() { //IL_002f: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0110: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_0192: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown GameObject val = PrefabManager.Instance.CreateClonedPrefab("FenringLord", "Fenring"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[BiomeLords] Failed to clone Fenring prefab."); return; } val.transform.localScale = Vector3.one * 1.4f; AttachLordAura(val, new Color(0.6f, 0.85f, 1f)); Humanoid component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).m_health = 7500f; ((Character)component).m_name = "$enemy_fenringlord"; } Character component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.m_boss = true; } CharacterDrop component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.m_drops.Clear(); component3.m_drops.Add(new Drop { m_prefab = (PrefabManager.Instance.GetPrefab("TrophyFenringLord") ?? PrefabManager.Instance.GetPrefab("TrophyFenring")), m_amountMin = 1, m_amountMax = 1, m_chance = 1f, m_onePerPlayer = true }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("WolfFang"), m_amountMin = 3, m_amountMax = 5, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("WolfPelt"), m_amountMin = 2, m_amountMax = 4, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("FreezeGland"), m_amountMin = 1, m_amountMax = 2, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Silver"), m_amountMin = 1, m_amountMax = 2, m_chance = 1f }); } val.AddComponent(); CustomCreature val2 = new CustomCreature(val, true); CreatureManager.Instance.AddCreature(val2); RegisteredLords.Register("FenringLord", "biomelords_fenring", "fenring_lord"); Logger.LogInfo((object)"[BiomeLords] Registered creature: FenringLord"); } private static void BuildLoxLord() { //IL_002f: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //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_011e: 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) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_0182: Expected O, but got Unknown //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_01c8: 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_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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown GameObject val = PrefabManager.Instance.CreateClonedPrefab("LoxLord", "Lox"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[BiomeLords] Failed to clone Lox prefab."); return; } val.transform.localScale = Vector3.one * 1.25f; AttachLordAura(val, new Color(1f, 0.85f, 0.45f)); Humanoid component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).m_health = 10000f; ((Character)component).m_name = "$enemy_loxlord"; } Character component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.m_boss = true; } Tameable component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { Object.DestroyImmediate((Object)(object)component3); } Procreation component4 = val.GetComponent(); if ((Object)(object)component4 != (Object)null) { Object.DestroyImmediate((Object)(object)component4); } CharacterDrop component5 = val.GetComponent(); if ((Object)(object)component5 != (Object)null) { component5.m_drops.Clear(); component5.m_drops.Add(new Drop { m_prefab = (PrefabManager.Instance.GetPrefab("TrophyLoxLord") ?? PrefabManager.Instance.GetPrefab("TrophyLox")), m_amountMin = 1, m_amountMax = 1, m_chance = 1f, m_onePerPlayer = true }); component5.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("LoxMeat"), m_amountMin = 3, m_amountMax = 5, m_chance = 1f }); component5.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("LoxPelt"), m_amountMin = 2, m_amountMax = 4, m_chance = 1f }); component5.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Barley"), m_amountMin = 8, m_amountMax = 15, m_chance = 1f }); component5.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("BlackMetalScrap"), m_amountMin = 1, m_amountMax = 3, m_chance = 1f }); } val.AddComponent(); CustomCreature val2 = new CustomCreature(val, true); CreatureManager.Instance.AddCreature(val2); RegisteredLords.Register("LoxLord", "biomelords_lox", "lox_lord"); Logger.LogInfo((object)"[BiomeLords] Registered creature: LoxLord"); } private static void BuildSeekerLord() { //IL_002f: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0110: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_0192: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown GameObject val = PrefabManager.Instance.CreateClonedPrefab("SeekerLord", "Seeker"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[BiomeLords] Failed to clone Seeker prefab."); return; } val.transform.localScale = Vector3.one * 1.4f; AttachLordAura(val, new Color(0.55f, 0.3f, 1f)); Humanoid component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).m_health = 12500f; ((Character)component).m_name = "$enemy_seekerlord"; } Character component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.m_boss = true; } CharacterDrop component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.m_drops.Clear(); component3.m_drops.Add(new Drop { m_prefab = (PrefabManager.Instance.GetPrefab("TrophySeekerLord") ?? PrefabManager.Instance.GetPrefab("TrophySeeker")), m_amountMin = 1, m_amountMax = 1, m_chance = 1f, m_onePerPlayer = true }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Carapace"), m_amountMin = 3, m_amountMax = 5, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Sap"), m_amountMin = 2, m_amountMax = 4, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Eitr"), m_amountMin = 1, m_amountMax = 3, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Mandible"), m_amountMin = 1, m_amountMax = 2, m_chance = 1f }); } val.AddComponent(); CustomCreature val2 = new CustomCreature(val, true); CreatureManager.Instance.AddCreature(val2); RegisteredLords.Register("SeekerLord", "biomelords_seeker", "seeker_lord"); Logger.LogInfo((object)"[BiomeLords] Registered creature: SeekerLord"); } private static void BuildFallerValkyrieLord() { //IL_002f: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0110: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: 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_020a: Expected O, but got Unknown GameObject val = PrefabManager.Instance.CreateClonedPrefab("FallerValkyrieLord", "FallenValkyrie"); if ((Object)(object)val == (Object)null) { Logger.LogError((object)"[BiomeLords] Failed to clone FallenValkyrie prefab."); return; } val.transform.localScale = Vector3.one * 1.3f; AttachLordAura(val, new Color(1f, 0.95f, 0.75f)); Humanoid component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).m_health = 25000f; ((Character)component).m_name = "$enemy_fallervalkyrielord"; } Character component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.m_boss = true; } CharacterDrop component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.m_drops.Clear(); component3.m_drops.Add(new Drop { m_prefab = (PrefabManager.Instance.GetPrefab("TrophyFallerValkyrieLord") ?? PrefabManager.Instance.GetPrefab("TrophyFallenValkyrie")), m_amountMin = 1, m_amountMax = 1, m_chance = 1f, m_onePerPlayer = true }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("FlametalNew"), m_amountMin = 2, m_amountMax = 4, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("Coal"), m_amountMin = 10, m_amountMax = 20, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("CharredBone"), m_amountMin = 3, m_amountMax = 6, m_chance = 1f }); component3.m_drops.Add(new Drop { m_prefab = PrefabManager.Instance.GetPrefab("SulfurStone"), m_amountMin = 4, m_amountMax = 8, m_chance = 1f }); } val.AddComponent(); CustomCreature val2 = new CustomCreature(val, true); CreatureManager.Instance.AddCreature(val2); RegisteredLords.Register("FallerValkyrieLord", "biomelords_fallervalkyrie", "faller_valkyrie_lord"); Logger.LogInfo((object)"[BiomeLords] Registered creature: FallerValkyrieLord"); } private static void CollectEffects(EffectList list, List dst) { if (list == null || list.m_effectPrefabs == null) { return; } EffectData[] effectPrefabs = list.m_effectPrefabs; foreach (EffectData val in effectPrefabs) { if (val != null && (Object)(object)val.m_prefab != (Object)null) { dst.Add(val.m_prefab); } } } private static void AttachLordAura(GameObject lord, Color lightColor) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0032: 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_00b6: 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_00d0: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BiomeLords_Aura"); val.transform.SetParent(lord.transform, false); val.transform.localPosition = new Vector3(0f, 1.2f, 0f); Light obj = val.AddComponent(); obj.type = (LightType)2; obj.color = lightColor; obj.intensity = 2.5f; obj.range = 5f; string[] array = new string[3] { "fx_firepit", "fx_torch_basic", "vfx_firewisp" }; foreach (string text in array) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); if (!((Object)(object)prefab == (Object)null)) { GameObject obj2 = Object.Instantiate(prefab, val.transform); obj2.transform.localPosition = Vector3.zero; obj2.transform.localScale = Vector3.one * 0.5f; ((Object)obj2).name = "BiomeLords_AuraFx"; Logger.LogInfo((object)("[BiomeLords] Lord aura particle: " + text)); break; } } } } public static class EventFactory { public const string NeckLordEvent = "biomelords_neck"; public const string GreydwarfLordEvent = "biomelords_greydwarf"; public const string DraugrLordEvent = "biomelords_draugr"; public const string FenringLordEvent = "biomelords_fenring"; public const string LoxLordEvent = "biomelords_lox"; public const string SeekerLordEvent = "biomelords_seeker"; public const string FallerValkyrieLordEvent = "biomelords_fallervalkyrie"; private static readonly Dictionary EventByLord = new Dictionary { { "neck_lord", "biomelords_neck" }, { "greydwarf_lord", "biomelords_greydwarf" }, { "draugr_lord", "biomelords_draugr" }, { "fenring_lord", "biomelords_fenring" }, { "lox_lord", "biomelords_lox" }, { "seeker_lord", "biomelords_seeker" }, { "faller_valkyrie_lord", "biomelords_fallervalkyrie" } }; public static string EventNameFor(string lordId) { if (!EventByLord.TryGetValue(lordId, out var value)) { return null; } return value; } public static void RegisterAll() { RandEventSystem instance = RandEventSystem.instance; if ((Object)(object)instance == (Object)null) { Logger.LogWarning((object)"[BiomeLords] RandEventSystem not ready; events skipped."); return; } RegisterEvent(instance, BuildNeckEvent()); RegisterEvent(instance, BuildGreydwarfEvent()); RegisterEvent(instance, BuildDraugrEvent()); RegisterEvent(instance, BuildFenringEvent()); RegisterEvent(instance, BuildLoxEvent()); RegisterEvent(instance, BuildSeekerEvent()); RegisterEvent(instance, BuildFallerValkyrieEvent()); } private static RandomEvent BuildFallerValkyrieEvent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0030: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown return new RandomEvent { m_name = "biomelords_fallervalkyrie", m_enabled = true, m_random = false, m_duration = 600f, m_nearBaseOnly = false, m_pauseIfNoPlayerInArea = true, m_biome = (Biome)32, m_startMessage = "$biomelords_summon_fallervalkyrie_start", m_endMessage = "$biomelords_summon_fallervalkyrie_end", m_forceEnvironment = "AshRain", m_forceMusic = "boss_eikthyr" }; } private static RandomEvent BuildSeekerEvent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0030: 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_003d: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown return new RandomEvent { m_name = "biomelords_seeker", m_enabled = true, m_random = false, m_duration = 600f, m_nearBaseOnly = false, m_pauseIfNoPlayerInArea = true, m_biome = (Biome)512, m_startMessage = "$biomelords_summon_seeker_start", m_endMessage = "$biomelords_summon_seeker_end", m_forceEnvironment = "Misty", m_forceMusic = "boss_eikthyr" }; } private static RandomEvent BuildLoxEvent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0030: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown return new RandomEvent { m_name = "biomelords_lox", m_enabled = true, m_random = false, m_duration = 600f, m_nearBaseOnly = false, m_pauseIfNoPlayerInArea = true, m_biome = (Biome)16, m_startMessage = "$biomelords_summon_lox_start", m_endMessage = "$biomelords_summon_lox_end", m_forceEnvironment = "Misty", m_forceMusic = "boss_eikthyr" }; } private static RandomEvent BuildFenringEvent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0030: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown return new RandomEvent { m_name = "biomelords_fenring", m_enabled = true, m_random = false, m_duration = 600f, m_nearBaseOnly = false, m_pauseIfNoPlayerInArea = true, m_biome = (Biome)4, m_startMessage = "$biomelords_summon_fenring_start", m_endMessage = "$biomelords_summon_fenring_end", m_forceEnvironment = "SnowStorm", m_forceMusic = "boss_eikthyr" }; } private static void RegisterEvent(RandEventSystem sys, RandomEvent evt) { if (!sys.m_events.Exists((RandomEvent e) => e.m_name == evt.m_name)) { sys.m_events.Add(evt); Logger.LogInfo((object)("[BiomeLords] Registered event: " + evt.m_name)); } } private static RandomEvent BuildNeckEvent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0030: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown return new RandomEvent { m_name = "biomelords_neck", m_enabled = true, m_random = false, m_duration = 600f, m_nearBaseOnly = false, m_pauseIfNoPlayerInArea = true, m_biome = (Biome)9, m_startMessage = "$biomelords_summon_neck_start", m_endMessage = "$biomelords_summon_neck_end", m_forceEnvironment = "Rain", m_forceMusic = "boss_eikthyr" }; } private static RandomEvent BuildGreydwarfEvent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0030: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown return new RandomEvent { m_name = "biomelords_greydwarf", m_enabled = true, m_random = false, m_duration = 600f, m_nearBaseOnly = false, m_pauseIfNoPlayerInArea = true, m_biome = (Biome)9, m_startMessage = "$biomelords_summon_greydwarf_start", m_endMessage = "$biomelords_summon_greydwarf_end", m_forceEnvironment = "Misty", m_forceMusic = "boss_eikthyr" }; } private static RandomEvent BuildDraugrEvent() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0030: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown return new RandomEvent { m_name = "biomelords_draugr", m_enabled = true, m_random = false, m_duration = 600f, m_nearBaseOnly = false, m_pauseIfNoPlayerInArea = true, m_biome = (Biome)2, m_startMessage = "$biomelords_summon_draugr_start", m_endMessage = "$biomelords_summon_draugr_end", m_forceEnvironment = "SwampRain", m_forceMusic = "boss_eikthyr" }; } } public static class ItemFactory { public const string LordsHornPrefab = "LordsHorn"; public static void RegisterAll() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_005e: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00a0: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: 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_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: 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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_042e: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_0500: 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_052a: 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_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_057e: 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_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: 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_0626: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_068f: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: Unknown result type (might be due to invalid IL or missing references) //IL_07b5: Unknown result type (might be due to invalid IL or missing references) //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0833: Unknown result type (might be due to invalid IL or missing references) //IL_0848: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Unknown result type (might be due to invalid IL or missing references) //IL_0872: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Unknown result type (might be due to invalid IL or missing references) //IL_089c: Unknown result type (might be due to invalid IL or missing references) //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08c6: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08f0: Unknown result type (might be due to invalid IL or missing references) //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_091a: Unknown result type (might be due to invalid IL or missing references) //IL_092f: Unknown result type (might be due to invalid IL or missing references) //IL_0944: Unknown result type (might be due to invalid IL or missing references) //IL_0959: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_0983: Unknown result type (might be due to invalid IL or missing references) //IL_0998: Unknown result type (might be due to invalid IL or missing references) //IL_09ad: Unknown result type (might be due to invalid IL or missing references) //IL_09c2: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09ec: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_0a16: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a40: Unknown result type (might be due to invalid IL or missing references) //IL_0a55: Unknown result type (might be due to invalid IL or missing references) //IL_0a6a: Unknown result type (might be due to invalid IL or missing references) //IL_0a7f: Unknown result type (might be due to invalid IL or missing references) //IL_0a94: Unknown result type (might be due to invalid IL or missing references) //IL_0aa9: Unknown result type (might be due to invalid IL or missing references) //IL_0ac3: Expected O, but got Unknown //IL_0bca: Unknown result type (might be due to invalid IL or missing references) //IL_0bcb: Unknown result type (might be due to invalid IL or missing references) //IL_0bd7: Unknown result type (might be due to invalid IL or missing references) //IL_0bdc: Unknown result type (might be due to invalid IL or missing references) //IL_0be4: Unknown result type (might be due to invalid IL or missing references) //IL_0bec: Unknown result type (might be due to invalid IL or missing references) //IL_0bf3: Unknown result type (might be due to invalid IL or missing references) //IL_0c0a: Expected O, but got Unknown //IL_0b3a: Unknown result type (might be due to invalid IL or missing references) //IL_0b42: Unknown result type (might be due to invalid IL or missing references) //IL_0b52: Unknown result type (might be due to invalid IL or missing references) //IL_0b6e: Unknown result type (might be due to invalid IL or missing references) //IL_0b7a: Unknown result type (might be due to invalid IL or missing references) ItemConfig val = new ItemConfig(); val.Name = "$item_lordshorn"; val.Description = "$item_lordshorn_desc"; val.CraftingStation = CraftingStations.Workbench; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig { Item = "NeckTail", Amount = 5, Recover = false }, new RequirementConfig { Item = "TrophyDeer", Amount = 1, Recover = false }, new RequirementConfig { Item = "Bronze", Amount = 1, Recover = false } }; CustomItem val2 = new CustomItem("LordsHorn", "TankardAnniversary", val); LocalizationManager.Instance.AddLocalization(new LocalizationConfig("English") { Translations = { { "item_lordshorn", "Lord's Horn" } }, Translations = { { "item_lordshorn_desc", "A primal horn that calls forth the Lord of the current biome — if you have proven yourself a worthy hunter." } }, Translations = { { "enemy_necklord", "Neck Lord" } }, Translations = { { "biomelords_summon_neck_start", "The marshes ripple… something ancient stirs." } }, Translations = { { "biomelords_summon_neck_end", "The waters fall still. The Neck Lord is no more." } }, Translations = { { "biomelords_horn_fail_biome", "The horn falls silent. No Lord rules this land." } }, Translations = { { "biomelords_horn_fail_kills", "The horn refuses you. You are not yet a proven hunter here." } }, Translations = { { "biomelords_horn_fail_day", "The horn lies silent under the sun. The Lord answers only by night." } }, Translations = { { "item_consumable", "Consumable" } }, Translations = { { "item_trophynecklord", "Trophy of the Neck Lord" } }, Translations = { { "item_trophynecklord_desc", "The horned skull of the Neck Lord. Mount it on a Lord's Pedestal to draw upon its spirit." } }, Translations = { { "piece_lordspedestal", "Lord's Pedestal" } }, Translations = { { "piece_lordspedestal_desc", "A gilded ceremonial stand that holds the trophy of a fallen Lord. Glows softly when erected. Place several side-by-side to form your own Hall of the Lords." } }, Translations = { { "se_necklordspirit", "Fisher's Boon" } }, Translations = { { "se_necklordspirit_tooltip", "The Neck Lord's gift. Your fishing casts have a chance to spare the bait, and a chance to land a bonus fish on the catch." } }, Translations = { { "se_necklordspirit_start", "The Neck Lord's spirit settles upon your line." } }, Translations = { { "se_necklordspirit_stop", "The Neck Lord's spirit drifts away." } }, Translations = { { "enemy_greydwarflord", "Greydwarf Shaman Lord" } }, Translations = { { "item_trophygreydwarflord", "Trophy of the Greydwarf Shaman Lord" } }, Translations = { { "item_trophygreydwarflord_desc", "The mossy skull of the Greydwarf Shaman Lord. Mount it on a Lord's Pedestal to draw upon its spirit." } }, Translations = { { "biomelords_summon_greydwarf_start", "The greenwood stirs… ancient eyes open." } }, Translations = { { "biomelords_summon_greydwarf_end", "The forest grows still. The Shaman Lord falls." } }, Translations = { { "enemy_draugrlord", "Draugr Elite Lord" } }, Translations = { { "item_trophydraugrlord", "Trophy of the Draugr Elite Lord" } }, Translations = { { "item_trophydraugrlord_desc", "The crowned skull of the Draugr Elite Lord. Mount it on a Lord's Pedestal to draw upon its spirit." } }, Translations = { { "biomelords_summon_draugr_start", "A miasma rises from the bog… the dead king walks." } }, Translations = { { "biomelords_summon_draugr_end", "The bog grows quiet. The Draugr Lord returns to dust." } }, Translations = { { "biomelords_plague_cloud", "A choking miasma billows out — do not stand in it." } }, Translations = { { "biomelords_undying_surge", "The Draugr Lord tears the life-force from everything around it!" } }, Translations = { { "biomelords_undying_surge_fail", "The Draugr Lord's hunger finds no prey — its surge fails!" } }, Translations = { { "se_draugrwound", "Wounded" } }, Translations = { { "se_draugrlordspirit", "Iron Vein" } }, Translations = { { "se_draugrlordspirit_tooltip", "The Draugr Lord's gift. Mining iron from Swamp ores has a chance to yield an extra piece." } }, Translations = { { "se_draugrlordspirit_start", "The Draugr Lord's spirit hardens your strike." } }, Translations = { { "se_draugrlordspirit_stop", "The Draugr Lord's spirit fades." } }, Translations = { { "se_greydwarflordspirit", "Quick Sprout" } }, Translations = { { "se_greydwarflordspirit_tooltip", "Planted crops within 30 m grow about 30 % faster while this blessing endures." } }, Translations = { { "se_greydwarflordspirit_start", "The Greydwarf Shaman whispers to the seeds you've sown." } }, Translations = { { "se_greydwarflordspirit_stop", "The Greydwarf Shaman's whisper fades." } }, Translations = { { "biomelords_pedestal_receive", "Receive blessing" } }, Translations = { { "biomelords_pedestal_unknown_trophy", "This is not a Trophy of a Lord." } }, Translations = { { "biomelords_blessing_spent", "The spirit is spent. Hunt the Lord again to draw upon it." } }, Translations = { { "biomelords_blessing_cooldown", "The spirit gathers — wait a moment." } }, Translations = { { "biomelords_blessing_lastuse", "The Trophy crumbles to dust. The Lord's spirit is spent — hunt it anew to restore the blessing." } }, Translations = { { "biomelords_pedestal_locked", "The Trophy is bound to the pedestal until its spirit is spent." } }, Translations = { { "biomelords_pedestal_lockedhint", "Bound — cannot be removed until charges are spent." } }, Translations = { { "biomelords_pedestal_destroy_locked", "The Pedestal cannot be removed while a Lord's trophy is mounted." } }, Translations = { { "gp_tidesgrace", "Tide's Grace" } }, Translations = { { "gp_tidesgrace_tooltip", "The Neck Lord's mastery of water flows through you.\nWhile swimming, your stamina is restored instead of drained.\nWhile Wet, all of your melee attacks deal +50% damage — and the Wet status can no longer harm you." } }, Translations = { { "gp_tidesgrace_start", "The tide answers your call." } }, Translations = { { "gp_tidesgrace_stop", "The tide recedes from you." } }, Translations = { { "gp_forestsembrace", "Forest's Embrace" } }, Translations = { { "gp_forestsembrace_tooltip", "The trees themselves shelter you.\nStanding by any mature tree counts as shelter.\nSit (use the /sit emote or a chair) beside a tree with no monsters within 30 metres to heal — the older the tree, the stronger the gift (1 HP near Beech up to 6 HP near Charred trees, every 3 seconds). After 60 seconds of seated rest the forest grants you a Rested buff. Older trees grant more comfort, extending the Rested time (Beech +1, Oak +2, Yggdrasil/Charred +3)." } }, Translations = { { "gp_forestsembrace_start", "The forest folds itself around you." } }, Translations = { { "gp_forestsembrace_stop", "The forest releases you." } }, Translations = { { "gp_plaguebearer", "Plague Bearer" } }, Translations = { { "gp_plaguebearer_tooltip", "Poison cannot touch you. Your poison strikes burn fiercer." } }, Translations = { { "gp_plaguebearer_start", "The rot is yours to wield." } }, Translations = { { "gp_plaguebearer_stop", "The rot leaves you." } }, Translations = { { "gp_howlofthepack", "Howl of the Pack" } }, Translations = { { "gp_howlofthepack_tooltip", "The Fenring's call answers.\nOn activation, every tamed creature within 30 m is fully healed and marked with the pack's ember light.\nA ghostly violet Phantom Wolf fights at your side for 60 s.\nAny tamed wolf within 30 m deals +100% damage for 10 minutes.\n\nSynergy with Pack Whisperer: if the blessing is active when you press F, tamed wolves take −85% damage (instead of −50%), the Phantom Wolf endures for 2 minutes and ignores all incoming damage, and your Blood Magic swells the pack — 50+ summons 2 wolves, 100 summons 3." } }, Translations = { { "gp_howlofthepack_start", "The pack answers your call." } }, Translations = { { "gp_howlofthepack_stop", "The pack returns to the wild." } }, Translations = { { "gp_howlofthepack_phantom", "A phantom wolf joins your side." } }, Translations = { { "gp_howlofthepack_phantom_synergy", "The pack answers in full — a phantom wolf joins your side, and the blessing's bond runs deeper." } }, Translations = { { "enemy_phantomwolf", "Phantom Wolf" } }, Translations = { { "enemy_fenringlord", "Fenring Lord" } }, Translations = { { "item_trophyfenringlord", "Trophy of the Fenring Lord" } }, Translations = { { "item_trophyfenringlord_desc", "The frostbitten skull of the Fenring Lord. Mount it on a Lord's Pedestal to draw upon its spirit." } }, Translations = { { "biomelords_summon_fenring_start", "The mountain howls… the pack stirs." } }, Translations = { { "biomelords_summon_fenring_end", "The wind grows still. The Fenring Lord falls." } }, Translations = { { "se_fenringlordspirit", "Pack Whisperer" } }, Translations = { { "se_fenringlordspirit_tooltip", "The Fenring Lord's gift. Tamed wolves within 30 m take −50% damage and breed twice as fast." } }, Translations = { { "se_fenringlordspirit_start", "The pack senses one of its own." } }, Translations = { { "se_fenringlordspirit_stop", "The pack's bond fades." } }, Translations = { { "enemy_loxlord", "Lox Lord" } }, Translations = { { "item_trophyloxlord", "Trophy of the Lox Lord" } }, Translations = { { "item_trophyloxlord_desc", "The matted skull of the Lox Lord. Mount it on a Lord's Pedestal to draw upon its spirit." } }, Translations = { { "biomelords_summon_lox_start", "The grasslands tremble… a great beast bellows." } }, Translations = { { "biomelords_summon_lox_end", "The thunder of hooves ends. The Lox Lord falls." } }, Translations = { { "biomelords_lox_bellow", "A bone-shaking bellow knocks you back!" } }, Translations = { { "biomelords_lox_bulwark", "The Lox Lord digs in, hide hardening like stone!" } }, Translations = { { "se_loxlordspirit", "Hearth Master" } }, Translations = { { "se_loxlordspirit_tooltip", "The Lox Lord's gift. Food buffs you eat last +100% longer." } }, Translations = { { "se_loxlordspirit_start", "The Lox Lord blesses your hearth." } }, Translations = { { "se_loxlordspirit_stop", "The hearth's warmth fades." } }, Translations = { { "enemy_seekerlord", "Seeker Lord" } }, Translations = { { "item_trophyseekerlord", "Trophy of the Seeker Lord" } }, Translations = { { "item_trophyseekerlord_desc", "The chitinous skull of the Seeker Lord, still humming with hive resonance. Mount it on a Lord's Pedestal to draw upon its spirit." } }, Translations = { { "biomelords_summon_seeker_start", "The mist hums… the hive marks you." } }, Translations = { { "biomelords_summon_seeker_end", "The hum dies away. The Seeker Lord is undone." } }, Translations = { { "se_seekerlordspirit", "Refiner's Touch" } }, Translations = { { "se_seekerlordspirit_tooltip", "The Seeker Lord's gift. Smelters, Blast Furnaces, Spinning Wheels and Eitr Refineries near you have a chance to yield a bonus output." } }, Translations = { { "se_seekerlordspirit_start", "The hive bends raw matter to your will." } }, Translations = { { "se_seekerlordspirit_stop", "The hive's gift fades." } }, Translations = { { "enemy_fallervalkyrielord", "Fallen Valkyrie Lord" } }, Translations = { { "item_trophyfallervalkyrielord", "Trophy of the Fallen Valkyrie Lord" } }, Translations = { { "item_trophyfallervalkyrielord_desc", "The radiant, ash-streaked skull of the Fallen Valkyrie Lord. Mount it on a Lord's Pedestal to draw upon its spirit." } }, Translations = { { "biomelords_summon_fallervalkyrie_start", "The ashen sky tears open… a fallen Valkyrie descends." } }, Translations = { { "biomelords_summon_fallervalkyrie_end", "The light fades from the sky. The Fallen Valkyrie Lord is slain." } }, Translations = { { "se_fallervalkyrielordspirit", "Featherweight" } }, Translations = { { "se_fallervalkyrielordspirit_tooltip", "The Fallen Valkyrie Lord's gift. Her wings bear your burdens: carry up to 1000 weight with no encumbrance penalty — walk, run and recover stamina freely until you reach the cap. Also grants +2 inventory rows. Switch blessings and anything in those extra rows spills into a crate at your feet." } }, Translations = { { "se_fallervalkyrielordspirit_start", "Your burdens turn weightless." } }, Translations = { { "se_fallervalkyrielordspirit_stop", "The weight of the world returns." } }, Translations = { { "biomelords_featherweight_crate", "Featherweight fades — your extra packs spill into a crate." } }, Translations = { { "biomelords_featherweight_dropped", "Featherweight fades — your extra packs tumble to the ground." } }, Translations = { { "gp_bullrush", "Bull Rush" } }, Translations = { { "gp_bullrush_tooltip", "Unstoppable. Cannot be staggered, attacks cost −50% stamina, adrenaline surges +100% with every strike." } }, Translations = { { "gp_bullrush_start", "Nothing shall move you." } }, Translations = { { "gp_bullrush_stop", "The strength of the beast leaves you." } }, Translations = { { "gp_hivesight", "Hive Sight" } }, Translations = { { "gp_hivesight_tooltip", "The hive shows you its prey.\nFor 10 minutes, every hostile creature within 80 m is marked on your minimap and pulses with a faint sign — visible even through stone and mist." } }, Translations = { { "gp_hivesight_start", "The hive opens its many eyes." } }, Translations = { { "gp_hivesight_stop", "The hive closes its eyes." } }, Translations = { { "gp_valkyrieascension", "Valkyrie's Rally" } }, Translations = { { "gp_valkyrieascension_tooltip", "The fallen Valkyrie answers your call to arms.\nEvery player within 20 m — you and your kin — is restored in an instant:\n• Health, Stamina and Eitr filled to the brim\n• Adrenaline maxed, if a trinket is worn\n• A max-level shield bubble, as from the Staff of Protection\n• A 20-minute Rested buff" } }, Translations = { { "gp_valkyrieascension_start", "You raise the Valkyrie's banner." } }, Translations = { { "gp_valkyrieascension_stop", "The banner lowers." } }, Translations = { { "gp_valkyrieascension_rallied", "The Valkyrie's grace restores you." } }, Translations = { { "se_forestsit", "Resting under a tree" } }, Translations = { { "se_forestsit_tooltip", "Seated beneath the boughs. Stay seated long enough and the forest will grant you the Rested buff." } }, Translations = { { "biomelords_power_awarded", "The Lord's spirit chooses you — its power is yours." } } }); ItemDrop component = val2.ItemPrefab.GetComponent(); if ((Object)(object)component != (Object)null && component.m_itemData != null && component.m_itemData.m_shared != null) { SharedData shared = component.m_itemData.m_shared; shared.m_equipStatusEffect = null; shared.m_setStatusEffect = null; shared.m_attackStatusEffect = null; shared.m_consumeStatusEffect = null; shared.m_setName = ""; shared.m_setSize = 0; shared.m_animationState = (AnimationState)0; shared.m_itemType = (ItemType)2; shared.m_maxStackSize = 1; shared.m_attachOverride = (ItemType)0; shared.m_useDurability = false; shared.m_questItem = false; Logger.LogInfo((object)$"[BiomeLords] LordsHorn shared: itemType={shared.m_itemType}, attachOverride={shared.m_attachOverride}"); } Color body = default(Color); ((Color)(ref body))..ctor(0.15f, 0.55f, 0.85f, 1f); Color emission = default(Color); ((Color)(ref emission))..ctor(0.05f, 0.7f, 1f, 1f); RetintPrefab(val2.ItemPrefab, body, emission); try { RenderRequest val3 = new RenderRequest(val2.ItemPrefab) { Width = 64, Height = 64, UseCache = true, TargetPlugin = ((BaseUnityPlugin)Plugin.Instance).Info.Metadata }; Sprite val4 = RenderManager.Instance.Render(val3); if ((Object)(object)val4 != (Object)null && (Object)(object)component != (Object)null) { component.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val4 }; } } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] Icon render failed: " + ex.Message)); } ItemManager.Instance.AddItem(val2); Logger.LogInfo((object)"[BiomeLords] Registered item: LordsHorn"); } private static void RetintPrefab(GameObject prefab, Color body, Color emission) { //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0057: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prefab == (Object)null) { return; } Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { Material[] sharedMaterials = val.sharedMaterials; if (sharedMaterials == null || sharedMaterials.Length == 0) { continue; } Material[] array = (Material[])(object)new Material[sharedMaterials.Length]; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null)) { Material val2 = new Material(sharedMaterials[j]); if (val2.HasProperty("_Color")) { val2.color = body; } if (val2.HasProperty("_MainColor")) { val2.SetColor("_MainColor", body); } if (val2.HasProperty("_EmissionColor")) { val2.SetColor("_EmissionColor", emission); } array[j] = val2; } } val.sharedMaterials = array; } ParticleSystem[] componentsInChildren2 = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { MainModule main = componentsInChildren2[i].main; ((MainModule)(ref main)).startColor = new MinMaxGradient(emission); } Light[] componentsInChildren3 = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { componentsInChildren3[i].color = emission; } } } public static class LordFx { public class FxSet { public string[] Burst = Array.Empty(); public string[] BurstTimed = Array.Empty(); public string Roar = "fx_Fader_Roar"; public int SparkRing = 6; public float SparkR = 1.5f; } private static readonly Dictionary Summon; private static readonly Dictionary Death; static LordFx() { Summon = new Dictionary(); Death = new Dictionary(); Summon["neck_lord"] = new FxSet { Burst = new string[6] { "fx_summon_start", "vfx_prespawn", "vfx_MeadSplash", "fx_himminafl_aoe", "fx_redlightning_burst", "fx_chainlightning_hit" }, BurstTimed = new string[1] { "vfx_water_surface" }, SparkRing = 6 }; Death["neck_lord"] = new FxSet { Burst = new string[6] { "vfx_eikthyr_death", "vfx_BonemassDeath", "vfx_MeadSplash", "vfx_corpse_destruction_small", "fx_himminafl_aoe", "fx_redlightning_burst" }, BurstTimed = new string[1] { "vfx_water_surface" }, SparkRing = 12 }; Summon["greydwarf_lord"] = new FxSet { Burst = new string[5] { "fx_summon_start", "vfx_prespawn", "fx_gdking_rootspawn", "vfx_gdking_stomp", "fx_himminafl_aoe" }, SparkRing = 8 }; Death["greydwarf_lord"] = new FxSet { Burst = new string[6] { "vfx_greydwarf_elite_death", "fx_gdking_rootspawn", "vfx_gdking_stomp", "vfx_corpse_destruction_small", "fx_himminafl_aoe", "fx_redlightning_burst" }, SparkRing = 12 }; Summon["draugr_lord"] = new FxSet { Burst = new string[5] { "fx_summon_start", "vfx_prespawn", "vfx_DraugrSpawn", "vfx_blob_attack", "fx_himminafl_aoe" }, SparkRing = 8 }; Death["draugr_lord"] = new FxSet { Burst = new string[6] { "vfx_draugr_death", "vfx_BonemassDeath", "vfx_blob_attack", "vfx_corpse_destruction_small", "fx_himminafl_aoe", "fx_redlightning_burst" }, SparkRing = 12 }; Summon["fenring_lord"] = new FxSet { Burst = new string[5] { "fx_summon_start", "vfx_prespawn", "fx_himminafl_aoe", "fx_chainlightning_hit", "vfx_FreezeGland_explosion" }, BurstTimed = new string[1] { "vfx_frostbolt_explode" }, SparkRing = 8 }; Death["fenring_lord"] = new FxSet { Burst = new string[5] { "vfx_fenring_death", "vfx_corpse_destruction_small", "fx_himminafl_aoe", "vfx_FreezeGland_explosion", "fx_redlightning_burst" }, BurstTimed = new string[1] { "vfx_frostbolt_explode" }, SparkRing = 12 }; Summon["lox_lord"] = new FxSet { Burst = new string[5] { "fx_summon_start", "vfx_prespawn", "vfx_gdking_stomp", "fx_himminafl_aoe", "fx_crit" }, SparkRing = 8 }; Death["lox_lord"] = new FxSet { Burst = new string[5] { "vfx_lox_death", "vfx_corpse_destruction_small", "vfx_gdking_stomp", "fx_himminafl_aoe", "fx_redlightning_burst" }, SparkRing = 12 }; Summon["seeker_lord"] = new FxSet { Burst = new string[5] { "fx_summon_start", "vfx_prespawn", "fx_himminafl_aoe", "vfx_seeker_attack", "fx_chainlightning_hit" }, SparkRing = 10 }; Death["seeker_lord"] = new FxSet { Burst = new string[5] { "vfx_seeker_death", "vfx_corpse_destruction_small", "fx_himminafl_aoe", "vfx_seeker_attack", "fx_redlightning_burst" }, SparkRing = 14 }; Summon["faller_valkyrie_lord"] = new FxSet { Burst = new string[6] { "fx_summon_start", "vfx_prespawn", "fx_Fader_Fissure_Prespawn", "fx_himminafl_aoe", "fx_fallenvalkyrie_screech", "fx_crit" }, BurstTimed = new string[1] { "vfx_meteor_explosion" }, SparkRing = 10 }; Death["faller_valkyrie_lord"] = new FxSet { Burst = new string[5] { "fx_fallenvalkyrie_death", "fx_Fader_CorpseExplosion", "vfx_corpse_destruction_small", "fx_himminafl_aoe", "fx_redlightning_burst" }, BurstTimed = new string[1] { "vfx_meteor_explosion" }, SparkRing = 16 }; } public static void PlaySummon(string lordId, Vector3 pos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Play(Summon, lordId, pos); } public static void PlayDeath(string lordId, Vector3 pos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Play(Death, lordId, pos); } private static void Play(Dictionary map, string lordId, Vector3 pos) { //IL_0029: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (map.TryGetValue(lordId, out var value) || map.TryGetValue("neck_lord", out value)) { string[] burst = value.Burst; for (int i = 0; i < burst.Length; i++) { FxLibrary.TrySpawn(burst[i], pos); } burst = value.BurstTimed; for (int i = 0; i < burst.Length; i++) { FxLibrary.TrySpawnTimed(burst[i], pos, 4f); } for (int j = 0; j < value.SparkRing; j++) { float num = (float)j * (360f / (float)value.SparkRing); Vector3 val = Quaternion.Euler(0f, num, 0f) * Vector3.forward * value.SparkR; FxLibrary.TrySpawn("vfx_HitSparks", pos + val + Vector3.up * 0.5f); } if (!string.IsNullOrEmpty(value.Roar)) { FxLibrary.TrySpawn(value.Roar, pos); } } } } internal sealed class NeckBlobProjectile : MonoBehaviour { private const float Speed = 10f; private const float ArrivalDist = 0.6f; private const float SplashRadius = 1.5f; private const float MaxLifetime = 6f; private Vector3 _target; private Character _attacker; private bool _detonated; private float _nextTrailTime; private static Material _blueMat; internal static void Fire(Vector3 origin, Vector3 target, Character attacker) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)obj.GetComponent()); obj.transform.position = origin + Vector3.up * 1.2f; obj.transform.localScale = Vector3.one * 0.4f; Renderer component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { component.material = GetBlueMaterial() ?? component.material; } NeckBlobProjectile neckBlobProjectile = obj.AddComponent(); neckBlobProjectile._target = target + Vector3.up * 0.8f; neckBlobProjectile._attacker = attacker; Object.Destroy((Object)(object)obj, 6f); } private static Material GetBlueMaterial() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_blueMat != (Object)null) { return _blueMat; } GameObject prefab = PrefabManager.Instance.GetPrefab("Neck"); if ((Object)(object)prefab == (Object)null) { return null; } SkinnedMeshRenderer componentInChildren = prefab.GetComponentInChildren(true); if ((Object)(object)componentInChildren == (Object)null || (Object)(object)((Renderer)componentInChildren).sharedMaterial == (Object)null) { return null; } _blueMat = new Material(((Renderer)componentInChildren).sharedMaterial); _blueMat.color = new Color(0.2f, 0.6f, 1f, 1f); if (_blueMat.HasProperty("_EmissionColor")) { _blueMat.SetColor("_EmissionColor", new Color(0f, 0.3f, 0.8f) * 1.2f); } return _blueMat; } private void Update() { //IL_000a: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (_detonated) { return; } Vector3 val = _target - ((Component)this).transform.position; if (((Vector3)(ref val)).magnitude <= 0.6f) { Detonate(); return; } Transform transform = ((Component)this).transform; transform.position += ((Vector3)(ref val)).normalized * 10f * Time.deltaTime; ((Component)this).transform.Rotate(0f, 300f * Time.deltaTime, 0f); if (Time.time >= _nextTrailTime) { _nextTrailTime = Time.time + 0.08f; FxLibrary.TrySpawn("vfx_HitSparks", ((Component)this).transform.position); } } private void Detonate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) _detonated = true; Vector3 position = ((Component)this).transform.position; FxLibrary.TrySpawnTimed("vfx_water_surface", position, 2f); FxLibrary.TrySpawn("vfx_HitSparks", position); float num = 2.25f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character obj = allCharacters[i]; Player val = (Player)(object)((obj is Player) ? obj : null); if (val != null && !((Character)val).IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num)) { HitData val3 = new HitData(); val3.m_pushForce = 25f; val3.m_point = position; val3.m_dir = ((((Vector3)(ref val2)).sqrMagnitude > 0f) ? ((Vector3)(ref val2)).normalized : Vector3.up); val3.m_hitType = (HitType)1; val3.m_blockable = true; val3.m_dodgeable = true; val3.SetAttacker(_attacker); ((Character)val).Damage(val3); } } } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class NeckLordBrain : MonoBehaviour { private const float MinionCooldown = 45f; private const int MaxNearbyMinions = 3; private const float MinionSpawnRadius = 3f; private const float MinionDetectRadius = 20f; private const float FrenzyHpFraction = 0.3f; private const float FrenzySpeedFactor = 1.5f; private const string MinionPrefabName = "Neck"; private const float BlobCooldown = 12f; private const float BlobMinRange = 5f; private const float BlobMaxRange = 18f; private const float BlockHpFraction = 0.5f; private const float BlockDuration = 2.5f; private const float BlockInterCooldown = 12f; private const float BlockDetectRadius = 6f; private Character _character; private ZNetView _nview; private float _baseSpeed; private float _baseRunSpeed; private bool _frenzied; private float _nextMinionTime; private float _nextFrenzyPulse; private float _nextBlobTime; private bool _blockPhaseActive; private float _nextBlockTime; private float _blockEndTime; private string _attackAnimTrigger; private static GameObject _cachedMinion; public bool IsBlocking { get; private set; } private void Awake() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Invalid comparison between Unknown and I4 _character = ((Component)this).GetComponent(); _nview = ((Component)this).GetComponent(); if ((Object)(object)_character != (Object)null) { _baseSpeed = _character.m_speed; _baseRunSpeed = _character.m_runSpeed; } Animator component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { AnimatorControllerParameter[] parameters = component.parameters; foreach (AnimatorControllerParameter val in parameters) { if ((int)val.type == 9 && val.name.ToLower().Contains("attack")) { _attackAnimTrigger = val.name; break; } } } _nextMinionTime = Time.time + 15f; _nextBlobTime = Time.time + 10f; } private void Update() { if (!((Object)(object)_nview == (Object)null) && _nview.IsValid() && _nview.IsOwner() && !((Object)(object)_character == (Object)null) && !_character.IsDead()) { TryFrenzy(); TrySummonMinions(); TryWaterBlob(); TryEnterBlockPhase(); TryBlock(); TickBlock(); TickFrenzyAura(); } } private void TickFrenzyAura() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0047: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (_frenzied && !(Time.time < _nextFrenzyPulse)) { _nextFrenzyPulse = Time.time + 0.4f; Vector3 val = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_HitSparks", val); if (Random.value < 0.4f) { FxLibrary.TrySpawn("fx_redlightning_burst", val + Vector3.up * 0.3f); } } } private void TryFrenzy() { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) if (_frenzied || _character.GetHealth() / _character.GetMaxHealth() > 0.3f) { return; } _frenzied = true; _character.m_speed = _baseSpeed * 1.5f; _character.m_runSpeed = _baseRunSpeed * 1.5f; Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.1f, 0.1f, 1f); Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val2 in materials) { if (!((Object)(object)val2 == (Object)null)) { if (val2.HasProperty("_Color")) { val2.color = val; } if (val2.HasProperty("_EmissionColor")) { val2.SetColor("_EmissionColor", val * 0.8f); } } } } Vector3 val3 = ((Component)this).transform.position + Vector3.up * 1f; FxLibrary.TrySpawn("vfx_neck_hit", val3); FxLibrary.TrySpawn("vfx_corpse_destruction_small", val3); FxLibrary.TrySpawn("fx_redlightning_burst", val3); for (int k = 0; k < 6; k++) { float num = (float)k * 60f; Vector3 val4 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.2f; FxLibrary.TrySpawn("vfx_HitSparks", val3 + val4); } Logger.LogInfo((object)"[BiomeLords] Neck Lord entered frenzy."); } private void TryEnterBlockPhase() { if (!_blockPhaseActive && !(_character.GetHealth() / _character.GetMaxHealth() > 0.5f)) { _blockPhaseActive = true; _nextBlockTime = Time.time + 2f; Logger.LogInfo((object)"[BiomeLords] Neck Lord entered block phase."); } } private void TryBlock() { //IL_003d: 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_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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) if (_blockPhaseActive && !IsBlocking && !(Time.time < _nextBlockTime)) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead() && !(Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position) > 6f) && ((Character)localPlayer).InAttack()) { IsBlocking = true; _blockEndTime = Time.time + 2.5f; _nextBlockTime = _blockEndTime + 12f; FxLibrary.TrySpawn("fx_guardstone_activate", ((Component)this).transform.position + Vector3.up * 0.8f); } } } private void TickBlock() { if (IsBlocking && !(Time.time < _blockEndTime)) { IsBlocking = false; } } private void TryWaterBlob() { //IL_002c: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextBlobTime) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } float num = Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position); if (!(num < 5f) && !(num > 18f)) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)this).transform.position; val.y = 0f; if (!(Vector3.Dot(((Component)this).transform.forward, ((Vector3)(ref val)).normalized) < 0.5f)) { _nextBlobTime = Time.time + 12f; ((MonoBehaviour)this).StartCoroutine(BlobThrowSequence(((Component)localPlayer).transform.position)); } } } private IEnumerator BlobThrowSequence(Vector3 targetPos) { //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) _character.m_speed = 0f; _character.m_runSpeed = 0f; yield return (object)new WaitForSeconds(1f); float num = (_frenzied ? 1.5f : 1f); _character.m_speed = _baseSpeed * num; _character.m_runSpeed = _baseRunSpeed * num; NeckBlobProjectile.Fire(((Component)this).transform.position, targetPos, _character); if (_frenzied) { Vector3 val = targetPos - ((Component)this).transform.position; val.y = 0f; Vector3 target = ((Component)this).transform.position + Quaternion.Euler(0f, -20f, 0f) * val; Vector3 target2 = ((Component)this).transform.position + Quaternion.Euler(0f, 20f, 0f) * val; NeckBlobProjectile.Fire(((Component)this).transform.position, target, _character); NeckBlobProjectile.Fire(((Component)this).transform.position, target2, _character); } } private void TrySummonMinions() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //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_00ac: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _nextMinionTime) { return; } if (CountNearbyMinions() >= 3) { _nextMinionTime = Time.time + 10f; return; } EnsurePrefabs(); if (!((Object)(object)_cachedMinion == (Object)null)) { for (int i = 0; i < 2; i++) { float num = (float)i * 180f + Random.Range(-30f, 30f); Vector3 val = Quaternion.Euler(0f, num, 0f) * Vector3.forward; Vector3 val2 = ((Component)this).transform.position + val * 3f + Vector3.up * 0.2f; Object.Instantiate(_cachedMinion, val2, Quaternion.LookRotation(-val)); FxLibrary.TrySpawn("vfx_spawn", val2); } _nextMinionTime = Time.time + 45f; } } private int CountNearbyMinions() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) int num = 0; Vector3 position = ((Component)this).transform.position; float num2 = 400f; List allCharacters = Character.GetAllCharacters(); for (int i = 0; i < allCharacters.Count; i++) { Character val = allCharacters[i]; if (!((Object)(object)val == (Object)null) && !((Object)(object)val == (Object)(object)_character) && !val.IsDead()) { Vector3 val2 = ((Component)val).transform.position - position; if (!(((Vector3)(ref val2)).sqrMagnitude > num2) && ((Object)((Component)val).gameObject).name.StartsWith("Neck")) { num++; } } } return num; } private static void EnsurePrefabs() { if ((Object)(object)_cachedMinion == (Object)null) { _cachedMinion = PrefabManager.Instance.GetPrefab("Neck"); } } } public static class SummonService { public static bool TryUseHorn(Player player) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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_0199: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return false; } if ((Object)(object)EnvMan.instance != (Object)null && !EnvMan.IsNight()) { ((Character)player).Message((MessageType)2, "$biomelords_horn_fail_day", 0, (Sprite)null); return false; } BiomeLordDef biomeLordDef = FindLordForBiome(((object)player.GetCurrentBiome()/*cast due to .constrained prefix*/).ToString()); if (biomeLordDef == null) { ((Character)player).Message((MessageType)2, "$biomelords_horn_fail_biome", 0, (Sprite)null); return false; } int num = KillStore.SumFor(player, biomeLordDef.KillTargets); int num2 = LordConfig.KillRequirement(biomeLordDef.Id); if (num < num2) { ((Character)player).Message((MessageType)2, $"$biomelords_horn_fail_kills ({num}/{num2})", 0, (Sprite)null); return false; } string text = ResolvePrefabName(biomeLordDef.Id); if (string.IsNullOrEmpty(text)) { ((Character)player).Message((MessageType)2, "The " + biomeLordDef.DisplayName + " sleeps still. (Not yet implemented.)", 0, (Sprite)null); return false; } GameObject prefab = PrefabManager.Instance.GetPrefab(text); if ((Object)(object)prefab == (Object)null) { Logger.LogError((object)("[BiomeLords] " + text + " prefab missing at summon time.")); return false; } Vector3 val = ((Component)player).transform.position + ((Component)player).transform.forward * 8f + Vector3.up * 0.5f; FxLibrary.DumpFxNamesOnce(); LordFx.PlaySummon(biomeLordDef.Id, val); ApplyScaling(Object.Instantiate(prefab, val, Quaternion.LookRotation(-((Component)player).transform.forward)), biomeLordDef); RandEventSystem instance = RandEventSystem.instance; string text2 = EventFactory.EventNameFor(biomeLordDef.Id); if ((Object)(object)instance != (Object)null && !string.IsNullOrEmpty(text2)) { instance.SetRandomEventByName(text2, val); } Logger.LogInfo((object)$"[BiomeLords] {player.GetPlayerName()} summoned {biomeLordDef.DisplayName} at {val}."); return true; } private static string ResolvePrefabName(string lordId) { return lordId switch { "neck_lord" => "NeckLord", "greydwarf_lord" => "GreydwarfShamanLord", "draugr_lord" => "DraugrEliteLord", "fenring_lord" => "FenringLord", "lox_lord" => "LoxLord", "seeker_lord" => "SeekerLord", "faller_valkyrie_lord" => "FallerValkyrieLord", _ => null, }; } private static BiomeLordDef FindLordForBiome(string biomeName) { foreach (BiomeLordDef item in LordRegistry.All) { if (item.Biome.Equals(biomeName, StringComparison.OrdinalIgnoreCase)) { return item; } } return null; } private static void ApplyScaling(GameObject go, BiomeLordDef lord) { int num = LordDefeatStore.HighestDefeatedTier(); int num2 = Math.Max(lord.Tier, num); float num3 = LordConfig.HealthMultiplier(lord.Id); float num4 = LordConfig.DamageMultiplier(lord.Id); float num5 = LordIntrinsic.DamageMultiplier(lord.Id); float num6 = LordBaseStats.HpFor(lord.Id, lord.Tier); float num7 = TierTable.HpFor(num2) / TierTable.HpFor(lord.Tier); float num8 = num6 * num7 * num3; DamageProfile profile = LordAttackProfile.Resolve(lord.Id, lord.Tier, num2); float num9 = num4 * num5; Character component = go.GetComponent(); Humanoid component2 = go.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Character)component2).SetMaxHealth(num8); ((Character)component2).SetHealth(num8); } if ((Object)(object)component != (Object)null) { LordDamageRegistry.Set(component, num9); LordProfileRegistry.Set(component, profile); } Logger.LogInfo((object)($"[BiomeLords] Scaling {lord.Id}: lordTier={lord.Tier} highestLordTier={num} " + $"effectiveTier={num2} HP={num8:F0} (base {num6:F0} × ratio {num7:F2} × cfg {num3:F2}) " + $"profile@tier{num2} dmgMult={num9:F2} (cfg {num4:F2} × intrinsic {num5:F2})")); } } } namespace BiomeLords.Patches { [HarmonyPatch(typeof(Player), "OnSpawned")] public static class Player_OnSpawned_BlessingPersistence { [HarmonyPostfix] public static void Postfix(Player __instance) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } string activeBlessing = BlessingSystem.GetActiveBlessing(__instance); if (!string.IsNullOrEmpty(activeBlessing) && StatusEffectFactory.ByName.TryGetValue(activeBlessing, out var value) && (Object)(object)value != (Object)null) { SEMan sEMan = ((Character)__instance).GetSEMan(); if (sEMan != null && !sEMan.HaveStatusEffect(value.NameHash())) { sEMan.AddStatusEffect(value, true, 0, 0f); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] Re-applied persisted blessing " + activeBlessing + " on spawn.")); } } } FeatherweightInventory.Reconcile(__instance); } } [HarmonyPatch(typeof(Character), "Damage")] public static class Character_Damage_DraugrWound { [HarmonyPrefix] public static void Prefix(Character __instance, HitData hit, out float __state) { __state = -1f; if (hit == null) { return; } Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val != null && !((Character)val).IsDead()) { Character attacker = hit.GetAttacker(); if (!((Object)(object)attacker == (Object)null) && DraugrLordBrain.IsCleaving(((Object)attacker).GetInstanceID())) { __state = __instance.GetHealth(); } } } [HarmonyPostfix] public static void Postfix(Character __instance, float __state) { if (!(__state < 0f)) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val != null && !(__instance.GetHealth() >= __state)) { DraugrLordBrain.ApplyWound(val); } } } } [HarmonyPatch(typeof(RandEventSystem), "Awake")] public static class RandEventSystem_Awake_Patch { [HarmonyPostfix] public static void Postfix() { try { EventFactory.RegisterAll(); } catch (Exception arg) { Logger.LogError((object)$"[BiomeLords] Event registration failed: {arg}"); } } } [HarmonyPatch(typeof(Player), "GetMaxCarryWeight")] public static class Player_GetMaxCarryWeight_Featherweight { [HarmonyPostfix] public static void Postfix(Player __instance, ref float __result) { float num = LordConfig.FallerValkyrieWeightCap?.Value ?? 0f; if (!(num <= 0f) && FeatherweightInventory.HasBlessing(__instance) && __result < num) { __result = num; } } } [HarmonyPatch(typeof(InventoryGui), "UpdateInventoryWeight")] public static class InventoryGui_UpdateInventoryWeight_Featherweight { private static readonly FieldInfo WeightField = AccessTools.Field(typeof(InventoryGui), "m_weight"); [HarmonyPostfix] public static void Postfix(InventoryGui __instance, Player player) { if ((Object)(object)player == (Object)null || (Object)(object)__instance == (Object)null || !FeatherweightInventory.HasBlessing(player)) { return; } object obj = WeightField?.GetValue(__instance); if (obj == null) { return; } PropertyInfo property = obj.GetType().GetProperty("text"); if (!(property == null)) { int num = Mathf.CeilToInt(((Humanoid)player).GetInventory().GetTotalWeight()); float maxCarryWeight = player.m_maxCarryWeight; SEMan sEMan = ((Character)player).GetSEMan(); if (sEMan != null) { sEMan.ModifyMaxCarryWeight(maxCarryWeight, ref maxCarryWeight); } int num2 = Mathf.CeilToInt(maxCarryWeight); string value = ((num > num2 && Mathf.Sin(Time.time * 10f) > 0f) ? $"{num}/{num2}" : $"{num}/{num2}"); property.SetValue(obj, value); } } } [HarmonyPatch(typeof(InventoryGui), "Show")] public static class InventoryGui_Show_FeatherweightPanel { private static float _basePanelHeight = float.NaN; private static float _baseBkgHeight = float.NaN; [HarmonyPostfix] public static void Postfix(InventoryGui __instance) { try { Resize(__instance); } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] Featherweight panel resize skipped: " + ex.Message)); } } private static void Resize(InventoryGui gui) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)gui == (Object)null || (Object)(object)localPlayer == (Object)null || (Object)(object)gui.m_player == (Object)null || (Object)(object)gui.m_playerGrid == (Object)null) { return; } int num = ((Humanoid)localPlayer).GetInventory().GetHeight() - 4; if (num < 0) { num = 0; } float elementSpace = gui.m_playerGrid.m_elementSpace; float num2 = (float)num * elementSpace; RectTransform player = gui.m_player; if (float.IsNaN(_basePanelHeight)) { _basePanelHeight = player.sizeDelta.y; } SetHeight(player, _basePanelHeight + num2); RectTransform val = FindBackdrop(player); if ((Object)(object)val != (Object)null) { if (float.IsNaN(_baseBkgHeight)) { _baseBkgHeight = val.sizeDelta.y; } SetHeight(val, _baseBkgHeight + num2); } } private static void SetHeight(RectTransform rt, float height) { //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_0010: Unknown result type (might be due to invalid IL or missing references) Vector2 sizeDelta = rt.sizeDelta; sizeDelta.y = height; rt.sizeDelta = sizeDelta; } private static RectTransform FindBackdrop(RectTransform panel) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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) RectTransform result = null; float num = 0f; for (int i = 0; i < ((Transform)panel).childCount; i++) { Transform child = ((Transform)panel).GetChild(i); RectTransform val = (RectTransform)(object)((child is RectTransform) ? child : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)((Component)val).GetComponent("Image") == (Object)null)) { Rect rect = val.rect; float width = ((Rect)(ref rect)).width; rect = val.rect; float num2 = width * ((Rect)(ref rect)).height; if (num2 > num) { num = num2; result = val; } } } return result; } } [HarmonyPatch(typeof(Character), "Damage")] internal static class Character_Damage_FenringVamp { [HarmonyPostfix] private static void Postfix(HitData hit) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) Character attacker = hit.GetAttacker(); if ((Object)(object)attacker == (Object)null) { return; } FenringLordBrain component = ((Component)attacker).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsVampActive) { float totalDamage = hit.GetTotalDamage(); if (!(totalDamage <= 0f)) { attacker.Heal(totalDamage * 0.8f, true); FxLibrary.TrySpawn("vfx_HitSparks", ((Component)attacker).transform.position + Vector3.up); } } } } internal static class FisherBoonUtil { private static int _seHash; public static bool HasBlessing(Player p) { if ((Object)(object)p == (Object)null || (Object)(object)p != (Object)(object)Player.m_localPlayer) { return false; } if (_seHash == 0) { _seHash = StringExtensionMethods.GetStableHashCode("SE_NeckLordSpirit"); } SEMan sEMan = ((Character)p).GetSEMan(); if (sEMan != null) { return sEMan.HaveStatusEffect(_seHash); } return false; } } [HarmonyPatch(typeof(FishingFloat), "Setup")] public static class FishingFloat_Setup_FisherBoon { [HarmonyPostfix] public static void Postfix(Character owner, ItemData ammo) { Player val = (Player)(object)((owner is Player) ? owner : null); if (val == null || !FisherBoonUtil.HasBlessing(val) || ammo == null || (Object)(object)ammo.m_dropPrefab == (Object)null || Random.value >= LordConfig.FisherBoonBaitSaveChance.Value) { return; } Inventory inventory = ((Humanoid)val).GetInventory(); if (inventory != null) { inventory.AddItem(ammo.m_dropPrefab, 1); ((Character)val).Message((MessageType)1, "Fisher's Boon — bait spared.", 0, (Sprite)null); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] FisherBoon bait refunded: " + ((Object)ammo.m_dropPrefab).name)); } } } } [HarmonyPatch(typeof(Fish), "Pickup")] public static class Fish_Pickup_FisherBoon { [HarmonyPostfix] public static void Postfix(Fish __instance, Humanoid character, bool __result) { if (!__result) { return; } Player val = (Player)(object)((character is Player) ? character : null); if (val == null || !FisherBoonUtil.HasBlessing(val) || (Object)(object)__instance == (Object)null || (Object)(object)__instance.m_pickupItem == (Object)null || Random.value >= LordConfig.FisherBoonBonusFishChance.Value) { return; } Inventory inventory = ((Humanoid)val).GetInventory(); if (inventory != null) { inventory.AddItem(__instance.m_pickupItem, 1); ((Character)val).Message((MessageType)1, "Fisher's Boon — a second catch!", 0, (Sprite)null); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] FisherBoon bonus fish: " + ((Object)__instance.m_pickupItem).name)); } } } } [HarmonyPatch(typeof(Player), "GetComfortLevel")] public static class Player_GetComfortLevel_ForestsEmbrace { [HarmonyPostfix] public static void Postfix(Player __instance, ref int __result) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { int currentTreeComfort = ForestEmbraceService.CurrentTreeComfort; if (currentTreeComfort > 0) { __result += currentTreeComfort; } } } } [HarmonyPatch(typeof(Player), "InShelter")] public static class Player_InShelter_ForestsEmbrace { [HarmonyPostfix] public static void Postfix(Player __instance, ref bool __result) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && !__result && ForestEmbraceService.IsNearQualifyingTree) { __result = true; } } } [HarmonyPatch(typeof(Player), "EatFood")] public static class Player_EatFood_HearthMaster { private static int _seHash; [HarmonyPostfix] public static void Postfix(Player __instance, ItemData item, bool __result) { if (!__result || (Object)(object)__instance == (Object)null || (Object)(object)__instance != (Object)(object)Player.m_localPlayer || item == null) { return; } if (_seHash == 0) { _seHash = StringExtensionMethods.GetStableHashCode("SE_LoxLordSpirit"); } SEMan sEMan = ((Character)__instance).GetSEMan(); if (sEMan == null || !sEMan.HaveStatusEffect(_seHash)) { return; } float value = LordConfig.HearthMasterMultiplier.Value; if (value <= 1f) { return; } List foods = __instance.GetFoods(); if (foods == null) { return; } for (int i = 0; i < foods.Count; i++) { Food val = foods[i]; if (val != null && val.m_item != null && val.m_item.m_shared == item.m_shared) { val.m_time *= value; break; } } } } [HarmonyPatch(typeof(ItemData), "GetTooltip", new Type[] { typeof(ItemData), typeof(int), typeof(bool), typeof(float), typeof(int) })] public static class ItemData_GetTooltip_Patch { private static bool _loggedOnce; [HarmonyPostfix] public static void Postfix(ItemData item, ref string __result) { if (!((Object)(object)item?.m_dropPrefab == (Object)null) && !(((Object)item.m_dropPrefab).name != "LordsHorn") && !string.IsNullOrEmpty(__result)) { if (!_loggedOnce && LordConfig.DebugLogging != null && LordConfig.DebugLogging.Value) { _loggedOnce = true; Logger.LogInfo((object)("[BiomeLords] Raw LordsHorn tooltip:\n----\n" + __result + "\n----")); } __result = __result.Replace("Utility", "Consumable").Replace("utility", "consumable"); } } } [HarmonyPatch(typeof(Humanoid), "UseItem")] public static class Humanoid_UseItem_Patch { [HarmonyPrefix] public static bool Prefix(Humanoid __instance, ItemData item) { if ((Object)(object)item?.m_dropPrefab == (Object)null) { return true; } if (((Object)item.m_dropPrefab).name != "LordsHorn") { return true; } Player val = (Player)(object)((__instance is Player) ? __instance : null); if ((Object)(object)val == (Object)null) { return true; } if (SummonService.TryUseHorn(val)) { ((Humanoid)val).GetInventory().RemoveOneItem(item); } return false; } } [HarmonyPatch(typeof(Inventory), "Load")] public static class Inventory_Load_FeatherweightExpand { [HarmonyPrefix] public static void Prefix(Inventory __instance) { if (FeatherweightInventory.IsPlayerInventory(__instance)) { FeatherweightInventory.GrowForLoad(__instance); } } } [HarmonyPatch(typeof(DropTable), "GetDropList", new Type[] { })] public static class DropTable_GetDropList_IronVein { private const float Chance = 0.3f; private static int _seHash; [HarmonyPostfix] public static void Postfix(List __result) { if (__result == null || __result.Count == 0) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } if (_seHash == 0) { _seHash = StringExtensionMethods.GetStableHashCode("SE_DraugrLordSpirit"); } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null || !sEMan.HaveStatusEffect(_seHash)) { return; } int count = __result.Count; for (int i = 0; i < count; i++) { GameObject val = __result[i]; if (!((Object)(object)val == (Object)null)) { string name = ((Object)val).name; if ((!(name != "Iron") || !(name != "IronScrap")) && Random.value < 0.3f) { __result.Add(val); } } } } } [HarmonyPatch(typeof(Character), "Damage")] public static class Character_Damage_Patch { [HarmonyPrefix] public static void Prefix(Character __instance, out bool __state) { __state = (Object)(object)__instance != (Object)null && __instance.GetHealth() > 0f; } [HarmonyPostfix] public static void Postfix(Character __instance, HitData hit, bool __state) { if (!LordConfig.EnableKillTracking.Value || (Object)(object)__instance == (Object)null || hit == null || __instance is Player || !__state || __instance.GetHealth() > 0f) { return; } string text = StripClone(((Object)((Component)__instance).gameObject).name); if (RegisteredLords.IsLord(__instance)) { OnLordDeath(__instance, hit); } BiomeLordDef biomeLordDef = LordRegistry.FindByKillTarget(text); if (biomeLordDef == null) { return; } Character attacker = hit.GetAttacker(); Player val = (Player)(object)((attacker is Player) ? attacker : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer)) { int num = KillStore.Increment(val, text); if (LordConfig.DebugLogging.Value) { int num2 = KillStore.SumFor(val, biomeLordDef.KillTargets); int num3 = LordConfig.KillRequirement(biomeLordDef.Id); Logger.LogInfo((object)("[BiomeLords] " + val.GetPlayerName() + " killed " + text + " " + $"({num} of this type). {biomeLordDef.DisplayName}: {num2}/{num3}.")); } } } private static void OnLordDeath(Character lord, HitData hit) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)lord).transform.position; string text = RegisteredLords.EventFor(lord); if (text != null) { RandEventSystem instance = RandEventSystem.instance; RandomEvent val = ((instance != null) ? instance.GetCurrentRandomEvent() : null); if (val != null && val.m_name == text) { instance.ResetRandomEvent(); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] Ended event " + text + " on Lord death.")); } } } Character obj = ((hit != null) ? hit.GetAttacker() : null); Player val2 = (Player)(object)((obj is Player) ? obj : null); if ((Object)(object)val2 != (Object)null && (Object)(object)val2 == (Object)(object)Player.m_localPlayer) { string text2 = RegisteredLords.LordIdFor(lord); BiomeLordDef biomeLordDef = ((text2 != null) ? LordRegistry.ById(text2) : null); if (biomeLordDef != null) { ((Humanoid)val2).AddUniqueKey(PowerClaimSystem.DefeatKey(biomeLordDef.Id)); LordDefeatStore.RecordDefeat(biomeLordDef.Id); string[] killTargets = biomeLordDef.KillTargets; foreach (string prefabName in killTargets) { KillStore.Set(val2, prefabName, 0); } ((Character)val2).Message((MessageType)2, "The hunt resets. Prove yourself again to summon the " + biomeLordDef.DisplayName + ".", 0, (Sprite)null); PowerClaimSystem.GrantOnDefeat(val2, biomeLordDef.Id); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] Reset kill counters for " + biomeLordDef.Id + ", recorded defeat, awarded GP.")); } } } LordFx.PlayDeath(RegisteredLords.LordIdFor(lord) ?? "neck_lord", position); } private static string StripClone(string n) { if (string.IsNullOrEmpty(n)) { return n; } if (!n.EndsWith("(Clone)")) { return n; } return n.Substring(0, n.Length - "(Clone)".Length); } } [HarmonyPatch(typeof(Character), "Awake")] public static class Character_Awake_LordAutoRegister { [HarmonyPostfix] public static void Postfix(Character __instance) { if ((Object)(object)__instance == (Object)null) { return; } string text = RegisteredLords.LordIdFor(__instance); if (text == null || LordDamageRegistry.Get(__instance, -1f) >= 0f) { return; } BiomeLordDef biomeLordDef = LordRegistry.ById(text); if (biomeLordDef != null) { int num = Math.Max(biomeLordDef.Tier, LordDefeatStore.HighestDefeatedTier()); DamageProfile profile = LordAttackProfile.Resolve(biomeLordDef.Id, biomeLordDef.Tier, num); float num2 = LordConfig.DamageMultiplier(biomeLordDef.Id); float num3 = LordIntrinsic.DamageMultiplier(biomeLordDef.Id); float num4 = num2 * num3; LordDamageRegistry.Set(__instance, num4); LordProfileRegistry.Set(__instance, profile); if (LordConfig.DebugLogging != null && LordConfig.DebugLogging.Value) { Logger.LogInfo((object)("[BiomeLords] Auto-registered " + biomeLordDef.Id + " on Awake: " + $"effectiveTier={num} profile@tier{num} " + $"dmgMult=×{num4:F2} (cfg×{num2:F2} intrinsic×{num3:F2})")); } } } } [HarmonyPatch(typeof(Character), "Damage")] public static class Character_Damage_LordBoost { [HarmonyPrefix] public static void Prefix(HitData hit) { if (hit == null) { return; } Character attacker = hit.GetAttacker(); if ((Object)(object)attacker == (Object)null || (!RegisteredLords.IsLord(attacker) && !LordDamageRegistry.Has(attacker))) { return; } float num = LordDamageRegistry.Get(attacker); string text = RegisteredLords.LordIdFor(attacker); DamageProfile profile; if (text == "greydwarf_lord" && hit.m_damage.m_poison > 0f && hit.m_damage.m_blunt == 0f) { float num2 = 36f; hit.m_damage.m_damage = 0f; hit.m_damage.m_blunt = 0f; hit.m_damage.m_slash = 0f; hit.m_damage.m_pierce = 0f; hit.m_damage.m_fire = 0f; hit.m_damage.m_frost = 0f; hit.m_damage.m_lightning = 0f; hit.m_damage.m_poison = num2 * num; hit.m_damage.m_spirit = 0f; hit.m_pushForce *= 1.5f; hit.m_backstabBonus = 1f; } else if (LordProfileRegistry.TryGet(attacker, out profile) || (text != null && LordAttackProfile.TryGet(text, out profile))) { hit.m_damage.m_damage = 0f; hit.m_damage.m_blunt = profile.Blunt * num; hit.m_damage.m_slash = profile.Slash * num; hit.m_damage.m_pierce = profile.Pierce * num; hit.m_damage.m_fire = profile.Fire * num; hit.m_damage.m_frost = profile.Frost * num; hit.m_damage.m_lightning = profile.Lightning * num; hit.m_damage.m_poison = profile.Poison * num; hit.m_damage.m_spirit = profile.Spirit * num; hit.m_pushForce *= 1.5f; hit.m_backstabBonus = 1f; if (LordConfig.DebugLogging != null && LordConfig.DebugLogging.Value) { Logger.LogInfo((object)($"[BiomeLords] {text} hit (profile ×{num:F2}): " + $"blunt={hit.m_damage.m_blunt:F0} slash={hit.m_damage.m_slash:F0} " + $"pierce={hit.m_damage.m_pierce:F0} fire={hit.m_damage.m_fire:F0} " + $"frost={hit.m_damage.m_frost:F0} lightning={hit.m_damage.m_lightning:F0} " + $"poison={hit.m_damage.m_poison:F0} spirit={hit.m_damage.m_spirit:F0}")); } } else { hit.m_damage.m_damage *= num; hit.m_damage.m_blunt *= num; hit.m_damage.m_slash *= num; hit.m_damage.m_pierce *= num; hit.m_damage.m_chop *= num; hit.m_damage.m_pickaxe *= num; hit.m_damage.m_fire *= num; hit.m_damage.m_frost *= num; hit.m_damage.m_lightning *= num; hit.m_damage.m_poison *= num; hit.m_damage.m_spirit *= num; hit.m_pushForce *= 1.5f; hit.m_backstabBonus = 1f; } } } [HarmonyPatch(typeof(Character), "Stagger")] public static class Character_Stagger_Patch { [HarmonyPrefix] public static bool Prefix(Character __instance) { return !RegisteredLords.IsLord(__instance); } } [HarmonyPatch(typeof(Character), "Damage")] public static class LoxLordShieldPatch { private const float ShieldReduction = 0.65f; private const float LastStandReduction = 0.8f; [HarmonyPrefix] public static bool Prefix(Character __instance, HitData hit) { //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_0127: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) if (hit == null) { return true; } LoxLordBrain component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return true; } float num = (component.IsLastStand ? 0.8f : (component.IsShielded ? 0.65f : 0f)); if (num <= 0f) { return true; } float num2 = 1f - num; hit.m_damage.m_damage *= num2; hit.m_damage.m_blunt *= num2; hit.m_damage.m_slash *= num2; hit.m_damage.m_pierce *= num2; hit.m_damage.m_chop *= num2; hit.m_damage.m_pickaxe *= num2; hit.m_damage.m_fire *= num2; hit.m_damage.m_frost *= num2; hit.m_damage.m_lightning *= num2; hit.m_damage.m_poison *= num2; hit.m_damage.m_spirit *= num2; Vector3 pos = ((hit.m_point != Vector3.zero) ? hit.m_point : (((Component)__instance).transform.position + Vector3.up)); FxLibrary.TrySpawn("fx_GoblinShieldHit", pos); return true; } } [HarmonyPatch(typeof(Character), "Damage")] public static class NeckLordBlockPatch { [HarmonyPrefix] public static bool Prefix(Character __instance, HitData hit) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (hit == null || !hit.m_blockable) { return true; } NeckLordBrain component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null || !component.IsBlocking) { return true; } Vector3 pos = ((hit.m_point != Vector3.zero) ? hit.m_point : (((Component)__instance).transform.position + Vector3.up)); FxLibrary.TrySpawn("fx_GoblinShieldHit", pos); return false; } } public static class NeckWetImmunityPatch { [HarmonyPatch(typeof(SE_Stats), "ModifyDamageMods")] public static class SE_Stats_ModifyDamageMods_NeckWet { [HarmonyPrefix] public static bool Prefix(SE_Stats __instance) { return !ShouldSuppress(__instance); } } [HarmonyPatch(typeof(SE_Stats), "ModifyStaminaRegen")] public static class SE_Stats_ModifyStaminaRegen_NeckWet { [HarmonyPrefix] public static bool Prefix(SE_Stats __instance) { return !ShouldSuppress(__instance); } } private static int _tidesHash; private static bool ShouldSuppress(SE_Stats se) { if (!(se is SE_Wet)) { return false; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || (Object)(object)((StatusEffect)se).m_character != (Object)(object)localPlayer) { return false; } if (_tidesHash == 0) { _tidesHash = StringExtensionMethods.GetStableHashCode("GP_TidesGrace"); } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan != null) { return sEMan.HaveStatusEffect(_tidesHash); } return false; } } [HarmonyPatch(typeof(Player), "Update")] public static class Player_Update_BiomeLordsTicks { [HarmonyPostfix] public static void Postfix(Player __instance) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { ForestEmbraceService.Tick(); PowerEffectsService.Tick(); } } } [HarmonyPatch(typeof(ObjectDB), "Awake")] public static class ObjectDB_Awake_BiomeLordsInject { [HarmonyPostfix] public static void Postfix(ObjectDB __instance) { InjectAll(__instance); } public static void InjectAll(ObjectDB db = null) { db = db ?? ObjectDB.instance; if (!((Object)(object)db == (Object)null) && db.m_StatusEffects != null) { int num = 0; num += Inject(db, GuardianPowerFactory.ByName); num += Inject(db, StatusEffectFactory.ByName); num += Inject(db, SubEffectFactory.ByName); Traverse.Create((object)db).Method("UpdateRegisters", Array.Empty()).GetValue(); Logger.LogInfo((object)$"[BiomeLords] ObjectDB inject pass: {num} SEs added."); IconAssignment.AssignAll(); } } private static int Inject(ObjectDB db, Dictionary map) { if (map == null) { return 0; } int num = 0; foreach (KeyValuePair item in map) { StatusEffect value = item.Value; if (!((Object)(object)value == (Object)null) && !db.m_StatusEffects.Contains(value)) { db.m_StatusEffects.Add(value); num++; } } return num; } } [HarmonyPatch(typeof(Player), "OnSpawned")] public static class Player_OnSpawned_GPMigration { [HarmonyPostfix] public static void Postfix(Player __instance) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { string guardianPowerName = __instance.GetGuardianPowerName(); if (!string.IsNullOrEmpty(guardianPowerName) && guardianPowerName == "GP_VerdantWrath") { __instance.SetGuardianPower("GP_ForestsEmbrace"); ((Character)__instance).Message((MessageType)2, "Your Greydwarf Shaman Lord's spirit has been renewed.", 0, (Sprite)null); Logger.LogInfo((object)"[BiomeLords] Migrated GP_VerdantWrath → GP_ForestsEmbrace"); } } } } [HarmonyPatch] public static class Procreation_Procreate_PackBreed { private const float Range = 30f; private static int _seHash; [ThreadStatic] private static bool _reentering; private static MethodInfo _procreateMethod; [HarmonyTargetMethod] public static MethodBase Target() { return _procreateMethod = AccessTools.Method(typeof(Procreation), "Procreate", (Type[])null, (Type[])null); } [HarmonyPostfix] public static void Postfix(Procreation __instance) { //IL_0047: 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_005c: Unknown result type (might be due to invalid IL or missing references) if (_reentering || (Object)(object)__instance == (Object)null || _procreateMethod == null || !IsBreedableWolf(__instance)) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } Vector3 val = ((Component)localPlayer).transform.position - ((Component)__instance).transform.position; if (((Vector3)(ref val)).sqrMagnitude > 900f) { return; } if (_seHash == 0) { _seHash = StringExtensionMethods.GetStableHashCode("SE_FenringLordSpirit"); } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null || !sEMan.HaveStatusEffect(_seHash)) { return; } try { _reentering = true; _procreateMethod.Invoke(__instance, null); } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] PackBreed re-invoke failed: " + ex.Message)); } finally { _reentering = false; } } private static bool IsBreedableWolf(Procreation proc) { Character component = ((Component)proc).GetComponent(); if ((Object)(object)component == (Object)null || component.IsDead() || !component.IsTamed()) { return false; } return ((Object)((Component)component).gameObject).name.StartsWith("Wolf"); } } [HarmonyPatch] public static class Tameable_DecreaseRemainingTime_PackWhisperer { private const float Range = 30f; private static int _seHash; private static MethodInfo _decreaseMethod; [ThreadStatic] private static bool _reentering; [HarmonyTargetMethod] public static MethodBase Target() { return _decreaseMethod = AccessTools.Method(typeof(Tameable), "DecreaseRemainingTime", (Type[])null, (Type[])null); } [HarmonyPostfix] public static void Postfix(Tameable __instance, float time) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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) if (_reentering || (Object)(object)__instance == (Object)null || _decreaseMethod == null || __instance.IsTamed()) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } Vector3 val = ((Component)localPlayer).transform.position - ((Component)__instance).transform.position; if (((Vector3)(ref val)).sqrMagnitude > 900f) { return; } if (_seHash == 0) { _seHash = StringExtensionMethods.GetStableHashCode("SE_FenringLordSpirit"); } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null || !sEMan.HaveStatusEffect(_seHash)) { return; } try { _reentering = true; _decreaseMethod.Invoke(__instance, new object[1] { time }); } catch (Exception ex) { Logger.LogWarning((object)("[BiomeLords] TamingAccelerate failed: " + ex.Message)); } finally { _reentering = false; } } } [HarmonyPatch(typeof(ItemStand), "Interact")] public static class ItemStand_Interact_Patch { [HarmonyPrefix] public static bool Prefix(ItemStand __instance, Humanoid user, bool hold, bool alt, ref bool __result) { if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { return true; } Player val = (Player)(object)((user is Player) ? user : null); if (hold && __instance.HaveAttachment()) { if (val != null) { ((Character)val).Message((MessageType)2, "$biomelords_pedestal_locked", 0, (Sprite)null); } __result = false; return false; } if (hold || alt) { return true; } if (!__instance.HaveAttachment()) { return true; } if ((Object)(object)val == (Object)null) { return true; } __result = BlessingSystem.TryGrant(val, __instance, __instance.GetAttachedItem()); return false; } } [HarmonyPatch(typeof(ItemStand), "CanAttach")] public static class ItemStand_CanAttach_LordsOnly { [HarmonyPostfix] public static void Postfix(ItemStand __instance, ItemData item, ref bool __result) { if (__result && !((Object)(object)__instance == (Object)null) && item != null && !((Object)(object)((Component)__instance).GetComponent() == (Object)null) && !BlessingSystem.TryResolve(((Object)(object)item.m_dropPrefab != (Object)null) ? ((Object)item.m_dropPrefab).name : null, out var _, out var _)) { __result = false; } } } [HarmonyPatch(typeof(ItemStand), "DropItem")] public static class ItemStand_DropItem_LockTrophy { [HarmonyPrefix] public static bool Prefix(ItemStand __instance) { if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { return true; } return false; } } [HarmonyPatch(typeof(ItemStand), "UseItem")] public static class ItemStand_UseItem_ResetCharges { [HarmonyPostfix] public static void Postfix(ItemStand __instance, bool __result) { if (__result && !((Object)(object)__instance == (Object)null) && !((Object)(object)((Component)__instance).GetComponent() == (Object)null) && BlessingSystem.TryResolve(__instance.GetAttachedItem(), out var _, out var _)) { BlessingSystem.ResetCharges(__instance); } } internal static void PlayMountCeremonyPublic(Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) PlayMountCeremony(pos); } private static void PlayMountCeremony(Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_005c: 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_006b: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) Vector3 val = pos + Vector3.up * 0.6f; FxLibrary.TrySpawn("vfx_lootspawn", val); FxLibrary.TrySpawn("vfx_lootspawn", val + Vector3.up * 0.3f); FxLibrary.TrySpawn("vfx_lootspawn", val + Vector3.up * 0.6f); for (int i = 0; i < 8; i++) { float num = (float)i * 45f; Vector3 val2 = Quaternion.Euler(0f, num, 0f) * Vector3.forward * 1.2f; FxLibrary.TrySpawn("vfx_HitSparks", pos + val2 + Vector3.up * 0.1f); } } } [HarmonyPatch(typeof(ItemStand), "SetVisualItem")] public static class ItemStand_SetVisualItem_MountHook { private const string CeremonyZDOKey = "biomelords.ceremony_for"; [HarmonyPostfix] public static void Postfix(ItemStand __instance, string itemName) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).GetComponent() == (Object)null) { return; } ZNetView component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null || !component.IsValid()) { return; } ZDO zDO = component.GetZDO(); string lordId; string seName; if (string.IsNullOrEmpty(itemName)) { zDO.Set("biomelords.ceremony_for", ""); } else if (BlessingSystem.TryResolve(itemName, out lordId, out seName)) { BlessingSystem.ResetCharges(__instance); if (!(zDO.GetString("biomelords.ceremony_for", "") == itemName)) { zDO.Set("biomelords.ceremony_for", itemName); ItemStand_UseItem_ResetCharges.PlayMountCeremonyPublic(((Component)__instance).transform.position); } } } } [HarmonyPatch(typeof(ItemStand), "GetHoverText")] public static class ItemStand_GetHoverText_Patch { [HarmonyPostfix] public static void Postfix(ItemStand __instance, ref string __result) { if ((Object)(object)__instance == (Object)null || (Object)(object)((Component)__instance).GetComponent() == (Object)null || !__instance.HaveAttachment() || !BlessingSystem.TryResolve(__instance.GetAttachedItem(), out var _, out var _)) { return; } int charges = BlessingSystem.GetCharges(__instance); int maxCharges = BlessingSystem.MaxCharges; string text; if (charges <= 0) { text = "[Spirit spent]"; } else { double num = BlessingSystem.CooldownRemaining(__instance); if (num > 0.0) { int num2 = (int)Math.Ceiling(num); text = $"[Cooldown {num2:D2}s] ({charges}/{maxCharges})"; } else { text = Localization.instance.Localize("[$KEY_Use] $biomelords_pedestal_receive") + $" ({charges}/{maxCharges})"; } } string text2 = Localization.instance.Localize("$biomelords_pedestal_lockedhint"); __result = __result + "\n" + text + "\n" + text2 + ""; } } [HarmonyPatch(typeof(Player), "CheckCanRemovePiece")] public static class Player_CheckCanRemovePiece_LockOccupied { [HarmonyPostfix] public static void Postfix(Player __instance, Piece piece, ref bool __result) { if (!__result || (Object)(object)piece == (Object)null) { return; } ItemStand component = ((Component)piece).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)((Component)component).GetComponent() == (Object)null) && component.HaveAttachment()) { __result = false; if ((Object)(object)__instance != (Object)null) { ((Character)__instance).Message((MessageType)2, "$biomelords_pedestal_destroy_locked", 0, (Sprite)null); } } } } [HarmonyPatch(typeof(WearNTear), "CanBeRemoved")] public static class WearNTear_CanBeRemoved_LockOccupied { [HarmonyPostfix] public static void Postfix(WearNTear __instance, ref bool __result) { if (__result && !((Object)(object)__instance == (Object)null)) { ItemStand component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)((Component)component).GetComponent() == (Object)null) && component.HaveAttachment()) { __result = false; } } } } [HarmonyPatch(typeof(ZNetScene), "Awake")] public static class ZNetScene_Awake_RegisterPedestal { [HarmonyPostfix] public static void Postfix() { try { PedestalFactory.RegisterAll(); } catch (Exception arg) { Logger.LogError((object)$"[BiomeLords] Deferred pedestal registration failed: {arg}"); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class PhantomWolfInvulnPatch { [HarmonyPrefix] public static bool Prefix(Character __instance, HitData hit) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) if ((Object)(object)__instance == (Object)null) { return true; } PhantomWolf component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null || !component.Invulnerable) { return true; } Vector3 pos = ((hit != null && hit.m_point != Vector3.zero) ? hit.m_point : (((Component)__instance).transform.position + Vector3.up)); FxLibrary.TrySpawn("vfx_HitSparks", pos); return false; } } [HarmonyPatch(typeof(Character), "Damage")] public static class Character_Damage_PlagueBearerPoison { private const float AddedPoison = 25f; private static int _gpHash; [HarmonyPrefix] public static void Prefix(HitData hit) { if (hit == null) { return; } Character attacker = hit.GetAttacker(); Player val = (Player)(object)((attacker is Player) ? attacker : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val != (Object)(object)Player.m_localPlayer)) { if (_gpHash == 0) { _gpHash = StringExtensionMethods.GetStableHashCode("GP_PlagueBearer"); } SEMan sEMan = ((Character)val).GetSEMan(); if (sEMan != null && sEMan.HaveStatusEffect(_gpHash)) { hit.m_damage.m_poison += 25f; } } } } [HarmonyPatch(typeof(Plant), "GetHoverText")] public static class Plant_GetHoverText_DebugTimes { private static readonly MethodInfo MGrowTime = AccessTools.Method(typeof(Plant), "GetGrowTime", (Type[])null, (Type[])null); private static readonly MethodInfo MTimeSincePlanted = AccessTools.Method(typeof(Plant), "TimeSincePlanted", (Type[])null, (Type[])null); private static int _logCounter; [HarmonyPostfix] public static void Postfix(Plant __instance, ref string __result) { if (!((Object)(object)__instance == (Object)null) && LordConfig.ShowCropGrowTimes != null && LordConfig.ShowCropGrowTimes.Value) { float num = TryInvoke(MGrowTime, __instance); float num2 = TryInvoke(MTimeSincePlanted, __instance); float num3 = Math.Max(0f, num - num2); int num4 = (int)(num3 / 60f); int num5 = (int)(num3 % 60f); int num6 = (int)(num / 60f); int num7 = (int)(num % 60f); __result += $"\nGrowth: {num4:D2}:{num5:D2} / {num6:D2}:{num7:D2}"; if (LordConfig.DebugLogging != null && LordConfig.DebugLogging.Value && _logCounter++ % 30 == 0) { Logger.LogInfo((object)($"[BiomeLords] Plant hover (grow={num:F1}s elapsed={num2:F1}s remaining={num3:F1}s) " + "appended to '" + ((Object)((Component)__instance).gameObject).name + "'.")); } } } private static float TryInvoke(MethodInfo mi, Plant target) { if (mi == null) { return 0f; } try { object obj = mi.Invoke(target, null); if (obj is float result) { return result; } if (obj is double num) { return (float)num; } if (obj is int num2) { return num2; } return 0f; } catch { return 0f; } } } [HarmonyPatch(typeof(Character), "Damage")] public static class Character_Damage_TidesGraceMelee { private const float WetMeleeMultiplier = 1.5f; private static int _tidesHash; [HarmonyPrefix] public static void Prefix(Character __instance, HitData hit) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (hit == null || (Object)(object)__instance == (Object)null) { return; } Character attacker = hit.GetAttacker(); Player val = (Player)(object)((attacker is Player) ? attacker : null); if (val == null || (Object)(object)val != (Object)(object)Player.m_localPlayer || !IsMeleeSkill(hit.m_skill)) { return; } SEMan sEMan = ((Character)val).GetSEMan(); if (sEMan != null) { if (_tidesHash == 0) { _tidesHash = StringExtensionMethods.GetStableHashCode("GP_TidesGrace"); } if (sEMan.HaveStatusEffect(_tidesHash) && sEMan.HaveStatusEffect(SEMan.s_statusEffectWet)) { hit.m_damage.m_blunt *= 1.5f; hit.m_damage.m_slash *= 1.5f; hit.m_damage.m_pierce *= 1.5f; } } } private static bool IsMeleeSkill(SkillType skill) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected I4, but got Unknown switch (skill - 1) { case 0: case 1: case 2: case 3: case 4: case 6: case 10: return true; default: return false; } } } [HarmonyPatch(typeof(Plant), "GetGrowTime")] public static class Plant_GetGrowTime_QuickSprout { private const float NearbyRadiusSqr = 400f; private const float GrowFactor = 0.77f; private static int _spiritHash; [HarmonyPostfix] public static void Postfix(Plant __instance, ref float __result) { //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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } if (_spiritHash == 0) { _spiritHash = StringExtensionMethods.GetStableHashCode("SE_GreydwarfLordSpirit"); } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan != null && sEMan.HaveStatusEffect(_spiritHash)) { Vector3 val = ((Component)localPlayer).transform.position - ((Component)__instance).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude > 400f)) { __result *= 0.77f; } } } } [HarmonyPatch(typeof(Smelter), "Spawn")] public static class Smelter_Spawn_RefinersTouch { private const float Range = 30f; private static int _seHash; [HarmonyPostfix] public static void Postfix(Smelter __instance, string ore, int stack) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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) if ((Object)(object)__instance == (Object)null || string.IsNullOrEmpty(ore)) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } Vector3 val = ((Component)localPlayer).transform.position - ((Component)__instance).transform.position; if (((Vector3)(ref val)).sqrMagnitude > 900f) { return; } if (_seHash == 0) { _seHash = StringExtensionMethods.GetStableHashCode("SE_SeekerLordSpirit"); } SEMan sEMan = ((Character)localPlayer).GetSEMan(); if (sEMan == null || !sEMan.HaveStatusEffect(_seHash) || Random.value >= LordConfig.RefinersTouchChance.Value) { return; } ItemDrop val2 = null; foreach (ItemConversion item in __instance.m_conversion) { if ((Object)(object)item?.m_from != (Object)null && ((Object)((Component)item.m_from).gameObject).name == ore) { val2 = item.m_to; break; } } if (!((Object)(object)val2 == (Object)null)) { Transform val3 = (((Object)(object)__instance.m_outputPoint != (Object)null) ? __instance.m_outputPoint : ((Component)__instance).transform); ItemDrop component = Object.Instantiate(((Component)val2).gameObject, val3.position, val3.rotation).GetComponent(); if ((Object)(object)component != (Object)null) { component.m_itemData.m_stack = stack; ItemDrop.OnCreateNew(component); } ((Character)localPlayer).Message((MessageType)1, "Refiner's Touch — extra output.", 0, (Sprite)null); if (LordConfig.DebugLogging.Value) { Logger.LogInfo((object)$"[BiomeLords] RefinersTouch bonus: {((Object)((Component)val2).gameObject).name} x{stack} from {((Object)__instance).name}"); } } } } [HarmonyPatch(typeof(Character), "Damage")] public static class Character_Damage_PackWhisperer { private const float WhispererDmgTakenMult = 0.5f; private const float SynergyDmgTakenMult = 0.15f; private const float HowlDmgDealtMult = 2f; private const float Range = 30f; private static int _blessingHash; private static int _howlHash; [HarmonyPrefix] public static void Prefix(Character __instance, HitData hit) { if (hit == null || (Object)(object)__instance == (Object)null) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { return; } if (_blessingHash == 0) { _blessingHash = StringExtensionMethods.GetStableHashCode("SE_FenringLordSpirit"); } if (_howlHash == 0) { _howlHash = StringExtensionMethods.GetStableHashCode("GP_HowlOfThePack"); } SEMan sEMan = ((Character)localPlayer).GetSEMan(); bool flag = sEMan != null && sEMan.HaveStatusEffect(_blessingHash); bool flag2 = sEMan != null && sEMan.HaveStatusEffect(_howlHash); if (!flag && !flag2) { return; } if (flag && IsTamedWolf(__instance) && InRange((Component)(object)localPlayer, (Component)(object)__instance)) { float mult = (flag2 ? 0.15f : 0.5f); Scale(hit, mult); } else if (flag2) { Character attacker = hit.GetAttacker(); if (IsTamedWolf(attacker) && InRange((Component)(object)localPlayer, (Component)(object)attacker)) { Scale(hit, 2f); } } } private static bool IsTamedWolf(Character c) { if ((Object)(object)c == (Object)null) { return false; } if (!((Object)((Component)c).gameObject).name.StartsWith("Wolf")) { return false; } return c.IsTamed(); } private static bool InRange(Component a, Component b) { //IL_001a: 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_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) if ((Object)(object)a == (Object)null || (Object)(object)b == (Object)null) { return false; } Vector3 val = a.transform.position - b.transform.position; return ((Vector3)(ref val)).sqrMagnitude <= 900f; } private static void Scale(HitData hit, float mult) { hit.m_damage.m_damage *= mult; hit.m_damage.m_blunt *= mult; hit.m_damage.m_slash *= mult; hit.m_damage.m_pierce *= mult; hit.m_damage.m_chop *= mult; hit.m_damage.m_pickaxe *= mult; hit.m_damage.m_fire *= mult; hit.m_damage.m_frost *= mult; hit.m_damage.m_lightning *= mult; hit.m_damage.m_poison *= mult; hit.m_damage.m_spirit *= mult; } } [HarmonyPatch(typeof(Game), "Start")] public static class Game_Start_ValkyrieRallyRpc { [HarmonyPostfix] public static void Postfix() { ValkyrieRallyService.RegisterRpc(); } } [HarmonyPatch(typeof(Character), "Start")] public static class VanillaBossScalingPatch { private static readonly Dictionary NativeTierByPrefab = new Dictionary { { "Eikthyr", 1 }, { "gd_king", 2 }, { "Bonemass", 3 }, { "Dragon", 4 }, { "GoblinKing", 5 }, { "SeekerQueen", 6 }, { "FallenValkyrie", 7 } }; [HarmonyPostfix] public static void Postfix(Character __instance) { if ((Object)(object)__instance == (Object)null || !__instance.m_boss) { return; } string text = StripClone(((Object)((Component)__instance).gameObject).name); if (!NativeTierByPrefab.TryGetValue(text, out var value)) { return; } int val = LordDefeatStore.HighestDefeatedTier(); int num = Math.Max(value, val); if (num != value) { float num2 = TierTable.HpFor(num); Humanoid component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { ((Character)component).SetMaxHealth(num2); ((Character)component).SetHealth(num2); } float num3 = LordAttackProfile.TierMagnitude(value); float num4 = LordAttackProfile.TierMagnitude(num); float num5 = ((num3 > 0f) ? (num4 / num3) : 1f); LordDamageRegistry.Set(__instance, num5); Logger.LogInfo((object)($"[BiomeLords] Vanilla boss scaled: {text} nativeTier={value} " + $"effectiveTier={num} HP={num2:F0} dmgMult=×{num5:F2} " + $"(magnitude {num3:F0}→{num4:F0})")); } } private static string StripClone(string n) { if (string.IsNullOrEmpty(n)) { return n; } if (!n.EndsWith("(Clone)")) { return n; } return n.Substring(0, n.Length - "(Clone)".Length); } } } namespace BiomeLords.Data { public class BiomeLordDef { public string Id; public string DisplayName; public string[] KillTargets; public int DefaultKillRequirement; public string Biome; public string BasePrefab; public int Tier; public BiomeLordDef(string id, string display, string basePrefab, string biome, int tier, int killReq, params string[] killTargets) { Id = id; DisplayName = display; BasePrefab = basePrefab; Biome = biome; Tier = tier; DefaultKillRequirement = killReq; KillTargets = killTargets; } } public static class LordRegistry { public static readonly List All = new List { new BiomeLordDef("neck_lord", "Neck Lord", "Neck", "Meadows", 1, 20, "Neck"), new BiomeLordDef("greydwarf_lord", "Greydwarf Shaman Lord", "Greydwarf_Shaman", "BlackForest", 2, 30, "Greydwarf", "Greydwarf_Elite", "Greydwarf_Shaman"), new BiomeLordDef("draugr_lord", "Draugr Elite Lord", "Draugr_Elite", "Swamp", 3, 25, "Draugr", "Draugr_Elite", "Draugr_Ranged"), new BiomeLordDef("fenring_lord", "Fenring Lord", "Fenring", "Mountain", 4, 20, "Wolf", "Fenring", "Fenring_Cultist"), new BiomeLordDef("lox_lord", "Lox Lord", "Lox", "Plains", 5, 10, "Lox"), new BiomeLordDef("seeker_lord", "Seeker Lord", "Seeker", "Mistlands", 6, 20, "Seeker", "SeekerBrute", "SeekerBrood"), new BiomeLordDef("faller_valkyrie_lord", "Fallen Valkyrie Lord", "FallenValkyrie", "AshLands", 7, 25, "Charred_Melee", "Charred_Archer", "Charred_Mage") }; public static BiomeLordDef ById(string id) { return All.Find((BiomeLordDef l) => l.Id == id); } public static BiomeLordDef FindByKillTarget(string prefabName) { foreach (BiomeLordDef item in All) { string[] killTargets = item.KillTargets; for (int i = 0; i < killTargets.Length; i++) { if (killTargets[i] == prefabName) { return item; } } } return null; } } } namespace BiomeLords.Config { public static class LordConfig { public static ConfigEntry DebugLogging; public static ConfigEntry EnableKillTracking; public static ConfigEntry ShowCropGrowTimes; public static ConfigEntry GlobalLordDefeats; public static ConfigEntry BlessingChargesPerTrophy; public static ConfigEntry FisherBoonBonusFishChance; public static ConfigEntry FisherBoonBaitSaveChance; public static ConfigEntry HearthMasterMultiplier; public static ConfigEntry RefinersTouchChance; public static ConfigEntry FallerValkyrieWeightCap; public static ConfigEntry FallerValkyrieExtraRows; public static ConfigEntry ValkyrieRallyRadius; public static ConfigEntry ValkyrieRallyRestedSeconds; public static ConfigEntry HallRecipe; private static readonly Dictionary> _killReq = new Dictionary>(); private static readonly Dictionary> _hpMult = new Dictionary>(); private static readonly Dictionary> _dmgMult = new Dictionary>(); private static ConfigDescription Admin(string description) { //IL_000a: 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) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown return new ConfigDescription(description, (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { IsAdminOnly = true } }); } public static void Bind(ConfigFile cfg) { DebugLogging = cfg.Bind("General", "DebugLogging", false, Admin("Verbose logging for kill tracking and summon checks. Spammy — leave off in normal play.")); EnableKillTracking = cfg.Bind("General", "EnableKillTracking", true, Admin("Master switch for kill tracking. Disable to stop counting (existing counts are preserved).")); ShowCropGrowTimes = cfg.Bind("General", "ShowCropGrowTimes", false, Admin("DEBUG: When true, planted crops show remaining grow time in their hover text.")); GlobalLordDefeats = cfg.Bind("General", "GlobalLordDefeats", false, Admin("When false (default), each player's Lord defeat progression is tracked individually — only your own Lord kills raise your scaling tier. When true, any Lord kill on the server advances scaling for every player.")); BlessingChargesPerTrophy = cfg.Bind("Blessings", "ChargesPerTrophy", 5, Admin("How many blessings each mounted trophy can grant before crumbling to dust. Hunting the Lord again restocks via a fresh trophy.")); FisherBoonBonusFishChance = cfg.Bind("Blessings", "FisherBoonBonusFishChance", 0.25f, Admin("Fisher's Boon: chance (0-1) for a bonus fish on pickup. 0.25 = 25%.")); FisherBoonBaitSaveChance = cfg.Bind("Blessings", "FisherBoonBaitSaveChance", 0.5f, Admin("Fisher's Boon (Bait Saver): chance (0-1) that a cast doesn't consume bait. 0.50 = 50%.")); HearthMasterMultiplier = cfg.Bind("Blessings", "HearthMasterMultiplier", 2f, Admin("Hearth Master (Lox Lord): multiplier on the duration of food buffs you eat. 2.0 = 100% longer. Stacks with vanilla cooking-quality bonuses.")); RefinersTouchChance = cfg.Bind("Blessings", "RefinersTouchChance", 0.5f, Admin("Refiner's Touch (Seeker Lord): chance (0-1) that a Smelter, Blast Furnace, Spinning Wheel or Eitr Refinery yields a bonus output item when one finishes near you. 0.5 = 50%.")); FallerValkyrieWeightCap = cfg.Bind("Blessings", "FallerValkyrieWeightCap", 1000f, Admin("Featherweight (Fallen Valkyrie Lord): raised carry-weight cap, in units. Below this you suffer NO over-encumbrance penalty — you walk, run, and regenerate stamina normally with no encumbered animation. Only when your load reaches this cap (1000) does the normal encumbered state kick in. The inventory weight readout still shows your base capacity, not this cap.")); FallerValkyrieExtraRows = cfg.Bind("Blessings", "FallerValkyrieExtraRows", 2, Admin("Featherweight: extra inventory rows granted while the blessing is active (8 slots per row). When you switch to a different blessing, items left in these extra rows are moved into a CargoCrate dropped at your feet.")); ValkyrieRallyRadius = cfg.Bind("ForsakenPowers", "ValkyrieRallyRadius", 20f, Admin("Valkyrie's Rally (Fallen Valkyrie Lord): radius, in metres, around the caster within which all players are fully restored. 20 = 20 m.")); ValkyrieRallyRestedSeconds = cfg.Bind("ForsakenPowers", "ValkyrieRallyRestedSeconds", 1200f, Admin("Valkyrie's Rally: duration of the Rested buff granted to affected players, in seconds. 1200 = 20 minutes.")); HallRecipe = cfg.Bind("Hall", "Recipe", "Stone:40,FineWood:20,Flint:10,SurtlingCore:3", Admin("Comma-separated 'ItemPrefab:Amount' pairs for the Hall of the Lords. Examples: 'Stone:40,FineWood:20,Flint:10,SurtlingCore:3' (default). Use vanilla item prefab names. Amounts ≤ 0 skip that requirement.")); foreach (BiomeLordDef item in LordRegistry.All) { _killReq[item.Id] = cfg.Bind("KillRequirements", item.Id, item.DefaultKillRequirement, Admin("Kills required before the Lord's Horn can summon the " + item.DisplayName + ". Targets: " + string.Join(", ", item.KillTargets))); _hpMult[item.Id] = cfg.Bind("LordStats.HealthMultiplier", item.Id, 1f, Admin("Multiplier applied to the " + item.DisplayName + "'s tier-baseline HP. 1.0 = default. 2.0 = twice as tough. 0.5 = half as tough.")); _dmgMult[item.Id] = cfg.Bind("LordStats.DamageMultiplier", item.Id, 1f, Admin("Multiplier applied to the " + item.DisplayName + "'s tier-baseline damage. 1.0 = default. 2.0 = twice as hard-hitting. 0.5 = half damage.")); } } public static int KillRequirement(string lordId) { if (!_killReq.TryGetValue(lordId, out var value)) { return 0; } return value.Value; } public static float HealthMultiplier(string lordId) { if (!_hpMult.TryGetValue(lordId, out var value)) { return 1f; } return value.Value; } public static float DamageMultiplier(string lordId) { if (!_dmgMult.TryGetValue(lordId, out var value)) { return 1f; } return value.Value; } } }