using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using bossadd.Patches; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace bossadd { public static class BonemassConfig { public static ConfigEntry SplitEnabled { get; private set; } public static ConfigEntry SplitHealthThreshold { get; private set; } public static ConfigEntry KillConditionEnabled { get; private set; } public static ConfigEntry KillOrderEnabled { get; private set; } public static ConfigEntry WrongOrderHealPercent { get; private set; } public static ConfigEntry MiniDamageMult { get; private set; } public static ConfigEntry MiniHPMult { get; private set; } public static ConfigEntry MiniSpeedMult { get; private set; } public static ConfigEntry MiniAttackRangeMult { get; private set; } public static ConfigEntry MiniAttackIntervalMult { get; private set; } public static ConfigEntry MiniResistBlunt { get; private set; } public static ConfigEntry MiniResistSlash { get; private set; } public static ConfigEntry MiniResistPierce { get; private set; } public static ConfigEntry MiniResistFire { get; private set; } public static ConfigEntry MiniResistFrost { get; private set; } public static ConfigEntry MiniResistLightning { get; private set; } public static ConfigEntry MiniResistPoison { get; private set; } public static ConfigEntry MiniResistSpirit { get; private set; } public static ConfigEntry BonusSpawnEnabled { get; private set; } public static ConfigEntry BonusSpawnPrefab { get; private set; } public static ConfigEntry BonusSpawnChance { get; private set; } public static ConfigEntry BonusSpawnCount { get; private set; } public static ConfigEntry BonusSpawnHealthThreshold { get; private set; } public static ConfigEntry PhaseMessage { get; private set; } public static ConfigEntry PhaseMessageHP { get; private set; } public static void Bind(ConfigFile cfg) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Expected O, but got Unknown //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Expected O, but got Unknown //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Expected O, but got Unknown //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Expected O, but got Unknown //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Expected O, but got Unknown //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Expected O, but got Unknown //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Expected O, but got Unknown //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Expected O, but got Unknown //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Expected O, but got Unknown //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Expected O, but got Unknown //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Expected O, but got Unknown //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Expected O, but got Unknown //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Expected O, but got Unknown //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Expected O, but got Unknown //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Expected O, but got Unknown //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Expected O, but got Unknown //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Expected O, but got Unknown //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04cd: Expected O, but got Unknown //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Expected O, but got Unknown //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Expected O, but got Unknown //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Expected O, but got Unknown //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Expected O, but got Unknown //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Expected O, but got Unknown SplitEnabled = cfg.Bind("Bonemass", "(Split Summon) Enabled", true, LocalizationManager.Desc("Bonemass.SplitSummon.Enabled")); SplitHealthThreshold = cfg.Bind("Bonemass", "(Split Summon) HPThreshold", 50f, new ConfigDescription(LocalizationManager.Desc("Bonemass.SplitSummon.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); KillConditionEnabled = cfg.Bind("Bonemass", "(Kill Condition) Enabled", true, LocalizationManager.Desc("Bonemass.KillCondition.Enabled")); KillOrderEnabled = cfg.Bind("Bonemass", "(Kill Condition) OrderEnabled", true, LocalizationManager.Desc("Bonemass.KillCondition.OrderEnabled")); WrongOrderHealPercent = cfg.Bind("Bonemass", "(Kill Condition) WrongOrderHeal", 5f, new ConfigDescription(LocalizationManager.Desc("Bonemass.KillCondition.WrongOrderHeal"), (AcceptableValueBase)new AcceptableValueRange(0f, 50f), Array.Empty())); MiniDamageMult = cfg.Bind("Bonemass", "(Mini Stat) DamageMult", 1f, new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniStat.DamageMult"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 5f), Array.Empty())); MiniHPMult = cfg.Bind("Bonemass", "(Mini Stat) HPMult", 0.3f, new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniStat.HPMult"), (AcceptableValueBase)new AcceptableValueRange(0.05f, 1f), Array.Empty())); MiniSpeedMult = cfg.Bind("Bonemass", "(Mini Stat) SpeedMult", 1.6f, new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniStat.SpeedMult"), (AcceptableValueBase)new AcceptableValueRange(1f, 4f), Array.Empty())); MiniAttackRangeMult = cfg.Bind("Bonemass", "(Mini Stat) AttackRangeMult", 0.35f, new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniStat.AttackRangeMult"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 1f), Array.Empty())); MiniAttackIntervalMult = cfg.Bind("Bonemass", "(Mini Stat) AttackIntervalMult", 1f, new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniStat.AttackIntervalMult"), (AcceptableValueBase)new AcceptableValueRange(0.3f, 3f), Array.Empty())); AcceptableValueList val = new AcceptableValueList(new string[8] { "Inherit", "Normal", "Resistant", "VeryResistant", "Weak", "VeryWeak", "Immune", "Ignore" }); MiniResistBlunt = cfg.Bind("Bonemass", "(Mini Resist) Blunt", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Blunt"), (AcceptableValueBase)val, Array.Empty())); MiniResistSlash = cfg.Bind("Bonemass", "(Mini Resist) Slash", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Slash"), (AcceptableValueBase)val, Array.Empty())); MiniResistPierce = cfg.Bind("Bonemass", "(Mini Resist) Pierce", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Pierce"), (AcceptableValueBase)val, Array.Empty())); MiniResistFire = cfg.Bind("Bonemass", "(Mini Resist) Fire", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Fire"), (AcceptableValueBase)val, Array.Empty())); MiniResistFrost = cfg.Bind("Bonemass", "(Mini Resist) Frost", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Frost"), (AcceptableValueBase)val, Array.Empty())); MiniResistLightning = cfg.Bind("Bonemass", "(Mini Resist) Lightning", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Lightning"), (AcceptableValueBase)val, Array.Empty())); MiniResistPoison = cfg.Bind("Bonemass", "(Mini Resist) Poison", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Poison"), (AcceptableValueBase)val, Array.Empty())); MiniResistSpirit = cfg.Bind("Bonemass", "(Mini Resist) Spirit", "Inherit", new ConfigDescription(LocalizationManager.Desc("Bonemass.MiniResist.Spirit"), (AcceptableValueBase)val, Array.Empty())); BonusSpawnEnabled = cfg.Bind("Bonemass", "(Throw Summon) Enabled", false, LocalizationManager.Desc("Bonemass.ThrowSummon.Enabled")); BonusSpawnPrefab = cfg.Bind("Bonemass", "(Throw Summon) Prefab", "Blob", LocalizationManager.Desc("Bonemass.ThrowSummon.Prefab")); BonusSpawnChance = cfg.Bind("Bonemass", "(Throw Summon) Chance", 50f, new ConfigDescription(LocalizationManager.Desc("Bonemass.ThrowSummon.Chance"), (AcceptableValueBase)new AcceptableValueRange(0f, 100f), Array.Empty())); BonusSpawnCount = cfg.Bind("Bonemass", "(Throw Summon) Count", 1, new ConfigDescription(LocalizationManager.Desc("Bonemass.ThrowSummon.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 10), Array.Empty())); BonusSpawnHealthThreshold = cfg.Bind("Bonemass", "(Throw Summon) HPThreshold", 100f, new ConfigDescription(LocalizationManager.Desc("Bonemass.ThrowSummon.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); PhaseMessage = cfg.Bind("Bonemass", "(Phase) Message", "", LocalizationManager.Desc("Bonemass.Phase.Message")); PhaseMessageHP = cfg.Bind("Bonemass", "(Phase) MessageHP", 50f, new ConfigDescription(LocalizationManager.Desc("Bonemass.Phase.MessageHP"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); } } public class BossConfig { public readonly string PrefabName; public readonly string DisplayName; public ConfigEntry Enabled { get; private set; } public ConfigEntry TriggerMode { get; private set; } public ConfigEntry HealthStepCount { get; private set; } public ConfigEntry TimerInterval { get; private set; } public ConfigEntry SummonPrefab { get; private set; } public ConfigEntry SummonCount { get; private set; } public ConfigEntry SummonLevel { get; private set; } public ConfigEntry MaxTotalSummons { get; private set; } public ConfigEntry UseCLLC { get; private set; } public ConfigEntry SpecialSummonEnabled { get; private set; } public ConfigEntry SpecialSummonHealthThreshold { get; private set; } public ConfigEntry SpecialSummonPrefab { get; private set; } public ConfigEntry SpecialSummonCount { get; private set; } public ConfigEntry SpecialSummonLevel { get; private set; } public ConfigEntry SpecialSummonVfxPrefab { get; private set; } public BossConfig(string prefabName, string displayName, string sectionName, ConfigFile cfg, string defaultPrefab, int defaultCount = 2, int defaultLevel = 1, string specialPrefab = "", int specialCount = 1, int specialLevel = 3) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown PrefabName = prefabName; DisplayName = displayName; Enabled = cfg.Bind(sectionName, "(Summon) Enabled", true, LocalizationManager.Desc("BossSummon.Enabled")); TriggerMode = cfg.Bind(sectionName, "(Summon) TriggerMode", SummonTriggerMode.Health, LocalizationManager.Desc("BossSummon.TriggerMode")); HealthStepCount = cfg.Bind(sectionName, "(Summon) HealthStepCount", 5, new ConfigDescription(LocalizationManager.Desc("BossSummon.HealthStepCount"), (AcceptableValueBase)new AcceptableValueRange(1, 100), Array.Empty())); TimerInterval = cfg.Bind(sectionName, "(Summon) TimerInterval", 30f, new ConfigDescription(LocalizationManager.Desc("BossSummon.TimerInterval"), (AcceptableValueBase)new AcceptableValueRange(1f, 3600f), Array.Empty())); SummonPrefab = cfg.Bind(sectionName, "(Summon) Prefab", defaultPrefab, LocalizationManager.Desc("BossSummon.Prefab")); SummonCount = cfg.Bind(sectionName, "(Summon) Count", defaultCount, new ConfigDescription(LocalizationManager.Desc("BossSummon.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 50), Array.Empty())); SummonLevel = cfg.Bind(sectionName, "(Summon) Level", defaultLevel, new ConfigDescription(LocalizationManager.Desc("BossSummon.Level"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); MaxTotalSummons = cfg.Bind(sectionName, "(Summon) MaxTotal", 20, new ConfigDescription(LocalizationManager.Desc("BossSummon.MaxTotal"), (AcceptableValueBase)new AcceptableValueRange(1, 200), Array.Empty())); UseCLLC = cfg.Bind(sectionName, "(Summon) UseCLLC", false, LocalizationManager.Desc("BossSummon.UseCLLC")); SpecialSummonEnabled = cfg.Bind(sectionName, "(Special Summon) Enabled", true, LocalizationManager.Desc("BossSummon.SpecialEnabled")); SpecialSummonHealthThreshold = cfg.Bind(sectionName, "(Special Summon) HPThreshold", 50f, new ConfigDescription(LocalizationManager.Desc("BossSummon.SpecialHPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); SpecialSummonPrefab = cfg.Bind(sectionName, "(Special Summon) Prefab", string.IsNullOrEmpty(specialPrefab) ? defaultPrefab : specialPrefab, LocalizationManager.Desc("BossSummon.SpecialPrefab")); SpecialSummonCount = cfg.Bind(sectionName, "(Special Summon) Count", specialCount, new ConfigDescription(LocalizationManager.Desc("BossSummon.SpecialCount"), (AcceptableValueBase)new AcceptableValueRange(1, 10), Array.Empty())); SpecialSummonLevel = cfg.Bind(sectionName, "(Special Summon) Level", specialLevel, new ConfigDescription(LocalizationManager.Desc("BossSummon.SpecialLevel"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); SpecialSummonVfxPrefab = cfg.Bind(sectionName, "(Special Summon) VFX", "vfx_GodExplosion", LocalizationManager.Desc("BossSummon.SpecialVFX")); } } public static class BossStatConfig { public static readonly Dictionary All = new Dictionary(); public static void Bind(ConfigFile cfg) { Register(new BossStatEntry("Eikthyr", "에이크쉬르", "Eikthyr", cfg)); Register(new BossStatEntry("gd_king", "더 엘더", "The Elder", cfg)); Register(new BossStatEntry("Bonemass", "본매스", "Bonemass", cfg)); Register(new BossStatEntry("Dragon", "모더", "Moder", cfg)); Register(new BossStatEntry("GoblinKing", "야글루스", "Yagluth", cfg)); Register(new BossStatEntry("SeekerQueen", "더 퀸", "The Queen", cfg)); Register(new BossStatEntry("Fader", "페이더", "Fader", cfg)); } private static void Register(BossStatEntry e) { All[e.PrefabName] = e; } } public class BossStatEntry { public readonly string PrefabName; public readonly string DisplayName; public ConfigEntry HealthMultiplier { get; private set; } public ConfigEntry MoveSpeedMultiplier { get; private set; } public ConfigEntry AttackSpeedMultiplier { get; private set; } public BossStatEntry(string prefabName, string displayName, string sectionName, ConfigFile cfg) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown PrefabName = prefabName; DisplayName = displayName; HealthMultiplier = cfg.Bind(sectionName, "(Boss Stat) HealthMultiplier", 1f, new ConfigDescription(LocalizationManager.Desc("BossStat.Health"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 100f), Array.Empty())); MoveSpeedMultiplier = cfg.Bind(sectionName, "(Boss Stat) MoveSpeedMultiplier", 1f, new ConfigDescription(LocalizationManager.Desc("BossStat.Speed"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 10f), Array.Empty())); AttackSpeedMultiplier = cfg.Bind(sectionName, "(Boss Stat) AttackSpeedMultiplier", 1f, new ConfigDescription(LocalizationManager.Desc("BossStat.AttackFreq"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 10f), Array.Empty())); } } public static class BossSummonConfig { public static readonly Dictionary All = new Dictionary(); public static void Bind(ConfigFile cfg) { Register(new BossConfig("gd_king", "더 엘더", "The Elder", cfg, "Greydwarf_Elite", 2, 1, "Troll")); Register(new BossConfig("Bonemass", "본매스", "Bonemass", cfg, "Skeleton", 3, 1, "Draugr_Elite")); Register(new BossConfig("Dragon", "모더", "Moder", cfg, "Hatchling", 2, 1, "StoneGolem")); Register(new BossConfig("GoblinKing", "야글루스", "Yagluth", cfg, "Goblin", 3, 1, "GoblinBrute")); Register(new BossConfig("SeekerQueen", "더 퀸", "The Queen", cfg, "Seeker", 2, 1, "SeekerBrute")); Register(new BossConfig("Fader", "페이더", "Fader", cfg, "Charred_Melee", 2, 1, "Charred_Melee")); } private static void Register(BossConfig c) { All[c.PrefabName] = c; } } public static class BossVFXManager { private static readonly Dictionary _cache = new Dictionary(StringComparer.Ordinal); private static readonly HashSet _safeToDestroy = new HashSet(StringComparer.Ordinal); private static bool _initialized = false; public static void Initialize() { if (!_initialized) { string[] array = new string[4] { "fx_Lightning", "fx_eikthyr_stomp", "vfx_spawn_small", "vfx_GodExplosion" }; for (int i = 0; i < array.Length; i++) { TryCachePrefab(array[i]); } _initialized = true; Plugin.Log.LogInfo((object)$"[BossVFX] 초기화 완료 ({_cache.Count}개 캐싱)"); } } private static void TryCachePrefab(string prefabName) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if (!_cache.ContainsKey(prefabName) && !((Object)ZNetScene.instance == (Object)null)) { GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)prefab != (Object)null) { _cache[prefabName] = prefab; } } } public static void RegisterAsDestroyable(string prefabName) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown if (_safeToDestroy.Contains(prefabName) || (Object)ZNetScene.instance == (Object)null) { return; } GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[BossVFX] RegisterAsDestroyable: '" + prefabName + "' 없음")); return; } bool activeSelf = prefab.activeSelf; prefab.SetActive(false); GameObject val = Object.Instantiate(prefab); prefab.SetActive(activeSelf); ((Object)val).name = prefabName; Object.DontDestroyOnLoad((Object)val); ZNetView[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)componentsInChildren[i]); } ZSyncTransform[] componentsInChildren2 = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)componentsInChildren2[i]); } ZSyncAnimation[] componentsInChildren3 = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Object.DestroyImmediate((Object)componentsInChildren3[i]); } val.SetActive(false); _cache[prefabName] = val; _safeToDestroy.Add(prefabName); Plugin.Log.LogInfo((object)("[BossVFX] '" + prefabName + "' Destroyable 등록 완료")); } public static GameObject Play(string prefabName, Vector3 position, float lifetime = 3f) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0084: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown if (string.IsNullOrEmpty(prefabName)) { return null; } if ((Object)ZNetScene.instance == (Object)null) { return null; } try { if (!_cache.TryGetValue(prefabName, out var value) || (Object)value == (Object)null) { value = ZNetScene.instance.GetPrefab(prefabName); if ((Object)value == (Object)null) { Plugin.Log.LogWarning((object)("[BossVFX] 프리팹 '" + prefabName + "' 없음")); return null; } _cache[prefabName] = value; } GameObject val = Object.Instantiate(value, position, Quaternion.identity); if ((Object)val == (Object)null) { return null; } if (!val.activeSelf) { val.SetActive(true); } if (lifetime > 0f && _safeToDestroy.Contains(prefabName)) { Object.Destroy((Object)val, lifetime); } return val; } catch (Exception ex) { Plugin.Log.LogError((object)("[BossVFX] Play(" + prefabName + ") 실패: " + ex.Message)); return null; } } public static GameObject PlayAndDestroy(string prefabName, Vector3 position, float lifetime = 3f) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown if (string.IsNullOrEmpty(prefabName)) { return null; } if ((Object)ZNetScene.instance == (Object)null) { return null; } try { GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[BossVFX] PlayAndDestroy: '" + prefabName + "' 없음")); return null; } bool activeSelf = prefab.activeSelf; prefab.SetActive(false); GameObject val = Object.Instantiate(prefab, position, Quaternion.identity); prefab.SetActive(activeSelf); ZNetView[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)componentsInChildren[i]); } ZSyncTransform[] componentsInChildren2 = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)componentsInChildren2[i]); } ZSyncAnimation[] componentsInChildren3 = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Object.DestroyImmediate((Object)componentsInChildren3[i]); } Aoe[] componentsInChildren4 = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren4.Length; i++) { Object.DestroyImmediate((Object)componentsInChildren4[i]); } val.SetActive(true); if (lifetime > 0f) { Object.Destroy((Object)val, lifetime); } return val; } catch (Exception ex) { Plugin.Log.LogError((object)("[BossVFX] PlayAndDestroy(" + prefabName + ") 실패: " + ex.Message)); return null; } } public static void ClearCache() { _cache.Clear(); _safeToDestroy.Clear(); _initialized = false; Plugin.Log.LogInfo((object)"[BossVFX] 캐시 초기화 완료 (씬 언로드)"); } } [HarmonyPatch(typeof(ZNetScene), "OnDestroy")] public static class BossVFXManager_ZNetScene_OnDestroy_Patch { [HarmonyPostfix] public static void Postfix() { BossVFXManager.ClearCache(); } } [HarmonyPatch(typeof(ZNetScene), "Awake")] public static class BossVFXManager_ZNetScene_Patch { [HarmonyPostfix] public static void Postfix() { try { BossVFXManager.Initialize(); BossVFXManager.RegisterAsDestroyable("vfx_GodExplosion"); } catch (Exception ex) { Plugin.Log.LogError((object)("[BossVFX] ZNetScene 초기화 실패: " + ex.Message)); } } } public static class EikthyrSummonConfig { public static ConfigEntry Enabled { get; private set; } public static ConfigEntry TriggerMode { get; private set; } public static ConfigEntry HealthStepCount { get; private set; } public static ConfigEntry TimerInterval { get; private set; } public static ConfigEntry SummonPrefab { get; private set; } public static ConfigEntry SummonCount { get; private set; } public static ConfigEntry SummonLevel { get; private set; } public static ConfigEntry MaxTotalSummons { get; private set; } public static ConfigEntry UseCLLC { get; private set; } public static ConfigEntry SpecialSummonEnabled { get; private set; } public static ConfigEntry SpecialSummonHealthThreshold { get; private set; } public static ConfigEntry SpecialSummonPrefab { get; private set; } public static ConfigEntry SpecialSummonCount { get; private set; } public static ConfigEntry SpecialSummonLevel { get; private set; } public static ConfigEntry SpecialSummonVfxPrefab { get; private set; } public static ConfigEntry Phase2Enabled { get; private set; } public static ConfigEntry Phase2HealthThreshold { get; private set; } public static ConfigEntry StompAnimName { get; private set; } public static ConfigEntry LightningProcChance { get; private set; } public static ConfigEntry LightningCount { get; private set; } public static ConfigEntry LightningDamageBlunt { get; private set; } public static ConfigEntry LightningDamageSlash { get; private set; } public static ConfigEntry LightningDamagePierce { get; private set; } public static ConfigEntry LightningDamageLightning { get; private set; } public static ConfigEntry LightningVfxPrefab { get; private set; } public static ConfigEntry LightningStartDelay { get; private set; } public static ConfigEntry LightningSafeZoneRadius { get; private set; } public static ConfigEntry FirePatchEnabled { get; private set; } public static ConfigEntry FirePatchRadius { get; private set; } public static ConfigEntry FirePatchDuration { get; private set; } public static ConfigEntry FirePatchDamagePerTick { get; private set; } public static ConfigEntry FirePatchHitVfxPrefab { get; private set; } public static ConfigEntry FirePatchTickVfxPrefab { get; private set; } public static ConfigEntry HornLaunchEnabled { get; private set; } public static ConfigEntry HornLaunchHealthThreshold { get; private set; } public static ConfigEntry HornLaunchAnimName { get; private set; } public static ConfigEntry HornLaunchRange { get; private set; } public static ConfigEntry HornLaunchHorizontalForce { get; private set; } public static ConfigEntry HornLaunchVerticalForce { get; private set; } public static ConfigEntry HornLaunchProcChance { get; private set; } public static ConfigEntry HornLaunchAffectsBlocking { get; private set; } public static ConfigEntry PhaseMessage { get; private set; } public static ConfigEntry PhaseMessageHP { get; private set; } public static void Bind(ConfigFile cfg) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Expected O, but got Unknown //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Expected O, but got Unknown //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Expected O, but got Unknown //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Expected O, but got Unknown //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Expected O, but got Unknown //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Expected O, but got Unknown //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Expected O, but got Unknown //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Expected O, but got Unknown //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Expected O, but got Unknown //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Expected O, but got Unknown //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Expected O, but got Unknown //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03f4: Expected O, but got Unknown //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Expected O, but got Unknown //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Expected O, but got Unknown //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Expected O, but got Unknown //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Expected O, but got Unknown //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Expected O, but got Unknown //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ba: Expected O, but got Unknown //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Expected O, but got Unknown //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Expected O, but got Unknown //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Expected O, but got Unknown //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Expected O, but got Unknown //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Expected O, but got Unknown //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Expected O, but got Unknown //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Expected O, but got Unknown //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Expected O, but got Unknown //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Expected O, but got Unknown //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Expected O, but got Unknown //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Expected O, but got Unknown //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06f2: Expected O, but got Unknown //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Expected O, but got Unknown //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Expected O, but got Unknown //IL_0753: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Expected O, but got Unknown //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_079a: Expected O, but got Unknown //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Expected O, but got Unknown //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Expected O, but got Unknown //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Expected O, but got Unknown //IL_080f: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Expected O, but got Unknown //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Expected O, but got Unknown //IL_0895: Unknown result type (might be due to invalid IL or missing references) //IL_08a4: Expected O, but got Unknown //IL_089f: Unknown result type (might be due to invalid IL or missing references) //IL_08a9: Expected O, but got Unknown Enabled = cfg.Bind("Eikthyr", "(Summon) Enabled", true, LocalizationManager.Desc("Eikthyr.Summon.Enabled")); TriggerMode = cfg.Bind("Eikthyr", "(Summon) TriggerMode", SummonTriggerMode.Both, LocalizationManager.Desc("Eikthyr.Summon.TriggerMode")); HealthStepCount = cfg.Bind("Eikthyr", "(Summon) HealthStepCount", 10, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.HealthStepCount"), (AcceptableValueBase)new AcceptableValueRange(1, 100), Array.Empty())); TimerInterval = cfg.Bind("Eikthyr", "(Summon) TimerInterval", 30f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.TimerInterval"), (AcceptableValueBase)new AcceptableValueRange(1f, 3600f), Array.Empty())); SummonPrefab = cfg.Bind("Eikthyr", "(Summon) Prefab", "Troll", LocalizationManager.Desc("Eikthyr.Summon.Prefab")); SummonCount = cfg.Bind("Eikthyr", "(Summon) Count", 2, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 50), Array.Empty())); SummonLevel = cfg.Bind("Eikthyr", "(Summon) Level", 1, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.Level"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); MaxTotalSummons = cfg.Bind("Eikthyr", "(Summon) MaxTotal", 20, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.MaxTotal"), (AcceptableValueBase)new AcceptableValueRange(1, 200), Array.Empty())); UseCLLC = cfg.Bind("Eikthyr", "(Summon) UseCLLC", false, LocalizationManager.Desc("Eikthyr.Summon.UseCLLC")); SpecialSummonEnabled = cfg.Bind("Eikthyr", "(Special Summon) Enabled", true, LocalizationManager.Desc("Eikthyr.Summon.SpecialEnabled")); SpecialSummonHealthThreshold = cfg.Bind("Eikthyr", "(Special Summon) HPThreshold", 50f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.SpecialHPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); SpecialSummonPrefab = cfg.Bind("Eikthyr", "(Special Summon) Prefab", "Troll", LocalizationManager.Desc("Eikthyr.Summon.SpecialPrefab")); SpecialSummonCount = cfg.Bind("Eikthyr", "(Special Summon) Count", 1, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.SpecialCount"), (AcceptableValueBase)new AcceptableValueRange(1, 10), Array.Empty())); SpecialSummonLevel = cfg.Bind("Eikthyr", "(Special Summon) Level", 3, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Summon.SpecialLevel"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); SpecialSummonVfxPrefab = cfg.Bind("Eikthyr", "(Special Summon) VFX", "vfx_GodExplosion", LocalizationManager.Desc("Eikthyr.Summon.SpecialVFX")); Phase2Enabled = cfg.Bind("Eikthyr", "(Lightning) Enabled", true, LocalizationManager.Desc("Eikthyr.Lightning.Enabled")); Phase2HealthThreshold = cfg.Bind("Eikthyr", "(Lightning) HPThreshold", 50f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); StompAnimName = cfg.Bind("Eikthyr", "(Lightning) StompAnim", "stomp", LocalizationManager.Desc("Eikthyr.Lightning.StompAnim")); LightningProcChance = cfg.Bind("Eikthyr", "(Lightning) ProcChance", 50f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.ProcChance"), (AcceptableValueBase)new AcceptableValueRange(0f, 100f), Array.Empty())); LightningCount = cfg.Bind("Eikthyr", "(Lightning) Count", 3, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 20), Array.Empty())); LightningDamageBlunt = cfg.Bind("Eikthyr", "(Lightning) DamageBlunt", 0f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.DamageBlunt"), (AcceptableValueBase)new AcceptableValueRange(0f, 1000f), Array.Empty())); LightningDamageSlash = cfg.Bind("Eikthyr", "(Lightning) DamageSlash", 0f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.DamageSlash"), (AcceptableValueBase)new AcceptableValueRange(0f, 1000f), Array.Empty())); LightningDamagePierce = cfg.Bind("Eikthyr", "(Lightning) DamagePierce", 0f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.DamagePierce"), (AcceptableValueBase)new AcceptableValueRange(0f, 1000f), Array.Empty())); LightningDamageLightning = cfg.Bind("Eikthyr", "(Lightning) DamageLightning", 50f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.DamageLightning"), (AcceptableValueBase)new AcceptableValueRange(0f, 1000f), Array.Empty())); LightningVfxPrefab = cfg.Bind("Eikthyr", "(Lightning) VFX", "fx_Lightning", LocalizationManager.Desc("Eikthyr.Lightning.VFX")); LightningStartDelay = cfg.Bind("Eikthyr", "(Lightning) StartDelay", 0.8f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.StartDelay"), (AcceptableValueBase)new AcceptableValueRange(0f, 5f), Array.Empty())); LightningSafeZoneRadius = cfg.Bind("Eikthyr", "(Lightning) SafeZoneRadius", 10f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Lightning.SafeZoneRadius"), (AcceptableValueBase)new AcceptableValueRange(0f, 49f), Array.Empty())); FirePatchEnabled = cfg.Bind("Eikthyr", "(Fire Patch) Enabled", true, LocalizationManager.Desc("Eikthyr.FirePatch.Enabled")); FirePatchRadius = cfg.Bind("Eikthyr", "(Fire Patch) Radius", 3f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.FirePatch.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 20f), Array.Empty())); FirePatchDuration = cfg.Bind("Eikthyr", "(Fire Patch) Duration", 10f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.FirePatch.Duration"), (AcceptableValueBase)new AcceptableValueRange(1f, 120f), Array.Empty())); FirePatchDamagePerTick = cfg.Bind("Eikthyr", "(Fire Patch) DamagePerTick", 10f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.FirePatch.DamagePerTick"), (AcceptableValueBase)new AcceptableValueRange(0f, 1000f), Array.Empty())); FirePatchHitVfxPrefab = cfg.Bind("Eikthyr", "(Fire Patch) HitVFX", "vfx_Burning", LocalizationManager.Desc("Eikthyr.FirePatch.HitVFX")); FirePatchTickVfxPrefab = cfg.Bind("Eikthyr", "(Fire Patch) TickVFX", "vfx_Burning", LocalizationManager.Desc("Eikthyr.FirePatch.TickVFX")); HornLaunchEnabled = cfg.Bind("Eikthyr", "(Horn Attack) Enabled", true, LocalizationManager.Desc("Eikthyr.HornAttack.Enabled")); HornLaunchHealthThreshold = cfg.Bind("Eikthyr", "(Horn Attack) HPThreshold", 100f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.HornAttack.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); HornLaunchAnimName = cfg.Bind("Eikthyr", "(Horn Attack) Anim", "attack1", LocalizationManager.Desc("Eikthyr.HornAttack.Anim")); HornLaunchRange = cfg.Bind("Eikthyr", "(Horn Attack) Range", 5f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.HornAttack.Range"), (AcceptableValueBase)new AcceptableValueRange(1f, 20f), Array.Empty())); HornLaunchHorizontalForce = cfg.Bind("Eikthyr", "(Horn Attack) HorizontalForce", 15f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.HornAttack.HorizontalForce"), (AcceptableValueBase)new AcceptableValueRange(0f, 100f), Array.Empty())); HornLaunchVerticalForce = cfg.Bind("Eikthyr", "(Horn Attack) VerticalForce", 12f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.HornAttack.VerticalForce"), (AcceptableValueBase)new AcceptableValueRange(0f, 100f), Array.Empty())); HornLaunchProcChance = cfg.Bind("Eikthyr", "(Horn Attack) ProcChance", 100f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.HornAttack.ProcChance"), (AcceptableValueBase)new AcceptableValueRange(0f, 100f), Array.Empty())); HornLaunchAffectsBlocking = cfg.Bind("Eikthyr", "(Horn Attack) AffectsBlocking", false, LocalizationManager.Desc("Eikthyr.HornAttack.AffectsBlocking")); PhaseMessage = cfg.Bind("Eikthyr", "(Phase) Message", "", LocalizationManager.Desc("Eikthyr.Phase.Message")); PhaseMessageHP = cfg.Bind("Eikthyr", "(Phase) MessageHP", 50f, new ConfigDescription(LocalizationManager.Desc("Eikthyr.Phase.MessageHP"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); } } public static class LocalizationManager { private static Dictionary _strings = new Dictionary(); public static void Init() { string text = ((PlayerPrefs.GetString("language", "English") == "Korean") ? "ko" : "en"); string text2 = "bossadd.Shared.Localization." + text + ".json"; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(text2)) { if (stream == null) { ManualLogSource log = Plugin.Log; if (log != null) { log.LogWarning((object)("[BossAdd] Localization resource not found: " + text2)); } return; } using StreamReader streamReader = new StreamReader(stream); _strings = ParseJson(streamReader.ReadToEnd()); } ManualLogSource log2 = Plugin.Log; if (log2 != null) { log2.LogInfo((object)("[BossAdd] Localization loaded: " + text + " (" + _strings.Count + " keys)")); } } public static string Desc(string key) { if (!_strings.TryGetValue(key, out var value)) { return key; } return value; } private static Dictionary ParseJson(string json) { Dictionary dictionary = new Dictionary(); foreach (Match item in Regex.Matches(json, "\"((?:[^\"\\\\]|\\\\.)*?)\"[ \\t]*:[ \\t]*\"((?:[^\"\\\\]|\\\\.)*?)\"")) { dictionary[item.Groups[1].Value] = Unescape(item.Groups[2].Value); } return dictionary; } private static string Unescape(string s) { return s.Replace("\\n", "\n").Replace("\\t", "\t").Replace("\\\"", "\"") .Replace("\\\\", "\\"); } } [HarmonyPatch(typeof(ZNetScene), "CreateObject")] internal static class MiniBonemassStaleZDOCleanupPatch { [HarmonyPrefix] public static bool Prefix(ZNetScene __instance, ZDO zdo, ref GameObject __result) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) int prefab = zdo.GetPrefab(); GameObject prefab2 = __instance.GetPrefab(prefab); if ((Object)prefab2 == (Object)null || !MiniBonemassVariants.IsMini(((Object)prefab2).name)) { return true; } if (ZDOMan.instance != null && zdo.IsOwner()) { ZDOMan.instance.DestroyZDO(zdo); } Plugin.Log.LogInfo((object)$"[MonsterDB] 잔존 ZDO 제거: {((Object)prefab2).name} ({zdo.m_uid})"); __result = null; return false; } } internal static class MiniBonemassVariants { public const int Count = 5; public static readonly string[] Names = new string[5] { "MiniBonemass_Red", "MiniBonemass_Orange", "MiniBonemass_Yellow", "MiniBonemass_Green", "MiniBonemass_Blue" }; public static readonly string[] KoreanNames = new string[5] { "빨강", "주황", "노랑", "초록", "파랑" }; public static readonly Color[] Colors = (Color[])(object)new Color[5] { new Color(1f, 0.05f, 0.05f), new Color(1f, 0.45f, 0f), new Color(1f, 1f, 0f), new Color(0f, 0.9f, 0.8f), new Color(0.05f, 0.3f, 1f) }; public static bool IsMini(string prefabName) { return prefabName?.StartsWith("MiniBonemass_") ?? false; } public static int IndexOf(string prefabName) { for (int i = 0; i < Names.Length; i++) { if (Names[i] == prefabName) { return i; } } return -1; } } [HarmonyPatch(typeof(ZNetScene), "CreateObject")] internal static class MiniModerStaleZDOCleanupPatch { [HarmonyPrefix] public static bool Prefix(ZNetScene __instance, ZDO zdo, ref GameObject __result) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) int prefab = zdo.GetPrefab(); GameObject prefab2 = __instance.GetPrefab(prefab); if ((Object)prefab2 == (Object)null || ((Object)prefab2).name != "MiniModer") { return true; } if (ZDOMan.instance != null && zdo.IsOwner()) { ZDOMan.instance.DestroyZDO(zdo); } Plugin.Log.LogInfo((object)$"[ModerDB] 잔존 ZDO 제거: MiniModer ({zdo.m_uid})"); __result = null; return false; } } public static class ModerConfig { public static ConfigEntry SplitEnabled { get; private set; } public static ConfigEntry SplitHPThreshold { get; private set; } public static ConfigEntry SplitCount { get; private set; } public static ConfigEntry MiniScaleMult { get; private set; } public static ConfigEntry MiniHPMult { get; private set; } public static ConfigEntry MiniDamageMult { get; private set; } public static ConfigEntry MiniSpeedMult { get; private set; } public static ConfigEntry MiniAttackIntervalMult { get; private set; } public static ConfigEntry MiniAttackRangeMult { get; private set; } public static ConfigEntry MiniFlightDuration { get; private set; } public static ConfigEntry MiniFarTargetMinDist { get; private set; } public static ConfigEntry AirBreathEnabled { get; private set; } public static ConfigEntry AirBreathCooldown { get; private set; } public static ConfigEntry AirBreathRange { get; private set; } public static ConfigEntry AirBreathAngle { get; private set; } public static ConfigEntry AirBreathDamageFrost { get; private set; } public static ConfigEntry AirBreathDamageBlunt { get; private set; } public static ConfigEntry AirBreathVFX { get; private set; } public static ConfigEntry AirBreathMinAltitude { get; private set; } public static ConfigEntry AirBreathHPThreshold { get; private set; } public static ConfigEntry AirBreathPhaseMessage { get; private set; } public static ConfigEntry AirBreathPhaseMessageHP { get; private set; } public static ConfigEntry LandBlastEnabled { get; private set; } public static ConfigEntry LandBlastRadius { get; private set; } public static ConfigEntry LandBlastPushForce { get; private set; } public static ConfigEntry LandBlastPushForceY { get; private set; } public static ConfigEntry LandBlastVFX { get; private set; } public static ConfigEntry LandBlastVFXScale { get; private set; } public static ConfigEntry LandBlastSFX { get; private set; } public static ConfigEntry LandBlastCooldown { get; private set; } public static ConfigEntry LandBlastDelay { get; private set; } public static ConfigEntry RoarEnabled { get; private set; } public static ConfigEntry RoarHPThreshold { get; private set; } public static ConfigEntry RoarCooldown { get; private set; } public static ConfigEntry RoarRadius { get; private set; } public static ConfigEntry RoarDamageFrost { get; private set; } public static ConfigEntry RoarDamageBlunt { get; private set; } public static ConfigEntry RoarPushForce { get; private set; } public static ConfigEntry RoarStaggerMult { get; private set; } public static ConfigEntry RoarBlockable { get; private set; } public static ConfigEntry RoarVFX { get; private set; } public static ConfigEntry RoarSFX { get; private set; } public static ConfigEntry ZoneEnabled { get; private set; } public static ConfigEntry ZoneHPThreshold { get; private set; } public static ConfigEntry ZoneSlowEnabled { get; private set; } public static ConfigEntry ZoneCount { get; private set; } public static ConfigEntry ZoneSpawnRange { get; private set; } public static ConfigEntry ZoneRadius { get; private set; } public static ConfigEntry ZoneDamageFrost { get; private set; } public static ConfigEntry ZoneDamageBlunt { get; private set; } public static ConfigEntry ZoneDuration { get; private set; } public static ConfigEntry ZoneVFX { get; private set; } public static ConfigEntry ZoneVFXScale { get; private set; } public static void Bind(ConfigFile cfg) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Expected O, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Expected O, but got Unknown //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Expected O, but got Unknown //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Expected O, but got Unknown //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Expected O, but got Unknown //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Expected O, but got Unknown //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Expected O, but got Unknown //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Expected O, but got Unknown //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Expected O, but got Unknown //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Expected O, but got Unknown //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Expected O, but got Unknown //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Expected O, but got Unknown //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Expected O, but got Unknown //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Expected O, but got Unknown //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Expected O, but got Unknown //IL_04a1: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Expected O, but got Unknown //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Expected O, but got Unknown //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Expected O, but got Unknown //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Expected O, but got Unknown //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Expected O, but got Unknown //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Expected O, but got Unknown //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05ba: Expected O, but got Unknown //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Expected O, but got Unknown //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Expected O, but got Unknown //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_0601: Expected O, but got Unknown //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_0662: Expected O, but got Unknown //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Expected O, but got Unknown //IL_06b9: Unknown result type (might be due to invalid IL or missing references) //IL_06c8: Expected O, but got Unknown //IL_06c3: Unknown result type (might be due to invalid IL or missing references) //IL_06cd: Expected O, but got Unknown //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_070a: Expected O, but got Unknown //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Expected O, but got Unknown //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_076c: Expected O, but got Unknown //IL_0767: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Expected O, but got Unknown //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Expected O, but got Unknown //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07b3: Expected O, but got Unknown //IL_07e1: Unknown result type (might be due to invalid IL or missing references) //IL_07f0: Expected O, but got Unknown //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Expected O, but got Unknown //IL_0823: Unknown result type (might be due to invalid IL or missing references) //IL_0832: Expected O, but got Unknown //IL_082d: Unknown result type (might be due to invalid IL or missing references) //IL_0837: Expected O, but got Unknown //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Expected O, but got Unknown //IL_086f: Unknown result type (might be due to invalid IL or missing references) //IL_0879: Expected O, but got Unknown //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08b6: Expected O, but got Unknown //IL_08b1: Unknown result type (might be due to invalid IL or missing references) //IL_08bb: Expected O, but got Unknown //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Expected O, but got Unknown //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08fd: Expected O, but got Unknown //IL_09b3: Unknown result type (might be due to invalid IL or missing references) //IL_09c2: Expected O, but got Unknown //IL_09bd: Unknown result type (might be due to invalid IL or missing references) //IL_09c7: Expected O, but got Unknown //IL_0a0a: Unknown result type (might be due to invalid IL or missing references) //IL_0a19: Expected O, but got Unknown //IL_0a14: Unknown result type (might be due to invalid IL or missing references) //IL_0a1e: Expected O, but got Unknown //IL_0a4c: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Expected O, but got Unknown //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_0a60: Expected O, but got Unknown //IL_0a8e: Unknown result type (might be due to invalid IL or missing references) //IL_0a9d: Expected O, but got Unknown //IL_0a98: Unknown result type (might be due to invalid IL or missing references) //IL_0aa2: Expected O, but got Unknown //IL_0ad0: Unknown result type (might be due to invalid IL or missing references) //IL_0adf: Expected O, but got Unknown //IL_0ada: Unknown result type (might be due to invalid IL or missing references) //IL_0ae4: Expected O, but got Unknown //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_0b21: Expected O, but got Unknown //IL_0b1c: Unknown result type (might be due to invalid IL or missing references) //IL_0b26: Expected O, but got Unknown //IL_0b54: Unknown result type (might be due to invalid IL or missing references) //IL_0b63: Expected O, but got Unknown //IL_0b5e: Unknown result type (might be due to invalid IL or missing references) //IL_0b68: Expected O, but got Unknown //IL_0bba: Unknown result type (might be due to invalid IL or missing references) //IL_0bc9: Expected O, but got Unknown //IL_0bc4: Unknown result type (might be due to invalid IL or missing references) //IL_0bce: Expected O, but got Unknown SplitEnabled = cfg.Bind("Moder", "(Frost Clone) Enabled", true, LocalizationManager.Desc("Moder.FrostClone.Enabled")); SplitHPThreshold = cfg.Bind("Moder", "(Frost Clone) HPThreshold", 40f, new ConfigDescription(LocalizationManager.Desc("Moder.FrostClone.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); SplitCount = cfg.Bind("Moder", "(Frost Clone) Count", 2, new ConfigDescription(LocalizationManager.Desc("Moder.FrostClone.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); MiniScaleMult = cfg.Bind("Moder", "(Mini Stat) ScaleMult", 0.55f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniStat.ScaleMult"), (AcceptableValueBase)new AcceptableValueRange(0.2f, 0.9f), Array.Empty())); MiniHPMult = cfg.Bind("Moder", "(Mini Stat) HPMult", 0.3f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniStat.HPMult"), (AcceptableValueBase)new AcceptableValueRange(0.05f, 1f), Array.Empty())); MiniDamageMult = cfg.Bind("Moder", "(Mini Stat) DamageMult", 0.5f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniStat.DamageMult"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 3f), Array.Empty())); MiniSpeedMult = cfg.Bind("Moder", "(Mini Stat) SpeedMult", 1.4f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniStat.SpeedMult"), (AcceptableValueBase)new AcceptableValueRange(0.5f, 3f), Array.Empty())); MiniAttackIntervalMult = cfg.Bind("Moder", "(Mini Stat) AttackIntervalMult", 0.6f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniStat.AttackIntervalMult"), (AcceptableValueBase)new AcceptableValueRange(0.2f, 2f), Array.Empty())); MiniAttackRangeMult = cfg.Bind("Moder", "(Mini Stat) AttackRangeMult", 0.6f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniStat.AttackRangeMult"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 1.5f), Array.Empty())); MiniFlightDuration = cfg.Bind("Moder", "(Mini Flight) FlightDuration", 6f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniFlight.FlightDuration"), (AcceptableValueBase)new AcceptableValueRange(2f, 30f), Array.Empty())); MiniFarTargetMinDist = cfg.Bind("Moder", "(Mini Flight) FarTargetMinDist", 20f, new ConfigDescription(LocalizationManager.Desc("Moder.MiniFlight.FarTargetMinDist"), (AcceptableValueBase)new AcceptableValueRange(5f, 60f), Array.Empty())); AirBreathEnabled = cfg.Bind("Moder", "(Air Breath) Enabled", true, LocalizationManager.Desc("Moder.AirBreath.Enabled")); AirBreathCooldown = cfg.Bind("Moder", "(Air Breath) Cooldown", 8f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.Cooldown"), (AcceptableValueBase)new AcceptableValueRange(1f, 60f), Array.Empty())); AirBreathRange = cfg.Bind("Moder", "(Air Breath) Range", 28f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.Range"), (AcceptableValueBase)new AcceptableValueRange(5f, 80f), Array.Empty())); AirBreathAngle = cfg.Bind("Moder", "(Air Breath) Angle", 60f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.Angle"), (AcceptableValueBase)new AcceptableValueRange(10f, 180f), Array.Empty())); AirBreathDamageFrost = cfg.Bind("Moder", "(Air Breath) DamageFrost", 25f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.DamageFrost"), (AcceptableValueBase)new AcceptableValueRange(0f, 500f), Array.Empty())); AirBreathDamageBlunt = cfg.Bind("Moder", "(Air Breath) DamageBlunt", 0f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.DamageBlunt"), (AcceptableValueBase)new AcceptableValueRange(0f, 500f), Array.Empty())); AirBreathVFX = cfg.Bind("Moder", "(Air Breath) VFX", "vfx_dragon_coldbreath", LocalizationManager.Desc("Moder.AirBreath.VFX")); AirBreathMinAltitude = cfg.Bind("Moder", "(Air Breath) MinAltitude", 8f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.MinAltitude"), (AcceptableValueBase)new AcceptableValueRange(0f, 30f), Array.Empty())); AirBreathHPThreshold = cfg.Bind("Moder", "(Air Breath) HPThreshold", 100f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); AirBreathPhaseMessage = cfg.Bind("Moder", "(Air Breath) PhaseMessage", "", LocalizationManager.Desc("Moder.AirBreath.PhaseMessage")); AirBreathPhaseMessageHP = cfg.Bind("Moder", "(Air Breath) PhaseMessageHP", 50f, new ConfigDescription(LocalizationManager.Desc("Moder.AirBreath.PhaseMessageHP"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); LandBlastEnabled = cfg.Bind("Moder", "(Landing Blast) Enabled", true, LocalizationManager.Desc("Moder.LandingBlast.Enabled")); LandBlastRadius = cfg.Bind("Moder", "(Landing Blast) Radius", 14f, new ConfigDescription(LocalizationManager.Desc("Moder.LandingBlast.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 40f), Array.Empty())); LandBlastPushForce = cfg.Bind("Moder", "(Landing Blast) PushForce", 25f, new ConfigDescription(LocalizationManager.Desc("Moder.LandingBlast.PushForce"), (AcceptableValueBase)new AcceptableValueRange(0f, 200f), Array.Empty())); LandBlastPushForceY = cfg.Bind("Moder", "(Landing Blast) PushForceY", 0f, new ConfigDescription(LocalizationManager.Desc("Moder.LandingBlast.PushForceY"), (AcceptableValueBase)new AcceptableValueRange(0f, 100f), Array.Empty())); LandBlastVFX = cfg.Bind("Moder", "(Landing Blast) VFX", "fx_eikthyr_stomp", LocalizationManager.Desc("Moder.LandingBlast.VFX")); LandBlastVFXScale = cfg.Bind("Moder", "(Landing Blast) VFXScale", 2f, new ConfigDescription(LocalizationManager.Desc("Moder.LandingBlast.VFXScale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 5f), Array.Empty())); LandBlastSFX = cfg.Bind("Moder", "(Landing Blast) SFX", "sfx_dragon_scream", LocalizationManager.Desc("Moder.LandingBlast.SFX")); LandBlastCooldown = cfg.Bind("Moder", "(Landing Blast) Cooldown", 10f, new ConfigDescription(LocalizationManager.Desc("Moder.LandingBlast.Cooldown"), (AcceptableValueBase)new AcceptableValueRange(1f, 60f), Array.Empty())); LandBlastDelay = cfg.Bind("Moder", "(Landing Blast) Delay", 2f, new ConfigDescription(LocalizationManager.Desc("Moder.LandingBlast.Delay"), (AcceptableValueBase)new AcceptableValueRange(0f, 5f), Array.Empty())); RoarEnabled = cfg.Bind("Moder", "(Freeze Roar) Enabled", true, LocalizationManager.Desc("Moder.FreezeRoar.Enabled")); RoarHPThreshold = cfg.Bind("Moder", "(Freeze Roar) HPThreshold", 100f, new ConfigDescription(LocalizationManager.Desc("Moder.FreezeRoar.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); RoarCooldown = cfg.Bind("Moder", "(Freeze Roar) Cooldown", 25f, new ConfigDescription(LocalizationManager.Desc("Moder.FreezeRoar.Cooldown"), (AcceptableValueBase)new AcceptableValueRange(5f, 300f), Array.Empty())); RoarRadius = cfg.Bind("Moder", "(Freeze Roar) Radius", 15f, new ConfigDescription(LocalizationManager.Desc("Moder.FreezeRoar.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 60f), Array.Empty())); RoarDamageFrost = cfg.Bind("Moder", "(Freeze Roar) DamageFrost", 30f, new ConfigDescription(LocalizationManager.Desc("Moder.FreezeRoar.DamageFrost"), (AcceptableValueBase)new AcceptableValueRange(0f, 500f), Array.Empty())); RoarDamageBlunt = cfg.Bind("Moder", "(Freeze Roar) DamageBlunt", 0f, new ConfigDescription(LocalizationManager.Desc("Moder.FreezeRoar.DamageBlunt"), (AcceptableValueBase)new AcceptableValueRange(0f, 500f), Array.Empty())); RoarPushForce = cfg.Bind("Moder", "(Freeze Roar) PushForce", 20f, new ConfigDescription(LocalizationManager.Desc("Moder.FreezeRoar.PushForce"), (AcceptableValueBase)new AcceptableValueRange(0f, 200f), Array.Empty())); RoarStaggerMult = cfg.Bind("Moder", "(Freeze Roar) StaggerMult", 1f, new ConfigDescription(LocalizationManager.Desc("Moder.FreezeRoar.StaggerMult"), (AcceptableValueBase)new AcceptableValueRange(0f, 5f), Array.Empty())); RoarBlockable = cfg.Bind("Moder", "(Freeze Roar) Blockable", true, LocalizationManager.Desc("Moder.FreezeRoar.Blockable")); RoarVFX = cfg.Bind("Moder", "(Freeze Roar) VFX", "", LocalizationManager.Desc("Moder.FreezeRoar.VFX")); RoarSFX = cfg.Bind("Moder", "(Freeze Roar) SFX", "", LocalizationManager.Desc("Moder.FreezeRoar.SFX")); ZoneEnabled = cfg.Bind("Moder", "(Ice Field) Enabled", true, LocalizationManager.Desc("Moder.IceField.Enabled")); ZoneHPThreshold = cfg.Bind("Moder", "(Ice Field) HPThreshold", 100f, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); ZoneSlowEnabled = cfg.Bind("Moder", "(Ice Field) SlowEnabled", true, LocalizationManager.Desc("Moder.IceField.SlowEnabled")); ZoneCount = cfg.Bind("Moder", "(Ice Field) Count", 2, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 30), Array.Empty())); ZoneSpawnRange = cfg.Bind("Moder", "(Ice Field) SpawnRange", 12f, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.SpawnRange"), (AcceptableValueBase)new AcceptableValueRange(2f, 40f), Array.Empty())); ZoneRadius = cfg.Bind("Moder", "(Ice Field) Radius", 6f, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 20f), Array.Empty())); ZoneDamageFrost = cfg.Bind("Moder", "(Ice Field) DamageFrost", 10f, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.DamageFrost"), (AcceptableValueBase)new AcceptableValueRange(0f, 200f), Array.Empty())); ZoneDamageBlunt = cfg.Bind("Moder", "(Ice Field) DamageBlunt", 0f, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.DamageBlunt"), (AcceptableValueBase)new AcceptableValueRange(0f, 200f), Array.Empty())); ZoneDuration = cfg.Bind("Moder", "(Ice Field) Duration", 8f, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.Duration"), (AcceptableValueBase)new AcceptableValueRange(1f, 60f), Array.Empty())); ZoneVFX = cfg.Bind("Moder", "(Ice Field) VFX", "fx_fenring_icenova", LocalizationManager.Desc("Moder.IceField.VFX")); ZoneVFXScale = cfg.Bind("Moder", "(Ice Field) VFXScale", 1f, new ConfigDescription(LocalizationManager.Desc("Moder.IceField.VFXScale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 5f), Array.Empty())); } } [HarmonyPatch(typeof(ZNetScene), "Awake")] internal static class ModerMonsterDB { private static readonly FieldInfo s_namedPrefabsField = AccessTools.Field(typeof(ZNetScene), "m_namedPrefabs"); private static GameObject s_miniModer; public const string PrefabName = "MiniModer"; [HarmonyPostfix] public static void Postfix(ZNetScene __instance) { if (!(s_namedPrefabsField.GetValue(__instance) is Dictionary namedPrefabs)) { Plugin.Log.LogError((object)"[ModerDB] m_namedPrefabs 접근 실패"); } else { RegisterMiniModer(__instance, namedPrefabs); } } private static void RegisterMiniModer(ZNetScene zns, Dictionary namedPrefabs) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Expected O, but got Unknown //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) if ((Object)zns.GetPrefab("MiniModer") != (Object)null) { return; } if ((Object)s_miniModer != (Object)null) { zns.m_prefabs.Add(s_miniModer); namedPrefabs[StringExtensionMethods.GetStableHashCode("MiniModer")] = s_miniModer; Plugin.Log.LogInfo((object)"[ModerDB] MiniModer 재등록"); return; } GameObject prefab = zns.GetPrefab("Dragon"); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)"[ModerDB] Dragon 프리팹 없음 — MiniModer 등록 실패"); return; } bool activeSelf = prefab.activeSelf; prefab.SetActive(false); GameObject val = Object.Instantiate(prefab); prefab.SetActive(activeSelf); ((Object)val).name = "MiniModer"; Object.DontDestroyOnLoad((Object)val); val.SetActive(false); Character component = prefab.GetComponent(); Character component2 = val.GetComponent(); if ((Object)component2 != (Object)null) { component2.m_boss = false; component2.m_bossEvent = ""; float value = ModerConfig.MiniSpeedMult.Value; component2.m_runSpeed *= value; component2.m_walkSpeed *= value; component2.m_swimSpeed *= value; if ((Object)component != (Object)null) { component2.m_health = Mathf.Max(component.m_health * ModerConfig.MiniHPMult.Value, 1f); } } ZNetView component3 = val.GetComponent(); if ((Object)component3 != (Object)null) { component3.m_persistent = false; } MonsterAI component4 = val.GetComponent(); if ((Object)component4 != (Object)null) { float value2 = ModerConfig.MiniAttackIntervalMult.Value; if (!Mathf.Approximately(value2, 1f)) { component4.m_minAttackInterval *= value2; } } CharacterDrop component5 = val.GetComponent(); if ((Object)component5 != (Object)null) { component5.m_drops.Clear(); } ApplyFrostTint(val, new Color(0.15f, 0.55f, 1f)); float value3 = ModerConfig.MiniScaleMult.Value; val.transform.localScale = Vector3.one * value3; zns.m_prefabs.Add(val); namedPrefabs[StringExtensionMethods.GetStableHashCode("MiniModer")] = val; s_miniModer = val; Plugin.Log.LogInfo((object)("[ModerDB] MiniModer 등록 완료 — " + $"HP {component2?.m_health:F0} / scale {value3:F2} / 보스 플래그 OFF")); } private static void ApplyFrostTint(GameObject go, Color tint) { //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = go.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (val is ParticleSystemRenderer) { continue; } Material[] sharedMaterials = val.sharedMaterials; bool flag = false; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)sharedMaterials[j] == (Object)null)) { Material val2 = new Material(sharedMaterials[j]); if (val2.HasProperty("_Color")) { Color color = val2.color; val2.color = new Color(tint.r, tint.g, tint.b, color.a); } if (val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", tint * 8f); } if (val2.HasProperty("_TintColor")) { val2.SetColor("_TintColor", new Color(tint.r, tint.g, tint.b, 0.5f)); } sharedMaterials[j] = val2; flag = true; } } if (flag) { val.sharedMaterials = sharedMaterials; } } ParticleSystem[] componentsInChildren2 = go.GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren2) { MainModule main = obj.main; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTimeMultiplier = ((EmissionModule)(ref emission)).rateOverTimeMultiplier * 0.5f; ((EmissionModule)(ref emission)).rateOverDistanceMultiplier = ((EmissionModule)(ref emission)).rateOverDistanceMultiplier * 0.5f; ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * 0.6f; MinMaxGradient startColor = ((MainModule)(ref main)).startColor; Color color2 = ((MinMaxGradient)(ref startColor)).color; ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(tint.r, tint.g, tint.b, color2.a)); } } } [HarmonyPatch(typeof(ZNetScene), "Awake")] internal static class MonsterDB { private static readonly FieldInfo s_namedPrefabsField = AccessTools.Field(typeof(ZNetScene), "m_namedPrefabs"); private static readonly GameObject[] s_variants = (GameObject[])(object)new GameObject[5]; [HarmonyPostfix] public static void Postfix(ZNetScene __instance) { if (!(s_namedPrefabsField.GetValue(__instance) is Dictionary namedPrefabs)) { Plugin.Log.LogError((object)"[MonsterDB] m_namedPrefabs 접근 실패"); return; } for (int i = 0; i < 5; i++) { RegisterVariant(__instance, namedPrefabs, i); } } private static void RegisterVariant(ZNetScene zns, Dictionary namedPrefabs, int idx) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Expected O, but got Unknown //IL_01b0: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: 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_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029a: 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_02a3: 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_02de: Expected O, but got Unknown //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Expected O, but got Unknown //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) string text = MiniBonemassVariants.Names[idx]; Color tint = MiniBonemassVariants.Colors[idx]; if ((Object)zns.GetPrefab(text) != (Object)null) { return; } if ((Object)s_variants[idx] != (Object)null) { zns.m_prefabs.Add(s_variants[idx]); namedPrefabs[StringExtensionMethods.GetStableHashCode(text)] = s_variants[idx]; Plugin.Log.LogInfo((object)("[MonsterDB] " + text + " 재등록")); return; } GameObject prefab = zns.GetPrefab("Bonemass"); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)("[MonsterDB] Bonemass 프리팹 없음 — " + text + " 등록 실패")); return; } bool activeSelf = prefab.activeSelf; prefab.SetActive(false); GameObject val = Object.Instantiate(prefab); prefab.SetActive(activeSelf); ((Object)val).name = text; Object.DontDestroyOnLoad((Object)val); val.SetActive(false); Character component = prefab.GetComponent(); Character component2 = val.GetComponent(); if ((Object)component2 != (Object)null) { component2.m_boss = false; component2.m_bossEvent = ""; component2.m_runSpeed *= BonemassConfig.MiniSpeedMult.Value; component2.m_walkSpeed *= BonemassConfig.MiniSpeedMult.Value; component2.m_swimSpeed *= BonemassConfig.MiniSpeedMult.Value; if ((Object)component != (Object)null) { component2.m_health = Mathf.Max(component.m_health * BonemassConfig.MiniHPMult.Value, 1f); } } if ((Object)component2 != (Object)null) { DamageModifiers damageModifiers = component2.m_damageModifiers; damageModifiers.m_blunt = ParseModifier(BonemassConfig.MiniResistBlunt.Value, damageModifiers.m_blunt); damageModifiers.m_slash = ParseModifier(BonemassConfig.MiniResistSlash.Value, damageModifiers.m_slash); damageModifiers.m_pierce = ParseModifier(BonemassConfig.MiniResistPierce.Value, damageModifiers.m_pierce); damageModifiers.m_fire = ParseModifier(BonemassConfig.MiniResistFire.Value, damageModifiers.m_fire); damageModifiers.m_frost = ParseModifier(BonemassConfig.MiniResistFrost.Value, damageModifiers.m_frost); damageModifiers.m_lightning = ParseModifier(BonemassConfig.MiniResistLightning.Value, damageModifiers.m_lightning); damageModifiers.m_poison = ParseModifier(BonemassConfig.MiniResistPoison.Value, damageModifiers.m_poison); damageModifiers.m_spirit = ParseModifier(BonemassConfig.MiniResistSpirit.Value, damageModifiers.m_spirit); component2.m_damageModifiers = damageModifiers; } ZNetView component3 = val.GetComponent(); if ((Object)component3 != (Object)null) { component3.m_persistent = false; } MonsterAI component4 = val.GetComponent(); if ((Object)component4 != (Object)null && BonemassConfig.MiniAttackIntervalMult.Value != 1f) { component4.m_minAttackInterval *= BonemassConfig.MiniAttackIntervalMult.Value; } CharacterDrop component5 = val.GetComponent(); if ((Object)component5 != (Object)null) { component5.m_drops.Clear(); } ApplyTint(val, tint); val.transform.localScale = Vector3.one * 0.3f; zns.m_prefabs.Add(val); namedPrefabs[StringExtensionMethods.GetStableHashCode(text)] = val; s_variants[idx] = val; Plugin.Log.LogInfo((object)("[MonsterDB] " + text + " 등록 완료 — " + $"HP {component2?.m_health:F0} / 보스 플래그 OFF")); } private static DamageModifier ParseModifier(string value, DamageModifier original) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(value) || value == "Inherit") { return original; } if (Enum.TryParse(value, out DamageModifier result)) { return result; } Plugin.Log.LogWarning((object)("[MonsterDB] 알 수 없는 저항값 '" + value + "' → Inherit 처리")); return original; } private static void ApplyTint(GameObject go, Color tint) { //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = go.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (val is ParticleSystemRenderer) { continue; } Material[] sharedMaterials = val.sharedMaterials; bool flag = false; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)sharedMaterials[j] == (Object)null)) { Material val2 = new Material(sharedMaterials[j]); if (val2.HasProperty("_Color")) { Color color = val2.color; val2.color = new Color(tint.r, tint.g, tint.b, color.a); } if (val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", tint * 15f); } if (val2.HasProperty("_TintColor")) { val2.SetColor("_TintColor", new Color(tint.r, tint.g, tint.b, 0.5f)); } sharedMaterials[j] = val2; flag = true; } } if (flag) { val.sharedMaterials = sharedMaterials; } } ParticleSystem[] componentsInChildren2 = go.GetComponentsInChildren(true); foreach (ParticleSystem obj in componentsInChildren2) { MainModule main = obj.main; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTimeMultiplier = ((EmissionModule)(ref emission)).rateOverTimeMultiplier * 0.1f; ((EmissionModule)(ref emission)).rateOverDistanceMultiplier = ((EmissionModule)(ref emission)).rateOverDistanceMultiplier * 0.1f; ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * 0.35f; MinMaxGradient startColor = ((MainModule)(ref main)).startColor; Color color2 = ((MinMaxGradient)(ref startColor)).color; ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(tint.r, tint.g, tint.b, color2.a * 0.06f)); } } } [BepInPlugin("bossadd", "BossAdd", "1.0.2")] public class Plugin : BaseUnityPlugin { public static ManualLogSource Log; public static bool SummonBlocked; private bool _playerWasDead; private float _unblockTime; public static Plugin Instance { get; private set; } private void Awake() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) Instance = this; Log = ((BaseUnityPlugin)this).Logger; LocalizationManager.Init(); BossStatConfig.Bind(((BaseUnityPlugin)this).Config); EikthyrSummonConfig.Bind(((BaseUnityPlugin)this).Config); BossSummonConfig.Bind(((BaseUnityPlugin)this).Config); TheElderConfig.Bind(((BaseUnityPlugin)this).Config); BonemassConfig.Bind(((BaseUnityPlugin)this).Config); ModerConfig.Bind(((BaseUnityPlugin)this).Config); YagluthConfig.Bind(((BaseUnityPlugin)this).Config); QueenConfig.Bind(((BaseUnityPlugin)this).Config); new Harmony("bossadd").PatchAll(); Log.LogInfo((object)"BossAdd loaded."); } private void Update() { EikthyrTimerSummonHandler.Tick(); BossTimerSummonHandler.Tick(); TheElderRockThrowHandler.Tick(); MiniModerFlightHandler.Tick(); ModerRoarZoneHandler.Tick(); ModerAirBreathHandler.Tick(); YagluthRageHandler.Tick(); YagluthDeathZoneHandler.Tick(); YagluthMeteorFireHandler.Tick(); QueenBroodTimerHandler.Tick(); QueenPoisonZoneHandler.Tick(); CheckRespawn(); } private void CheckRespawn() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown if ((Object)Player.m_localPlayer == (Object)null || ((Character)Player.m_localPlayer).IsDead()) { if (!_playerWasDead) { _playerWasDead = true; SummonBlocked = true; Log.LogInfo((object)"[EikthyrSummon] 플레이어 사망 → 소환 차단 시작"); } } else if (_playerWasDead) { _playerWasDead = false; _unblockTime = Time.time + 3f; Log.LogInfo((object)"[EikthyrSummon] 플레이어 리스폰 → 3초 후 소환 재개 예정"); } if (SummonBlocked && _unblockTime > 0f && Time.time >= _unblockTime) { SummonBlocked = false; _unblockTime = 0f; Log.LogInfo((object)"[EikthyrSummon] 소환 차단 해제 — 전투 재개"); } } } public static class QueenConfig { public static ConfigEntry BroodHPEnabled { get; private set; } public static ConfigEntry BroodHPStep { get; private set; } public static ConfigEntry BroodHPCount { get; private set; } public static ConfigEntry BroodHPLevel { get; private set; } public static ConfigEntry BroodHPScale { get; private set; } public static ConfigEntry BroodHPPrefab { get; private set; } public static ConfigEntry BroodHPVFX { get; private set; } public static ConfigEntry BroodHPMessage { get; private set; } public static ConfigEntry BroodTimerEnabled { get; private set; } public static ConfigEntry BroodTimerInterval { get; private set; } public static ConfigEntry BroodTimerCount { get; private set; } public static ConfigEntry BroodTimerLevel { get; private set; } public static ConfigEntry BroodTimerScale { get; private set; } public static ConfigEntry BroodTimerPrefab { get; private set; } public static ConfigEntry BroodTimerVFX { get; private set; } public static ConfigEntry BreathSummonEnabled { get; private set; } public static ConfigEntry BreathSummonVFXTrigger { get; private set; } public static ConfigEntry BreathSummonChance { get; private set; } public static ConfigEntry BreathSummonPrefab { get; private set; } public static ConfigEntry BreathSummonCount { get; private set; } public static ConfigEntry BreathSummonLevel { get; private set; } public static ConfigEntry BreathSummonScale { get; private set; } public static ConfigEntry BreathSummonVFX { get; private set; } public static ConfigEntry BreathSummonDebugScan { get; private set; } public static ConfigEntry PoisonEnabled { get; private set; } public static ConfigEntry PoisonMoveInterval { get; private set; } public static ConfigEntry PoisonDuration { get; private set; } public static ConfigEntry PoisonRadius { get; private set; } public static ConfigEntry PoisonDamagePerTick { get; private set; } public static ConfigEntry PoisonTickInterval { get; private set; } public static ConfigEntry PoisonMaxZones { get; private set; } public static ConfigEntry PoisonVFX { get; private set; } public static ConfigEntry PoisonVFXScale { get; private set; } public static void Bind(ConfigFile cfg) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Expected O, but got Unknown //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Expected O, but got Unknown //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Expected O, but got Unknown //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Expected O, but got Unknown //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Expected O, but got Unknown //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Expected O, but got Unknown //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Expected O, but got Unknown //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Expected O, but got Unknown //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Expected O, but got Unknown //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Expected O, but got Unknown //IL_04c6: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Expected O, but got Unknown //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0512: Expected O, but got Unknown //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Expected O, but got Unknown //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Expected O, but got Unknown //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Expected O, but got Unknown //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Expected O, but got Unknown //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Expected O, but got Unknown //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Expected O, but got Unknown //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Expected O, but got Unknown //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060f: Expected O, but got Unknown //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Expected O, but got Unknown //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Expected O, but got Unknown BroodHPEnabled = cfg.Bind("The Queen", "(HP Summon) Enabled", true, LocalizationManager.Desc("Queen.HPSummon.Enabled")); BroodHPStep = cfg.Bind("The Queen", "(HP Summon) HPStep", 25f, new ConfigDescription(LocalizationManager.Desc("Queen.HPSummon.HPStep"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); BroodHPCount = cfg.Bind("The Queen", "(HP Summon) Count", 3, new ConfigDescription(LocalizationManager.Desc("Queen.HPSummon.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 20), Array.Empty())); BroodHPLevel = cfg.Bind("The Queen", "(HP Summon) Level", 1, new ConfigDescription(LocalizationManager.Desc("Queen.HPSummon.Level"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); BroodHPScale = cfg.Bind("The Queen", "(HP Summon) Scale", 1f, new ConfigDescription(LocalizationManager.Desc("Queen.HPSummon.Scale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 5f), Array.Empty())); BroodHPPrefab = cfg.Bind("The Queen", "(HP Summon) Prefab", "Seeker", LocalizationManager.Desc("Queen.HPSummon.Prefab")); BroodHPVFX = cfg.Bind("The Queen", "(HP Summon) VFX", "", LocalizationManager.Desc("Queen.HPSummon.VFX")); BroodHPMessage = cfg.Bind("The Queen", "(HP Summon) PhaseMessage", "The Queen calls her brood!", LocalizationManager.Desc("Queen.HPSummon.PhaseMessage")); BroodTimerEnabled = cfg.Bind("The Queen", "(Timer Summon) Enabled", true, LocalizationManager.Desc("Queen.TimerSummon.Enabled")); BroodTimerInterval = cfg.Bind("The Queen", "(Timer Summon) Interval", 30f, new ConfigDescription(LocalizationManager.Desc("Queen.TimerSummon.Interval"), (AcceptableValueBase)new AcceptableValueRange(5f, 600f), Array.Empty())); BroodTimerCount = cfg.Bind("The Queen", "(Timer Summon) Count", 2, new ConfigDescription(LocalizationManager.Desc("Queen.TimerSummon.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 20), Array.Empty())); BroodTimerLevel = cfg.Bind("The Queen", "(Timer Summon) Level", 1, new ConfigDescription(LocalizationManager.Desc("Queen.TimerSummon.Level"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); BroodTimerScale = cfg.Bind("The Queen", "(Timer Summon) Scale", 1f, new ConfigDescription(LocalizationManager.Desc("Queen.TimerSummon.Scale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 5f), Array.Empty())); BroodTimerPrefab = cfg.Bind("The Queen", "(Timer Summon) Prefab", "Seeker", LocalizationManager.Desc("Queen.TimerSummon.Prefab")); BroodTimerVFX = cfg.Bind("The Queen", "(Timer Summon) VFX", "", LocalizationManager.Desc("Queen.TimerSummon.VFX")); BreathSummonEnabled = cfg.Bind("The Queen", "(Breath Summon) Enabled", true, LocalizationManager.Desc("Queen.BreathSummon.Enabled")); BreathSummonVFXTrigger = cfg.Bind("The Queen", "(Breath Summon) VFXTrigger", "", LocalizationManager.Desc("Queen.BreathSummon.VFXTrigger")); BreathSummonChance = cfg.Bind("The Queen", "(Breath Summon) Chance", 50f, new ConfigDescription(LocalizationManager.Desc("Queen.BreathSummon.Chance"), (AcceptableValueBase)new AcceptableValueRange(0f, 100f), Array.Empty())); BreathSummonPrefab = cfg.Bind("The Queen", "(Breath Summon) Prefab", "SeekerBrute", LocalizationManager.Desc("Queen.BreathSummon.Prefab")); BreathSummonCount = cfg.Bind("The Queen", "(Breath Summon) Count", 1, new ConfigDescription(LocalizationManager.Desc("Queen.BreathSummon.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 10), Array.Empty())); BreathSummonLevel = cfg.Bind("The Queen", "(Breath Summon) Level", 1, new ConfigDescription(LocalizationManager.Desc("Queen.BreathSummon.Level"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); BreathSummonScale = cfg.Bind("The Queen", "(Breath Summon) Scale", 1f, new ConfigDescription(LocalizationManager.Desc("Queen.BreathSummon.Scale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 5f), Array.Empty())); BreathSummonVFX = cfg.Bind("The Queen", "(Breath Summon) VFX", "", LocalizationManager.Desc("Queen.BreathSummon.VFX")); BreathSummonDebugScan = cfg.Bind("The Queen", "(Breath Summon) DebugScan", false, LocalizationManager.Desc("Queen.BreathSummon.DebugScan")); PoisonEnabled = cfg.Bind("The Queen", "(Poison Field) Enabled", true, LocalizationManager.Desc("Queen.PoisonField.Enabled")); PoisonMoveInterval = cfg.Bind("The Queen", "(Poison Field) MoveInterval", 10f, new ConfigDescription(LocalizationManager.Desc("Queen.PoisonField.MoveInterval"), (AcceptableValueBase)new AcceptableValueRange(1f, 120f), Array.Empty())); PoisonDuration = cfg.Bind("The Queen", "(Poison Field) Duration", 20f, new ConfigDescription(LocalizationManager.Desc("Queen.PoisonField.Duration"), (AcceptableValueBase)new AcceptableValueRange(1f, 300f), Array.Empty())); PoisonRadius = cfg.Bind("The Queen", "(Poison Field) Radius", 6f, new ConfigDescription(LocalizationManager.Desc("Queen.PoisonField.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 50f), Array.Empty())); PoisonDamagePerTick = cfg.Bind("The Queen", "(Poison Field) DamagePerTick", 5f, new ConfigDescription(LocalizationManager.Desc("Queen.PoisonField.DamagePerTick"), (AcceptableValueBase)new AcceptableValueRange(0f, 500f), Array.Empty())); PoisonTickInterval = cfg.Bind("The Queen", "(Poison Field) TickInterval", 1f, new ConfigDescription(LocalizationManager.Desc("Queen.PoisonField.TickInterval"), (AcceptableValueBase)new AcceptableValueRange(0.5f, 10f), Array.Empty())); PoisonMaxZones = cfg.Bind("The Queen", "(Poison Field) MaxZones", 5, new ConfigDescription(LocalizationManager.Desc("Queen.PoisonField.MaxZones"), (AcceptableValueBase)new AcceptableValueRange(1, 20), Array.Empty())); PoisonVFX = cfg.Bind("The Queen", "(Poison Field) VFX", "", LocalizationManager.Desc("Queen.PoisonField.VFX")); PoisonVFXScale = cfg.Bind("The Queen", "(Poison Field) VFXScale", 2f, new ConfigDescription(LocalizationManager.Desc("Queen.PoisonField.VFXScale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 20f), Array.Empty())); } } public enum SummonTriggerMode { Health, Timer, Both } public static class TheElderConfig { public static ConfigEntry TreeSpawnEnabled { get; private set; } public static ConfigEntry TreeSpawnHealthThreshold { get; private set; } public static ConfigEntry TreeSpawnInterval { get; private set; } public static ConfigEntry TreeCount { get; private set; } public static ConfigEntry TreeSpawnRadius { get; private set; } public static ConfigEntry TreePrefab { get; private set; } public static ConfigEntry TreePlayerDetectRange { get; private set; } public static ConfigEntry RockThrowEnabled { get; private set; } public static ConfigEntry RockThrowHealthThreshold { get; private set; } public static ConfigEntry RockThrowCooldown { get; private set; } public static ConfigEntry RockThrowProcChance { get; private set; } public static ConfigEntry RockThrowProjectilePrefab { get; private set; } public static ConfigEntry RockThrowSpeed { get; private set; } public static ConfigEntry RockThrowArcHeight { get; private set; } public static ConfigEntry RockThrowDamageBlunt { get; private set; } public static ConfigEntry RockThrowStartDelay { get; private set; } public static ConfigEntry RockThrowDetectRange { get; private set; } public static ConfigEntry RockThrowSplashEnabled { get; private set; } public static ConfigEntry RockThrowSplashRadius { get; private set; } public static ConfigEntry RockThrowSplashDamage { get; private set; } public static ConfigEntry RockThrowSplashVFX { get; private set; } public static ConfigEntry PhaseMessage { get; private set; } public static ConfigEntry PhaseMessageHP { get; private set; } public static void Bind(ConfigFile cfg) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Expected O, but got Unknown //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Expected O, but got Unknown //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Expected O, but got Unknown //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Expected O, but got Unknown //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Expected O, but got Unknown //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Expected O, but got Unknown //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Expected O, but got Unknown //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Expected O, but got Unknown //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Expected O, but got Unknown //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Expected O, but got Unknown //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Expected O, but got Unknown //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Expected O, but got Unknown //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Expected O, but got Unknown //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Expected O, but got Unknown //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Expected O, but got Unknown //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Expected O, but got Unknown //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Expected O, but got Unknown //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Expected O, but got Unknown TreeSpawnEnabled = cfg.Bind("The Elder", "(Tree Spawn) Enabled", true, LocalizationManager.Desc("Elder.TreeSpawn.Enabled")); TreeSpawnHealthThreshold = cfg.Bind("The Elder", "(Tree Spawn) HPThreshold", 50f, new ConfigDescription(LocalizationManager.Desc("Elder.TreeSpawn.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); TreeSpawnInterval = cfg.Bind("The Elder", "(Tree Spawn) Interval", 20f, new ConfigDescription(LocalizationManager.Desc("Elder.TreeSpawn.Interval"), (AcceptableValueBase)new AcceptableValueRange(5f, 300f), Array.Empty())); TreeCount = cfg.Bind("The Elder", "(Tree Spawn) Count", 10, new ConfigDescription(LocalizationManager.Desc("Elder.TreeSpawn.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 30), Array.Empty())); TreeSpawnRadius = cfg.Bind("The Elder", "(Tree Spawn) Radius", 2f, new ConfigDescription(LocalizationManager.Desc("Elder.TreeSpawn.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 10f), Array.Empty())); TreePrefab = cfg.Bind("The Elder", "(Tree Spawn) Prefab", "Beech_small2", LocalizationManager.Desc("Elder.TreeSpawn.Prefab")); TreePlayerDetectRange = cfg.Bind("The Elder", "(Tree Spawn) DetectRange", 30f, new ConfigDescription(LocalizationManager.Desc("Elder.TreeSpawn.DetectRange"), (AcceptableValueBase)new AcceptableValueRange(10f, 100f), Array.Empty())); RockThrowEnabled = cfg.Bind("The Elder", "(Rock Throw) Enabled", true, LocalizationManager.Desc("Elder.RockThrow.Enabled")); RockThrowHealthThreshold = cfg.Bind("The Elder", "(Rock Throw) HPThreshold", 75f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); RockThrowCooldown = cfg.Bind("The Elder", "(Rock Throw) Cooldown", 8f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.Cooldown"), (AcceptableValueBase)new AcceptableValueRange(1f, 120f), Array.Empty())); RockThrowProcChance = cfg.Bind("The Elder", "(Rock Throw) ProcChance", 70f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.ProcChance"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); RockThrowProjectilePrefab = cfg.Bind("The Elder", "(Rock Throw) Prefab", "troll_throw_projectile", LocalizationManager.Desc("Elder.RockThrow.Prefab")); RockThrowSpeed = cfg.Bind("The Elder", "(Rock Throw) Speed", 22f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.Speed"), (AcceptableValueBase)new AcceptableValueRange(5f, 80f), Array.Empty())); RockThrowArcHeight = cfg.Bind("The Elder", "(Rock Throw) ArcHeight", 6f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.ArcHeight"), (AcceptableValueBase)new AcceptableValueRange(0f, 30f), Array.Empty())); RockThrowDamageBlunt = cfg.Bind("The Elder", "(Rock Throw) DamageBlunt", 45f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.DamageBlunt"), (AcceptableValueBase)new AcceptableValueRange(0f, 500f), Array.Empty())); RockThrowStartDelay = cfg.Bind("The Elder", "(Rock Throw) StartDelay", 0.5f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.StartDelay"), (AcceptableValueBase)new AcceptableValueRange(0f, 3f), Array.Empty())); RockThrowDetectRange = cfg.Bind("The Elder", "(Rock Throw) DetectRange", 40f, new ConfigDescription(LocalizationManager.Desc("Elder.RockThrow.DetectRange"), (AcceptableValueBase)new AcceptableValueRange(5f, 100f), Array.Empty())); RockThrowSplashEnabled = cfg.Bind("The Elder", "(Rock Splash) Enabled", true, LocalizationManager.Desc("Elder.RockSplash.Enabled")); RockThrowSplashRadius = cfg.Bind("The Elder", "(Rock Splash) Radius", 6f, new ConfigDescription(LocalizationManager.Desc("Elder.RockSplash.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 30f), Array.Empty())); RockThrowSplashDamage = cfg.Bind("The Elder", "(Rock Splash) Damage", 40f, new ConfigDescription(LocalizationManager.Desc("Elder.RockSplash.Damage"), (AcceptableValueBase)new AcceptableValueRange(0f, 500f), Array.Empty())); RockThrowSplashVFX = cfg.Bind("The Elder", "(Rock Splash) VFX", "fx_rock_hit", LocalizationManager.Desc("Elder.RockSplash.VFX")); PhaseMessage = cfg.Bind("The Elder", "(Phase) Message", "", LocalizationManager.Desc("Elder.Phase.Message")); PhaseMessageHP = cfg.Bind("The Elder", "(Phase) MessageHP", 50f, new ConfigDescription(LocalizationManager.Desc("Elder.Phase.MessageHP"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); } } public static class YagluthConfig { public static ConfigEntry SkeletonEnabled { get; private set; } public static ConfigEntry SkeletonCount { get; private set; } public static ConfigEntry SkeletonLevel { get; private set; } public static ConfigEntry SkeletonHP1 { get; private set; } public static ConfigEntry SkeletonPrefab1 { get; private set; } public static ConfigEntry SkeletonHP2 { get; private set; } public static ConfigEntry SkeletonPrefab2 { get; private set; } public static ConfigEntry SkeletonHP3 { get; private set; } public static ConfigEntry SkeletonPrefab3 { get; private set; } public static ConfigEntry SkeletonVFX { get; private set; } public static ConfigEntry SkeletonPhaseMessage1 { get; private set; } public static ConfigEntry SkeletonPhaseMessage2 { get; private set; } public static ConfigEntry SkeletonPhaseMessage3 { get; private set; } public static ConfigEntry SkeletonDamageBlockEnabled { get; private set; } public static ConfigEntry SkeletonDamageBlockMessage { get; private set; } public static ConfigEntry MeteorFireEnabled { get; private set; } public static ConfigEntry MeteorFireHPThreshold { get; private set; } public static ConfigEntry MeteorFireDuration { get; private set; } public static ConfigEntry MeteorFireRadius { get; private set; } public static ConfigEntry MeteorFireDamagePerTick { get; private set; } public static ConfigEntry MeteorFireTickInterval { get; private set; } public static ConfigEntry MeteorFireVFX { get; private set; } public static ConfigEntry MeteorFireVFXScale { get; private set; } public static ConfigEntry MeteorFirePhaseMessage { get; private set; } public static ConfigEntry MeteorFireProjectileFilter { get; private set; } public static ConfigEntry DeathZoneEnabled { get; private set; } public static ConfigEntry DeathZoneHPThreshold { get; private set; } public static ConfigEntry DeathZoneHPDrainPercent { get; private set; } public static ConfigEntry DeathZoneRadius { get; private set; } public static ConfigEntry DeathZoneWarningMessage { get; private set; } public static ConfigEntry DeathZonePhaseMessage { get; private set; } public static ConfigEntry DeathZoneVFX { get; private set; } public static ConfigEntry DeathZoneVFXScale { get; private set; } public static ConfigEntry DeathZoneAnimSpeedScale { get; private set; } public static ConfigEntry DeathZoneAttackAnim { get; private set; } public static ConfigEntry RageEnabled { get; private set; } public static ConfigEntry RageHPThreshold { get; private set; } public static ConfigEntry RageMaxGauge { get; private set; } public static ConfigEntry RageDuration { get; private set; } public static ConfigEntry RageCooldown { get; private set; } public static ConfigEntry RageSpeedMult { get; private set; } public static ConfigEntry RageDamageMult { get; private set; } public static ConfigEntry RageVFX { get; private set; } public static ConfigEntry RagePhaseMessage { get; private set; } public static void Bind(ConfigFile cfg) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Expected O, but got Unknown //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Expected O, but got Unknown //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Expected O, but got Unknown //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Expected O, but got Unknown //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Expected O, but got Unknown //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Expected O, but got Unknown //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Expected O, but got Unknown //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Expected O, but got Unknown //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Expected O, but got Unknown //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Expected O, but got Unknown //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0459: Expected O, but got Unknown //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Expected O, but got Unknown //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_0503: Expected O, but got Unknown //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Expected O, but got Unknown //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Expected O, but got Unknown //IL_0540: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Expected O, but got Unknown //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Expected O, but got Unknown //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Expected O, but got Unknown //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Expected O, but got Unknown //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_063a: Expected O, but got Unknown //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Expected O, but got Unknown //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Expected O, but got Unknown //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Expected O, but got Unknown //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Expected O, but got Unknown //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Expected O, but got Unknown //IL_073a: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Expected O, but got Unknown //IL_0772: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Expected O, but got Unknown //IL_077c: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Expected O, but got Unknown //IL_07b4: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Expected O, but got Unknown //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Expected O, but got Unknown //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Expected O, but got Unknown //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_080a: Expected O, but got Unknown //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_0847: Expected O, but got Unknown //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Expected O, but got Unknown SkeletonEnabled = cfg.Bind("Yagluth", "(Skeleton Summon) Enabled", true, LocalizationManager.Desc("Yagluth.Skeleton.Enabled")); SkeletonCount = cfg.Bind("Yagluth", "(Skeleton Summon) Count", 3, new ConfigDescription(LocalizationManager.Desc("Yagluth.Skeleton.Count"), (AcceptableValueBase)new AcceptableValueRange(1, 20), Array.Empty())); SkeletonLevel = cfg.Bind("Yagluth", "(Skeleton Summon) Level", 1, new ConfigDescription(LocalizationManager.Desc("Yagluth.Skeleton.Level"), (AcceptableValueBase)new AcceptableValueRange(1, 5), Array.Empty())); SkeletonHP1 = cfg.Bind("Yagluth", "(Skeleton Summon) HP1", 75f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Skeleton.HP1"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); SkeletonPrefab1 = cfg.Bind("Yagluth", "(Skeleton Summon) Prefab1", "Skeleton", LocalizationManager.Desc("Yagluth.Skeleton.Prefab1")); SkeletonHP2 = cfg.Bind("Yagluth", "(Skeleton Summon) HP2", 50f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Skeleton.HP2"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); SkeletonPrefab2 = cfg.Bind("Yagluth", "(Skeleton Summon) Prefab2", "Skeleton", LocalizationManager.Desc("Yagluth.Skeleton.Prefab2")); SkeletonHP3 = cfg.Bind("Yagluth", "(Skeleton Summon) HP3", 25f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Skeleton.HP3"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); SkeletonPrefab3 = cfg.Bind("Yagluth", "(Skeleton Summon) Prefab3", "Skeleton", LocalizationManager.Desc("Yagluth.Skeleton.Prefab3")); SkeletonVFX = cfg.Bind("Yagluth", "(Skeleton Summon) VFX", "vfx_GodExplosion", LocalizationManager.Desc("Yagluth.Skeleton.VFX")); SkeletonPhaseMessage1 = cfg.Bind("Yagluth", "(Skeleton Summon) PhaseMessage1", "", LocalizationManager.Desc("Yagluth.Skeleton.PhaseMsg1")); SkeletonPhaseMessage2 = cfg.Bind("Yagluth", "(Skeleton Summon) PhaseMessage2", "", LocalizationManager.Desc("Yagluth.Skeleton.PhaseMsg2")); SkeletonPhaseMessage3 = cfg.Bind("Yagluth", "(Skeleton Summon) PhaseMessage3", "", LocalizationManager.Desc("Yagluth.Skeleton.PhaseMsg3")); SkeletonDamageBlockEnabled = cfg.Bind("Yagluth", "(Skeleton Summon) DamageBlockEnabled", true, LocalizationManager.Desc("Yagluth.Skeleton.DamageBlock")); SkeletonDamageBlockMessage = cfg.Bind("Yagluth", "(Skeleton Summon) DamageBlockMessage", "Defeat all Skeleton Warriors!", LocalizationManager.Desc("Yagluth.Skeleton.DamageBlockMsg")); MeteorFireEnabled = cfg.Bind("Yagluth", "(Meteor Fire) Enabled", true, LocalizationManager.Desc("Yagluth.MeteorFire.Enabled")); MeteorFireHPThreshold = cfg.Bind("Yagluth", "(Meteor Fire) HPThreshold", 100f, new ConfigDescription(LocalizationManager.Desc("Yagluth.MeteorFire.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); MeteorFireDuration = cfg.Bind("Yagluth", "(Meteor Fire) Duration", 15f, new ConfigDescription(LocalizationManager.Desc("Yagluth.MeteorFire.Duration"), (AcceptableValueBase)new AcceptableValueRange(1f, 120f), Array.Empty())); MeteorFireRadius = cfg.Bind("Yagluth", "(Meteor Fire) Radius", 5f, new ConfigDescription(LocalizationManager.Desc("Yagluth.MeteorFire.Radius"), (AcceptableValueBase)new AcceptableValueRange(1f, 50f), Array.Empty())); MeteorFireDamagePerTick = cfg.Bind("Yagluth", "(Meteor Fire) DamagePerTick", 20f, new ConfigDescription(LocalizationManager.Desc("Yagluth.MeteorFire.DamagePerTick"), (AcceptableValueBase)new AcceptableValueRange(1f, 500f), Array.Empty())); MeteorFireTickInterval = cfg.Bind("Yagluth", "(Meteor Fire) TickInterval", 1f, new ConfigDescription(LocalizationManager.Desc("Yagluth.MeteorFire.TickInterval"), (AcceptableValueBase)new AcceptableValueRange(0.5f, 10f), Array.Empty())); MeteorFireVFX = cfg.Bind("Yagluth", "(Meteor Fire) VFX", "", LocalizationManager.Desc("Yagluth.MeteorFire.VFX")); MeteorFireVFXScale = cfg.Bind("Yagluth", "(Meteor Fire) VFXScale", 1.5f, new ConfigDescription(LocalizationManager.Desc("Yagluth.MeteorFire.VFXScale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 20f), Array.Empty())); MeteorFirePhaseMessage = cfg.Bind("Yagluth", "(Meteor Fire) PhaseMessage", "", LocalizationManager.Desc("Yagluth.MeteorFire.PhaseMessage")); MeteorFireProjectileFilter = cfg.Bind("Yagluth", "(Meteor Fire) ProjectileFilter", "", LocalizationManager.Desc("Yagluth.MeteorFire.Filter")); DeathZoneEnabled = cfg.Bind("Yagluth", "(Death Zone) Enabled", true, LocalizationManager.Desc("Yagluth.DeathZone.Enabled")); DeathZoneHPThreshold = cfg.Bind("Yagluth", "(Death Zone) HPThreshold", 50f, new ConfigDescription(LocalizationManager.Desc("Yagluth.DeathZone.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); DeathZoneHPDrainPercent = cfg.Bind("Yagluth", "(Death Zone) HPDrainPercent", 50f, new ConfigDescription(LocalizationManager.Desc("Yagluth.DeathZone.HPDrain"), (AcceptableValueBase)new AcceptableValueRange(1f, 99f), Array.Empty())); DeathZoneRadius = cfg.Bind("Yagluth", "(Death Zone) Radius", 40f, new ConfigDescription(LocalizationManager.Desc("Yagluth.DeathZone.Radius"), (AcceptableValueBase)new AcceptableValueRange(5f, 200f), Array.Empty())); DeathZoneWarningMessage = cfg.Bind("Yagluth", "(Death Zone) WarningMessage", "The Death Zone spreads...", LocalizationManager.Desc("Yagluth.DeathZone.WarningMsg")); DeathZonePhaseMessage = cfg.Bind("Yagluth", "(Death Zone) PhaseMessage", "Yagluth's fury splits the earth!", LocalizationManager.Desc("Yagluth.DeathZone.PhaseMsg")); DeathZoneVFX = cfg.Bind("Yagluth", "(Death Zone) VFX", "vfx_GodExplosion", LocalizationManager.Desc("Yagluth.DeathZone.VFX")); DeathZoneVFXScale = cfg.Bind("Yagluth", "(Death Zone) VFXScale", 4f, new ConfigDescription(LocalizationManager.Desc("Yagluth.DeathZone.VFXScale"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 20f), Array.Empty())); DeathZoneAnimSpeedScale = cfg.Bind("Yagluth", "(Death Zone) AnimSpeedScale", 0.4f, new ConfigDescription(LocalizationManager.Desc("Yagluth.DeathZone.AnimSpeed"), (AcceptableValueBase)new AcceptableValueRange(0.1f, 2f), Array.Empty())); DeathZoneAttackAnim = cfg.Bind("Yagluth", "(Death Zone) AttackAnim", "nova", LocalizationManager.Desc("Yagluth.DeathZone.AttackAnim")); RageEnabled = cfg.Bind("Yagluth", "(Rage) Enabled", true, LocalizationManager.Desc("Yagluth.Rage.Enabled")); RageHPThreshold = cfg.Bind("Yagluth", "(Rage) HPThreshold", 100f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Rage.HPThreshold"), (AcceptableValueBase)new AcceptableValueRange(1f, 100f), Array.Empty())); RageMaxGauge = cfg.Bind("Yagluth", "(Rage) MaxGauge", 500f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Rage.MaxGauge"), (AcceptableValueBase)new AcceptableValueRange(50f, 5000f), Array.Empty())); RageDuration = cfg.Bind("Yagluth", "(Rage) Duration", 15f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Rage.Duration"), (AcceptableValueBase)new AcceptableValueRange(3f, 120f), Array.Empty())); RageCooldown = cfg.Bind("Yagluth", "(Rage) Cooldown", 30f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Rage.Cooldown"), (AcceptableValueBase)new AcceptableValueRange(5f, 300f), Array.Empty())); RageSpeedMult = cfg.Bind("Yagluth", "(Rage) SpeedMult", 1.5f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Rage.SpeedMult"), (AcceptableValueBase)new AcceptableValueRange(1f, 5f), Array.Empty())); RageDamageMult = cfg.Bind("Yagluth", "(Rage) DamageMult", 1.5f, new ConfigDescription(LocalizationManager.Desc("Yagluth.Rage.DamageMult"), (AcceptableValueBase)new AcceptableValueRange(1f, 5f), Array.Empty())); RageVFX = cfg.Bind("Yagluth", "(Rage) VFX", "vfx_GodExplosion", LocalizationManager.Desc("Yagluth.Rage.VFX")); RagePhaseMessage = cfg.Bind("Yagluth", "(Rage) PhaseMessage", "", LocalizationManager.Desc("Yagluth.Rage.PhaseMessage")); } } } namespace bossadd.Patches { internal static class BonemassBonusSpawnHandler { private const float DetectRange = 40f; public static void TrySpawn(Character bonemass) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_015f: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown //IL_0166: Unknown result type (might be due to invalid IL or missing references) if (!BonemassConfig.BonusSpawnEnabled.Value || (Object)bonemass == (Object)null || (Object)ZNetScene.instance == (Object)null) { return; } float maxHealth = bonemass.GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = bonemass.GetHealth() / maxHealth * 100f; if (num > BonemassConfig.BonusSpawnHealthThreshold.Value || Random.value * 100f > BonemassConfig.BonusSpawnChance.Value) { return; } Player nearestPlayer = GetNearestPlayer(((Component)bonemass).transform.position, 40f); if ((Object)nearestPlayer == (Object)null) { return; } string value = BonemassConfig.BonusSpawnPrefab.Value; GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[Bonemass:추가소환] '" + value + "' 프리팹 없음 — Config의 BonusSpawnPrefab 이름을 확인하세요")); return; } int value2 = BonemassConfig.BonusSpawnCount.Value; Vector3 position = ((Component)nearestPlayer).transform.position; float num2 = 0f; for (int i = 0; i < value2; i++) { float num3 = Random.Range(0f, 360f) * ((float)Math.PI / 180f); float num4 = Random.Range(2f, 5f); Vector3 val = position + new Vector3(Mathf.Sin(num3) * num4, 0.5f, Mathf.Cos(num3) * num4); if ((Object)ZoneSystem.instance != (Object)null) { ZoneSystem.instance.GetSolidHeight(val, ref num2, 1000); if (num2 > float.MinValue) { val.y = num2 + 0.5f; } } GameObject val2 = Object.Instantiate(prefab, val, Quaternion.identity); if ((Object)val2 != (Object)null) { val2.SetActive(true); } } Plugin.Log.LogInfo((object)($"[Bonemass:추가소환] '{value}' {value2}마리 소환 " + $"(HP {num:F0}% / 확률 {BonemassConfig.BonusSpawnChance.Value:F0}%)")); } private static Player GetNearestPlayer(Vector3 origin, float maxRange) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Player result = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(((Component)allPlayer).transform.position, origin); if (!(num2 > maxRange) && !(num2 >= num)) { num = num2; result = allPlayer; } } } return result; } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class BonemassKillConditionPatch { [HarmonyPrefix] public static bool Prefix(Character __instance) { if (!BonemassConfig.KillConditionEnabled.Value) { return true; } if (!__instance.IsOwner()) { return true; } if (Utils.GetPrefabName(((Component)__instance).gameObject) != "Bonemass") { return true; } if (MiniBonemassKillTracker.CanBossDie()) { return true; } __instance.SetHealth(1f); BonemassSplitDeathCleanupPatch.MarkBossBlocked(((Object)((Component)__instance).gameObject).GetInstanceID()); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)2, "분열된 본매스를 모두 처치하라!", 0, (Sprite)null); } Plugin.Log.LogInfo((object)"[Bonemass:처치조건] 미니 생존 → 본매스 사망 차단"); return false; } } [HarmonyPatch(typeof(Projectile), "Setup")] public static class BonemassProjectileSetupPatch { [HarmonyPostfix] public static void Postfix(Character owner) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown if (!((Object)owner == (Object)null) && !(Utils.GetPrefabName(((Component)owner).gameObject) != "Bonemass")) { BonemassBonusSpawnHandler.TrySpawn(owner); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class BonemassSplitDeathCleanupPatch { private static readonly HashSet s_bossBlockedIds = new HashSet(); public static void MarkBossBlocked(int goId) { s_bossBlockedIds.Add(goId); } [HarmonyPostfix] public static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "Bonemass") && !s_bossBlockedIds.Remove(((Object)((Component)__instance).gameObject).GetInstanceID())) { BonemassSplitState.Remove(((Object)((Component)__instance).gameObject).GetInstanceID()); MiniBonemassKillTracker.Reset(); Plugin.Log.LogInfo((object)"[Bonemass:분열] 원본 본매스 사망 → 분열 데이터 초기화"); ((MonoBehaviour)Plugin.Instance).StartCoroutine(DespawnAfterFrames()); } } private static IEnumerator DespawnAfterFrames() { yield return null; yield return null; DespawnAllMinis(); } private static void DespawnAllMinis() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown if ((Object)ZNetScene.instance == (Object)null) { return; } int num = 0; foreach (Character item in new List(Character.GetAllCharacters())) { if (!((Object)item == (Object)null) && !item.IsDead() && MiniBonemassVariants.IsMini(Utils.GetPrefabName(((Component)item).gameObject))) { ZNetView component = ((Component)item).GetComponent(); if ((Object)component != (Object)null && component.IsValid()) { ZNetScene.instance.Destroy(((Component)item).gameObject); } else { Object.Destroy((Object)((Component)item).gameObject); } num++; } } if (num > 0) { Plugin.Log.LogInfo((object)$"[Bonemass:분열] MiniBonemass {num}마리 제거 (원본 사망)"); } } } internal static class BonemassSplitState { private static readonly HashSet s_triggered = new HashSet(); public static bool HasTriggered(int id) { return s_triggered.Contains(id); } public static void SetTriggered(int id) { s_triggered.Add(id); } public static void Remove(int id) { s_triggered.Remove(id); } } [HarmonyPatch(typeof(Character), "Damage")] public static class BonemassSplitTriggerPatch { private static readonly MethodInfo s_setTargetMethod = AccessTools.Method(typeof(MonsterAI), "SetTarget", new Type[1] { typeof(Character) }, (Type[])null); [HarmonyPostfix] public static void Postfix(Character __instance) { if (!BonemassConfig.SplitEnabled.Value || !__instance.IsOwner() || __instance.IsDead() || Utils.GetPrefabName(((Component)__instance).gameObject) != "Bonemass") { return; } int instanceID = ((Object)((Component)__instance).gameObject).GetInstanceID(); if (BonemassSplitState.HasTriggered(instanceID)) { return; } float maxHealth = __instance.GetMaxHealth(); if (!(maxHealth <= 0f)) { float num = __instance.GetHealth() / maxHealth * 100f; if (!(num > BonemassConfig.SplitHealthThreshold.Value)) { BonemassSplitState.SetTriggered(instanceID); MiniBonemassKillTracker.OnSplitFired(5); Plugin.Log.LogInfo((object)($"[Bonemass:분열] HP {num:F1}% → " + "5색 MiniBonemass 소환 발동!")); ((MonoBehaviour)Plugin.Instance).StartCoroutine(SpawnAllVariants(__instance)); } } } private static void SetMiniTarget(GameObject mini, Vector3 spawnPos) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (s_setTargetMethod == null) { return; } MonsterAI component = mini.GetComponent(); if ((Object)component == (Object)null) { return; } Player val = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(spawnPos, ((Component)allPlayer).transform.position); if (num2 < num) { num = num2; val = allPlayer; } } } if ((Object)val != (Object)null) { s_setTargetMethod.Invoke(component, new object[1] { val }); Plugin.Log.LogDebug((object)$"[Bonemass:분열] {((Object)mini).name} → 타겟: {val.GetPlayerName()} ({num:F1}m)"); } } private static IEnumerator SpawnAllVariants(Character boss) { if ((Object)ZNetScene.instance == (Object)null) { yield break; } Vector3 position = ((Component)boss).transform.position; float num3 = default(float); for (int i = 0; i < 5; i++) { if ((Object)boss == (Object)null) { break; } if (boss.IsDead()) { break; } string text = MiniBonemassVariants.Names[i]; GameObject prefab = ZNetScene.instance.GetPrefab(text); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)("[Bonemass:분열] '" + text + "' 프리팹 없음 — MonsterDB 등록 여부 확인")); MiniBonemassKillTracker.OnMiniDied(); continue; } float num = 72f * (float)i; float num2 = num * ((float)Math.PI / 180f); Vector3 val = position + new Vector3(Mathf.Sin(num2) * 5f, 0.5f, Mathf.Cos(num2) * 5f); if ((Object)ZoneSystem.instance != (Object)null) { ZoneSystem.instance.GetSolidHeight(val, ref num3, 1000); if (num3 > float.MinValue) { val.y = num3 + 0.5f; } } GameObject val2 = Object.Instantiate(prefab, val, Quaternion.identity); if (!((Object)val2 == (Object)null)) { val2.SetActive(true); SetMiniTarget(val2, val); Plugin.Log.LogInfo((object)$"[Bonemass:분열] {text} 소환 ({i + 1}/{5})"); yield return (object)new WaitForSeconds(0.1f); } else { MiniBonemassKillTracker.OnMiniDied(); } } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class BossDeathResetPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { string prefabName = Utils.GetPrefabName(((Component)__instance).gameObject); if (BossSummonConfig.All.ContainsKey(prefabName)) { BossSummonState.Remove(((Object)__instance).GetInstanceID()); Plugin.Log.LogInfo((object)("[BossSummon:" + prefabName + "] 사망 → 소환 데이터 초기화")); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class BossHealthSummonPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!BossSummonHelper.TryGetConfig(__instance, out var cfg) || cfg.TriggerMode.Value == SummonTriggerMode.Timer) { return; } float maxHealth = __instance.GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = __instance.GetHealth() / maxHealth; int value = cfg.HealthStepCount.Value; int num2 = Mathf.FloorToInt(num * (float)value); if (num2 < value) { BossSummonTracker orCreate = BossSummonState.GetOrCreate(((Object)__instance).GetInstanceID()); if (!orCreate.TriggeredSteps.Contains(num2)) { orCreate.TriggeredSteps.Add(num2); float num3 = (float)num2 / (float)value * 100f; BossSummonHelper.Summon(__instance, cfg, $"체력 ~{num3:F0}% 단계"); } } } } internal static class BossPhaseMessageHandler { private const float TickInterval = 0.5f; private static float s_nextTick = 0f; private static readonly HashSet s_messageSent = new HashSet(); private static readonly (string prefab, Func msg, Func hp)[] s_bosses = new(string, Func, Func)[4] { ("Eikthyr", () => EikthyrSummonConfig.PhaseMessage.Value, () => EikthyrSummonConfig.PhaseMessageHP.Value), ("Bonemass", () => BonemassConfig.PhaseMessage.Value, () => BonemassConfig.PhaseMessageHP.Value), ("TheElder", () => TheElderConfig.PhaseMessage.Value, () => TheElderConfig.PhaseMessageHP.Value), ("Dragon", () => ModerConfig.AirBreathPhaseMessage.Value, () => ModerConfig.AirBreathPhaseMessageHP.Value) }; public static void Tick() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown if (Time.time < s_nextTick) { return; } s_nextTick = Time.time + 0.5f; (string, Func, Func)[] array = s_bosses; for (int i = 0; i < array.Length; i++) { (string, Func, Func) tuple = array[i]; string item = tuple.Item1; Func item2 = tuple.Item2; Func item3 = tuple.Item3; string text = item2(); if (string.IsNullOrEmpty(text)) { continue; } float num = item3(); foreach (Character allCharacter in Character.GetAllCharacters()) { if ((Object)allCharacter == (Object)null || Utils.GetPrefabName(((Component)allCharacter).gameObject) != item) { continue; } int instanceID = ((Object)((Component)allCharacter).gameObject).GetInstanceID(); float maxHealth = allCharacter.GetMaxHealth(); if (maxHealth <= 0f) { continue; } if (allCharacter.IsDead()) { s_messageSent.Remove(instanceID); continue; } float num2 = allCharacter.GetHealth() / maxHealth * 100f; if (s_messageSent.Contains(instanceID) && num2 > num) { s_messageSent.Remove(instanceID); } if (!s_messageSent.Contains(instanceID) && num2 <= num) { s_messageSent.Add(instanceID); MessageHud instance = MessageHud.instance; if ((Object)(object)instance != (Object)null) { instance.ShowMessage((MessageType)2, text, 0, (Sprite)null, false); } Plugin.Log.LogInfo((object)$"[{item}:PhaseMessage] '{text}' (체력 {num2:F1}%)"); } } } } } [HarmonyPatch(typeof(Character), "Damage")] public static class BossSpecialSummonPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!BossSummonHelper.TryGetConfig(__instance, out var cfg) || !cfg.SpecialSummonEnabled.Value) { return; } BossSummonTracker orCreate = BossSummonState.GetOrCreate(((Object)__instance).GetInstanceID()); if (orCreate.SpecialTriggered) { return; } float maxHealth = __instance.GetMaxHealth(); if (!(maxHealth <= 0f)) { float num = __instance.GetHealth() / maxHealth * 100f; if (!(num > cfg.SpecialSummonHealthThreshold.Value)) { orCreate.SpecialTriggered = true; Plugin.Log.LogInfo((object)$"[BossSummon:{cfg.DisplayName}] 스페셜 소환 발동! 체력 {num:F1}%"); BossSummonHelper.SpecialSummon(__instance, cfg); } } } } [HarmonyPatch(typeof(Character), "Awake")] public static class BossStatCharacterPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (__instance.IsPlayer()) { return; } string prefabName = Utils.GetPrefabName(((Component)__instance).gameObject); if (!BossStatConfig.All.TryGetValue(prefabName, out var value)) { return; } float value2 = value.HealthMultiplier.Value; if (!Mathf.Approximately(value2, 1f)) { float maxHealth = __instance.GetMaxHealth(); float num = maxHealth * value2; float health = __instance.GetHealth(); __instance.SetMaxHealth(num); if (Mathf.Approximately(health, maxHealth)) { __instance.SetHealth(num); } Plugin.Log.LogInfo((object)$"[BossStat:{value.DisplayName}] 체력 {maxHealth:F0} → {num:F0} (x{value2:F2})"); } float value3 = value.MoveSpeedMultiplier.Value; if (!Mathf.Approximately(value3, 1f)) { float walkSpeed = __instance.m_walkSpeed; float runSpeed = __instance.m_runSpeed; __instance.m_walkSpeed *= value3; __instance.m_runSpeed *= value3; __instance.m_swimSpeed *= value3; Plugin.Log.LogInfo((object)($"[BossStat:{value.DisplayName}] 이동속도 걷기 {walkSpeed:F1}→{__instance.m_walkSpeed:F1} " + $"달리기 {runSpeed:F1}→{__instance.m_runSpeed:F1} (x{value3:F2})")); } } } [HarmonyPatch(typeof(MonsterAI), "Awake")] public static class BossStatMonsterAIPatch { [HarmonyPostfix] public static void Postfix(MonsterAI __instance) { string prefabName = Utils.GetPrefabName(((Component)__instance).gameObject); if (BossStatConfig.All.TryGetValue(prefabName, out var value)) { float value2 = value.AttackSpeedMultiplier.Value; if (!Mathf.Approximately(value2, 1f) && !(__instance.m_minAttackInterval <= 0f)) { float minAttackInterval = __instance.m_minAttackInterval; __instance.m_minAttackInterval = minAttackInterval / value2; Plugin.Log.LogInfo((object)($"[BossStat:{value.DisplayName}] 공격 간격 {minAttackInterval:F2}s → {__instance.m_minAttackInterval:F2}s " + $"(x{value2:F2} 빈도)")); } } } } internal static class BossSummonHelper { private const float NearRadius = 50f; public static bool TryGetConfig(Character c, out BossConfig cfg) { cfg = null; if (!c.IsOwner() || c.IsDead()) { return false; } string prefabName = Utils.GetPrefabName(((Component)c).gameObject); if (BossSummonConfig.All.TryGetValue(prefabName, out cfg)) { return cfg.Enabled.Value; } return false; } public static void Summon(Character boss, BossConfig cfg, string reason) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) if ((Object)ZNetScene.instance == (Object)null) { return; } string value = cfg.SummonPrefab.Value; int num = Mathf.Max(1, cfg.SummonCount.Value); int num2 = Mathf.Clamp(cfg.SummonLevel.Value, 1, 5); int num3 = Mathf.Max(1, cfg.MaxTotalSummons.Value); int num4 = CountNearby(((Component)boss).transform.position, value, 50f); if (num4 >= num3) { Plugin.Log.LogInfo((object)$"[BossSummon:{cfg.DisplayName}] 생략 - 최대 수 초과 ({num4}/{num3})"); return; } int num5 = Mathf.Min(num, num3 - num4); GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)("[BossSummon:" + cfg.DisplayName + "] 프리팹 '" + value + "' 없음")); return; } Vector3 position = ((Component)boss).transform.position; Vector3 val = default(Vector3); for (int i = 0; i < num5; i++) { float num6 = ((num5 > 1) ? (360f / (float)num5 * (float)i) : 0f) * ((float)Math.PI / 180f); ((Vector3)(ref val))..ctor(Mathf.Sin(num6) * 5f, 0f, Mathf.Cos(num6) * 5f); SpawnMonster(prefab, position + val, num2, cfg.UseCLLC.Value); } Plugin.Log.LogInfo((object)$"[BossSummon:{cfg.DisplayName}] {value} x{num5} (Lv.{num2}) [{reason}]"); } public static void SpecialSummon(Character boss, BossConfig cfg) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) if ((Object)ZNetScene.instance == (Object)null) { return; } string value = cfg.SpecialSummonPrefab.Value; int num = Mathf.Max(1, cfg.SpecialSummonCount.Value); int num2 = Mathf.Clamp(cfg.SpecialSummonLevel.Value, 1, 5); string value2 = cfg.SpecialSummonVfxPrefab.Value; if (!string.IsNullOrEmpty(value2)) { GameObject prefab = ZNetScene.instance.GetPrefab(value2); if ((Object)prefab != (Object)null) { Object.Destroy((Object)Object.Instantiate(prefab, ((Component)boss).transform.position, Quaternion.identity), 5f); } else { Plugin.Log.LogWarning((object)("[BossSummon:" + cfg.DisplayName + "] 스페셜 VFX '" + value2 + "' 없음")); } } GameObject prefab2 = ZNetScene.instance.GetPrefab(value); if ((Object)prefab2 == (Object)null) { Plugin.Log.LogError((object)("[BossSummon:" + cfg.DisplayName + "] 스페셜 프리팹 '" + value + "' 없음")); return; } Vector3 position = ((Component)boss).transform.position; Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { float num3 = ((num > 1) ? (360f / (float)num * (float)i) : 0f) * ((float)Math.PI / 180f); ((Vector3)(ref val))..ctor(Mathf.Sin(num3) * 6f, 0f, Mathf.Cos(num3) * 6f); SpawnMonster(prefab2, position + val, num2, cfg.UseCLLC.Value); } Plugin.Log.LogInfo((object)$"[BossSummon:{cfg.DisplayName}] 스페셜 소환! {value} x{num} (Lv.{num2})"); } private static void SpawnMonster(GameObject prefab, Vector3 pos, int level, bool useCLLC) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown GameObject val = Object.Instantiate(prefab, pos, Quaternion.identity); if ((Object)val == (Object)null) { return; } Character component = val.GetComponent(); if (!((Object)component == (Object)null)) { if (useCLLC) { ApplyCLLCLevel(val, component, level); } else { component.SetLevel(level); } } } private static void ApplyCLLCLevel(GameObject obj, Character c, int level) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Component component = obj.GetComponent("CreatureLevel"); if ((Object)component != (Object)null) { PropertyInfo property = ((object)component).GetType().GetProperty("Level"); if (property != null) { property.SetValue(component, level); return; } } c.SetLevel(level); } private static int CountNearby(Vector3 center, string prefabName, float radius) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (Character item in new List(Character.GetAllCharacters())) { if (!((Object)item == (Object)null) && !item.IsDead() && !(Utils.GetPrefabName(((Component)item).gameObject) != prefabName) && Vector3.Distance(((Component)item).transform.position, center) <= radius) { num++; } } return num; } } internal static class BossSummonState { private static readonly Dictionary s_map = new Dictionary(); public static BossSummonTracker GetOrCreate(int id) { if (!s_map.TryGetValue(id, out var value)) { return s_map[id] = new BossSummonTracker(); } return value; } public static void Remove(int id) { s_map.Remove(id); } } internal class BossSummonTracker { public readonly HashSet TriggeredSteps = new HashSet(); public float LastTimerSummon; public bool TimerInitialized; public bool SpecialTriggered; } public static class BossTimerSummonHandler { public static void Tick() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown foreach (KeyValuePair item in BossSummonConfig.All) { BossConfig value = item.Value; if (!value.Enabled.Value || value.TriggerMode.Value == SummonTriggerMode.Health) { continue; } foreach (Character item2 in new List(Character.GetAllCharacters())) { if (!((Object)item2 == (Object)null) && !item2.IsDead() && item2.IsOwner() && !(Utils.GetPrefabName(((Component)item2).gameObject) != value.PrefabName)) { BossSummonTracker orCreate = BossSummonState.GetOrCreate(((Object)item2).GetInstanceID()); float time = Time.time; float value2 = value.TimerInterval.Value; if (!orCreate.TimerInitialized) { orCreate.TimerInitialized = true; orCreate.LastTimerSummon = time; } else if (!(time - orCreate.LastTimerSummon < value2)) { orCreate.LastTimerSummon = time; BossSummonHelper.Summon(item2, value, $"타이머 {value2}초"); } } } } } } [HarmonyPatch(typeof(Character), "CustomFixedUpdate")] public static class DragonFlyingStateSnapshot { internal static readonly Dictionary s_prevFlying = new Dictionary(); private static readonly Dictionary s_lastLandTime = new Dictionary(); [HarmonyPostfix] private static void Postfix(Character __instance) { if (Utils.GetPrefabName(((Component)__instance).gameObject) != "Dragon") { return; } int instanceID = ((Object)((Component)__instance).gameObject).GetInstanceID(); bool flag = __instance.IsFlying(); if (s_prevFlying.TryGetValue(instanceID, out var value) && value && !flag) { float value2 = ModerConfig.LandBlastDelay.Value; if (value2 > 0f) { ((MonoBehaviour)Plugin.Instance).StartCoroutine(DelayedTrigger(__instance, value2)); } else { TriggerLandBlast(__instance); } } s_prevFlying[instanceID] = flag; } private static IEnumerator DelayedTrigger(Character dragon, float delay) { yield return (object)new WaitForSeconds(delay); TriggerLandBlast(dragon); } private static void TriggerLandBlast(Character dragon) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_0146: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) if (!ModerConfig.LandBlastEnabled.Value || !dragon.IsOwner()) { return; } int instanceID = ((Object)((Component)dragon).gameObject).GetInstanceID(); float time = Time.time; if (s_lastLandTime.TryGetValue(instanceID, out var value) && time - value < ModerConfig.LandBlastCooldown.Value) { return; } s_lastLandTime[instanceID] = time; Vector3 position = ((Component)dragon).transform.position; float value2 = ModerConfig.LandBlastRadius.Value; float value3 = ModerConfig.LandBlastPushForce.Value; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead() && !(Vector3.Distance(position, ((Component)allPlayer).transform.position) > value2)) { Vector3 val = ((Component)allPlayer).transform.position - position; val.y = 0f; ((Vector3)(ref val)).Normalize(); Rigidbody component = ((Component)allPlayer).GetComponent(); if ((Object)component != (Object)null) { Vector3 val2 = val * value3; val2.y += ModerConfig.LandBlastPushForceY.Value; component.AddForce(val2, (ForceMode)2); } } } SpawnVFX(position); PlaySFX(position); Plugin.Log.LogInfo((object)$"[ModerLanding] 착지 풍압 발동 (반경={value2}m, 힘={value3})"); } private static void SpawnVFX(Vector3 pos) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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) string value = ModerConfig.LandBlastVFX.Value; if (string.IsNullOrEmpty(value) || (Object)ZNetScene.instance == (Object)null) { return; } GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[ModerLanding] VFX 없음: " + value)); return; } GameObject val = Object.Instantiate(prefab, pos, Quaternion.identity); float value2 = ModerConfig.LandBlastVFXScale.Value; if (value2 > 0f && !Mathf.Approximately(value2, 1f)) { Transform transform = val.transform; transform.localScale *= value2; } } private static void PlaySFX(Vector3 pos) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) string value = ModerConfig.LandBlastSFX.Value; if (!string.IsNullOrEmpty(value) && !((Object)ZNetScene.instance == (Object)null)) { GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[ModerLanding] SFX 없음: " + value)); } else { Object.Instantiate(prefab, pos, Quaternion.identity); } } } } [HarmonyPatch(typeof(ZNetScene), "Awake")] public static class DragonIcePrefabCleanupPatch { [HarmonyPostfix] [HarmonyPriority(100)] public static void Postfix(ZNetScene __instance) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown GameObject prefab = __instance.GetPrefab("dragon_ice_projectile"); if ((Object)prefab == (Object)null) { return; } Projectile component = prefab.GetComponent(); if ((Object)component != (Object)null && (Object)component.m_spawnOnHit != (Object)null && ((Object)component.m_spawnOnHit).name.Contains("eikthyr")) { Plugin.Log.LogInfo((object)("[Dragon:얼음파편] spawnOnHit 제거: " + ((Object)component.m_spawnOnHit).name)); component.m_spawnOnHit = null; } Component[] components = prefab.GetComponents(); foreach (Component val in components) { string name = ((object)val).GetType().Name; if (name.Contains("Lightning") || name.Contains("Impact")) { Plugin.Log.LogInfo((object)("[Dragon:얼음파편] 번개 컴포넌트 제거: " + name)); Object.Destroy((Object)val); } } } } [HarmonyPatch(typeof(Projectile), "Setup")] public static class DragonIceProjectileBreathTrigger { [HarmonyPostfix] private static void Postfix(Projectile __instance, Character owner) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown if (!((Object)owner == (Object)null) && !(Utils.GetPrefabName(((Component)owner).gameObject) != "Dragon")) { ModerAirBreathHandler.FireBreath(owner); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class EikthyrDeathResetPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "Eikthyr")) { EikthyrSummonState.Remove(((Object)__instance).GetInstanceID()); Plugin.Log.LogInfo((object)"[EikthyrSummon] 에이크쉬르 사망 → 소환 데이터 초기화 (재도전 가능)"); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class EikthyrHealthSummonPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if (!EikthyrSummonHelper.ShouldProcess(__instance) || !EikthyrSummonConfig.Enabled.Value || Plugin.SummonBlocked || EikthyrSummonConfig.TriggerMode.Value == SummonTriggerMode.Timer || (Object)Player.m_localPlayer == (Object)null || ((Character)Player.m_localPlayer).IsDead()) { return; } float maxHealth = __instance.GetMaxHealth(); if (maxHealth <= 0f) { return; } EikthyrSummonTracker orCreate = EikthyrSummonState.GetOrCreate(((Object)__instance).GetInstanceID()); if (!(Time.time - orCreate.SpawnTime < 3f)) { float num = __instance.GetHealth() / maxHealth; int value = EikthyrSummonConfig.HealthStepCount.Value; int num2 = Mathf.FloorToInt(num * (float)value); if (num2 < value && !orCreate.TriggeredSteps.Contains(num2)) { orCreate.TriggeredSteps.Add(num2); float num3 = (float)num2 / (float)value * 100f; Plugin.Log.LogInfo((object)$"[EikthyrSummon] 체력 단계 트리거: {num:P0} → 단계 {num2}/{value}"); EikthyrSummonHelper.TrySummon(__instance, $"체력 ~{num3:F0}% 단계"); } } } } [HarmonyPatch(typeof(Attack), "DoMeleeAttack")] public static class EikthyrHornLaunchPatch { private static readonly FieldInfo s_mCharacter = AccessTools.Field(typeof(Attack), "m_character"); private static readonly MethodInfo s_forceJumpMethod = typeof(Character).GetMethod("ForceJump", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[2] { typeof(Vector3), typeof(bool) }, null); [HarmonyPostfix] public static void Postfix(Attack __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Expected O, but got Unknown //IL_0279: 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_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) if (!EikthyrSummonConfig.HornLaunchEnabled.Value) { return; } object value = s_mCharacter.GetValue(__instance); Humanoid val = (Humanoid)((value is Humanoid) ? value : null); if ((Object)val == (Object)null || !((Character)val).IsOwner() || ((Character)val).IsDead() || Utils.GetPrefabName(((Component)val).gameObject) != "Eikthyr") { return; } string text = __instance.m_attackAnimation?.ToLower() ?? ""; string text2 = EikthyrSummonConfig.HornLaunchAnimName.Value?.ToLower() ?? ""; Plugin.Log.LogInfo((object)("[HornLaunch] anim='" + text + "' trigger='" + text2 + "'")); if (!string.IsNullOrEmpty(text2) && !text.Contains(text2)) { return; } float maxHealth = ((Character)val).GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = ((Character)val).GetHealth() / maxHealth * 100f; if (num > EikthyrSummonConfig.HornLaunchHealthThreshold.Value || Random.value * 100f > EikthyrSummonConfig.HornLaunchProcChance.Value) { return; } float value2 = EikthyrSummonConfig.HornLaunchRange.Value; float value3 = EikthyrSummonConfig.HornLaunchHorizontalForce.Value; float value4 = EikthyrSummonConfig.HornLaunchVerticalForce.Value; Vector3 position = ((Component)val).transform.position; int num2 = 0; bool value5 = EikthyrSummonConfig.HornLaunchAffectsBlocking.Value; foreach (Player allPlayer in Player.GetAllPlayers()) { if ((Object)allPlayer == (Object)null || ((Character)allPlayer).IsDead() || Vector3.Distance(((Component)allPlayer).transform.position, position) > value2) { continue; } if (!value5 && ((Character)allPlayer).IsBlocking()) { Plugin.Log.LogInfo((object)("[HornLaunch] '" + allPlayer.GetPlayerName() + "' 블록/패링 중 — 발사 스킵")); continue; } Vector3 val2 = ((Component)allPlayer).transform.position - position; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.001f) { val2 = ((Component)val).transform.forward; } ((Vector3)(ref val2)).Normalize(); Vector3 val3 = val2 * value3 + Vector3.up * value4; ApplyLaunch((Character)allPlayer, val3); Plugin.Log.LogInfo((object)("[HornLaunch] '" + allPlayer.GetPlayerName() + "' 발사! " + $"vel=({val3.x:F1}, {val3.y:F1}, {val3.z:F1})")); num2++; } if (num2 > 0) { Plugin.Log.LogInfo((object)$"[HornLaunch] 총 {num2}명 발사 완료 (체력 {num:F0}%)"); } } private static void ApplyLaunch(Character target, Vector3 velocity) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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) if (s_forceJumpMethod != null) { s_forceJumpMethod.Invoke(target, new object[2] { velocity, true }); } else { Plugin.Log.LogWarning((object)"[HornLaunch] ForceJump 메서드를 찾을 수 없어 Pushback으로 대체"); Vector3 val = velocity; val.y = 0f; target.ApplyPushback(((Vector3)(ref val)).normalized, ((Vector3)(ref val)).magnitude); } } } public static class EikthyrLightningSequence { private const float LightningDelay = 0.3f; private const float BossRange = 50f; private static readonly List s_active = new List(); public static void Track(Coroutine co) { if (co != null) { s_active.Add(co); } } public static void CancelAll() { foreach (Coroutine item in s_active) { if (item != null) { ((MonoBehaviour)Plugin.Instance).StopCoroutine(item); } } if (s_active.Count > 0) { Plugin.Log.LogInfo((object)$"[Phase2] 코루틴 취소 {s_active.Count}개 (사망 또는 리스폰)"); } s_active.Clear(); } public static IEnumerator Execute(Humanoid boss) { float value = EikthyrSummonConfig.LightningStartDelay.Value; if (value > 0f) { yield return (object)new WaitForSeconds(value); } List playersInRange = GetPlayersInRange(((Component)boss).transform.position, 50f); if (playersInRange.Count == 0) { yield break; } int value2 = EikthyrSummonConfig.LightningCount.Value; for (int i = 0; i < value2; i++) { Player val = PickAliveTarget(playersInRange); if (!((Object)val == (Object)null)) { Vector3 position = ((Component)val).transform.position; SpawnVfx(lifetime: EikthyrSummonConfig.FirePatchEnabled.Value ? EikthyrSummonConfig.FirePatchDuration.Value : 3f, prefabName: EikthyrSummonConfig.LightningVfxPrefab.Value, pos: position); ApplyLightningDamage((Character)val, position); if (EikthyrSummonConfig.FirePatchEnabled.Value) { Coroutine item = ((MonoBehaviour)Plugin.Instance).StartCoroutine(FirePatchRoutine(position)); s_active.Add(item); } Plugin.Log.LogInfo((object)$"[Phase2] 번개 #{i + 1}/{value2} → {val.GetPlayerName()} 위치"); yield return (object)new WaitForSeconds(0.3f); continue; } break; } } private static List GetPlayersInRange(Vector3 center, float radius) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) float value = EikthyrSummonConfig.LightningSafeZoneRadius.Value; List list = new List(); foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num = Vector3.Distance(((Component)allPlayer).transform.position, center); if (!(num > radius) && (!(value > 0f) || !(num <= value))) { list.Add(allPlayer); } } } return list; } private static Player PickAliveTarget(List players) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown List list = new List(); foreach (Player player in players) { if ((Object)player != (Object)null && !((Character)player).IsDead()) { list.Add(player); } } if (list.Count == 0) { return null; } return list[Random.Range(0, list.Count)]; } private static void ApplyLightningDamage(Character target, Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) HitData val = new HitData(); val.m_damage.m_blunt = EikthyrSummonConfig.LightningDamageBlunt.Value; val.m_damage.m_slash = EikthyrSummonConfig.LightningDamageSlash.Value; val.m_damage.m_pierce = EikthyrSummonConfig.LightningDamagePierce.Value; val.m_damage.m_lightning = EikthyrSummonConfig.LightningDamageLightning.Value; val.m_point = pos; val.m_dir = Vector3.down; val.m_dodgeable = true; val.m_blockable = false; val.m_hitType = (HitType)1; target.Damage(val); } private static void SpawnVfx(string prefabName, Vector3 pos, float lifetime = 3f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) BossVFXManager.PlayAndDestroy(prefabName, pos, lifetime); } private static IEnumerator FirePatchRoutine(Vector3 pos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) float value = EikthyrSummonConfig.FirePatchDuration.Value; float value2 = EikthyrSummonConfig.FirePatchRadius.Value; float value3 = EikthyrSummonConfig.FirePatchDamagePerTick.Value; Plugin.Log.LogInfo((object)$"[FirePatch] 시작 pos={pos} duration={value}s radius={value2}m dmg={value3}"); string value4 = EikthyrSummonConfig.FirePatchHitVfxPrefab.Value; BossVFXManager.PlayAndDestroy(value4, pos, value); string value5 = EikthyrSummonConfig.FirePatchTickVfxPrefab.Value; float num = 0f; while (num < value && !((Object)ZNetScene.instance == (Object)null)) { BossVFXManager.PlayAndDestroy(value5, pos, 1.5f); yield return (object)new WaitForSeconds(1f); num += 1f; if (value3 <= 0f) { continue; } int num2 = 0; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead() && !(Vector3.Distance(((Component)allPlayer).transform.position, pos) > value2)) { HitData val = new HitData(); val.m_damage.m_fire = value3; val.m_point = pos; val.m_dir = Vector3.up; val.m_dodgeable = false; val.m_blockable = false; val.m_hitType = (HitType)1; ((Character)allPlayer).Damage(val); num2++; } } Plugin.Log.LogInfo((object)$"[FirePatch] {num:F0}s 틱 — 피격 {num2}명 (fire={value3})"); } } } [HarmonyPatch(typeof(Attack), "DoAreaAttack")] public static class EikthyrPhase2StompPatch { private static readonly FieldInfo _mCharacter = AccessTools.Field(typeof(Attack), "m_character"); [HarmonyPostfix] public static void Postfix(Attack __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown if (!EikthyrSummonConfig.Phase2Enabled.Value) { return; } object value = _mCharacter.GetValue(__instance); Humanoid val = (Humanoid)((value is Humanoid) ? value : null); if ((Object)val == (Object)null || !((Character)val).IsOwner() || ((Character)val).IsDead() || Utils.GetPrefabName(((Component)val).gameObject) != "Eikthyr") { return; } float maxHealth = ((Character)val).GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = ((Character)val).GetHealth() / maxHealth * 100f; if (num > EikthyrSummonConfig.Phase2HealthThreshold.Value) { return; } string text = __instance.m_attackAnimation?.ToLower() ?? ""; string value2 = EikthyrSummonConfig.StompAnimName.Value?.ToLower() ?? "stomp"; if (!string.IsNullOrEmpty(value2) && text.Contains(value2)) { float num2 = EikthyrSummonConfig.LightningProcChance.Value / 100f; if (!(Random.value > num2)) { Plugin.Log.LogInfo((object)$"[Phase2] 번개 공격 발동! 체력 {num:F0}% / 애니메이션: {text}"); EikthyrLightningSequence.Track(((MonoBehaviour)Plugin.Instance).StartCoroutine(EikthyrLightningSequence.Execute(val))); } } } } [HarmonyPatch(typeof(Character), "Awake")] public static class EikthyrSpawnTimePatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "Eikthyr")) { EikthyrSummonState.GetOrCreate(((Object)__instance).GetInstanceID()).SpawnTime = Time.time; Plugin.Log.LogInfo((object)"[EikthyrSummon] 에이크쉬르 스폰 시각 기록 (소환 유예 시작)"); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class EikthyrSpecialSummonPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!EikthyrSummonHelper.ShouldProcess(__instance) || !EikthyrSummonConfig.SpecialSummonEnabled.Value || Plugin.SummonBlocked) { return; } EikthyrSummonTracker orCreate = EikthyrSummonState.GetOrCreate(((Object)__instance).GetInstanceID()); if (orCreate.SpecialTriggered) { return; } float maxHealth = __instance.GetMaxHealth(); if (!(maxHealth <= 0f)) { float num = __instance.GetHealth() / maxHealth * 100f; if (!(num > EikthyrSummonConfig.SpecialSummonHealthThreshold.Value)) { orCreate.SpecialTriggered = true; Plugin.Log.LogInfo((object)($"[SpecialSummon] 스페셜 소환 발동! 체력 {num:F1}% / " + $"{EikthyrSummonConfig.SpecialSummonPrefab.Value} x{EikthyrSummonConfig.SpecialSummonCount.Value}")); EikthyrSummonHelper.TrySpecialSummon(__instance); } } } } internal static class EikthyrSummonHelper { private const string BossName = "Eikthyr"; private const float NearRadius = 50f; public static bool ShouldProcess(Character c) { if (!c.IsOwner()) { return false; } if (c.IsDead()) { return false; } if (Utils.GetPrefabName(((Component)c).gameObject) != "Eikthyr") { return false; } return true; } public static void TrySummon(Character boss, string reason) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_013c: Unknown result type (might be due to invalid IL or missing references) if ((Object)ZNetScene.instance == (Object)null) { return; } string value = EikthyrSummonConfig.SummonPrefab.Value; int num = Mathf.Max(1, EikthyrSummonConfig.SummonCount.Value); int num2 = Mathf.Clamp(EikthyrSummonConfig.SummonLevel.Value, 1, 5); int num3 = Mathf.Max(1, EikthyrSummonConfig.MaxTotalSummons.Value); int num4 = CountNearby(((Component)boss).transform.position, value, 50f); if (num4 >= num3) { Plugin.Log.LogInfo((object)$"[EikthyrSummon] 소환 생략 - 최대 수 초과 ({num4}/{num3}) [{reason}]"); return; } int num5 = Mathf.Min(num, num3 - num4); GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)("[EikthyrSummon] 프리팹 '" + value + "'을 찾을 수 없음")); return; } Vector3 position = ((Component)boss).transform.position; Vector3 val = default(Vector3); for (int i = 0; i < num5; i++) { float num6 = ((num5 > 1) ? (360f / (float)num5 * (float)i) : 0f) * ((float)Math.PI / 180f); ((Vector3)(ref val))..ctor(Mathf.Sin(num6) * 5f, 0f, Mathf.Cos(num6) * 5f); SpawnMonster(prefab, position + val, num2); } Plugin.Log.LogInfo((object)$"[EikthyrSummon] {value} x{num5} (Lv.{num2}) 소환 완료 [{reason}]"); } public static void TrySpecialSummon(Character boss) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_00a9: 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_00b2: 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_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) if ((Object)ZNetScene.instance == (Object)null) { return; } string value = EikthyrSummonConfig.SpecialSummonPrefab.Value; int num = Mathf.Max(1, EikthyrSummonConfig.SpecialSummonCount.Value); int num2 = Mathf.Clamp(EikthyrSummonConfig.SpecialSummonLevel.Value, 1, 5); GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)("[SpecialSummon] 프리팹 '" + value + "'을 찾을 수 없음")); return; } string value2 = EikthyrSummonConfig.SpecialSummonVfxPrefab.Value; if (!string.IsNullOrEmpty(value2)) { BossVFXManager.Play(value2, ((Component)boss).transform.position, 5f); } Vector3 position = ((Component)boss).transform.position; Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { float num3 = ((num > 1) ? (360f / (float)num * (float)i) : 0f) * ((float)Math.PI / 180f); ((Vector3)(ref val))..ctor(Mathf.Sin(num3) * 6f, 0f, Mathf.Cos(num3) * 6f); SpawnMonster(prefab, position + val, num2); } Plugin.Log.LogInfo((object)$"[SpecialSummon] {value} x{num} (Lv.{num2}) 스페셜 소환 완료"); } private static void SpawnMonster(GameObject prefab, Vector3 pos, int level) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown GameObject val = Object.Instantiate(prefab, pos, Quaternion.identity); if ((Object)val == (Object)null) { return; } Character component = val.GetComponent(); if (!((Object)component == (Object)null)) { if (EikthyrSummonConfig.UseCLLC.Value) { ApplyCLLCLevel(val, component, level); } else { component.SetLevel(level); } } } private static void ApplyCLLCLevel(GameObject obj, Character c, int level) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Component component = obj.GetComponent("CreatureLevel"); if ((Object)component != (Object)null) { PropertyInfo property = ((object)component).GetType().GetProperty("Level"); if (property != null) { property.SetValue(component, level); Plugin.Log.LogInfo((object)$"[EikthyrSummon] CLLC 레벨 {level} 적용"); return; } } c.SetLevel(level); } private static int CountNearby(Vector3 center, string prefabName, float radius) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) int num = 0; foreach (Character item in new List(Character.GetAllCharacters())) { if (!((Object)item == (Object)null) && !item.IsDead() && !(Utils.GetPrefabName(((Component)item).gameObject) != prefabName) && Vector3.Distance(((Component)item).transform.position, center) <= radius) { num++; } } return num; } } internal static class EikthyrSummonState { private static readonly Dictionary s_map = new Dictionary(); public static EikthyrSummonTracker GetOrCreate(int id) { if (!s_map.TryGetValue(id, out var value)) { value = new EikthyrSummonTracker(); s_map[id] = value; } return value; } public static void Remove(int id) { s_map.Remove(id); } } internal class EikthyrSummonTracker { public readonly HashSet TriggeredSteps = new HashSet(); public float LastTimerSummon; public bool TimerInitialized; public bool SpecialTriggered; public float SpawnTime = float.MinValue; } public static class EikthyrTimerSummonHandler { public static void Tick() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown if (!EikthyrSummonConfig.Enabled.Value || Plugin.SummonBlocked || EikthyrSummonConfig.TriggerMode.Value == SummonTriggerMode.Health || (Object)Player.m_localPlayer == (Object)null || ((Character)Player.m_localPlayer).IsDead()) { return; } foreach (Character item in new List(Character.GetAllCharacters())) { if (!((Object)item == (Object)null) && !item.IsDead() && item.IsOwner() && !(Utils.GetPrefabName(((Component)item).gameObject) != "Eikthyr")) { EikthyrSummonTracker orCreate = EikthyrSummonState.GetOrCreate(((Object)item).GetInstanceID()); float time = Time.time; float value = EikthyrSummonConfig.TimerInterval.Value; if (!orCreate.TimerInitialized) { orCreate.TimerInitialized = true; orCreate.LastTimerSummon = time; } else if (!(time - orCreate.LastTimerSummon < value)) { orCreate.LastTimerSummon = time; Plugin.Log.LogInfo((object)$"[EikthyrSummon] 타이머 트리거 ({value}초 경과)"); EikthyrSummonHelper.TrySummon(item, $"타이머 {value}초"); } } } } } [HarmonyPatch(typeof(Projectile), "OnHit")] public static class ElderRockSplashPatch { [HarmonyPostfix] private static void Postfix(Projectile __instance, Vector3 hitPoint) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0086: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00c2: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) if (!TheElderConfig.RockThrowSplashEnabled.Value) { return; } int instanceID = ((Object)((Component)__instance).gameObject).GetInstanceID(); if (!TheElderRockThrowHandler.s_thrownProjectiles.TryGetValue(instanceID, out var value)) { return; } TheElderRockThrowHandler.s_thrownProjectiles.Remove(instanceID); float value2 = TheElderConfig.RockThrowSplashRadius.Value; float value3 = TheElderConfig.RockThrowSplashDamage.Value; int num = 0; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead() && !(Vector3.Distance(hitPoint, ((Component)allPlayer).transform.position) > value2)) { HitData val = new HitData(); val.m_damage.m_blunt = value3; val.m_dodgeable = true; val.m_blockable = true; val.m_hitType = (HitType)1; val.m_point = hitPoint; Vector3 val2 = ((Component)allPlayer).transform.position - hitPoint; val.m_dir = ((Vector3)(ref val2)).normalized; val.SetAttacker(value); ((Character)allPlayer).Damage(val); num++; } } string value4 = TheElderConfig.RockThrowSplashVFX.Value; if (!string.IsNullOrEmpty(value4) && (Object)ZNetScene.instance != (Object)null) { GameObject prefab = ZNetScene.instance.GetPrefab(value4); if ((Object)prefab != (Object)null) { Object.Instantiate(prefab, hitPoint, Quaternion.identity); } else { Plugin.Log.LogWarning((object)("[Elder:스플래시] VFX 없음: " + value4)); } } if (num > 0) { Plugin.Log.LogInfo((object)$"[Elder:스플래시] 착탄 — 반경 {value2}m, {num}명 피격, 데미지 {value3}"); } } } [HarmonyPatch(typeof(Character), "Damage")] internal static class MiniBonemassAttackDamagePatch { [HarmonyPrefix] public static void Prefix(HitData hit) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown if (hit == null) { return; } float value = BonemassConfig.MiniDamageMult.Value; if (!Mathf.Approximately(value, 1f)) { Character attacker = hit.GetAttacker(); if (!((Object)attacker == (Object)null) && MiniBonemassVariants.IsMini(Utils.GetPrefabName(((Component)attacker).gameObject))) { ((DamageTypes)(ref hit.m_damage)).Modify(value); } } } } [HarmonyPatch(typeof(Attack), "Start")] public static class MiniBonemassAttackInterceptPatch { private static readonly FieldInfo s_charField = AccessTools.Field(typeof(Attack), "m_character"); [HarmonyPrefix] public static bool Prefix(Attack __instance, ref bool __result) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Invalid comparison between Unknown and I4 object obj = s_charField?.GetValue(__instance); Character val = (Character)((obj is Character) ? obj : null); if ((Object)val == (Object)null) { return true; } if (!MiniBonemassVariants.IsMini(Utils.GetPrefabName(((Component)val).gameObject))) { return true; } AttackType attackType = __instance.m_attackType; if ((int)attackType != 0 && (int)attackType != 1) { __result = false; return false; } return true; } } [HarmonyPatch(typeof(Attack), "DoMeleeAttack")] internal static class MiniBonemassAttackRangePatch { private static readonly FieldInfo s_charField = AccessTools.Field(typeof(Attack), "m_character"); [HarmonyPrefix] public static void Prefix(Attack __instance, out float __state) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown __state = -1f; object obj = s_charField?.GetValue(__instance); Humanoid val = (Humanoid)((obj is Humanoid) ? obj : null); if (!((Object)val == (Object)null) && MiniBonemassVariants.IsMini(Utils.GetPrefabName(((Component)val).gameObject))) { __state = __instance.m_attackRange; __instance.m_attackRange *= BonemassConfig.MiniAttackRangeMult.Value; } } [HarmonyPostfix] public static void Postfix(Attack __instance, float __state) { if (__state >= 0f) { __instance.m_attackRange = __state; } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class MiniBonemassDeathTrackPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (MiniBonemassVariants.IsMini(Utils.GetPrefabName(((Component)__instance).gameObject)) && !MiniBonemassOrderDeathPatch.WasBlocked(((Object)((Component)__instance).gameObject).GetInstanceID())) { MiniBonemassKillTracker.OnMiniDied(); } } } internal static class MiniBonemassKillTracker { private static int s_living; private static bool s_splitFired; private static int s_orderIdx; public static int CurrentOrder => s_orderIdx; public static void OnSplitFired(int count) { s_splitFired = true; s_living = count; s_orderIdx = 0; Plugin.Log.LogInfo((object)($"[Bonemass:처치조건] 분열 추적 시작 — {count}마리 / " + "첫 번째: " + MiniBonemassVariants.KoreanNames[0])); } public static void OnMiniDied() { s_living = Mathf.Max(0, s_living - 1); s_orderIdx = Mathf.Min(s_orderIdx + 1, 5); string arg = ((s_orderIdx < 5) ? MiniBonemassVariants.KoreanNames[s_orderIdx] : "없음 (완료)"); Plugin.Log.LogInfo((object)$"[Bonemass:처치조건] 미니 사망 확정 — 잔여 {s_living}마리 / 다음: {arg}"); } public static bool IsSplitActive() { return s_splitFired; } public static bool IsCorrectOrder(string prefabName) { if (!s_splitFired) { return true; } if (s_orderIdx >= 5) { return true; } return prefabName == MiniBonemassVariants.Names[s_orderIdx]; } public static bool CanBossDie() { if (s_splitFired) { return s_living <= 0; } return true; } public static void Reset() { s_living = 0; s_splitFired = false; s_orderIdx = 0; Plugin.Log.LogInfo((object)"[Bonemass:처치조건] 트래커 초기화"); } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class MiniBonemassOrderDeathPatch { private static readonly HashSet s_blockedIds = new HashSet(); private static float s_lastMsgTime = -99f; [HarmonyPrefix] public static bool Prefix(Character __instance) { //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown if (!BonemassConfig.KillConditionEnabled.Value) { return true; } if (!BonemassConfig.KillOrderEnabled.Value) { return true; } string prefabName = Utils.GetPrefabName(((Component)__instance).gameObject); if (!MiniBonemassVariants.IsMini(prefabName)) { return true; } if (!MiniBonemassKillTracker.IsSplitActive()) { return true; } if (MiniBonemassKillTracker.IsCorrectOrder(prefabName)) { return true; } int instanceID = ((Object)((Component)__instance).gameObject).GetInstanceID(); s_blockedIds.Add(instanceID); __instance.SetHealth(__instance.GetMaxHealth() * 0.15f); if (Time.time - s_lastMsgTime > 3f) { s_lastMsgTime = Time.time; int currentOrder = MiniBonemassKillTracker.CurrentOrder; string text = MiniBonemassVariants.KoreanNames[currentOrder]; Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)2, "[" + text + "]색 본매스를 먼저 처치하라!", 0, (Sprite)null); } } float value = BonemassConfig.WrongOrderHealPercent.Value; if (value > 0f) { foreach (Character allCharacter in Character.GetAllCharacters()) { if (!((Object)allCharacter == (Object)null) && !allCharacter.IsDead() && !(Utils.GetPrefabName(((Component)allCharacter).gameObject) != "Bonemass")) { float num = allCharacter.GetMaxHealth() * (value / 100f); allCharacter.Heal(num, true); Plugin.Log.LogInfo((object)$"[Bonemass:순서조건] 오순서 페널티 → 본매스 HP +{num:F0} 회복 ({value}%)"); break; } } } Plugin.Log.LogInfo((object)("[Bonemass:순서조건] '" + prefabName + "' 순서 불일치 → 사망 차단 (현재 필요: " + MiniBonemassVariants.Names[MiniBonemassKillTracker.CurrentOrder] + ")")); return false; } public static bool WasBlocked(int goInstanceId) { return s_blockedIds.Remove(goInstanceId); } } [HarmonyPatch(typeof(Projectile), "Setup")] public static class MiniBonemassProjectileBlockPatch { [HarmonyPrefix] public static bool Prefix(Character owner) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown if ((Object)owner == (Object)null) { return true; } if (MiniBonemassVariants.IsMini(Utils.GetPrefabName(((Component)owner).gameObject))) { Plugin.Log.LogInfo((object)("[MiniBonemass] 투사체 차단: " + Utils.GetPrefabName(((Component)owner).gameObject))); return false; } return true; } } [HarmonyPatch(typeof(Character), "Damage")] internal static class MiniModerAttackDamagePatch { [HarmonyPrefix] public static void Prefix(HitData hit) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown if (hit == null) { return; } float value = ModerConfig.MiniDamageMult.Value; if (!Mathf.Approximately(value, 1f)) { Character attacker = hit.GetAttacker(); if (!((Object)attacker == (Object)null) && !(Utils.GetPrefabName(((Component)attacker).gameObject) != "MiniModer")) { ((DamageTypes)(ref hit.m_damage)).Modify(value); } } } } [HarmonyPatch(typeof(Attack), "Start")] public static class MiniModerAttackInterceptPatch { private static readonly FieldInfo s_charField = AccessTools.Field(typeof(Attack), "m_character"); [HarmonyPrefix] public static bool Prefix(Attack __instance, ref bool __result) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Invalid comparison between Unknown and I4 object obj = s_charField?.GetValue(__instance); Character val = (Character)((obj is Character) ? obj : null); if ((Object)val == (Object)null) { return true; } if (Utils.GetPrefabName(((Component)val).gameObject) != "MiniModer") { return true; } AttackType attackType = __instance.m_attackType; if ((int)attackType != 0 && (int)attackType != 1) { __result = false; return false; } return true; } } [HarmonyPatch(typeof(Attack), "DoMeleeAttack")] internal static class MiniModerAttackRangePatch { private static readonly FieldInfo s_charField = AccessTools.Field(typeof(Attack), "m_character"); [HarmonyPrefix] public static void Prefix(Attack __instance, out float __state) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown __state = -1f; object obj = s_charField?.GetValue(__instance); Humanoid val = (Humanoid)((obj is Humanoid) ? obj : null); if (!((Object)val == (Object)null) && !(Utils.GetPrefabName(((Component)val).gameObject) != "MiniModer")) { __state = __instance.m_attackRange; __instance.m_attackRange *= ModerConfig.MiniAttackRangeMult.Value; } } [HarmonyPostfix] public static void Postfix(Attack __instance, float __state) { if (__state >= 0f) { __instance.m_attackRange = __state; } } } internal static class MiniModerFlightHandler { private const float TickInterval = 0.5f; private const float TargetUpdateInterval = 3f; private static float s_nextTick = 0f; private static readonly Dictionary s_flightStart = new Dictionary(); private static readonly Dictionary s_lastTargetSet = new Dictionary(); private static readonly MethodInfo s_setTargetMethod = AccessTools.Method(typeof(MonsterAI), "SetTarget", new Type[1] { typeof(Character) }, (Type[])null); public static void Tick() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown if (Time.time < s_nextTick) { return; } s_nextTick = Time.time + 0.5f; foreach (Character allCharacter in Character.GetAllCharacters()) { if (!((Object)allCharacter == (Object)null) && !allCharacter.IsDead() && !(Utils.GetPrefabName(((Component)allCharacter).gameObject) != "MiniModer") && allCharacter.IsOwner()) { ProcessFlight(allCharacter); } } } private static void ProcessFlight(Character mini) { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) bool num = mini.IsFlying(); int instanceID = ((Object)((Component)mini).gameObject).GetInstanceID(); if (!num) { s_flightStart.Remove(instanceID); s_lastTargetSet.Remove(instanceID); return; } if (!s_flightStart.ContainsKey(instanceID)) { s_flightStart[instanceID] = Time.time; Plugin.Log.LogInfo((object)$"[MiniModer:비행] 이륙 감지 (id={instanceID})"); } float num2 = Time.time - s_flightStart[instanceID]; if (num2 >= ModerConfig.MiniFlightDuration.Value) { mini.Land(); s_flightStart.Remove(instanceID); s_lastTargetSet.Remove(instanceID); Plugin.Log.LogInfo((object)($"[MiniModer:비행] {num2:F1}s 초과 → Land() 호출 " + $"(FlightDuration={ModerConfig.MiniFlightDuration.Value})")); } else { if (s_lastTargetSet.TryGetValue(instanceID, out var value) && Time.time - value < 3f) { return; } s_lastTargetSet[instanceID] = Time.time; MonsterAI component = ((Component)mini).GetComponent(); if (!((Object)component == (Object)null)) { Player farthestPlayer = GetFarthestPlayer(((Component)mini).transform.position, ModerConfig.MiniFarTargetMinDist.Value); if ((Object)farthestPlayer != (Object)null) { s_setTargetMethod?.Invoke(component, new object[1] { farthestPlayer }); Plugin.Log.LogDebug((object)("[MiniModer:비행] 원거리 타겟: " + farthestPlayer.GetPlayerName() + " " + $"(경과 {num2:F1}s / {Vector3.Distance(((Component)mini).transform.position, ((Component)farthestPlayer).transform.position):F1}m)")); } } } } private static Player GetFarthestPlayer(Vector3 origin, float minDist) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Player result = null; float num = 0f; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(((Component)allPlayer).transform.position, origin); if (!(num2 < minDist) && !(num2 <= num)) { num = num2; result = allPlayer; } } } return result; } private static Player GetNearestPlayer(Vector3 origin) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Player result = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(((Component)allPlayer).transform.position, origin); if (!(num2 >= num)) { num = num2; result = allPlayer; } } } return result; } } [HarmonyPatch(typeof(Humanoid), "GiveDefaultItem")] internal static class MiniModerGiveDefaultItemPatch { [HarmonyPrefix] public static bool Prefix(Humanoid __instance, GameObject prefab) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown if (Utils.GetPrefabName(((Component)__instance).gameObject) != "MiniModer") { return true; } if ((Object)prefab == (Object)null) { return true; } ItemDrop component = prefab.GetComponent(); if ((Object)component == (Object)null) { return true; } string text = component.m_itemData?.m_shared?.m_attack?.m_attackAnimation ?? ""; if (text.Contains("breath") || text.Contains("iceball") || text.Contains("taunt")) { Plugin.Log.LogInfo((object)("[MiniModer] 공격 지급 차단: " + ((Object)prefab).name + " (anim=" + text + ")")); return false; } return true; } } [HarmonyPatch(typeof(Projectile), "Setup")] public static class MiniModerProjectileBlockPatch { [HarmonyPrefix] public static bool Prefix(Character owner) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown if ((Object)owner == (Object)null) { return true; } if (Utils.GetPrefabName(((Component)owner).gameObject) != "MiniModer") { return true; } Plugin.Log.LogDebug((object)"[MiniModer] 투사체 차단"); return false; } } internal static class ModerAirBreathHandler { private static readonly Dictionary s_lastBreathTime = new Dictionary(); public static void Tick() { BossPhaseMessageHandler.Tick(); } public static void FireBreath(Character dragon) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_00c3: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Expected O, but got Unknown //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Expected O, but got Unknown //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0203: 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_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Expected O, but got Unknown //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) if ((Object)dragon == (Object)null || dragon.IsDead() || !ModerConfig.AirBreathEnabled.Value || !dragon.IsFlying() || !dragon.IsOwner()) { return; } int instanceID = ((Object)((Component)dragon).gameObject).GetInstanceID(); float time = Time.time; float value = ModerConfig.AirBreathCooldown.Value; if (value > 0f && s_lastBreathTime.TryGetValue(instanceID, out var value2) && time - value2 < value) { Plugin.Log.LogDebug((object)$"[Dragon:공중브레스] 쿨타임 중 ({time - value2:F1}s / {value}s) → 스킵"); return; } float maxHealth = dragon.GetMaxHealth(); if (maxHealth > 0f && dragon.GetHealth() / maxHealth * 100f > ModerConfig.AirBreathHPThreshold.Value) { return; } Vector3 position = ((Component)dragon).transform.position; Vector3 forward = ((Component)dragon).transform.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.001f) { forward = ((Component)dragon).transform.forward; } else { ((Vector3)(ref forward)).Normalize(); } float value3 = ModerConfig.AirBreathRange.Value; float num = ModerConfig.AirBreathAngle.Value * 0.5f; Player val = null; foreach (Player allPlayer in Player.GetAllPlayers()) { if ((Object)allPlayer == (Object)null || ((Character)allPlayer).IsDead()) { continue; } Vector3 val2 = ((Component)allPlayer).transform.position - position; if (((Vector3)(ref val2)).magnitude > value3) { continue; } Vector3 val3 = val2; val3.y = 0f; if (!(((Vector3)(ref val3)).sqrMagnitude < 0.001f) && !(Vector3.Angle(forward, ((Vector3)(ref val3)).normalized) > num)) { HitData val4 = new HitData(); val4.m_damage.m_frost = ModerConfig.AirBreathDamageFrost.Value; val4.m_damage.m_blunt = ModerConfig.AirBreathDamageBlunt.Value; val4.m_dir = ((Vector3)(ref val2)).normalized; val4.m_point = ((Component)allPlayer).transform.position + Vector3.up; val4.m_dodgeable = true; val4.m_blockable = true; val4.m_hitType = (HitType)1; val4.SetAttacker(dragon); ((Character)allPlayer).Damage(val4); Plugin.Log.LogInfo((object)($"[Dragon:공중브레스] 데미지 적용 → HP: {((Character)allPlayer).GetHealth():F0}, " + $"Frost: {ModerConfig.AirBreathDamageFrost.Value}")); if ((Object)val == (Object)null) { val = allPlayer; } } } string value4 = ModerConfig.AirBreathVFX.Value; if (!string.IsNullOrEmpty(value4) && (Object)ZNetScene.instance != (Object)null) { GameObject prefab = ZNetScene.instance.GetPrefab(value4); if ((Object)prefab != (Object)null) { Vector3 val5; if (!((Object)val != (Object)null)) { val5 = ((Component)dragon).transform.forward; } else { Vector3 val6 = ((Component)val).transform.position - position; val5 = ((Vector3)(ref val6)).normalized; } Vector3 val7 = val5; Vector3 val8 = position + val7 * 4f + Vector3.up * 1.5f; Object.Instantiate(prefab, val8, Quaternion.LookRotation(val7)); } else { Plugin.Log.LogWarning((object)("[Dragon:공중브레스] VFX 없음: " + value4)); } } s_lastBreathTime[instanceID] = time; Plugin.Log.LogInfo((object)$"[Dragon:공중브레스] 발동 (범위={value3}m / 각도={ModerConfig.AirBreathAngle.Value}°)"); } } [HarmonyPatch(typeof(ZSyncAnimation), "SetTrigger")] public static class ModerRoarDetectPatch { private static void Postfix(ZSyncAnimation __instance, string name) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (!(name != "attack_taunt")) { Character componentInParent = ((Component)__instance).GetComponentInParent(); if (!((Object)componentInParent == (Object)null) && !(Utils.GetPrefabName(((Component)componentInParent).gameObject) != "Dragon")) { ModerRoarZoneHandler.OnRoar(componentInParent); } } } } public static class ModerRoarZoneHandler { private sealed class BlizzardZone { private readonly Vector3 _pos; private readonly float _radius; private readonly float _frost; private readonly float _blunt; private readonly float _expire; private float _nextTick; public BlizzardZone(Vector3 pos, float radius, float frost, float blunt, float expire) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) _pos = pos; _radius = radius; _frost = frost; _blunt = blunt; _expire = expire; _nextTick = Time.time + 1f; } public bool IsExpired(float now) { return now >= _expire; } public void Tick(float now) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00e7: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) if (now < _nextTick) { return; } _nextTick = now + 1f; bool flag = _frost > 0f || _blunt > 0f; bool value = ModerConfig.ZoneSlowEnabled.Value; if (!flag && !value) { return; } int num = 0; foreach (Player allPlayer in Player.GetAllPlayers()) { if ((Object)allPlayer == (Object)null || ((Character)allPlayer).IsDead()) { continue; } Vector3 val = ((Component)allPlayer).transform.position - _pos; val.y = 0f; if (!(((Vector3)(ref val)).magnitude > _radius)) { if (flag) { HitData val2 = new HitData(); val2.m_damage.m_frost = _frost; val2.m_damage.m_blunt = _blunt; val2.m_dir = Vector3.up; val2.m_point = ((Component)allPlayer).transform.position; val2.m_blockable = false; val2.m_dodgeable = false; ((Character)allPlayer).Damage(val2); num++; } if (value) { ((Character)allPlayer).GetSEMan().AddStatusEffect(StringExtensionMethods.GetStableHashCode("Frost"), true, 0, 0f); } } } if (num > 0) { Plugin.Log.LogInfo((object)$"[빙결장판] 지속 데미지 {num}명 적용 (frost={_frost})"); } } } private static readonly Dictionary s_lastRoarTime = new Dictionary(); private static readonly List s_activeZones = new List(); public static void Tick() { float time = Time.time; for (int num = s_activeZones.Count - 1; num >= 0; num--) { if (s_activeZones[num].IsExpired(time)) { s_activeZones.RemoveAt(num); } else { s_activeZones[num].Tick(time); } } } public static void OnRoar(Character dragon) { if (!ModerConfig.RoarEnabled.Value) { return; } float num = dragon.GetHealthPercentage() * 100f; if (num > ModerConfig.RoarHPThreshold.Value) { return; } int instanceID = ((Object)dragon).GetInstanceID(); float time = Time.time; if (!s_lastRoarTime.TryGetValue(instanceID, out var value) || !(time - value < ModerConfig.RoarCooldown.Value)) { s_lastRoarTime[instanceID] = time; ApplyRoarEffect(dragon, ModerConfig.RoarRadius.Value, ModerConfig.RoarDamageFrost.Value, ModerConfig.RoarDamageBlunt.Value, ModerConfig.RoarPushForce.Value, ModerConfig.RoarStaggerMult.Value, ModerConfig.RoarBlockable.Value, ModerConfig.RoarVFX.Value, ModerConfig.RoarSFX.Value); float num2 = dragon.GetHealthPercentage() * 100f; if (ModerConfig.ZoneEnabled.Value && num2 <= ModerConfig.ZoneHPThreshold.Value) { SpawnZones(dragon); } Plugin.Log.LogInfo((object)$"[ModerRoar] 동결 포효 발동 — HP:{num:F0}%"); } } private static void ApplyRoarEffect(Character dragon, float radius, float frost, float blunt, float pushForce, float staggerMult, bool blockable, string vfxName, string sfxName) { //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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)dragon).transform.position; if (frost > 0f || blunt > 0f) { ApplyDamageInRange(position, radius, frost, blunt, pushForce, staggerMult, blockable); } if (!string.IsNullOrEmpty(vfxName)) { SpawnVFX(vfxName, position); } if (!string.IsNullOrEmpty(sfxName)) { PlaySFX(sfxName, position); } } private static void ApplyDamageInRange(Vector3 origin, float radius, float frost, float blunt, float pushForce, float staggerMult, bool blockable) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00ec: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) foreach (Player allPlayer in Player.GetAllPlayers()) { if ((Object)allPlayer == (Object)null || ((Character)allPlayer).IsDead() || Vector3.Distance(origin, ((Component)allPlayer).transform.position) > radius) { continue; } Vector3 val = ((Component)allPlayer).transform.position - origin; Vector3 normalized = ((Vector3)(ref val)).normalized; HitData val2 = new HitData(); val2.m_damage.m_frost = frost; val2.m_damage.m_blunt = blunt; val2.m_dir = normalized; val2.m_point = ((Component)allPlayer).transform.position + Vector3.up; val2.m_staggerMultiplier = staggerMult; val2.m_blockable = blockable; val2.m_dodgeable = false; ((Character)allPlayer).Damage(val2); if (pushForce > 0f) { Rigidbody component = ((Component)allPlayer).GetComponent(); if ((Object)component != (Object)null) { Vector3 val3 = normalized; val3.y = 0f; ((Vector3)(ref val3)).Normalize(); component.AddForce(val3 * pushForce, (ForceMode)2); } } } } private static void SpawnZones(Character dragon) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) Player nearestPlayer = GetNearestPlayer(((Component)dragon).transform.position); Vector3 val = (((Object)nearestPlayer != (Object)null) ? ((Component)nearestPlayer).transform.position : ((Component)dragon).transform.position); int value = ModerConfig.ZoneCount.Value; float value2 = ModerConfig.ZoneSpawnRange.Value; float time = Time.time; string value3 = ModerConfig.ZoneVFX.Value; RaycastHit val2 = default(RaycastHit); for (int i = 0; i < value; i++) { float num = Random.Range(0f, 360f) * ((float)Math.PI / 180f); float num2 = Random.Range(2f, value2); Vector3 val3 = val + new Vector3(Mathf.Cos(num) * num2, 0f, Mathf.Sin(num) * num2); val3.y = val.y + 500f; if (Physics.Raycast(val3, Vector3.down, ref val2, 1000f, LayerMask.GetMask(new string[4] { "Default", "terrain", "piece", "static_solid" }))) { val3.y = ((RaycastHit)(ref val2)).point.y; } else { val3.y = val.y; } if (!string.IsNullOrEmpty(value3)) { SpawnVFX(value3, val3, ModerConfig.ZoneVFXScale.Value); } s_activeZones.Add(new BlizzardZone(val3, ModerConfig.ZoneRadius.Value, ModerConfig.ZoneDamageFrost.Value, ModerConfig.ZoneDamageBlunt.Value, time + ModerConfig.ZoneDuration.Value)); } Plugin.Log.LogInfo((object)$"[ModerRoar] 빙결 장판 {value}개 소환"); } private static float GetNearestPlayerDistance(Vector3 pos) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0031: 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) float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(pos, ((Component)allPlayer).transform.position); if (num2 < num) { num = num2; } } } return num; } private static Player GetNearestPlayer(Vector3 pos) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Player result = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(pos, ((Component)allPlayer).transform.position); if (num2 < num) { num = num2; result = allPlayer; } } } return result; } private static void SpawnVFX(string prefabName, Vector3 pos, float scale = 1f) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if ((Object)ZNetScene.instance == (Object)null) { return; } GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[ModerRoar] VFX 없음: " + prefabName)); return; } GameObject val = Object.Instantiate(prefab, pos, Quaternion.identity); float num = ((scale > 0f) ? scale : 1f); if (!Mathf.Approximately(num, 1f)) { Transform transform = val.transform; transform.localScale *= num; } } private static void PlaySFX(string sfxName, Vector3 pos) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!((Object)ZNetScene.instance == (Object)null)) { GameObject prefab = ZNetScene.instance.GetPrefab(sfxName); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[ModerRoar] SFX 없음: " + sfxName)); } else { Object.Instantiate(prefab, pos, Quaternion.identity); } } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class ModerSplitDeathCleanupPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "Dragon")) { ModerSplitState.Remove(((Object)((Component)__instance).gameObject).GetInstanceID()); Plugin.Log.LogInfo((object)"[Moder:서리분신] Dragon 사망 → 분열 데이터 초기화"); ((MonoBehaviour)Plugin.Instance).StartCoroutine(DespawnAfterFrames()); } } private static IEnumerator DespawnAfterFrames() { yield return null; yield return null; DespawnAllMiniModers(); } internal static void DespawnAllMiniModers() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown if ((Object)ZNetScene.instance == (Object)null) { return; } int num = 0; foreach (Character item in new List(Character.GetAllCharacters())) { if (!((Object)item == (Object)null) && !item.IsDead() && !(Utils.GetPrefabName(((Component)item).gameObject) != "MiniModer")) { ZNetView component = ((Component)item).GetComponent(); if ((Object)component != (Object)null && component.IsValid()) { ZNetScene.instance.Destroy(((Component)item).gameObject); } else { Object.Destroy((Object)((Component)item).gameObject); } num++; } } if (num > 0) { Plugin.Log.LogInfo((object)$"[Moder:서리분신] MiniModer {num}마리 제거 (Dragon 사망)"); } } } internal static class ModerSplitState { private static readonly HashSet s_triggered = new HashSet(); public static bool HasTriggered(int id) { return s_triggered.Contains(id); } public static void SetTriggered(int id) { s_triggered.Add(id); } public static void Remove(int id) { s_triggered.Remove(id); } } [HarmonyPatch(typeof(Character), "Damage")] public static class ModerSplitTriggerPatch { private static readonly MethodInfo s_setTargetMethod = AccessTools.Method(typeof(MonsterAI), "SetTarget", new Type[1] { typeof(Character) }, (Type[])null); private static readonly FieldInfo s_bodyField = AccessTools.Field(typeof(Character), "m_body"); [HarmonyPostfix] public static void Postfix(Character __instance) { if (!ModerConfig.SplitEnabled.Value || !__instance.IsOwner() || __instance.IsDead() || Utils.GetPrefabName(((Component)__instance).gameObject) != "Dragon") { return; } int instanceID = ((Object)((Component)__instance).gameObject).GetInstanceID(); if (ModerSplitState.HasTriggered(instanceID)) { return; } float maxHealth = __instance.GetMaxHealth(); if (maxHealth <= 0f) { return; } float health = __instance.GetHealth(); if (!(health <= 0f)) { float num = health / maxHealth * 100f; if (!(num > ModerConfig.SplitHPThreshold.Value)) { ModerSplitState.SetTriggered(instanceID); Plugin.Log.LogInfo((object)($"[Moder:서리분신] HP {num:F1}% → " + $"MiniModer {ModerConfig.SplitCount.Value}마리 소환!")); ((MonoBehaviour)Plugin.Instance).StartCoroutine(SpawnMiniModers(__instance)); } } } private static Quaternion CalcFacingRotation(Vector3 spawnPos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Player nearestPlayer = GetNearestPlayer(spawnPos); if ((Object)nearestPlayer == (Object)null) { return Quaternion.identity; } Vector3 val = ((Component)nearestPlayer).transform.position - spawnPos; val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude > 0.001f)) { return Quaternion.identity; } return Quaternion.LookRotation(((Vector3)(ref val)).normalized); } private static void ApplyInitialVelocity(GameObject mini, Vector3 spawnPos) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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) Character component = mini.GetComponent(); if ((Object)component == (Object)null) { return; } object obj = s_bodyField?.GetValue(component); Rigidbody val = (Rigidbody)((obj is Rigidbody) ? obj : null); if ((Object)val == (Object)null) { return; } Player nearestPlayer = GetNearestPlayer(spawnPos); if (!((Object)nearestPlayer == (Object)null)) { Vector3 val2 = ((Component)nearestPlayer).transform.position - spawnPos; Vector3 normalized = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.001f) { val.velocity = normalized * 4f; } } } private static Player GetNearestPlayer(Vector3 origin) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Player result = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(((Component)allPlayer).transform.position, origin); if (num2 < num) { num = num2; result = allPlayer; } } } return result; } private static void SetMiniTarget(GameObject mini, Vector3 spawnPos) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) if (s_setTargetMethod == null) { return; } MonsterAI component = mini.GetComponent(); if ((Object)component == (Object)null) { return; } Player val = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(spawnPos, ((Component)allPlayer).transform.position); if (num2 < num) { num = num2; val = allPlayer; } } } if ((Object)val != (Object)null) { s_setTargetMethod.Invoke(component, new object[1] { val }); Plugin.Log.LogInfo((object)$"[Moder:서리분신] MiniModer → 타겟: {val.GetPlayerName()} ({num:F1}m)"); } } private static IEnumerator SpawnMiniModers(Character dragon) { if ((Object)ZNetScene.instance == (Object)null) { yield break; } GameObject prefab = ZNetScene.instance.GetPrefab("MiniModer"); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)"[Moder:서리분신] MiniModer 프리팹 없음 — ModerMonsterDB 등록 여부 확인"); yield break; } int value = ModerConfig.SplitCount.Value; float num = ((value > 1) ? (360f / (float)value) : 0f); Vector3 position = ((Component)dragon).transform.position; float num4 = default(float); for (int i = 0; i < value; i++) { if ((Object)dragon == (Object)null) { break; } if (dragon.IsDead()) { break; } float num2 = num * (float)i; float num3 = num2 * ((float)Math.PI / 180f); Vector3 val = position + new Vector3(Mathf.Sin(num3) * 6f, 0.5f, Mathf.Cos(num3) * 6f); if ((Object)ZoneSystem.instance != (Object)null) { ZoneSystem.instance.GetSolidHeight(val, ref num4, 1000); if (num4 > float.MinValue) { val.y = num4 + 0.5f; } } Quaternion val2 = CalcFacingRotation(val); GameObject val3 = Object.Instantiate(prefab, val, val2); if (!((Object)val3 == (Object)null)) { val3.SetActive(true); Plugin.Log.LogInfo((object)$"[Moder:서리분신] MiniModer 소환 ({i + 1}/{value})"); ApplyInitialVelocity(val3, val); SetMiniTarget(val3, val); yield return (object)new WaitForSeconds(0.15f); } } } } [HarmonyPatch(typeof(Player), "OnDeath")] public static class PlayerDeathCancelElderTreePatch { [HarmonyPostfix] public static void Postfix(Player __instance) { if (((Character)__instance).IsOwner()) { TheElderTreeSequence.CancelAll(); } } } [HarmonyPatch(typeof(Player), "OnDeath")] public static class PlayerDeathCancelLightningPatch { [HarmonyPostfix] public static void Postfix(Player __instance) { if (((Character)__instance).IsOwner()) { EikthyrLightningSequence.CancelAll(); } } } [HarmonyPatch(typeof(Player), "OnDeath")] public static class PlayerDeathCancelRockThrowPatch { [HarmonyPostfix] public static void Postfix(Player __instance) { if (((Character)__instance).IsOwner()) { TheElderRockThrowHandler.CancelAll(); } } } [HarmonyPatch(typeof(Player), "SetLocalPlayer")] public static class PlayerRespawnCancelElderTreePatch { [HarmonyPostfix] public static void Postfix() { TheElderTreeSequence.CancelAll(); } } [HarmonyPatch(typeof(Player), "SetLocalPlayer")] public static class PlayerRespawnCancelLightningPatch { [HarmonyPostfix] public static void Postfix() { EikthyrLightningSequence.CancelAll(); } } [HarmonyPatch(typeof(EffectList), "Create")] public static class QueenBreathSummonPatch { private static bool s_queenAlive; [HarmonyPrefix] private static void Prefix(EffectList __instance, Vector3 basePos) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) if (!QueenConfig.BreathSummonEnabled.Value || __instance.m_effectPrefabs == null) { return; } s_queenAlive = IsQueenAlive(); if (!s_queenAlive) { return; } bool value = QueenConfig.BreathSummonDebugScan.Value; string value2 = QueenConfig.BreathSummonVFXTrigger.Value; bool flag = !string.IsNullOrEmpty(value2); EffectData[] effectPrefabs = __instance.m_effectPrefabs; foreach (EffectData val in effectPrefabs) { if (!((Object)(val?.m_prefab) == (Object)null)) { string name = ((Object)val.m_prefab).name; if (value) { Plugin.Log.LogInfo((object)$"[더 퀸:브레스 스캔] EffectList '{name}' @ {basePos:F1}"); } if (flag && name == value2) { TrySummon(basePos); break; } } } } private static void TrySummon(Vector3 pos) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_00e5: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) float value = QueenConfig.BreathSummonChance.Value; if (Random.Range(0f, 100f) > value || (Object)ZNetScene.instance == (Object)null) { return; } string value2 = QueenConfig.BreathSummonVFX.Value; if (!string.IsNullOrEmpty(value2)) { GameObject prefab = ZNetScene.instance.GetPrefab(value2); if ((Object)prefab != (Object)null) { Object.Destroy((Object)Object.Instantiate(prefab, pos, Quaternion.identity), 5f); } else { Plugin.Log.LogWarning((object)("[더 퀸:브레스 소환] VFX '" + value2 + "' 없음")); } } string value3 = QueenConfig.BreathSummonPrefab.Value; GameObject prefab2 = ZNetScene.instance.GetPrefab(value3); if ((Object)prefab2 == (Object)null) { Plugin.Log.LogError((object)("[더 퀸:브레스 소환] 프리팹 '" + value3 + "' 없음")); return; } int value4 = QueenConfig.BreathSummonCount.Value; Vector3 val = default(Vector3); for (int i = 0; i < value4; i++) { float num = ((value4 > 1) ? (360f / (float)value4 * (float)i) : Random.Range(0f, 360f)); float num2 = Random.Range(1f, 3f); ((Vector3)(ref val))..ctor(Mathf.Sin(num * ((float)Math.PI / 180f)) * num2, 0f, Mathf.Cos(num * ((float)Math.PI / 180f)) * num2); GameObject val2 = Object.Instantiate(prefab2, pos + val, Quaternion.identity); if (!((Object)val2 == (Object)null)) { float value5 = QueenConfig.BreathSummonScale.Value; if (!Mathf.Approximately(value5, 1f)) { Transform transform = val2.transform; transform.localScale *= value5; } Character component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetLevel(Mathf.Clamp(QueenConfig.BreathSummonLevel.Value, 1, 5)); } } } Plugin.Log.LogInfo((object)$"[더 퀸:브레스 소환] {value3} x{value4} @ {pos:F1} ({value:F0}% 발동)"); } private static bool IsQueenAlive() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown foreach (Character allCharacter in Character.GetAllCharacters()) { if ((Object)allCharacter != (Object)null && !allCharacter.IsDead() && Utils.GetPrefabName(((Component)allCharacter).gameObject) == "SeekerQueen") { return true; } } return false; } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class QueenBroodDeathPatch { [HarmonyPostfix] private static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "SeekerQueen")) { QueenBroodHPSummonPatch.OnDeath(((Object)__instance).GetInstanceID()); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class QueenBroodHPSummonPatch { private static readonly Dictionary s_lastBucket = new Dictionary(); [HarmonyPostfix] private static void Postfix(Character __instance) { if (Utils.GetPrefabName(((Component)__instance).gameObject) != "SeekerQueen" || !QueenConfig.BroodHPEnabled.Value || !__instance.IsOwner() || __instance.IsDead()) { return; } float maxHealth = __instance.GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = __instance.GetHealth() / maxHealth * 100f; float value = QueenConfig.BroodHPStep.Value; int num2 = Mathf.FloorToInt(num / value); int instanceID = ((Object)__instance).GetInstanceID(); if (!s_lastBucket.TryGetValue(instanceID, out var value2)) { s_lastBucket[instanceID] = num2; } else if (num2 < value2) { int num3 = value2 - num2; s_lastBucket[instanceID] = num2; for (int i = 0; i < num3; i++) { QueenBroodSummonHelper.DoSummon(__instance, QueenConfig.BroodHPCount.Value, QueenConfig.BroodHPLevel.Value, QueenConfig.BroodHPScale.Value, QueenConfig.BroodHPPrefab.Value, QueenConfig.BroodHPVFX.Value, QueenConfig.BroodHPMessage.Value); } Plugin.Log.LogInfo((object)($"[더 퀸:HP 구간 소환] {QueenConfig.BroodHPPrefab.Value} x{QueenConfig.BroodHPCount.Value * num3}" + $" ({num:F0}% / {value:F0}%마다)")); } } internal static void OnDeath(int instanceId) { s_lastBucket.Remove(instanceId); } } internal static class QueenBroodSummonHelper { public static void DoSummon(Character queen, int count, int level, float scale, string prefabName, string vfxName, string message) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0136: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Expected O, but got Unknown //IL_016d: 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)ZNetScene.instance == (Object)null) { return; } if (!string.IsNullOrEmpty(vfxName)) { GameObject prefab = ZNetScene.instance.GetPrefab(vfxName); if ((Object)prefab != (Object)null) { Object.Destroy((Object)Object.Instantiate(prefab, ((Component)queen).transform.position, Quaternion.identity), 5f); } else { Plugin.Log.LogWarning((object)("[SeekerQueen] VFX '" + vfxName + "' 없음")); } } GameObject prefab2 = ZNetScene.instance.GetPrefab(prefabName); if ((Object)prefab2 == (Object)null) { Plugin.Log.LogError((object)("[SeekerQueen] 프리팹 '" + prefabName + "' 없음")); return; } Vector3 position = ((Component)queen).transform.position; count = Mathf.Max(1, count); Vector3 val = default(Vector3); for (int i = 0; i < count; i++) { float num = ((count > 1) ? (360f / (float)count * (float)i) : Random.Range(0f, 360f)); float num2 = Random.Range(2f, 5f); ((Vector3)(ref val))..ctor(Mathf.Sin(num * ((float)Math.PI / 180f)) * num2, 0f, Mathf.Cos(num * ((float)Math.PI / 180f)) * num2); GameObject val2 = Object.Instantiate(prefab2, position + val, Quaternion.identity); if (!((Object)val2 == (Object)null)) { if (!Mathf.Approximately(scale, 1f)) { Transform transform = val2.transform; transform.localScale *= scale; } Character component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetLevel(Mathf.Clamp(level, 1, 5)); } } } if (!string.IsNullOrEmpty(message)) { MessageHud instance = MessageHud.instance; if ((Object)(object)instance != (Object)null) { instance.ShowMessage((MessageType)2, message, 0, (Sprite)null, false); } } } } internal static class QueenBroodTimerHandler { private static float s_lastSummonTime = -999f; public static void Tick() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) if (!QueenConfig.BroodTimerEnabled.Value) { return; } float value = QueenConfig.BroodTimerInterval.Value; float time = Time.time; if (!(time - s_lastSummonTime < value)) { Character val = FindQueen(); if (!((Object)val == (Object)null) && !val.IsDead() && !((Object)Player.m_localPlayer == (Object)null) && !(Vector3.Distance(((Component)val).transform.position, ((Component)Player.m_localPlayer).transform.position) > 100f)) { s_lastSummonTime = time; QueenBroodSummonHelper.DoSummon(val, QueenConfig.BroodTimerCount.Value, QueenConfig.BroodTimerLevel.Value, QueenConfig.BroodTimerScale.Value, QueenConfig.BroodTimerPrefab.Value, QueenConfig.BroodTimerVFX.Value, ""); Plugin.Log.LogInfo((object)$"[더 퀸:타이머 소환] {QueenConfig.BroodTimerPrefab.Value} x{QueenConfig.BroodTimerCount.Value}"); } } } private static Character FindQueen() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown foreach (Character allCharacter in Character.GetAllCharacters()) { if ((Object)allCharacter != (Object)null && !allCharacter.IsDead() && Utils.GetPrefabName(((Component)allCharacter).gameObject) == "SeekerQueen") { return allCharacter; } } return null; } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class QueenPoisonZoneDeathPatch { [HarmonyPostfix] private static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "SeekerQueen")) { QueenPoisonZoneHandler.OnQueenDeath(); } } } internal static class QueenPoisonZoneHandler { private class PoisonZone { public Vector3 position; public float expireTime; public float lastTickTime; public GameObject vfxObject; } private static readonly List s_zones = new List(); private static Vector3 s_lastSpawnPos = Vector3.zero; private static bool s_initialized = false; private static bool s_vfxScanned = false; public static void Tick() { //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) if (!QueenConfig.PoisonEnabled.Value) { return; } float time = Time.time; float value = QueenConfig.PoisonRadius.Value; float value2 = QueenConfig.PoisonDamagePerTick.Value; float value3 = QueenConfig.PoisonTickInterval.Value; for (int num = s_zones.Count - 1; num >= 0; num--) { PoisonZone poisonZone = s_zones[num]; if (time >= poisonZone.expireTime) { if ((Object)poisonZone.vfxObject != (Object)null) { Object.Destroy((Object)poisonZone.vfxObject); } s_zones.RemoveAt(num); } else if (!(time < poisonZone.lastTickTime + value3)) { poisonZone.lastTickTime = time; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead() && !(Vector3.Distance(poisonZone.position, ((Component)allPlayer).transform.position) > value)) { HitData val = new HitData(); val.m_damage.m_poison = value2; val.m_point = ((Component)allPlayer).transform.position; val.m_dir = Vector3.up; ((Character)allPlayer).Damage(val); } } } } Character val2 = FindQueen(); if ((Object)val2 == (Object)null || val2.IsDead()) { s_initialized = false; return; } Vector3 position = ((Component)val2).transform.position; if (!s_vfxScanned && (Object)ZNetScene.instance != (Object)null) { s_vfxScanned = true; ScanPoisonVFX(); } if (!s_initialized) { s_lastSpawnPos = position; s_initialized = true; return; } float value4 = QueenConfig.PoisonMoveInterval.Value; if (!(Vector3.Distance(position, s_lastSpawnPos) < value4)) { s_lastSpawnPos = position; SpawnZone(position, time); } } private static void SpawnZone(Vector3 pos, float now) { //IL_014b: 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_0180: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) int value = QueenConfig.PoisonMaxZones.Value; if (s_zones.Count >= value) { int index = 0; for (int i = 1; i < s_zones.Count; i++) { if (s_zones[i].expireTime < s_zones[index].expireTime) { index = i; } } if ((Object)s_zones[index].vfxObject != (Object)null) { Object.Destroy((Object)s_zones[index].vfxObject); } s_zones.RemoveAt(index); } GameObject val = null; string value2 = QueenConfig.PoisonVFX.Value; if (!string.IsNullOrEmpty(value2) && (Object)ZNetScene.instance != (Object)null) { GameObject prefab = ZNetScene.instance.GetPrefab(value2); if ((Object)prefab != (Object)null) { val = Object.Instantiate(prefab, pos, Quaternion.identity); float value3 = QueenConfig.PoisonVFXScale.Value; if (!Mathf.Approximately(value3, 1f)) { Transform transform = val.transform; transform.localScale *= value3; } } else { Plugin.Log.LogWarning((object)("[더 퀸:독 장판] VFX '" + value2 + "' 없음 — bossadd.cfg에서 VFX 이름 변경")); } } s_zones.Add(new PoisonZone { position = pos, expireTime = now + QueenConfig.PoisonDuration.Value, lastTickTime = now, vfxObject = val }); Plugin.Log.LogInfo((object)$"[더 퀸:독 장판] 독 장판 생성 @ {pos:F1} (현재 {s_zones.Count}개)"); } private static Character FindQueen() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown foreach (Character allCharacter in Character.GetAllCharacters()) { if ((Object)allCharacter != (Object)null && !allCharacter.IsDead() && Utils.GetPrefabName(((Component)allCharacter).gameObject) == "SeekerQueen") { return allCharacter; } } return null; } private static void ScanPoisonVFX() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown List prefabs = ZNetScene.instance.m_prefabs; if (prefabs == null) { return; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("[더 퀸:독 장판] 독/점액 계열 VFX 후보:\n"); foreach (GameObject item in prefabs) { if (!((Object)item == (Object)null)) { string text = ((Object)item).name.ToLower(); if (text.Contains("blob") || text.Contains("poison") || text.Contains("ooze") || text.Contains("bile") || text.Contains("slime") || text.Contains("puke") || text.Contains("bonemass") || (text.Contains("seeker") && (text.Contains("vfx") || text.StartsWith("fx_")))) { stringBuilder.Append(" ").Append(((Object)item).name).Append("\n"); } } } Plugin.Log.LogInfo((object)stringBuilder.ToString()); } public static void OnQueenDeath() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown foreach (PoisonZone s_zone in s_zones) { if ((Object)s_zone.vfxObject != (Object)null) { Object.Destroy((Object)s_zone.vfxObject); } } s_zones.Clear(); s_initialized = false; s_vfxScanned = false; } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class TheElderDeathCancelRockThrowPatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "gd_king")) { TheElderRockThrowHandler.RemoveCooldown(((Object)__instance).GetInstanceID()); TheElderRockThrowHandler.CancelAll(); Plugin.Log.LogInfo((object)"[Elder:돌던지기] 엘더 사망 — 쿨타임·코루틴 초기화"); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class TheElderDeathCancelTreePatch { [HarmonyPostfix] public static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "gd_king")) { Plugin.Log.LogInfo((object)"[Elder] 보스 사망 — 나무 스폰 루프 중단"); TheElderTreeSequence.CancelAll(); } } } internal static class TheElderRockThrowHandler { private const string BossName = "gd_king"; private static readonly Dictionary s_lastThrow = new Dictionary(); private static readonly Dictionary s_active = new Dictionary(); private static int s_nextId = 0; internal static readonly Dictionary s_thrownProjectiles = new Dictionary(); public static void Tick() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown if (!TheElderConfig.RockThrowEnabled.Value) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || (Object)ZNetScene.instance == (Object)null) { return; } foreach (Character allCharacter in Character.GetAllCharacters()) { if (!((Object)allCharacter == (Object)null) && !allCharacter.IsDead() && allCharacter.IsOwner() && !(Utils.GetPrefabName(((Component)allCharacter).gameObject) != "gd_king")) { TryThrow(allCharacter); } } } private static void TryThrow(Character elder) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Expected O, but got Unknown float maxHealth = elder.GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = elder.GetHealth() / maxHealth * 100f; if (num > TheElderConfig.RockThrowHealthThreshold.Value) { return; } int instanceID = ((Object)elder).GetInstanceID(); float time = Time.time; if (!s_lastThrow.TryGetValue(instanceID, out var value) || !(time - value < TheElderConfig.RockThrowCooldown.Value)) { Player nearestPlayer = GetNearestPlayer(((Component)elder).transform.position, TheElderConfig.RockThrowDetectRange.Value); if (!((Object)nearestPlayer == (Object)null) && !(Random.value > TheElderConfig.RockThrowProcChance.Value / 100f)) { s_lastThrow[instanceID] = time; Plugin.Log.LogInfo((object)$"[Elder:돌던지기] 발동! 체력 {num:F0}% → {nearestPlayer.GetPlayerName()}"); int num2 = s_nextId++; Coroutine value2 = ((MonoBehaviour)Plugin.Instance).StartCoroutine(ThrowSequence(elder, nearestPlayer, num2)); s_active[num2] = value2; } } } private static IEnumerator ThrowSequence(Character elder, Player target, int throwId) { if ((Object)elder != (Object)null && !elder.IsDead()) { Animator componentInChildren = ((Component)elder).GetComponentInChildren(); if ((Object)componentInChildren != (Object)null) { componentInChildren.SetTrigger("shoot"); } } float value = TheElderConfig.RockThrowStartDelay.Value; if (value > 0f) { yield return (object)new WaitForSeconds(value); } if ((Object)ZNetScene.instance == (Object)null) { s_active.Remove(throwId); yield break; } if ((Object)elder == (Object)null || elder.IsDead()) { s_active.Remove(throwId); yield break; } if ((Object)target == (Object)null || ((Character)target).IsDead()) { s_active.Remove(throwId); yield break; } string value2 = TheElderConfig.RockThrowProjectilePrefab.Value; GameObject prefab = ZNetScene.instance.GetPrefab(value2); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[Elder:돌던지기] 투사체 프리팹 '" + value2 + "' 없음 — Config의 RockThrowProjectilePrefab 이름을 확인하세요")); s_active.Remove(throwId); yield break; } Vector3 centerPoint = ((Character)target).GetCenterPoint(); Vector3 val = elder.GetCenterPoint() + Vector3.up * 2f; Vector3 val2 = centerPoint - val; Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = val + normalized * 3f; Vector3 val4 = CalculateLaunchVelocity(val3, centerPoint, TheElderConfig.RockThrowSpeed.Value, TheElderConfig.RockThrowArcHeight.Value); Quaternion val5 = ((((Vector3)(ref val4)).sqrMagnitude > 0.01f) ? Quaternion.LookRotation(((Vector3)(ref val4)).normalized) : Quaternion.identity); GameObject val6 = Object.Instantiate(prefab, val3, val5); Projectile component = val6.GetComponent(); if ((Object)component != (Object)null) { HitData val7 = new HitData(); val7.m_damage.m_blunt = TheElderConfig.RockThrowDamageBlunt.Value; val7.m_dodgeable = true; val7.m_blockable = true; val7.m_hitType = (HitType)1; val7.SetAttacker(elder); component.Setup(elder, val4, -1f, val7, (ItemData)null, (ItemData)null); s_thrownProjectiles[((Object)val6).GetInstanceID()] = elder; Plugin.Log.LogInfo((object)($"[Elder:돌던지기] 발사 완료 — 속도 {((Vector3)(ref val4)).magnitude:F1} m/s " + $"/ 거리 {Vector3.Distance(val3, centerPoint):F1} m")); } else { Plugin.Log.LogWarning((object)("[Elder:돌던지기] '" + value2 + "'에 Projectile 컴포넌트 없음 — Rigidbody 물리로 대체 시도")); Rigidbody component2 = val6.GetComponent(); if ((Object)component2 != (Object)null) { component2.velocity = val4; } } s_active.Remove(throwId); } private static Player GetNearestPlayer(Vector3 origin, float maxRange) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) Player result = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(((Component)allPlayer).transform.position, origin); if (!(num2 > maxRange) && !(num2 >= num)) { num = num2; result = allPlayer; } } } return result; } private static Vector3 CalculateLaunchVelocity(Vector3 from, Vector3 to, float speed, float arcHeight) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_0071: 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_003e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = to - from; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 0f, val.z); float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude < 0.01f) { return Vector3.up * speed; } Vector3 val3 = ((Vector3)(ref val2)).normalized * magnitude + Vector3.up * (val.y + arcHeight); return ((Vector3)(ref val3)).normalized * speed; } public static void CancelAll() { if (s_active.Count > 0) { foreach (KeyValuePair item in s_active) { if (item.Value != null) { ((MonoBehaviour)Plugin.Instance).StopCoroutine(item.Value); } } Plugin.Log.LogInfo((object)$"[Elder:돌던지기] 코루틴 {s_active.Count}개 취소"); s_active.Clear(); } s_thrownProjectiles.Clear(); } public static void RemoveCooldown(int instanceId) { s_lastThrow.Remove(instanceId); } } public static class TheElderTreeSequence { private static readonly List s_active = new List(); private static readonly int s_groundMask = LayerMask.GetMask(new string[3] { "terrain", "Default", "static_solid" }); public static void Track(Coroutine co) { if (co != null) { s_active.Add(co); } } public static void CancelAll() { foreach (Coroutine item in s_active) { if (item != null) { ((MonoBehaviour)Plugin.Instance).StopCoroutine(item); } } if (s_active.Count > 0) { Plugin.Log.LogInfo((object)$"[Elder] 나무 스폰 코루틴 취소 {s_active.Count}개"); } s_active.Clear(); TheElderTreeState.ClearAll(); } internal static IEnumerator SpawnLoop(Character elder, TheElderTreeTracker tracker) { SpawnTreesAroundPlayers(elder); while (true) { yield return (object)new WaitForSeconds(TheElderConfig.TreeSpawnInterval.Value); if ((Object)elder == (Object)null || elder.IsDead() || (Object)ZNetScene.instance == (Object)null) { break; } float maxHealth = elder.GetMaxHealth(); if (maxHealth <= 0f) { break; } float num = elder.GetHealth() / maxHealth * 100f; if (num > TheElderConfig.TreeSpawnHealthThreshold.Value) { break; } SpawnTreesAroundPlayers(elder); } tracker.IsRunning = false; tracker.SpawnCoroutine = null; Plugin.Log.LogInfo((object)"[Elder] 나무 스폰 루프 종료"); } private static void SpawnTreesAroundPlayers(Character elder) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) if ((Object)ZNetScene.instance == (Object)null) { return; } string value = TheElderConfig.TreePrefab.Value; if (string.IsNullOrEmpty(value)) { return; } GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[Elder] 나무 프리팹 '" + value + "' 없음 — Config의 TreePrefab 이름을 확인하세요")); return; } float value2 = TheElderConfig.TreePlayerDetectRange.Value; float value3 = TheElderConfig.TreeSpawnRadius.Value; int value4 = TheElderConfig.TreeCount.Value; int num = 0; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead() && !(Vector3.Distance(((Component)allPlayer).transform.position, ((Component)elder).transform.position) > value2)) { num += SpawnTreeCircle(prefab, ((Component)allPlayer).transform.position, value3, value4); Plugin.Log.LogInfo((object)($"[Elder] '{allPlayer.GetPlayerName()}' 주변 나무 {value4}그루 스폰 " + $"(반경 {value3}m)")); } } if (num > 0) { Plugin.Log.LogInfo((object)$"[Elder] 총 나무 {num}그루 스폰 완료"); } } private static int SpawnTreeCircle(GameObject prefab, Vector3 center, float radius, int count) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) int num = 0; float num2 = 360f / (float)count; Vector3 val = default(Vector3); for (int i = 0; i < count; i++) { float num3 = (float)i * num2 * ((float)Math.PI / 180f); float num4 = center.x + Mathf.Sin(num3) * radius; float num5 = center.z + Mathf.Cos(num3) * radius; float groundHeight = GetGroundHeight(num4, center.y, num5); ((Vector3)(ref val))..ctor(num4, groundHeight, num5); Quaternion val2 = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f); try { Object.Instantiate(prefab, val, val2); num++; } catch (Exception ex) { Plugin.Log.LogError((object)$"[Elder] 나무 스폰 실패 (인덱스 {i}): {ex.Message}"); } } return num; } private static float GetGroundHeight(float x, float fallbackY, float z) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) Vector3 val = new Vector3(x, fallbackY + 100f, z); RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, Vector3.down, ref val2, 300f, s_groundMask)) { return ((RaycastHit)(ref val2)).point.y; } return fallbackY; } } internal static class TheElderTreeState { private static readonly Dictionary s_map = new Dictionary(); public static TheElderTreeTracker GetOrCreate(int id) { if (!s_map.TryGetValue(id, out var value)) { value = new TheElderTreeTracker(); s_map[id] = value; } return value; } public static void ClearAll() { foreach (KeyValuePair item in s_map) { item.Value.IsRunning = false; item.Value.SpawnCoroutine = null; } s_map.Clear(); } } internal class TheElderTreeTracker { public bool IsRunning; public Coroutine SpawnCoroutine; } [HarmonyPatch(typeof(Character), "Damage")] public static class TheElderTreeTriggerPatch { private const string BossName = "gd_king"; [HarmonyPostfix] public static void Postfix(Character __instance) { if (!TheElderConfig.TreeSpawnEnabled.Value || !IsElderOwner(__instance)) { return; } float maxHealth = __instance.GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = __instance.GetHealth() / maxHealth * 100f; if (!(num > TheElderConfig.TreeSpawnHealthThreshold.Value)) { TheElderTreeTracker orCreate = TheElderTreeState.GetOrCreate(((Object)__instance).GetInstanceID()); if (!orCreate.IsRunning) { Plugin.Log.LogInfo((object)$"[Elder] 나무 스폰 루프 시작! 체력 {num:F0}%"); orCreate.IsRunning = true; TheElderTreeSequence.Track(orCreate.SpawnCoroutine = ((MonoBehaviour)Plugin.Instance).StartCoroutine(TheElderTreeSequence.SpawnLoop(__instance, orCreate))); } } } private static bool IsElderOwner(Character c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown if ((Object)c == (Object)null || c.IsDead()) { return false; } if (!c.IsOwner()) { return false; } return Utils.GetPrefabName(((Component)c).gameObject) == "gd_king"; } } [HarmonyPatch(typeof(Attack), "OnAttackTrigger")] public static class YagluthDeathZoneAttackPatch { [HarmonyPrefix] private static void Prefix(Attack __instance) { YagluthDeathZoneHandler.OnAttackTrigger(__instance); } } [HarmonyPatch(typeof(Attack), "Start")] public static class YagluthDeathZoneAttackStartPatch { private static readonly FieldInfo s_charField = AccessTools.Field(typeof(Attack), "m_character"); private static readonly FieldInfo s_animField = AccessTools.Field(typeof(Attack), "m_attackAnimation"); [HarmonyPostfix] private static void Postfix(Attack __instance, bool __result) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown object obj = s_charField?.GetValue(__instance); Character val = (Character)((obj is Character) ? obj : null); if (!((Object)val == (Object)null)) { string animName = (s_animField?.GetValue(__instance) as string) ?? ""; YagluthDeathZoneHandler.OnAttackStart(val, animName, __result); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class YagluthDeathZoneDeathPatch { [HarmonyPostfix] private static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "GoblinKing")) { YagluthDeathZoneHandler.OnDeath(__instance); } } } internal static class YagluthDeathZoneHandler { private class State { public bool fired; public bool pending; public bool doAttackCalled; public bool novaStarted; public float animRestoreTime; public float origAnimSpeed = 1f; public Animator animator; } private const string PREFAB = "GoblinKing"; private static readonly Dictionary s_states = new Dictionary(); private static readonly FieldInfo s_charField = AccessTools.Field(typeof(Attack), "m_character"); private static readonly FieldInfo s_animField = AccessTools.Field(typeof(Attack), "m_attackAnimation"); private static readonly MethodInfo s_doAttack = AccessTools.Method(typeof(MonsterAI), "DoAttack", (Type[])null, (Type[])null); private static readonly FieldInfo s_charAnimField = AccessTools.Field(typeof(Character), "m_animator"); private static Animator GetCharacterAnimator(Character c) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown if (s_charAnimField != null) { object value = s_charAnimField.GetValue(c); Animator val = (Animator)((value is Animator) ? value : null); if ((Object)(object)val != (Object)null && (Object)val != (Object)null) { return val; } } return ((Component)c).GetComponentInChildren(); } private static void RestoreAnimSpeed(State st) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown if (!((Object)st.animator == (Object)null)) { st.animator.speed = st.origAnimSpeed; Plugin.Log.LogInfo((object)string.Format("[{0}:죽음의 지대] 애니메이션 속도 복원 → {1:F2}", "GoblinKing", st.origAnimSpeed)); st.animator = null; } } private static Player GetClosestPlayer(Character c) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0039: 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) Player result = null; float num = float.MaxValue; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead()) { float num2 = Vector3.Distance(((Component)c).transform.position, ((Component)allPlayer).transform.position); if (num2 < num) { num = num2; result = allPlayer; } } } return result; } public static void Tick() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown if (!YagluthConfig.DeathZoneEnabled.Value) { return; } float time = Time.time; foreach (Character allCharacter in Character.GetAllCharacters()) { if ((Object)allCharacter == (Object)null || allCharacter.IsDead() || Utils.GetPrefabName(((Component)allCharacter).gameObject) != "GoblinKing" || !allCharacter.IsOwner()) { continue; } int instanceID = ((Object)((Component)allCharacter).gameObject).GetInstanceID(); if (!s_states.TryGetValue(instanceID, out var value)) { State state = (s_states[instanceID] = new State()); value = state; } if (value.animRestoreTime > 0f && time >= value.animRestoreTime) { RestoreAnimSpeed(value); value.animRestoreTime = 0f; } if (value.pending && value.novaStarted && (Object)value.animator != (Object)null) { value.animator.speed = YagluthConfig.DeathZoneAnimSpeedScale.Value; } if (value.pending) { if (value.doAttackCalled || allCharacter.InAttack()) { continue; } MonsterAI component = ((Component)allCharacter).GetComponent(); if ((Object)component != (Object)null && s_doAttack != null) { Player closestPlayer = GetClosestPlayer(allCharacter); if ((bool)(s_doAttack.Invoke(component, new object[2] { closestPlayer, false }) ?? ((object)false))) { value.doAttackCalled = true; Plugin.Log.LogInfo((object)"[GoblinKing:죽음의 지대] 행동 완료 후 DoAttack 성공 — nova 대기 중"); } } } else { if (value.fired) { continue; } float maxHealth = allCharacter.GetMaxHealth(); if (maxHealth <= 0f || allCharacter.GetHealth() / maxHealth * 100f > YagluthConfig.DeathZoneHPThreshold.Value) { continue; } value.pending = true; string value2 = YagluthConfig.DeathZoneWarningMessage.Value; if (!string.IsNullOrEmpty(value2)) { MessageHud instance = MessageHud.instance; if ((Object)(object)instance != (Object)null) { instance.ShowMessage((MessageType)2, value2, 0, (Sprite)null, false); } } Plugin.Log.LogInfo((object)"[GoblinKing:죽음의 지대] HP 임계값 도달 — 현재 행동 완료 후 nova 강제 실행 예정"); } } } public static void OnAttackTrigger(Attack attack) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Expected O, but got Unknown //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) if (s_charField == null || s_animField == null) { return; } object value = s_charField.GetValue(attack); Character val = (Character)((value is Character) ? value : null); if ((Object)val == (Object)null || Utils.GetPrefabName(((Component)val).gameObject) != "GoblinKing") { return; } string text = (s_animField.GetValue(attack) as string) ?? ""; Plugin.Log.LogInfo((object)("[GoblinKing:죽음의 지대] 공격 감지: '" + text + "'")); int instanceID = ((Object)((Component)val).gameObject).GetInstanceID(); if (!s_states.TryGetValue(instanceID, out var value2) || !value2.pending) { return; } string value3 = YagluthConfig.DeathZoneAttackAnim.Value; if (!string.IsNullOrEmpty(value3) && text != value3) { return; } value2.pending = false; value2.fired = true; value2.novaStarted = false; string value4 = YagluthConfig.DeathZoneVFX.Value; if (!string.IsNullOrEmpty(value4) && (Object)ZNetScene.instance != (Object)null) { GameObject prefab = ZNetScene.instance.GetPrefab(value4); if ((Object)prefab != (Object)null) { GameObject val2 = Object.Instantiate(prefab, ((Component)val).transform.position, Quaternion.identity); float value5 = YagluthConfig.DeathZoneVFXScale.Value; if (!Mathf.Approximately(value5, 1f)) { Transform transform = val2.transform; transform.localScale *= value5; } Object.Destroy((Object)val2, 6f); } else { Plugin.Log.LogWarning((object)("[GoblinKing:죽음의 지대] VFX '" + value4 + "' 없음")); } } string value6 = YagluthConfig.DeathZonePhaseMessage.Value; if (!string.IsNullOrEmpty(value6)) { MessageHud instance = MessageHud.instance; if ((Object)(object)instance != (Object)null) { instance.ShowMessage((MessageType)2, value6, 0, (Sprite)null, false); } } float value7 = YagluthConfig.DeathZoneRadius.Value; float num = YagluthConfig.DeathZoneHPDrainPercent.Value / 100f; int num2 = 0; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead() && !(Vector3.Distance(((Component)val).transform.position, ((Component)allPlayer).transform.position) > value7)) { float health = Mathf.Max(1f, ((Character)allPlayer).GetHealth() - ((Character)allPlayer).GetMaxHealth() * num); ((Character)allPlayer).SetHealth(health); num2++; } } value2.animRestoreTime = Time.time + 4f; Plugin.Log.LogInfo((object)string.Format("[{0}:죽음의 지대] 발동! anim='{1}', 반경={2}m, {3}명 피격", "GoblinKing", text, value7, num2)); } public static void OnAttackStart(Character character, string animName, bool success) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown if (!success || Utils.GetPrefabName(((Component)character).gameObject) != "GoblinKing") { return; } string value = YagluthConfig.DeathZoneAttackAnim.Value; int instanceID = ((Object)((Component)character).gameObject).GetInstanceID(); if (s_states.TryGetValue(instanceID, out var value2) && value2.pending && (string.IsNullOrEmpty(value) || !(animName != value))) { value2.novaStarted = true; Animator characterAnimator = GetCharacterAnimator(character); if ((Object)characterAnimator != (Object)null) { value2.animator = characterAnimator; value2.origAnimSpeed = characterAnimator.speed; characterAnimator.speed = YagluthConfig.DeathZoneAnimSpeedScale.Value; Plugin.Log.LogInfo((object)string.Format("[{0}:죽음의 지대] nova 시작 → 슬로우 {1:F2} → {2:F2}", "GoblinKing", value2.origAnimSpeed, characterAnimator.speed)); } else { Plugin.Log.LogWarning((object)"[GoblinKing:죽음의 지대] Attack.Start에서 Animator null"); } } } public static void OnDeath(Character yagluth) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown int instanceID = ((Object)((Component)yagluth).gameObject).GetInstanceID(); if (s_states.TryGetValue(instanceID, out var value)) { if ((Object)value.animator != (Object)null) { RestoreAnimSpeed(value); } s_states.Remove(instanceID); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class YagluthMeteorFireDeathPatch { [HarmonyPostfix] private static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "GoblinKing")) { YagluthMeteorFireHandler.ClearBoss(((Object)((Component)__instance).gameObject).GetInstanceID()); } } } [HarmonyPatch(typeof(EffectList), "Create")] public static class YagluthMeteorFireEffectPatch { [HarmonyPrefix] private static void Prefix(EffectList __instance, Vector3 basePos) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00e2: 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) if (!YagluthConfig.MeteorFireEnabled.Value || __instance.m_effectPrefabs == null) { return; } bool flag = false; EffectData[] effectPrefabs = __instance.m_effectPrefabs; foreach (EffectData val in effectPrefabs) { if ((Object)(val?.m_prefab) != (Object)null && ((Object)val.m_prefab).name == "fx_goblinking_meteor_hit") { flag = true; break; } } if (!flag) { return; } Character val2 = null; foreach (Character allCharacter in Character.GetAllCharacters()) { if ((Object)allCharacter != (Object)null && Utils.GetPrefabName(((Component)allCharacter).gameObject) == "GoblinKing") { val2 = allCharacter; break; } } if (!((Object)val2 == (Object)null)) { Plugin.Log.LogInfo((object)$"[GoblinKing:운석 장판] 운석 착지 감지 @ {basePos:F1}"); YagluthMeteorFireHandler.OnMeteorHit(val2, basePos); } } } internal static class YagluthMeteorFireHandler { private class FireZone { public Vector3 position; public float expireTime; public float lastTickTime; public GameObject vfxObject; } private static readonly List s_zones = new List(); private static readonly HashSet s_msgShown = new HashSet(); public static void Tick() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) if (!YagluthConfig.MeteorFireEnabled.Value || s_zones.Count == 0) { return; } float time = Time.time; float value = YagluthConfig.MeteorFireRadius.Value; float value2 = YagluthConfig.MeteorFireDamagePerTick.Value; float value3 = YagluthConfig.MeteorFireTickInterval.Value; for (int num = s_zones.Count - 1; num >= 0; num--) { FireZone fireZone = s_zones[num]; if (time >= fireZone.expireTime) { if ((Object)fireZone.vfxObject != (Object)null) { Object.Destroy((Object)fireZone.vfxObject); } s_zones.RemoveAt(num); } else if (!(time < fireZone.lastTickTime + value3)) { fireZone.lastTickTime = time; foreach (Player allPlayer in Player.GetAllPlayers()) { if (!((Object)allPlayer == (Object)null) && !((Character)allPlayer).IsDead() && !(Vector3.Distance(fireZone.position, ((Component)allPlayer).transform.position) > value)) { HitData val = new HitData(); val.m_damage.m_fire = value2; val.m_point = ((Component)allPlayer).transform.position; val.m_dir = Vector3.up; ((Character)allPlayer).Damage(val); } } } } } public static void OnMeteorHit(Character goblinKing, Vector3 hitPoint) { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_0180: 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_008f: Expected O, but got Unknown //IL_0093: 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_00c0: 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) if (!YagluthConfig.MeteorFireEnabled.Value) { return; } float maxHealth = goblinKing.GetMaxHealth(); if (maxHealth > 0f && goblinKing.GetHealth() / maxHealth * 100f > YagluthConfig.MeteorFireHPThreshold.Value) { return; } float time = Time.time; float value = YagluthConfig.MeteorFireDuration.Value; GameObject val = null; string value2 = YagluthConfig.MeteorFireVFX.Value; if (!string.IsNullOrEmpty(value2) && (Object)ZNetScene.instance != (Object)null) { GameObject prefab = ZNetScene.instance.GetPrefab(value2); if ((Object)prefab != (Object)null) { val = Object.Instantiate(prefab, hitPoint, Quaternion.identity); float value3 = YagluthConfig.MeteorFireVFXScale.Value; if (!Mathf.Approximately(value3, 1f)) { Transform transform = val.transform; transform.localScale *= value3; } } else { Plugin.Log.LogWarning((object)("[GoblinKing:운석 장판] VFX '" + value2 + "' 없음")); } } s_zones.Add(new FireZone { position = hitPoint, expireTime = time + value, lastTickTime = time, vfxObject = val }); int instanceID = ((Object)((Component)goblinKing).gameObject).GetInstanceID(); if (!s_msgShown.Contains(instanceID)) { s_msgShown.Add(instanceID); string value4 = YagluthConfig.MeteorFirePhaseMessage.Value; if (!string.IsNullOrEmpty(value4)) { MessageHud instance = MessageHud.instance; if ((Object)(object)instance != (Object)null) { instance.ShowMessage((MessageType)2, value4, 0, (Sprite)null, false); } } } Plugin.Log.LogInfo((object)$"[GoblinKing:운석 장판] 화염 장판 생성 @ {hitPoint:F1}, {value}s 지속"); } public static void ClearBoss(int instanceId) { s_msgShown.Remove(instanceId); } } [HarmonyPatch(typeof(Character), "Damage")] public static class YagluthRageAccumulatePatch { [HarmonyPostfix] private static void Postfix(Character __instance, HitData hit) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "GoblinKing") && !__instance.IsDead()) { YagluthRageHandler.OnDamageTaken(__instance, hit); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class YagluthRageDamagePatch { [HarmonyPrefix] private static void Prefix(HitData hit) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (YagluthRageHandler.IsRaging(hit.m_attacker)) { ((DamageTypes)(ref hit.m_damage)).Modify(YagluthConfig.RageDamageMult.Value); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class YagluthRageDeathPatch { [HarmonyPostfix] private static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "GoblinKing")) { YagluthRageHandler.OnDeath(__instance); } } } internal static class YagluthRageHandler { private class RageState { public float gauge; public bool inRage; public float rageEndTime; public float cooldownEnd; public float origWalkSpeed; public float origRunSpeed; public ZDOID zdoid; } private const string PREFAB = "GoblinKing"; private static readonly Dictionary s_states = new Dictionary(); private static readonly HashSet s_raging = new HashSet(); internal static bool IsRaging(ZDOID id) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return s_raging.Contains(id); } public static void Tick() { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (s_states.Count == 0) { return; } float time = Time.time; foreach (KeyValuePair s_state in s_states) { RageState value = s_state.Value; if (!value.inRage || time < value.rageEndTime) { continue; } foreach (Character allCharacter in Character.GetAllCharacters()) { if (((Object)((Component)allCharacter).gameObject).GetInstanceID() == s_state.Key) { allCharacter.m_walkSpeed = value.origWalkSpeed; allCharacter.m_runSpeed = value.origRunSpeed; Plugin.Log.LogInfo((object)"[GoblinKing:분노] 분노 종료 → 속도 복원"); break; } } value.inRage = false; value.gauge = 0f; value.cooldownEnd = time + YagluthConfig.RageCooldown.Value; s_raging.Remove(value.zdoid); } } public static void OnDamageTaken(Character yagluth, HitData hit) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) if (!YagluthConfig.RageEnabled.Value || !yagluth.IsOwner()) { return; } int instanceID = ((Object)((Component)yagluth).gameObject).GetInstanceID(); if (!s_states.TryGetValue(instanceID, out var value)) { value = new RageState { zdoid = yagluth.GetZDOID() }; s_states[instanceID] = value; } if (value.inRage) { return; } float time = Time.time; if (time < value.cooldownEnd) { return; } float maxHealth = yagluth.GetMaxHealth(); if (maxHealth > 0f && yagluth.GetHealth() / maxHealth * 100f > YagluthConfig.RageHPThreshold.Value) { return; } value.gauge += hit.GetTotalDamage(); Plugin.Log.LogDebug((object)string.Format("[{0}:분노] 게이지 {1:F0}/{2:F0}", "GoblinKing", value.gauge, YagluthConfig.RageMaxGauge.Value)); if (value.gauge < YagluthConfig.RageMaxGauge.Value) { return; } value.origWalkSpeed = yagluth.m_walkSpeed; value.origRunSpeed = yagluth.m_runSpeed; float value2 = YagluthConfig.RageSpeedMult.Value; yagluth.m_walkSpeed = value.origWalkSpeed * value2; yagluth.m_runSpeed = value.origRunSpeed * value2; value.inRage = true; value.rageEndTime = time + YagluthConfig.RageDuration.Value; value.zdoid = yagluth.GetZDOID(); s_raging.Add(value.zdoid); SpawnVFX(((Component)yagluth).transform.position); string value3 = YagluthConfig.RagePhaseMessage.Value; if (!string.IsNullOrEmpty(value3)) { MessageHud instance = MessageHud.instance; if ((Object)(object)instance != (Object)null) { instance.ShowMessage((MessageType)2, value3, 0, (Sprite)null, false); } } Plugin.Log.LogInfo((object)string.Format("[{0}:분노] 분노 발동! 속도×{1} / 데미지×{2} / {3}s", "GoblinKing", value2, YagluthConfig.RageDamageMult.Value, YagluthConfig.RageDuration.Value)); } public static void OnDeath(Character yagluth) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) int instanceID = ((Object)((Component)yagluth).gameObject).GetInstanceID(); if (s_states.TryGetValue(instanceID, out var value)) { s_raging.Remove(value.zdoid); s_states.Remove(instanceID); } } private static void SpawnVFX(Vector3 pos) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) string value = YagluthConfig.RageVFX.Value; if (!string.IsNullOrEmpty(value) && !((Object)ZNetScene.instance == (Object)null)) { GameObject prefab = ZNetScene.instance.GetPrefab(value); if ((Object)prefab == (Object)null) { Plugin.Log.LogWarning((object)("[GoblinKing:분노] VFX 없음: " + value)); } else { Object.Instantiate(prefab, pos, Quaternion.identity); } } } } [HarmonyPatch(typeof(Character), "Damage")] public static class YagluthSkeletonDamageBlockPatch { private static float s_lastMsgTime = -99f; [HarmonyPrefix] private static bool Prefix(Character __instance) { if (!YagluthConfig.SkeletonEnabled.Value) { return true; } if (!YagluthConfig.SkeletonDamageBlockEnabled.Value) { return true; } if (Utils.GetPrefabName(((Component)__instance).gameObject) != "GoblinKing") { return true; } if (!YagluthSkeletonKillTracker.HasLiving()) { return true; } if (Time.time - s_lastMsgTime > 3f) { s_lastMsgTime = Time.time; string value = YagluthConfig.SkeletonDamageBlockMessage.Value; if (!string.IsNullOrEmpty(value)) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { ((Character)localPlayer).Message((MessageType)2, value, 0, (Sprite)null); } } } return false; } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class YagluthSkeletonDeathPatch { [HarmonyPostfix] private static void Postfix(Character __instance) { if (!(Utils.GetPrefabName(((Component)__instance).gameObject) != "GoblinKing")) { YagluthSkeletonSummonPatch.OnDeath(((Object)__instance).GetInstanceID()); YagluthSkeletonKillTracker.Reset(); } } } internal static class YagluthSkeletonKillTracker { private static readonly HashSet s_living = new HashSet(); public static void Register(GameObject go) { s_living.Add(((Object)go).GetInstanceID()); Plugin.Log.LogInfo((object)$"[GoblinKing:뼈기사] 등록 id={((Object)go).GetInstanceID()}, 생존={s_living.Count}"); } public static void OnDied(int instanceId) { if (s_living.Remove(instanceId)) { Plugin.Log.LogInfo((object)$"[GoblinKing:뼈기사] 사망 확인 id={instanceId}, 잔여={s_living.Count}"); } } public static bool HasLiving() { return s_living.Count > 0; } public static void Reset() { s_living.Clear(); Plugin.Log.LogInfo((object)"[GoblinKing:뼈기사] 트래커 초기화"); } } [HarmonyPatch(typeof(Character), "Damage")] public static class YagluthSkeletonSummonPatch { private static readonly Dictionary> s_triggered = new Dictionary>(); [HarmonyPostfix] private static void Postfix(Character __instance) { if (Utils.GetPrefabName(((Component)__instance).gameObject) != "GoblinKing" || !YagluthConfig.SkeletonEnabled.Value || !__instance.IsOwner() || __instance.IsDead()) { return; } float maxHealth = __instance.GetMaxHealth(); if (maxHealth <= 0f) { return; } float num = __instance.GetHealth() / maxHealth * 100f; int instanceID = ((Object)__instance).GetInstanceID(); if (!s_triggered.TryGetValue(instanceID, out var value)) { HashSet hashSet = (s_triggered[instanceID] = new HashSet()); value = hashSet; } (float, string, string)[] array = new(float, string, string)[3] { (YagluthConfig.SkeletonHP1.Value, YagluthConfig.SkeletonPrefab1.Value, YagluthConfig.SkeletonPhaseMessage1.Value), (YagluthConfig.SkeletonHP2.Value, YagluthConfig.SkeletonPrefab2.Value, YagluthConfig.SkeletonPhaseMessage2.Value), (YagluthConfig.SkeletonHP3.Value, YagluthConfig.SkeletonPrefab3.Value, YagluthConfig.SkeletonPhaseMessage3.Value) }; for (int i = 0; i < array.Length; i++) { if (!value.Contains(i) && !(num > array[i].Item1)) { value.Add(i); DoSummon(__instance, array[i].Item1, array[i].Item2, array[i].Item3); } } } private static void DoSummon(Character yagluth, float threshold, string prefabName, string msg) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown if ((Object)ZNetScene.instance == (Object)null) { return; } int num = Mathf.Max(1, YagluthConfig.SkeletonCount.Value); int num2 = Mathf.Clamp(YagluthConfig.SkeletonLevel.Value, 1, 5); GameObject prefab = ZNetScene.instance.GetPrefab(prefabName); if ((Object)prefab == (Object)null) { Plugin.Log.LogError((object)("[GoblinKing:해골 소환] 프리팹 '" + prefabName + "' 없음")); return; } string value = YagluthConfig.SkeletonVFX.Value; if (!string.IsNullOrEmpty(value)) { GameObject prefab2 = ZNetScene.instance.GetPrefab(value); if ((Object)prefab2 != (Object)null) { Object.Destroy((Object)Object.Instantiate(prefab2, ((Component)yagluth).transform.position, Quaternion.identity), 5f); } else { Plugin.Log.LogWarning((object)("[GoblinKing:해골 소환] VFX '" + value + "' 없음")); } } Vector3 position = ((Component)yagluth).transform.position; Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { float num3 = ((num > 1) ? (360f / (float)num * (float)i) : 0f); ((Vector3)(ref val))..ctor(Mathf.Sin(num3 * ((float)Math.PI / 180f)) * 5f, 0f, Mathf.Cos(num3 * ((float)Math.PI / 180f)) * 5f); GameObject val2 = Object.Instantiate(prefab, position + val, Quaternion.identity); if ((Object)val2 != (Object)null) { Character component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.SetLevel(num2); } YagluthSkeletonKillTracker.Register(val2); } } if (!string.IsNullOrEmpty(msg)) { MessageHud instance = MessageHud.instance; if ((Object)(object)instance != (Object)null) { instance.ShowMessage((MessageType)2, msg, 0, (Sprite)null, false); } } Plugin.Log.LogInfo((object)$"[GoblinKing:해골 소환] {prefabName} x{num} (Lv.{num2}) @ 체력 {threshold:F0}% 구간"); } internal static void OnDeath(int instanceId) { s_triggered.Remove(instanceId); } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class YagluthSummonedSkeletonDeathPatch { [HarmonyPostfix] private static void Postfix(Character __instance) { YagluthSkeletonKillTracker.OnDied(((Object)((Component)__instance).gameObject).GetInstanceID()); } } }