Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Path of the Fallen v1.0.8
PathOfTheFallen.dll
Decompiled 2 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.IO; using System.IO.Compression; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CoarstalsEitrArmorMod; using CoarstalsEnemyOverhaul; using CoarstalsRPClasses; using FinalMod; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using NewDualAxesMod; using NoVegvisir; using Splatform; using TMPro; using Unity.Collections; using UnityEngine; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.UI; using WeaponAttributesMod; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace FinalMod { public static class FinalModulesConfig { public const string SectionName = "00. Modules"; public static ConfigEntry<bool> EnableRPClasses; public static ConfigEntry<bool> EnableWeaponAttributes; public static ConfigEntry<bool> EnableWeaponPack; public static ConfigEntry<bool> EnableEitrArmor; public static ConfigEntry<bool> EnableEnemyOverhaul; public static ConfigEntry<bool> EnableNoVegvisir; public static void Bind(ConfigFile config) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown ConfigurationManagerAttributes val = new ConfigurationManagerAttributes(); val.IsAdminOnly = true; val.Order = 100; ConfigurationManagerAttributes val2 = val; EnableRPClasses = config.Bind<bool>("00. Modules", "EnableRPClasses", true, new ConfigDescription("Включить модуль ролевой системы классов (RP Classes: 6 классов, пассивки, Свиток Перерождения у Хильдир).", (AcceptableValueBase)null, new object[1] { val2 })); EnableWeaponAttributes = config.Bind<bool>("00. Modules", "EnableWeaponAttributes", true, new ConfigDescription("Включить модуль зачарования оружия душами боссов (WeaponAttributes: Стол Зачарования, 4 улучшения станции и 5 тиров чар).", (AcceptableValueBase)null, new object[1] { val2 })); EnableWeaponPack = config.Bind<bool>("00. Modules", "EnableWeaponPack", true, new ConfigDescription("Включить модуль нового снаряжения и кулинарии (WeaponPack: 2 вида парных топоров, 5 магических посохов включая Посох Очищения и 6 блюд на Эйтр).", (AcceptableValueBase)null, new object[1] { val2 })); EnableEitrArmor = config.Bind<bool>("00. Modules", "EnableEitrArmor", true, new ConfigDescription("Включить модуль ранней и средней магической брони на Эйтр (EitrArmor: сеты Чёрного Леса и Гор).", (AcceptableValueBase)null, new object[1] { val2 })); EnableEnemyOverhaul = config.Bind<bool>("00. Modules", "EnableEnemyOverhaul", true, new ConfigDescription("Включить модуль усиления врагов и данжей (EnemyOverhaul: Именные Чемпионы Охоты, 6 Боевых Травм и Проклятые Запечатанные Подземелья).", (AcceptableValueBase)null, new object[1] { val2 })); EnableNoVegvisir = config.Bind<bool>("00. Modules", "EnableNoVegvisir", true, new ConfigDescription("Включить модуль удаления рунных камней-вегвизиров боссов в мире и подземельях (NoVegvisir).", (AcceptableValueBase)null, new object[1] { val2 })); } } [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.coarstal.pathofthefallen", "Valheim - Path of the Fallen", "1.0.8")] public class PathOfTheFallenPlugin : BaseUnityPlugin { public const string PluginGUID = "com.coarstal.pathofthefallen"; public const string PluginName = "Valheim - Path of the Fallen"; public const string PluginVersion = "1.0.8"; internal static ManualLogSource ModLogger; private Harmony m_harmony; private void Awake() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown ModLogger = ((BaseUnityPlugin)this).Logger; FinalModulesConfig.Bind(((BaseUnityPlugin)this).Config); RPClassesModule.BindConfigs(((BaseUnityPlugin)this).Config); WeaponAttributesPlugin.BindConfigs(((BaseUnityPlugin)this).Config); NewDualAxesPlugin.BindConfigs(((BaseUnityPlugin)this).Config); CoarstalsEitrArmorPlugin.BindConfigs(((BaseUnityPlugin)this).Config); EnemyOverhaulModule.BindConfigs(((BaseUnityPlugin)this).Config); NoVegvisirPlugin.BindConfigs(((BaseUnityPlugin)this).Config); m_harmony = new Harmony("com.coarstal.pathofthefallen"); if (FinalModulesConfig.EnableRPClasses.Value) { RPClassesModule.Init(((BaseUnityPlugin)this).Logger); PatchModuleNamespace(m_harmony, "CoarstalsRPClasses"); } if (FinalModulesConfig.EnableWeaponAttributes.Value) { WeaponAttributesPlugin.Init(((BaseUnityPlugin)this).Logger); PatchModuleNamespace(m_harmony, "WeaponAttributesMod"); } if (FinalModulesConfig.EnableWeaponPack.Value) { NewDualAxesPlugin.Init(((BaseUnityPlugin)this).Logger); PatchModuleNamespace(m_harmony, "NewDualAxesMod"); } if (FinalModulesConfig.EnableEitrArmor.Value) { CoarstalsEitrArmorPlugin.Init(((BaseUnityPlugin)this).Logger); PatchModuleNamespace(m_harmony, "CoarstalsEitrArmorMod"); } if (FinalModulesConfig.EnableEnemyOverhaul.Value) { EnemyOverhaulModule.Init(((BaseUnityPlugin)this).Logger); PatchModuleNamespace(m_harmony, "CoarstalsEnemyOverhaul"); } if (FinalModulesConfig.EnableNoVegvisir.Value) { NoVegvisirPlugin.Init(((BaseUnityPlugin)this).Logger); PatchModuleNamespace(m_harmony, "NoVegvisir"); } ((BaseUnityPlugin)this).Logger.LogInfo((object)string.Format("{0} v{1} loaded successfully!", "Valheim - Path of the Fallen", "1.0.8")); } private void Update() { if (WeaponAttributesPlugin.IsActive) { SoulExtractionUI.UpdateTick(); } } private void OnDestroy() { RPClassesModule.Shutdown(); WeaponAttributesPlugin.Shutdown(); NewDualAxesPlugin.Shutdown(); CoarstalsEitrArmorPlugin.Shutdown(); EnemyOverhaulModule.Shutdown(); if (m_harmony != null) { m_harmony.UnpatchSelf(); } } private static void PatchModuleNamespace(Harmony harmony, string targetNamespace) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (harmony == null || string.IsNullOrEmpty(targetNamespace)) { return; } Type[] typesFromAssembly = AccessTools.GetTypesFromAssembly(typeof(PathOfTheFallenPlugin).Assembly); int num = 0; foreach (Type type in typesFromAssembly) { if (type == null || type.Namespace != targetNamespace) { continue; } try { List<HarmonyMethod> fromType = HarmonyMethodExtensions.GetFromType(type); if (fromType != null && fromType.Count > 0) { new PatchClassProcessor(harmony, type).Patch(); num++; } } catch (Exception arg) { if (ModLogger != null) { ModLogger.LogError((object)$"[PathOfTheFallen] Failed patching {type.FullName}: {arg}"); } } } if (ModLogger != null) { ModLogger.LogInfo((object)$"[PathOfTheFallen] Patched {num} Harmony class(es) in namespace '{targetNamespace}'."); } } } } namespace CoarstalsEitrArmorMod { public class CoarstalsEitrArmorPlugin { private enum RecolorMode { BlackForestTrollBlue, MountainFrostGrey } public const string PluginGUID = "com.coarstal.eitrarmor"; public const string PluginName = "Coarstal's Eitr Armor"; public const string PluginVersion = "1.1.1"; public const string BFHoodPrefab = "ArmorForestShamanHood"; public const string BFChestPrefab = "ArmorForestShamanChest"; public const string BFLegsPrefab = "ArmorForestShamanLegs"; public const string BFSetName = "ForestShamanEitrSet"; public const string BFSetEffectName = "SE_ForestShamanSet"; public const string MTHoodPrefab = "ArmorWolfMageHood"; public const string MTChestPrefab = "ArmorWolfMageChest"; public const string MTLegsPrefab = "ArmorWolfMageLegs"; public const string MTSetName = "WolfRuneMageEitrSet"; public const string MTSetEffectName = "SE_WolfRuneMageSet"; internal static ManualLogSource ModLogger; public static ConfigEntry<float> BFArmorBase; public static ConfigEntry<float> BFArmorPerLevel; public static ConfigEntry<float> BFHoodEitrRegen; public static ConfigEntry<float> BFChestEitrRegen; public static ConfigEntry<float> BFLegsEitrRegen; public static ConfigEntry<float> BFSetBonusEitrRegen; public static ConfigEntry<int> BFMinStationLevel; public static ConfigEntry<string> BFHoodRecipe; public static ConfigEntry<string> BFChestRecipe; public static ConfigEntry<string> BFLegsRecipe; public static ConfigEntry<float> MTArmorBase; public static ConfigEntry<float> MTArmorPerLevel; public static ConfigEntry<float> MTHoodEitrRegen; public static ConfigEntry<float> MTChestEitrRegen; public static ConfigEntry<float> MTLegsEitrRegen; public static ConfigEntry<float> MTSetBonusEitrRegen; public static ConfigEntry<bool> MTChestFrostResist; public static ConfigEntry<int> MTMinStationLevel; public static ConfigEntry<string> MTHoodRecipe; public static ConfigEntry<string> MTChestRecipe; public static ConfigEntry<string> MTLegsRecipe; private static bool s_registered; private static bool s_initialized; internal static SE_Stats s_bfSetStatusEffect; internal static SE_Stats s_mtSetStatusEffect; private static readonly Dictionary<string, Material> s_recoloredMatCache = new Dictionary<string, Material>(); private static readonly Dictionary<string, Texture2D> s_recoloredTexCache = new Dictionary<string, Texture2D>(); public static void BindConfigs(ConfigFile config) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Expected O, but got Unknown //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Expected O, but got Unknown //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Expected O, but got Unknown //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Expected O, but got Unknown //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Expected O, but got Unknown //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Expected O, but got Unknown //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Expected O, but got Unknown //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Expected O, but got Unknown ConfigurationManagerAttributes val = new ConfigurationManagerAttributes(); val.IsAdminOnly = true; ConfigurationManagerAttributes val2 = val; BFArmorBase = config.Bind<float>("04. Eitr Armor - 1. Black Forest Set", "BaseArmor", 5f, new ConfigDescription("Base armor value at quality level 1 for each piece of the Black Forest Eitr set.", (AcceptableValueBase)null, new object[1] { val2 })); BFArmorPerLevel = config.Bind<float>("04. Eitr Armor - 1. Black Forest Set", "ArmorPerLevel", 2f, new ConfigDescription("Additional armor gained per upgrade level for each piece of the Black Forest Eitr set.", (AcceptableValueBase)null, new object[1] { val2 })); BFHoodEitrRegen = config.Bind<float>("04. Eitr Armor - 1. Black Forest Set", "HoodEitrRegenBonus", 0.1f, new ConfigDescription("Eitr regeneration bonus on Hood (0.10 = +10%).", (AcceptableValueBase)null, new object[1] { val2 })); BFChestEitrRegen = config.Bind<float>("04. Eitr Armor - 1. Black Forest Set", "ChestEitrRegenBonus", 0.15f, new ConfigDescription("Eitr regeneration bonus on Robe (0.15 = +15%).", (AcceptableValueBase)null, new object[1] { val2 })); BFLegsEitrRegen = config.Bind<float>("04. Eitr Armor - 1. Black Forest Set", "LegsEitrRegenBonus", 0.15f, new ConfigDescription("Eitr regeneration bonus on Trousers (0.15 = +15%).", (AcceptableValueBase)null, new object[1] { val2 })); BFSetBonusEitrRegen = config.Bind<float>("04. Eitr Armor - 1. Black Forest Set", "SetBonusEitrRegen", 0.2f, new ConfigDescription("3-piece Set Bonus Eitr regeneration for Black Forest set (0.20 = +20%, bringing full set total to +60%).", (AcceptableValueBase)null, new object[1] { val2 })); BFMinStationLevel = config.Bind<int>("04. Eitr Armor - 1. Black Forest Set", "MinForgeLevel", 1, new ConfigDescription("Minimum Forge level required to craft the Black Forest set.", (AcceptableValueBase)null, new object[1] { val2 })); BFHoodRecipe = config.Bind<string>("04. Eitr Armor - 1. Black Forest Set", "HoodRecipe", "Copper:4:2,TrollHide:4:2,SurtlingCore:1:1,Thistle:4:2", new ConfigDescription("Crafting recipe for Black Forest Hood (Format: Prefab:Amount:AmountPerLevel).", (AcceptableValueBase)null, new object[1] { val2 })); BFChestRecipe = config.Bind<string>("04. Eitr Armor - 1. Black Forest Set", "ChestRecipe", "Copper:6:3,TrollHide:6:2,SurtlingCore:2:1,Thistle:6:2", new ConfigDescription("Crafting recipe for Black Forest Robe (Format: Prefab:Amount:AmountPerLevel).", (AcceptableValueBase)null, new object[1] { val2 })); BFLegsRecipe = config.Bind<string>("04. Eitr Armor - 1. Black Forest Set", "LegsRecipe", "Copper:5:2,TrollHide:5:2,SurtlingCore:1:1,Thistle:4:2", new ConfigDescription("Crafting recipe for Black Forest Trousers (Format: Prefab:Amount:AmountPerLevel).", (AcceptableValueBase)null, new object[1] { val2 })); MTArmorBase = config.Bind<float>("04. Eitr Armor - 2. Mountain Set", "BaseArmor", 8f, new ConfigDescription("Base armor value at quality level 1 for each piece of the Mountain Eitr set.", (AcceptableValueBase)null, new object[1] { val2 })); MTArmorPerLevel = config.Bind<float>("04. Eitr Armor - 2. Mountain Set", "ArmorPerLevel", 2f, new ConfigDescription("Additional armor gained per upgrade level for each piece of the Mountain Eitr set.", (AcceptableValueBase)null, new object[1] { val2 })); MTHoodEitrRegen = config.Bind<float>("04. Eitr Armor - 2. Mountain Set", "HoodEitrRegenBonus", 0.2f, new ConfigDescription("Eitr regeneration bonus on Mountain Hood (0.20 = +20%).", (AcceptableValueBase)null, new object[1] { val2 })); MTChestEitrRegen = config.Bind<float>("04. Eitr Armor - 2. Mountain Set", "ChestEitrRegenBonus", 0.25f, new ConfigDescription("Eitr regeneration bonus on Mountain Robe (0.25 = +25%).", (AcceptableValueBase)null, new object[1] { val2 })); MTLegsEitrRegen = config.Bind<float>("04. Eitr Armor - 2. Mountain Set", "LegsEitrRegenBonus", 0.25f, new ConfigDescription("Eitr regeneration bonus on Mountain Trousers (0.25 = +25%).", (AcceptableValueBase)null, new object[1] { val2 })); MTSetBonusEitrRegen = config.Bind<float>("04. Eitr Armor - 2. Mountain Set", "SetBonusEitrRegen", 0.3f, new ConfigDescription("3-piece Set Bonus Eitr regeneration for Mountain set (0.30 = +30%, bringing full set total to +100%).", (AcceptableValueBase)null, new object[1] { val2 })); MTChestFrostResist = config.Bind<bool>("04. Eitr Armor - 2. Mountain Set", "ChestGrantsFrostResistance", true, new ConfigDescription("Whether the Mountain Robe grants built-in Frost resistance (prevents Freezing in Mountains).", (AcceptableValueBase)null, new object[1] { val2 })); MTMinStationLevel = config.Bind<int>("04. Eitr Armor - 2. Mountain Set", "MinForgeLevel", 2, new ConfigDescription("Minimum Forge level required to craft the Mountain set.", (AcceptableValueBase)null, new object[1] { val2 })); MTHoodRecipe = config.Bind<string>("04. Eitr Armor - 2. Mountain Set", "HoodRecipe", "Silver:5:2,WolfPelt:4:2,Obsidian:6:2,Crystal:2:1", new ConfigDescription("Crafting recipe for Mountain Hood (Format: Prefab:Amount:AmountPerLevel).", (AcceptableValueBase)null, new object[1] { val2 })); MTChestRecipe = config.Bind<string>("04. Eitr Armor - 2. Mountain Set", "ChestRecipe", "Silver:8:3,WolfPelt:6:3,Obsidian:6:3,Crystal:4:2", new ConfigDescription("Crafting recipe for Mountain Robe (Format: Prefab:Amount:AmountPerLevel).", (AcceptableValueBase)null, new object[1] { val2 })); MTLegsRecipe = config.Bind<string>("04. Eitr Armor - 2. Mountain Set", "LegsRecipe", "Silver:6:2,WolfPelt:5:2,Obsidian:6:2,Crystal:2:1", new ConfigDescription("Crafting recipe for Mountain Trousers (Format: Prefab:Amount:AmountPerLevel).", (AcceptableValueBase)null, new object[1] { val2 })); MigrateLegacyFenrisHairInConfigs(config); } public static void Init(ManualLogSource logger) { if (!s_initialized) { ModLogger = logger; RegisterLocalizations(); PrefabManager.OnVanillaPrefabsAvailable += RegisterAllEitrArmors; s_initialized = true; if (ModLogger != null) { ModLogger.LogInfo((object)"[PathOfTheFallen] EitrArmor module initialized."); } } } public static void Shutdown() { PrefabManager.OnVanillaPrefabsAvailable -= RegisterAllEitrArmors; s_initialized = false; } private static void MigrateLegacyFenrisHairInConfigs(ConfigFile config) { bool flag = false; ConfigEntry<string>[] array = new ConfigEntry<string>[3] { MTHoodRecipe, MTChestRecipe, MTLegsRecipe }; for (int i = 0; i < array.Length; i++) { string value = array[i].Value; if (string.IsNullOrEmpty(value) || (!value.Contains("WolfHairBundle") && !value.Contains("FenrisHair"))) { continue; } string[] array2 = value.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries); List<string> list = new List<string>(); for (int j = 0; j < array2.Length; j++) { string text = array2[j].Trim(); if (!text.StartsWith("WolfHairBundle:", StringComparison.OrdinalIgnoreCase) && !text.StartsWith("FenrisHair:", StringComparison.OrdinalIgnoreCase)) { list.Add(text); } } array[i].Value = string.Join(",", list.ToArray()); flag = true; } if (flag && config != null) { config.Save(); } } private static void RegisterLocalizations() { CustomLocalization localization = LocalizationManager.Instance.GetLocalization(); string text = "English"; localization.AddTranslation(ref text, new Dictionary<string, string> { { "item_forestshaman_hood", "Forest Eitr-Weave Hood" }, { "item_forestshaman_hood_desc", "An azure mage hood woven with Black Forest troll hide and surtling essence, accelerating Eitr recovery." }, { "item_forestshaman_chest", "Forest Eitr-Weave Robe" }, { "item_forestshaman_chest_desc", "A blue Eitr-woven robe attuned to the ancient woods, pairing seamlessly with troll-hide cloaks." }, { "item_forestshaman_legs", "Forest Eitr-Weave Trousers" }, { "item_forestshaman_legs_desc", "Light azure mage trousers threaded with copper and forest runes for swift Eitr flow." }, { "se_forestshaman_set", "Whisper of the Forest" }, { "item_wolfmage_hood", "Frost Embla Hood" }, { "item_wolfmage_hood_desc", "A storm-grey mountain mage hood forged with silver and crystal, focusing arcane power in the cold." }, { "item_wolfmage_chest", "Frost Embla Robes" }, { "item_wolfmage_chest_desc", "Silver-grey vestments modeled after Embla's attire, warding off mountain blizzards and surging with Eitr." }, { "item_wolfmage_legs", "Frost Embla Trousers" }, { "item_wolfmage_legs_desc", "Insulated grey mage trousers woven with wolf pelts and silver threads." }, { "se_wolfmage_set", "Mountain Arcane Surge" } }); string text2 = "Russian"; localization.AddTranslation(ref text2, new Dictionary<string, string> { { "item_forestshaman_hood", "Лесной капюшон эйтра" }, { "item_forestshaman_hood_desc", "Синий капюшон из плетения эйтра в тонах Чёрного леса, ускоряющий восстановление эйтра." }, { "item_forestshaman_chest", "Лесное сшитое из эйтра одеяние" }, { "item_forestshaman_chest_desc", "Синее магическое одеяние из Чёрного леса, идеально сочетающееся с плащом из шкуры тролля." }, { "item_forestshaman_legs", "Лесные штаны эйтра" }, { "item_forestshaman_legs_desc", "Лёгкие синие штаны мага, прошитые медной нитью для свободного тока эйтра." }, { "se_forestshaman_set", "Дыхание Чёрного леса" }, { "item_wolfmage_hood", "Горный капюшон Эмблы" }, { "item_wolfmage_hood_desc", "Пепельно-серый капюшон мага с серебряной отделкой, наполняющий разум силой горных вершин." }, { "item_wolfmage_chest", "Горная одежда Эмблы" }, { "item_wolfmage_chest_desc", "Серо-серебристое облачение Эмблы, защищающее от горной стужи и отлично сочетающееся с волчьим плащом." }, { "item_wolfmage_legs", "Горные штаны Эмблы" }, { "item_wolfmage_legs_desc", "Утеплённая серая юбка-штаны Эмблы, сотканная с серебром и волчьим мехом." }, { "se_wolfmage_set", "Морозный поток Эмблы" } }); } private static void RegisterAllEitrArmors() { //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Expected O, but got Unknown if (s_registered || (FinalModulesConfig.EnableEitrArmor != null && !FinalModulesConfig.EnableEitrArmor.Value)) { return; } if (ItemManager.Instance.GetItem("ArmorForestShamanHood") != null || (Object)(object)PrefabManager.Instance.GetPrefab("ArmorForestShamanHood") != (Object)null) { s_registered = true; return; } try { GameObject prefab = PrefabManager.Instance.GetPrefab("HelmetMage"); GameObject prefab2 = PrefabManager.Instance.GetPrefab("ArmorMageChest"); GameObject prefab3 = PrefabManager.Instance.GetPrefab("ArmorMageLegs"); GameObject val = FindFirstValidPrefab("HelmetMage_Ashlands", "HelmetAshlandsMage", "HelmetMage"); GameObject val2 = FindFirstValidPrefab("ArmorMageChest_Ashlands", "ArmorMageAshlandsChest", "ArmorMageChest"); GameObject val3 = FindFirstValidPrefab("ArmorMageLegs_Ashlands", "ArmorMageAshlandsLegs", "ArmorMageLegs"); if ((Object)(object)prefab == (Object)null || (Object)(object)prefab2 == (Object)null || (Object)(object)prefab3 == (Object)null || (Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null) { if (ModLogger != null) { ModLogger.LogError((object)"Could not find vanilla Eitr-Weave or Embla armor donor prefabs!"); } return; } if (ModLogger != null) { ModLogger.LogInfo((object)$"[EitrArmor] Vanilla donors resolved -> BlackForest(Blue): [{((Object)prefab).name}, {((Object)prefab2).name}, {((Object)prefab3).name}] | Mountains(Grey): [{((Object)val).name}, {((Object)val2).name}, {((Object)val3).name}]"); } Sprite icon = CloneAndRecolorItemIcon(prefab, "ArmorForestShamanHood_Icon", RecolorMode.BlackForestTrollBlue); Sprite icon2 = CloneAndRecolorItemIcon(prefab2, "ArmorForestShamanChest_Icon", RecolorMode.BlackForestTrollBlue); Sprite icon3 = CloneAndRecolorItemIcon(prefab3, "ArmorForestShamanLegs_Icon", RecolorMode.BlackForestTrollBlue); Sprite icon4 = CloneAndRecolorItemIcon(val, "ArmorWolfMageHood_Icon", RecolorMode.MountainFrostGrey); Sprite icon5 = CloneAndRecolorItemIcon(val2, "ArmorWolfMageChest_Icon", RecolorMode.MountainFrostGrey); Sprite icon6 = CloneAndRecolorItemIcon(val3, "ArmorWolfMageLegs_Icon", RecolorMode.MountainFrostGrey); s_bfSetStatusEffect = CreateSetEitrStatusEffect("SE_ForestShamanSet", "$se_forestshaman_set", icon, BFSetBonusEitrRegen.Value); s_mtSetStatusEffect = CreateSetEitrStatusEffect("SE_WolfRuneMageSet", "$se_wolfmage_set", icon4, MTSetBonusEitrRegen.Value); ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)s_bfSetStatusEffect, false)); ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)s_mtSetStatusEffect, false)); CloneRecolorAndRegisterVanillaArmor("ArmorForestShamanHood", prefab, RecolorMode.BlackForestTrollBlue, "$item_forestshaman_hood", "$item_forestshaman_hood_desc", icon, BFArmorBase.Value, BFArmorPerLevel.Value, BFHoodEitrRegen.Value, grantFrostResist: false, "ForestShamanEitrSet", (StatusEffect)(object)s_bfSetStatusEffect, BFMinStationLevel.Value, BFHoodRecipe.Value); CloneRecolorAndRegisterVanillaArmor("ArmorForestShamanChest", prefab2, RecolorMode.BlackForestTrollBlue, "$item_forestshaman_chest", "$item_forestshaman_chest_desc", icon2, BFArmorBase.Value, BFArmorPerLevel.Value, BFChestEitrRegen.Value, grantFrostResist: false, "ForestShamanEitrSet", (StatusEffect)(object)s_bfSetStatusEffect, BFMinStationLevel.Value, BFChestRecipe.Value); CloneRecolorAndRegisterVanillaArmor("ArmorForestShamanLegs", prefab3, RecolorMode.BlackForestTrollBlue, "$item_forestshaman_legs", "$item_forestshaman_legs_desc", icon3, BFArmorBase.Value, BFArmorPerLevel.Value, BFLegsEitrRegen.Value, grantFrostResist: false, "ForestShamanEitrSet", (StatusEffect)(object)s_bfSetStatusEffect, BFMinStationLevel.Value, BFLegsRecipe.Value); CloneRecolorAndRegisterVanillaArmor("ArmorWolfMageHood", val, RecolorMode.MountainFrostGrey, "$item_wolfmage_hood", "$item_wolfmage_hood_desc", icon4, MTArmorBase.Value, MTArmorPerLevel.Value, MTHoodEitrRegen.Value, grantFrostResist: false, "WolfRuneMageEitrSet", (StatusEffect)(object)s_mtSetStatusEffect, MTMinStationLevel.Value, MTHoodRecipe.Value); CloneRecolorAndRegisterVanillaArmor("ArmorWolfMageChest", val2, RecolorMode.MountainFrostGrey, "$item_wolfmage_chest", "$item_wolfmage_chest_desc", icon5, MTArmorBase.Value, MTArmorPerLevel.Value, MTChestEitrRegen.Value, MTChestFrostResist.Value, "WolfRuneMageEitrSet", (StatusEffect)(object)s_mtSetStatusEffect, MTMinStationLevel.Value, MTChestRecipe.Value); CloneRecolorAndRegisterVanillaArmor("ArmorWolfMageLegs", val3, RecolorMode.MountainFrostGrey, "$item_wolfmage_legs", "$item_wolfmage_legs_desc", icon6, MTArmorBase.Value, MTArmorPerLevel.Value, MTLegsEitrRegen.Value, grantFrostResist: false, "WolfRuneMageEitrSet", (StatusEffect)(object)s_mtSetStatusEffect, MTMinStationLevel.Value, MTLegsRecipe.Value); s_registered = true; if (ModLogger != null) { ModLogger.LogInfo((object)"Registered Blue Eitr-Weave (Black Forest) & Grey Embla (Mountains) sets cleanly v1.1.1!"); } } catch (Exception ex) { if (ModLogger != null) { ModLogger.LogError((object)("Error registering recolored vanilla Eitr armors: " + ex)); } } } private static void CloneRecolorAndRegisterVanillaArmor(string newPrefabName, GameObject donorPrefab, RecolorMode mode, string nameToken, string descToken, Sprite icon, float armorBase, float armorPerLvl, float eitrRegenBonus, bool grantFrostResist, string setName, StatusEffect setEffect, int minStationLvl, string recipeStr) { //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Expected O, but got Unknown //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Expected O, but got Unknown //IL_018f: 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_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabManager.Instance.CreateClonedPrefab(newPrefabName, donorPrefab); if ((Object)(object)val == (Object)null) { if (ModLogger != null) { ModLogger.LogWarning((object)("CreateClonedPrefab returned null for " + newPrefabName)); } return; } Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true); foreach (Renderer val2 in componentsInChildren) { if ((Object)(object)val2 == (Object)null) { continue; } Material[] sharedMaterials = val2.sharedMaterials; if (sharedMaterials != null && sharedMaterials.Length != 0) { Material[] array = (Material[])(object)new Material[sharedMaterials.Length]; for (int j = 0; j < sharedMaterials.Length; j++) { array[j] = GetOrCreateRecoloredMaterial(sharedMaterials[j], mode); } val2.sharedMaterials = array; } } ItemDrop component = val.GetComponent<ItemDrop>(); 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_name = nameToken; shared.m_description = descToken; if ((Object)(object)icon != (Object)null) { shared.m_icons = (Sprite[])(object)new Sprite[1] { icon }; } if ((Object)(object)shared.m_armorMaterial != (Object)null) { shared.m_armorMaterial = GetOrCreateRecoloredMaterial(shared.m_armorMaterial, mode); } shared.m_maxQuality = 4; shared.m_armor = armorBase; shared.m_armorPerLevel = armorPerLvl; shared.m_movementModifier = 0f; shared.m_eitrRegenModifier = eitrRegenBonus; shared.m_equipStatusEffect = null; shared.m_dlc = ""; shared.m_damageModifiers = new List<DamageModPair>(); if (grantFrostResist) { shared.m_damageModifiers.Add(new DamageModPair { m_type = (DamageType)64, m_modifier = (DamageModifier)1 }); } shared.m_setName = setName; shared.m_setSize = 3; shared.m_setStatusEffect = setEffect; } ItemConfig val3 = new ItemConfig(); val3.Name = nameToken; val3.Description = descToken; val3.Amount = 1; val3.CraftingStation = CraftingStations.Forge; val3.RepairStation = CraftingStations.Forge; val3.MinStationLevel = Mathf.Max(1, minStationLvl); if ((Object)(object)icon != (Object)null) { val3.Icons = (Sprite[])(object)new Sprite[1] { icon }; } ParseAndAddRequirements(val3, recipeStr); CustomItem val4 = new CustomItem(val, false, val3); ItemManager.Instance.AddItem(val4); } private static Material GetOrCreateRecoloredMaterial(Material origMat, RecolorMode mode) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0137: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)origMat == (Object)null) { return null; } string key = ((Object)origMat).GetInstanceID() + "_" + mode.ToString(); if (s_recoloredMatCache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } Material val = new Material(origMat); ((Object)val).name = ((Object)origMat).name + "_" + mode; string[] array = new string[4] { "_MainTex", "_ChestTex", "_LegsTex", "_EmissionMap" }; foreach (string text in array) { if (!val.HasProperty(text)) { continue; } Texture texture = val.GetTexture(text); if (!((Object)(object)texture != (Object)null)) { continue; } Texture2D orCreateRecoloredTexture = GetOrCreateRecoloredTexture(texture, mode, text == "_EmissionMap"); if ((Object)(object)orCreateRecoloredTexture != (Object)null) { val.SetTexture(text, (Texture)(object)orCreateRecoloredTexture); if (text == "_MainTex") { val.mainTexture = (Texture)(object)orCreateRecoloredTexture; } } } if (val.HasProperty("_Color")) { Color color = val.GetColor("_Color"); val.SetColor("_Color", TransformPixelColor(color, mode, isEmission: false)); } if (val.HasProperty("_EmissionColor")) { Color color2 = val.GetColor("_EmissionColor"); if (((Color)(ref color2)).maxColorComponent > 0.01f) { val.SetColor("_EmissionColor", TransformPixelColor(color2, mode, isEmission: true)); } } s_recoloredMatCache[key] = val; return val; } private static Texture2D GetOrCreateRecoloredTexture(Texture srcTex, RecolorMode mode, bool isEmission) { //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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00df: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_0131: 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_013a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)srcTex == (Object)null) { return null; } string key = ((Object)srcTex).GetInstanceID() + "_" + mode.ToString() + (isEmission ? "_EM" : ""); if (s_recoloredTexCache.TryGetValue(key, out var value) && (Object)(object)value != (Object)null) { return value; } try { int num = Mathf.Max(4, srcTex.width); int num2 = Mathf.Max(4, srcTex.height); FilterMode filterMode = srcTex.filterMode; TextureWrapMode wrapMode = srcTex.wrapMode; RenderTexture temporary = RenderTexture.GetTemporary(num, num2, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)2); ((Texture)temporary).filterMode = (FilterMode)0; Graphics.Blit(srcTex, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val = new Texture2D(num, num2, (TextureFormat)4, true, false); val.ReadPixels(new Rect(0f, 0f, (float)num, (float)num2), 0, 0); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); Color[] pixels = val.GetPixels(); for (int i = 0; i < pixels.Length; i++) { Color c = pixels[i]; if (c.a > 0.002f || isEmission) { ref Color reference = ref pixels[i]; reference = TransformPixelColor(c, mode, isEmission); } } ((Object)val).name = ((Object)srcTex).name + "_" + mode; ((Texture)val).filterMode = filterMode; ((Texture)val).wrapMode = wrapMode; val.SetPixels(pixels); val.Apply(true, false); s_recoloredTexCache[key] = val; return val; } catch (Exception ex) { if (ModLogger != null) { ModLogger.LogWarning((object)("Failed to recolor texture " + ((Object)srcTex).name + ": " + ex.Message)); } return null; } } private static Color TransformPixelColor(Color c, RecolorMode mode, bool isEmission) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0032: 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_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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: 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_013c: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(c, ref num, ref num2, ref num3); if (mode == RecolorMode.BlackForestTrollBlue) { if (isEmission) { Color result = Color.HSVToRGB(0.55f, Mathf.Clamp01(num2 * 0.85f + 0.15f), num3); result.a = c.a; return result; } bool flag = (num >= 0.82f || num <= 0.068f) && num2 > 0.16f; bool flag2 = num > 0.068f && num <= 0.19f && num2 > 0.22f && num3 > 0.28f; if (flag) { float num4 = 0.555f; float num5 = Mathf.Clamp(num2 * 0.68f, 0.18f, 0.62f); float num6 = Mathf.Clamp01(num3 * 1.12f + 0.02f); Color result2 = Color.HSVToRGB(num4, num5, num6); result2.a = c.a; return result2; } if (flag2) { Color result3 = Color.HSVToRGB(0.062f, Mathf.Clamp01(num2 * 0.82f), Mathf.Clamp01(num3 * 0.96f)); result3.a = c.a; return result3; } float num7 = 0.56f; float num8 = Mathf.Clamp(num2 * 0.35f, 0.05f, 0.28f); Color result4 = Color.HSVToRGB(num7, num8, num3); result4.a = c.a; return result4; } if (isEmission) { Color result5 = Color.HSVToRGB(0.56f, 0.28f, num3); result5.a = c.a; return result5; } bool flag3 = num2 > 0.22f && num3 > 0.48f; float num9 = 0.58f; float num10 = (flag3 ? 0.05f : Mathf.Clamp(num2 * 0.12f, 0.02f, 0.09f)); float num11 = (flag3 ? Mathf.Clamp01(num3 * 1.1f + 0.04f) : Mathf.Clamp01(num3 * 1.04f + 0.02f)); Color result6 = Color.HSVToRGB(num9, num10, num11); result6.a = c.a; return result6; } private static Sprite CloneAndRecolorItemIcon(GameObject donorPrefab, string iconName, RecolorMode mode) { //IL_0070: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_012d: 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_01bf: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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_019e: Unknown result type (might be due to invalid IL or missing references) ItemDrop val = (((Object)(object)donorPrefab != (Object)null) ? donorPrefab.GetComponent<ItemDrop>() : null); if ((Object)(object)val == (Object)null || val.m_itemData == null || val.m_itemData.m_shared == null) { return null; } Sprite[] icons = val.m_itemData.m_shared.m_icons; if (icons == null || icons.Length == 0 || (Object)(object)icons[0] == (Object)null) { return null; } Sprite val2 = icons[0]; Texture2D texture = val2.texture; if ((Object)(object)texture == (Object)null) { return val2; } try { Rect textureRect = val2.textureRect; int width = ((Texture)texture).width; int height = ((Texture)texture).height; int num = Mathf.Clamp(Mathf.RoundToInt(((Rect)(ref textureRect)).x), 0, width - 1); int num2 = Mathf.Clamp(Mathf.RoundToInt(((Rect)(ref textureRect)).y), 0, height - 1); int num3 = Mathf.Clamp(Mathf.RoundToInt(((Rect)(ref textureRect)).width), 1, width - num); int num4 = Mathf.Clamp(Mathf.RoundToInt(((Rect)(ref textureRect)).height), 1, height - num2); RenderTexture temporary = RenderTexture.GetTemporary(width, height, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)2); Graphics.Blit((Texture)(object)texture, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val3 = new Texture2D(width, height, (TextureFormat)4, false, false); val3.ReadPixels(new Rect(0f, 0f, (float)width, (float)height), 0, 0); val3.Apply(); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); Color[] pixels = val3.GetPixels(num, num2, num3, num4); Object.DestroyImmediate((Object)(object)val3); for (int i = 0; i < pixels.Length; i++) { if (pixels[i].a > 0.01f) { ref Color reference = ref pixels[i]; reference = TransformPixelColor(pixels[i], mode, isEmission: false); } } Texture2D val4 = new Texture2D(num3, num4, (TextureFormat)4, false, false); ((Object)val4).name = iconName; ((Texture)val4).filterMode = (FilterMode)1; ((Texture)val4).wrapMode = (TextureWrapMode)1; val4.SetPixels(pixels); val4.Apply(); return Sprite.Create(val4, new Rect(0f, 0f, (float)num3, (float)num4), new Vector2(0.5f, 0.5f), val2.pixelsPerUnit); } catch (Exception ex) { if (ModLogger != null) { ModLogger.LogWarning((object)("Icon recolor fallback for " + iconName + ": " + ex.Message)); } return val2; } } private static GameObject FindFirstValidPrefab(params string[] names) { for (int i = 0; i < names.Length; i++) { GameObject prefab = PrefabManager.Instance.GetPrefab(names[i]); if ((Object)(object)prefab != (Object)null) { return prefab; } } return null; } private static SE_Stats CreateSetEitrStatusEffect(string effectName, string displayNameToken, Sprite icon, float bonusRegenFraction) { SE_Stats val = ScriptableObject.CreateInstance<SE_Stats>(); ((Object)val).name = effectName; ((StatusEffect)val).m_name = displayNameToken; ((StatusEffect)val).m_icon = icon; ((StatusEffect)val).m_tooltip = ""; val.m_eitrRegenMultiplier = 1f + Mathf.Max(0f, bonusRegenFraction); return val; } private static void ParseAndAddRequirements(ItemConfig cfg, string recipeStr) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown if (string.IsNullOrEmpty(recipeStr)) { return; } string[] array = recipeStr.Split(new char[1] { ',' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Trim().Split(':'); if (array2.Length >= 2) { string text = array2[0].Trim(); int result = 1; int result2 = 0; int.TryParse(array2[1].Trim(), out result); if (array2.Length >= 3) { int.TryParse(array2[2].Trim(), out result2); } if (!string.IsNullOrEmpty(text) && (result > 0 || result2 > 0)) { cfg.AddRequirement(new RequirementConfig(text, result, result2, true)); } } } } } } namespace CoarstalsEnemyOverhaul { public class ChampionBehaviour : MonoBehaviour { private Character m_char; private ZNetView m_nview; private MonsterAI m_ai; private bool m_visualsApplied; private bool m_packCalled; private GameObject m_auraObj; private Light m_auraLight; private ParticleSystem m_auraParticles; private Vector3 m_originalScale = Vector3.one; private float m_fallCheckTimer; public bool IsEnraged { get; private set; } public ChampionPerk PrimaryPerk { get; private set; } public ChampionPerk SecondaryPerk { get; private set; } public Biome ChampionBiome { get; private set; } public bool IsDungeonWarden { get; private set; } public Vector3 AnchorDungeonPos { get; private set; } private void Awake() { //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) m_char = ((Component)this).GetComponent<Character>(); m_nview = ((Component)this).GetComponent<ZNetView>(); m_ai = ((Component)this).GetComponent<MonsterAI>(); m_originalScale = ((Component)this).transform.localScale; } private void Start() { RefreshFromZDO(); } private void Update() { //IL_0089: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_char == (Object)null || (Object)(object)m_nview == (Object)null || !m_nview.IsValid()) { return; } if (!m_visualsApplied) { RefreshFromZDO(); } if (m_char.IsDead()) { if ((Object)(object)m_auraObj != (Object)null && m_auraObj.activeSelf) { m_auraObj.SetActive(false); } return; } if (IsDungeonWarden && m_nview.IsOwner() && AnchorDungeonPos.y > 3000f) { m_fallCheckTimer -= Time.deltaTime; if (m_fallCheckTimer <= 0f) { m_fallCheckTimer = 0.5f; if (((Component)this).transform.position.y < AnchorDungeonPos.y - 18f || ((Component)this).transform.position.y > AnchorDungeonPos.y + 18f) { Rigidbody component = ((Component)this).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.linearVelocity = Vector3.zero; } ((Component)this).transform.position = AnchorDungeonPos; ZDO zDO = m_nview.GetZDO(); if (zDO != null) { zDO.SetPosition(AnchorDungeonPos); } } } } float healthPercentage = m_char.GetHealthPercentage(); if ((PrimaryPerk == ChampionPerk.BerserkFury || SecondaryPerk == ChampionPerk.BerserkFury) && !IsEnraged && healthPercentage <= 0.4f) { IsEnraged = true; if ((Object)(object)m_auraLight != (Object)null) { m_auraLight.intensity = 3.2f; m_auraLight.range = 7.5f; m_auraLight.color = new Color(1f, 0.22f, 0.18f, 1f); } } if ((PrimaryPerk != ChampionPerk.PackCaller && SecondaryPerk != ChampionPerk.PackCaller) || m_packCalled || !m_nview.IsOwner() || !(healthPercentage <= 0.68f)) { return; } ZDO zDO2 = m_nview.GetZDO(); if (zDO2 != null && !zDO2.GetBool("CEO_PackUsed", false)) { if ((Object)(object)m_ai == (Object)null || ((BaseAI)m_ai).IsAlerted() || (Object)(object)((BaseAI)m_ai).GetTargetCreature() != (Object)null) { m_packCalled = true; zDO2.Set("CEO_PackUsed", true); ChampionSystem.SpawnPackBodyguards(m_char); } } else { m_packCalled = true; } } public void RefreshFromZDO() { //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_00a8: 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_00c6: 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_0134: 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_00de: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_char == (Object)null || (Object)(object)m_nview == (Object)null || !m_nview.IsValid()) { return; } ZDO zDO = m_nview.GetZDO(); if (zDO == null || !zDO.GetBool("CEO_IsChamp", false)) { return; } PrimaryPerk = (ChampionPerk)zDO.GetInt("CEO_Perk1", 1); SecondaryPerk = (ChampionPerk)zDO.GetInt("CEO_Perk2", 0); ChampionBiome = (Biome)zDO.GetInt("CEO_Biome", 8); IsDungeonWarden = zDO.GetBool("CEO_IsWarden", false); if (IsDungeonWarden) { Vector3 vec = zDO.GetVec3("CEO_WardenAnchor", Vector3.zero); if (vec.y > 3000f) { AnchorDungeonPos = vec; } else if (((Component)this).transform.position.y > 3000f) { AnchorDungeonPos = ((Component)this).transform.position; } } float num = Mathf.Clamp(EnemyOverhaulConfig.ChampionScaleMultiplier.Value, 1f, 2f); if (IsDungeonWarden || ((Component)this).transform.position.y > 3000f) { num = Mathf.Min(num, 1.15f); } ((Component)this).transform.localScale = m_originalScale * num; if (m_nview.IsOwner()) { float num2 = zDO.GetFloat("CEO_MaxHP", 0f); if (num2 > 1f && Mathf.Abs(m_char.GetMaxHealth() - num2) > 1f) { bool flag = m_char.GetHealthPercentage() >= 0.98f; m_char.SetMaxHealth(num2); if (flag) { m_char.SetHealth(num2); } } } EnsureChampionAura(); m_visualsApplied = true; } private void EnsureChampionAura() { //IL_0010: 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_0020: 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_0031: Expected O, but got Unknown //IL_0062: 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_00f6: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: 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_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022b: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0285: 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_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)m_auraObj != (Object)null)) { Color biomeAccentColor = ChampionSystem.GetBiomeAccentColor(ChampionBiome, IsDungeonWarden); m_auraObj = new GameObject("CEO_ChampionAura"); m_auraObj.transform.SetParent(((Component)this).transform, false); m_auraObj.transform.localPosition = new Vector3(0f, 0.9f, 0f); m_auraLight = m_auraObj.AddComponent<Light>(); m_auraLight.type = (LightType)2; m_auraLight.color = biomeAccentColor; m_auraLight.range = (IsDungeonWarden ? 6.5f : 5.2f); m_auraLight.intensity = (IsDungeonWarden ? 2.2f : 1.75f); m_auraLight.shadows = (LightShadows)0; m_auraParticles = m_auraObj.AddComponent<ParticleSystem>(); MainModule main = m_auraParticles.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(1.1f, 1.9f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.35f, 0.95f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.1f, 0.24f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(biomeAccentColor.r, biomeAccentColor.g, biomeAccentColor.b, 0.72f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = 40; ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.15f); EmissionModule emission = m_auraParticles.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(14f); ShapeModule shape = m_auraParticles.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.65f; ColorOverLifetimeModule colorOverLifetime = m_auraParticles.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(Color.Lerp(biomeAccentColor, Color.white, 0.35f), 0f), new GradientColorKey(biomeAccentColor, 0.6f), new GradientColorKey(biomeAccentColor, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(0.75f, 0.25f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val); ParticleSystemRenderer component = m_auraObj.GetComponent<ParticleSystemRenderer>(); if ((Object)(object)component != (Object)null) { ((Renderer)component).sharedMaterial = CursedDungeonSystem.GetSharedSoftParticleMaterial(); } } } } public static class ChampionSystem { public const string ZdoIsChampion = "CEO_IsChamp"; public const string ZdoIsChampionMinion = "CEO_ChampMinion"; public const string ZdoIsDungeonWarden = "CEO_IsWarden"; public const string ZdoWardenDungeonId = "CEO_WardenDungId"; public const string ZdoWardenAnchorPos = "CEO_WardenAnchor"; public const string ZdoChampRusTitle = "CEO_TitleRu"; public const string ZdoChampEngTitle = "CEO_TitleEn"; public const string ZdoChampPerk1 = "CEO_Perk1"; public const string ZdoChampPerk2 = "CEO_Perk2"; public const string ZdoChampBiome = "CEO_Biome"; public const string ZdoChampMaxHP = "CEO_MaxHP"; public const string ZdoChampPackUsed = "CEO_PackUsed"; public const string RPC_ReportKillToServer = "CEO_RPC_ReportKill"; public const string RPC_ClientSpawnAmbush = "CEO_RPC_SpawnAmbush"; public const string RPC_ConfirmAmbushResult = "CEO_RPC_AmbushResult"; public const string RPC_SyncRemainingKills = "CEO_RPC_SyncRem"; public const string RPC_RequestRemainingKills = "CEO_RPC_ReqRem"; private const string GlobalHuntKillsKeyPrefix = "ceo_huntkills_"; private static int s_serverHuntKills = -1; private static int s_serverTargetThreshold = -1; private static int s_clientSyncedRemaining = -1; private static float s_nextClientSyncReqTime; private static bool s_ambushPending; private static float s_ambushPendingUntil; private static readonly MethodInfo s_aiSetTargetMethod = typeof(MonsterAI).GetMethod("SetTarget", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[1] { typeof(Character) }, null); private static readonly HashSet<string> s_largeSpecies = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Troll", "Bjorn", "Unbjorn", "Abomination", "StoneGolem", "Fenring", "Fenring_Cultist", "GoblinBrute", "Lox", "Gjall", "SeekerBrute", "DvergerMage", "Morgen", "Asksvin", "FallenValkyrie", "Charred_Melee_Dyrnwyn", "BonemawSerpent", "Serpent" }; private static readonly HashSet<string> s_excludedSpecies = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "Deer", "Hare", "Hen", "Chicken", "Boar_piggy", "Wolf_cub", "Lox_Calf", "Asksvin_hatchling", "TrainingDummy", "Haldor", "Hildir", "BogWitch", "Dverger", "WildHuntDeerBoss" }; private static readonly Dictionary<string, string> s_fallbackTrophyBySpecies = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) { { "Greydwarf", "TrophyGreydwarf" }, { "Greydwarf_Elite", "TrophyGreydwarfBrute" }, { "Greydwarf_Shaman", "TrophyGreydwarfShaman" }, { "Troll", "TrophyForestTroll" }, { "Bjorn", "TrophyBjorn" }, { "Unbjorn", "TrophyBjornUndead" }, { "Skeleton", "TrophySkeleton" }, { "Skeleton_Poison", "TrophySkeletonPoison" }, { "Ghost", "TrophySkeleton" }, { "Draugr", "TrophyDraugr" }, { "Draugr_Ranged", "TrophyDraugr" }, { "Draugr_Elite", "TrophyDraugrElite" }, { "Blob", "TrophyBlob" }, { "BlobElite", "TrophyBlob" }, { "Wraith", "TrophyWraith" }, { "Abomination", "TrophyAbomination" }, { "Surtling", "TrophySurtling" }, { "Leech", "TrophyLeech" }, { "Wolf", "TrophyWolf" }, { "Hatchling", "TrophyHatchling" }, { "Fenring", "TrophyFenring" }, { "Fenring_Cultist", "TrophyCultist" }, { "Ulv", "TrophyUlv" }, { "StoneGolem", "TrophySGolem" }, { "Goblin", "TrophyGoblin" }, { "GoblinArcher", "TrophyGoblin" }, { "GoblinBrute", "TrophyGoblinBrute" }, { "GoblinShaman", "TrophyGoblinShaman" }, { "Deathsquito", "Needle" }, { "Lox", "TrophyLox" }, { "BlobTar", "TrophyGrowth" }, { "Seeker", "TrophySeeker" }, { "SeekerBrute", "TrophySeekerBrute" }, { "Gjall", "TrophyGjall" }, { "Tick", "TrophyTick" }, { "Asksvin", "TrophyAsksvin" }, { "Morgen", "TrophyMorgen" }, { "FallenValkyrie", "TrophyFallenValkyrie" }, { "Charred_Melee", "TrophyCharredMelee" }, { "Charred_Archer", "TrophyCharredArcher" }, { "Charred_Mage", "TrophyCharredMage" } }; private static bool s_rpcRegistered; private static readonly Dictionary<int, bool> s_championCache = new Dictionary<int, bool>(); private static float s_championCacheClearTimer; public static void RegisterRPCs(ZRoutedRpc routedRpc) { if (routedRpc != null && !s_rpcRegistered) { routedRpc.Register<string, Vector3, long>("CEO_RPC_ReportKill", (Action<long, string, Vector3, long>)OnServerReceivedSpeciesKill); routedRpc.Register<string>("CEO_RPC_SpawnAmbush", (Action<long, string>)OnClientSpawnAmbushRequested); routedRpc.Register<bool>("CEO_RPC_AmbushResult", (Action<long, bool>)OnServerConfirmAmbushResult); routedRpc.Register<int>("CEO_RPC_SyncRem", (Action<long, int>)OnClientReceivedRemainingKills); routedRpc.Register("CEO_RPC_ReqRem", (Action<long>)OnServerReceivedRemainingRequest); s_rpcRegistered = true; } } public static void ResetSessionFlag() { s_rpcRegistered = false; s_serverHuntKills = -1; s_serverTargetThreshold = -1; s_clientSyncedRemaining = -1; s_nextClientSyncReqTime = 0f; s_ambushPending = false; s_ambushPendingUntil = 0f; s_championCache.Clear(); } public static bool IsChampion(Character ch) { if ((Object)(object)ch == (Object)null || ch.IsPlayer()) { return false; } if (Time.time - s_championCacheClearTimer > 5f) { s_championCacheClearTimer = Time.time; if (s_championCache.Count > 256) { s_championCache.Clear(); } } int instanceID = ((Object)ch).GetInstanceID(); if (s_championCache.TryGetValue(instanceID, out var value)) { return value; } ZNetView component = ((Component)ch).GetComponent<ZNetView>(); if ((Object)(object)component == (Object)null || !component.IsValid() || component.GetZDO() == null) { return false; } bool flag = component.GetZDO().GetBool("CEO_IsChamp", false); s_championCache[instanceID] = flag; return flag; } public static void InvalidateChampionCache(Character ch) { if ((Object)(object)ch != (Object)null) { s_championCache.Remove(((Object)ch).GetInstanceID()); } } public static bool IsLargeSpecies(string prefabName) { if (!string.IsNullOrEmpty(prefabName)) { return s_largeSpecies.Contains(prefabName); } return false; } public static bool IsEligibleHuntSpecies(Character victim) { //IL_0098: 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_00a7: Invalid comparison between Unknown and I4 if ((Object)(object)victim == (Object)null || victim.IsPlayer() || victim.IsBoss() || victim.IsTamed()) { return false; } if (IsChampion(victim)) { return false; } ZNetView component = ((Component)victim).GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.IsValid() && component.GetZDO() != null && component.GetZDO().GetBool("CEO_ChampMinion", false)) { return false; } string prefabName = Utils.GetPrefabName(((Component)victim).gameObject); if (string.IsNullOrEmpty(prefabName) || s_excludedSpecies.Contains(prefabName)) { return false; } BaseAI baseAI = victim.GetBaseAI(); if ((Object)(object)baseAI == (Object)null) { return false; } if ((int)victim.m_faction == 0 || (int)victim.m_faction == 10) { return false; } return true; } public static void NotifyCreatureKilledByPlayer(Character victim, Player killer) { //IL_0060: 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 (!EnemyOverhaulConfig.EnableChampions.Value || (Object)(object)victim == (Object)null || (Object)(object)killer == (Object)null || !IsEligibleHuntSpecies(victim)) { return; } string prefabName = Utils.GetPrefabName(((Component)victim).gameObject); if (string.IsNullOrEmpty(prefabName)) { return; } if ((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsServer()) { ProcessSpeciesKillOnServer(0L, prefabName, ((Component)killer).transform.position, killer.GetPlayerID()); } else if (ZRoutedRpc.instance != null && (Object)(object)ZNet.instance != (Object)null) { ZNetPeer serverPeer = ZNet.instance.GetServerPeer(); if (serverPeer != null) { ZRoutedRpc.instance.InvokeRoutedRPC(serverPeer.m_uid, "CEO_RPC_ReportKill", new object[3] { prefabName, ((Component)killer).transform.position, killer.GetPlayerID() }); } } } private static void OnServerReceivedSpeciesKill(long senderPeer, string prefabName, Vector3 killerPos, long killerPlayerId) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ZNet.instance == (Object)null) && ZNet.instance.IsServer()) { ProcessSpeciesKillOnServer(senderPeer, prefabName, killerPos, killerPlayerId); } } private static int RollNextChampionKillThreshold() { int num = Mathf.Max(5, EnemyOverhaulConfig.HuntChampionMinKills.Value); int num2 = Mathf.Max(num, EnemyOverhaulConfig.HuntChampionMaxKills.Value); return Random.Range(num, num2 + 1); } public static int GetCurrentTargetThreshold() { if (s_serverTargetThreshold <= 0) { s_serverTargetThreshold = RollNextChampionKillThreshold(); } return s_serverTargetThreshold; } public static void BroadcastRemainingKillsFromServer() { if (!((Object)(object)ZNet.instance == (Object)null) && ZNet.instance.IsServer()) { int num = (s_clientSyncedRemaining = Mathf.Max(1, GetCurrentTargetThreshold() - GetServerGlobalKillCount())); if (ZRoutedRpc.instance != null) { ZRoutedRpc.instance.InvokeRoutedRPC(0L, "CEO_RPC_SyncRem", new object[1] { num }); } } } private static void OnClientReceivedRemainingKills(long senderPeer, int remaining) { s_clientSyncedRemaining = Mathf.Max(1, remaining); } private static void OnServerReceivedRemainingRequest(long senderPeer) { if (!((Object)(object)ZNet.instance == (Object)null) && ZNet.instance.IsServer() && ZRoutedRpc.instance != null && senderPeer != 0) { int num = Mathf.Max(1, GetCurrentTargetThreshold() - GetServerGlobalKillCount()); ZRoutedRpc.instance.InvokeRoutedRPC(senderPeer, "CEO_RPC_SyncRem", new object[1] { num }); } } public static int GetRemainingKillsForMinimap() { if ((Object)(object)ZNet.instance == (Object)null || ZNet.instance.IsServer()) { return Mathf.Max(1, GetCurrentTargetThreshold() - GetServerGlobalKillCount()); } if (s_clientSyncedRemaining > 0) { return s_clientSyncedRemaining; } if (Time.time >= s_nextClientSyncReqTime && ZRoutedRpc.instance != null) { s_nextClientSyncReqTime = Time.time + 3f; ZNetPeer serverPeer = ZNet.instance.GetServerPeer(); if (serverPeer != null) { ZRoutedRpc.instance.InvokeRoutedRPC(serverPeer.m_uid, "CEO_RPC_ReqRem", new object[0]); } } int num = (EnemyOverhaulConfig.HuntChampionMinKills.Value + EnemyOverhaulConfig.HuntChampionMaxKills.Value) / 2; return Mathf.Max(1, num - GetServerGlobalKillCount()); } private static void ProcessSpeciesKillOnServer(long senderPeer, string prefabName, Vector3 killerPos, long killerPlayerId) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) if (!EnemyOverhaulConfig.EnableChampions.Value || (Object)(object)ZoneSystem.instance == (Object)null || (s_ambushPending && Time.time < s_ambushPendingUntil)) { return; } s_ambushPending = false; int num = GetServerGlobalKillCount() + 1; int currentTargetThreshold = GetCurrentTargetThreshold(); if (num >= currentTargetThreshold) { if ((Object)(object)ZNet.instance != (Object)null && !ZNet.instance.IsDedicated() && (Object)(object)Player.m_localPlayer != (Object)null && senderPeer == 0) { GameObject val = SpawnAmbushChampionNear(prefabName, killerPos); if ((Object)(object)val != (Object)null) { SetServerGlobalKillCount(0); s_serverTargetThreshold = RollNextChampionKillThreshold(); BroadcastRemainingKillsFromServer(); } else { SetServerGlobalKillCount(currentTargetThreshold - 1, forcePersistToZoneSystem: false); BroadcastRemainingKillsFromServer(); } } else if (ZRoutedRpc.instance != null && senderPeer != 0) { s_ambushPending = true; s_ambushPendingUntil = Time.time + 5f; SetServerGlobalKillCount(currentTargetThreshold - 1, forcePersistToZoneSystem: false); BroadcastRemainingKillsFromServer(); ZRoutedRpc.instance.InvokeRoutedRPC(senderPeer, "CEO_RPC_SpawnAmbush", new object[1] { prefabName }); } } else { bool forcePersistToZoneSystem = num % 10 == 0; SetServerGlobalKillCount(num, forcePersistToZoneSystem); BroadcastRemainingKillsFromServer(); } } private static void OnClientSpawnAmbushRequested(long senderPeer, string prefabName) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) bool flag = false; try { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead() && !((Character)localPlayer).IsTeleporting()) { GameObject val = SpawnAmbushChampionNear(prefabName, ((Component)localPlayer).transform.position); flag = (Object)(object)val != (Object)null; } } catch (Exception ex) { if (CoarstalsEnemyOverhaulPlugin.ModLogger != null) { CoarstalsEnemyOverhaulPlugin.ModLogger.LogWarning((object)("[EnemyOverhaul] Client ambush spawn error: " + ex.Message)); } } if (ZRoutedRpc.instance != null && senderPeer != 0) { ZRoutedRpc.instance.InvokeRoutedRPC(senderPeer, "CEO_RPC_AmbushResult", new object[1] { flag }); } } private static void OnServerConfirmAmbushResult(long senderPeer, bool spawned) { if ((Object)(object)ZNet.instance == (Object)null || !ZNet.instance.IsServer()) { return; } s_ambushPending = false; if (spawned) { SetServerGlobalKillCount(0); s_serverTargetThreshold = RollNextChampionKillThreshold(); BroadcastRemainingKillsFromServer(); if (CoarstalsEnemyOverhaulPlugin.ModLogger != null) { CoarstalsEnemyOverhaulPlugin.ModLogger.LogInfo((object)("[EnemyOverhaul] Confirmed Hunt Champion ambush spawned on client peer " + senderPeer + "; counter reset to 0.")); } } else { int newCount = Mathf.Max(0, GetCurrentTargetThreshold() - 1); SetServerGlobalKillCount(newCount, forcePersistToZoneSystem: false); BroadcastRemainingKillsFromServer(); } } public static int GetServerGlobalKillCount() { bool flag = (Object)(object)ZNet.instance == (Object)null || ZNet.instance.IsServer(); if (flag && s_serverHuntKills >= 0) { return s_serverHuntKills; } if ((Object)(object)ZoneSystem.instance == (Object)null) { return Mathf.Max(0, s_serverHuntKills); } List<string> globalKeys = ZoneSystem.instance.GetGlobalKeys(); if (globalKeys == null) { return 0; } int result = 0; for (int i = 0; i < globalKeys.Count; i++) { string text = globalKeys[i]; if (text != null && text.StartsWith("ceo_huntkills_", StringComparison.OrdinalIgnoreCase) && int.TryParse(text.Substring("ceo_huntkills_".Length), out var result2)) { result = Mathf.Max(0, result2); break; } } if (flag) { s_serverHuntKills = result; } return result; } public static void SetServerGlobalKillCount(int newCount, bool forcePersistToZoneSystem = true) { s_serverHuntKills = Mathf.Max(0, newCount); if (!forcePersistToZoneSystem || (Object)(object)ZoneSystem.instance == (Object)null) { return; } List<string> globalKeys = ZoneSystem.instance.GetGlobalKeys(); if (globalKeys != null) { List<string> list = null; for (int i = 0; i < globalKeys.Count; i++) { string text = globalKeys[i]; if (text != null && text.StartsWith("ceo_huntkills_", StringComparison.OrdinalIgnoreCase)) { if (list == null) { list = new List<string>(); } list.Add(text); } } if (list != null) { for (int j = 0; j < list.Count; j++) { ZoneSystem.instance.RemoveGlobalKey(list[j]); } } } if (s_serverHuntKills > 0) { ZoneSystem.instance.SetGlobalKey("ceo_huntkills_" + s_serverHuntKills); } } public static GameObject SpawnAmbushChampionNear(string prefabName, Vector3 targetPos) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0061: 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_007c: 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_0096: 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_00a0: 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_00ac: 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_0135: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ZNetScene.instance == (Object)null) { return null; } GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)(object)prefab == (Object)null) { return null; } bool flag = targetPos.y > 3000f; Vector3 result; if (flag) { if (!TryFindDungeonAmbushPoint(targetPos, out result)) { return null; } } else if (!TryFindOutdoorAmbushPoint(targetPos, 20f, 32f, out result)) { return null; } Vector3 val = targetPos - result; val.y = 0f; Quaternion val2 = ((((Vector3)(ref val)).sqrMagnitude > 0.01f) ? Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up) : Quaternion.identity); Biome biome = GuessBiomeForPositionAndPrefab(targetPos, prefabName); GameObject val3 = Object.Instantiate<GameObject>(prefab, result, val2); ImbueAsChampion(val3, biome, isDungeonWarden: false, string.Empty); MonsterAI component = val3.GetComponent<MonsterAI>(); if ((Object)(object)component != (Object)null) { ((BaseAI)component).SetHuntPlayer(true); ((BaseAI)component).SetPatrolPoint(); ((BaseAI)component).Alert(); Player closestPlayer = Player.GetClosestPlayer(result, 65f); if ((Object)(object)closestPlayer != (Object)null && s_aiSetTargetMethod != null) { s_aiSetTargetMethod.Invoke(component, new object[1] { closestPlayer }); } } if (CoarstalsEnemyOverhaulPlugin.ModLogger != null) { CoarstalsEnemyOverhaulPlugin.ModLogger.LogInfo((object)$"[EnemyOverhaul] Ambush Champion ({prefabName}) spawned silently at {result} (dungeon={flag})!"); } return val3; } public static void ImbueAsChampion(GameObject creatureObj, Biome biome, bool isDungeonWarden, string wardenDungeonId) { //IL_004a: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected I4, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)creatureObj == (Object)null) { return; } Character component = creatureObj.GetComponent<Character>(); ZNetView component2 = creatureObj.GetComponent<ZNetView>(); if ((Object)(object)component == (Object)null || (Object)(object)component2 == (Object)null || !component2.IsValid()) { return; } ZDO zDO = component2.GetZDO(); if (zDO != null) { int seed = Random.Range(1, int.MaxValue); EnemyLocalization.GenerateChampionIdentity(biome, seed, out var rusTitle, out var engTitle); ChampionPerk championPerk = ChampionPerk.ElementalInfusion; ChampionPerk championPerk2 = ChampionPerk.None; if (Random.value <= 0.55f) { championPerk2 = (isDungeonWarden ? ChampionPerk.BerserkFury : ((Random.value <= 0.5f) ? ChampionPerk.BerserkFury : ChampionPerk.PackCaller)); } float health = component.m_health; component.SetLevel(4); float num = Mathf.Max(1f, EnemyOverhaulConfig.ChampionHPMultiplier.Value); int num2 = CountNearbyAlivePlayers(creatureObj.transform.position, 65f); if (num2 > 1) { num *= 1f + (float)(num2 - 1) * 0.25f; } float num3 = Mathf.Max(40f, Mathf.Round(health * num)); component.SetMaxHealth(num3); component.SetHealth(num3); component.m_boss = false; zDO.Set("CEO_IsChamp", true); zDO.Set("CEO_IsWarden", isDungeonWarden); if (!string.IsNullOrEmpty(wardenDungeonId)) { zDO.Set("CEO_WardenDungId", wardenDungeonId); } if (isDungeonWarden) { zDO.Set("CEO_WardenAnchor", creatureObj.transform.position); } zDO.Set("CEO_TitleRu", rusTitle); zDO.Set("CEO_TitleEn", engTitle); zDO.Set("CEO_Perk1", (int)championPerk); zDO.Set("CEO_Perk2", (int)championPerk2); zDO.Set("CEO_Biome", (int)biome); zDO.Set("CEO_MaxHP", num3); s_championCache[((Object)component).GetInstanceID()] = true; ChampionBehaviour championBehaviour = creatureObj.GetComponent<ChampionBehaviour>(); if ((Object)(object)championBehaviour == (Object)null) { championBehaviour = creatureObj.AddComponent<ChampionBehaviour>(); } championBehaviour.RefreshFromZDO(); } } public static void SpawnPackBodyguards(Character champion) { //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_0074: 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_0084: 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_0095: 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_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) //IL_00b1: 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_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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_012d: 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_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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)champion == (Object)null || (Object)(object)ZNetScene.instance == (Object)null) { return; } string prefabName = Utils.GetPrefabName(((Component)champion).gameObject); GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)(object)prefab == (Object)null) { return; } int num = (IsLargeSpecies(prefabName) ? 1 : 2); Vector3 position = ((Component)champion).transform.position; RaycastHit val3 = default(RaycastHit); for (int i = 0; i < num; i++) { Vector3 val = Quaternion.Euler(0f, (i == 0) ? (-55f) : 55f, 0f) * ((Component)champion).transform.forward * 2.8f; Vector3 val2 = position + val + Vector3.up * 0.35f; if (Physics.Raycast(val2 + Vector3.up * 2.5f, Vector3.down, ref val3, 6f, LayerMask.GetMask(new string[4] { "Default", "static_solid", "terrain", "piece" }))) { val2 = ((RaycastHit)(ref val3)).point + Vector3.up * 0.2f; } GameObject val4 = Object.Instantiate<GameObject>(prefab, val2, ((Component)champion).transform.rotation); ZNetView component = val4.GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.IsValid() && component.GetZDO() != null) { component.GetZDO().Set("CEO_ChampMinion", true); } MonsterAI component2 = val4.GetComponent<MonsterAI>(); if ((Object)(object)component2 != (Object)null) { ((BaseAI)component2).SetHuntPlayer(true); ((BaseAI)component2).Alert(); } } } public static void SpawnChampionBonusRewards(Character champion) { //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_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_0044: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //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_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: 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_0243: 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_015d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)champion == (Object)null || (Object)(object)ZNetScene.instance == (Object)null) { return; } string prefabName = Utils.GetPrefabName(((Component)champion).gameObject); bool flag = IsLargeSpecies(prefabName); Vector3 val = champion.GetCenterPoint() + Vector3.up * 0.35f; int totalAmount = (flag ? Mathf.Max(1, EnemyOverhaulConfig.LargeChampionTrophyCount.Value) : Mathf.Max(1, EnemyOverhaulConfig.SmallChampionTrophyCount.Value)); GameObject val2 = FindTrophyPrefabForCreature(champion, prefabName); if ((Object)(object)val2 != (Object)null) { DropItemStack(val2, totalAmount, val); } int num = Mathf.Max(0, EnemyOverhaulConfig.ChampionLootMultiplier.Value - 1); CharacterDrop component = ((Component)champion).GetComponent<CharacterDrop>(); if (num > 0 && (Object)(object)component != (Object)null && component.m_drops != null) { for (int i = 0; i < component.m_drops.Count; i++) { Drop val3 = component.m_drops[i]; if (val3 != null && !((Object)(object)val3.m_prefab == (Object)null) && ((Object)val3.m_prefab).name.IndexOf("Trophy", StringComparison.OrdinalIgnoreCase) < 0 && Random.value <= Mathf.Clamp01(val3.m_chance * 1.35f)) { int num2 = Random.Range(Mathf.Max(1, val3.m_amountMin), Mathf.Max(1, val3.m_amountMax) + 1); int num3 = num2 * num; if (num3 > 0) { DropItemStack(val3.m_prefab, num3, val); } } } } Biome biome = (Biome)8; ZNetView component2 = ((Component)champion).GetComponent<ZNetView>(); if ((Object)(object)component2 != (Object)null && component2.IsValid() && component2.GetZDO() != null) { biome = (Biome)component2.GetZDO().GetInt("CEO_Biome", 8); } else if (WorldGenerator.instance != null) { biome = WorldGenerator.instance.GetBiome(((Component)champion).transform.position); } GameObject prefab = ZNetScene.instance.GetPrefab("Coins"); if ((Object)(object)prefab != (Object)null) { float biomeTierCoinMultiplier = GetBiomeTierCoinMultiplier(biome); int num4 = Mathf.Max(1, Mathf.RoundToInt((float)EnemyOverhaulConfig.ChampionMinCoins.Value * biomeTierCoinMultiplier)); int num5 = Mathf.Max(num4, Mathf.RoundToInt((float)EnemyOverhaulConfig.ChampionMaxCoins.Value * biomeTierCoinMultiplier)); int totalAmount2 = Random.Range(num4, num5 + 1); DropItemStack(prefab, totalAmount2, val); } SacredIdolsSystem.TryDropChampionBlessedIdol(champion, biome, val); } private static GameObject FindTrophyPrefabForCreature(Character ch, string speciesPrefab) { CharacterDrop component = ((Component)ch).GetComponent<CharacterDrop>(); if ((Object)(object)component != (Object)null && component.m_drops != null) { for (int i = 0; i < component.m_drops.Count; i++) { Drop val = component.m_drops[i]; if (val != null && (Object)(object)val.m_prefab != (Object)null && ((Object)val.m_prefab).name.IndexOf("Trophy", StringComparison.OrdinalIgnoreCase) >= 0) { return val.m_prefab; } } } if (!string.IsNullOrEmpty(speciesPrefab) && s_fallbackTrophyBySpecies.TryGetValue(speciesPrefab, out var value)) { return ZNetScene.instance.GetPrefab(value); } return null; } private static void DropItemStack(GameObject itemPrefab, int totalAmount, Vector3 center) { //IL_0061: 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_0070: 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_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_0090: 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_00ae: 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_010a: 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) if ((Object)(object)itemPrefab == (Object)null || totalAmount <= 0) { return; } ItemDrop component = itemPrefab.GetComponent<ItemDrop>(); int num = (((Object)(object)component != (Object)null && component.m_itemData != null && component.m_itemData.m_shared != null) ? Mathf.Max(1, component.m_itemData.m_shared.m_maxStackSize) : 50); int num2 = totalAmount; while (num2 > 0) { int num3 = Mathf.Min(num2, num); num2 -= num3; Vector2 val = Random.insideUnitCircle * 0.65f; Vector3 val2 = center + new Vector3(val.x, 0.25f, val.y); GameObject val3 = Object.Instantiate<GameObject>(itemPrefab, val2, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f)); ItemDrop component2 = val3.GetComponent<ItemDrop>(); if ((Object)(object)component2 != (Object)null) { component2.SetStack(num3); } Rigidbody component3 = val3.GetComponent<Rigidbody>(); if ((Object)(object)component3 != (Object)null) { Vector3 insideUnitSphere = Random.insideUnitSphere; insideUnitSphere.y = Mathf.Abs(insideUnitSphere.y) + 1.2f; component3.linearVelocity = insideUnitSphere * 2.4f; } } } public static void ApplyChampionElementalPerkDamage(Character attacker, ref HitData hit) { //IL_0051: 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_0092: 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_0098: Invalid comparison between Unknown and I4 //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Invalid comparison between Unknown and I4 //IL_009a: 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_00b3: Expected I4, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Invalid comparison between Unknown and I4 //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Invalid comparison between Unknown and I4 if ((Object)(object)attacker == (Object)null || hit == null) { return; } ZNetView component = ((Component)attacker).GetComponent<ZNetView>(); if ((Object)(object)component == (Object)null || !component.IsValid() || component.GetZDO() == null) { return; } ZDO zDO = component.GetZDO(); if (!zDO.GetBool("CEO_IsChamp", false)) { return; } Biome val = (Biome)zDO.GetInt("CEO_Biome", 8); float mult = Mathf.Max(0.5f, EnemyOverhaulConfig.ChampionDamageMultiplier.Value); ScaleHitDamage(ref hit.m_damage, mult); float totalDamage = hit.GetTotalDamage(); float num = Mathf.Max(4f, totalDamage * 0.15f); Biome val2 = val; if ((int)val2 <= 16) { switch (val2 - 1) { default: if ((int)val2 != 8) { goto IL_00b8; } goto case 1; case 0: { ref DamageTypes damage = ref hit.m_damage; damage.m_lightning += num; return; } case 1: { ref DamageTypes damage2 = ref hit.m_damage; damage2.m_poison += num; return; } case 3: break; case 2: goto IL_016c; } } else { if ((int)val2 == 32) { goto IL_011f; } if ((int)val2 != 64) { if ((int)val2 != 512) { goto IL_016c; } ref DamageTypes damage3 = ref hit.m_damage; damage3.m_lightning += num * 0.5f; ref DamageTypes damage4 = ref hit.m_damage; damage4.m_poison += num * 0.5f; return; } } ref DamageTypes damage5 = ref hit.m_damage; damage5.m_frost += num; return; IL_016c: ref DamageTypes damage6 = ref hit.m_damage; damage6.m_poison += num; return; IL_00b8: if ((int)val2 == 16) { goto IL_011f; } goto IL_016c; IL_011f: ref DamageTypes damage7 = ref hit.m_damage; damage7.m_fire += num; } internal static void ScaleHitDamage(ref DamageTypes dmg, float mult) { dmg.m_damage *= mult; dmg.m_blunt *= mult; dmg.m_slash *= mult; dmg.m_pierce *= mult; dmg.m_fire *= mult; dmg.m_frost *= mult; dmg.m_lightning *= mult; dmg.m_poison *= mult; dmg.m_spirit *= mult; } private static bool TryFindOutdoorAmbushPoint(Vector3 center, float minRadius, float maxRadius, out Vector3 result) { //IL_001f: 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_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_0040: 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_00c1: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) float num3 = default(float); for (int i = 0; i < 28; i++) { float num = Random.Range(0f, (float)Math.PI * 2f); float num2 = Random.Range(minRadius, maxRadius); Vector3 val = center + new Vector3(Mathf.Cos(num) * num2, 0f, Mathf.Sin(num) * num2); if (!Object.op_Implicit((Object)(object)EffectArea.IsPointInsideArea(val, (Type)4, 2f)) && (Object)(object)ZoneSystem.instance != (Object)null && ZoneSystem.instance.GetSolidHeight(val, ref num3, 1000)) { float waterLevel = ZoneSystem.instance.m_waterLevel; if (num3 >= waterLevel - 0.35f) { result = new Vector3(val.x, num3 + 0.5f, val.z); return true; } } } result = Vector3.zero; return false; } private static bool TryFindDungeonAmbushPoint(Vector3 playerPos, out Vector3 result) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: 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_00d9: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0255: 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_01a0: 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_01af: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type