using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Logging; using HarmonyLib; using Jotunn.Utils; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("AichoGuardian")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AichoGuardian")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("D28110A9-E229-4700-AD4D-DCD37486A82B")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace EikthyrTracker; [BepInPlugin("com.tumod.eikthyrtracker", "EikthyrTracker", "3.7.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class EikthyrTrackerPlugin : BaseUnityPlugin { public const string PluginGUID = "com.tumod.eikthyrtracker"; public const string PluginName = "EikthyrTracker"; public const string PluginVersion = "3.7.0"; internal static ManualLogSource Log; private Harmony _harmony; private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"[EikthyrTracker] cargando..."); _harmony = new Harmony("com.tumod.eikthyrtracker"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); Log.LogInfo((object)"[EikthyrTracker] Harmony cargado correctamente."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } internal static bool IsEikthyr(Character c) { if (!Object.op_Implicit((Object)(object)c)) { return false; } return Utils.GetPrefabName(((Component)c).gameObject) == "Eikthyr"; } } [HarmonyPatch(typeof(ZNet), "Start")] public static class Patch_ZNet_Start_RPCInit { private static void Postfix() { if (ZRoutedRpc.instance == null) { EikthyrTrackerPlugin.Log.LogWarning((object)"[EikthyrTracker] ZRoutedRpc no disponible en ZNet.Start."); return; } RPC.RegisterRPCs(); PhaseSystem.StartMonitoring(); ManualLogSource log = EikthyrTrackerPlugin.Log; ZNet instance = ZNet.instance; log.LogInfo((object)$"[EikthyrTracker] RPCs registrados | isServer={((instance != null) ? new bool?(instance.IsServer()) : null)}"); } } public static class AttackClients { [CompilerGenerated] private sealed class d__7 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Vector3 bossPos; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; ZNetScene instance = ZNetScene.instance; GameObject val = ((instance != null) ? instance.GetPrefab("lightningAOE") : null); if ((Object)(object)val == (Object)null) { return false; } GameObject val2 = Object.Instantiate(val, bossPos, Quaternion.identity); ParticleSystem[] componentsInChildren = val2.GetComponentsInChildren(); foreach (ParticleSystem val3 in componentsInChildren) { MainModule main = val3.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.cyan); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public List group1; public List group2; private List 5__2; private List 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Expected O, but got Unknown //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00b9: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; ZNetScene instance = ZNetScene.instance; GameObject val = ((instance != null) ? instance.GetPrefab("lightningAOE") : null); if ((Object)(object)val == (Object)null) { return false; } 5__2 = new List(); foreach (Vector3 item in group1) { 5__2.Add(SpawnWarningCircle(item, 1.5f, Color.cyan)); } <>2__current = (object)new WaitForSeconds(1.2f); <>1__state = 1; return true; } case 1: <>1__state = -1; foreach (GameObject item2 in 5__2) { SetCircleColor(item2, Color.white); } <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 2; return true; case 2: <>1__state = -1; foreach (GameObject item3 in 5__2) { SetCircleColor(item3, Color.yellow); } <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 3; return true; case 3: <>1__state = -1; foreach (GameObject item4 in 5__2) { if (Object.op_Implicit((Object)(object)item4)) { Object.Destroy((Object)(object)item4); } } foreach (Vector3 item5 in group1) { SpawnLocalFX("lightningAOE", item5, Color.cyan); } 5__3 = new List(); foreach (Vector3 item6 in group2) { 5__3.Add(SpawnWarningCircle(item6, 1.5f, Color.cyan)); } <>2__current = (object)new WaitForSeconds(1.2f); <>1__state = 4; return true; case 4: <>1__state = -1; foreach (GameObject item7 in 5__3) { SetCircleColor(item7, Color.white); } <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 5; return true; case 5: <>1__state = -1; foreach (GameObject item8 in 5__3) { SetCircleColor(item8, Color.yellow); } <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 6; return true; case 6: <>1__state = -1; foreach (GameObject item9 in 5__3) { if (Object.op_Implicit((Object)(object)item9)) { Object.Destroy((Object)(object)item9); } } foreach (Vector3 item10 in group2) { SpawnLocalFX("lightningAOE", item10, Color.cyan); } EikthyrTrackerPlugin.Log.LogInfo((object)"[Rays] Visuales ejecutados."); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__10 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Vector3 bossPos; private int 5__2; private float 5__3; private List 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; ZNetScene instance = ZNetScene.instance; GameObject val3 = ((instance != null) ? instance.GetPrefab("lightningAOE") : null); if ((Object)(object)val3 == (Object)null) { return false; } 5__2 = 8; 5__3 = 4f; 5__4 = new List(); for (int j = 0; j < 5__2; j++) { float num2 = 360f / (float)5__2 * (float)j * ((float)Math.PI / 180f); Vector3 center = bossPos + new Vector3(Mathf.Sin(num2) * 5__3, 0f, Mathf.Cos(num2) * 5__3); 5__4.Add(SpawnWarningCircle(center, 1.5f, Color.yellow)); } <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; } case 1: <>1__state = -1; foreach (GameObject item in 5__4) { SetCircleColor(item, Color.white); } <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 2; return true; case 2: { <>1__state = -1; foreach (GameObject item2 in 5__4) { if (Object.op_Implicit((Object)(object)item2)) { Object.Destroy((Object)(object)item2); } } RaycastHit val2 = default(RaycastHit); for (int i = 0; i < 5__2; i++) { float num = 360f / (float)5__2 * (float)i * ((float)Math.PI / 180f); Vector3 val = bossPos + new Vector3(Mathf.Sin(num) * 5__3, 0f, Mathf.Cos(num) * 5__3); if (Physics.Raycast(val + Vector3.up * 50f, Vector3.down, ref val2, 100f)) { val.y = ((RaycastHit)(ref val2)).point.y; } SpawnLocalFX("lightningAOE", val, Color.yellow); } EikthyrTrackerPlugin.Log.LogInfo((object)"[Stomp] Visuales ejecutados (local-only)."); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Vector3 ParseVec(string s, CultureInfo ci) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) string[] array = s.Split(new char[1] { ',' }); if (array.Length < 3) { return Vector3.zero; } return new Vector3(float.Parse(array[0], ci), float.Parse(array[1], ci), float.Parse(array[2], ci)); } public static string VecToStr(Vector3 v, CultureInfo ci) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) return string.Format(ci, "{0},{1},{2}", v.x, v.y, v.z); } public static GameObject SpawnWarningCircle(Vector3 center, float radius, Color color) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_0069: 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_00a0: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("EK_WarningCircle"); val.transform.position = center + Vector3.up * 0.1f; LineRenderer val2 = val.AddComponent(); val2.useWorldSpace = false; val2.loop = true; val2.widthMultiplier = 0.12f; val2.positionCount = 32; ((Renderer)val2).material = new Material(Shader.Find("Sprites/Default")); val2.startColor = color; val2.endColor = color; for (int i = 0; i < 32; i++) { float num = 11.25f * (float)i * ((float)Math.PI / 180f); val2.SetPosition(i, new Vector3(Mathf.Sin(num) * radius, 0f, Mathf.Cos(num) * radius)); } return val; } public static void SetCircleColor(GameObject go, Color color) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)go)) { LineRenderer component = go.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.startColor = color; component.endColor = color; } } } public static void SpawnLocalFX(string prefabName, Vector3 pos, Color color, float lifetime = 3f) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0141: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Expected O, but got Unknown //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) ZNetScene instance = ZNetScene.instance; GameObject val = ((instance != null) ? instance.GetPrefab(prefabName) : null); if ((Object)(object)val == (Object)null) { return; } GameObject val2 = new GameObject("EK_FX_" + prefabName + "_Local"); val2.transform.position = pos; ParticleSystem[] componentsInChildren = val.GetComponentsInChildren(true); foreach (ParticleSystem val3 in componentsInChildren) { GameObject val4 = Object.Instantiate(((Component)val3).gameObject, pos, ((Component)val3).transform.rotation, val2.transform); ZNetView[] componentsInChildren2 = val4.GetComponentsInChildren(true); foreach (ZNetView val5 in componentsInChildren2) { Object.Destroy((Object)(object)val5); } ZSyncTransform[] componentsInChildren3 = val4.GetComponentsInChildren(true); foreach (ZSyncTransform val6 in componentsInChildren3) { Object.Destroy((Object)(object)val6); } MainModule main = val4.GetComponent().main; ((MainModule)(ref main)).startColor = new MinMaxGradient(color); } AudioSource[] componentsInChildren4 = val.GetComponentsInChildren(true); foreach (AudioSource val7 in componentsInChildren4) { if (!((Object)(object)val7.clip == (Object)null)) { GameObject val8 = new GameObject("EK_Audio"); val8.transform.SetParent(val2.transform); val8.transform.position = pos; AudioSource val9 = val8.AddComponent(); val9.clip = val7.clip; val9.volume = val7.volume; val9.pitch = val7.pitch; val9.spatialBlend = val7.spatialBlend; val9.minDistance = val7.minDistance; val9.maxDistance = val7.maxDistance; val9.rolloffMode = val7.rolloffMode; val9.Play(); } } ZSFX[] componentsInChildren5 = val.GetComponentsInChildren(true); foreach (ZSFX val10 in componentsInChildren5) { if (val10.m_audioClips != null && val10.m_audioClips.Length != 0) { GameObject val11 = new GameObject("EK_ZSFX_Audio"); val11.transform.SetParent(val2.transform); val11.transform.position = pos; AudioSource component = ((Component)val10).GetComponent(); AudioSource val12 = val11.AddComponent(); if ((Object)(object)component != (Object)null) { val12.spatialBlend = component.spatialBlend; val12.minDistance = component.minDistance; val12.maxDistance = component.maxDistance; val12.rolloffMode = component.rolloffMode; val12.spread = component.spread; } val12.clip = val10.m_audioClips[Random.Range(0, val10.m_audioClips.Length)]; val12.volume = Random.Range(val10.m_minVol, val10.m_maxVol) * 0.5f; val12.pitch = Random.Range(val10.m_minPitch, val10.m_maxPitch); val12.Play(); } } Object.Destroy((Object)(object)val2, lifetime); } public static void ExecuteLightningRays(string payload, MonoBehaviour runner) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) CultureInfo invariantCulture = CultureInfo.InvariantCulture; Vector3 bossPos = ParseVec(payload, invariantCulture); runner.StartCoroutine(CoLightningRays(bossPos)); } public static void ExecuteLightningRaysWithGroups(string payload, MonoBehaviour runner) { //IL_0073: 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) CultureInfo invariantCulture = CultureInfo.InvariantCulture; string[] array = payload.Split(new char[1] { '|' }); if (array.Length < 3) { EikthyrTrackerPlugin.Log.LogError((object)("[Rays] payload inválido: '" + payload + "'")); return; } List list = new List(); List list2 = new List(); string[] array2 = array[1].Split(new char[1] { ';' }); foreach (string text in array2) { if (!string.IsNullOrEmpty(text)) { list.Add(ParseVec(text, invariantCulture)); } } string[] array3 = array[2].Split(new char[1] { ';' }); foreach (string text2 in array3) { if (!string.IsNullOrEmpty(text2)) { list2.Add(ParseVec(text2, invariantCulture)); } } runner.StartCoroutine(CoLightningRaysVisuals(list, list2)); } [IteratorStateMachine(typeof(d__7))] private static IEnumerator CoLightningRays(Vector3 bossPos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { bossPos = bossPos }; } [IteratorStateMachine(typeof(d__8))] private static IEnumerator CoLightningRaysVisuals(List group1, List group2) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0) { group1 = group1, group2 = group2 }; } public static void ExecuteStompAOE(string payload, MonoBehaviour runner) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) CultureInfo invariantCulture = CultureInfo.InvariantCulture; Vector3 bossPos = ParseVec(payload, invariantCulture); runner.StartCoroutine(CoStompAOE(bossPos)); } [IteratorStateMachine(typeof(d__10))] private static IEnumerator CoStompAOE(Vector3 bossPos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__10(0) { bossPos = bossPos }; } } public static class ServerCoroutineRunner { private static ServerCoroutineRunnerMB _instance; private static ServerCoroutineRunnerMB Instance { get { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { GameObject val = new GameObject("EikthyrServerRunner"); Object.DontDestroyOnLoad((Object)(object)val); _instance = val.AddComponent(); } return _instance; } } public static void Run(IEnumerator coroutine) { ((MonoBehaviour)Instance).StartCoroutine(coroutine); } public static Coroutine RunAndWait(IEnumerator coroutine) { return ((MonoBehaviour)Instance).StartCoroutine(coroutine); } } public class ServerCoroutineRunnerMB : MonoBehaviour { } public static class RPC { [CompilerGenerated] private sealed class d__34 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float delay; public Player player; public bool checkProximity; public Vector3 impactPos; public float dmg; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__34(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (delay > 0f) { <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; } break; case 1: <>1__state = -1; break; } if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } if (checkProximity && Vector3.Distance(((Component)player).transform.position, impactPos) > 3f) { EikthyrTrackerPlugin.Log.LogInfo((object)$"[CLIENT Rays] Jugador fuera del rayo ({Vector3.Distance(((Component)player).transform.position, impactPos):F1}u) — daño cancelado."); return false; } HitData val = new HitData(); val.m_point = ((Component)player).transform.position; val.m_damage.m_lightning = dmg; val.m_ranged = true; val.m_hitType = (HitType)16; ((Character)player).Damage(val); EikthyrTrackerPlugin.Log.LogWarning((object)$"[CLIENT Rays] \ud83d\udca5 Daño: {dmg} lightning"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__25 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Vector3 bossPos; private float 5__2; private float 5__3; private int 5__4; private float 5__5; private int 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__25(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; 5__3 += 0.1f; if (5__3 >= 5__2) { return false; } 5__6++; goto IL_012a; } <>1__state = -1; 5__2 = 4f; 5__3 = 0f; goto IL_013b; IL_013b: if (5__3 < 5__2) { AttackClients.SpawnLocalFX("fx_himminafl_hit", bossPos + Vector3.up, Color.yellow); 5__4 = 8; 5__5 = 6f; 5__6 = 0; goto IL_012a; } return false; IL_012a: if (5__6 < 5__4) { float num2 = 360f / (float)5__4 * (float)5__6 * ((float)Math.PI / 180f); Vector3 pos = bossPos + new Vector3(Mathf.Sin(num2) * 5__5, 0f, Mathf.Cos(num2) * 5__5); AttackClients.SpawnLocalFX("fx_himminafl_aoe", pos, Color.yellow); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } goto IL_013b; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__36 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Vector3 bossPos; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.8f); <>1__state = 1; return true; case 1: { <>1__state = -1; int num = 8; float num2 = 4f; foreach (ZNetPeer connectedPeer in ZNet.instance.GetConnectedPeers()) { if (connectedPeer.m_characterID == ZDOID.None) { continue; } ZDO zDO = ZDOMan.instance.GetZDO(connectedPeer.m_characterID); if (zDO == null) { continue; } Vector3 position = zDO.GetPosition(); bool flag = false; for (int i = 0; i < num; i++) { float num3 = 360f / (float)num * (float)i * ((float)Math.PI / 180f); Vector3 val = bossPos + new Vector3(Mathf.Sin(num3) * num2, 0f, Mathf.Cos(num3) * num2); if (Vector3.Distance(position, val) <= 2.5f) { flag = true; break; } } if (flag) { ZRoutedRpc.instance.InvokeRoutedRPC(connectedPeer.m_uid, "EikthyrTracker_StompDamage", new object[1] { "15" }); Log.LogWarning((object)("[SERVER Stomp] \ud83d\udca5 Daño → " + connectedPeer.m_playerName)); } } _stompInProgress = false; EikthyrTrackerPlugin.Log.LogInfo((object)"[SERVER Stomp] Flag reseteado."); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string EikthyrAttack = "EikthyrTracker_AttackDetected"; public const string EikthyrSummoned = "EikthyrTracker_BossSummoned"; public const string FreezeEikthyr = "EikthyrTracker_Freeze"; public const string UnfreezeEikthyr = "EikthyrTracker_Unfreeze"; public const string RaysRequest = "EikthyrTracker_RaysRequest"; public const string RaysBroadcast = "EikthyrTracker_RaysBroadcast"; public const string RaysDamage = "EikthyrTracker_RaysDamage"; public const string StompRequest = "EikthyrTracker_StompRequest"; public const string StompBroadcast = "EikthyrTracker_StompBroadcast"; public const string StompDamage = "EikthyrTracker_StompDamage"; public const string PhaseTransition = "EikthyrTracker_PhaseTransition"; public const string PhaseImmunity = "EikthyrTracker_PhaseImmunity"; public static int CurrentPhase = 0; public static bool IsPhaseImmune = false; public const string BossDefeated = "EikthyrTracker_BossDefeated"; private static float _lastRaysTime = -99f; private static float _lastStompTime = -99f; private const float RaysCooldown = 4f; private const float StompCooldown = 3f; private static bool _stompInProgress = false; private static ManualLogSource Log => EikthyrTrackerPlugin.Log; public static void RegisterRPCs() { ZRoutedRpc.instance.Register("EikthyrTracker_AttackDetected", (Action)OnEikthyrAttack_Server); ZRoutedRpc.instance.Register("EikthyrTracker_BossSummoned", (Action)OnEikthyrSummoned_Server); ZRoutedRpc.instance.Register("EikthyrTracker_Freeze", (Action)OnFreezeEikthyr_Client); ZRoutedRpc.instance.Register("EikthyrTracker_Unfreeze", (Action)OnUnfreezeEikthyr_Client); ZRoutedRpc.instance.Register("EikthyrTracker_RaysRequest", (Action)OnRaysRequest_Server); ZRoutedRpc.instance.Register("EikthyrTracker_RaysBroadcast", (Action)OnRaysBroadcast_Client); ZRoutedRpc.instance.Register("EikthyrTracker_RaysDamage", (Action)OnRaysDamage_Client); ZRoutedRpc.instance.Register("EikthyrTracker_StompRequest", (Action)OnStompRequest_Server); ZRoutedRpc.instance.Register("EikthyrTracker_StompBroadcast", (Action)OnStompBroadcast_Client); ZRoutedRpc.instance.Register("EikthyrTracker_StompDamage", (Action)OnStompDamage_Client); ZRoutedRpc.instance.Register("EikthyrTracker_PhaseTransition", (Action)OnPhaseTransition_Client); ZRoutedRpc.instance.Register("EikthyrTracker_PhaseImmunity", (Action)OnPhaseImmunity_Client); ZRoutedRpc.instance.Register("EikthyrTracker_BossDefeated", (Action)OnBossDefeated_Server); } public static void OnBossDefeated_Server(long senderPeerID, string unused) { if (!((Object)(object)ZNet.instance == (Object)null) && ZNet.instance.IsServer()) { PhaseSystem.Reset(); PhaseSystem.StartMonitoring(); Log.LogWarning((object)"[SERVER] \ud83d\udc80 Boss derrotado — fases reseteadas."); } } public static void OnPhaseTransition_Client(long senderPeerID, string payload) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) CultureInfo invariantCulture = CultureInfo.InvariantCulture; string[] array = payload.Split(new char[1] { '|' }); if (array.Length >= 2) { int.TryParse(array[0], out var result); Vector3 bossPos = AttackClients.ParseVec(array[1], invariantCulture); CurrentPhase = result; Log.LogWarning((object)$"[CLIENT] ⚡ Fase {result} activada."); Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { ((MonoBehaviour)localPlayer).StartCoroutine(PhaseTransitionFX(bossPos)); } } } [IteratorStateMachine(typeof(d__25))] private static IEnumerator PhaseTransitionFX(Vector3 bossPos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__25(0) { bossPos = bossPos }; } public static void OnPhaseImmunity_Client(long senderPeerID, string value) { IsPhaseImmune = value == "1"; EikthyrTrackerPlugin.Log.LogInfo((object)$"[CLIENT] Inmunidad de faseo: {IsPhaseImmune}"); } public static void OnEikthyrAttack_Server(long senderPeerID, string attackName, int attackId) { if (!((Object)(object)ZNet.instance == (Object)null) && ZNet.instance.IsServer()) { string peerName = GetPeerName(senderPeerID); Log.LogWarning((object)"══════════════════════════════════════"); Log.LogWarning((object)"[SERVER RPC] \ud83d\udde1\ufe0f EIKTHYR ATAQUE DETECTADO"); Log.LogWarning((object)("[SERVER RPC] Ataque : " + attackName)); Log.LogWarning((object)$"[SERVER RPC] Attack ID : {attackId}"); Log.LogWarning((object)$"[SERVER RPC] Peer : {peerName} ({senderPeerID})"); Log.LogWarning((object)"══════════════════════════════════════"); } } public static void OnEikthyrSummoned_Server(long senderPeerID, string invokerName) { if (!((Object)(object)ZNet.instance == (Object)null) && ZNet.instance.IsServer()) { string peerName = GetPeerName(senderPeerID); Log.LogWarning((object)"══════════════════════════════════════"); Log.LogWarning((object)"[SERVER RPC] \ud83d\udd14 EIKTHYR INVOCADO"); Log.LogWarning((object)("[SERVER RPC] Invocador : " + invokerName)); Log.LogWarning((object)$"[SERVER RPC] Peer : {peerName} ({senderPeerID})"); Log.LogWarning((object)"══════════════════════════════════════"); } } public static void OnFreezeEikthyr_Client(long senderPeerID, string unused) { foreach (Character allCharacter in Character.GetAllCharacters()) { if (!EikthyrTrackerPlugin.IsEikthyr(allCharacter)) { continue; } ZNetView component = ((Component)allCharacter).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid() && component.IsOwner()) { MonsterAI component2 = ((Component)allCharacter).GetComponent(); BaseAI component3 = ((Component)allCharacter).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = false; } if (component3 != null) { component3.StopMoving(); } allCharacter.m_speed = 0f; allCharacter.m_runSpeed = 0f; allCharacter.m_walkSpeed = 0f; EikthyrTrackerPlugin.Log.LogInfo((object)"[CLIENT] Eikthyr congelado (soy el owner)."); break; } } } public static void OnUnfreezeEikthyr_Client(long senderPeerID, string unused) { foreach (Character allCharacter in Character.GetAllCharacters()) { if (!EikthyrTrackerPlugin.IsEikthyr(allCharacter)) { continue; } ZNetView component = ((Component)allCharacter).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid() && component.IsOwner()) { MonsterAI component2 = ((Component)allCharacter).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Behaviour)component2).enabled = true; } allCharacter.m_speed = 3f; allCharacter.m_runSpeed = 6f; allCharacter.m_walkSpeed = 2f; EikthyrTrackerPlugin.Log.LogInfo((object)"[CLIENT] Eikthyr descongelado."); break; } } } public static void OnRaysRequest_Server(long senderPeerID, string posStr) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_049d: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ZNet.instance == (Object)null || !ZNet.instance.IsServer()) { return; } float time = Time.time; if (time - _lastRaysTime < 4f) { Log.LogInfo((object)("[SERVER Rays] En cooldown — ignorando de " + GetPeerName(senderPeerID) + ".")); return; } _lastRaysTime = time; CultureInfo invariantCulture = CultureInfo.InvariantCulture; Vector3 val = AttackClients.ParseVec(posStr, invariantCulture); Log.LogWarning((object)"══════════════════════════════════════"); Log.LogWarning((object)"[SERVER Rays] ⚡ LIGHTNING RAYS"); Log.LogWarning((object)$"[SERVER Rays] Boss pos : {val}"); Log.LogWarning((object)("[SERVER Rays] Peer : " + GetPeerName(senderPeerID))); Log.LogWarning((object)"══════════════════════════════════════"); List list = new List(); foreach (ZNetPeer connectedPeer in ZNet.instance.GetConnectedPeers()) { if (!(connectedPeer.m_characterID == ZDOID.None)) { ZDO zDO = ZDOMan.instance.GetZDO(connectedPeer.m_characterID); if (zDO != null && Vector3.Distance(zDO.GetPosition(), val) < 30f) { list.Add(connectedPeer); } } } if (list.Count == 0) { Log.LogInfo((object)"[SERVER Rays] Sin jugadores en rango."); return; } for (int num = list.Count - 1; num > 0; num--) { int index = Random.Range(0, num + 1); ZNetPeer value = list[num]; list[num] = list[index]; list[index] = value; } List list2 = new List(); List list3 = new List(); List list4; List list5; if (list.Count >= 5) { int num2 = list.Count / 2; list4 = list.GetRange(0, num2); list5 = list.GetRange(num2, list.Count - num2); } else { list4 = new List(list); list5 = new List(); } foreach (ZNetPeer item in list4) { ZDO zDO2 = ZDOMan.instance.GetZDO(item.m_characterID); if (zDO2 != null) { list2.Add(zDO2.GetPosition()); } } foreach (ZNetPeer item2 in list5) { ZDO zDO3 = ZDOMan.instance.GetZDO(item2.m_characterID); if (zDO3 != null) { list3.Add(zDO3.GetPosition()); } } while (list2.Count < 5) { float num3 = Random.Range(0f, 360f) * ((float)Math.PI / 180f); float num4 = Random.Range(3f, 12f); Vector3 val2 = val + new Vector3(Mathf.Sin(num3) * num4, 0f, Mathf.Cos(num3) * num4); if ((Object)(object)ZoneSystem.instance != (Object)null) { ZoneSystem.instance.GetSolidHeight(val2, ref val2.y, 1000); } list2.Add(val2); } if (list5.Count > 0) { while (list3.Count < 5) { float num5 = Random.Range(0f, 360f) * ((float)Math.PI / 180f); float num6 = Random.Range(3f, 12f); Vector3 val3 = val + new Vector3(Mathf.Sin(num5) * num6, 0f, Mathf.Cos(num5) * num6); if ((Object)(object)ZoneSystem.instance != (Object)null) { ZoneSystem.instance.GetSolidHeight(val3, ref val3.y, 1000); } list3.Add(val3); } } else { while (list3.Count < 5) { float num7 = Random.Range(0f, 360f) * ((float)Math.PI / 180f); float num8 = Random.Range(3f, 12f); Vector3 val4 = val + new Vector3(Mathf.Sin(num7) * num8, 0f, Mathf.Cos(num7) * num8); if ((Object)(object)ZoneSystem.instance != (Object)null) { ZoneSystem.instance.GetSolidHeight(val4, ref val4.y, 1000); } list3.Add(val4); } } Log.LogWarning((object)$"[SERVER Rays] Oleada1={list2.Count} puntos | Oleada2={list3.Count} puntos"); CultureInfo invariantCulture2 = CultureInfo.InvariantCulture; for (int i = 0; i < list4.Count; i++) { ZNetPeer val5 = list4[i]; string text = ((i < list2.Count) ? AttackClients.VecToStr(list2[i], invariantCulture2) : AttackClients.VecToStr(Vector3.zero, invariantCulture2)); ZRoutedRpc.instance.InvokeRoutedRPC(val5.m_uid, "EikthyrTracker_RaysDamage", new object[1] { "1.9|8|" + text }); Log.LogWarning((object)("[SERVER Rays] \ud83d\udca5 Oleada 1 → " + val5.m_playerName + " @ " + text)); } for (int j = 0; j < list5.Count; j++) { ZNetPeer val6 = list5[j]; string text2 = ((j < list3.Count) ? AttackClients.VecToStr(list3[j], invariantCulture2) : AttackClients.VecToStr(Vector3.zero, invariantCulture2)); ZRoutedRpc.instance.InvokeRoutedRPC(val6.m_uid, "EikthyrTracker_RaysDamage", new object[1] { "3.8|8|" + text2 }); Log.LogWarning((object)("[SERVER Rays] \ud83d\udca5 Oleada 2 → " + val6.m_playerName + " @ " + text2)); } StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder2 = new StringBuilder(); for (int k = 0; k < list2.Count; k++) { if (k > 0) { stringBuilder.Append(';'); } stringBuilder.Append(AttackClients.VecToStr(list2[k], invariantCulture)); } for (int l = 0; l < list3.Count; l++) { if (l > 0) { stringBuilder2.Append(';'); } stringBuilder2.Append(AttackClients.VecToStr(list3[l], invariantCulture)); } string text3 = $"{posStr}|{stringBuilder}|{stringBuilder2}"; ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "EikthyrTracker_RaysBroadcast", new object[1] { text3 }); } public static void OnRaysBroadcast_Client(long senderPeerID, string payload) { if (!((Object)(object)ZNet.instance != (Object)null) || !ZNet.instance.IsServer()) { Log.LogInfo((object)"[CLIENT Rays] ⚡ Broadcast recibido — ejecutando visuales."); Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { AttackClients.ExecuteLightningRaysWithGroups(payload, (MonoBehaviour)(object)localPlayer); } } } public static void OnRaysDamage_Client(long senderPeerID, string dmgPayload) { //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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsServer()) { return; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; string[] array = dmgPayload.Split(new char[1] { '|' }); float result = 0f; float result2 = 8f; Vector3 impactPos = Vector3.zero; bool checkProximity = false; if (array.Length >= 1) { float.TryParse(array[0], NumberStyles.Float, invariantCulture, out result); } if (array.Length >= 2) { float.TryParse(array[1], NumberStyles.Float, invariantCulture, out result2); } if (array.Length >= 3) { impactPos = AttackClients.ParseVec(array[2], invariantCulture); checkProximity = true; } ((MonoBehaviour)localPlayer).StartCoroutine(ApplyDamageDelayed(localPlayer, result2, result, impactPos, checkProximity)); } } [IteratorStateMachine(typeof(d__34))] private static IEnumerator ApplyDamageDelayed(Player player, float dmg, float delay, Vector3 impactPos, bool checkProximity) { //IL_001c: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__34(0) { player = player, dmg = dmg, delay = delay, impactPos = impactPos, checkProximity = checkProximity }; } public static void OnStompRequest_Server(long senderPeerID, string posStr) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ZNet.instance == (Object)null || !ZNet.instance.IsServer()) { return; } if (_stompInProgress) { Log.LogInfo((object)("[SERVER Stomp] Stomp ya en curso — ignorando RPC de " + GetPeerName(senderPeerID) + ".")); return; } float time = Time.time; if (time - _lastStompTime < 3f) { Log.LogInfo((object)("[SERVER Stomp] En cooldown — ignorando de " + GetPeerName(senderPeerID) + ".")); return; } _lastStompTime = time; _stompInProgress = true; CultureInfo invariantCulture = CultureInfo.InvariantCulture; Vector3 val = AttackClients.ParseVec(posStr, invariantCulture); Log.LogWarning((object)"══════════════════════════════════════"); Log.LogWarning((object)"[SERVER Stomp] \ud83d\udd28 STOMP AOE"); Log.LogWarning((object)$"[SERVER Stomp] Boss pos : {val}"); Log.LogWarning((object)("[SERVER Stomp] Peer : " + GetPeerName(senderPeerID))); Log.LogWarning((object)"══════════════════════════════════════"); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "EikthyrTracker_StompBroadcast", new object[1] { posStr }); ServerCoroutineRunner.Run(StompDamageSequence(val)); } [IteratorStateMachine(typeof(d__36))] private static IEnumerator StompDamageSequence(Vector3 bossPos) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { bossPos = bossPos }; } public static void OnStompBroadcast_Client(long senderPeerID, string payload) { if (!((Object)(object)ZNet.instance != (Object)null) || !ZNet.instance.IsServer()) { Log.LogInfo((object)"[CLIENT Stomp] \ud83d\udd28 Broadcast recibido — ejecutando visuales."); Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null)) { AttackClients.ExecuteStompAOE(payload, (MonoBehaviour)(object)localPlayer); } } } public static void OnStompDamage_Client(long senderPeerID, string dmgStr) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ZNet.instance != (Object)null) || !ZNet.instance.IsServer()) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Character)localPlayer).IsDead()) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; float result = 15f; float.TryParse(dmgStr, NumberStyles.Float, invariantCulture, out result); HitData val = new HitData(); val.m_point = ((Component)localPlayer).transform.position; val.m_damage.m_blunt = result; val.m_ranged = true; val.m_hitType = (HitType)6; ((Character)localPlayer).Damage(val); EikthyrTrackerPlugin.Log.LogWarning((object)$"[CLIENT Stomp] \ud83d\udca5 Daño: {result} blunt"); } } } public static void SendAttack(string attackName, int attackId) { if (ZRoutedRpc.instance != null && !((Object)(object)ZNet.instance == (Object)null)) { long num = (ZNet.instance.IsServer() ? ZNet.GetUID() : ZRoutedRpc.instance.GetServerPeerID()); ZRoutedRpc.instance.InvokeRoutedRPC(num, "EikthyrTracker_AttackDetected", new object[2] { attackName, attackId }); } } public static void SendSummoned(string playerName) { if (ZRoutedRpc.instance != null && !((Object)(object)ZNet.instance == (Object)null)) { long num = (ZNet.instance.IsServer() ? ZNet.GetUID() : ZRoutedRpc.instance.GetServerPeerID()); ZRoutedRpc.instance.InvokeRoutedRPC(num, "EikthyrTracker_BossSummoned", new object[1] { playerName }); } } public static void SendRaysRequest(Vector3 bossPos) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (ZRoutedRpc.instance != null && !((Object)(object)ZNet.instance == (Object)null)) { long num = (ZNet.instance.IsServer() ? ZNet.GetUID() : ZRoutedRpc.instance.GetServerPeerID()); CultureInfo invariantCulture = CultureInfo.InvariantCulture; string text = AttackClients.VecToStr(bossPos, invariantCulture); ZRoutedRpc.instance.InvokeRoutedRPC(num, "EikthyrTracker_RaysRequest", new object[1] { text }); } } public static void SendStompRequest(Vector3 bossPos) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (ZRoutedRpc.instance != null && !((Object)(object)ZNet.instance == (Object)null)) { long num = (ZNet.instance.IsServer() ? ZNet.GetUID() : ZRoutedRpc.instance.GetServerPeerID()); CultureInfo invariantCulture = CultureInfo.InvariantCulture; string text = AttackClients.VecToStr(bossPos, invariantCulture); ZRoutedRpc.instance.InvokeRoutedRPC(num, "EikthyrTracker_StompRequest", new object[1] { text }); } } private static string GetPeerName(long peerID) { if ((Object)(object)ZNet.instance == (Object)null) { return "desconocido"; } foreach (ZNetPeer connectedPeer in ZNet.instance.GetConnectedPeers()) { if (connectedPeer.m_uid == peerID) { return connectedPeer.m_playerName; } } if (peerID == ZNet.GetUID()) { return "Host/Server"; } return $"Peer-{peerID}"; } } [HarmonyPatch(typeof(Character), "Damage")] public static class Patch_Eikthyr_HPSync { private static void Postfix(Character __instance) { if (!((Object)(object)__instance == (Object)null) && !__instance.IsDead() && EikthyrTrackerPlugin.IsEikthyr(__instance)) { ZNetView component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid() && component.IsOwner()) { ZDO zDO = component.GetZDO(); zDO.Set("eikthyr_hp", __instance.GetHealth()); zDO.Set("eikthyr_max_hp", __instance.GetMaxHealth()); } } } } [HarmonyPatch(typeof(Character), "Damage")] public static class Patch_Eikthyr_Immunity { private static void Prefix(Character __instance, ref HitData hit) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Invalid comparison between Unknown and I4 if (!((Object)(object)__instance == (Object)null) && hit != null && EikthyrTrackerPlugin.IsEikthyr(__instance)) { if (RPC.IsPhaseImmune) { hit.m_damage.m_blunt = 0f; hit.m_damage.m_slash = 0f; hit.m_damage.m_pierce = 0f; hit.m_damage.m_fire = 0f; hit.m_damage.m_frost = 0f; hit.m_damage.m_lightning = 0f; hit.m_damage.m_poison = 0f; hit.m_damage.m_spirit = 0f; EikthyrTrackerPlugin.Log.LogInfo((object)"[EikthyrTracker] \ud83d\udee1\ufe0f Daño bloqueado — faseo activo."); } else if ((int)hit.m_hitType == 16) { hit.m_damage.m_blunt = 0f; hit.m_damage.m_slash = 0f; hit.m_damage.m_pierce = 0f; hit.m_damage.m_fire = 0f; hit.m_damage.m_frost = 0f; hit.m_damage.m_lightning = 0f; hit.m_damage.m_poison = 0f; hit.m_damage.m_spirit = 0f; } } } } [HarmonyPatch(typeof(OfferingBowl), "Interact")] public static class Patch_OfferingBowl_Interact { private static void Postfix(OfferingBowl __instance, Humanoid user, bool hold) { if (!hold && !((Object)(object)__instance == (Object)null) && !((Object)(object)user == (Object)null)) { GameObject bossPrefab = __instance.m_bossPrefab; if ((((bossPrefab != null) ? ((Object)bossPrefab).name : null) ?? "").Contains("Eikthyr")) { Player val = (Player)(object)((user is Player) ? user : null); string text = ((val != null) ? val.GetPlayerName() : "Desconocido"); EikthyrTrackerPlugin.Log.LogInfo((object)("[CLIENT DETECT] Altar Eikthyr activado por " + text)); RPC.SendSummoned(text); } } } } [HarmonyPatch(typeof(ZSyncAnimation))] public static class Patch_ZSyncAnimation_SetTrigger { [HarmonyPrefix] [HarmonyPatch("SetTrigger", new Type[] { typeof(string) })] private static void Prefix(ZSyncAnimation __instance, string name) { //IL_0083: 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) Character val = ((__instance != null) ? ((Component)__instance).GetComponentInParent() : null); if ((Object)(object)val == (Object)null || !EikthyrTrackerPlugin.IsEikthyr(val)) { return; } ZNetView component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid() && component.IsOwner()) { int hashCode = name.GetHashCode(); EikthyrTrackerPlugin.Log.LogInfo((object)("[CLIENT DETECT] Trigger: " + name + " (soy el owner)")); if (name == "attack1") { EikthyrTrackerPlugin.Log.LogInfo((object)"[CLIENT DETECT] attack1 → enviando StompRequest al servidor."); RPC.SendStompRequest(((Component)val).transform.position); } else if (name == "attack2") { EikthyrTrackerPlugin.Log.LogInfo((object)"[CLIENT DETECT] attack2 → enviando RaysRequest al servidor."); RPC.SendRaysRequest(((Component)val).transform.position); } else { RPC.SendAttack(name, hashCode); } WriteAttackToZDO(val, name, hashCode); } } private static void WriteAttackToZDO(Character eikthyr, string attackName, int attackId) { ZNetView component = ((Component)eikthyr).GetComponent(); if (!((Object)(object)component == (Object)null) && component.IsValid() && component.IsOwner()) { ZDO zDO = component.GetZDO(); zDO.Set("eikthyr_last_attack", attackName); zDO.Set("eikthyr_attack_id", attackId); if ((Object)(object)ZNet.instance != (Object)null) { zDO.Set("eikthyr_attack_timestamp", (float)ZNet.instance.GetTimeSeconds()); } zDO.Set("eikthyr_hp", eikthyr.GetHealth()); zDO.Set("eikthyr_max_hp", eikthyr.GetMaxHealth()); } } } [HarmonyPatch(typeof(ZSyncAnimation))] public static class Patch_ZSyncAnimation_RPC_SetTrigger { [HarmonyPrefix] [HarmonyPatch("RPC_SetTrigger", new Type[] { typeof(long), typeof(string) })] private static void Prefix(ZSyncAnimation __instance, long sender, string name) { Character val = ((__instance != null) ? ((Component)__instance).GetComponentInParent() : null); if (!((Object)(object)val == (Object)null) && EikthyrTrackerPlugin.IsEikthyr(val) && !(name == "attack1") && !(name == "attack2")) { RPC.SendAttack("RPC_" + name, name.GetHashCode()); } } } [HarmonyPatch(typeof(Aoe), "OnHit")] public static class Patch_Eikthyr_AoeOnHit { private static void Prefix(Aoe __instance, Collider collider, Vector3 hitPoint) { if ((Object)(object)__instance == (Object)null) { return; } Transform root = ((Component)__instance).transform.root; if ((((root != null) ? ((Object)root).name : null) ?? "").Contains("Eikthyr")) { object obj; if (collider == null) { obj = null; } else { GameObject gameObject = ((Component)collider).gameObject; obj = ((gameObject != null) ? ((Object)gameObject).name : null); } if (obj == null) { obj = "desconocido"; } string text = (string)obj; RPC.SendAttack("AOE_Hit_" + text, 900); } } } [HarmonyPatch(typeof(Character), "OnDeath")] public static class Patch_Eikthyr_Death { private static void Prefix(Character __instance) { if (!((Object)(object)__instance == (Object)null) && EikthyrTrackerPlugin.IsEikthyr(__instance)) { PhaseSystem.Reset(); if (ZRoutedRpc.instance != null && (Object)(object)ZNet.instance != (Object)null) { long num = (ZNet.instance.IsServer() ? ZNet.GetUID() : ZRoutedRpc.instance.GetServerPeerID()); ZRoutedRpc.instance.InvokeRoutedRPC(num, "EikthyrTracker_BossDefeated", new object[1] { "1" }); } RPC.SendAttack("BOSS_DEFEATED", -1); } } } public static class PhaseSystem { [CompilerGenerated] private sealed class d__6 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public int token; private List 5__2; private int 5__3; private float 5__4; private Vector3 5__5; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) ZDO val; float @float; float float2; switch (<>1__state) { default: return false; case 0: <>1__state = -1; EikthyrTrackerPlugin.Log.LogInfo((object)$"[Phase] Monitor iniciado — sesión {token}."); goto IL_006f; case 1: <>1__state = -1; goto IL_006f; case 2: <>1__state = -1; if (_sessionToken != token) { return false; } if ((Object)(object)ZNet.instance == (Object)null || !ZNet.instance.IsServer()) { break; } 5__2 = new List(); 5__3 = 0; goto IL_00f4; case 3: <>1__state = -1; goto IL_00f4; case 4: <>1__state = -1; goto IL_0255; case 5: { <>1__state = -1; goto IL_02b8; } IL_0255: if (!_phase2Done && 5__4 < 0.45f && _sessionToken == token) { _phase2Done = true; RPC.CurrentPhase = 2; EikthyrTrackerPlugin.Log.LogWarning((object)"[Phase] ⚡ ENTRANDO FASE 2"); <>2__current = ServerCoroutineRunner.RunAndWait(PhaseTransition(5__5, 2)); <>1__state = 5; return true; } goto IL_02b8; IL_006f: if (ZDOMan.instance == null) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; } break; IL_00f4: if (!ZDOMan.instance.GetAllZDOsWithPrefabIterative("Eikthyr", 5__2, ref 5__3)) { <>2__current = null; <>1__state = 3; return true; } if (_sessionToken != token) { return false; } val = null; using (List.Enumerator enumerator = 5__2.GetEnumerator()) { if (enumerator.MoveNext()) { ZDO current = enumerator.Current; val = current; } } if (val == null) { break; } @float = val.GetFloat("eikthyr_hp", 0f); float2 = val.GetFloat("eikthyr_max_hp", 0f); if (float2 <= 0f || @float <= 0f) { break; } 5__4 = @float / float2; 5__5 = val.GetPosition(); EikthyrTrackerPlugin.Log.LogInfo((object)$"[Phase] HP: {@float:F0}/{float2:F0} ({5__4:P0}) | Phase={RPC.CurrentPhase}"); if (!_phase1Done && 5__4 < 0.9f && _sessionToken == token) { _phase1Done = true; RPC.CurrentPhase = 1; EikthyrTrackerPlugin.Log.LogWarning((object)"[Phase] ⚡ ENTRANDO FASE 1"); <>2__current = ServerCoroutineRunner.RunAndWait(PhaseTransition(5__5, 1)); <>1__state = 4; return true; } goto IL_0255; IL_02b8: 5__2 = null; break; } if (_sessionToken == token) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } _monitoring = false; EikthyrTrackerPlugin.Log.LogInfo((object)$"[Phase] Monitor sesión {token} terminado."); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__7 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public int phase; public Vector3 bossPos; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0075: 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_00d3: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; CultureInfo invariantCulture = CultureInfo.InvariantCulture; ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "EikthyrTracker_Freeze", new object[1] { "1" }); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "EikthyrTracker_PhaseImmunity", new object[1] { "1" }); string text = $"{phase}|{AttackClients.VecToStr(bossPos, invariantCulture)}"; ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "EikthyrTracker_PhaseTransition", new object[1] { text }); EikthyrTrackerPlugin.Log.LogWarning((object)$"[Phase] Freeze + FX fase {phase}."); <>2__current = (object)new WaitForSeconds(4f); <>1__state = 1; return true; } case 1: <>1__state = -1; ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "EikthyrTracker_Unfreeze", new object[1] { "1" }); ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "EikthyrTracker_PhaseImmunity", new object[1] { "0" }); EikthyrTrackerPlugin.Log.LogWarning((object)$"[Phase] Unfreeze — fase {phase} activa."); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static bool _phase1Done; private static bool _phase2Done; private static int _sessionToken; private static bool _monitoring; public static void Reset() { _sessionToken++; _phase1Done = false; _phase2Done = false; _monitoring = false; RPC.CurrentPhase = 0; EikthyrTrackerPlugin.Log.LogInfo((object)$"[Phase] Reset — sesión {_sessionToken}."); } public static void StartMonitoring() { if (!((Object)(object)ZNet.instance == (Object)null) && ZNet.instance.IsServer() && !_monitoring) { _monitoring = true; int sessionToken = _sessionToken; ServerCoroutineRunner.Run(MonitorLoop(sessionToken)); } } [IteratorStateMachine(typeof(d__6))] private static IEnumerator MonitorLoop(int token) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { token = token }; } [IteratorStateMachine(typeof(d__7))] private static IEnumerator PhaseTransition(Vector3 bossPos, int phase) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { bossPos = bossPos, phase = phase }; } }