using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using MT.Core; using MT.Core.Commands; using MT.Core.Diario; using MT.Core.Especialidades; using MT.Core.I18n; using MT.Core.Mana; using MT.Core.Rueda; using MT.Core.Touki; using MT.Core.Vfx; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Animations; using UnityEngine.Playables; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")] [assembly: AssemblyCompany("MT.Magia")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+ffb23be1655489b43ebd87164178fc39ecbb9f14")] [assembly: AssemblyProduct("MT.Magia")] [assembly: AssemblyTitle("MT.Magia")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace MT.Magia { public static class Afinidad { private const string Key = "MT.Magia.Afinidad"; public static bool Get(Player p, out Escuela fav, out Escuela weak) { fav = (weak = Escuela.Fuego); if ((Object)(object)p == (Object)null || !p.m_customData.TryGetValue("MT.Magia.Afinidad", out var value)) { return false; } string[] array = value.Split(new char[1] { ',' }); if (array.Length == 2 && Enum.TryParse(array[0], out fav)) { return Enum.TryParse(array[1], out weak); } return false; } public static void Roll(Player p) { if (!((Object)(object)p == (Object)null) && !p.m_customData.ContainsKey("MT.Magia.Afinidad")) { Escuela[] all = Escuelas.All; Escuela escuela = all[Random.Range(0, all.Length)]; Escuela escuela2; do { escuela2 = all[Random.Range(0, all.Length)]; } while (escuela2 == escuela); p.m_customData["MT.Magia.Afinidad"] = escuela.ToString() + "," + escuela2; ((Character)p).Message((MessageType)2, Tr.Get("magia_magic_affinity_favorite_weak", new object[2] { Escuelas.Name(escuela), Escuelas.Name(escuela2) }), 0, (Sprite)null, false); } } public static float CostMult(Player p, Escuela e) { if (!Get(p, out var fav, out var weak)) { return 1f; } if (e != fav) { if (e != weak) { return 1f; } return 1.1f; } return 0.9f; } public static bool IsFavorite(Player p, Escuela e) { if (Get(p, out var fav, out var _)) { return fav == e; } return false; } public static string Describe(Player p) { if (!Get(p, out var fav, out var weak)) { return Tr.Get("magia_not_rolled"); } return Tr.Get("magia_favorite_weak", new object[2] { Escuelas.Name(fav), Escuelas.Name(weak) }); } } public static class Agarre { private static ConfigFile _cfg; private static readonly Dictionary> Rot = new Dictionary>(); private static readonly Dictionary> Pos = new Dictionary>(); private static readonly Dictionary Prefabs = new Dictionary(); public static readonly Vector3 GiroPorDefecto = new Vector3(90f, 0f, 0f); public const float EscalaPorDefecto = 0.7f; private static readonly Dictionary> Size = new Dictionary>(); public static void Init(ConfigFile cfg) { _cfg = cfg; } public static Vector3 Rotation(string prefab) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return Entry(Rot, prefab, "Giro", GiroPorDefecto).Value; } public static Vector3 Offset(string prefab) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return Entry(Pos, prefab, "Posicion", Vector3.zero).Value; } public static float Scale(string prefab) { if (!Size.TryGetValue(prefab, out var value)) { value = _cfg.Bind("Agarre", prefab + ".Escala", 0.7f, "Tamaño del modelo (1 = original). Ajústalo en el juego con «mt_grab scale 0.7»."); Size[prefab] = value; } return Mathf.Clamp(value.Value, 0.2f, 3f); } public static void SetScale(string prefab, float value) { Scale(prefab); Size[prefab].Value = value; _cfg.Save(); if (Prefabs.TryGetValue(prefab, out var value2)) { Apply(value2.transform.Find("attach"), prefab); } } public static void Track(string prefab, GameObject go) { Prefabs[prefab] = go; } private static ConfigEntry Entry(Dictionary> map, string prefab, string kind, Vector3 def) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (map.TryGetValue(prefab, out var value)) { return value; } return map[prefab] = _cfg.Bind("Agarre", prefab + "." + kind, def, (kind == "Giro") ? "Giro del modelo en la mano (grados X, Y, Z). Ajústalo en el juego con mt_grab." : "Desplazamiento del modelo en la mano (metros X, Y, Z). Ajústalo en el juego con mt_grab."); } public static void Set(string prefab, Vector3? rot, Vector3? pos) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (rot.HasValue) { Entry(Rot, prefab, "Giro", Vector3.zero).Value = rot.Value; } if (pos.HasValue) { Entry(Pos, prefab, "Posicion", Vector3.zero).Value = pos.Value; } _cfg.Save(); if (Prefabs.TryGetValue(prefab, out var value)) { Apply(value.transform.Find("attach")); } } public static void Apply(Transform attach, string prefab = null) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_006d: 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: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)attach == (Object)null) { return; } Transform val = attach.Find("MT_Modelo"); if (!((Object)(object)val == (Object)null)) { if (prefab == null) { prefab = ((Object)attach.root).name.Replace("(Clone)", "").Trim(); } val.localRotation = Quaternion.Euler(Rotation(prefab)); val.localPosition = Offset(prefab); val.localScale = Vector3.one * Scale(prefab); Transform val2 = attach.root.Find("MT_ModeloSuelo"); if ((Object)(object)val2 != (Object)null) { val2.localScale = Vector3.one * Scale(prefab); } } } public static void Setup(string prefab, GameObject go) { Track(prefab, go); Apply(go.transform.Find("attach"), prefab); } public static Transform HeldModel(Player p, out string prefab) { prefab = null; ItemData currentWeapon = ((Humanoid)p).GetCurrentWeapon(); if ((Object)(object)currentWeapon?.m_dropPrefab == (Object)null) { return null; } prefab = ((Object)currentWeapon.m_dropPrefab).name; VisEquipment val = Campos.VisEquipo.Invoke((Humanoid)(object)p); GameObject val2 = (((Object)(object)val != (Object)null) ? Campos.InstanciaDerecha.Invoke(val) : null); if (!((Object)(object)val2 != (Object)null)) { return null; } return Find(val2.transform, "MT_Modelo"); } private static Transform Find(Transform t, string name) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (((Object)t).name == name) { return t; } foreach (Transform item in t) { Transform val = Find(item, name); if ((Object)(object)val != (Object)null) { return val; } } return null; } } public class AgarreCommand : ConsoleCommand { public override string Name => "mt_grab"; public override string Help => "mt_grab [rotX rotY rotZ] [posX posY posZ] — adjust how you hold the wand or staff in your hand (saved per item). mt_grab scale 0.7: size. No numbers: show values. mt_grab reset: rotation and position to 0."; public override void Run(string[] args) { //IL_004d: 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_014a: 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_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } string prefab; Transform val = Agarre.HeldModel(localPlayer, out prefab); if ((Object)(object)val == (Object)null) { Console.instance.Print("Equip a mod wand or staff (with its own model)."); return; } if (args.Length == 0) { Console.instance.Print($"{prefab}: rotation {Fmt(Agarre.Rotation(prefab))} · position {Fmt(Agarre.Offset(prefab))} · scale {Agarre.Scale(prefab):0.##}\n{((ConsoleCommand)this).Help}"); return; } if (args[0].ToLowerInvariant() == "scale") { if (args.Length < 2 || !float.TryParse(args[1].Replace(',', '.'), NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { Console.instance.Print($"{prefab}: scale {Agarre.Scale(prefab):0.##}. Usage: mt_grab scale 0.7"); return; } Agarre.SetScale(prefab, result); val.localScale = Vector3.one * Agarre.Scale(prefab); Console.instance.Print($"{prefab}: scale {Agarre.Scale(prefab):0.##} (saved)"); return; } Vector3? rot = null; Vector3? pos = null; if (args[0].ToLowerInvariant() == "reset") { rot = Vector3.zero; pos = Vector3.zero; } else { if (args.Length >= 3 && TryVec(args, 0, out var v)) { rot = v; } if (args.Length >= 6 && TryVec(args, 3, out var v2)) { pos = v2; } if (!rot.HasValue) { Console.instance.Print(((ConsoleCommand)this).Help); return; } } Agarre.Set(prefab, rot, pos); val.localRotation = Quaternion.Euler(Agarre.Rotation(prefab)); val.localPosition = Agarre.Offset(prefab); Console.instance.Print(prefab + ": rotation " + Fmt(Agarre.Rotation(prefab)) + " · position " + Fmt(Agarre.Offset(prefab)) + " (saved)"); } private static bool TryVec(string[] a, int i, out Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) v = Vector3.zero; CultureInfo invariantCulture = CultureInfo.InvariantCulture; if (!float.TryParse(a[i].Replace(',', '.'), NumberStyles.Float, invariantCulture, out var result) || !float.TryParse(a[i + 1].Replace(',', '.'), NumberStyles.Float, invariantCulture, out var result2) || !float.TryParse(a[i + 2].Replace(',', '.'), NumberStyles.Float, invariantCulture, out var result3)) { return false; } v = new Vector3(result, result2, result3); return true; } private static string Fmt(Vector3 v) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) return string.Format(CultureInfo.InvariantCulture, "{0:0.##} {1:0.##} {2:0.##}", v.x, v.y, v.z); } } public static class AguaVfx { private static readonly Color Agua = new Color(0.45f, 0.7f, 1f); private static readonly Color AguaClara = new Color(0.8f, 0.92f, 1f); public static void Diluvio(Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_0128: 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) FuegoVfx.Destello(pos + Vector3.up, 14f, 2.5f, 0.6f, Agua); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(Agua.r, Agua.g, Agua.b, 0.9f), ColorB = new Color(AguaClara.r, AguaClara.g, AguaClara.b, 0.8f), LifeMin = 0.8f, LifeMax = 1.3f, SpeedMin = 12f, SpeedMax = 20f, SizeMin = 0.1f, SizeMax = 0.25f, Gravity = 0.4f, Radius = 0.6f, Hemisphere = true, Rate = 250f, Duration = 1f, FadeIn = 0.05f, Grow = 0.6f, Max = 3000 }); Chaparron(pos, 10f, 4f, 700f); Salpicadura(pos, 3f, 70); } public static void Ventisca(Vector3 pos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) FuegoVfx.Destello(pos + Vector3.up, 12f, 2f, 0.6f, AguaClara); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(1f, 1f, 1f, 0.9f), ColorB = new Color(0.75f, 0.88f, 1f, 0.7f), LifeMin = 1.2f, LifeMax = 2f, SpeedMin = 3f, SpeedMax = 8f, SizeMin = 0.06f, SizeMax = 0.16f, Gravity = -0.1f, Radius = 3f, Hemisphere = true, Rate = 300f, Duration = 2.5f, FadeIn = 0.1f, Max = 3000 }); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(0.9f, 0.95f, 1f, 0.4f), ColorB = new Color(0.8f, 0.88f, 1f, 0.25f), LifeMin = 1.5f, LifeMax = 2.5f, SpeedMin = 1f, SpeedMax = 3f, SizeMin = 1.2f, SizeMax = 2.4f, Radius = 2f, Hemisphere = true, Burst = 25, Additive = false, FadeIn = 0.15f, Grow = 2.5f }); Particulas.Spawn(pos + Vector3.up * 8f, new Particulas.Config { ColorA = Color.white, ColorB = new Color(0.8f, 0.9f, 1f, 0.8f), LifeMin = 2.5f, LifeMax = 3.5f, SpeedMin = 0f, SpeedMax = 0.5f, SizeMin = 0.06f, SizeMax = 0.14f, Gravity = 0.25f, Radius = 10f, Rate = 400f, Duration = 4f, FadeIn = 0.1f, Max = 3000 }); } public static void Lavar(Player p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)p).transform.position; Particulas.Spawn(position + Vector3.up * 2.6f, new Particulas.Config { ColorA = new Color(Agua.r, Agua.g, Agua.b, 0.9f), ColorB = new Color(AguaClara.r, AguaClara.g, AguaClara.b, 0.8f), LifeMin = 0.45f, LifeMax = 0.7f, SpeedMin = 0.5f, SpeedMax = 1.5f, SizeMin = 0.08f, SizeMax = 0.2f, Gravity = 2f, Radius = 0.45f, Rate = 300f, Duration = 0.5f, FadeIn = 0.05f, Max = 1000 }); Salpicadura(position, 0.6f, 50); } private static void Chaparron(Vector3 pos, float radio, float segundos, float porSegundo) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(pos + Vector3.up * 10f, new Particulas.Config { ColorA = new Color(Agua.r, Agua.g, Agua.b, 0.75f), ColorB = new Color(AguaClara.r, AguaClara.g, AguaClara.b, 0.6f), LifeMin = 0.8f, LifeMax = 1.1f, SpeedMin = 0f, SpeedMax = 1f, SizeMin = 0.06f, SizeMax = 0.14f, Gravity = 2.2f, Radius = radio, Rate = porSegundo, Duration = segundos, FadeIn = 0.05f, Max = 4000 }); } private static void Salpicadura(Vector3 pos, float radio, int cantidad) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(pos + Vector3.up * 0.1f, new Particulas.Config { ColorA = new Color(AguaClara.r, AguaClara.g, AguaClara.b, 0.9f), ColorB = new Color(Agua.r, Agua.g, Agua.b, 0.7f), LifeMin = 0.4f, LifeMax = 0.8f, SpeedMin = 2f, SpeedMax = 4.5f, SizeMin = 0.06f, SizeMax = 0.16f, Gravity = 1.5f, Radius = radio, Hemisphere = true, Burst = cantidad, FadeIn = 0.02f, Max = 1000 }); } } public static class Aprendizaje { private const string DespiertaKey = "MT.Magia.Despierta"; public static Spell Random(Player p, int minRank, int maxRank, Escuela? school = null) { HashSet known = Pergaminos.Known(p); List list = SpellBook.All.Where((Spell s) => !known.Contains(s.Id) && s.School != Escuela.Gravedad && s.Rank >= minRank && s.Rank <= maxRank && (!school.HasValue || s.School == school.Value)).ToList(); if (list.Count != 0) { return list[Random.Range(0, list.Count)]; } return null; } public static Spell Nuevo(Player p, Escuela? school, int minRank, int maxRank) { return Random(p, minRank, maxRank, school) ?? Random(p, 0, maxRank, school) ?? Random(p, 0, maxRank) ?? Random(p, 0, 6); } public static void Teach(Player p, Spell s, string como) { Pergaminos.Learn(p, s.Id); DiarioMagia.HechizoAprendido(p, s); string text = como + "\n«" + s.Name + "»"; if (!Pergaminos.CanCast(p, s)) { text = text + "\n" + Tr.Get("magia_learned_cannot_cast_yet"); } ((Character)p).Message((MessageType)2, text, 0, (Sprite)null, false); } public static bool MagiaDespierta(Player p) { if ((Object)(object)p != (Object)null) { if (!p.m_customData.ContainsKey("MT.Magia.Despierta")) { return Pergaminos.Known(p).Count > 0; } return true; } return false; } public static void Despertar(Player p) { if (!((Object)(object)p == (Object)null) && !p.m_customData.ContainsKey("MT.Magia.Despierta")) { p.m_customData["MT.Magia.Despierta"] = "1"; Laminas.Desbloquear(p, "pagina_mana"); if (Pergaminos.Known(p).Count <= 0) { ((Character)p).Message((MessageType)2, Tr.Get("magia_mana_awakened_no_spell"), 0, (Sprite)null, false); Cronica.AnotarUnaVez(p, "magia_despierta", "cronica_magic_awakened", Array.Empty()); } } } public static void AlFabricarVarita(Player p) { Despertar(p); } public static void AlSubirRango(Player p, Escuela e, int rank) { if (MTMagiaPlugin.AprenderRango.Value) { Spell spell = Nuevo(p, e, 0, rank); if (spell != null) { Teach(p, spell, Tr.Get("magia_practice_pays_off_discover_new")); } } } } [HarmonyPatch(typeof(InventoryGui), "DoCrafting")] public static class VaritaCraftPatch { private static int _antes; private static void Prefix(InventoryGui __instance, out bool __state) { Traverse obj = Traverse.Create((object)__instance); Recipe value = obj.Field("m_craftRecipe").GetValue(); ItemData value2 = obj.Field("m_craftUpgradeItem").GetValue(); __state = value2 == null && (Object)(object)value != (Object)null && (Object)(object)value.m_item != (Object)null && ((Object)value.m_item).name == "MT_VaritaAprendiz"; if (__state) { _antes = Contar(Player.m_localPlayer); } } private static int Contar(Player p) { if (!((Object)(object)p == (Object)null)) { return ((Humanoid)p).GetInventory().GetAllItems().Count((ItemData i) => (Object)(object)i.m_dropPrefab != (Object)null && ((Object)i.m_dropPrefab).name == "MT_VaritaAprendiz"); } return 0; } private static void Postfix(bool __state) { Player localPlayer = Player.m_localPlayer; if (__state && (Object)(object)localPlayer != (Object)null && Contar(localPlayer) > _antes) { Aprendizaje.AlFabricarVarita(localPlayer); } } } public class Arco : MonoBehaviour { private LineRenderer _core; private LineRenderer _glow; private Light _light; private Vector3 _from; private Vector3 _to; private float _width; private float _grow; private float _born; public static Arco Spawn(Vector3 from, Vector3 to, Color color, float width = 0.3f, float duration = 0.3f, float grow = 0f) { //IL_000c: 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_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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { Vector3 val = to - from; if (!(((Vector3)(ref val)).sqrMagnitude < 0.01f)) { GameObject val2 = new GameObject("MT_ArcoElectrico"); Arco arco = val2.AddComponent(); arco._from = from; arco._to = to; arco._width = width; arco._grow = grow; arco._born = Time.time; arco._glow = Line(val2.transform, "Halo", color, width); arco._core = Line(val2.transform, "Nucleo", Color.Lerp(color, Color.white, 0.8f), width * 0.3f); arco._light = LucesMagicas.Registrar(new GameObject("Luz").AddComponent()); ((Component)arco._light).transform.SetParent(val2.transform, false); ((Component)arco._light).transform.position = to; arco._light.color = color; arco._light.range = 6f; arco._light.intensity = 2.5f; arco.Shape(); Object.Destroy((Object)(object)val2, duration); return arco; } } return null; } public void Retarget(Vector3 from, Vector3 to) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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) _from = from; _to = to; if ((Object)(object)_light != (Object)null) { ((Component)_light).transform.position = to; } } private static LineRenderer Line(Transform parent, string name, Color color, float width) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0044: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); LineRenderer obj = val.AddComponent(); obj.useWorldSpace = true; ((Renderer)obj).material = Vfx.NewMaterial(Vfx.Tex("heal_streak"), color); Color startColor = (obj.endColor = color); obj.startColor = startColor; obj.startWidth = width; obj.endWidth = width * 0.6f; obj.textureMode = (LineTextureMode)0; obj.numCapVertices = 2; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } private void Update() { Shape(); } private void Shape() { //IL_0016: 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_0039: 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_003e: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((_grow > 0f) ? Vector3.Lerp(_from, _to, Mathf.Clamp01((Time.time - _born) / _grow)) : _to); if ((Object)(object)_light != (Object)null) { ((Component)_light).transform.position = val; } float num = Vector3.Distance(_from, val); int num2 = Mathf.Clamp(Mathf.CeilToInt(num / 0.5f), 4, 60); Vector3 val2 = val - _from; Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = Vector3.Cross(normalized, Vector3.up); if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.Cross(normalized, Vector3.right); } ((Vector3)(ref val3)).Normalize(); Vector3 val4 = Vector3.Cross(val3, normalized); float num3 = Mathf.Clamp(num * 0.03f, 0.08f, 0.5f); Vector3[] array = (Vector3[])(object)new Vector3[num2 + 1]; for (int i = 0; i <= num2; i++) { float num4 = (float)i / (float)num2; float num5 = Mathf.Sin(num4 * (float)Math.PI); Vector3 val5 = (val3 * Random.Range(-1f, 1f) + val4 * Random.Range(-1f, 1f)) * num3 * num5; array[i] = Vector3.Lerp(_from, val, num4) + val5; } LineRenderer[] array2 = (LineRenderer[])(object)new LineRenderer[2] { _glow, _core }; foreach (LineRenderer obj in array2) { obj.positionCount = array.Length; obj.SetPositions(array); } float num6 = Random.Range(0.7f, 1.2f); _glow.widthMultiplier = num6; if ((Object)(object)_light != (Object)null) { _light.intensity = 2.5f * num6; } } } public static class ArmaduraMk1 { public class Modelo { public Mesh Mesh; public Material[] Mats; } public const string Prefab = "MT_ArmaduraMk1"; public const string Escudo = "MT_EscudoMk1"; public const string Canon = "MT_CanonMk1"; public const string Casco = "MT_CascoMk1"; public const string Grebas = "MT_GrebasMk1"; public const string Coraza = "MT_CorazaMk1"; public static readonly KeyValuePair[] Piezas = new KeyValuePair[15] { P("cabeza", (HumanBodyBones)10), P("pecho", (HumanBodyBones)8), P("cadera", (HumanBodyBones)0), P("brazo_der", (HumanBodyBones)14), P("brazo_izq", (HumanBodyBones)13), P("antebrazo_der", (HumanBodyBones)16), P("antebrazo_izq", (HumanBodyBones)15), P("mano_der", (HumanBodyBones)18), P("mano_izq", (HumanBodyBones)17), P("muslo_der", (HumanBodyBones)2), P("muslo_izq", (HumanBodyBones)1), P("pierna_der", (HumanBodyBones)4), P("pierna_izq", (HumanBodyBones)3), P("pie_der", (HumanBodyBones)6), P("pie_izq", (HumanBodyBones)5) }; public static readonly KeyValuePair[] PiezaEscudo = new KeyValuePair[1] { P("escudo", (HumanBodyBones)15) }; public static readonly KeyValuePair[] PiezaCanon = new KeyValuePair[1] { P("canon", (HumanBodyBones)16) }; public static bool Powered; private static Dictionary _cache; private static KeyValuePair P(string pieza, HumanBodyBones hueso) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return new KeyValuePair(pieza, hueso); } public static void Register() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Expected O, but got Unknown PrefabManager.OnVanillaPrefabsAvailable -= Register; RegistrarPieza("MT_CascoMk1", Tr.Token("magia_casco_mk1"), Tr.Token("magia_casco_mk1_d"), "casco_mk1", 8f, (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig("BlackMetal", 10, 0, true), new RequirementConfig("Iron", 10, 0, true), new RequirementConfig("Crystal", 3, 0, true) }); RegistrarPieza("MT_CorazaMk1", Tr.Token("magia_coraza_mk1"), Tr.Token("magia_coraza_mk1_d"), "coraza_mk1", 30f, (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig("BlackMetal", 30, 0, true), new RequirementConfig("Iron", 30, 0, true), new RequirementConfig("Crystal", 10, 0, true), new RequirementConfig("SurtlingCore", 10, 0, true) }); RegistrarPieza("MT_GrebasMk1", Tr.Token("magia_grebas_mk1"), Tr.Token("magia_grebas_mk1_d"), "grebas_mk1", 18f, (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig("BlackMetal", 20, 0, true), new RequirementConfig("Iron", 20, 0, true), new RequirementConfig("SurtlingCore", 4, 0, true) }); RegistrarArmadura(); RegistrarEscudo(); RegistrarCanon(); } private static void RegistrarArmadura() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)PrefabManager.Instance.GetPrefab("ArmorBronzeChest") == (Object)null)) { ItemConfig val = new ItemConfig(); val.Name = Tr.Token("magia_armadura_mk1"); val.Description = Tr.Token("magia_armadura_mk1_d"); val.Icon = MTMagiaPlugin.Icon("armadura_mk1"); val.CraftingStation = CraftingStations.Forge; val.MinStationLevel = 3; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[5] { new RequirementConfig("MT_CascoMk1", 1, 1, true), new RequirementConfig("MT_CorazaMk1", 1, 1, true), new RequirementConfig("MT_GrebasMk1", 1, 1, true), new RequirementConfig("BlackMetal", 0, 10, true), new RequirementConfig("Crystal", 0, 5, true) }; CustomItem val2 = new CustomItem("MT_ArmaduraMk1", "ArmorBronzeChest", val); SharedData shared = val2.ItemDrop.m_itemData.m_shared; shared.m_armor = MTMagiaPlugin.Mk1Armadura.Value + 28f; shared.m_damageModifiers = new List(shared.m_damageModifiers ?? new List()) { new DamageModPair { m_type = (DamageType)64, m_modifier = (DamageModifier)5 } }; shared.m_armorPerLevel = 4f; shared.m_weight = 60f; shared.m_movementModifier = 0f; shared.m_maxQuality = 3; shared.m_useDurability = true; shared.m_canBeReparied = true; shared.m_maxDurability = MTMagiaPlugin.Mk1Durabilidad.Value; shared.m_durabilityPerLevel = MTMagiaPlugin.Mk1Durabilidad.Value * 0.25f; HideVisual(val2.ItemPrefab); EnElSuelo(val2.ItemPrefab, new string[3] { "casco", "torso", "piernas" }, 2.3f); ItemManager.Instance.AddItem(val2); } } private static void RegistrarPieza(string prefab, string name, string desc, string icon, float weight, RequirementConfig[] req) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)PrefabManager.Instance.GetPrefab("BlackMetal") == (Object)null)) { CustomItem val = new CustomItem(prefab, "BlackMetal", new ItemConfig { Name = name, Description = desc, Icon = MTMagiaPlugin.Icon(icon), CraftingStation = CraftingStations.Forge, MinStationLevel = 3, Requirements = req }); SharedData shared = val.ItemDrop.m_itemData.m_shared; shared.m_itemType = (ItemType)1; shared.m_maxStackSize = 1; shared.m_weight = weight; shared.m_maxQuality = 1; shared.m_teleportable = true; string text = ((prefab == "MT_CascoMk1") ? "casco" : ((prefab == "MT_CorazaMk1") ? "torso" : "piernas")); HideVisual(val.ItemPrefab); EnElSuelo(val.ItemPrefab, new string[1] { text }, 1.6f); ItemManager.Instance.AddItem(val); } } public static bool WornPart(Player p, string field, string prefab) { if ((Object)(object)p != (Object)null) { return Is(Slot(p, field), prefab); } return false; } public static int Piezas_(Player p) { if (!Worn(p)) { return 0; } return 3; } private static void RegistrarEscudo() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown string text = (((Object)(object)PrefabManager.Instance.GetPrefab("ShieldIronTower") != (Object)null) ? "ShieldIronTower" : "ShieldBanded"); if (!((Object)(object)PrefabManager.Instance.GetPrefab(text) == (Object)null)) { ItemConfig val = new ItemConfig(); val.Name = Tr.Token("magia_escudo_mk1"); val.Description = Tr.Token("magia_escudo_mk1_d"); val.Icon = MTMagiaPlugin.Icon("escudo_mk1"); val.CraftingStation = CraftingStations.Forge; val.MinStationLevel = 3; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig("BlackMetal", 15, 5, true), new RequirementConfig("Iron", 15, 5, true), new RequirementConfig("Crystal", 0, 3, true), new RequirementConfig("SurtlingCore", 0, 1, true) }; CustomItem val2 = new CustomItem("MT_EscudoMk1", text, val); SharedData shared = val2.ItemDrop.m_itemData.m_shared; shared.m_blockPower = MTMagiaPlugin.Mk1BloqueoEscudo.Value; shared.m_blockPowerPerLevel = 6f; shared.m_deflectionForce = 60f; shared.m_weight = 18f; shared.m_movementModifier = -0.05f; shared.m_maxDurability *= 1.5f; shared.m_durabilityPerLevel *= 1.5f; shared.m_maxQuality = 3; ShieldInHand(val2.ItemPrefab); ItemManager.Instance.AddItem(val2); } } private static void EnElSuelo(GameObject prefab, string[] piezas, float escala) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //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_00d4: 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) GameObject val = new GameObject("MT_Mk1_suelo"); val.transform.SetParent(prefab.transform, false); val.transform.localScale = Vector3.one * escala; Material val2 = Mk1Material.Body(); Bounds? val3 = null; foreach (string text in piezas) { Mesh val4 = Mk1Skin.StaticMesh(text); if (!((Object)(object)val4 == (Object)null)) { GameObject val5 = new GameObject(text); val5.transform.SetParent(val.transform, false); val5.AddComponent().sharedMesh = val4; MeshRenderer val6 = val5.AddComponent(); if ((Object)(object)val2 != (Object)null) { ((Renderer)val6).sharedMaterial = val2; } if (!val3.HasValue) { val3 = val4.bounds; continue; } Bounds value = val3.Value; ((Bounds)(ref value)).Encapsulate(val4.bounds); val3 = value; } } if (val3.HasValue) { Bounds value2 = val3.Value; val.transform.localPosition = -new Vector3(((Bounds)(ref value2)).center.x, ((Bounds)(ref value2)).min.y, ((Bounds)(ref value2)).center.z) * escala; } } private static void CanonEnSuelo(GameObject prefab) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Modelo modelo = Piece("canon"); if (!((Object)(object)modelo.Mesh == (Object)null)) { GameObject val = new GameObject("MT_Mk1_canon_suelo"); val.transform.SetParent(prefab.transform, false); val.transform.localRotation = Quaternion.Euler(90f, 0f, 0f); val.AddComponent().sharedMesh = modelo.Mesh; ((Renderer)val.AddComponent()).sharedMaterials = modelo.Mats; } } private static void ShieldInHand(GameObject prefab) { bool num = ColocarEscudo(prefab, soloVisibles: true); HideVisual(prefab); if (!num) { MTMagiaPlugin.Log.LogWarning((object)"Mk-I: no se pudo poner el escudo en la mano"); } } public static bool ColocarEscudo(GameObject root, bool soloVisibles, float extra = 1f) { //IL_0120: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_0151: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: 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_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: 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_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_025a: 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_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0360: 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) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: 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_03a0: Unknown result type (might be due to invalid IL or missing references) MeshFilter val = null; Transform val2 = root.transform.Find("attach"); MeshFilter[] componentsInChildren = (((Object)(object)val2 != (Object)null) ? ((Component)val2).gameObject : root).GetComponentsInChildren(true); Bounds bounds; foreach (MeshFilter val3 in componentsInChildren) { MeshRenderer component = ((Component)val3).GetComponent(); if ((Object)(object)val3.sharedMesh == (Object)null || (Object)(object)component == (Object)null || (soloVisibles && !((Renderer)component).enabled) || ((Object)val3).name.StartsWith("MT_Mk1")) { continue; } if (!((Object)(object)val == (Object)null)) { bounds = val3.sharedMesh.bounds; Vector3 size = ((Bounds)(ref bounds)).size; float sqrMagnitude = ((Vector3)(ref size)).sqrMagnitude; bounds = val.sharedMesh.bounds; size = ((Bounds)(ref bounds)).size; if (!(sqrMagnitude > ((Vector3)(ref size)).sqrMagnitude)) { continue; } } val = val3; } Modelo modelo = Piece("escudo"); if ((Object)(object)val == (Object)null || (Object)(object)modelo.Mesh == (Object)null) { return false; } Ejes(val.sharedMesh, out var c, out var ax, out var len); Ejes(modelo.Mesh, out var c2, out var ax2, out var len2); if (Vector3.Dot(Vector3.Cross(ax2[0], ax2[1]), ax2[2]) < 0f) { ax2[2] = -ax2[2]; } if (Vector3.Dot(Vector3.Cross(ax[0], ax[1]), ax[2]) < 0f) { ax[2] = -ax[2]; } if (MTMagiaPlugin.Mk1EscudoManoVoltear.Value) { ax2[1] = -ax2[1]; ax2[2] = -ax2[2]; } Quaternion val4 = Quaternion.LookRotation(ax2[2], ax2[0]); Quaternion val5 = Quaternion.LookRotation(ax[2], ax[0]) * Quaternion.Inverse(val4) * Quaternion.Euler(MTMagiaPlugin.Mk1EscudoManoGiro.Value); float num = len[0] / Mathf.Max(0.01f, len2[0]) * MTMagiaPlugin.Mk1EscudoManoEscala.Value * extra; if (float.IsNaN(num) || float.IsInfinity(num) || num <= 0f || float.IsNaN(val5.x)) { MTMagiaPlugin.Log.LogWarning((object)$"Mk-I: ajuste del escudo inválido (escala {num}); se usa tamaño 1"); num = MTMagiaPlugin.Mk1EscudoManoEscala.Value; val5 = Quaternion.Euler(MTMagiaPlugin.Mk1EscudoManoGiro.Value); bounds = val.sharedMesh.bounds; c = ((Bounds)(ref bounds)).center; bounds = modelo.Mesh.bounds; c2 = ((Bounds)(ref bounds)).center; } GameObject val6 = new GameObject("MT_Mk1_escudo_mano"); val6.transform.SetParent(((Component)val).transform, false); val6.transform.localRotation = val5; val6.transform.localScale = Vector3.one * num; Vector3 val7 = ((Vector3.Dot(c, ax[2]) < 0f) ? (-ax[2]) : ax[2]); float num2 = MTMagiaPlugin.Mk1EscudoManoSeparacion.Value / Mathf.Max(0.01f, ((Component)val).transform.lossyScale.x); val6.transform.localPosition = c - val5 * (c2 * num) + val7 * num2; val6.layer = ((Component)val).gameObject.layer; val6.AddComponent().sharedMesh = modelo.Mesh; ((Renderer)val6.AddComponent()).sharedMaterials = modelo.Mats; return true; } private static void Ejes(Mesh mesh, out Vector3 c, out Vector3[] ax, out float[] len) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(mesh.isReadable ? ((Array)mesh.vertices) : ((Array)new Vector3[0])); if (array.Length >= 3) { Ejes(array, out c, out ax, out len); if (!float.IsNaN(len[0]) && len[0] > 0f) { return; } } Bounds bounds = mesh.bounds; c = ((Bounds)(ref bounds)).center; Vector3[] array2 = (Vector3[])(object)new Vector3[3] { Vector3.right, Vector3.up, Vector3.forward }; float[] sizes = new float[3] { ((Bounds)(ref bounds)).size.x, ((Bounds)(ref bounds)).size.y, ((Bounds)(ref bounds)).size.z }; int[] array3 = new int[3] { 0, 1, 2 }; Array.Sort(array3, (int i, int j) => sizes[j].CompareTo(sizes[i])); ax = (Vector3[])(object)new Vector3[3] { array2[array3[0]], array2[array3[1]], array2[array3[2]] }; len = new float[3] { sizes[array3[0]], sizes[array3[1]], sizes[array3[2]] }; } public static bool ReaplicarEscudo(Player p) { if ((Object)(object)p == (Object)null || !Is(Slot(p, "m_leftItem"), "MT_EscudoMk1")) { return false; } VisEquipment component = ((Component)p).GetComponent(); GameObject val = (((Object)(object)component != (Object)null) ? Campos.InstanciaIzquierda.Invoke(component) : null); if ((Object)(object)val == (Object)null) { return false; } MeshRenderer[] componentsInChildren = val.GetComponentsInChildren(true); foreach (MeshRenderer val2 in componentsInChildren) { if (((Object)val2).name == "MT_Mk1_escudo_mano") { Object.Destroy((Object)(object)((Component)val2).gameObject); } } return ColocarEscudo(val, soloVisibles: false, ConArmadura(p)); } private static void Ejes(Vector3[] v, out Vector3 c, out Vector3[] ax, out float[] len) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: 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_01fe: 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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0226: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0250: 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_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) c = Vector3.zero; Vector3[] array = v; foreach (Vector3 val in array) { c += val; } c /= (float)Mathf.Max(1, v.Length); float xx = 0f; float xy = 0f; float xz = 0f; float yy = 0f; float yz = 0f; float zz = 0f; array = v; for (int i = 0; i < array.Length; i++) { Vector3 val2 = array[i] - c; xx += val2.x * val2.x; xy += val2.x * val2.y; xz += val2.x * val2.z; yy += val2.y * val2.y; yz += val2.y * val2.z; zz += val2.z * val2.z; } Func func = (Vector3 a) => new Vector3(xx * a.x + xy * a.y + xz * a.z, xy * a.x + yy * a.y + yz * a.z, xz * a.x + yz * a.y + zz * a.z); Vector3 normalized = default(Vector3); ((Vector3)(ref normalized))..ctor(0.3f, 0.9f, 0.2f); Vector3 val3; for (int num = 0; num < 60; num++) { val3 = func(normalized); normalized = ((Vector3)(ref val3)).normalized; } val3 = Vector3.Cross(normalized, (Mathf.Abs(normalized.x) < 0.9f) ? Vector3.right : Vector3.up); Vector3 normalized2 = ((Vector3)(ref val3)).normalized; for (int num2 = 0; num2 < 60; num2++) { normalized2 = func(normalized2); val3 = normalized2 - Vector3.Dot(normalized2, normalized) * normalized; normalized2 = ((Vector3)(ref val3)).normalized; } val3 = Vector3.Cross(normalized, normalized2); Vector3 normalized3 = ((Vector3)(ref val3)).normalized; ax = (Vector3[])(object)new Vector3[3] { normalized, normalized2, normalized3 }; len = new float[3]; for (int num3 = 0; num3 < 3; num3++) { float num4 = float.MaxValue; float num5 = float.MinValue; array = v; for (int i = 0; i < array.Length; i++) { float num6 = Vector3.Dot(array[i] - c, ax[num3]); num4 = Mathf.Min(num4, num6); num5 = Mathf.Max(num5, num6); } len[num3] = num5 - num4; } } private static int[] Axes(Vector3 s) { //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) int[] obj = new int[3] { 0, 1, 2 }; Array.Sort(obj, (int x, int y) => ((Vector3)(ref s))[y].CompareTo(((Vector3)(ref s))[x])); return obj; } private static Vector3 Axis(int i) { //IL_0013: 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_0007: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(i switch { 1 => Vector3.up, 0 => Vector3.right, _ => Vector3.forward, }); } private static void RegistrarCanon() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Expected O, but got Unknown //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00ed: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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) string text = (((Object)(object)PrefabManager.Instance.GetPrefab("StaffIceShards") != (Object)null) ? "StaffIceShards" : "StaffFireball"); if (!((Object)(object)PrefabManager.Instance.GetPrefab(text) == (Object)null)) { ItemConfig val = new ItemConfig(); val.Name = Tr.Token("magia_canon_mk1"); val.Description = Tr.Token("magia_canon_mk1_d"); val.Icon = MTMagiaPlugin.Icon("canon_mk1"); val.CraftingStation = CraftingStations.Forge; val.MinStationLevel = 3; val.Requirements = (RequirementConfig[])(object)new RequirementConfig[4] { new RequirementConfig("BlackMetal", 20, 5, true), new RequirementConfig("Iron", 10, 5, true), new RequirementConfig("SurtlingCore", 5, 2, true), new RequirementConfig("Crystal", 0, 3, true) }; CustomItem val2 = new CustomItem("MT_CanonMk1", text, val); SharedData shared = val2.ItemDrop.m_itemData.m_shared; shared.m_itemType = (ItemType)3; shared.m_skillType = (SkillType)9; shared.m_damages = new DamageTypes { m_blunt = MTMagiaPlugin.Mk1DanoBala.Value }; shared.m_damagesPerLevel = new DamageTypes { m_blunt = 5f }; shared.m_attack.m_attackEitr = 0f; shared.m_attackStatusEffect = null; shared.m_secondaryAttack.m_attackEitr = 0f; shared.m_weight = 12f; shared.m_maxQuality = 3; shared.m_useDurability = true; shared.m_canBeReparied = true; shared.m_maxDurability = MTMagiaPlugin.Mk1CanonDurabilidad.Value; shared.m_durabilityPerLevel = MTMagiaPlugin.Mk1CanonDurabilidad.Value * 0.25f; HideVisual(val2.ItemPrefab); CanonEnSuelo(val2.ItemPrefab); ItemManager.Instance.AddItem(val2); } } private static void HideVisual(GameObject prefab) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Light[] componentsInChildren2 = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Behaviour)componentsInChildren2[i]).enabled = false; } ParticleSystem[] componentsInChildren3 = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { EmissionModule emission = componentsInChildren3[i].emission; ((EmissionModule)(ref emission)).enabled = false; } } public static bool Is(ItemData it, string prefab) { if (it != null && (Object)(object)it.m_dropPrefab != (Object)null) { return ((Object)it.m_dropPrefab).name == prefab; } return false; } public static ItemData Slot(Player p, string field) { if ((Object)(object)p == (Object)null) { return null; } return (ItemData)(field switch { "m_chestItem" => Campos.Pecho.Invoke((Humanoid)(object)p), "m_rightItem" => Campos.ManoDerecha.Invoke((Humanoid)(object)p), "m_leftItem" => Campos.ManoIzquierda.Invoke((Humanoid)(object)p), _ => Traverse.Create((object)p).Field(field).GetValue(), }); } public static bool Worn(Player p) { if ((Object)(object)p != (Object)null) { return Is(Slot(p, "m_chestItem"), "MT_ArmaduraMk1"); } return false; } public static float ConArmadura(Player p) { if (!Worn(p)) { return 1f; } return MTMagiaPlugin.Mk1ConArmaduraEscala.Value; } public static bool HoldsCanon(Player p) { if ((Object)(object)p != (Object)null) { return Is(Slot(p, "m_rightItem"), "MT_CanonMk1"); } return false; } public static void Recargar() { _cache = null; Mk1Skin.ClearCache(); Mk1Material.ClearCache(); ArmaduraMk1Ctrl.Rebuild = true; } public static Modelo Piece(string name) { if (_cache == null) { _cache = new Dictionary(); } if (_cache.TryGetValue(name, out var value)) { return value; } string text = Path.Combine(MTMagiaPlugin.ModelDir, "mk1_" + name + ".obj"); List materialNames; Mesh val = ObjModel.Load(text, out materialNames); if ((Object)(object)val == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)("Mk-I: falta la pieza " + text)); return _cache[name] = new Modelo(); } val.RecalculateTangents(); Material val2 = Mk1Material.Armas(); if ((Object)(object)val2 == (Object)null) { return _cache[name] = new Modelo(); } Material[] array = (Material[])(object)new Material[val.subMeshCount]; for (int i = 0; i < array.Length; i++) { array[i] = (materialNames[i].Contains("UnderArmor") ? Mk1Material.Joint() : val2); } return _cache[name] = new Modelo { Mesh = val, Mats = array }; } } public class ArmaduraMk1Ctrl : MonoBehaviour { private class Conjunto { public readonly List Pieces = new List(); public float Since; public bool Built => Pieces.Count > 0; } public static bool Rebuild; private readonly Conjunto _armadura = new Conjunto(); private readonly Conjunto _escudo = new Conjunto(); private readonly Conjunto _canon = new Conjunto(); private readonly Conjunto _casco = new Conjunto(); private readonly Conjunto _grebas = new Conjunto(); private readonly List _hidden = new List(); private readonly List _piezasCuerpo = new List(); private Player _for; private float _hideCheck; private Animator _animator; private AnimatorCullingMode _originalCulling; private float _nextBuildWarning; public static Transform CanonPiece; private bool _apuntando; private float _nextShot; private float _nadoPuesto = -1f; private bool _camara; public static float CamaraAplicada = 1f; public static bool CamaraReaplicar; public static bool CanonReaplicar; private Vector3 _off3; private Vector3 _offCombate; private float _minD; private float _maxD; private static readonly HumanBodyBones[][] BrazoApuntar = new HumanBodyBones[2][] { (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)14, (HumanBodyBones)16 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)16, (HumanBodyBones)18 } }; internal static bool Saltando; private float _stepDist; private float _airTime; private float _peakY; private Vector3 _lastPos; private static GameObject _sfxPaso; private static bool _sfxBuscado; private GameObject _escudoRevisado; private bool _escudoConArmadura; private bool _canonConArmadura; private Transform _grown; private Vector3 _grownScale; private readonly List _hiddenParts = new List(); private float _partsCheck; private void OnDisable() { Clear(_armadura, restore: true); Clear(_escudo, restore: false); Clear(_canon, restore: false); Clear(_casco, restore: false); Clear(_grebas, restore: false); RestoreAnimator(); CanonPiece = null; ArmaduraMk1.Powered = false; } private void RestoreAnimator() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_animator != (Object)null) { _animator.cullingMode = _originalCulling; } _animator = null; } private void Canon(Player p) { //IL_00a3: 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_00da: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_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_0150: 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) _apuntando = false; if ((Object)(object)p == (Object)null || ((Character)p).IsDead() || !ArmaduraMk1.HoldsCanon(p) || ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus()) || Console.IsVisible() || Menu.IsVisible() || InventoryGui.IsVisible() || Minimap.IsOpen() || !ZInput.GetButton("Attack")) { return; } _apuntando = true; p.FaceLookDirection(); if (Time.time < _nextShot) { return; } _nextShot = Time.time + MTMagiaPlugin.Mk1Cadencia.Value; if (Mk1Canon.Calor(p)) { Vector3 val = Fx.AimPoint(p, 60f); MeshRenderer val2 = (((Object)(object)CanonPiece != (Object)null) ? ((Component)CanonPiece).GetComponent() : null); Vector3 val3; Bounds bounds; if (!((Object)(object)val2 != (Object)null)) { val3 = Fx.HandOrigin(p); } else { bounds = ((Renderer)val2).bounds; val3 = ((Bounds)(ref bounds)).center; } Vector3 val4 = val3; Vector3 val5 = val - val4; val5 = ((((Vector3)(ref val5)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val5)).normalized : ((Component)p).transform.forward); Vector3 val6 = val5; float num; if (!((Object)(object)val2 != (Object)null)) { num = 0f; } else { bounds = ((Renderer)val2).bounds; Vector3 extents = ((Bounds)(ref bounds)).extents; num = ((Vector3)(ref extents)).magnitude * 0.7f; } Vector3 muzzle = val4 + val6 * (num + 0.3f); Mk1Canon.Disparar(p, muzzle, val5); } } private void Camara(bool puesta) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) GameCamera instance = GameCamera.instance; if (!((Object)(object)instance == (Object)null) && puesta != _camara) { Traverse val = Traverse.Create((object)instance); if (puesta && !_camara) { _off3 = val.Field("m_3rdOffset").GetValue(); _offCombate = val.Field("m_3rdCombatOffset").GetValue(); _minD = val.Field("m_minDistance").GetValue(); _maxD = val.Field("m_maxDistance").GetValue(); float num = (CamaraAplicada = MTMagiaPlugin.Mk1Camara.Value); val.Field("m_3rdOffset").SetValue((object)new Vector3(_off3.x * num, _off3.y * num, _off3.z)); val.Field("m_3rdCombatOffset").SetValue((object)new Vector3(_offCombate.x * num, _offCombate.y * num, _offCombate.z)); val.Field("m_minDistance").SetValue((object)(_minD * num)); val.Field("m_maxDistance").SetValue((object)(_maxD * num)); float value = val.Field("m_distance").GetValue(); val.Field("m_distance").SetValue((object)Mathf.Max(value * num, _minD * num)); _camara = true; } else if (!puesta && _camara) { val.Field("m_3rdOffset").SetValue((object)_off3); val.Field("m_3rdCombatOffset").SetValue((object)_offCombate); val.Field("m_minDistance").SetValue((object)_minD); val.Field("m_maxDistance").SetValue((object)_maxD); float value2 = val.Field("m_distance").GetValue(); val.Field("m_distance").SetValue((object)Mathf.Clamp(value2 / CamaraAplicada, _minD, _maxD)); _camara = false; } } } private void LateUpdate() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0108: 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_010f: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0140: 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) Player localPlayer = Player.m_localPlayer; if (CamaraReaplicar) { CamaraReaplicar = false; Camara(puesta: false); } Camara((Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead() && _armadura.Built); if ((Object)(object)localPlayer != (Object)null && ArmaduraMk1.Powered && ((Character)localPlayer).m_swimSpeed != _nadoPuesto) { ((Character)localPlayer).m_swimSpeed = ((Character)localPlayer).m_swimSpeed * MTMagiaPlugin.Mk1Nado.Value; _nadoPuesto = ((Character)localPlayer).m_swimSpeed; } if (!_apuntando) { return; } Player localPlayer2 = Player.m_localPlayer; Animator val = (((Object)(object)localPlayer2 != (Object)null) ? ((Component)localPlayer2).GetComponentInChildren() : null); if ((Object)(object)val == (Object)null) { return; } Vector3 val2 = Fx.AimPoint(localPlayer2, 60f); HumanBodyBones[][] brazoApuntar = BrazoApuntar; foreach (HumanBodyBones[] array in brazoApuntar) { Transform boneTransform = val.GetBoneTransform(array[0]); Transform boneTransform2 = val.GetBoneTransform(array[1]); if (!((Object)(object)boneTransform == (Object)null) && !((Object)(object)boneTransform2 == (Object)null)) { Vector3 val3 = boneTransform2.position - boneTransform.position; Vector3 val4 = val2 - boneTransform.position; if (!(((Vector3)(ref val3)).sqrMagnitude < 1E-06f) && !(((Vector3)(ref val4)).sqrMagnitude < 1E-06f)) { boneTransform.rotation = Quaternion.FromToRotation(val3, val4) * boneTransform.rotation; } } } } private void Update() { Player localPlayer = Player.m_localPlayer; if (Rebuild) { Rebuild = false; _for = null; } if ((Object)(object)localPlayer != (Object)(object)_for) { Clear(_armadura, restore: true); Clear(_escudo, restore: false); Clear(_canon, restore: false); Clear(_casco, restore: false); Clear(_grebas, restore: false); RestoreAnimator(); _for = localPlayer; } bool flag = (Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead(); bool flag2 = flag && ArmaduraMk1.Worn(localPlayer); if (flag2 && Escuelas.Rank(localPlayer, Escuela.Tierra) < 3) { ((Humanoid)localPlayer).UnequipItem(ArmaduraMk1.Slot(localPlayer, "m_chestItem"), true); ((Character)localPlayer).Message((MessageType)2, Tr.Get("magia_need_earth_saint_rank_move"), 0, (Sprite)null, false); flag2 = false; } if (flag2 && !Mk1Diaria.PuedeEncender(localPlayer)) { ((Humanoid)localPlayer).UnequipItem(ArmaduraMk1.Slot(localPlayer, "m_chestItem"), true); ((Character)localPlayer).Message((MessageType)2, Tr.Get("magia_mk1_cooldown"), 0, (Sprite)null, false); flag2 = false; } if ((Object)(object)localPlayer != (Object)null && !flag2) { Mk1Diaria.Terminar(localPlayer); } Keep(localPlayer, _armadura, flag2, ArmaduraMk1.Piezas); if (ArmaduraMk1.Worn(localPlayer) != _canonConArmadura) { _canonConArmadura = ArmaduraMk1.Worn(localPlayer); CanonReaplicar = true; } if (CanonReaplicar) { CanonReaplicar = false; Clear(_canon, restore: false); } Keep(localPlayer, _canon, flag && ArmaduraMk1.HoldsCanon(localPlayer), ArmaduraMk1.PiezaCanon); Keep(localPlayer, _casco, flag2, null); Keep(localPlayer, _grebas, flag2, null); HideForParts(localPlayer); EscudoVisible(localPlayer); CanonPiece = (_canon.Built ? _canon.Pieces[0].transform : null); Canon(localPlayer); if (!_armadura.Built && !_escudo.Built && !_canon.Built && !_casco.Built && !_grebas.Built) { RestoreAnimator(); } if (flag) { Pisadas(localPlayer, flag2); } if (!flag2 || !_armadura.Built) { ArmaduraMk1.Powered = false; return; } float num = MTMagiaPlugin.Mk1ManaSegundo.Value * Time.deltaTime; bool powered = ArmaduraMk1.Powered; ArmaduraMk1.Powered = localPlayer.GetEitr() > num + 0.5f; ItemData val = ArmaduraMk1.Slot(localPlayer, "m_chestItem"); if (ArmaduraMk1.Powered && val != null) { val.m_durability = Mathf.Max(0f, val.m_durability - MTMagiaPlugin.Mk1DesgasteSegundo.Value * Time.deltaTime); if (val.m_durability <= 0f) { ArmaduraMk1.Powered = false; Clear(_armadura, restore: true); Clear(_casco, restore: false); Clear(_grebas, restore: false); HideForParts(localPlayer); RestoreAnimator(); ((Humanoid)localPlayer).UnequipItem(val, true); ((Character)localPlayer).Message((MessageType)2, Tr.Get("magia_mk_i_broken_repair_forge"), 0, (Sprite)null, false); Cronica.AnotarUnaVez(localPlayer, "mk1_rota", "cronica_mk1_broken", Array.Empty()); return; } } if (ArmaduraMk1.Powered) { if (!powered) { Cronica.AnotarUnaVez(localPlayer, "mk1_encendida", "cronica_mk1_powered", Array.Empty()); } ((Character)localPlayer).UseEitr(num); if (((Character)localPlayer).GetHealth() < ((Character)localPlayer).GetMaxHealth()) { ((Character)localPlayer).Heal(MTMagiaPlugin.Mk1RegenVida.Value * Time.deltaTime, false); } _hideCheck -= Time.deltaTime; if (!(_hideCheck <= 0f) || (!_grebas.Built && Mk1Skin.PartAvailable("piernas"))) { return; } _hideCheck = 0.5f; ((Component)localPlayer).GetComponentsInChildren(_piezasCuerpo); { foreach (SkinnedMeshRenderer item in _piezasCuerpo) { if (((Renderer)item).enabled && !((Object)item).name.StartsWith("MT_Mk1_")) { ((Renderer)item).enabled = false; _hidden.Add((Renderer)(object)item); } } return; } } ArmaduraMk1.Powered = false; Clear(_armadura, restore: true); Clear(_casco, restore: false); Clear(_grebas, restore: false); HideForParts(localPlayer); RestoreAnimator(); ((Humanoid)localPlayer).UnequipItem(ArmaduraMk1.Slot(localPlayer, "m_chestItem"), true); ((Character)localPlayer).Message((MessageType)2, Tr.Get("magia_mk_i_runs_out_mana"), 0, (Sprite)null, false); } private void Pisadas(Player p, bool worn) { //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_0074: 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_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_0022: 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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: 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_00c0: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)p).transform.position; if (!((Character)p).IsOnGround()) { if (_airTime <= 0f) { _peakY = position.y; } _peakY = Mathf.Max(_peakY, position.y); _airTime += Time.deltaTime; _lastPos = position; return; } if (_airTime > 0f) { float num = _peakY - position.y; float value = MTMagiaPlugin.Mk1CaidaMinima.Value; if (num >= value) { float num2 = Mathf.Clamp01((num - value) / (value * 2f)); if (MTMagiaPlugin.Mk1TemblorCaida.Value > 0f) { GameCamera instance = GameCamera.instance; if (instance != null) { instance.AddShake(position, 12f, MTMagiaPlugin.Mk1TemblorCaida.Value * (1f + num2 * 2f), false); } } Tierra(position, 0.25f + num2 * 0.35f); if (worn) { SonidoPesado(position, fuerte: true); } if (worn && ArmaduraMk1.Powered && Saltando) { Aterrizaje(p, position, 0.5f + num2 * 2.5f); } } else if (worn && num > 0.3f) { if (MTMagiaPlugin.Mk1TemblorPaso.Value > 0f) { GameCamera instance2 = GameCamera.instance; if (instance2 != null) { instance2.AddShake(position, 12f, MTMagiaPlugin.Mk1TemblorPaso.Value * 0.8f, false); } } SonidoPesado(position, fuerte: false); } } _airTime = 0f; Saltando = false; if (!worn || !MTMagiaPlugin.Mk1Temblor.Value) { _lastPos = position; return; } Vector3 val = position - _lastPos; val.y = 0f; _lastPos = position; if (!(((Vector3)(ref val)).magnitude > 2f)) { _stepDist += ((Vector3)(ref val)).magnitude; float num3 = (((Character)p).IsRunning() ? 2.1f : 1.4f); if (_stepDist >= num3) { _stepDist = 0f; Paso(p, position, ((Character)p).IsRunning() ? 1f : 0.6f); } } } private static void Aterrizaje(Player p, Vector3 pos, float aire) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_006c: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp(aire, 0.5f, 3f); float radius = 1.8f + num * 0.8f; DamageTypes damage = new DamageTypes { m_blunt = MTMagiaPlugin.Mk1DanoCaida.Value * num }; foreach (Character item in Fx.EnemiesInRadius(p, pos, radius)) { if ((Object)(object)item != (Object)null && !item.IsDead()) { Fx.Damage(p, item, damage, (SkillType)9, 25f * num, 2f); } } } private static void Tierra(Vector3 pos, float fuerza) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(pos + Vector3.up * 0.1f, new Particulas.Config { ColorA = new Color(0.55f, 0.47f, 0.36f, 0.7f), ColorB = new Color(0.45f, 0.4f, 0.32f, 0.5f), LifeMin = 0.6f, LifeMax = 1.2f, SpeedMin = 0.5f, SpeedMax = 2f * fuerza, SizeMin = 0.3f, SizeMax = 0.8f * fuerza, Radius = 0.5f, Hemisphere = true, Additive = false, Burst = (int)(18f * fuerza), Grow = 1.8f }); } private static void SonidoPesado(Vector3 pos, bool fuerte) { //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) List nombres; if (!_sfxBuscado && (Object)(object)ZNetScene.instance != (Object)null) { _sfxBuscado = true; nombres = new List(); foreach (GameObject prefab in ZNetScene.instance.m_prefabs) { if ((Object)(object)prefab != (Object)null && ((Object)prefab).name.StartsWith("sfx_")) { nombres.Add(((Object)prefab).name); } } string text = Buscar(new string[6][] { new string[1] { "footstep" }, new string[2] { "foot", "grass" }, new string[2] { "foot", "dirt" }, new string[2] { "troll", "foot" }, new string[2] { "troll", "step" }, new string[2] { "golem", "step" } }); _sfxPaso = ((text != null) ? ZNetScene.instance.GetPrefab(text) : null); MTMagiaPlugin.Log.LogInfo((object)("Mk-I: sonido de pisada reutilizado «" + (text ?? "ninguno") + "»")); } if (fuerte && (Object)(object)_sfxPaso != (Object)null) { Object.Instantiate(_sfxPaso, pos, Quaternion.identity); } string Buscar(params string[][] reglas) { foreach (string[] array in reglas) { foreach (string item in nombres) { string text2 = item.ToLowerInvariant(); bool flag = true; string[] array2 = array; foreach (string value in array2) { if (!text2.Contains(value)) { flag = false; break; } } if (flag) { return item; } } } return null; } } private void EscudoVisible(Player p) { //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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) if ((Object)(object)p == (Object)null || !ArmaduraMk1.Is(ArmaduraMk1.Slot(p, "m_leftItem"), "MT_EscudoMk1")) { _escudoRevisado = null; return; } VisEquipment component = ((Component)p).GetComponent(); GameObject val = (((Object)(object)component != (Object)null) ? Campos.InstanciaIzquierda.Invoke(component) : null); bool flag = ArmaduraMk1.Worn(p); if ((Object)(object)val == (Object)null || ((Object)(object)val == (Object)(object)_escudoRevisado && flag == _escudoConArmadura)) { return; } if ((Object)(object)val == (Object)(object)_escudoRevisado) { _escudoConArmadura = flag; ArmaduraMk1.ReaplicarEscudo(p); return; } _escudoRevisado = val; _escudoConArmadura = flag; if (flag) { ArmaduraMk1.ReaplicarEscudo(p); } MeshRenderer val2 = null; MeshRenderer[] componentsInChildren = val.GetComponentsInChildren(true); foreach (MeshRenderer val3 in componentsInChildren) { if (((Object)val3).name == "MT_Mk1_escudo_mano") { val2 = val3; } } if ((Object)(object)val2 == (Object)null) { bool flag2 = ArmaduraMk1.ColocarEscudo(val, soloVisibles: false, ArmaduraMk1.ConArmadura(p)); MTMagiaPlugin.Log.LogInfo((object)("Mk-I: escudo en la mano sin nuestro modelo; " + (flag2 ? "añadido" : "NO se pudo añadir"))); componentsInChildren = val.GetComponentsInChildren(true); foreach (MeshRenderer val4 in componentsInChildren) { if (((Object)val4).name == "MT_Mk1_escudo_mano") { val2 = val4; } } } if ((Object)(object)val2 != (Object)null) { ((Renderer)val2).enabled = true; ((Component)val2).gameObject.SetActive(true); ManualLogSource log = MTMagiaPlugin.Log; object arg = ((Component)val2).gameObject.activeInHierarchy; Bounds bounds = ((Renderer)val2).bounds; log.LogInfo((object)($"Mk-I: escudo en la mano: activo={arg}, tamaño={((Bounds)(ref bounds)).size}, " + $"escala={((Component)val2).transform.lossyScale}, capa={((Component)val2).gameObject.layer}, padre={((Object)((Component)val2).transform.parent).name}, instancia={((Object)val).name}")); } else { MTMagiaPlugin.Log.LogWarning((object)("Mk-I: el escudo en la mano no tiene dónde poner el modelo (instancia " + ((Object)val).name + ")")); } } private static void Paso(Player p, Vector3 pos, float fuerza) { //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_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) float num = ((fuerza > 1f) ? MTMagiaPlugin.Mk1TemblorCaida.Value : MTMagiaPlugin.Mk1TemblorPaso.Value); if (num > 0f) { GameCamera instance = GameCamera.instance; if (instance != null) { instance.AddShake(pos, 12f, num * fuerza, false); } } Particulas.Spawn(pos + Vector3.up * 0.1f, new Particulas.Config { ColorA = new Color(0.55f, 0.47f, 0.36f, 0.7f), ColorB = new Color(0.45f, 0.4f, 0.32f, 0.5f), LifeMin = 0.6f, LifeMax = 1.1f, SpeedMin = 0.5f, SpeedMax = 1.5f * fuerza, SizeMin = 0.3f, SizeMax = 0.7f * fuerza, Radius = 0.4f, Hemisphere = true, Additive = false, Burst = (int)(14f * fuerza), Grow = 1.8f }); if (fuerza > 2f) { Fx.Visual("vfx_RockHit", pos, 1.5f); Particulas.Tierra(pos, 1f, Mathf.Min(fuerza / 3f, 2f)); } } private void Keep(Player p, Conjunto c, bool want, KeyValuePair[] piezas) { if (!want) { Clear(c, c == _armadura); } else if (!c.Built) { if (c.Since <= 0f) { c.Since = Time.time; } if (Time.time >= c.Since) { c.Since = Time.time + 1f; Build(p, c, piezas); } } } private void Build(Player p, Conjunto c, KeyValuePair[] piezas) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Expected O, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) Animator componentInChildren = ((Component)p).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return; } if ((Object)(object)_animator == (Object)null) { _animator = componentInChildren; _originalCulling = componentInChildren.cullingMode; } componentInChildren.cullingMode = (AnimatorCullingMode)0; string text = ((c == _casco) ? "casco" : ((c == _grebas) ? "piernas" : ((c == _armadura) ? "torso" : null))); Vector3 velocity; if (text != null && Mk1Skin.PartAvailable(text)) { if (Mk1Skin.PartNeedsCalm(text)) { if (!((Character)p).IsOnGround() || ((Character)p).InAttack() || ((Character)p).IsSitting()) { return; } velocity = ((Character)p).GetVelocity(); if (((Vector3)(ref velocity)).magnitude > 0.5f) { return; } } if (c == _armadura) { Grow(p, on: true); } GameObject val = Mk1Skin.BuildPart(p, componentInChildren, text); if ((Object)(object)val != (Object)null) { c.Pieces.Add(val); if (c == _armadura) { ((Character)p).Message((MessageType)1, Tr.Get("magia_mk_i_magic_armor_activated"), 0, (Sprite)null, false); Destello(p, poner: true); } } return; } if (c == _armadura) { Grow(p, on: true); if (MTMagiaPlugin.Mk1Esqueleto.Value && Mk1Skin.Available) { if (!MTMagiaPlugin.Mk1EsqueletoPropio.Value || !MTMagiaPlugin.Mk1PoseBase.Value) { if (((Character)p).IsOnGround() && !((Character)p).InAttack() && !((Character)p).IsSitting()) { velocity = ((Character)p).GetVelocity(); if (!(((Vector3)(ref velocity)).magnitude > 0.5f)) { goto IL_0181; } } Grow(p, on: false); return; } goto IL_0181; } } goto IL_01bd; IL_01bd: if (piezas == null) { return; } for (int i = 0; i < piezas.Length; i++) { KeyValuePair keyValuePair = piezas[i]; ArmaduraMk1.Modelo modelo = ArmaduraMk1.Piece(keyValuePair.Key); if ((Object)(object)modelo.Mesh == (Object)null) { Clear(c, restore: false); return; } GameObject val2 = new GameObject("MT_Mk1_" + keyValuePair.Key); val2.layer = ((Component)p).gameObject.layer; if (!Mk1Rig.Attach(val2, p, keyValuePair.Value, keyValuePair.Key)) { Object.Destroy((Object)(object)val2); Clear(c, restore: false); if (Time.time >= _nextBuildWarning) { _nextBuildWarning = Time.time + 10f; MTMagiaPlugin.Log.LogWarning((object)("Mk-I: no se pudo vincular " + keyValuePair.Key + "; se conserva el cuerpo visible")); } return; } val2.AddComponent().sharedMesh = modelo.Mesh; ((Renderer)val2.AddComponent()).sharedMaterials = modelo.Mats; Colocar(val2.transform, keyValuePair.Key); c.Pieces.Add(val2); } if (c == _armadura) { ((Character)p).Message((MessageType)1, Tr.Get("magia_mk_i_magic_armor_activated"), 0, (Sprite)null, false); Destello(p, poner: true); } return; IL_0181: GameObject val3 = Mk1Skin.Build(p, componentInChildren); if ((Object)(object)val3 != (Object)null) { c.Pieces.Add(val3); ((Character)p).Message((MessageType)1, Tr.Get("magia_mk_i_magic_armor_activated"), 0, (Sprite)null, false); Destello(p, poner: true); return; } goto IL_01bd; } private static void Colocar(Transform t, string pieza) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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) Vector3 value; Vector3 value2; float num; if (pieza == "escudo") { value = MTMagiaPlugin.Mk1EscudoGiro.Value; value2 = MTMagiaPlugin.Mk1EscudoPos.Value; num = MTMagiaPlugin.Mk1EscudoEscala.Value; } else { if (!(pieza == "canon")) { return; } value = MTMagiaPlugin.Mk1CanonGiro.Value; value2 = MTMagiaPlugin.Mk1CanonPos.Value; num = MTMagiaPlugin.Mk1CanonEscala.Value * ArmaduraMk1.ConArmadura(Player.m_localPlayer); } t.rotation *= Quaternion.Euler(value); t.position += t.rotation * value2; t.localScale *= num; } private void Grow(Player p, bool on) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) if (on && (Object)(object)_grown == (Object)null) { _grown = ((Component)p).transform.Find("Visual"); if (!((Object)(object)_grown == (Object)null)) { _grownScale = _grown.localScale; _grown.localScale = _grownScale * MTMagiaPlugin.Mk1Tamano.Value; } } else if (!on && (Object)(object)_grown != (Object)null) { _grown.localScale = _grownScale; _grown = null; } } private void HideForParts(Player p) { bool built = _casco.Built; bool flag = _grebas.Built && !_armadura.Built; if (!built && !flag) { foreach (Renderer hiddenPart in _hiddenParts) { if ((Object)(object)hiddenPart != (Object)null) { hiddenPart.enabled = true; } } _hiddenParts.Clear(); return; } _partsCheck -= Time.deltaTime; if (_partsCheck > 0f) { return; } _partsCheck = 0.5f; VisEquipment component = ((Component)p).GetComponent(); if ((Object)(object)component == (Object)null || !built) { return; } string[] array = new string[2] { "m_hairItemInstance", "m_beardItemInstance" }; foreach (string text in array) { GameObject value = Traverse.Create((object)component).Field(text).GetValue(); if ((Object)(object)value == (Object)null) { continue; } Renderer[] componentsInChildren = value.GetComponentsInChildren(); foreach (Renderer val in componentsInChildren) { if (val.enabled) { val.enabled = false; _hiddenParts.Add(val); } } } } private static void Destello(Player p, bool poner) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)p == (Object)null)) { Vector3 position = ((Component)p).transform.position; Particulas.Spawn(position + Vector3.up * 1.1f, new Particulas.Config { ColorA = new Color(0.45f, 0.85f, 1f, 0.9f), ColorB = new Color(0.8f, 0.95f, 1f, 0.7f), LifeMin = 0.6f, LifeMax = 1.3f, SpeedMin = 0.5f, SpeedMax = (poner ? 2.5f : 3.5f), SizeMin = 0.05f, SizeMax = 0.16f, Gravity = (poner ? (-0.4f) : 0.2f), Radius = 0.9f, Additive = true, Burst = 90, Grow = 0.3f }); Particulas.Spawn(position + Vector3.up * 0.1f, new Particulas.Config { ColorA = new Color(0.4f, 0.8f, 1f, 0.6f), ColorB = new Color(0.6f, 0.9f, 1f, 0.4f), LifeMin = 0.5f, LifeMax = 0.8f, SpeedMin = 2f, SpeedMax = 3f, SizeMin = 0.2f, SizeMax = 0.35f, Radius = 0.3f, Hemisphere = true, Additive = true, Burst = 40, Grow = 2f }); Light obj = LucesMagicas.Registrar(new GameObject("MT_Mk1_destello").AddComponent()); ((Component)obj).transform.position = position + Vector3.up * 1.2f; obj.color = new Color(0.5f, 0.85f, 1f); obj.range = 6f; obj.intensity = 3f; Object.Destroy((Object)(object)((Component)obj).gameObject, 0.4f); Fx.Visual("fx_StaffShield_Hit", position + Vector3.up * 1f, 1.2f); } } private void Clear(Conjunto c, bool restore) { if (c == _armadura && c.Pieces.Count > 0 && (Object)(object)Player.m_localPlayer != (Object)null && !((Character)Player.m_localPlayer).IsDead()) { Destello(Player.m_localPlayer, poner: false); } foreach (GameObject piece in c.Pieces) { if ((Object)(object)piece != (Object)null) { Object.Destroy((Object)(object)piece); } } c.Pieces.Clear(); c.Since = 0f; if (c == _armadura) { Grow(null, on: false); } if (!restore) { return; } foreach (Renderer item in _hidden) { if ((Object)(object)item != (Object)null) { item.enabled = true; } } _hidden.Clear(); } } [HarmonyPatch(typeof(Humanoid), "EquipItem")] public static class Mk1SoloConArmaduraPatch { private static bool Prefix(Humanoid __instance, ItemData __0) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val == null || __0 == null) { return true; } if (!ArmaduraMk1.Is(__0, "MT_EscudoMk1") && !ArmaduraMk1.Is(__0, "MT_CanonMk1")) { return true; } if (ArmaduraMk1.Worn(val)) { return true; } if ((Object)(object)val == (Object)(object)Player.m_localPlayer) { ((Character)val).Message((MessageType)2, Tr.Get("magia_too_heavy_need_mk_i"), 0, (Sprite)null, false); } return false; } } [HarmonyPatch(typeof(Humanoid), "UnequipItem")] public static class Mk1QuitarConArmaduraPatch { private static void Postfix(Humanoid __instance, ItemData __0) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val == null || !ArmaduraMk1.Is(__0, "MT_ArmaduraMk1") || ArmaduraMk1.Worn(val)) { return; } foreach (ItemData item in ((Humanoid)val).GetInventory().GetEquippedItems().ToList()) { if (ArmaduraMk1.Is(item, "MT_EscudoMk1") || ArmaduraMk1.Is(item, "MT_CanonMk1")) { ((Humanoid)val).UnequipItem(item, false); } } } } [HarmonyPatch(typeof(Humanoid), "StartAttack")] public static class Mk1CanonSinAtaquePatch { private static bool Prefix(Humanoid __instance, ref bool __result) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || !ArmaduraMk1.HoldsCanon((Player)__instance)) { return true; } __result = false; return false; } } public static class Mk1Canon { private static GameObject _sfx; private static bool _buscado; private static int _balas; private static float _ultimaBala = -99f; private static float _frioHasta; private static void Sonido(Vector3 pos) { //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) if (!MTMagiaPlugin.Mk1CanonVolumen.Value) { return; } if (!_buscado && (Object)(object)ZNetScene.instance != (Object)null) { _buscado = true; List list = new List(); foreach (GameObject prefab in ZNetScene.instance.m_prefabs) { if ((Object)(object)prefab != (Object)null && ((Object)prefab).name.StartsWith("sfx_")) { list.Add(((Object)prefab).name); } } string text = null; string[][] array = new string[7][] { new string[2] { "arbalest", "fire" }, new string[2] { "crossbow", "fire" }, new string[2] { "ballista", "fire" }, new string[1] { "ballista" }, new string[1] { "arbalest" }, new string[1] { "catapult" }, new string[2] { "bow", "fire" } }; foreach (string[] regla in array) { text = list.FirstOrDefault((string n) => regla.All((string t) => n.ToLowerInvariant().Contains(t))); if (text != null) { break; } } _sfx = ((text != null) ? ZNetScene.instance.GetPrefab(text) : null); MTMagiaPlugin.Log.LogInfo((object)("Mk-I: sonido del cañón reutilizado «" + (text ?? "ninguno") + "»")); } if ((Object)(object)_sfx != (Object)null) { Object.Instantiate(_sfx, pos, Quaternion.identity); } } public static bool Calor(Player p) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Time.time < _frioHasta) { return false; } if (Time.time - _ultimaBala > 1f) { _balas = 0; } _ultimaBala = Time.time; if ((float)(++_balas) <= MTMagiaPlugin.Mk1CalorBalas.Value) { return true; } _balas = 0; _frioHasta = Time.time + MTMagiaPlugin.Mk1CalorEspera.Value; ((Character)p).Message((MessageType)1, Tr.Get("magia_mk1_cannon_overheat"), 0, (Sprite)null, false); Fx.Visual("vfx_smelter_add", ((Character)p).GetCenterPoint() + ((Component)p).transform.right * 0.5f, 0.6f); Cronica.AnotarUnaVez(p, "mk1_calor", "cronica_mk1_overheat", Array.Empty()); return false; } public static void Disparar(Player p, Vector3 muzzle, Vector3 dir) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) float value = MTMagiaPlugin.Mk1ManaDisparo.Value; ItemData val = ArmaduraMk1.Slot(p, "m_rightItem"); if (val != null && val.m_durability <= 0f) { ((Character)p).Message((MessageType)2, Tr.Get("magia_mk_i_cannon_burnt_out"), 0, (Sprite)null, false); return; } if (p.GetEitr() < value) { ((Character)p).Message((MessageType)1, Tr.Get("magia_no_mana_cannon"), 0, (Sprite)null, false); return; } ((Character)p).UseEitr(value); Sonido(muzzle); if (val != null) { val.m_durability = Mathf.Max(0f, val.m_durability - MTMagiaPlugin.Mk1CanonDesgaste.Value); if (val.m_durability <= 0f) { ((Character)p).Message((MessageType)2, Tr.Get("magia_mk_i_cannon_has_burnt"), 0, (Sprite)null, false); } } float blunt = ((val != null) ? val.GetDamage().m_blunt : MTMagiaPlugin.Mk1DanoBala.Value) * (1f + ((Character)p).GetSkillLevel((SkillType)9) / 100f); Fx.HeatOverride = 1f; try { Fx.Projectile(p, "MT_BalaPiedra", dir, MTMagiaPlugin.Mk1VelocidadBala.Value, new DamageTypes { m_blunt = blunt }, (SkillType)9, 15f, muzzle, null, MTMagiaPlugin.Mk1TamanoBala.Value); } finally { Fx.HeatOverride = null; } ((Character)p).RaiseSkill((SkillType)9, 0.1f); } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class Mk1DefensaPatch { private static void Prefix(Character __instance, HitData hit) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown if (hit != null && !((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && ArmaduraMk1.Powered) { float num = Mathf.Clamp(1f - MTMagiaPlugin.Mk1Reduccion.Value, 0.3f, 1f); hit.m_damage.m_blunt *= num; hit.m_damage.m_slash *= num; hit.m_damage.m_pierce *= num; hit.m_damage.m_fire *= num; hit.m_damage.m_frost *= num; hit.m_damage.m_lightning *= num; hit.m_damage.m_poison *= num; hit.m_damage.m_spirit *= num; hit.m_damage.m_frost *= 0.5f; hit.m_staggerMultiplier *= 0.5f; ItemData val = ArmaduraMk1.Slot((Player)__instance, "m_chestItem"); if (val != null) { val.m_durability = Mathf.Max(0f, val.m_durability - hit.GetTotalDamage() * MTMagiaPlugin.Mk1DesgasteGolpe.Value); } } } } [HarmonyPatch(typeof(Player), "Dodge")] public static class Mk1SinEsquivaPatch { private static bool Prefix(Player __instance) { if ((Object)(object)__instance == (Object)(object)Player.m_localPlayer) { return !ArmaduraMk1.Worn(__instance); } return true; } } [HarmonyPatch(typeof(Character), "Jump")] public static class Mk1SaltoPatch { private static void Postfix(Character __instance) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: Expected O, but got Unknown if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && ArmaduraMk1.Worn((Player)(object)((__instance is Player) ? __instance : null))) { ArmaduraMk1Ctrl.Saltando = true; Rigidbody val = Campos.Cuerpo.Invoke(__instance); if (!((Object)(object)val == (Object)null) && !(val.linearVelocity.y <= 0f)) { float num = (ArmaduraMk1.Powered ? MTMagiaPlugin.Mk1Salto.Value : 0.6f); val.linearVelocity = new Vector3(val.linearVelocity.x, val.linearVelocity.y * num, val.linearVelocity.z); WindImpulseVfx.Spawn((Player)__instance, Vector3.up); } } } } [HarmonyPatch(typeof(Player), "GetRunSpeedFactor")] public static class Mk1VelocidadPatch { private static void Postfix(Player __instance, ref float __result) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && ArmaduraMk1.Worn(__instance)) { __result *= (ArmaduraMk1.Powered ? MTMagiaPlugin.Mk1Carrera.Value : 0.85f); } } } [HarmonyPatch(typeof(Player), "GetJogSpeedFactor")] public static class Mk1TrotePatch { private static void Postfix(Player __instance, ref float __result) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && ArmaduraMk1.Worn(__instance)) { __result *= (ArmaduraMk1.Powered ? 1.1f : 0.85f); } } } [HarmonyPatch(typeof(Character), "Damage")] public static class Mk1DanoPatch { private static void Prefix(Character __instance, HitData hit) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && hit != null && !((Object)(object)__instance == (Object)(object)localPlayer) && !((Object)(object)hit.GetAttacker() != (Object)(object)localPlayer) && ArmaduraMk1.Powered) { ((DamageTypes)(ref hit.m_damage)).Modify(1f + MTMagiaPlugin.Mk1MasDano.Value * (float)ArmaduraMk1.Piezas_(localPlayer)); } } } [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] [HarmonyPriority(200)] public static class Mk1VidaPatch { private static void Postfix(Player __instance, ref float hp) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && ArmaduraMk1.Powered) { hp += MTMagiaPlugin.Mk1VidaPorPieza.Value * (float)ArmaduraMk1.Piezas_(__instance); } } } [HarmonyPatch(typeof(Character), "RPC_Damage")] [HarmonyPriority(600)] public static class Mk1DisrupcionPatch { private static float _listo; private static void Prefix(Character __instance, HitData hit) { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) Player val = (Player)(object)((__instance is Player) ? __instance : null); if ((Object)(object)val == (Object)null || (Object)(object)val != (Object)(object)Player.m_localPlayer || hit == null || !hit.m_ranged || ((Character)val).IsDead()) { return; } ItemData val2 = ArmaduraMk1.Slot(val, "m_leftItem"); if (ArmaduraMk1.Is(val2, "MT_EscudoMk1") && !(val2.m_durability <= 0f) && !(Time.time < _listo)) { float value = MTMagiaPlugin.Mk1DisrupcionMana.Value; if (!(val.GetEitr() < value)) { _listo = Time.time + MTMagiaPlugin.Mk1DisrupcionEspera.Value; ((Character)val).UseEitr(value); val2.m_durability = Mathf.Max(0f, val2.m_durability - val2.GetMaxDurability() * MTMagiaPlugin.Mk1DisrupcionDesgaste.Value); ((DamageTypes)(ref hit.m_damage)).Modify(0f); hit.m_pushForce = 0f; hit.m_staggerMultiplier = 0f; Vector3 pos = ((hit.m_point != Vector3.zero) ? hit.m_point : ((Character)val).GetCenterPoint()); Fx.Visual("fx_StaffShield_Hit", pos, 1.3f); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(0.45f, 0.85f, 1f, 0.9f), ColorB = new Color(0.75f, 0.6f, 1f, 0.7f), LifeMin = 0.3f, LifeMax = 0.7f, SpeedMin = 1.5f, SpeedMax = 4f, SizeMin = 0.05f, SizeMax = 0.14f, Radius = 0.2f, Additive = true, Burst = 60, Grow = 0.2f }); ((Character)val).Message((MessageType)1, Tr.Get("magia_magic_disruption"), 0, (Sprite)null, false); } } } } [HarmonyPatch(typeof(Humanoid), "StartAttack")] public static class AttackCastPatch { private static bool Prefix(Humanoid __instance, bool secondaryAttack, ref bool __result) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)__instance == (Object)(object)localPlayer && (Caster.BloqueoAtaque || Time.time < Caster.BloqueoAtaqueHasta || BloqueoClic.Bloquea)) { if (ZInput.GetButton("Attack") || ZInput.GetButton("SecondaryAttack") || Time.time < Caster.BloqueoAtaqueHasta) { BloqueoClic.VaciarCola(localPlayer); __result = false; return false; } Caster.BloqueoAtaque = false; } if ((Object)(object)__instance != (Object)(object)localPlayer) { return true; } if (secondaryAttack && (Object)(object)Caster.Instance != (Object)null && Caster.IsActiveCasting) { Caster.CancelCurrentCast(localPlayer); __result = false; return false; } if (secondaryAttack || (Object)(object)Caster.Instance == (Object)null || !Focus.CastsGrimoire(localPlayer)) { return true; } if (Caster.AllowNextAttack) { return true; } if (((Character)localPlayer).InAttack()) { __result = false; return false; } if (Caster.Instance.BeginAttackCast(localPlayer)) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(Attack), "OnAttackTrigger")] public static class AttackTriggerPatch { private static readonly MethodInfo SpawnPoint = AccessTools.Method(typeof(Attack), "GetProjectileSpawnPoint", (Type[])null, (Type[])null); private static bool Prefix(Attack __instance) { //IL_0046: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_0098: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return true; } if ((Object)(object)Campos.AtaquePersonaje.Invoke(__instance) != (Object)(object)localPlayer) { return true; } if (Caster.Pending == null) { return !Focus.CastsGrimoire(localPlayer); } localPlayer.FaceLookDirection(); object[] array = new object[2] { Vector3.zero, Vector3.zero }; SpawnPoint.Invoke(__instance, array); Vector3 val = Fx.HandOrigin(localPlayer); Vector3 val2 = Fx.AimPoint(localPlayer, 60f) - val; Caster.FirePending(localPlayer, val, (Vector3)((((Vector3)(ref val2)).sqrMagnitude > 0.01f) ? ((Vector3)(ref val2)).normalized : ((Vector3)array[1]))); return false; } } [HarmonyPatch(typeof(Attack), "GetAttackEitr", new Type[] { typeof(Character), typeof(ItemData) })] public static class AttackEitrPatch { private static void Postfix(Character character, ItemData weapon, ref float __result) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown if ((Object)(object)character == (Object)(object)Player.m_localPlayer && weapon != null && Focus.CastsGrimoire((Player)character)) { __result = 0f; } } } [HarmonyPatch(typeof(ZInput), "GetMouseScrollWheel")] public static class BlockZoomPatch { private static void Postfix(ref float __result) { if (!Caster.ReadingWheel && __result != 0f) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && Caster.CanTakeInput() && Focus.HasFocus(localPlayer) && (ZInput.GetKey((KeyCode)308, false) || ZInput.GetKey((KeyCode)307, false))) { __result = 0f; } } } } public class AuraCurativa : MonoBehaviour { private const float Tick = 0.5f; private Character _target; private float _left; private float _timer; private GameObject _vfx; public static float Total(Player caster) { if (!((Object)(object)caster == (Object)null)) { return 5f + 0.2f * Escuelas.Level(caster, Escuela.Sanacion); } return 5f; } public static void Start(Character target, Player caster) { if (!((Object)(object)target == (Object)null) && !target.IsDead()) { AuraCurativa obj = ((Component)target).GetComponent() ?? ((Component)target).gameObject.AddComponent(); obj._target = target; obj._left = Total(caster); obj._timer = 0f; obj.RestartVfx(); } } private void RestartVfx() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_vfx != (Object)null) { Object.Destroy((Object)(object)_vfx); } float duration = _left * 0.5f; Vfx.Heal(_target, Vfx.Verde, destellos: false, duration, loop: true); for (int num = ((Component)_target).transform.childCount - 1; num >= 0; num--) { Transform child = ((Component)_target).transform.GetChild(num); if (((Object)child).name == "MT_HealVFX") { _vfx = ((Component)child).gameObject; break; } } } private void Update() { if ((Object)(object)_target == (Object)null || _target.IsDead() || _left <= 0f) { if ((Object)(object)_vfx != (Object)null) { Object.Destroy((Object)(object)_vfx); } Object.Destroy((Object)(object)this); return; } _timer += Time.deltaTime; if (!(_timer < 0.5f)) { _timer -= 0.5f; _left -= 1f; if (_target.IsOwner() && _target.GetHealth() < _target.GetMaxHealth()) { _target.Heal(1f, true); } } } } public class AuraHechizos : MonoBehaviour { private struct EffectDef { public string Key; public int Hash; public Color Color; } private static readonly Color Barrera = new Color(0.95f, 0.85f, 0.5f); private static readonly Color Sanacion = new Color(0.5f, 1f, 0.5f); private static readonly Color Desintox = new Color(0.75f, 0.9f, 0.3f); private static readonly Color Viento = new Color(0.5f, 0.95f, 0.7f); private static readonly Color Gravedad = new Color(0.78f, 0.64f, 1f); private static readonly Color Sangre = new Color(0.85f, 0.15f, 0.2f); private static readonly EffectDef[] EfectosDefs = new EffectDef[14] { new EffectDef { Key = "MT_EscudoMagico", Hash = StringExtensionMethods.GetStableHashCode("MT_EscudoMagico"), Color = Barrera }, new EffectDef { Key = "MT_BarreraFlechas", Hash = StringExtensionMethods.GetStableHashCode("MT_BarreraFlechas"), Color = Barrera }, new EffectDef { Key = "MT_Reflectante", Hash = StringExtensionMethods.GetStableHashCode("MT_Reflectante"), Color = Barrera }, new EffectDef { Key = "MT_ReduccionDano", Hash = StringExtensionMethods.GetStableHashCode("MT_ReduccionDano"), Color = Barrera }, new EffectDef { Key = "MT_FortalezaDivina", Hash = StringExtensionMethods.GetStableHashCode("MT_FortalezaDivina"), Color = Barrera }, new EffectDef { Key = "MT_Regeneracion", Hash = StringExtensionMethods.GetStableHashCode("MT_Regeneracion"), Color = Sanacion }, new EffectDef { Key = "MT_Renacer", Hash = StringExtensionMethods.GetStableHashCode("MT_Renacer"), Color = Sanacion }, new EffectDef { Key = "MT_Vigor", Hash = StringExtensionMethods.GetStableHashCode("MT_Vigor"), Color = Sanacion }, new EffectDef { Key = "MT_Resistencia", Hash = StringExtensionMethods.GetStableHashCode("MT_Resistencia"), Color = Desintox }, new EffectDef { Key = "MT_Inmunidad", Hash = StringExtensionMethods.GetStableHashCode("MT_Inmunidad"), Color = Desintox }, new EffectDef { Key = "MT_PasoViento", Hash = StringExtensionMethods.GetStableHashCode("MT_PasoViento"), Color = Viento }, new EffectDef { Key = "MT_Aligerar", Hash = StringExtensionMethods.GetStableHashCode("MT_Aligerar"), Color = Gravedad }, new EffectDef { Key = "MT_PactoSangre", Hash = StringExtensionMethods.GetStableHashCode("MT_PactoSangre"), Color = Sangre }, new EffectDef { Key = "MT_SenorSangre", Hash = StringExtensionMethods.GetStableHashCode("MT_SenorSangre"), Color = Sangre } }; private static readonly int[] BarrerasHashes = new int[5] { StringExtensionMethods.GetStableHashCode("MT_EscudoMagico"), StringExtensionMethods.GetStableHashCode("MT_BarreraFlechas"), StringExtensionMethods.GetStableHashCode("MT_Reflectante"), StringExtensionMethods.GetStableHashCode("MT_ReduccionDano"), StringExtensionMethods.GetStableHashCode("MT_FortalezaDivina") }; private readonly Dictionary _activas = new Dictionary(); private readonly Dictionary _cuerpo = new Dictionary(); private Material _materialCuerpo; private Transform _burbuja; private Material _burbujaMat; private float _check; private Player _for; private readonly List _colores = new List(); private Transform _pies; private Transform _pecho; private Transform _cupula; private void Update() { //IL_00b0: 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) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)(object)_for) { Clear(); _for = localPlayer; } if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || !MTMagiaPlugin.EfectosPropios.Value) { Clear(); return; } _check -= Time.deltaTime; if (_check > 0f) { return; } _check = 0.25f; SEMan sEMan = ((Character)localPlayer).GetSEMan(); List colores = _colores; colores.Clear(); for (int i = 0; i < EfectosDefs.Length; i++) { EffectDef effectDef = EfectosDefs[i]; bool flag = sEMan.HaveStatusEffect(effectDef.Hash); if (flag) { colores.Add(effectDef.Color); } ParticleSystem value; bool flag2 = _activas.TryGetValue(effectDef.Key, out value) && (Object)(object)value != (Object)null; if (flag && !flag2) { _activas[effectDef.Key] = Crear(localPlayer, effectDef.Color, _activas.Count); } else if (!flag && flag2) { Object.Destroy((Object)(object)((Component)value).gameObject); _activas.Remove(effectDef.Key); } } UpdateCuerpo(localPlayer, colores); bool flag3 = false; for (int j = 0; j < BarrerasHashes.Length; j++) { if (sEMan.HaveStatusEffect(BarrerasHashes[j])) { flag3 = true; break; } } UpdateBurbuja(localPlayer, flag3); } private void LateUpdate() { //IL_002c: 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_0089: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_burbuja == (Object)null)) { float time = Time.time; _pies.localRotation = Quaternion.Euler(0f, time * 20f, 0f); _pecho.localRotation = Quaternion.Euler(8f * Mathf.Sin(time * 0.7f), (0f - time) * 35f, 8f * Mathf.Cos(time * 0.7f)); _cupula.localRotation = Quaternion.Euler(0f, time * 8f, 0f); float num = 0.75f + 0.25f * Mathf.Sin(time * 2.4f); Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.88f, 0.55f, 0.85f * num); _burbujaMat.color = val; if (_burbujaMat.HasProperty("_TintColor")) { _burbujaMat.SetColor("_TintColor", val * 0.5f); } } } private void UpdateBurbuja(Player p, bool on) { //IL_0084: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: 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_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown if (!on) { if ((Object)(object)_burbuja != (Object)null) { Object.Destroy((Object)(object)((Component)_burbuja).gameObject); } _burbuja = null; } else { if ((Object)(object)_burbuja != (Object)null) { return; } if ((Object)(object)_burbujaMat == (Object)null) { _burbujaMat = new Material(Shader.Find("Legacy Shaders/Particles/Additive") ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)Texture2D.whiteTexture, renderQueue = 3050 }; } Transform transform = new GameObject("MT_SelloEscudo").transform; transform.SetParent(((Component)p).transform, false); _pies = Hijo(transform, "Pies", 0.06f); Circulo(_pies, 1.15f, 0.045f); Circulo(_pies, 1f, 0.02f); Vector3 val = default(Vector3); for (int i = 0; i < 12; i++) { float num = (float)i * (float)Math.PI / 6f; ((Vector3)(ref val))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); Trazo(_pies, (Vector3[])(object)new Vector3[2] { val * 1.01f, val * 1.14f }, (i % 3 == 0) ? 0.05f : 0.03f, cerrado: false); } _pecho = Hijo(transform, "Pecho", 1.25f); Circulo(_pecho, 0.95f, 0.02f); _cupula = Hijo(transform, "Cupula", 0f); for (int j = 0; j < 6; j++) { Vector3[] array = (Vector3[])(object)new Vector3[20]; float num2 = (float)j * (float)Math.PI / 3f; for (int k = 0; k < 20; k++) { float num3 = (float)k / 19f * (float)Math.PI / 2f; float num4 = Mathf.Cos(num3) * 1.15f; array[k] = new Vector3(Mathf.Cos(num2) * num4, 0.06f + Mathf.Sin(num3) * 2.25f, Mathf.Sin(num2) * num4); } Trazo(_cupula, array, 0.012f, cerrado: false).widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.02f), new Keyframe(0.7f, 0.012f), new Keyframe(1f, 0f) }); } _burbuja = transform; } } private static Transform Hijo(Transform padre, string nombre, float alto) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Transform transform = new GameObject(nombre).transform; transform.SetParent(padre, false); transform.localPosition = Vector3.up * alto; return transform; } private void Circulo(Transform padre, float r, float ancho) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[64]; for (int i = 0; i < 64; i++) { float num = (float)i / 64f * (float)Math.PI * 2f; array[i] = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * r; } Trazo(padre, array, ancho, cerrado: true); } private LineRenderer Trazo(Transform padre, Vector3[] pts, float ancho, bool cerrado) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Trazo"); val.transform.SetParent(padre, false); LineRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = _burbujaMat; obj.useWorldSpace = false; obj.loop = cerrado; obj.positionCount = pts.Length; obj.SetPositions(pts); obj.widthMultiplier = 1f; float startWidth = (obj.endWidth = ancho); obj.startWidth = startWidth; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } private void Clear() { foreach (ParticleSystem value in _activas.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); } } _activas.Clear(); foreach (SkinnedMeshRenderer value2 in _cuerpo.Values) { if ((Object)(object)value2 != (Object)null) { Object.Destroy((Object)(object)((Component)value2).gameObject); } } _cuerpo.Clear(); if ((Object)(object)_materialCuerpo != (Object)null) { Object.Destroy((Object)(object)_materialCuerpo); } _materialCuerpo = null; if ((Object)(object)_burbuja != (Object)null) { Object.Destroy((Object)(object)((Component)_burbuja).gameObject); } _burbuja = null; } private void UpdateCuerpo(Player p, List colors) { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0287: 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_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) if (colors.Count == 0) { foreach (SkinnedMeshRenderer value in _cuerpo.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); } } _cuerpo.Clear(); return; } if ((Object)(object)_materialCuerpo == (Object)null) { _materialCuerpo = MTBundle.Material("MT_ToukiAura"); if ((Object)(object)_materialCuerpo == (Object)null) { return; } _materialCuerpo.SetFloat("_Thickness", 0.018f); _materialCuerpo.SetFloat("_EdgePower", 2.1f); _materialCuerpo.SetFloat("_Fill", 0.15f); _materialCuerpo.SetFloat("_Intensity", 1.1f); } Color val = colors.Aggregate((Color a, Color b) => Color.Lerp(a, b, 0.5f)); _materialCuerpo.SetColor("_ColorLow", val * 0.6f); _materialCuerpo.SetColor("_ColorHigh", Color.Lerp(val, Color.white, 0.45f)); foreach (SkinnedMeshRenderer item in (from kv in _cuerpo where (Object)(object)kv.Key == (Object)null || (Object)(object)kv.Value == (Object)null select kv.Key).ToList()) { if ((Object)(object)_cuerpo[item] != (Object)null) { Object.Destroy((Object)(object)((Component)_cuerpo[item]).gameObject); } _cuerpo.Remove(item); } SkinnedMeshRenderer[] componentsInChildren = ((Component)p).GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren) { if (!((Object)val2).name.StartsWith("MT_Aura") && !((Object)(object)val2.sharedMesh == (Object)null) && !_cuerpo.ContainsKey(val2)) { GameObject val3 = new GameObject("MT_AuraHechizoCuerpo") { layer = ((Component)val2).gameObject.layer }; val3.transform.SetParent(((Component)val2).transform.parent, false); val3.transform.localPosition = ((Component)val2).transform.localPosition; val3.transform.localRotation = ((Component)val2).transform.localRotation; val3.transform.localScale = ((Component)val2).transform.localScale; SkinnedMeshRenderer val4 = val3.AddComponent(); val4.sharedMesh = val2.sharedMesh; val4.bones = val2.bones; val4.rootBone = val2.rootBone; val4.updateWhenOffscreen = true; ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val4).receiveShadows = false; ((Renderer)val4).sharedMaterials = Enumerable.Repeat(_materialCuerpo, val2.sharedMesh.subMeshCount).ToArray(); _cuerpo[val2] = val4; } } foreach (KeyValuePair item2 in _cuerpo) { ((Renderer)item2.Value).enabled = ((Renderer)item2.Key).enabled && ((Component)item2.Key).gameObject.activeInHierarchy; } } private static ParticleSystem Crear(Player p, Color c, int capa) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0023: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Expected O, but got Unknown GameObject val = new GameObject("MT_AuraHechizo"); val.transform.SetParent(((Component)p).transform, false); val.transform.localPosition = Vector3.up * (0.9f + 0.15f * (float)capa); ParticleSystem val2 = val.AddComponent(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(1f, 1.6f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.05f, 0.12f); ((MainModule)(ref main)).startColor = new MinMaxGradient(c, Color.Lerp(c, Color.white, 0.4f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).maxParticles = 150; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(30f); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 0.75f; ((ShapeModule)(ref shape)).radiusThickness = 0f; ((ShapeModule)(ref shape)).rotation = new Vector3(90f, 0f, 0f); VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalY = new MinMaxCurve((capa % 2 == 0) ? 1.6f : (-1.6f)); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(0.35f); MinMaxCurve val3 = default(MinMaxCurve); ((MinMaxCurve)(ref val3))..ctor(0f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).z = val3; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).x = val3; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val4 = new Gradient(); val4.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.2f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val4); ((Renderer)val.GetComponent()).material = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)ToukiManos.Dot() }; val2.Play(); return val2; } } public static class Bastones { public const string Aprendiz = "MT_BastonAprendiz"; public const string Adepto = "MT_BastonAdepto"; public const string Maestro = "MT_BastonMaestro"; public const string Archimago = "MT_BastonArchimago"; public const string GranGrimorio = "MT_GranGrimorio"; public const string Grimorio = "MT_GrimorioRunico"; public const string Pergamino = "MT_PergaminoMagiaRara"; public const string PergaminoGravedad = "MT_PergaminoGravedad"; public const string Agua = "MT_BastonAgua"; public const string Rudeus = "MT_BastonRudeus"; public const string Silfide = "MT_BastonSilfide"; public const string Tempestad = "MT_BastonTempestad"; public const string AquaHeartia = "MT_BastonAquaHeartia"; public const string Azurith = "MT_BastonAzurith"; public const string Ignivar = "MT_BastonIgnivar"; public const string Aurelia = "MT_BastonAurelia"; public const string Nihilum = "MT_BastonNihilum"; public const string Zefiria = "MT_BastonZefiria"; public static readonly Dictionary Nucleos = new Dictionary { { "MT_BastonAquaHeartia", Escuela.Agua }, { "MT_BastonAzurith", Escuela.Agua }, { "MT_BastonIgnivar", Escuela.Fuego }, { "MT_BastonAurelia", Escuela.Sanacion }, { "MT_BastonNihilum", Escuela.Gravedad }, { "MT_BastonZefiria", Escuela.Viento } }; public static float Tier(string prefab) { switch (prefab) { case "MT_BastonAprendiz": return 0.05f; case "MT_BastonAdepto": return 0.1f; case "MT_BastonMaestro": return 0.15f; case "MT_BastonArchimago": return 0.2f; case "MT_BastonRudeus": case "MT_BastonSilfide": case "MT_BastonTempestad": case "MT_BastonAgua": return 0.2f; case "MT_BastonAzurith": case "MT_BastonIgnivar": case "MT_BastonAurelia": case "MT_BastonNihilum": case "MT_BastonZefiria": case "MT_BastonAquaHeartia": return 0.3f; default: return -1f; } } public static void Register() { //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Expected O, but got Unknown //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Expected O, but got Unknown //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Expected O, but got Unknown PrefabManager.OnVanillaPrefabsAvailable -= Register; Baston("MT_BastonAprendiz", "baston_aprendiz", Tr.Token("magia_baston_aprendiz"), Tr.Token("magia_baston_aprendiz_d"), 1.5f, CraftingStations.Workbench, 2, 150f, 50f, false, R("FineWood", 10, 4), R("GreydwarfEye", 10, 5), R("Resin", 5, 3), R("SurtlingCore", 1, 1)); Baston("MT_BastonAdepto", "baston_adepto", Tr.Token("magia_baston_adepto"), Tr.Token("magia_baston_adepto_d"), 2.5f, CraftingStations.Forge, 2, 200f, 50f, false, R("ElderBark", 10, 4), R("Iron", 4, 2), R("Guck", 5, 2), R("SurtlingCore", 2, 1)); Baston("MT_BastonMaestro", "baston_maestro", Tr.Token("magia_baston_maestro"), Tr.Token("magia_baston_maestro_d"), 3f, CraftingStations.GaldrTable, 1, 250f, 50f, false, R("YggdrasilWood", 10, 4), R("Silver", 5, 2), R("Eitr", 10, 4)); Baston("MT_BastonArchimago", "baston_archimago", Tr.Token("magia_baston_archimago"), Tr.Token("magia_baston_archimago_d"), 3.5f, CraftingStations.GaldrTable, 3, 300f, 50f, false, R("Blackwood", 10, 4), R("FlametalNew", 4, 2), R("Eitr", 15, 5), R("MoltenCore", 2, 1)); RequirementConfig[] recipe = (RequirementConfig[])(object)new RequirementConfig[3] { R("YggdrasilWood", 0, 4), R("Eitr", 0, 6), R("BlackCore", 0, 1) }; Baston("MT_BastonAgua", "baculo_aqua_heartia_v2", Tr.Token("magia_baculo_aqua_heartia_v2"), Tr.Token("magia_baculo_aqua_heartia_v2_d"), 3f, CraftingStations.GaldrTable, 1, 300f, 50f, soloMejora: true, recipe); Baston("MT_BastonRudeus", "baston_rudeus_inspirado", Tr.Token("magia_baston_rudeus_inspirado"), Tr.Token("magia_baston_rudeus_inspirado_d"), 3f, CraftingStations.GaldrTable, 1, 300f, 50f, soloMejora: true, recipe); Baston("MT_BastonSilfide", "baston_silfide", Tr.Token("magia_baston_silfide"), Tr.Token("magia_baston_silfide_d"), 2.5f, CraftingStations.GaldrTable, 1, 300f, 50f, soloMejora: true, recipe); Baston("MT_BastonTempestad", "baston_tempestad", Tr.Token("magia_baston_tempestad"), Tr.Token("magia_baston_tempestad_d"), 3f, CraftingStations.GaldrTable, 1, 300f, 50f, soloMejora: true, recipe); RequirementConfig[] recipe2 = (RequirementConfig[])(object)new RequirementConfig[3] { R("Eitr", 0, 10), R("BlackCore", 0, 2), R("DragonTear", 0, 2) }; Baston("MT_BastonAquaHeartia", "baculo_aqua_heartia_v3", "Aqua Heartia", Tr.Token("magia_baculo_aqua_heartia_v3_d"), 3f, CraftingStations.GaldrTable, 1, 400f, 100f, soloMejora: true, recipe2); Baston("MT_BastonAzurith", "baston_azurith", "Azurith", Tr.Token("magia_baston_azurith_d"), 3f, CraftingStations.GaldrTable, 1, 400f, 100f, soloMejora: true, recipe2); Baston("MT_BastonIgnivar", "baston_ignivar", "Ignivar", Tr.Token("magia_baston_ignivar_d"), 2.5f, CraftingStations.GaldrTable, 1, 400f, 100f, soloMejora: true, recipe2); Baston("MT_BastonAurelia", "baston_aurelia", "Aurelia", Tr.Token("magia_baston_aurelia_d"), 2.5f, CraftingStations.GaldrTable, 1, 400f, 100f, soloMejora: true, recipe2); Baston("MT_BastonNihilum", "baston_nihilum", "Nihilum", Tr.Token("magia_baston_nihilum_d"), 3f, CraftingStations.GaldrTable, 1, 400f, 100f, soloMejora: true, recipe2); Baston("MT_BastonZefiria", "baston_zefiria", "Zefiria", Tr.Token("magia_baston_zefiria_d"), 2.5f, CraftingStations.GaldrTable, 1, 400f, 100f, soloMejora: true, recipe2); Objeto("MT_GrimorioRunico", "grimorio_runico", Tr.Token("magia_grimorio_runico"), Tr.Token("magia_grimorio_runico_d"), 2f, 1, usable: true); Objeto("MT_GranGrimorio", "gran_grimorio", Tr.Token("magia_gran_grimorio"), Tr.Token("magia_gran_grimorio_d"), 3f, 1, usable: true); Objeto("MT_PergaminoMagiaRara", "pergamino_magia_rara", Tr.Token("magia_pergamino_magia"), Tr.Token("magia_pergamino_magia_d"), 0.2f, 20, usable: true); Objeto("MT_PergaminoGravedad", "pergamino_magia_rara", Tr.Token("magia_pergamino_gravedad"), Tr.Token("magia_pergamino_gravedad_d"), 0.2f, 5, usable: true, (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig("DragonTear", 3, 0, true), new RequirementConfig("Crystal", 10, 0, true), new RequirementConfig("Obsidian", 10, 0, true) }, CraftingStations.GaldrTable); PergaminosConsumibles.Registrar(); MTMagiaPlugin.Log.LogInfo((object)"Equipo mágico registrado: 8 bastones, 6 legendarios, grimorio y pergamino"); } private static RequirementConfig R(string item, int amount, int perLevel) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown return new RequirementConfig(item, amount, perLevel, true); } private static void Baston(string prefab, string model, string name, string description, float weight, string station, int stationLevel, float durability, float durabilityPerLevel, bool soloMejora, params RequirementConfig[] recipe) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0079: 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_00ba: 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) if ((Object)(object)PrefabManager.Instance.GetPrefab("StaffGreenRoots") == (Object)null) { return; } CustomItem val = new CustomItem(prefab, "StaffGreenRoots", new ItemConfig { Name = name, Description = description, Icon = MTMagiaPlugin.Icon(model), CraftingStation = station, MinStationLevel = stationLevel, RepairStation = CraftingStations.Workbench, Requirements = recipe }); SharedData shared = val.ItemDrop.m_itemData.m_shared; shared.m_skillType = (SkillType)9; shared.m_attack.m_attackEitr = 0f; shared.m_secondaryAttack.m_attackEitr = 0f; shared.m_attackStatusEffect = null; shared.m_damages = new DamageTypes { m_blunt = 4f }; shared.m_weight = weight; shared.m_maxQuality = 4; Desgaste.Configurar(shared, durability, durabilityPerLevel); SetModel(val.ItemPrefab, model, null); ItemManager.Instance.AddItem(val); if (soloMejora) { CustomRecipe recipe2 = val.Recipe; if ((Object)(object)((recipe2 != null) ? recipe2.Recipe : null) != (Object)null) { val.Recipe.Recipe.m_noCraftOnlyUpgrade = true; } } } internal static void Objeto(string prefab, string model, string name, string description, float weight, int stack, bool usable, RequirementConfig[] recipe = null, string station = null, int amount = 1) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)PrefabManager.Instance.GetPrefab("Resin") == (Object)null)) { ItemConfig val = new ItemConfig { Name = name, Description = description, Icon = MTMagiaPlugin.Icon(model) }; if (recipe != null) { val.Requirements = recipe; val.CraftingStation = station; val.Amount = amount; } CustomItem val2 = new CustomItem(prefab, "Resin", val); SharedData shared = val2.ItemDrop.m_itemData.m_shared; shared.m_weight = weight; shared.m_maxStackSize = stack; shared.m_value = 0; if (usable) { shared.m_itemType = (ItemType)2; } SetModel(val2.ItemPrefab, model, Vector3.zero); ItemManager.Instance.AddItem(val2); } } private static void SetModel(GameObject prefab, string model, Vector3? groundEuler) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) string text = Path.Combine(MTMagiaPlugin.ModelDir, model + ".obj"); List materialNames; Mesh val = ObjModel.Load(text, out materialNames); if ((Object)(object)val == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)("Modelo no encontrado: " + text)); return; } GameObject prefab2 = PrefabManager.Instance.GetPrefab("Club"); object obj; if (prefab2 == null) { obj = null; } else { MeshRenderer componentInChildren = prefab2.GetComponentInChildren(true); obj = ((componentInChildren != null) ? ((Renderer)componentInChildren).sharedMaterial : null); } Material template = (Material)obj; string name = ((Object)prefab).name; ObjModel.ReplaceVisual(prefab, val, ObjModel.Materials(materialNames, template, Path.ChangeExtension(text, ".mtl")), Agarre.Rotation(name), Agarre.Offset(name), groundEuler); Agarre.Setup(name, prefab); } } [HarmonyPatch(typeof(CharacterDrop), "GenerateDropList")] public static class BastonesDropPatch { internal class Drop { public readonly string Item; public readonly float Chance; public Drop(string item, float chance) { Item = item; Chance = chance; } } private const string P = "MT_PergaminoMagiaRara"; private const string G = "MT_GrimorioRunico"; private const string PG = "MT_PergaminoGravedad"; internal static readonly Dictionary Table = new Dictionary { { "Greydwarf", new Drop[1] { B("MT_PergaminoMagiaRara", 0.02f) } }, { "Greydwarf_Elite", new Drop[2] { B("MT_BastonAprendiz", 0.02f), B("MT_PergaminoMagiaRara", 0.05f) } }, { "Greydwarf_Shaman", new Drop[3] { B("MT_BastonAprendiz", 0.04f), B("MT_GrimorioRunico", 0.01f), B("MT_PergaminoMagiaRara", 0.12f) } }, { "Skeleton", new Drop[2] { B("MT_BastonAprendiz", 0.01f), B("MT_PergaminoMagiaRara", 0.05f) } }, { "Skeleton_Poison", new Drop[2] { B("MT_BastonAprendiz", 0.02f), B("MT_PergaminoMagiaRara", 0.08f) } }, { "Ghost", new Drop[2] { B("MT_BastonAdepto", 0.03f), B("MT_PergaminoMagiaRara", 0.08f) } }, { "Draugr", new Drop[2] { B("MT_BastonAdepto", 0.02f), B("MT_PergaminoMagiaRara", 0.05f) } }, { "Draugr_Elite", new Drop[2] { B("MT_BastonAdepto", 0.04f), B("MT_PergaminoMagiaRara", 0.08f) } }, { "Wraith", new Drop[4] { B("MT_BastonAdepto", 0.05f), B("MT_BastonAgua", 0.02f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.1f) } }, { "Fenring_Cultist", new Drop[3] { B("MT_BastonAdepto", 0.05f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.1f) } }, { "Goblin", new Drop[1] { B("MT_PergaminoMagiaRara", 0.03f) } }, { "GoblinShaman", new Drop[4] { B("MT_BastonMaestro", 0.05f), B("MT_BastonSilfide", 0.02f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.12f) } }, { "DvergerMage", new Drop[4] { B("MT_BastonMaestro", 0.05f), B("MT_BastonRudeus", 0.02f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.1f) } }, { "DvergerMageFire", new Drop[3] { B("MT_BastonMaestro", 0.05f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.1f) } }, { "DvergerMageIce", new Drop[3] { B("MT_BastonMaestro", 0.05f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.1f) } }, { "DvergerMageSupport", new Drop[3] { B("MT_BastonMaestro", 0.05f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.1f) } }, { "Charred_Melee", new Drop[1] { B("MT_PergaminoMagiaRara", 0.03f) } }, { "Charred_Mage", new Drop[3] { B("MT_BastonArchimago", 0.04f), B("MT_GrimorioRunico", 0.02f), B("MT_PergaminoMagiaRara", 0.12f) } }, { "Charred_Twitcher", new Drop[2] { B("MT_BastonTempestad", 0.02f), B("MT_PergaminoMagiaRara", 0.05f) } }, { "Eikthyr", new Drop[1] { B("MT_PergaminoMagiaRara", 1f) } }, { "gd_king", new Drop[1] { B("MT_PergaminoMagiaRara", 1f) } }, { "Bonemass", new Drop[1] { B("MT_PergaminoMagiaRara", 1f) } }, { "Dragon", new Drop[4] { B("MT_PergaminoMagiaRara", 1f), B("MT_PergaminoGravedad", 0.5f), B("MT_BastonAquaHeartia", 0.1f), B("MT_BastonAzurith", 0.1f) } }, { "GoblinKing", new Drop[3] { B("MT_PergaminoMagiaRara", 1f), B("MT_PergaminoGravedad", 0.5f), B("MT_BastonZefiria", 0.15f) } }, { "SeekerQueen", new Drop[4] { B("MT_GranGrimorio", 1f), B("MT_PergaminoMagiaRara", 1f), B("MT_PergaminoGravedad", 0.3f), B("MT_BastonNihilum", 0.15f) } }, { "Fader", new Drop[3] { B("MT_PergaminoMagiaRara", 1f), B("MT_BastonIgnivar", 0.1f), B("MT_BastonAurelia", 0.1f) } } }; internal static Drop B(string item, float chance) { return new Drop(item, chance); } private static void Postfix(CharacterDrop __instance, List> __result) { if (__result == null || (Object)(object)ObjectDB.instance == (Object)null) { return; } string key = ((Object)((Component)__instance).gameObject).name.Replace("(Clone)", "").Trim(); if (!Table.TryGetValue(key, out var value)) { return; } Drop[] array = value; foreach (Drop drop in array) { float num = ((drop.Item == "MT_PergaminoMagiaRara") ? (drop.Chance * MTMagiaPlugin.PergaminoProbMult.Value) : drop.Chance); if (!(Random.value > num)) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(drop.Item); if ((Object)(object)itemPrefab != (Object)null) { __result.Add(new KeyValuePair(itemPrefab, 1)); } } } } } public class CaminoMago : MonoBehaviour { private const string AbiertoKey = "MT.Magia.CaminoMago.Abierto"; private float _tick; private float _ritual; private bool _avisado; private static float _buscaHasta; private static bool _cerca; public static int PiedrasLeidas(Player p) { return p.m_customData.Keys.Count((string k) => k.StartsWith("MT.Magia.Runa.")); } public static bool Cumple(Player p) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (((Character)p).GetSkillLevel(MTSkills.Reserva) >= MTMagiaPlugin.LaplaceCaminoReserva.Value && Pergaminos.Known(p).Count >= MTMagiaPlugin.LaplaceCaminoHechizos.Value) { return PiedrasLeidas(p) >= MTMagiaPlugin.LaplaceCaminoRunas.Value; } return false; } public static bool Abierto(Player p) { if ((Object)(object)p != (Object)null && p.m_customData.ContainsKey("MT.Magia.CaminoMago.Abierto")) { return !Talento.IsLaplace(p); } return false; } private void Update() { //IL_0163: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || !MTMagiaPlugin.LaplaceCaminoActivo.Value || Talento.IsLaplace(localPlayer)) { _ritual = 0f; return; } _tick += Time.deltaTime; if (_tick >= 2f) { _tick = 0f; if (!localPlayer.m_customData.ContainsKey("MT.Magia.CaminoMago.Abierto") && Cumple(localPlayer)) { localPlayer.m_customData["MT.Magia.CaminoMago.Abierto"] = "1"; ((Character)localPlayer).Message((MessageType)2, Tr.Get("magia_mage_path_open"), 0, (Sprite)null, false); Cronica.AnotarUnaVez(localPlayer, "camino_mago", "cronica_mage_path_open", Array.Empty()); } } if (!Abierto(localPlayer)) { return; } if (!Meditacion.Active || !((Object)(object)EnvMan.instance != (Object)null) || !EnvMan.IsNight() || !CercaDePiedra(localPlayer)) { _ritual = 0f; _avisado = false; return; } _ritual += Time.deltaTime; if (!_avisado && _ritual >= 45f) { _avisado = true; ((Character)localPlayer).Message((MessageType)2, Tr.Get("magia_mage_path_warning"), 0, (Sprite)null, false); } if (!(_ritual < 60f)) { _ritual = 0f; Talento.DespertarLaplace(localPlayer); localPlayer.m_skillLevelupEffects.Create(((Character)localPlayer).GetHeadPoint(), ((Component)localPlayer).transform.rotation, ((Component)localPlayer).transform, 1f, -1, default(ZDOID)); Cronica.AnotarUnaVez(localPlayer, "laplace", "cronica_mage_path_done", Array.Empty()); } } private static bool CercaDePiedra(Player p) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _buscaHasta) { return _cerca; } _buscaHasta = Time.time + 1f; _cerca = false; Collider[] array = Physics.OverlapSphere(((Component)p).transform.position, 6f); foreach (Collider val in array) { if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).GetComponentInParent() != (Object)null) { _cerca = true; break; } } return _cerca; } } [HarmonyPatch(typeof(SEMan), "ApplyStatusEffectSpeedMods")] public static class CanalizarVelocidadPatch { private static void Postfix(SEMan __instance, ref float speed) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && Caster.Canalizando != null && !((Object)(object)Campos.SEManPersonaje.Invoke(__instance) != (Object)(object)localPlayer)) { speed *= Mathf.Clamp01(MTMagiaPlugin.CargaVelocidadMovimiento.Value); } } } [HarmonyPatch(typeof(Player), "CheckRun")] public static class CanalizarSinCorrerPatch { private static bool Prefix(Player __instance, ref bool __result) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || Caster.Canalizando == null) { return true; } __result = false; return false; } } public class Caster : MonoBehaviour { private const string SelKey = "mt_hechizo_elegido"; private static Player _selPlayer; public const string CastButton = "MT_Lanzar"; public const string NextButton = "MT_SiguienteHechizo"; public static Caster Instance; private int _selected; private readonly Dictionary _readyAt = new Dictionary(); private Spell _reciting; private float _reciteStart; private float _reciteDuration; private bool _interrupted; private float _rankTimer; private static Spell _pending; private static float _pendingSince; public static bool AllowNextAttack; public static bool ReadingWheel; public static float FirmeListo; private static List _aprendidos = new List(); private static List _conocidos = new List(); private static readonly HashSet _favs = new HashSet(); private static Player _cacheP; private static string _cAprendidos; private static string _cOcultos; private static string _cFavoritos; private static string _cEquipado; private static bool _cVerOcultos; private static float _cHasta; public static bool ShowHidden; public static string Equipado; public static bool BloqueoAtaque; public static float BloqueoAtaqueHasta; private static readonly FieldInfo JotunnInputBlocked = AccessTools.Field(typeof(GUIManager), "InputBlocked"); public static readonly float[] CostoMinimo = new float[7] { 10f, 15f, 25f, 40f, 60f, 80f, 110f }; private Spell _sustaining; private float _sustainNext; private float _sustainStart; private bool _stopRequested; private static string _sustainAnim; private bool _loopAnim; private float _stuckSince = -1f; private bool _loopBool; private static readonly HashSet _loopLogged = new HashSet(); private string _loopName; private float _loopAt; private int _loopLayer = -1; private int _loopHash; private int[] _loopBase; private bool _loopVisto; private const float LoopRespaldo = 0.9f; private static string _raiseAnim; public static bool SustainStarted; private Spell _charging; private float _chargeStart; private float _chargePaid; private float _chargeMult = 1f; private float _maxSince = -1f; private StoneBulletVisual _stoneChargeVisual; private float _stoneChargeRoll; private static readonly HashSet ConoPiedra = new HashSet { "bala_piedra" }; private static readonly HashSet OrbeFuego = new HashSet { "bola_fuego", "lluvia_brasas" }; private static readonly HashSet OrbeHielo = new HashSet { "bala_agua", "cascada", "lanza_hielo" }; private ChargeOrb _chargeOrb; private string _chargeOrbFor; private readonly ChargeOrb[] _orbesLado = new ChargeOrb[2]; private const float HoldToChannel = 0.25f; private static float _lastSoundTime; private static readonly Dictionary _schoolEffects = new Dictionary(); private bool _reciteFromAttack; private static readonly Color HudLeatherInk = new Color(0.93f, 0.88f, 0.76f); private static readonly Color HudLeatherMuted = new Color(0.77f, 0.71f, 0.6f); private static readonly Color HudLeatherAccent = new Color(0.91f, 0.67f, 0.34f); private static readonly Color HudLeatherError = new Color(1f, 0.52f, 0.4f); private static readonly Color HudLeatherBlue = new Color(0.55f, 0.77f, 0.95f); private static readonly Color HudLeatherRule = new Color(0.59f, 0.43f, 0.25f, 0.65f); private GUIStyle _hudText; private static int _hudLastIdx = -1; private static int _hudLastKnownCount = -1; private static string _hudCachedIdxCount; private static string _hudLastSchoolSpellId; private static string _hudCachedSchoolRank; private static string _hudIdioma; private static string _hudLastCostSpellId; private static int _hudLastCostMana = -1; private static int _hudLastCostHp = -1; private static string _hudCachedCost; private static string _hudLastRemainingSpellId; private static int _hudLastRemainingDecimas = -1; private static string _hudCachedCooldown; private const float MW = 1040f; private const float MH = 648f; private const float BookMargin = 60f; private const float BookWidth = 1160f; private const float BookHeight = 768f; private Spell _menuSpell; private int _menuTab = -1; private int _menuRol = -1; private float _menuScroll; private float _lastClickTime; private string _lastClickId; private string _menuTip; private string _menuSearch = ""; private GUIStyle _searchStyle; private string _dragId; private int _dragFrom = -1; private Vector2 _dragStart; private bool _dragging; private static readonly Color BookInk = DiarioEscritor.Tinta; private static readonly Color BookMuted = DiarioEscritor.TintaSuave; private static readonly Color BookError = DiarioEscritor.TintaRoja; private static readonly Color BookBlue = DiarioEscritor.TintaAzul; private static readonly Color BookAccent = new Color(0.3f, 0.16f, 0.32f); private static readonly Color BookRule = new Color(0.4f, 0.28f, 0.17f, 0.55f); private static readonly Color Card = new Color(0.38f, 0.25f, 0.12f, 0.055f); private static readonly Color CardHover = new Color(0.33f, 0.16f, 0.3f, 0.12f); private static readonly Color HiddenCard = new Color(0.29f, 0.25f, 0.2f, 0.045f); private static readonly Color HiddenHover = new Color(0.29f, 0.25f, 0.2f, 0.1f); private static readonly Color Deep = new Color(0.98f, 0.91f, 0.75f, 0.16f); private static readonly List Orden = new List(64); private static readonly HashSet Puestos = new HashSet(); public static bool IsReciting { get { if ((Object)(object)Instance != (Object)null) { return Instance._reciting != null; } return false; } } public static Spell Recitando { get { if (!((Object)(object)Instance != (Object)null)) { return null; } return Instance._reciting; } } public static Spell Canalizando { get { if (!((Object)(object)Instance == (Object)null)) { if (Instance._charging == null || !(Time.time - Instance._chargeStart >= 0.25f)) { return Instance._sustaining; } return Instance._charging; } return null; } } public static Spell Pending { get { return _pending; } set { _pending = value; _pendingSince = Time.time; } } public static bool IsActiveCasting { get { if ((Object)(object)Instance != (Object)null) { if (Instance._reciting == null && Instance._charging == null && Instance._sustaining == null) { return Pending != null; } return true; } return false; } } private static string Fav => Tr.Get("magia_favorite"); public static bool MenuOpen { get; private set; } private static string Mana => Tr.Get("magia_mana"); private static float MaxSostener(Player p, Spell s) { return s.SustainMax + ((s.Id == "relampago" && Escuelas.Rank(p, s.School) >= 6) ? 0.5f : 0f); } public static void RegisterInput() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown InputManager.Instance.AddButton("mushokutensei.magia", new ButtonConfig { Name = "MT_SiguienteHechizo", Key = (KeyCode)287, ActiveInCustomGUI = false }); } private void Awake() { Instance = this; } public static void Interrupt() { if (!((Object)(object)Instance == (Object)null) && Instance._reciting != null) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && Time.time >= FirmeListo && MejorRango(localPlayer) >= 4) { FirmeListo = Time.time + 10f; ((Character)localPlayer).Message((MessageType)1, Tr.Get("magia_firm_recital"), 0, (Sprite)null, false); } else { Instance._interrupted = true; } } } private static int MejorRango(Player p) { int num = 0; foreach (Escuela value in Enum.GetValues(typeof(Escuela))) { num = Mathf.Max(num, Escuelas.Rank(p, value)); } return num; } public static List Learned(Player p) { Refrescar(p); return _aprendidos; } public static List Known(Player p) { Refrescar(p); return _conocidos; } private static string Dato(Player p, string key) { if (!p.m_customData.TryGetValue(key, out var value)) { return null; } return value; } private static void Refrescar(Player p) { if ((Object)(object)p == (Object)null) { _aprendidos.Clear(); _conocidos.Clear(); _cacheP = null; return; } string text = Dato(p, "MT.Magia.Aprendidos"); string text2 = Dato(p, "MT.Magia.Ocultos"); string text3 = Dato(p, "MT.Magia.Favoritos"); if ((Object)(object)p == (Object)(object)_cacheP && Time.time < _cHasta && (object)text == _cAprendidos && (object)text2 == _cOcultos && (object)text3 == _cFavoritos && ShowHidden == _cVerOcultos && Equipado == _cEquipado) { return; } _cacheP = p; _cAprendidos = text; _cOcultos = text2; _cFavoritos = text3; _cVerOcultos = ShowHidden; _cEquipado = Equipado; _cHasta = Time.time + 0.5f; HashSet hashSet = Pergaminos.Known(p); List list = new List(); foreach (Spell item in SpellBook.All) { if (hashSet.Contains(item.Id) && Pergaminos.CanCast(p, item)) { list.Add(item); } } _favs.Clear(); string[] array = Favoritos.Get(p); foreach (string text4 in array) { if (!string.IsNullOrEmpty(text4)) { _favs.Add(text4); } } List list2 = new List(); foreach (Spell item2 in list) { if (ShowHidden || !Grimorio.IsHidden(p, item2.Id) || _favs.Contains(item2.Id) || item2.Id == Equipado) { list2.Add(item2); } } _aprendidos = list; _conocidos = list2; } internal static void Reiniciar(Player p) { BloqueoAtaque = false; BloqueoAtaqueHasta = 0f; AllowNextAttack = false; Caster instance = Instance; if ((Object)(object)instance == (Object)null) { return; } if (instance._reciting != null) { instance._reciting = null; instance._reciteFromAttack = false; ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Recitando"), false); } if (instance._charging != null) { if (instance._chargePaid > 0f) { ((Character)p).AddEitr(instance._chargePaid); instance._chargePaid = 0f; } instance.CancelStoneCharge(); } if (instance._sustaining != null) { instance._readyAt[instance._sustaining.Id] = Time.time + instance._sustaining.Cooldown; instance._sustaining = null; LevitarAnim.EndPose(); } if (Pending != null) { Pending = null; instance.ClearStoneChargeVisual(); } instance.StopLoopAnim(p); } public static bool AnticlickPressed() { if (!ZInput.GetMouseButtonDown(1) && !ZInput.GetButtonDown("SecondaryAttack") && !ZInput.GetKeyDown((KeyCode)324, false)) { if (IsActiveCasting) { if (!ZInput.GetMouseButton(1)) { return ZInput.GetButton("SecondaryAttack"); } return true; } return false; } return true; } public static bool CancelCurrentCast(Player p) { if ((Object)(object)Instance == (Object)null || (Object)(object)p == (Object)null || !IsActiveCasting) { return false; } string text = null; bool flag = false; if (Instance._reciting != null) { text = Instance._reciting.Name; Instance._reciting = null; Instance._reciteFromAttack = false; ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Recitando"), false); Instance.StopLoopAnim(p); flag = true; } if (Instance._charging != null) { if (text == null) { text = Instance._charging.Name; } if (Instance._chargePaid > 0f) { ((Character)p).AddEitr(Instance._chargePaid); Instance._chargePaid = 0f; } Instance.CancelStoneCharge(); Instance._reciteFromAttack = false; flag = true; } if (Instance._sustaining != null) { if (text == null) { text = Instance._sustaining.Name; } Instance._readyAt[Instance._sustaining.Id] = Time.time + Instance._sustaining.Cooldown; Instance._sustaining = null; Instance.StopLoopAnim(p); LevitarAnim.EndPose(); flag = true; } if (Pending != null) { if (text == null) { text = Pending.Name; } Pending = null; Instance.ClearStoneChargeVisual(); flag = true; } if (flag) { Instance.StopLoopAnim(p); EndSustainAnim(p); BloqueoAtaque = true; BloqueoAtaqueHasta = Time.time + 0.35f; BloqueoClic.Bloquear(0.35f); string text2 = ((text != null) ? (text + " - " + Tr.Get("magia_cancelled")) : Tr.Get("magia_cancelled")); ((Character)p).Message((MessageType)1, text2, 0, (Sprite)null, false); return true; } return false; } internal static bool CanTakeInput() { if (((Object)(object)Chat.instance == (Object)null || !Chat.instance.HasFocus()) && !Console.IsVisible() && !Menu.IsVisible() && !InventoryGui.IsVisible() && !TextInput.IsVisible() && !Minimap.IsOpen()) { object obj = JotunnInputBlocked?.GetValue(null); bool flag = default(bool); int num; if (obj is bool) { flag = (bool)obj; num = 1; } else { num = 0; } return ((uint)num & (flag ? 1u : 0u)) == 0; } return false; } internal static bool CanUseFavorites() { if (MTMagiaPlugin.FavoriteShortcuts.Value && (Object)(object)Player.m_localPlayer != (Object)null && !((Character)Player.m_localPlayer).IsDead() && Focus.HasFocus(Player.m_localPlayer) && CanTakeInput() && (Object)(object)Instance != (Object)null && Instance._reciting == null) { return Instance._charging == null; } return false; } private void Update() { //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) Weather.Tick(); if (BloqueoAtaque && Time.time >= BloqueoAtaqueHasta && ((!ZInput.GetButton("Attack") && !ZInput.GetButton("SecondaryAttack") && !ZInput.GetMouseButton(0) && !ZInput.GetMouseButton(1)) || Time.time - BloqueoAtaqueHasta > 2f)) { BloqueoAtaque = false; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead()) { _reciting = null; CancelStoneCharge(); if (MenuOpen) { ToggleMenu(open: false); } return; } if ((_charging != null || Pending != null) && (ChargePreview(_charging) || ChargePreview(Pending)) && (!Focus.HasFocus(localPlayer) || !CanTakeInput() || ((Character)localPlayer).IsStaggering())) { CancelStoneCharge(); } UpdateStoneChargeVisual(localPlayer); Watchdog(localPlayer); if (UpdateMenu(localPlayer)) { return; } Afinidad.Roll(localPlayer); UpdateRanks(localPlayer); Levitacion.Tick(localPlayer); if (CanTakeInput()) { if (MTKeys.Down(MTKeys.Aterrizar) && Levitacion.Active) { Levitacion.Stop(localPlayer, Tr.Get("magia_land")); } else if (MTKeys.Down(MTKeys.Levitar)) { if (Levitacion.Active) { Levitacion.Stop(localPlayer, Tr.Get("magia_land")); } else { TryLevitate(localPlayer); } } } if (_pending != null && Time.time - _pendingSince > 2.5f) { _pending = null; } if (CanTakeInput() && AnticlickPressed() && IsActiveCasting) { CancelCurrentCast(localPlayer); } else if (_reciting != null) { UpdateRecite(localPlayer); } else if (_charging != null) { UpdateCharge(localPlayer); } else if (_sustaining != null) { UpdateSustain(localPlayer); } else { if (!CanTakeInput()) { return; } List list = Known(localPlayer); if (list.Count == 0) { if (MTKeys.Down(MTKeys.OcultarHechizo) && Learned(localPlayer).Count > 0) { ShowHidden = true; ((Character)localPlayer).Message((MessageType)1, Tr.Get("magia_grimoire_showing_hidden_spells_re", new object[1] { MTKeys.OcultarHechizo.Value }), 0, (Sprite)null, false); } return; } _selected = Mathf.Clamp(_selected, 0, list.Count - 1); string value; if ((Object)(object)_selPlayer != (Object)(object)localPlayer) { _selPlayer = localPlayer; if (localPlayer.m_customData.TryGetValue("mt_hechizo_elegido", out var guardado)) { int num = list.FindIndex((Spell x) => x.Id == guardado); if (num >= 0) { _selected = num; } } } else if (!localPlayer.m_customData.TryGetValue("mt_hechizo_elegido", out value) || value != list[_selected].Id) { localPlayer.m_customData["mt_hechizo_elegido"] = list[_selected].Id; } bool flag = ZInput.GetKey((KeyCode)308, false) || ZInput.GetKey((KeyCode)307, false); int num2 = (CanUseFavorites() ? Favoritos.Pressed() : (-1)); if (num2 >= 0) { string id = Favoritos.Get(localPlayer)[num2]; int num3 = list.FindIndex((Spell x) => x.Id == id); if (num3 >= 0) { _selected = num3; } ((Character)localPlayer).Message((MessageType)1, (num3 >= 0) ? (Fav + $" {num2 + 1}: {list[num3].Name}") : (string.IsNullOrEmpty(id) ? Tr.Get("magia_favorite_empty_alt_shift_save", new object[1] { num2 + 1 }) : (Favoritos.NameOf(id) + ": " + Tr.Get("magia_don_t_have_rank_cast"))), 0, (Sprite)null, false); return; } if (MTKeys.Down(MTKeys.OcultarHechizo)) { if (flag) { ShowHidden = !ShowHidden; ((Character)localPlayer).Message((MessageType)1, ShowHidden ? Tr.Get("magia_grimoire_also_showing_hidden_spells", new object[1] { MTKeys.OcultarHechizo.Value }) : Tr.Get("magia_grimoire_active_spells_only"), 0, (Sprite)null, false); return; } Spell spell = list[_selected]; bool flag2 = Grimorio.Toggle(localPlayer, spell.Id); ((Character)localPlayer).Message((MessageType)1, flag2 ? (spell.Name + " " + Tr.Get("magia_hidden_from_grimoire")) : (spell.Name + " " + Tr.Get("magia_enabled")), 0, (Sprite)null, false); if (!ShowHidden && flag2) { _selected = Mathf.Max(0, _selected - 1); } return; } if (MTKeys.Down(MTKeys.SiguienteHechizo)) { _selected = (_selected + ((!flag) ? 1 : (list.Count - 1))) % list.Count; } ReadingWheel = true; float mouseScrollWheel = ZInput.GetMouseScrollWheel(); ReadingWheel = false; if (flag && Focus.HasFocus(localPlayer) && Mathf.Abs(mouseScrollWheel) > 0.01f) { _selected = (_selected + ((mouseScrollWheel < 0f) ? 1 : (list.Count - 1))) % list.Count; } if ((int)MTKeys.Lanzar.Value != 0 && MTKeys.Down(MTKeys.Lanzar)) { TryCast(localPlayer, list[_selected]); } } } private void UpdateRanks(Player p) { _rankTimer += Time.deltaTime; if (_rankTimer < 2f) { return; } _rankTimer = 0f; Escuela[] all = Escuelas.All; foreach (Escuela escuela in all) { if (!Escuelas.UpdateRank(p, escuela)) { AvisoBloqueo(p, escuela); continue; } string text = Tr.Get("magia_are_now", new object[2] { Escuelas.RankNames[Escuelas.StoredRank(p, escuela)], Escuelas.Name(escuela) }); string text2 = Escuelas.JefesPorRango()[Escuelas.StoredRank(p, escuela)]; if (!string.IsNullOrEmpty(text2)) { text = text + "\n" + Tr.Get("magia_rank_boss_awoke", new object[1] { Tr.Localize(EventosCore.NombreJefe(JefeVencido(p, text2))) }); } ((Character)p).Message((MessageType)2, text, 0, (Sprite)null, false); Escuela escuela2 = escuela; int rango = Escuelas.StoredRank(p, escuela); DiarioMagia.RangoSubido(p, escuela2, rango); SpellRunner.After(3f, delegate { if ((Object)(object)p != (Object)null) { Aprendizaje.AlSubirRango(p, escuela2, rango); } }); } } private static string JefeVencido(Player p, string req) { string[] array = req.Split(new char[1] { '|' }); foreach (string text in array) { if (Escuelas.Defeated(p, text.Trim())) { return text.Trim(); } } return req.Split(new char[1] { '|' })[0].Trim(); } private static void AvisoBloqueo(Player p, Escuela e) { RangoRules.Falta falta; int num = Escuelas.RankFromLevel(p, e, out falta); if ((falta != RangoRules.Falta.Enemigos && falta != RangoRules.Falta.Jefe) || num < Escuelas.StoredRank(p, e)) { return; } int num2 = num + 1; if (num2 <= 6) { string key = "MT.Magia.AvisoBloqueo." + e.ToString() + "." + num2; if (!p.m_customData.ContainsKey(key)) { p.m_customData[key] = "1"; ((Character)p).Message((MessageType)2, Tr.Get((falta == RangoRules.Falta.Jefe) ? "magia_rank_blocked_boss" : "magia_rank_blocked_enemies", new object[1] { Escuelas.Name(e) }), 0, (Sprite)null, false); } } } public static float CostFactor(Player p, Escuela e) { return Mathf.Max((1f - Escuelas.CostCut(p, e)) * Manto.CostMultiplier(p) * (1f - Focus.CostCut(p, e)), 0.4f) * Afinidad.CostMult(p, e); } public static float ManaCost(Player p, Spell s) { float num = (1f - Escuelas.CostCut(p, s.School)) * Manto.CostMultiplier(p) * (1f - Focus.CostCut(p, s.School)); return ((s.Mana > 0f) ? Mathf.Max(s.Mana, CostoMinimo[Mathf.Clamp(s.Rank, 0, CostoMinimo.Length - 1)]) : 0f) * Mathf.Max(num, 0.4f) * Afinidad.CostMult(p, s.School); } public static float Power(Player p, Spell s) { float num = Escuelas.Power(p, s.School) * (1f + Focus.PowerBonus(p, s.School)); if (((Character)p).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_PactoSangre"))) { num *= 1.3f; } return num; } public static float ReciteTime(Player p, Spell s) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (s.Type != SpellType.Canalizado) { return 0f; } float num = ((s.Rank >= 6) ? 4f : ((s.Rank >= 5) ? 3f : ((s.Rank >= 4) ? 2f : ((s.Rank >= 3) ? 1.5f : 1f)))); float num2 = Mathf.Min(0.6f, ((Character)p).GetSkillLevel(MTSkills.Control) / 150f); float num3 = Mathf.Min(0.75f, num2 + Focus.ReciteCut(p)); float num4 = num * (1f - num3); if (s.Rank < 6) { return num4; } return Mathf.Max(num4, 1f); } private void TryLevitate(Player p) { Spell spell = SpellBook.All.FirstOrDefault((Spell x) => x.Id == "levitar"); if (spell != null) { string why; if (!Pergaminos.Knows(p, spell.Id)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_don_t_know_levitate_gravity"), 0, (Sprite)null, false); } else if (!Pergaminos.CanCast(p, spell)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_levitate_needs_gravity", new object[1] { Escuelas.RankNames[spell.Rank] }), 0, (Sprite)null, false); } else if (!Focus.HasFocus(p)) { ((Character)p).Message((MessageType)2, Tr.Get("magia_need_wand_or_staff_hand"), 0, (Sprite)null, false); } else if (Agotamiento.IsExhausted(p)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_are_exhausted_can_t_cast"), 0, (Sprite)null, false); } else if (!CanPay(p, spell, out why)) { ((Character)p).Message((MessageType)1, why, 0, (Sprite)null, false); } else { Execute(p, spell); } } } public bool BeginAttackCast(Player p) { p.FaceLookDirection(); if (_reciting != null || Pending != null || _charging != null || _sustaining != null) { return false; } List list = Known(p); if (list.Count == 0) { ((Character)p).Message((MessageType)1, Tr.Get("magia_don_t_know_any_spells"), 0, (Sprite)null, false); return false; } Spell spell = list[Mathf.Clamp(_selected, 0, list.Count - 1)]; if (spell.Id == "levitar" && Levitacion.Active) { Levitacion.Stop(p, Tr.Get("magia_land")); return false; } if (_readyAt.TryGetValue(spell.Id, out var value) && Time.time < value) { return false; } if (Agotamiento.IsExhausted(p)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_are_exhausted_can_t_cast"), 0, (Sprite)null, false); return false; } if (!CanPay(p, spell, out var why)) { ((Character)p).Message((MessageType)1, why, 0, (Sprite)null, false); return false; } float num = ReciteTime(p, spell); if (num > 0f) { _reciting = spell; _reciteStart = Time.time; _reciteDuration = num; _interrupted = false; _reciteFromAttack = true; StatusEffect val = ((Character)p).GetSEMan().AddStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Recitando"), true, 0, 0f, (short)(-1)); if ((Object)(object)val != (Object)null) { val.m_ttl = num; } StartLoopAnim(p); return false; } if (spell.Sustained) { _sustaining = spell; _sustainNext = Time.time; _sustainStart = Time.time; SustainStarted = true; UsoMagia.Lanzado(p, spell); return false; } if (!spell.Chargeable) { Pending = spell; return true; } _charging = spell; _chargeStart = Time.time; _maxSince = -1f; _chargePaid = 0f; _chargeMult = 1f; return false; } public static float SustainTickCost(Player p, Spell s, float held) { return ManaCost(p, s) * s.SustainCost * ((s.SustainMax > 0f) ? Mathf.Lerp(1f, s.SustainRamp, Mathf.Clamp01(held / MaxSostener(p, s))) : 1f); } private void StartLoopAnim(Player p, string anim = null) { if (_loopAnim || (Object)(object)p == (Object)null) { return; } _loopAnim = true; _loopName = anim ?? SustainAnim(); _loopAt = Time.time; _loopVisto = false; LoopBaseline(p); ZSyncAnimation val = Campos.Anim.Invoke((Character)(object)p); if (!((Object)(object)val == (Object)null)) { _loopBool = val.HasParameter(_loopName, (AnimatorControllerParameterType)4); if (_loopBool) { val.SetBool(_loopName, true); } else { val.SetTrigger(_loopName); } if (_loopLogged.Add(_loopName)) { MTMagiaPlugin.Log.LogInfo((object)("Animación de canalizar '" + _loopName + "': " + (_loopBool ? "bucle (bool)" : "trigger, se relanza"))); } } } private static Animator AnimatorOf(Player p) { return Campos.Animador.Invoke((Character)(object)p); } private void LoopBaseline(Player p) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) Animator val = AnimatorOf(p); _loopLayer = -1; _loopHash = 0; _loopBase = null; if (!((Object)(object)val == (Object)null)) { _loopBase = new int[val.layerCount]; for (int i = 0; i < val.layerCount; i++) { int[] loopBase = _loopBase; int num = i; AnimatorStateInfo currentAnimatorStateInfo = val.GetCurrentAnimatorStateInfo(i); loopBase[num] = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash; } } } private void RelanzarLoop(Player p) { LoopBaseline(p); _loopAt = Time.time; ZSyncAnimation obj = Campos.Anim.Invoke((Character)(object)p); if (obj != null) { obj.SetTrigger(_loopName); } } private void KeepLoopAnim(Player p) { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!_loopAnim || (Object)(object)p == (Object)null || _loopBool) { return; } Animator val = AnimatorOf(p); if ((Object)(object)val == (Object)null) { return; } float num = Time.time - _loopAt; if (_loopLayer < 0) { if (_loopBase != null && num > 0.15f) { for (int i = 0; i < val.layerCount && i < _loopBase.Length; i++) { if (!val.IsInTransition(i)) { AnimatorStateInfo currentAnimatorStateInfo = val.GetCurrentAnimatorStateInfo(i); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash != _loopBase[i]) { _loopLayer = i; _loopHash = ((AnimatorStateInfo)(ref currentAnimatorStateInfo)).fullPathHash; break; } } } } if (_loopLayer < 0 && num > 0.9f) { RelanzarLoop(p); } } else if (!val.IsInTransition(_loopLayer)) { AnimatorStateInfo currentAnimatorStateInfo2 = val.GetCurrentAnimatorStateInfo(_loopLayer); if (((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).fullPathHash != _loopHash && ((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).fullPathHash != _loopBase[_loopLayer]) { _loopHash = ((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).fullPathHash; } bool num2 = ((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).fullPathHash == _loopBase[_loopLayer]; if (((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).loop) { _loopVisto = true; } bool flag = !_loopVisto && !((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).loop && ((AnimatorStateInfo)(ref currentAnimatorStateInfo2)).normalizedTime >= 0.97f; if ((num2 || flag) && num > 0.3f) { RelanzarLoop(p); } } } private static string RaiseAnim() { if (_raiseAnim != null) { return _raiseAnim; } string[] array = new string[3] { "StaffSkeleton", "StaffRedTroll", "StaffGreenRoots" }; foreach (string text in array) { ObjectDB instance = ObjectDB.instance; object obj; if (instance == null) { obj = null; } else { GameObject itemPrefab = instance.GetItemPrefab(text); obj = ((itemPrefab == null) ? null : itemPrefab.GetComponent()?.m_itemData?.m_shared?.m_attack?.m_attackAnimation); } string text2 = (string)obj; if (!string.IsNullOrEmpty(text2)) { _raiseAnim = text2; break; } } if (_raiseAnim == null) { _raiseAnim = SustainAnim(); } MTMagiaPlugin.Log.LogInfo((object)("Animación del Pilar de Tierra: " + _raiseAnim)); return _raiseAnim; } private void StopLoopAnim(Player p) { if (!_loopAnim) { return; } _loopAnim = false; if ((Object)(object)p != (Object)null && _loopBool) { ZSyncAnimation obj = Campos.Anim.Invoke((Character)(object)p); if (obj != null) { obj.SetBool(_loopName, false); } } _loopBool = false; if ((Object)(object)p != (Object)null) { EndSustainAnim(p); } } private void Watchdog(Player p) { int num; if (_charging == null && _sustaining == null && Pending == null) { num = ((_reciting != null) ? 1 : 0); if (num == 0 && _loopAnim) { StopLoopAnim(p); } } else { num = 1; } if (num != 0 || !((Character)p).InAttack() || !Focus.CastsGrimoire(p)) { _stuckSince = -1f; } else if (_stuckSince < 0f) { _stuckSince = Time.time; } else if (Time.time - _stuckSince > 2f) { _stuckSince = -1f; EndSustainAnim(p); MTMagiaPlugin.Log.LogWarning((object)"Magia: animación atascada sin hechizo en curso; se ha cortado"); } } private void OnApplicationFocus(bool focus) { if (!focus) { Player localPlayer = Player.m_localPlayer; if (_sustaining != null) { _readyAt[_sustaining.Id] = Time.time + _sustaining.Cooldown; _sustaining = null; LevitarAnim.EndPose(); } CancelStoneCharge(); StopLoopAnim(localPlayer); } } private static void EndSustainAnim(Player p) { Attack val = Campos.AtaqueActual.Invoke((Humanoid)(object)p); if (val != null) { try { val.Stop(); } catch { } Campos.AtaqueActual.Invoke((Humanoid)(object)p) = null; } ZSyncAnimation val2 = Campos.Anim.Invoke((Character)(object)p); if ((Object)(object)val2 == (Object)null) { return; } val2.SetTrigger("attack_abort"); val2.SetBool("attack_rapidfire", false); SpellRunner.After(0.5f, delegate { if ((Object)(object)p != (Object)null && ((Character)p).InAttack()) { MTMagiaPlugin.Log.LogWarning((object)"La animación de hechizo mantenido no se cortó (sigue en ataque)"); } }); } private static string SustainAnim() { if (_sustainAnim != null) { return _sustainAnim; } string[] array = new string[3] { "StaffIceShards", "StaffLightning", "StaffFireball" }; foreach (string text in array) { ObjectDB instance = ObjectDB.instance; object obj; if (instance == null) { obj = null; } else { GameObject itemPrefab = instance.GetItemPrefab(text); obj = ((itemPrefab == null) ? null : itemPrefab.GetComponent()?.m_itemData?.m_shared?.m_attack?.m_attackAnimation); } string text2 = (string)obj; if (!string.IsNullOrEmpty(text2)) { _sustainAnim = text2; break; } } if (_sustainAnim == null) { _sustainAnim = "staff_fireball"; } MTMagiaPlugin.Log.LogInfo((object)("Animación de hechizos mantenidos: " + _sustainAnim)); return _sustainAnim; } public static void StopSustain() { if ((Object)(object)Instance != (Object)null) { Instance._stopRequested = true; } } private void UpdateSustain(Player p) { //IL_0199: Unknown result type (might be due to invalid IL or missing references) if (AnticlickPressed()) { CancelCurrentCast(p); return; } p.FaceLookDirection(); Spell sustaining = _sustaining; float num = Time.time - _sustainStart; float num2 = SustainTickCost(p, sustaining, num); if (sustaining.SustainMax > 0f && num >= MaxSostener(p, sustaining)) { _stopRequested = true; } bool num3 = _stopRequested || !ZInput.GetButton("Attack") || ((Character)p).IsStaggering() || !Focus.HasFocus(p) || p.GetEitr() < num2; _stopRequested = false; if (num3) { if (p.GetEitr() < num2 && ZInput.GetButton("Attack")) { ((Character)p).Message((MessageType)1, Tr.Get("magia_no_mana_sustain_beam"), 0, (Sprite)null, false); } _sustaining = null; StopLoopAnim(p); LevitarAnim.EndPose(); _readyAt[sustaining.Id] = Time.time + sustaining.Cooldown; return; } if (sustaining.Id == "pilar_tierra") { StartLoopAnim(p, RaiseAnim()); } else { p.FaceLookDirection(); StartLoopAnim(p); } KeepLoopAnim(p); if (!(Time.time < _sustainNext)) { _sustainNext = Time.time + sustaining.SustainTick; ((Character)p).UseEitr(num2); try { sustaining.Cast(p, Power(p, sustaining) * sustaining.SustainPower); } catch (Exception arg) { MTMagiaPlugin.Log.LogError((object)$"Error en {sustaining.Id}: {arg}"); _sustaining = null; StopLoopAnim(p); LevitarAnim.EndPose(); } SustainStarted = false; ((Character)p).RaiseSkill(Escuelas.Skill(sustaining.School), 0.5f); } } private static bool ChargePreview(Spell s) { if (s != null) { if (!ConoPiedra.Contains(s.Id) && !OrbeFuego.Contains(s.Id)) { return OrbeHielo.Contains(s.Id); } return true; } return false; } private void UpdateStoneChargeVisual(Player p) { //IL_0020: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_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_037e: 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_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: 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_0126: 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_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_0162: 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_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_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_023a: 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_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_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) Spell spell = _charging ?? Pending; if (!ChargePreview(spell)) { ClearStoneChargeVisual(); return; } Vector3 val = StoneBullet.Origin(p); Vector3 val2 = Fx.AimPoint(p, 60f) - val; if (((Vector3)(ref val2)).sqrMagnitude < 0.001f) { val2 = ((Component)p).transform.forward; } float num = Mathf.InverseLerp(1f, MaxCharge(p, spell), _chargeMult); if (!ConoPiedra.Contains(spell.Id)) { if ((Object)(object)_chargeOrb == (Object)null || _chargeOrbFor != spell.Id) { ClearStoneChargeVisual(); bool flag = OrbeFuego.Contains(spell.Id); _chargeOrb = (flag ? ChargeOrb.Create(new Color(1f, 0.45f, 0.1f), new Color(0.25f, 0.45f, 1f), new Color(0.65f, 0.15f, 1f)) : ChargeOrb.Create(new Color(0.5f, 0.8f, 1f), new Color(0.7f, 0.9f, 1f), new Color(0.9f, 0.97f, 1f))); _chargeOrbFor = spell.Id; } ((Component)_chargeOrb).transform.SetPositionAndRotation(val, Quaternion.LookRotation(val2)); float num2 = Mathf.Pow(_chargeMult, 0.85f) * ((spell.Id == "lanza_hielo") ? 1.3f : 1f); ((Component)_chargeOrb).transform.localScale = Vector3.one * num2; _chargeOrb.Heat = num; if (spell.Id == "lluvia_brasas") { Vector3 val3 = Vector3.Cross(Vector3.up, ((Vector3)(ref val2)).normalized); Vector3 normalized = ((Vector3)(ref val3)).normalized; for (int i = 0; i < 2; i++) { if ((Object)(object)_orbesLado[i] == (Object)null) { _orbesLado[i] = ChargeOrb.Create(new Color(1f, 0.45f, 0.1f), new Color(0.25f, 0.45f, 1f), new Color(0.65f, 0.15f, 1f)); } float num3 = ((i == 0) ? (-1f) : 1f); Vector3 val4 = Quaternion.AngleAxis(num3 * 8f, Vector3.up) * val2; Vector3 val5 = val + normalized * num3 * 0.55f * num2 - ((Vector3)(ref val2)).normalized * 0.15f; ((Component)_orbesLado[i]).transform.SetPositionAndRotation(val5, Quaternion.LookRotation(val4)); ((Component)_orbesLado[i]).transform.localScale = Vector3.one * num2 * 0.85f; _orbesLado[i].Heat = num; } } else { ClearOrbesLado(); } } else { if ((Object)(object)_stoneChargeVisual == (Object)null) { _stoneChargeVisual = StoneBullet.AddVisual(); } if (!((Object)(object)_stoneChargeVisual == (Object)null)) { _stoneChargeRoll += Mathf.Lerp(100f, 1800f, num) * Time.deltaTime; ((Component)_stoneChargeVisual).transform.SetPositionAndRotation(val, Quaternion.LookRotation(val2) * Quaternion.Euler(0f, 0f, _stoneChargeRoll)); ((Component)_stoneChargeVisual).transform.localScale = Vector3.one * Mathf.Pow(_chargeMult, 0.85f) * MTMagiaPlugin.BalaPiedraTamano.Value; _stoneChargeVisual.Heat = num; } } } private void ClearStoneChargeVisual() { if ((Object)(object)_stoneChargeVisual != (Object)null) { Object.Destroy((Object)(object)((Component)_stoneChargeVisual).gameObject); } _stoneChargeVisual = null; if ((Object)(object)_chargeOrb != (Object)null) { Object.Destroy((Object)(object)((Component)_chargeOrb).gameObject); } _chargeOrb = null; _chargeOrbFor = null; ClearOrbesLado(); } private void ClearOrbesLado() { for (int i = 0; i < _orbesLado.Length; i++) { if ((Object)(object)_orbesLado[i] != (Object)null) { Object.Destroy((Object)(object)((Component)_orbesLado[i]).gameObject); } _orbesLado[i] = null; } } private void CancelStoneCharge() { StopLoopAnim(Player.m_localPlayer); _charging = null; Pending = null; _chargeMult = 1f; ClearStoneChargeVisual(); Vfx.HideRing(); } private void OnDisable() { CancelStoneCharge(); } public static float MaxCharge(Player p, Spell s) { if (!(s.Id == "encender")) { return 2f + 0.5f * (float)Escuelas.Rank(p, s.School); } return 2f; } public static float PowerOfCharge(float charge) { return Mathf.Pow(Mathf.Max(1f, charge), MTMagiaPlugin.CargaExponente.Value); } private void UpdateCharge(Player p) { //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) if (AnticlickPressed()) { CancelCurrentCast(p); return; } Spell charging = _charging; p.FaceLookDirection(); float num = Time.time - _chargeStart; if (num >= 0.25f) { StartLoopAnim(p); KeepLoopAnim(p); } float num2 = ((charging.Id == "encender") ? FogataCarga.Target(num) : Mathf.Min(MaxCharge(p, charging), 1f + Mathf.Max(0f, num - 0.25f) * MTMagiaPlugin.CargaVelocidad.Value)); float num3 = ManaCost(p, charging) * MTMagiaPlugin.CargaMana.Value; float num4 = (num2 - 1f) * num3 - _chargePaid; bool flag = false; if (num4 > 0f) { if (p.GetEitr() - ManaCost(p, charging) >= num4) { ((Character)p).UseEitr(num4); _chargePaid += num4; } else { flag = true; } } _chargeMult = 1f + _chargePaid / Mathf.Max(num3, 0.01f); bool flag2 = false; if (charging.Id != "encender" && _chargeMult >= MaxCharge(p, charging) - 0.01f) { if (_maxSince < 0f) { _maxSince = Time.time; } float num5 = ManaCost(p, charging) * MTMagiaPlugin.CargaMantenerCosto.Value * Time.deltaTime; if (p.GetEitr() >= num5) { ((Character)p).UseEitr(num5); } else { flag = true; } if (Time.time - _maxSince >= MTMagiaPlugin.CargaMantenerMax.Value) { flag2 = true; } } else { _maxSince = -1f; } if (flag2 || (flag && _maxSince >= 0f)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_charge_overflow"), 0, (Sprite)null, false); Cronica.AnotarUnaVez(p, "magia_desborde", "cronica_charge_overflow", Array.Empty()); } if (ZInput.GetButton("Attack") && !flag && !flag2 && !((Character)p).IsStaggering()) { float num6 = ((charging.Radius > 0f) ? (charging.Radius * Mathf.Sqrt(_chargeMult)) : ((charging.Rol == Rol.Ofensivo && _chargeMult > 1.2f) ? Mathf.Min(6f, (_chargeMult - 1f) * 2.5f) : 0f)); if (num6 > 0f) { Vfx.Ring(charging.RadiusOnSelf ? ((Component)p).transform.position : Fx.AimPoint(p), num6); } return; } Vfx.HideRing(); _charging = null; StopLoopAnim(p); if (((Character)p).IsStaggering()) { ((Character)p).Message((MessageType)1, charging.Name + " " + Tr.Get("magia_interrupted"), 0, (Sprite)null, false); _chargeMult = 1f; ClearStoneChargeVisual(); return; } if (charging.Id == "encender") { ((Character)p).Message((MessageType)1, FogataCarga.Complete(_chargeMult) ? Tr.Get("magia_campfire_ready") : Tr.Get("magia_incomplete_charge_will_only_light"), 0, (Sprite)null, false); } else if (_chargeMult > 1.05f) { ((Character)p).Message((MessageType)1, Tr.Get("magia_charged_power", new object[3] { charging.Name, _chargeMult, PowerOfCharge(_chargeMult) }), 0, (Sprite)null, false); } Pending = charging; AllowNextAttack = true; bool num7 = ((Character)p).StartAttack((Character)null, false); AllowNextAttack = false; if (!num7) { SonidoBaston(p); if (ChargePreview(charging)) { FirePending(p, ((Component)p).transform.position, ((Component)p).transform.forward); return; } Pending = null; Execute(p, charging); } } public static void SonidoBaston(Player p) { //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_0051: 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) EffectList val = ((p == null) ? null : ((Humanoid)p).GetCurrentWeapon()?.m_shared?.m_attack?.m_startEffect); if (val != null && val.HasEffects()) { val.Create(Fx.HandOrigin(p), Quaternion.identity, (Transform)null, 1f, -1, default(ZDOID)); } } public static void PlayLaunchSound(Player p, Spell s) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p == (Object)null || s == null || Time.time - _lastSoundTime < 0.12f) { return; } _lastSoundTime = Time.time; Vector3 val = Fx.HandOrigin(p); if (!_schoolEffects.TryGetValue(s.School, out var value) || value == null) { string text = s.School switch { Escuela.Fuego => "StaffFireball", Escuela.Agua => "StaffIceShards", Escuela.Viento => "StaffLightning", _ => null, }; if (text != null) { object obj = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab(text) : null); if (obj == null) { PrefabManager instance = PrefabManager.Instance; obj = ((instance != null) ? instance.GetPrefab(text) : null); } GameObject val2 = (GameObject)obj; value = (((Object)(object)val2 != (Object)null) ? val2.GetComponent() : null)?.m_itemData?.m_shared?.m_attack?.m_triggerEffect; if (value != null && value.HasEffects()) { _schoolEffects[s.School] = value; } } } if (value != null && value.HasEffects()) { value.Create(val, Quaternion.identity, (Transform)null, 1f, -1, default(ZDOID)); } else { Fx.Visual(s.School switch { Escuela.Fuego => "sfx_staff_fireball_launch", Escuela.Agua => "sfx_ice_shards_launch", Escuela.Viento => "sfx_staff_lightning_fire", _ => "sfx_spear_throw", }, val); } if (s.School == Escuela.Fuego) { FuegoVfx.Brasas(val, 0.4f, 25, 0.4f); FuegoVfx.Destello(val, 3.5f, 2f, 0.2f); } } public static void FirePending(Player p, Vector3 origin, Vector3 dir) { //IL_0084: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) p.FaceLookDirection(); Spell pending = Pending; Pending = null; if (pending == null || (Object)(object)Instance == (Object)null) { return; } PlayLaunchSound(p, pending); Instance.ClearStoneChargeVisual(); if (!CanPay(p, pending, out var why)) { ((Character)p).Message((MessageType)1, why, 0, (Sprite)null, false); return; } if (ChargePreview(pending)) { origin = StoneBullet.Origin(p); Vector3 val = Fx.AimPoint(p, 60f) - origin; if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { dir = ((Vector3)(ref val)).normalized; } } Fx.OriginOverride = origin; Fx.DirOverride = dir; try { Instance.Execute(p, pending); } finally { Fx.OriginOverride = null; Fx.DirOverride = null; } } private bool TryCast(Player p, Spell s) { p.FaceLookDirection(); if (!Focus.HasFocus(p)) { ((Character)p).Message((MessageType)2, Tr.Get("magia_need_wand_or_staff_hand"), 0, (Sprite)null, false); return false; } if (Agotamiento.IsExhausted(p)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_are_exhausted_can_t_cast"), 0, (Sprite)null, false); return false; } if (_readyAt.TryGetValue(s.Id, out var value) && Time.time < value) { ((Character)p).Message((MessageType)1, s.Name + ": " + Tr.Get("magia_wait") + $" {value - Time.time:0} s", 0, (Sprite)null, false); return false; } if (!CanPay(p, s, out var why)) { ((Character)p).Message((MessageType)1, why, 0, (Sprite)null, false); return false; } float num = ReciteTime(p, s); if (num <= 0f) { Execute(p, s); return true; } _reciting = s; _reciteStart = Time.time; _reciteDuration = num; _interrupted = false; StatusEffect val = ((Character)p).GetSEMan().AddStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Recitando"), true, 0, 0f, (short)(-1)); if ((Object)(object)val != (Object)null) { val.m_ttl = num; } StartLoopAnim(p); return true; } private void UpdateRecite(Player p) { //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) if (AnticlickPressed()) { CancelCurrentCast(p); return; } p.FaceLookDirection(); if (_interrupted || ((Character)p).IsStaggering()) { ((Character)p).Message((MessageType)1, _reciting.Name + " " + Tr.Get("magia_interrupted"), 0, (Sprite)null, false); _reciting = null; ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Recitando"), false); StopLoopAnim(p); } else { if (Time.time - _reciteStart < _reciteDuration) { return; } Spell reciting = _reciting; _reciting = null; ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Recitando"), false); StopLoopAnim(p); if (!CanPay(p, reciting, out var why)) { ((Character)p).Message((MessageType)1, why, 0, (Sprite)null, false); } else if (_reciteFromAttack && reciting.Chargeable && Focus.CastsGrimoire(p) && ZInput.GetButton("Attack")) { _reciteFromAttack = false; _charging = reciting; _chargeStart = Time.time; _maxSince = -1f; _chargePaid = 0f; } else if (_reciteFromAttack && Focus.CastsGrimoire(p)) { _reciteFromAttack = false; Pending = reciting; AllowNextAttack = true; bool num = ((Character)p).StartAttack((Character)null, false); AllowNextAttack = false; if (!num) { SonidoBaston(p); PlayLaunchSound(p, reciting); if (ChargePreview(reciting)) { FirePending(p, ((Component)p).transform.position, ((Component)p).transform.forward); return; } Pending = null; Execute(p, reciting); } } else { Execute(p, reciting); } } } private static float HealthCost(Player p, Spell s) { return s.Health + s.HealthFraction * ((Character)p).GetMaxHealth(); } private static bool CanPay(Player p, Spell s, out string why) { why = null; if (s.Id == "impulso_viento" && (((Character)p).IsAttached() || ((Character)p).IsSwimming() || ((Character)p).IsEncumbered() || ((Character)p).IsStaggering() || ((Character)p).InDodge() || ((Character)p).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Paralisis")))) { why = Tr.Get("magia_can_t_boost_while_swimming"); return false; } float num = ManaCost(p, s); float num2 = HealthCost(p, s); bool flag = ((Character)p).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_SenorSangre")); if (p.GetEitr() < num && (!flag || !(((Character)p).GetHealth() > num + num2 + 1f))) { why = Tr.Get("magia_not_enough_mana"); return false; } if (num2 > 0f && ((Character)p).GetHealth() <= num2 + 1f) { why = Tr.Get("magia_not_enough_health"); return false; } return true; } private void Execute(Player p, Spell s) { //IL_0202: 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_0065: 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_006f: Expected O, but got Unknown float num = ManaCost(p, s); float num2 = HealthCost(p, s); if (p.GetEitr() >= num) { ((Character)p).UseEitr(num); } else { num2 += num; } if (num2 > 0f) { HitData val = new HitData { m_hitType = (HitType)14 }; val.m_damage.m_damage = num2; ((Character)p).ApplyDamage(val, true, false, (DamageModifier)0); } float chargeMult = _chargeMult; _chargeMult = 1f; Fx.ScaleOverride = Mathf.Sqrt(chargeMult); Fx.ChargeMult = chargeMult; UsoMagia.Lanzado(p, s); try { PlayLaunchSound(p, s); p.FaceLookDirection(); s.Cast(p, Power(p, s) * PowerOfCharge(chargeMult)); if (s.Chargeable && s.Rol == Rol.Ofensivo && s.Id != "bola_fuego" && Escuelas.Rank(p, s.School) >= 5) { float echo = Power(p, s) * PowerOfCharge(chargeMult) * 0.6f; SpellRunner.After(0.3f, delegate { if ((Object)(object)p == (Object)null || ((Character)p).IsDead()) { return; } try { s.Cast(p, echo); } catch (Exception arg2) { MTMagiaPlugin.Log.LogError((object)$"Error en el eco de {s.Id}: {arg2}"); } }); } } catch (Exception arg) { MTMagiaPlugin.Log.LogError((object)$"Error en {s.Id}: {arg}"); } finally { Fx.ScaleOverride = 1f; Fx.ChargeMult = 1f; } _readyAt[s.Id] = Time.time + s.Cooldown; ((Character)p).RaiseSkill(Escuelas.Skill(s.School), Mathf.Max(s.Mana, 5f) / 10f); } internal static string SchoolIconName(Escuela e) { return e switch { Escuela.Sanacion => "sanacion", Escuela.Desintoxicacion => "desintoxicacion", Escuela.Invocacion => "invocacion", _ => e.ToString().ToLowerInvariant(), }; } private void OnGUI() { //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) if (MenuOpen) { DrawMenu(); } else { if ((int)Event.current.type != 7) { return; } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || (Object)(object)Hud.instance == (Object)null || !Hud.instance.IsVisible() || Hud.IsUserHidden() || !MTMagiaPlugin.ShowHud.Value || !CanTakeInput() || (!Focus.HasFocus(localPlayer) && _reciting == null && _charging == null)) { return; } Matrix4x4 matrix = GUI.matrix; Color color = GUI.color; try { bool value = MTMagiaPlugin.HudHelp.Value; bool value2 = MTMagiaPlugin.HudFavorites.Value; List list = Known(localPlayer); Spell spell = _sustaining ?? _charging ?? _reciting ?? Pending ?? ((list.Count > 0) ? list[Mathf.Clamp(_selected, 0, list.Count - 1)] : null); string text = ((spell == null) ? null : SpellBook.DamagePreview(localPlayer, spell, (_charging != null || Pending != null) ? _chargeMult : 1f, _sustaining != null || (spell.Sustained && Focus.CastsGrimoire(localPlayer)))); float num = ((list.Count == 0) ? 200f : (272f + ((text != null) ? 46f : 0f) + (value2 ? 108f : 0f) + ((!value) ? 0f : (Focus.CastsGrimoire(localPlayer) ? 93f : 72f)))); float num2 = Mathf.Min(MTGui.Scale * MTMagiaPlugin.HudScale.Value, Mathf.Min((float)Screen.width / 432f, (float)Screen.height / (num + 32f))); GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(num2, num2, 1f)); GUI.color = Color.white; float num3 = (float)Screen.width / num2; float num4 = (float)Screen.height / num2; Rect val = default(Rect); ((Rect)(ref val))..ctor(16f + (num3 - 432f) * MTMagiaPlugin.HudX.Value, 16f + (num4 - num - 32f) * MTMagiaPlugin.HudY.Value, 400f, num); Texture2D fondo = HudCueroArte.Fondo; Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref val)).x - 12f, ((Rect)(ref val)).y - 14f, ((Rect)(ref val)).width + 24f, ((Rect)(ref val)).height + 28f); if ((Object)(object)fondo != (Object)null) { GUI.DrawTexture(val2, (Texture)(object)fondo); } else { Fill(val2, new Color(7f / 51f, 5f / 51f, 0.0627451f, 0.98f)); } GUI.BeginGroup(val); try { DrawGrimoire(localPlayer, value, value2, text); } finally { GUI.EndGroup(); } } finally { GUI.matrix = matrix; GUI.color = color; } } } private void DrawGrimoire(Player p, bool help, bool favorites, string damage) { //IL_0027: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_019b: 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_008b: 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_00d4: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_04a4: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_083c: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: 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_08a1: Unknown result type (might be due to invalid IL or missing references) //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_073d: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a70: Unknown result type (might be due to invalid IL or missing references) //IL_099b: Unknown result type (might be due to invalid IL or missing references) //IL_0969: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_0af4: Unknown result type (might be due to invalid IL or missing references) //IL_0afd: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09b9: Unknown result type (might be due to invalid IL or missing references) //IL_0b64: Unknown result type (might be due to invalid IL or missing references) //IL_0b7b: Unknown result type (might be due to invalid IL or missing references) //IL_0b8d: Unknown result type (might be due to invalid IL or missing references) //IL_0b9f: Unknown result type (might be due to invalid IL or missing references) //IL_0bc4: Unknown result type (might be due to invalid IL or missing references) //IL_0b2e: Unknown result type (might be due to invalid IL or missing references) //IL_0b3f: Unknown result type (might be due to invalid IL or missing references) //IL_09e2: Unknown result type (might be due to invalid IL or missing references) //IL_0bf5: Unknown result type (might be due to invalid IL or missing references) //IL_0c15: Unknown result type (might be due to invalid IL or missing references) //IL_0a19: Unknown result type (might be due to invalid IL or missing references) //IL_0a12: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) List list = Known(p); if (list.Count == 0) { Text(new Rect(18f, 14f, 364f, 30f), Tr.Get("magia_grimoire"), 23, HudLeatherAccent, bold: true, wrap: false, (TextAnchor)3); bool flag = Learned(p).Count > 0; Text(new Rect(18f, 55f, 364f, 54f), flag ? Tr.Get("magia_all_spells_are_hidden") : Tr.Get("magia_don_t_have_any_spells"), 17, HudLeatherInk, bold: false, wrap: true, (TextAnchor)3); Text(new Rect(18f, 113f, 364f, 75f), flag ? Tr.Get("magia_alt_show_hidden_re_enable", new object[1] { MTKeys.OcultarHechizo.Value }) : Tr.Get("magia_read_scrolls_learn_magic_learned"), 15, HudLeatherMuted, bold: false, wrap: true, (TextAnchor)3); return; } int num = Mathf.Clamp(_selected, 0, list.Count - 1); Spell spell = _sustaining ?? _charging ?? _reciting ?? Pending ?? list[num]; Sprite val = MTMagiaPlugin.Icon("hechizo_" + spell.Id) ?? MTMagiaPlugin.Icon(SchoolIconName(spell.School)); MTGui.Icon(new Rect(16f, 14f, 64f, 64f), val, 1f); Text(new Rect(92f, 12f, 232f, 56f), spell.Name, 22, HudLeatherAccent, bold: true, wrap: true, (TextAnchor)3); if (num != _hudLastIdx || list.Count != _hudLastKnownCount || _hudCachedIdxCount == null) { _hudLastIdx = num; _hudLastKnownCount = list.Count; _hudCachedIdxCount = num + 1 + "/" + list.Count; } Text(new Rect(330f, 15f, 54f, 24f), _hudCachedIdxCount, 13, HudLeatherMuted, bold: false, wrap: false, (TextAnchor)3); if (spell.Id != _hudLastSchoolSpellId || _hudCachedSchoolRank == null || _hudIdioma != Tr.Current) { _hudIdioma = Tr.Current; _hudCachedCost = null; _hudCachedCooldown = null; _hudLastSchoolSpellId = spell.Id; _hudCachedSchoolRank = string.Concat(Escuelas.Name(spell.School) + (spell.School2.HasValue ? (" + " + Escuelas.Name(spell.School2.Value)) : ""), " · ", Escuelas.RankNames[spell.Rank]); } Text(new Rect(18f, 82f, 364f, 24f), _hudCachedSchoolRank, 15, Color.Lerp(SchoolColor(spell.School), HudLeatherInk, 0.25f), bold: false, wrap: false, (TextAnchor)3); float num2 = ManaCost(p, spell); float num3 = HealthCost(p, spell); int num4 = Mathf.RoundToInt(num2 * 10f); int num5 = Mathf.RoundToInt(num3 * 10f); if (spell.Id != _hudLastCostSpellId || num4 != _hudLastCostMana || num5 != _hudLastCostHp || _hudCachedCost == null) { _hudLastCostSpellId = spell.Id; _hudLastCostMana = num4; _hudLastCostHp = num5; _hudCachedCost = $"{num2:0.#} " + Tr.Get("magia_mana") + ((num3 > 0f) ? ($" · {num3:0.#} " + Tr.Get("magia_health")) : ""); } Text(new Rect(18f, 108f, 364f, 22f), _hudCachedCost, 16, HudLeatherInk, bold: false, wrap: false, (TextAnchor)3); float num6 = ((damage != null) ? 46f : 0f); if (damage != null) { Text(new Rect(18f, 134f, 364f, 24f), damage, 15, HudLeatherAccent, bold: true, wrap: false, (TextAnchor)3); Text(new Rect(18f, 158f, 364f, 18f), Tr.Get("magia_before_resistances_without_echo_or"), 11, HudLeatherMuted, bold: false, wrap: false, (TextAnchor)3); } Text(new Rect(18f, 138f + num6, 364f, 64f), spell.Description, 13, HudLeatherInk, bold: false, wrap: true, (TextAnchor)3); float value; float num7 = (_readyAt.TryGetValue(spell.Id, out value) ? Mathf.Max(0f, value - Time.time) : 0f); Color color = HudLeatherInk; float num8 = 0f; string value2; string why; if (_sustaining != null) { value2 = Tr.Get("magia_sustaining") + $" · {ManaCost(p, spell) * spell.SustainCost / spell.SustainTick:0.#} " + Tr.Get("magia_mana_s"); color = HudLeatherBlue; } else if (_charging != null) { value2 = ((spell.Id == "encender") ? FogataCarga.Status(_chargeMult) : Tr.Get("magia_charging_power_mana", new object[3] { _chargeMult, PowerOfCharge(_chargeMult), _chargePaid })); num8 = (_chargeMult - 1f) / Mathf.Max(MaxCharge(p, spell) - 1f, 0.01f); color = HudLeatherAccent; } else if (_reciting != null) { value2 = Tr.Get("magia_reciting") + $" · {Mathf.Max(0f, _reciteDuration - Time.time + _reciteStart):0.0} s"; num8 = (Time.time - _reciteStart) / Mathf.Max(_reciteDuration, 0.01f); color = HudLeatherBlue; } else if (Grimorio.IsHidden(p, spell.Id)) { value2 = Tr.Get("magia_hidden_visible_recovery_mode"); color = HudLeatherMuted; } else if (num7 > 0f) { int num9 = Mathf.CeilToInt(num7 * 10f); if (spell.Id != _hudLastRemainingSpellId || num9 != _hudLastRemainingDecimas || _hudCachedCooldown == null) { _hudLastRemainingSpellId = spell.Id; _hudLastRemainingDecimas = num9; _hudCachedCooldown = Tr.Get("magia_cooldown") + $" · {(float)num9 / 10f:0.0} s"; } value2 = _hudCachedCooldown; num8 = 1f - num7 / Mathf.Max(spell.Cooldown, 0.01f); } else if (Agotamiento.IsExhausted(p)) { value2 = Tr.Get("magia_exhausted_recover_mana"); color = HudLeatherError; } else if (!CanPay(p, spell, out why)) { value2 = why; color = HudLeatherError; } else { value2 = ((spell.Id == "encender") ? Tr.Get("magia_ready_charge_1_s_release") : ((spell.Type == SpellType.Canalizado) ? (Tr.Get("magia_ready_recital") + $" {ReciteTime(p, spell):0.0} s") : Tr.Get("magia_ready_instant_cast"))); } Text(new Rect(18f, 206f + num6, 364f, 24f), value2, 14, color, bold: false, wrap: true, (TextAnchor)3); Fill(new Rect(18f, 232f + num6, 364f, 2f), HudLeatherRule); if (num7 > 0f || _charging != null || _reciting != null) { Fill(new Rect(18f, 232f + num6, 364f * Mathf.Clamp01(num8), 2f), color); } if (list.Count > 1) { string name = list[(num + list.Count - 1) % list.Count].Name; string name2 = list[(num + 1) % list.Count].Name; Text(new Rect(18f, 240f + num6, 180f, 22f), "◂ " + name, 13, HudLeatherMuted, bold: false, wrap: false, (TextAnchor)3); Text(new Rect(202f, 240f + num6, 180f, 22f), name2 + " ▸", 13, HudLeatherAccent, bold: false, wrap: false, (TextAnchor)2); } float num10 = 272f + num6; if (favorites) { string[] array = Favoritos.Get(p); for (int i = 0; i < 9; i++) { float num11 = 18 + i % 3 * 122; float num12 = num10 + (float)(i / 3 * 34); bool flag2 = array[i] == spell.Id; bool flag3 = string.IsNullOrEmpty(array[i]); if (flag2) { Fill(new Rect(num11 - 4f, num12, 118f, 32f), new Color(0.72f, 0.49f, 0.22f, 0.18f)); } Text(new Rect(num11, num12, 14f, 24f), $"{i + 1}", 13, flag2 ? HudLeatherAccent : HudLeatherMuted, bold: true, wrap: false, (TextAnchor)3); Text(new Rect(num11 + 16f, num12, 98f, 32f), flag3 ? Tr.Get("magia_empty") : Favoritos.NameOf(array[i]), 12, flag2 ? HudLeatherAccent : (flag3 ? HudLeatherMuted : HudLeatherInk), flag2, wrap: true, (TextAnchor)3); } num10 += 108f; } if (help) { string value3 = ((!Focus.CastsGrimoire(p)) ? (((int)MTKeys.Lanzar.Value != 0) ? ($"{MTKeys.Lanzar.Value}: " + Tr.Get("magia_cast")) : Tr.Get("magia_need_wand_or_staff_hand")) : ((spell.Id == "encender") ? Tr.Get("magia_click_kindle_full_charge_create") : (spell.Sustained ? Tr.Get("magia_hold_click_lasts_while_held") : (spell.Chargeable ? Tr.Get("magia_hold_click_charge_release_cast") : Tr.Get("magia_click_cast"))))); Text(new Rect(18f, num10, 364f, 20f), value3, 13, HudLeatherMuted, bold: false, wrap: false, (TextAnchor)3); if (Focus.CastsGrimoire(p)) { num10 += 21f; Text(new Rect(18f, num10, 364f, 20f), Tr.Get("magia_right_click_cancel"), 13, HudLeatherMuted, bold: false, wrap: false, (TextAnchor)3); } Text(new Rect(18f, num10 + 21f, 364f, 20f), Tr.Get("magia_alt_wheel_switch_hide", new object[2] { MTKeys.SiguienteHechizo.Value, MTKeys.OcultarHechizo.Value }), 13, HudLeatherMuted, bold: false, wrap: false, (TextAnchor)3); Text(new Rect(18f, num10 + 42f, 364f, 22f), (MTMagiaPlugin.FavoriteShortcuts.Value ? Tr.Get("magia_alt_1_9_favorite_alt") : Tr.Get("magia_favorite_shortcuts_disabled")) + $" · {MTKeys.MenuHechizos.Value}: " + Tr.Get("magia_menu"), 13, HudLeatherMuted, bold: false, wrap: false, (TextAnchor)3); } } private static void Fill(Rect r, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Color color2 = GUI.color; GUI.color = color; GUI.DrawTexture(r, (Texture)(object)Texture2D.whiteTexture); GUI.color = color2; } private void Text(Rect r, string value, int size, Color color, bool bold = false, bool wrap = false, TextAnchor align = (TextAnchor)3) { //IL_003b: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0033: Expected O, but got Unknown //IL_008f: 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_009d: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) if (_hudText == null) { _hudText = new GUIStyle(GUI.skin.label) { richText = false, padding = new RectOffset(0, 0, 0, 0) }; } _hudText.font = MTGui.Style(14, HudLeatherInk, (TextAnchor)3, false).font; _hudText.fontSize = size; _hudText.fontStyle = (FontStyle)(bold ? 1 : 0); _hudText.wordWrap = wrap; _hudText.clipping = (TextClipping)1; _hudText.alignment = align; GUIContent val = new GUIContent(value); while (_hudText.fontSize > 11 && (wrap ? (_hudText.CalcHeight(val, ((Rect)(ref r)).width) > ((Rect)(ref r)).height) : (_hudText.CalcSize(val).x > ((Rect)(ref r)).width))) { GUIStyle hudText = _hudText; int fontSize = hudText.fontSize; hudText.fontSize = fontSize - 1; } _hudText.normal.textColor = color; GUI.Label(r, value, _hudText); } private static string SchoolLabel(Escuela e) { return Escuelas.Name(e); } private static string RankLabel(int r) { return Rangos.Name(r); } private static string RolLabel(Rol r) { return Spell.RolName(r); } public static void ToggleMenu(bool open) { if (MenuOpen == open) { return; } MenuOpen = open; GUIManager.BlockInput(open); if ((Object)(object)Instance != (Object)null) { Instance._dragId = null; Instance._dragging = false; } if (!open) { BloqueoAtaque = true; BloqueoAtaqueHasta = Time.time + 0.35f; BloqueoClic.Bloquear(0.35f); } else if (!((Object)(object)Instance == (Object)null)) { Player localPlayer = Player.m_localPlayer; List list = (((Object)(object)localPlayer != (Object)null) ? Known(localPlayer) : null); if (list != null && list.Count > 0) { Instance._menuSpell = list[Mathf.Clamp(Instance._selected, 0, list.Count - 1)]; } } } private bool UpdateMenu(Player p) { bool flag = MTKeys.Down(MTKeys.MenuHechizos); if (MenuOpen) { if (flag || InventoryGui.IsVisible() || Minimap.IsOpen() || Console.IsVisible()) { ToggleMenu(open: false); } return MenuOpen; } if (flag && _reciting == null && _charging == null && _sustaining == null && CanTakeInput()) { ToggleMenu(open: true); return true; } return false; } private bool Choose(Player p, Spell s) { if (!Pergaminos.CanCast(p, s)) { ((Character)p).Message((MessageType)1, s.Name + ": " + NeedRank(s), 0, (Sprite)null, false); return false; } Equipado = s.Id; int num = Known(p).FindIndex((Spell x) => x.Id == s.Id); if (num < 0) { return false; } _selected = num; ((Character)p).Message((MessageType)1, Tr.Get("magia_grimoire") + ": " + s.Name, 0, (Sprite)null, false); return true; } private static string NeedRank(Spell s) { return Tr.Get("magia_needs_rank", new object[2] { RankLabel(s.Rank), SchoolLabel(s.School) }); } private void DrawMenu() { //IL_01bf: 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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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_0074: 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_00b9: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } Matrix4x4 matrix = GUI.matrix; Color color = GUI.color; try { float num = Mathf.Min(new float[3] { (float)Screen.width / 1184f, (float)Screen.height / 792f, MTGui.Scale * 1.15f }); GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(num, num, 1f)); GUI.color = Color.white; float num2 = (float)Screen.width / num; float num3 = (float)Screen.height / num; Fill(new Rect(0f, 0f, num2, num3), new Color(0.025f, 0.02f, 0.018f, 0.72f)); Rect val = default(Rect); ((Rect)(ref val))..ctor((num2 - 1040f) / 2f, (num3 - 648f) / 2f, 1040f, 648f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref val)).x - 60f, ((Rect)(ref val)).y - 60f, 1160f, 768f); Texture2D fondo = GrimorioArte.Fondo; if ((Object)(object)fondo != (Object)null) { GUI.DrawTexture(val2, (Texture)(object)fondo); } else { GUI.DrawTexture(val2, (Texture)(object)Pergamino.Cuero); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 30f, ((Rect)(ref val2)).y + 30f, 660f, 708f), (Texture)(object)Pergamino.Pagina); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 716f, ((Rect)(ref val2)).y + 30f, 414f, 708f), (Texture)(object)Pergamino.Pagina); } GUI.BeginGroup(val); try { DrawMenuContent(localPlayer); } finally { GUI.EndGroup(); } } finally { GUI.matrix = matrix; GUI.color = color; } } private void DrawMenuContent(Player p) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Invalid comparison between Unknown and I4 //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_016a: 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_01c4: 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_01f2: 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_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Invalid comparison between Unknown and I4 //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Unknown result type (might be due to invalid IL or missing references) //IL_0698: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_06c1: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) _menuTip = null; Event current = Event.current; if (_dragId != null && !_dragging && (int)current.type == 3) { Vector2 val = current.mousePosition - _dragStart; if (((Vector2)(ref val)).sqrMagnitude > 36f) { _dragging = true; } } HashSet learned = Pergaminos.Known(p); List list = (from s in SpellBook.All where learned.Contains(s.Id) orderby s.School, s.Rank, s.Name select s).ToList(); Text(new Rect(20f, 10f, 170f, 36f), Tr.Get("magia_grimoire"), 26, BookAccent, bold: true, wrap: false, (TextAnchor)3); int num = list.Count((Spell s) => Grimorio.IsHidden(p, s.Id)); int num2 = list.Count((Spell s) => !Pergaminos.CanCast(p, s)); Text(new Rect(210f, 14f, 410f, 28f), Tr.Get("magia_learned_locked_hidden", new object[3] { list.Count, num2, num }), 12, BookMuted, bold: false, wrap: false, (TextAnchor)3); DrawSearch(new Rect(660f, 12f, 320f, 32f)); Text(new Rect(810f, 44f, 210f, 14f), string.Format("{0} / Esc: {1}", MTKeys.MenuHechizos.Value, Tr.Get("magia_close")), 11, BookMuted, bold: false, wrap: false, (TextAnchor)5); Fill(new Rect(20f, 48f, 600f, 1f), BookRule); DrawSchoolTabs(list, new Rect(20f, 56f, 600f, 64f)); List list2 = ((_menuTab < 0) ? list : list.Where((Spell s) => s.School == (Escuela)_menuTab).ToList()); float num3 = 20f; int t; Rect r = default(Rect); for (t = -1; t < 4; t++) { int num4 = ((t < 0) ? list2.Count : list2.Count((Spell s) => s.Rol == (Rol)t)); if (t < 0 || num4 != 0) { string value = ((t < 0) ? Tr.Get("magia_all_types") : RolLabel((Rol)t)) + $" · {num4}"; ((Rect)(ref r))..ctor(num3, 126f, 116f, 24f); bool flag = _menuRol == t; Fill(r, flag ? CardHover : (((Rect)(ref r)).Contains(current.mousePosition) ? Card : Deep)); if (t >= 0) { Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, 1f, ((Rect)(ref r)).height), BookTint(RolColor((Rol)t))); } if (flag) { Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 2f, ((Rect)(ref r)).width, 2f), BookAccent); } Text(r, value, 12, flag ? BookAccent : BookInk, flag, wrap: false, (TextAnchor)4); if (Clicked(r)) { _menuRol = t; _menuScroll = 0f; } num3 += 120f; } } List list3 = (from s in list2 where (_menuRol < 0 || s.Rol == (Rol)_menuRol) && SpellSearch.Matches(s, _menuSearch) orderby Grimorio.IsHidden(p, s.Id), (int)s.Rol, s.Rank, s.Name select s).ToList(); Text(new Rect(20f, 492f, 600f, 20f), Tr.Get("magia_spells", new object[1] { list3.Count }), 12, BookMuted, bold: false, wrap: false, (TextAnchor)5); DrawSpellGrid(p, list3, new Rect(20f, 158f, 600f, 332f)); DrawDetail(p, new Rect(660f, 60f, 360f, 442f)); DrawFavoriteBar(p, 512f); if ((int)current.type == 1 && _dragId != null) { if (_dragging && _dragFrom >= 0) { Favoritos.Clear(p, _dragFrom); } _dragId = null; _dragging = false; } if (_dragging && _dragId != null) { Spell spell = SpellBook.All.Find((Spell x) => x.Id == _dragId); if (spell != null) { MTGui.Icon(new Rect(current.mousePosition.x - 24f, current.mousePosition.y - 24f, 48f, 48f), SpellIcon(spell), 0.85f); } _menuTip = ((_dragFrom >= 0) ? Tr.Get("magia_drop_on_number_move_drop") : Tr.Get("magia_drop_on_number_save_as")); } string value2 = _menuTip ?? Tr.Get("magia_click_view_double_click_use"); Text(new Rect(20f, 622f, 600f, 26f), value2, 12, (_menuTip != null) ? BookAccent : BookMuted, bold: false, wrap: true, (TextAnchor)3); Text(new Rect(660f, 622f, 360f, 26f), Tr.Get("magia_grimoire") + " · " + p.GetPlayerName(), 12, BookMuted, bold: false, wrap: false, (TextAnchor)5); } private void DrawSchoolTabs(List all, Rect row) { //IL_0157: 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_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_01ae: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: 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_02e1: Unknown result type (might be due to invalid IL or missing references) Event current = Event.current; List schools = Escuelas.All.Where((Escuela s) => all.Any((Spell x) => x.School == s)).ToList(); List list = new List { Tr.Get("magia_all") }; list.AddRange(schools.Select(SchoolLabel)); int num = Mathf.Min(5, list.Count); int num2 = Mathf.CeilToInt((float)list.Count / (float)num); float num3 = (((Rect)(ref row)).width - 4f * (float)(num - 1)) / (float)num; float num4 = (((Rect)(ref row)).height - 4f * (float)(num2 - 1)) / (float)num2; Rect r = default(Rect); for (int num5 = 0; num5 < list.Count; num5++) { int t = num5 - 1; ((Rect)(ref r))..ctor(((Rect)(ref row)).x + (float)(num5 % num) * (num3 + 4f), ((Rect)(ref row)).y + (float)(num5 / num) * (num4 + 4f), num3, num4); bool flag = ((t < 0) ? (_menuTab == -1) : (_menuTab == (int)schools[t])); bool flag2 = ((Rect)(ref r)).Contains(current.mousePosition); Fill(r, flag ? CardHover : (flag2 ? Card : Deep)); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 1f, ((Rect)(ref r)).width, 1f), flag ? BookAccent : BookRule); float num6 = ((Rect)(ref r)).x + 8f; if (t >= 0) { Fill(new Rect(num6, ((Rect)(ref r)).center.y - 3f, 6f, 6f), BookTint(SchoolColor(schools[t]))); num6 += 10f; } int num7 = ((t < 0) ? all.Count : all.Count((Spell s) => s.School == schools[t])); Text(new Rect(num6, ((Rect)(ref r)).y, ((Rect)(ref r)).xMax - num6 - 4f, ((Rect)(ref r)).height), list[num5], 13, flag ? BookAccent : BookInk, flag, wrap: true, (TextAnchor)3); if (flag2) { _menuTip = Tr.Get("magia_spells_2", new object[2] { list[num5], num7 }); } if (Clicked(r)) { _menuTab = (int)((t < 0) ? ((Escuela)(-1)) : schools[t]); _menuRol = -1; _menuScroll = 0f; } } } private void DrawSearch(Rect field) { //IL_0044: 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_004c: 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_005e: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_023c: 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_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) bool flag = GUI.GetNameOfFocusedControl() == "MTSpellSearch"; BookOutline(new Rect(((Rect)(ref field)).x - 1f, ((Rect)(ref field)).y - 1f, ((Rect)(ref field)).width + 2f, ((Rect)(ref field)).height + 2f), flag ? BookAccent : BookRule); Fill(field, Deep); if (_searchStyle == null) { _searchStyle = new GUIStyle(GUI.skin.textField) { font = MTGui.Style(14, BookInk, (TextAnchor)3, false).font, fontSize = 14, padding = new RectOffset(10, 34, 6, 6), richText = false }; GUIStyleState normal = _searchStyle.normal; GUIStyleState focused = _searchStyle.focused; Texture2D val = (_searchStyle.hover.background = null); Texture2D background = (focused.background = val); normal.background = background; GUIStyleState normal2 = _searchStyle.normal; GUIStyleState focused2 = _searchStyle.focused; Color val4 = (_searchStyle.hover.textColor = BookInk); Color textColor = (focused2.textColor = val4); normal2.textColor = textColor; } _searchStyle.font = MTGui.Style(14, BookInk, (TextAnchor)3, false).font; GUI.SetNextControlName("MTSpellSearch"); string text = GUI.TextField(field, _menuSearch, 80, _searchStyle); if (text != _menuSearch) { _menuSearch = text; _menuScroll = 0f; } if (_menuSearch.Length == 0 && !flag) { Text(new Rect(((Rect)(ref field)).x + 10f, ((Rect)(ref field)).y, ((Rect)(ref field)).width - 20f, ((Rect)(ref field)).height), Tr.Get("magia_search_name_school_or_effect"), 13, BookMuted, bold: false, wrap: false, (TextAnchor)3); } if (_menuSearch.Length > 0) { Rect r = default(Rect); ((Rect)(ref r))..ctor(((Rect)(ref field)).xMax - 30f, ((Rect)(ref field)).y + 4f, 24f, 24f); Fill(r, ((Rect)(ref r)).Contains(Event.current.mousePosition) ? CardHover : Card); Text(r, "×", 16, BookInk, bold: true, wrap: false, (TextAnchor)4); if (Clicked(r)) { _menuSearch = ""; _menuScroll = 0f; GUI.FocusControl("MTSpellSearch"); } } } private void DrawSpellGrid(Player p, List list, Rect area) { //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_06f5: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_051a: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) Fill(area, Deep); float num = (float)Mathf.CeilToInt((float)list.Count / 3f) * 76f + 6f; float num2 = Mathf.Max(0f, num - ((Rect)(ref area)).height); Event current = Event.current; if ((int)current.type == 6 && ((Rect)(ref area)).Contains(current.mousePosition)) { _menuScroll = Mathf.Clamp(_menuScroll + current.delta.y * 24f, 0f, num2); current.Use(); } _menuScroll = Mathf.Clamp(_menuScroll, 0f, num2); if (list.Count == 0) { bool flag = Pergaminos.Known(p).Count == 0; Text(new Rect(((Rect)(ref area)).x + 20f, ((Rect)(ref area)).y + 20f, ((Rect)(ref area)).width - 40f, 70f), flag ? Tr.Get("magia_haven_t_learned_any_spells") : Tr.Get("magia_no_spells_match_try_another"), 15, BookMuted, bold: false, wrap: true, (TextAnchor)3); if (!flag && Button(new Rect(((Rect)(ref area)).x + 20f, ((Rect)(ref area)).y + 106f, 230f, 34f), Tr.Get("magia_show_all"), enabled: true)) { _menuSearch = ""; _menuTab = (_menuRol = -1); _menuScroll = 0f; } return; } GUI.BeginGroup(area); try { string[] array = Favoritos.Get(p); Rect r = default(Rect); Rect r2 = default(Rect); Rect r3 = default(Rect); for (int i = 0; i < list.Count; i++) { Spell spell = list[i]; ((Rect)(ref r))..ctor(6f + (float)(i % 3) * 194f, 6f + (float)(i / 3) * 76f - _menuScroll, 188f, 70f); if (((Rect)(ref r)).yMax < 0f || ((Rect)(ref r)).y > ((Rect)(ref area)).height) { continue; } bool flag2 = Pergaminos.CanCast(p, spell); bool flag3 = Grimorio.IsHidden(p, spell.Id); bool flag4 = _menuSpell == spell; bool flag5 = !_dragging && ((Rect)(ref r)).Contains(current.mousePosition) && current.mousePosition.y >= 0f && current.mousePosition.y <= ((Rect)(ref area)).height; if (flag4) { BookOutline(new Rect(((Rect)(ref r)).x - 2f, ((Rect)(ref r)).y - 2f, ((Rect)(ref r)).width + 4f, ((Rect)(ref r)).height + 4f), BookAccent); } Fill(r, flag4 ? CardHover : ((!flag3) ? (flag5 ? CardHover : Card) : (flag5 ? HiddenHover : HiddenCard))); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 1f, ((Rect)(ref r)).width, 1f), (flag3 && !flag4) ? BookRule : (BookTint(SchoolColor(spell.School)) * new Color(1f, 1f, 1f, 0.45f))); float num3 = ((!flag4) ? (flag3 ? 0.25f : (flag2 ? 1f : 0.45f)) : (flag2 ? 1f : 0.6f)); MTGui.Icon(new Rect(((Rect)(ref r)).x + 9f, ((Rect)(ref r)).y + 9f, 52f, 52f), SpellIcon(spell), num3); Text(new Rect(((Rect)(ref r)).x + 68f, ((Rect)(ref r)).y + 5f, 114f, 36f), spell.Name, 14, flag4 ? BookAccent : (flag3 ? (BookMuted * 0.8f) : (flag2 ? BookInk : BookMuted)), bold: true, wrap: true, (TextAnchor)3); if (flag3) { ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 7f, ((Rect)(ref r)).y + 50f, 56f, 15f); Fill(r2, new Color(0.89f, 0.81f, 0.66f)); Text(r2, Tr.Get("magia_hidden"), 10, BookInk, bold: true, wrap: false, (TextAnchor)4); } string value = ((!flag2) ? Tr.Get("magia_needs", new object[1] { RankLabel(spell.Rank) }) : (flag3 ? Tr.Get("magia_hidden_right_click_show") : $"{RankLabel(spell.Rank)} · {ManaCost(p, spell):0} {Mana}")); Text(new Rect(((Rect)(ref r)).x + 68f, ((Rect)(ref r)).y + 44f, 114f, 20f), value, 12, (!flag2) ? BookError : BookMuted, bold: false, wrap: false, (TextAnchor)3); int num4 = Array.IndexOf(array, spell.Id); if (num4 >= 0) { ((Rect)(ref r3))..ctor(((Rect)(ref r)).xMax - 20f, ((Rect)(ref r)).y + 3f, 17f, 17f); Fill(r3, BookAccent); Text(r3, $"{num4 + 1}", 11, new Color(0.98f, 0.93f, 0.82f), bold: true, wrap: false, (TextAnchor)4); } if (!flag5) { continue; } if (Clicked(r)) { _menuSpell = spell; _dragId = spell.Id; _dragFrom = -1; _dragStart = current.mousePosition + ((Rect)(ref area)).position; bool flag6 = _lastClickId == spell.Id && Time.unscaledTime - _lastClickTime < 0.35f; if (Choose(p, spell) && flag6) { BloqueoAtaque = true; ToggleMenu(open: false); } _lastClickId = spell.Id; _lastClickTime = Time.unscaledTime; } else if (Clicked(r, 1)) { _menuSpell = spell; Grimorio.Set(p, spell.Id, !flag3); } } } finally { GUI.EndGroup(); } if (num2 > 0f) { float num5 = ((Rect)(ref area)).height * ((Rect)(ref area)).height / num; float num6 = ((Rect)(ref area)).y + (((Rect)(ref area)).height - num5) * (_menuScroll / num2); Fill(new Rect(((Rect)(ref area)).xMax - 4f, ((Rect)(ref area)).y, 4f, ((Rect)(ref area)).height), Card); Fill(new Rect(((Rect)(ref area)).xMax - 4f, num6, 4f, num5), BookRule); } } private void DrawDetail(Player p, Rect area) { //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_0061: 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_0053: 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_00b5: 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_0125: 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_0171: 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_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_0543: 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_0578: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) Fill(area, Deep); Spell menuSpell = _menuSpell; if (menuSpell == null) { Text(new Rect(((Rect)(ref area)).x + 20f, ((Rect)(ref area)).y + 20f, ((Rect)(ref area)).width - 40f, 60f), Tr.Get("magia_pick_spell_see_what_does"), 15, BookMuted, bold: false, wrap: true, (TextAnchor)3); return; } GUI.BeginGroup(area); try { float width = ((Rect)(ref area)).width; Event current = Event.current; MTGui.Icon(new Rect(16f, 16f, 80f, 80f), SpellIcon(menuSpell), 1f); Text(new Rect(108f, 12f, width - 120f, 50f), menuSpell.Name, 22, BookAccent, bold: true, wrap: true, (TextAnchor)3); string text = SchoolLabel(menuSpell.School) + (menuSpell.School2.HasValue ? (" + " + SchoolLabel(menuSpell.School2.Value)) : ""); Text(new Rect(108f, 62f, width - 120f, 30f), text + " · " + RankLabel(menuSpell.Rank), 13, BookTint(SchoolColor(menuSpell.School)), bold: false, wrap: true, (TextAnchor)3); Text(new Rect(108f, 94f, width - 120f, 18f), RolLabel(menuSpell.Rol), 12, BookTint(RolColor(menuSpell.Rol)), bold: true, wrap: false, (TextAnchor)3); Fill(new Rect(16f, 116f, width - 32f, 1f), BookRule); float num = HealthCost(p, menuSpell); string value = (menuSpell.Sustained ? Tr.Get("magia_hold_click_keep") : ((menuSpell.Type == SpellType.Canalizado) ? (Tr.Get("magia_chant") + $" · {ReciteTime(p, menuSpell):0.0} s") : (menuSpell.Chargeable ? Tr.Get("magia_instant_can_be_charged") : Tr.Get("magia_instant")))); Text(new Rect(16f, 122f, width - 32f, 22f), $"{ManaCost(p, menuSpell):0.#} {Mana}" + ((num > 0f) ? ($" · {num:0.#} " + Tr.Get("magia_health")) : "") + ((menuSpell.Cooldown > 0.5f) ? string.Format(" · {0} {1:0.#} s", Tr.Get("magia_cooldown_2"), menuSpell.Cooldown) : ""), 14, BookInk, bold: false, wrap: false, (TextAnchor)3); Text(new Rect(16f, 146f, width - 32f, 20f), value, 13, BookMuted, bold: false, wrap: false, (TextAnchor)3); string text2 = SpellBook.DamagePreview(p, menuSpell, 1f, menuSpell.Sustained && Focus.CastsGrimoire(p)); if (text2 != null) { Text(new Rect(16f, 170f, width - 32f, 26f), text2, 14, BookAccent, bold: true, wrap: true, (TextAnchor)3); } Text(new Rect(16f, (float)((text2 == null) ? 176 : 200), width - 32f, (float)((text2 == null) ? 130 : 106)), menuSpell.Description, 14, BookInk, bold: false, wrap: true, (TextAnchor)3); float value2; float num2 = (_readyAt.TryGetValue(menuSpell.Id, out value2) ? Mathf.Max(0f, value2 - Time.time) : 0f); bool num3 = Pergaminos.CanCast(p, menuSpell); bool flag = Grimorio.IsHidden(p, menuSpell.Id); string value3; Color color; string why; if (!num3) { value3 = NeedRank(menuSpell); color = BookError; } else if (flag) { value3 = Tr.Get("magia_hidden_won_t_appear_when"); color = BookMuted; } else if (num2 > 0f) { value3 = Tr.Get("magia_cooldown") + $" · {num2:0.0} s"; color = BookBlue; } else if (!CanPay(p, menuSpell, out why)) { value3 = why; color = BookError; } else { value3 = Tr.Get("magia_ready_double_click_use"); color = BookAccent; } Text(new Rect(16f, 310f, width - 32f, 32f), value3, 13, color, bold: true, wrap: true, (TextAnchor)3); int num4 = Favoritos.SlotOf(p, menuSpell.Id); Text(new Rect(16f, 346f, width - 32f, 32f), (num4 >= 0) ? Tr.Get("magia_favorite_alt", new object[1] { num4 + 1 }) : Tr.Get("magia_drag_number_below_make_favorite"), 12, (num4 >= 0) ? BookAccent : BookMuted, bold: false, wrap: true, (TextAnchor)3); Rect r = default(Rect); ((Rect)(ref r))..ctor(16f, 386f, width - 32f, 40f); bool flag2 = ((Rect)(ref r)).Contains(current.mousePosition); Fill(r, flag2 ? Card : Deep); Rect r2 = default(Rect); ((Rect)(ref r2))..ctor(((Rect)(ref r)).x + 8f, ((Rect)(ref r)).y + 11f, 18f, 18f); BookOutline(r2, BookMuted); if (flag) { Text(r2, "×", 18, BookAccent, bold: true, wrap: false, (TextAnchor)4); } Text(new Rect(((Rect)(ref r)).x + 34f, ((Rect)(ref r)).y, ((Rect)(ref r)).width - 40f, ((Rect)(ref r)).height), Tr.Get("magia_hide_when_cycling_spells"), 13, flag ? BookAccent : BookInk, bold: false, wrap: true, (TextAnchor)3); if (Clicked(r)) { Grimorio.Set(p, menuSpell.Id, !flag); } } finally { GUI.EndGroup(); } } private void DrawFavoriteBar(Player p, float y) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_022c: Invalid comparison between Unknown and I4 //IL_044c: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: 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_0336: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) Event current = Event.current; Fill(new Rect(20f, y - 3f, 600f, 1f), BookRule); Fill(new Rect(660f, y - 3f, 360f, 1f), BookRule); Text(new Rect(20f, y, 600f, 20f), Tr.Get("magia_favorites_alt_1_9_combat"), 14, BookAccent, bold: true, wrap: false, (TextAnchor)3); string[] fav = Favoritos.Get(p); int i; Rect r = default(Rect); for (i = 0; i < 9; i++) { float num = ((i < 6) ? 95f : 116f); float num2 = ((i < 6) ? (20f + (float)i * (num + 6f)) : (660f + (float)(i - 6) * (num + 6f))); ((Rect)(ref r))..ctor(num2, y + 24f, num, 82f); Spell spell = (string.IsNullOrEmpty(fav[i]) ? null : SpellBook.All.Find((Spell x) => x.Id == fav[i])); bool flag = ((Rect)(ref r)).Contains(current.mousePosition); bool flag2 = spell != null && spell == _menuSpell; BookOutline(new Rect(((Rect)(ref r)).x - 1f, ((Rect)(ref r)).y - 1f, ((Rect)(ref r)).width + 2f, ((Rect)(ref r)).height + 2f), ((_dragging && flag) || flag2) ? BookAccent : BookRule); Fill(r, flag ? CardHover : Card); Text(new Rect(((Rect)(ref r)).x + 6f, ((Rect)(ref r)).y + 3f, 20f, 18f), $"{i + 1}", 13, BookAccent, bold: true, wrap: false, (TextAnchor)3); if ((int)current.type == 1 && _dragging && flag && _dragId != null) { string text = fav[i]; Favoritos.Set(p, i, _dragId); if (_dragFrom >= 0 && _dragFrom != i && !string.IsNullOrEmpty(text)) { Favoritos.Set(p, _dragFrom, text); } _dragId = null; _dragging = false; current.Use(); } else if (spell != null) { MTGui.Icon(new Rect(((Rect)(ref r)).x + (((Rect)(ref r)).width - 36f) / 2f, ((Rect)(ref r)).y + 6f, 36f, 36f), SpellIcon(spell), 1f); Text(new Rect(((Rect)(ref r)).x + 4f, ((Rect)(ref r)).y + 44f, ((Rect)(ref r)).width - 8f, 34f), spell.Name, 12, BookInk, bold: false, wrap: true, (TextAnchor)1); if (flag && !_dragging) { _menuTip = Tr.Get("magia_drag_move_or_out_remove", new object[1] { spell.Name }); } if (Clicked(r)) { _menuSpell = spell; _dragId = spell.Id; _dragFrom = i; _dragStart = current.mousePosition; bool flag3 = _lastClickId == spell.Id && Time.unscaledTime - _lastClickTime < 0.35f; if (Choose(p, spell) && flag3) { BloqueoAtaque = true; ToggleMenu(open: false); } _lastClickId = spell.Id; _lastClickTime = Time.unscaledTime; } if (Clicked(r, 1)) { Favoritos.Clear(p, i); } } else { Text(new Rect(((Rect)(ref r)).x + 4f, ((Rect)(ref r)).y + 26f, ((Rect)(ref r)).width - 8f, 30f), Tr.Get("magia_empty"), 12, BookMuted, bold: false, wrap: false, (TextAnchor)4); if (flag && !_dragging) { _menuTip = Tr.Get("magia_drag_spell_here"); } } } } private bool Button(Rect r, string label, bool enabled) { //IL_000a: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) bool flag = enabled && ((Rect)(ref r)).Contains(Event.current.mousePosition); BookOutline(new Rect(((Rect)(ref r)).x - 1f, ((Rect)(ref r)).y - 1f, ((Rect)(ref r)).width + 2f, ((Rect)(ref r)).height + 2f), enabled ? BookRule : Card); Fill(r, flag ? CardHover : Card); Text(r, label, 15, (!enabled) ? BookMuted : (flag ? BookAccent : BookInk), bold: true, wrap: false, (TextAnchor)4); if (enabled) { return Clicked(r); } return false; } private static Color BookTint(Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) return Color.Lerp(BookInk, color * new Color(0.4f, 0.4f, 0.4f, 1f), 0.7f); } private static void BookOutline(Rect r, Color color) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, ((Rect)(ref r)).width, 1f), color); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).yMax - 1f, ((Rect)(ref r)).width, 1f), color); Fill(new Rect(((Rect)(ref r)).x, ((Rect)(ref r)).y, 1f, ((Rect)(ref r)).height), color); Fill(new Rect(((Rect)(ref r)).xMax - 1f, ((Rect)(ref r)).y, 1f, ((Rect)(ref r)).height), color); } private static bool Clicked(Rect r, int button = 0) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Event current = Event.current; if ((int)current.type != 0 || current.button != button || !((Rect)(ref r)).Contains(current.mousePosition)) { return false; } current.Use(); return true; } private static Color RolColor(Rol r) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return (Color)(r switch { Rol.Apoyo => new Color(0.4f, 0.85f, 0.45f), Rol.Defensivo => new Color(0.35f, 0.6f, 0.95f), Rol.Ofensivo => new Color(0.9f, 0.35f, 0.25f), _ => new Color(0.7f, 0.7f, 0.7f), }); } private static Sprite SpellIcon(Spell s) { return MTMagiaPlugin.Icon("hechizo_" + s.Id) ?? MTMagiaPlugin.Icon(SchoolIconName(s.School)); } public static Color SchoolColor(Escuela e) { //IL_0042: 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_006c: 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_0096: 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_00c0: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) return (Color)(e switch { Escuela.Fuego => new Color(1f, 0.45f, 0.2f), Escuela.Agua => new Color(0.35f, 0.6f, 1f), Escuela.Viento => new Color(0.5f, 0.95f, 0.7f), Escuela.Tierra => new Color(0.75f, 0.55f, 0.3f), Escuela.Sanacion => new Color(0.5f, 1f, 0.5f), Escuela.Desintoxicacion => new Color(0.75f, 0.9f, 0.3f), Escuela.Barrera => new Color(0.95f, 0.85f, 0.5f), Escuela.Invocacion => new Color(0.75f, 0.5f, 1f), Escuela.Gravedad => new Color(0.78f, 0.64f, 1f), _ => new Color(0.85f, 0.15f, 0.2f), }); } public static void RegistrarRueda() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown Ruedas.Registrar(new RuedaProveedor { Id = "magia", Prioridad = 20, Activo = Focus.HasFocus, Llenar = LlenarRueda, Elegir = delegate(Player p, RuedaOpcion o) { if ((Object)(object)Instance != (Object)null && o.Dato is Spell s) { Instance.Choose(p, s); } }, VaciaKey = "magia_wheel_none" }); } private static void LlenarRueda(Player p, List lista) { //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_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown List list = Known(p); Orden.Clear(); Puestos.Clear(); string[] array = Favoritos.Get(p); foreach (string id in array) { if (!string.IsNullOrEmpty(id) && Puestos.Add(id)) { Spell spell = list.Find((Spell x) => x.Id == id); if (spell != null) { Orden.Add(spell); } } } foreach (Spell item in list) { if (Puestos.Add(item.Id)) { Orden.Add(item); } } string arg = Tr.Get("core_mana_2"); foreach (Spell item2 in Orden) { float num = ManaCost(p, item2); float num2 = 0f; if ((Object)(object)Instance != (Object)null && Instance._readyAt.TryGetValue(item2.Id, out var value)) { num2 = Mathf.Max(0f, value - Time.time); } string text = null; if (num2 > 0f) { text = Tr.Get("magia_cooldown") + $": {Mathf.CeilToInt(num2)} s"; } else if (num > 0f && p.GetEitr() < num) { text = Tr.Get("magia_not_enough_mana"); } int num3 = Favoritos.SlotOf(p, item2.Id); if (text == null && num3 >= 0) { text = $"Alt + {num3 + 1}"; } lista.Add(new RuedaOpcion { Nombre = item2.Name, Detalle = ((num > 0f) ? $"{num:0} {arg}" : null), Estado = text, Icono = SpellIcon(item2), Color = SchoolColor(item2.School), Disponible = (num2 <= 0f && (num <= 0f || p.GetEitr() >= num)), Espera = ((num2 > 0f) ? (num2 / Mathf.Max(0.01f, item2.Cooldown)) : 0f), Dato = item2 }); } } } public static class Focus { private static readonly Dictionary Cores = new Dictionary { { "StaffFireball", Escuela.Fuego }, { "StaffClusterbomb", Escuela.Fuego }, { "StaffIceShards", Escuela.Agua }, { "StaffFrostOrbs", Escuela.Agua }, { "StaffLightning", Escuela.Viento }, { "StaffThunderBlood", Escuela.Viento }, { "StaffGreenRoots", Escuela.Tierra }, { "StaffShield", Escuela.Barrera }, { "StaffSkeleton", Escuela.Invocacion }, { "StaffRedTroll", Escuela.Invocacion }, { "StaffSpiritCaller", Escuela.Invocacion }, { "StaffOrbofAhri", Escuela.Invocacion } }; private static ItemData Staff(Player p) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Invalid comparison between Unknown and I4 ItemData currentWeapon = ((Humanoid)p).GetCurrentWeapon(); if (currentWeapon == null || (Object)(object)currentWeapon.m_dropPrefab == (Object)null) { return null; } if (Desgaste.Roto(currentWeapon)) { return null; } SkillType skillType = currentWeapon.m_shared.m_skillType; if (((Object)currentWeapon.m_dropPrefab).name == "MT_CanonMk1") { return null; } if (!((Object)currentWeapon.m_dropPrefab).name.StartsWith("MT_Varita") && (int)skillType != 9 && (int)skillType != 10) { return null; } return currentWeapon; } public static bool HasFocus(Player p) { return Staff(p) != null; } public static bool CastsGrimoire(Player p) { ItemData val = Staff(p); if (val == null) { return false; } if (!((Object)val.m_dropPrefab).name.StartsWith("MT_")) { return MTMagiaPlugin.BastonesGrimorio.Value; } return true; } private static float Tier(Player p) { ItemData val = Staff(p); if (val == null) { return 0f; } float num = Bastones.Tier(((Object)val.m_dropPrefab).name); if (num < 0f) { num = (((Object)val.m_dropPrefab).name.StartsWith("MT_Varita") ? 0.05f : 0.15f); } return num + 0.02f * (float)(val.m_quality - 1); } private static float CoreBonus(Player p, Escuela school) { ItemData val = Staff(p); if (val == null) { return 0f; } string name = ((Object)val.m_dropPrefab).name; if ((!Cores.TryGetValue(name, out var value) && !Bastones.Nucleos.TryGetValue(name, out value)) || value != school) { return 0f; } return 1f; } private static bool Legendary(Player p) { ItemData val = Staff(p); if (val != null) { return Bastones.Nucleos.ContainsKey(((Object)val.m_dropPrefab).name); } return false; } private static float Quality(Player p) { return 0.02f * (float)(Staff(p).m_quality - 1); } public static float CostCut(Player p, Escuela school) { if (Legendary(p)) { if (!(CoreBonus(p, school) > 0f)) { return 0f; } return 0.35f + Quality(p); } return 1f - (1f - Tier(p)) * (1f - 0.1f * CoreBonus(p, school)); } public static float PowerBonus(Player p, Escuela school) { if (Legendary(p)) { if (!(CoreBonus(p, school) > 0f)) { return 0f; } return 0.4f + Quality(p); } return Tier(p) + 0.15f * CoreBonus(p, school); } public static float ReciteCut(Player p) { if (Staff(p) != null) { return 0.2f; } return 0f; } } public class ChargeOrb : MonoBehaviour { public float Heat; private ParticleSystem _core; private ParticleSystem _swirl; private Light _light; private Color _cold; private Color _mid; private Color _hot; private Material _outerMat; private Material _innerMat; private Transform _outer; private Transform _inner; private ParticleSystem _chispas; private const float NucleoFuera = 0.2f; private const float NucleoDentro = 0.12f; public static ChargeOrb Create(Color cold, Color mid, Color hot) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("MT_OrbeCarga"); ChargeOrb chargeOrb = val.AddComponent(); chargeOrb._cold = cold; chargeOrb._mid = mid; chargeOrb._hot = hot; chargeOrb._core = chargeOrb.Part(val.transform, 0.45f, 0.22f, 0f, 120f, aditivo: true); chargeOrb._swirl = chargeOrb.Part(val.transform, 0.22f, 0.42f, 2.5f, 110f, aditivo: false); chargeOrb._chispas = chargeOrb.Part(val.transform, 0.07f, 0.25f, 0f, 60f, aditivo: true); MainModule main = chargeOrb._chispas.main; ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.8f, 2.2f); ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.3f, 0.6f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; chargeOrb._outer = chargeOrb.Ball(val.transform, 0.2f, out chargeOrb._outerMat); chargeOrb._inner = chargeOrb.Ball(val.transform, 0.12f, out chargeOrb._innerMat); chargeOrb._light = LucesMagicas.Registrar(new GameObject("Luz").AddComponent()); ((Component)chargeOrb._light).transform.SetParent(val.transform, false); chargeOrb._light.range = 3f; return chargeOrb; } private Transform Ball(Transform parent, float size, out Material mat) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)obj.GetComponent()); ((Object)obj).name = "Nucleo"; obj.transform.SetParent(parent, false); obj.transform.localScale = Vector3.one * size; MeshRenderer component = obj.GetComponent(); ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; mat = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)Texture2D.whiteTexture, renderQueue = 3100 }; ((Renderer)component).sharedMaterial = mat; return obj.transform; } private ParticleSystem Part(Transform parent, float size, float radius, float orbital, float rate, bool aditivo) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00fa: 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_00fd: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown GameObject val = new GameObject("Particulas"); val.transform.SetParent(parent, false); ParticleSystem val2 = val.AddComponent(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.25f, 0.45f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(size * 0.6f, size); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).maxParticles = 1000; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(rate); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = radius; if (orbital > 0f) { VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalZ = new MinMaxCurve(orbital); MinMaxCurve val3 = default(MinMaxCurve); ((MinMaxCurve)(ref val3))..ctor(0f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).z = val3; MinMaxCurve x = (((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = val3); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).x = x; } ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val5 = new Gradient(); val5.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.2f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val5); ((Renderer)val.GetComponent()).material = new Material(Shader.Find(aditivo ? "Legacy Shaders/Particles/Additive" : "Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)ToukiManos.Dot() }; val2.Play(); return val2; } private void Update() { //IL_0064: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e5: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_0141: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: 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) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0202: 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_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.Rotate(0f, 0f, Mathf.Lerp(120f, 1400f, Heat) * Time.deltaTime, (Space)1); Color val = ((Heat < 0.5f) ? Color.Lerp(_cold, _mid, Heat * 2f) : Color.Lerp(_mid, _hot, (Heat - 0.5f) * 2f)); MainModule main = _core.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val); MainModule main2 = _swirl.main; ((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(Color.Lerp(val, Color.white, 0.15f)); EmissionModule emission = _core.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(120f, 380f, Heat)); EmissionModule emission2 = _swirl.emission; ((EmissionModule)(ref emission2)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(110f, 480f, Heat)); EmissionModule emission3 = _chispas.emission; ((EmissionModule)(ref emission3)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Lerp(45f, 260f, Heat)); MainModule main3 = _chispas.main; ((MainModule)(ref main3)).startColor = MinMaxGradient.op_Implicit(Color.Lerp(val, Color.white, 0.35f)); VelocityOverLifetimeModule velocityOverLifetime = _swirl.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalZ = new MinMaxCurve(Mathf.Lerp(2.5f, 12f, Heat)); float num = (1f + 0.08f * Mathf.Sin(Time.time * Mathf.Lerp(6f, 18f, Heat))) / Mathf.Max(0.01f, ((Component)this).transform.lossyScale.x); _outer.localScale = Vector3.one * 0.2f * num; _inner.localScale = Vector3.one * 0.12f * num; _outerMat.color = new Color(val.r, val.g, val.b, 0.75f); _innerMat.color = new Color(Mathf.Lerp(val.r, 1f, 0.7f), Mathf.Lerp(val.g, 1f, 0.7f), Mathf.Lerp(val.b, 1f, 0.7f), 0.95f); _light.color = val; _light.intensity = Mathf.Lerp(0.8f, 3f, Heat) * (0.9f + 0.1f * Mathf.Sin(Time.time * 30f)); } } [HarmonyPatch(typeof(Container), "AddDefaultItems")] public static class CofresGravedadPatch { private static readonly string[] Cofres = new string[7] { "TreasureChest_mountaincave", "TreasureChest_mountains", "TreasureChest_plainsfortress_hildir", "TreasureChest_plains_stone", "TreasureChest_dvergrtower", "TreasureChest_dvergrtown", "TreasureChest_charredfortress" }; private static void Postfix(Container __instance) { string value = ((Object)((Component)__instance).gameObject).name.Replace("(Clone)", "").Trim(); if (Array.IndexOf(Cofres, value) >= 0 && !(Random.value > MTMagiaPlugin.CofreGravedad.Value)) { ObjectDB instance = ObjectDB.instance; GameObject val = ((instance != null) ? instance.GetItemPrefab("MT_PergaminoGravedad") : null); if ((Object)(object)val != (Object)null) { __instance.GetInventory().AddItem(val, 1); } } } } internal static class Contencion { private static readonly FieldInfo Tameness = AccessTools.Field(typeof(Tameable), "m_tameness"); public static void Tame(Character target, float amount) { if ((Object)(object)target == (Object)null || target.IsTamed()) { return; } Tameable component = ((Component)target).GetComponent(); if (!((Object)(object)component == (Object)null) && !(Tameness == null)) { ZNetView component2 = ((Component)target).GetComponent(); if ((!((Object)(object)component2 != (Object)null) || component2.IsOwner()) && Tameness.GetValue(component) is float num) { Tameness.SetValue(component, Mathf.Clamp01(num + amount)); } } } } [HarmonyPatch(typeof(CharacterDrop), "GenerateDropList")] public static class CookedDropPatch { private static readonly Dictionary Cooked = new Dictionary { { "RawMeat", "CookedMeat" }, { "DeerMeat", "CookedDeerMeat" }, { "NeckTail", "NeckTailGrilled" }, { "WolfMeat", "CookedWolfMeat" }, { "LoxMeat", "CookedLoxMeat" }, { "SerpentMeat", "SerpentMeatCooked" }, { "HareMeat", "CookedHareMeat" }, { "ChickenMeat", "CookedChickenMeat" }, { "BugMeat", "CookedBugMeat" }, { "AsksvinMeat", "CookedAsksvinMeat" }, { "VoltureMeat", "CookedVoltureMeat" }, { "MooseMeat", "CookedMooseMeat" }, { "BjornMeat", "CookedBjornMeat" }, { "BoneMawSerpentMeat", "CookedBoneMawSerpentMeat" }, { "SealBlubber", "CookedSealBlubber" }, { "Fish1", "FishCooked" }, { "Fish2", "FishCooked" }, { "Fish3", "FishCooked" }, { "Fish5", "FishCooked" }, { "Fish6", "FishCooked" }, { "Fish7", "FishCooked" }, { "Fish8", "FishCooked" }, { "Fish9", "FishCooked" } }; private static void Postfix(CharacterDrop __instance, List> __result) { if (__result == null || (Object)(object)ObjectDB.instance == (Object)null) { return; } Character component = ((Component)__instance).GetComponent(); HitData val = (((Object)(object)component != (Object)null) ? Campos.UltimoGolpe.Invoke(component) : null); if (val == null || val.m_damage.m_fire <= 0f) { return; } for (int i = 0; i < __result.Count; i++) { if (Cooked.TryGetValue(((Object)__result[i].Key).name, out var value)) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(value); if ((Object)(object)itemPrefab != (Object)null) { __result[i] = new KeyValuePair(itemPrefab, __result[i].Value); } } } } } public class Cumulonimbus : MonoBehaviour { private const float Altura = 22f; private const float Radio = 25f; private const float Duracion = 60f; private const float Intervalo = 2f; private const float Aviso = 0.45f; private Player _p; private DamageTypes _dano; private SkillType _skill; private int _total; private int _quedan; private float _fin; private float _proximo; private float _proximoDecor; private float _proximoMojar; private float _proximoInterno; private bool _apagando; private Vector3 _objetivo; private float _caeEn = -1f; private Character _ultimo; private ParticleSystem _nube; private Light _luz; private float _flash; private Material _matNube; private static Texture2D _texNube; private static readonly List _cerca = new List(); private GUIStyle _estilo; private string _texto; private int _textoDe = -1; public static int RayosPorRango(int rango) { if (rango < 6) { if (rango < 5) { if (rango < 4) { return 5; } return 8; } return 10; } return 12; } public static void Lanzar(Player p, DamageTypes dano, SkillType skill) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0060: 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) if (!((Object)(object)p == (Object)null)) { Transform val = ((Component)p).transform.Find("MT_Cumulonimbus"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } GameObject val2 = new GameObject("MT_Cumulonimbus"); val2.transform.SetParent(((Component)p).transform, false); Cumulonimbus cumulonimbus = val2.AddComponent(); cumulonimbus._p = p; cumulonimbus._dano = dano; cumulonimbus._skill = skill; cumulonimbus._total = (cumulonimbus._quedan = RayosPorRango(Escuelas.Rank(p, Escuela.Agua))); cumulonimbus._fin = Time.time + 60f; cumulonimbus._proximo = Time.time + 2.5f; cumulonimbus._proximoDecor = Time.time + 3f; if (MTMagiaPlugin.EfectosPropios.Value) { cumulonimbus.CrearNube(); } } } private void CrearNube() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00a4: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_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_013d: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: 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_01d3: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_0203: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0302: 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_031d: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Nube"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = Vector3.up * 22f; _nube = val.AddComponent(); _nube.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = _nube.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(5f, 8f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.2f, 0.8f); ((MainModule)(ref main)).startSize = new MinMaxCurve(7f, 13f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(0f, (float)Math.PI * 2f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.16f, 0.17f, 0.21f, 0.75f), new Color(0.3f, 0.32f, 0.38f, 0.7f)); ((MainModule)(ref main)).maxParticles = 70; ShapeModule shape = _nube.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 16f; ((ShapeModule)(ref shape)).rotation = new Vector3(90f, 0f, 0f); EmissionModule emission = _nube.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(14f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)18) }); RotationOverLifetimeModule rotationOverLifetime = _nube.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = new MinMaxCurve(-0.15f, 0.15f); VelocityOverLifetimeModule velocityOverLifetime = _nube.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalY = new MinMaxCurve(0.08f); ColorOverLifetimeModule colorOverLifetime = _nube.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.2f), new GradientAlphaKey(1f, 0.75f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val2); SizeOverLifetimeModule sizeOverLifetime = _nube.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.5f), new Keyframe(0.3f, 1f), new Keyframe(1f, 1.15f) })); ParticleSystemRenderer component = val.GetComponent(); _matNube = Vfx.NewMaterial(TexNube(), Color.white); ((Renderer)component).sharedMaterial = _matNube; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; _nube.Play(); _luz = LucesMagicas.Registrar(val.AddComponent()); _luz.color = new Color(0.65f, 0.78f, 1f); _luz.range = 45f; _luz.intensity = 0f; } private static Texture2D TexNube() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_texNube != (Object)null) { return _texNube; } _texNube = new Texture2D(64, 64, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1 }; for (int i = 0; i < 64; i++) { for (int j = 0; j < 64; j++) { float num = ((float)j - 32f) / 32f; float num2 = ((float)i - 32f) / 32f; float num3 = Mathf.Sqrt(num * num + num2 * num2); float num4 = Mathf.PerlinNoise((float)j * 0.12f, (float)i * 0.12f) * 0.6f + Mathf.PerlinNoise((float)j * 0.3f, (float)i * 0.3f) * 0.4f; float num5 = Mathf.Clamp01(1f - num3) * Mathf.Lerp(0.55f, 1f, num4); num5 *= num5; _texNube.SetPixel(j, i, new Color(1f, 1f, 1f, num5)); } } _texNube.Apply(); return _texNube; } private void Update() { //IL_0192: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: 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_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03cc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_p == (Object)null || ((Character)_p).IsDead()) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float time = Time.time; if ((Object)(object)_luz != (Object)null) { if (!_apagando && time >= _proximoInterno) { _proximoInterno = time + Random.Range(0.6f, 1.6f); _flash = Random.Range(2.5f, 5f); if (Random.value < 0.5f) { Vector3 val = ((Component)this).transform.position + Vector3.up * 22f; Vector2 val2 = Random.insideUnitCircle * 12f; Vector2 val3 = Random.insideUnitCircle * 12f; Rayo.Bolt(val + new Vector3(val2.x, Random.Range(-1f, 1f), val2.y), val + new Vector3(val3.x, Random.Range(-1f, 1f), val3.y), Rayo.Azul, 0.8f, 0.2f); } } _flash = Mathf.MoveTowards(_flash, 0f, Time.deltaTime * 14f); _luz.intensity = _flash; } if (_apagando) { return; } if (time >= _proximoMojar) { _proximoMojar = time + 1.5f; foreach (Character item in Fx.EnemiesInRadius(_p, ((Component)_p).transform.position, 25f)) { Fx.AddSE(item, "Wet"); } } if (_caeEn > 0f && time >= _caeEn) { _caeEn = -1f; Caer(_objetivo, _quedan == 1); _quedan--; } if (_quedan <= 0 || time >= _fin) { Apagar(); return; } if (_caeEn < 0f && time >= _proximo) { Character val4 = Elegir(); if ((Object)(object)val4 != (Object)null) { _ultimo = val4; _objetivo = ((Component)val4).transform.position; _caeEn = time + 0.45f; _proximo = time + 2f; FuegoVfx.Destello(_objetivo + Vector3.up * 0.3f, 6f, 2.5f, 0.45f, (Color?)new Color(0.6f, 0.75f, 1f)); Rayo.Sparks(_objetivo, Rayo.Azul, 5, 0.8f); } else { _proximo = time + 0.5f; } } if (_caeEn < 0f && time >= _proximoDecor) { _proximoDecor = time + Random.Range(3.5f, 6f); _cerca.Clear(); _cerca.AddRange(Fx.EnemiesInRadius(_p, ((Component)_p).transform.position, 25f)); if (_cerca.Count == 0) { Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val5 = ((Vector2)(ref insideUnitCircle)).normalized * Random.Range(8f, 25f); Visual(Suelo(((Component)_p).transform.position + new Vector3(val5.x, 0f, val5.y)), 1.2f); } } } private Character Elegir() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) _cerca.Clear(); _cerca.AddRange(Fx.EnemiesInRadius(_p, ((Component)_p).transform.position, 25f)); if (_cerca.Count == 0) { return null; } if (_cerca.Count > 1) { _cerca.Remove(_ultimo); } return _cerca[Random.Range(0, _cerca.Count)]; } private void Caer(Vector3 punto, bool ultimo) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) float escala = (ultimo ? 1.8f : 1f); Visual(punto, escala); Fx.DamageArea(_p, punto, ultimo ? 4f : 2.5f, ultimo ? Mult(_dano, 1.5f) : _dano, _skill, 0f, 2f); if (ultimo) { Rayo.EikthyrStrike(punto, 1.2f); } } private static DamageTypes Mult(DamageTypes d, float m) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((DamageTypes)(ref d)).Modify(m); return d; } private void Visual(Vector3 punto, float escala) { //IL_0000: 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_002c: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = new Vector3(punto.x + Random.Range(-3f, 3f), ((Component)this).transform.position.y + 22f, punto.z + Random.Range(-3f, 3f)); Fx.Visual("fx_Lightning", punto); Rayo.Bolt(val, punto, Rayo.Azul, 1.8f * escala, 0.4f); FuegoVfx.Destello(punto, 25f * escala, 6f * escala, 0.3f, (Color?)new Color(0.6f, 0.75f, 1f)); Rayo.Sparks(punto, Rayo.Azul, Mathf.RoundToInt(8f * escala), 1.4f * escala); _flash = 6f * escala; } private static Vector3 Suelo(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(p + Vector3.up * 50f, Vector3.down, ref val, 120f, -1, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point; } return p; } private void Apagar() { if (!_apagando) { _apagando = true; _flash = 0f; if ((Object)(object)_nube != (Object)null) { _nube.Stop(true, (ParticleSystemStopBehavior)1); } Object.Destroy((Object)(object)((Component)this).gameObject, 8f); } } private void OnDestroy() { if ((Object)(object)_matNube != (Object)null) { Object.Destroy((Object)(object)_matNube); } } private void OnGUI() { //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_003b: 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_004e: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) if (!_apagando && !((Object)(object)_p != (Object)(object)Player.m_localPlayer)) { if (_estilo == null) { _estilo = new GUIStyle(GUI.skin.label) { fontSize = 22, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; } if (_textoDe != _quedan) { _textoDe = _quedan; _texto = Tr.Get("magia_cumulonimbus_bolts", new object[2] { _quedan, _total }); } Rect val = default(Rect); ((Rect)(ref val))..ctor((float)Screen.width / 2f - 80f, 70f, 160f, 34f); _estilo.normal.textColor = new Color(0f, 0f, 0f, 0.7f); GUI.Label(new Rect(((Rect)(ref val)).x + 2f, ((Rect)(ref val)).y + 2f, ((Rect)(ref val)).width, ((Rect)(ref val)).height), _texto, _estilo); _estilo.normal.textColor = new Color(0.7f, 0.85f, 1f); GUI.Label(val, _texto, _estilo); } } } public static class Desgaste { public static void Configurar(SharedData shared, float max, float porNivel) { shared.m_useDurability = true; shared.m_canBeReparied = true; shared.m_destroyBroken = false; shared.m_maxDurability = max; shared.m_durabilityPerLevel = porNivel; shared.m_useDurabilityDrain = 1f; } public static bool Roto(ItemData w) { if (w != null && w.m_shared.m_useDurability && w.m_durability <= 0f && (Object)(object)w.m_dropPrefab != (Object)null) { return ((Object)w.m_dropPrefab).name.StartsWith("MT_"); } return false; } public static void AlLanzar(Player p, Spell s) { ItemData currentWeapon = ((Humanoid)p).GetCurrentWeapon(); if (currentWeapon != null && !((Object)(object)currentWeapon.m_dropPrefab == (Object)null) && ((Object)currentWeapon.m_dropPrefab).name.StartsWith("MT_") && currentWeapon.m_shared.m_useDurability && !(((Object)currentWeapon.m_dropPrefab).name == "MT_CanonMk1")) { currentWeapon.m_durability = Mathf.Max(0f, currentWeapon.m_durability - (1f + 0.5f * (float)s.Rank) * Game.m_durabilityRate); } } } public static class DiarioEstudios { private static readonly string[][] Guardianes = new string[4][] { new string[2] { "defeated_eikthyr", "guardian_eikthyr" }, new string[2] { "defeated_gdking", "guardian_elder" }, new string[2] { "defeated_bonemass", "guardian_bonemass" }, new string[2] { "defeated_dragon", "guardian_moder" } }; public static void Registrar() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown Paginas.Registrar(new DiarioPagina { Id = "estudios", TituloKey = "diario_tab_studies", Orden = 25, Dibujar = Dibujar }); ExtrasDiario.Cuerpo.Add(ExtrasCuerpo); ExtrasDiario.NotasReceta["MT_ArmaduraMk1"] = (Player p) => Tr.Get("diario_mk1_note_armor"); ExtrasDiario.NotasReceta["MT_CanonMk1"] = (Player p) => Tr.Get("diario_mk1_note_cannon"); ExtrasDiario.NotasReceta["MT_EscudoMk1"] = (Player p) => Tr.Get("diario_mk1_note_shield"); ExtrasDiario.NotasReceta["MT_PapelPergamino"] = (Player p) => Tr.Get("diario_note_paper"); ExtrasDiario.NotasReceta["MT_TintaMagica"] = (Player p) => Tr.Get("diario_note_ink"); ExtrasDiario.NotasReceta["MT_PergaminoCuracion"] = (Player p) => Tr.Get("diario_kind_consumable") + "\n" + NotaPergamino(p, "curar", "diario_note_scroll_heal"); ExtrasDiario.NotasReceta["MT_PergaminoDesintoxicacion"] = (Player p) => Tr.Get("diario_kind_consumable") + "\n" + NotaPergamino(p, "antidoto", "diario_note_scroll_detox"); ExtrasDiario.NotasReceta["MT_PergaminoGravedad"] = (Player p) => Tr.Get("diario_kind_knowledge"); } private static string NotaPergamino(Player p, string hechizo, string efectoKey) { Spell spell = SpellBook.All.Find((Spell x) => x.Id == hechizo); string text = ((spell != null) ? spell.Name : hechizo); return Tr.Get(efectoKey) + "\n" + Tr.Get(Pergaminos.Knows(p, hechizo) ? "diario_note_scroll_can_write" : "diario_note_scroll_need", new object[1] { text }) + "\n" + Tr.Get("diario_note_scroll_mana", new object[1] { Mathf.CeilToInt(PergaminoConsumibleEscribirPatch.Costo(p, spell)) }); } public static void EscaleraGuardianes(Player p, DiarioEscritor e) { //IL_00db: 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) float escalaActual = DiarioEscritor.EscalaActual; float num = 56f * escalaActual; float num2 = 10f * escalaActual; float num3 = (float)Guardianes.Length * num + (float)(Guardianes.Length - 1) * num2; float num4 = e.X + (e.Ancho - num3) / 2f; if (DiarioEscritor.Visible(e.Y, num)) { string[][] guardianes = Guardianes; foreach (string[] array in guardianes) { bool flag = Escuelas.Defeated(p, array[0]); RecortesDiario.Dibujar(new Rect(num4, e.Y, num, num), MTMagiaPlugin.Icon(array[1]), flag ? 1f : 0.3f, -1.4f); num4 += num + num2; } } e.Y += num + 4f * escalaActual; e.Parrafo(Tr.Get("diario_guardians_hint"), (Color?)DiarioEscritor.TintaSuave, 13, 0f); } public static string MetaMagia(Player p) { Escuela? escuela = null; float num = -1f; Escuela[] all = Escuelas.All; foreach (Escuela e in all) { int num2 = Escuelas.Rank(p, e); if (num2 < 6 && (num2 != 0 || SpellBook.All.Any((Spell s) => s.School == e && Pergaminos.Knows(p, s.Id)))) { float num3 = MagiaLogros.CastsDesde(p, e, num2) / Mathf.Max(1f, (float)MagiaLogros.Needed[num2 + 1]); if (num3 > num) { num = num3; escuela = e; } } } if (!escuela.HasValue) { if (!Aprendizaje.MagiaDespierta(p)) { return Tr.Get("diario_goal_magic_awaken"); } return Tr.Get("diario_goal_magic_first"); } Escuela value = escuela.Value; int num4 = Escuelas.Rank(p, value); int num5 = MagiaLogros.Needed[num4 + 1]; int num6 = (int)MagiaLogros.CastsDesde(p, value, num4); Escuelas.RankFromLevel(p, value, out var falta); string text = falta switch { RangoRules.Falta.Reserva => Tr.Get("diario_goal_magic_reserve", new object[1] { RangoRules.Reserva[num4 + 1] }), RangoRules.Falta.Jefe => Tr.Get("diario_goal_magic_boss"), RangoRules.Falta.Enemigos => Tr.Get("diario_goal_magic_kills", new object[2] { MagiaLogros.Kills(p, value), Escuelas.KillsNecesarios(value) }), _ => "", }; return Tr.Get("diario_goal_magic", new object[4] { Escuelas.Name(value), Rangos.Name(num4 + 1), Mathf.Min(num6, num5), num5 }) + text + ((falta == RangoRules.Falta.Lanzamientos) ? ConQue(p, value, num4) : ""); } private static string ConQue(Player p, Escuela esc, int rango) { List list = new List(); foreach (Spell item in Caster.Learned(p)) { if ((item.School == esc || item.School2 == esc) && item.Rank >= rango) { list.Add(item.Name); } } if (list.Count == 0) { return Tr.Get("diario_goal_magic_learn", new object[1] { Rangos.Name(rango) }); } return Tr.Get("diario_goal_magic_with", new object[1] { string.Join(", ", list.Take(4).ToArray()) }); } private static string Pista(Player p, Spell s) { if (s.School == Escuela.Gravedad) { return Tr.Get("diario_hint_gravity_scroll"); } int num = Escuelas.Rank(p, s.School); if (s.Rank <= num) { int num2 = Mathf.CeilToInt(Mathf.Max(0f, Practica.Siguiente(p, s.School) - Practica.Progreso(p, s.School))); return Tr.Get("diario_hint_practice", new object[1] { num2 }); } if (s.Rank >= 5) { return Tr.Get("diario_hint_grimoire"); } string text = ((s.Rank <= 0) ? "diario_biome_meadows" : ((s.Rank <= 1) ? "diario_biome_swamp" : ((s.Rank <= 2) ? "diario_biome_plains" : "diario_biome_mist"))); return Tr.Get("diario_hint_runes", new object[1] { Tr.Get(text) }); } private static void Dibujar(Player p, DiarioEscritor e) { //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) e.Titulo(Tr.Get("diario_tab_studies")); HashSet known = Pergaminos.Known(p); int num = SpellBook.All.Count((Spell x) => known.Contains(x.Id)); int count = SpellBook.All.Count; e.Meta((!Aprendizaje.MagiaDespierta(p)) ? Tr.Get("diario_goal_magic_awaken") : ((num == 0) ? Tr.Get("diario_goal_magic_first") : ((num >= count) ? Tr.Get("diario_goal_studies_done") : Tr.Get("diario_goal_studies", new object[1] { count - num })))); e.Dato(Tr.Get("diario_studies_known"), num + " / " + count, (Color?)null); e.Dato(Tr.Get("diario_studies_runes"), CaminoMago.PiedrasLeidas(p).ToString(CultureInfo.InvariantCulture), (Color?)null); Laminas.Dibujar(p, e, "pagina_runas"); Escuela[] all = Escuelas.All; foreach (Escuela esc in all) { List list = (from x in SpellBook.All where x.School == esc orderby x.Rank select x).ToList(); if (list.Count == 0) { continue; } int num3 = list.Count((Spell x) => known.Contains(x.Id)); e.Subtitulo($"{Escuelas.Name(esc)} · {num3}/{list.Count}", (Color?)null); foreach (Spell item in list) { if (known.Contains(item.Id)) { e.Dato(item.Name, Rangos.Name(item.Rank), (Color?)DiarioEscritor.Tinta); } else { e.Dato("???", Pista(p, item), (Color?)DiarioEscritor.TintaSuave); } } } } private static void ExtrasCuerpo(Player p, DiarioEscritor e) { //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) bool flag = Pergaminos.Knows(p, "sueno_reparador"); bool flag2 = Escuelas.Rank(p, Escuela.Tierra) >= 3; if (flag || flag2) { e.Subtitulo(Tr.Get("diario_body_magic"), (Color?)null); if (flag) { e.Dato(Tr.Get("magia_spell_sueno_reparador"), Tr.Get(SuenoReparador.UsadoHoy(p) ? "diario_used_today" : "diario_available"), (Color?)null); } if (flag2) { e.Dato(Tr.Get("magia_mk1_daily"), Tr.Get(Mk1Diaria.UsadaHoy(p) ? "diario_used_today" : "diario_available"), (Color?)null); } } if (Talento.IsLaplace(p) || !MTMagiaPlugin.LaplaceCaminoActivo.Value) { return; } e.Subtitulo(Tr.Get("diario_mage_path"), (Color?)null); if (CaminoMago.Abierto(p)) { e.Parrafo(Tr.Get("diario_mage_path_ritual"), (Color?)DiarioEscritor.TintaAzul, 15, 0f); return; } e.Parrafo(Tr.Get("diario_mage_path_intro"), (Color?)DiarioEscritor.TintaSuave, 14, 0f); e.Requisito(Tr.Get("core_skill_reserva"), ((Character)p).GetSkillLevel(MTSkills.Reserva), MTMagiaPlugin.LaplaceCaminoReserva.Value); HashSet conocidos = Pergaminos.Known(p); e.Requisito(Tr.Get("diario_studies_known"), (float)SpellBook.All.Count((Spell x) => conocidos.Contains(x.Id)), (float)MTMagiaPlugin.LaplaceCaminoHechizos.Value); e.Requisito(Tr.Get("diario_studies_runes"), (float)CaminoMago.PiedrasLeidas(p), (float)MTMagiaPlugin.LaplaceCaminoRunas.Value); } } public static class DiarioMagia { private static readonly string[] OrdenBotin = new string[18] { "MT_BastonAprendiz", "MT_BastonAdepto", "MT_BastonMaestro", "MT_BastonArchimago", "MT_BastonAgua", "MT_BastonSilfide", "MT_BastonRudeus", "MT_BastonTempestad", "MT_BastonAquaHeartia", "MT_BastonAzurith", "MT_BastonZefiria", "MT_BastonNihilum", "MT_BastonIgnivar", "MT_BastonAurelia", "MT_PergaminoMagiaRara", "MT_PergaminoGravedad", "MT_GrimorioRunico", "MT_GranGrimorio" }; private static readonly Dictionary FuentesBotin = new Dictionary(); private static string _idiomaBotin; public static void Registrar() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown Paginas.Registrar(new DiarioPagina { Id = "magia", TituloKey = "diario_tab_magic", Orden = 20, Dibujar = Dibujar }); Paginas.Registrar(new DiarioPagina { Id = "botin", TituloKey = "diario_tab_loot", Orden = 95, Dibujar = DibujarBotin }); DiarioVentana.OtroMenuAbierto = () => Caster.MenuOpen; DiarioEstudios.Registrar(); string[] array = new string[4] { "MT_ArmaduraMk1", "MT_CascoMk1", "MT_CorazaMk1", "MT_GrebasMk1" }; for (int num = 0; num < array.Length; num++) { Recetario.RegistrarLamina(array[num], (Func)(() => MTMagiaPlugin.Icon("lamina_mk1")), "diario_mk1_sheet"); } } private static string Fuentes(string item) { if (_idiomaBotin != Tr.Current) { FuentesBotin.Clear(); _idiomaBotin = Tr.Current; } if (FuentesBotin.TryGetValue(item, out var value)) { return value; } List> list = new List>(); foreach (KeyValuePair item2 in BastonesDropPatch.Table) { BastonesDropPatch.Drop[] value2 = item2.Value; foreach (BastonesDropPatch.Drop drop in value2) { if (drop.Item == item) { object obj; if (!((Object)(object)ZNetScene.instance != (Object)null)) { obj = null; } else { GameObject prefab = ZNetScene.instance.GetPrefab(item2.Key); obj = ((prefab != null) ? prefab.GetComponent() : null); } Character val = (Character)obj; string text = (((Object)(object)val != (Object)null) ? Tr.Localize(val.m_name) : item2.Key); list.Add(new KeyValuePair(drop.Chance, text + " " + (drop.Chance * 100f).ToString("0.#", CultureInfo.InvariantCulture) + " %")); } } } value = string.Join(" · ", (from x in list orderby x.Key descending select x.Value).Distinct().ToArray()); FuentesBotin[item] = value; return value; } private static void DibujarBotin(Player p, DiarioEscritor e) { //IL_001b: 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_00c2: 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_01e5: 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) e.Titulo(Tr.Get("diario_tab_loot")); e.Parrafo(Tr.Get("diario_loot_intro"), (Color?)DiarioEscritor.TintaSuave, 15, 0f); if ((Object)(object)ObjectDB.instance == (Object)null) { return; } float num = e.S(1f); float num2 = 52f; string[] ordenBotin = OrdenBotin; foreach (string text in ordenBotin) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(text); ItemDrop val = ((itemPrefab != null) ? itemPrefab.GetComponent() : null); if (!((Object)(object)val == (Object)null)) { SharedData shared = val.m_itemData.m_shared; float y = e.Y; if (DiarioEscritor.Visible(e.Y, num2 * num)) { RecortesDiario.Dibujar(new Rect(e.X, e.Y, num2 * num, num2 * num), (shared.m_icons != null && shared.m_icons.Length != 0) ? shared.m_icons[0] : null, 1f, -1.4f); } float x = e.X; float ancho = e.Ancho; e.X += (num2 + 12f) * num; e.Ancho -= (num2 + 12f) * num; e.Parrafo("" + Tr.Localize(shared.m_name) + "", (Color?)DiarioEscritor.Tinta, 17, 0f); switch (text) { case "MT_PergaminoMagiaRara": case "MT_PergaminoGravedad": case "MT_GrimorioRunico": case "MT_GranGrimorio": e.Parrafo(Tr.Get("diario_kind_knowledge"), (Color?)DiarioEscritor.TintaAzul, 14, 0f); break; } string text2 = Fuentes(text); if (text2.Length > 0) { e.Parrafo(Tr.Get("diario_loot_from", new object[1] { text2 }), (Color?)DiarioEscritor.Tinta, 14, 0f); } if (text == "MT_PergaminoMagiaRara" && MTMagiaPlugin.PrecioPergamino.Value > 0) { e.Parrafo(Tr.Get("diario_loot_haldor", new object[1] { MTMagiaPlugin.PrecioPergamino.Value }), (Color?)DiarioEscritor.TintaOro, 14, 0f); } e.X = x; e.Ancho = ancho; e.Y = Mathf.Max(e.Y, y + (num2 + 6f) * num); e.Espacio(10f); } } } public static string NameKey(Escuela e) { return e switch { Escuela.Fuego => "magia_fire", Escuela.Agua => "magia_water", Escuela.Viento => "magia_wind", Escuela.Tierra => "magia_earth", Escuela.Sanacion => "magia_healing", Escuela.Desintoxicacion => "magia_detox", Escuela.Barrera => "magia_barrier", Escuela.Invocacion => "magia_summoning", Escuela.Gravedad => "magia_gravity", _ => null, }; } private static string Arg(Escuela e) { if (NameKey(e) == null) { return e.ToString(); } return "@" + NameKey(e); } public static void RangoSubido(Player p, Escuela e, int rango) { Cronica.Anotar(p, "cronica_magic_rank", new string[2] { Arg(e), "@core_rank_" + rango.ToString(CultureInfo.InvariantCulture) }); Laminas.Desbloquear(p, "pagina_rangos"); } public static void HechizoAprendido(Player p, Spell s) { if (s != null) { Cronica.AnotarVariado(p, "cronica_spell_learned", 3, new string[2] { "@magia_spell_" + s.Id, Arg(s.School) }); } } private static void Dibujar(Player p, DiarioEscritor e) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0455: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) e.Titulo(Tr.Get("diario_tab_magic")); e.Meta(DiarioEstudios.MetaMagia(p)); HashSet known = Pergaminos.Known(p); e.Parrafo(Tr.Get("diario_magic_intro", new object[2] { known.Count, SpellBook.All.Count }), (Color?)DiarioEscritor.TintaSuave, 15, 0f); e.Subtitulo(Tr.Get("diario_magic_howto_title"), (Color?)null); e.Parrafo(Tr.Get("diario_magic_howto"), (Color?)DiarioEscritor.Tinta, 14, 0f); DiarioEstudios.EscaleraGuardianes(p, e); Laminas.Dibujar(p, e, "pagina_mana"); float escalaActual = DiarioEscritor.EscalaActual; int num = 0; Escuela[] all = Escuelas.All; foreach (Escuela esc in all) { List list = (from spell in SpellBook.All where spell.School == esc && known.Contains(spell.Id) orderby spell.Rank select spell).ToList(); int num2 = Escuelas.Rank(p, esc); if (list.Count <= 0 && num2 <= 0) { num++; continue; } e.Espacio(12f); float y = e.Y; Sprite val = MTMagiaPlugin.Icon(Caster.SchoolIconName(esc)); RecortesDiario.Dibujar(new Rect(e.X, e.Y + 4f * escalaActual, 34f * escalaActual, 34f * escalaActual), val, 1f, -1.4f); float x = e.X; float ancho = e.Ancho; e.X += 44f * escalaActual; e.Ancho -= 44f * escalaActual; e.Parrafo("" + Escuelas.Name(esc) + "", (Color?)DiarioEscritor.Tinta, 20, 0f); e.Dato(Tr.Get("diario_current_rank"), Rangos.Name(num2), (Color?)null); e.Dato(Tr.Get("diario_magic_power"), "×" + Escuelas.Power(p, esc).ToString("0.00", CultureInfo.InvariantCulture), (Color?)DiarioEscritor.TintaAzul); if (num2 >= 6) { e.Parrafo(Tr.Get("diario_rank_max"), (Color?)DiarioEscritor.TintaOro, 14, 0f); } else { int num3 = MagiaLogros.Needed[num2 + 1]; int num4 = (int)MagiaLogros.CastsDesde(p, esc, num2); e.Dato(Tr.Get("diario_target_rank"), Rangos.Name(num2 + 1), (Color?)null); e.Parrafo(Tr.Get("diario_practice_rank", new object[1] { Rangos.Name(num2) }), (Color?)DiarioEscritor.TintaSuave, 14, 0f); e.Requisito(Tr.Get("diario_casts_next", new object[1] { Rangos.Name(num2 + 1) }), (float)num4, (float)num3); Requisitos(p, e, esc, num2 + 1); } if (list.Count > 0) { e.Espacio(8f); foreach (Spell item in list) { e.Dato(item.Name, Rangos.Name(item.Rank), (Color?)DiarioEscritor.TintaSuave); } } e.X = x; e.Ancho = ancho; e.Y = Mathf.Max(e.Y, y + 42f * escalaActual); e.Espacio(8f); e.Raya(e.X, e.Y, e.Ancho, DiarioEscritor.TintaSuave, 0.5f); } if (num > 0) { e.Parrafo(Tr.Get("diario_undiscovered_schools", new object[1] { num }), (Color?)DiarioEscritor.TintaSuave, 15, 0f); } Laminas.Dibujar(p, e, "pagina_rangos"); Laminas.Dibujar(p, e, "pagina_guardianes"); } private static void Requisitos(Player p, DiarioEscritor e, Escuela esc, int siguiente) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) if (siguiente == 1 && Escuelas.KillsNecesarios(esc) > 0) { e.Requisito(Tr.Get("diario_magic_kills"), (float)MagiaLogros.Kills(p, esc), (float)Escuelas.KillsNecesarios(esc)); } float num = RangoRules.Reserva[Mathf.Clamp(siguiente, 0, 6)]; if (num > 0f) { e.Requisito(Tr.Get("core_skill_reserva"), ((Character)p).GetSkillLevel(MTSkills.Reserva), num); } string text = Escuelas.JefesPorRango()[Mathf.Clamp(siguiente, 0, 6)]; if (string.IsNullOrEmpty(text)) { return; } bool flag = false; string[] array = text.Split(new char[1] { '|' }); foreach (string text2 in array) { flag |= Escuelas.Defeated(p, text2.Trim()); } if (!flag) { List list = new List(); array = text.Split(new char[1] { '|' }); foreach (string text3 in array) { list.Add(Tr.Localize(EventosCore.NombreJefe(text3.Trim()))); } e.Parrafo(Tr.Get("diario_need_boss", new object[1] { string.Join(" / ", list.ToArray()) }), (Color?)DiarioEscritor.TintaRoja, 14, 0f); } } } public enum Escuela { Fuego, Agua, Viento, Tierra, Sanacion, Desintoxicacion, Barrera, Invocacion, Sangre, Gravedad } public static class Escuelas { public static readonly Escuela[] All = ((Escuela[])Enum.GetValues(typeof(Escuela))).Where((Escuela e) => e != Escuela.Sangre).ToArray(); public const int Principiante = 0; public const int Intermedio = 1; public const int Avanzado = 2; public const int Santo = 3; public const int Rey = 4; public const int Emperador = 5; public const int Dios = 6; private static readonly Dictionary _killsNecesarios = new Dictionary(); private static string[] _jefes; private static string _jefesCfg; private static readonly string[] _rankKeys = new string[16]; private static readonly int[] _rankFrame = new int[16]; private static readonly int[] _rankVal = new int[16]; private static Player _rankP; private static readonly float[] PowerByRank = new float[7] { 0f, 0.1f, 0.2f, 0.35f, 0.5f, 0.7f, 1f }; private static readonly float[] CostCutByRank = new float[7] { 0f, 0.03f, 0.06f, 0.1f, 0.14f, 0.18f, 0.22f }; public static string[] RankNames => Rangos.Names; public static void Register() { Especialidades.AttackMagicLevel = (Player p) => new Escuela[5] { Escuela.Fuego, Escuela.Agua, Escuela.Viento, Escuela.Tierra, Escuela.Gravedad }.Max((Escuela e) => Level(p, e)); Especialidades.SupportMagicLevel = (Player p) => new Escuela[5] { Escuela.Sanacion, Escuela.Desintoxicacion, Escuela.Barrera, Escuela.Invocacion, Escuela.Sangre }.Max((Escuela e) => Level(p, e)); } public static SkillType Skill(Escuela e) { if (e == Escuela.Sangre) { return (SkillType)10; } return (SkillType)9; } public static string Name(Escuela e) { return e switch { Escuela.Fuego => Tr.Get("magia_fire"), Escuela.Agua => Tr.Get("magia_water"), Escuela.Viento => Tr.Get("magia_wind"), Escuela.Tierra => Tr.Get("magia_earth"), Escuela.Sanacion => Tr.Get("magia_healing"), Escuela.Desintoxicacion => Tr.Get("magia_detox"), Escuela.Barrera => Tr.Get("magia_barrier"), Escuela.Invocacion => Tr.Get("magia_summoning"), Escuela.Gravedad => Tr.Get("magia_gravity"), _ => e.ToString(), }; } public static string Arg(string a) { return a.ToLowerInvariant() switch { "fire" => "Fuego", "water" => "Agua", "wind" => "Viento", "earth" => "Tierra", "gravity" => "Gravedad", "healing" => "Sanacion", "detox" => "Desintoxicacion", "barrier" => "Barrera", "summoning" => "Invocacion", _ => a, }; } public static float Level(Player p, Escuela e) { return (float)Rank(p, e) * 100f / 6f; } public static int RankFromLevel(Player p, Escuela e) { RangoRules.Falta falta; return RankFromLevel(p, e, out falta); } public static int RankFromLevel(Player p, Escuela e, out RangoRules.Falta falta) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) string[] jefes = JefesPorRango(); return RangoRules.Rango((int r) => MagiaLogros.CastsDesde(p, e, r), MagiaLogros.Needed, MagiaLogros.Kills(p, e), KillsNecesarios(e), (int r) => JefeOk(p, jefes[r]), ((Character)p).GetSkillLevel(MTSkills.Reserva), out falta); } public static int KillsNecesarios(Escuela e) { if (_killsNecesarios.TryGetValue(e, out var value)) { return value; } if (SpellBook.All.Count == 0) { return 25; } value = (SpellBook.All.Any((Spell s) => (s.School == e || s.School2 == e) && s.Rol == Rol.Ofensivo) ? 25 : 0); _killsNecesarios[e] = value; return value; } public static string[] JefesPorRango() { string text = MTMagiaPlugin.JefesPorRango?.Value; if (_jefes != null && _jefesCfg == text) { return _jefes; } _jefesCfg = text; _jefes = JefesDe(text); return _jefes; } private static string[] JefesDe(string cfg) { if (string.IsNullOrEmpty(cfg)) { return RangoRules.JefesPorDefecto; } string[] array = cfg.Split(new char[1] { ';' }); string[] array2 = new string[RangoRules.JefesPorDefecto.Length]; for (int i = 0; i < array2.Length; i++) { array2[i] = ((i < array.Length) ? array[i].Trim() : ""); } return array2; } private static bool JefeOk(Player p, string req) { if (string.IsNullOrEmpty(req)) { return true; } string[] array = req.Split(new char[1] { '|' }); foreach (string text in array) { if (Defeated(p, text.Trim())) { return true; } } return false; } public static bool Defeated(Player p, string key) { if (!Gremio.TieneJefe(p, key)) { if ((Object)(object)ZoneSystem.instance != (Object)null) { return ZoneSystem.instance.GetGlobalKey(key); } return false; } return true; } private static string RankKey(Escuela e) { return _rankKeys[(int)e] ?? (_rankKeys[(int)e] = "MT.Magia.Rango." + e); } public static int StoredRank(Player p, Escuela e) { if (!p.m_customData.TryGetValue(RankKey(e), out var value) || !int.TryParse(value, out var result)) { return 0; } return result; } public static int Rank(Player p, Escuela e) { int num = Time.frameCount + 1; if ((Object)(object)p == (Object)(object)_rankP && _rankFrame[(int)e] == num) { return _rankVal[(int)e]; } if ((Object)(object)p != (Object)(object)_rankP) { _rankP = p; Array.Clear(_rankFrame, 0, _rankFrame.Length); } _rankFrame[(int)e] = num; return _rankVal[(int)e] = Mathf.Max(StoredRank(p, e), RankFromLevel(p, e)); } private static void InvalidarRango() { Array.Clear(_rankFrame, 0, _rankFrame.Length); } public static void SetRank(Player p, Escuela e, int rank) { p.m_customData[RankKey(e)] = rank.ToString(); InvalidarRango(); } public static bool UpdateRank(Player p, Escuela e) { int num = RankFromLevel(p, e); if (num <= StoredRank(p, e)) { return false; } p.m_customData[RankKey(e)] = num.ToString(); InvalidarRango(); return true; } public static float Power(Player p, Escuela e) { return 1f + PowerByRank[Rank(p, e)]; } public static float CostCut(Player p, Escuela e) { return CostCutByRank[Rank(p, e)]; } } public static class Favoritos { public const int Slots = 9; private const string Key = "MT.Magia.Favoritos"; private static readonly KeyCode[] Keys; public static bool AltHeld() { if (!ZInput.GetKey((KeyCode)308, false)) { return ZInput.GetKey((KeyCode)307, false); } return true; } public static int Pressed() { if (!AltHeld()) { return -1; } for (int i = 0; i < 9; i++) { if (ZInput.GetKeyDown(Keys[i], false)) { return i; } } return -1; } public static string[] Get(Player p) { string[] array = new string[9]; if ((Object)(object)p != (Object)null && p.m_customData.TryGetValue("MT.Magia.Favoritos", out var value)) { string[] array2 = value.Split(new char[1] { ',' }); for (int i = 0; i < 9 && i < array2.Length; i++) { array[i] = array2[i]; } } return array; } public static void Set(Player p, int slot, string spellId) { string[] array = Get(p); for (int i = 0; i < 9; i++) { if (array[i] == spellId) { array[i] = ""; } } array[slot] = spellId; p.m_customData["MT.Magia.Favoritos"] = string.Join(",", array); } public static void Clear(Player p, int slot) { string[] array = Get(p); array[slot] = ""; p.m_customData["MT.Magia.Favoritos"] = string.Join(",", array); } public static int SlotOf(Player p, string id) { return Array.IndexOf(Get(p), id); } public static string NameOf(string id) { if (string.IsNullOrEmpty(id)) { return "—"; } Spell spell = SpellBook.All.Find((Spell x) => x.Id == id); if (spell == null) { return "—"; } return spell.Name; } static Favoritos() { KeyCode[] array = new KeyCode[9]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); Keys = (KeyCode[])(object)array; } } [HarmonyPatch(typeof(Player), "UseHotbarItem")] public static class FavoritosHotbarPatch { private static bool Prefix(Player __instance, int index) { if ((Object)(object)__instance == (Object)(object)Player.m_localPlayer && index >= 1 && index <= 9 && Favoritos.AltHeld() && Caster.CanUseFavorites()) { return Caster.Known(__instance).Count <= 0; } return true; } } [HarmonyPatch(typeof(Character), "Damage")] public static class SkeletonFireResistPatch { private static void Prefix(Character __instance, HitData hit) { if (hit != null && !(hit.m_damage.m_fire <= 0f)) { string name = ((Object)((Component)__instance).gameObject).name; if (name.StartsWith("Skeleton") || name.StartsWith("Charred")) { hit.m_damage.m_fire *= MTMagiaPlugin.FuegoContraEsqueletos.Value; } } } } public static class FogataCarga { public const float Maximum = 2f; public const float Seconds = 1f; public static float Target(float held) { return 1f + Math.Max(0f, Math.Min(1f, (held - 0.15f) / 0.85f)); } public static bool Complete(float charge) { return charge >= 1.9999f; } public static string Status(float charge) { if (!Complete(charge)) { return Tr.Get("magia_creating_campfire") + $" · {Math.Max(0f, Math.Min(1f, charge - 1f)):P0}"; } return Tr.Get("magia_full_charge_release_create_campfire"); } } public static class FuegoVfx { public class OndaFuego : MonoBehaviour { public float Radio = 4f; public float Duracion = 0.45f; public Color ColorInicio = Amarillo; public Color ColorFin = Rojo; private LineRenderer _lr; private LineRenderer _lr2; private Material _mat; private float _t; private void Start() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) _mat = Vfx.NewMaterial(Texture2D.whiteTexture, Naranja); _lr = Anillo(0.35f); _lr2 = Anillo(0.12f); Object.Destroy((Object)(object)((Component)this).gameObject, Duracion + 0.1f); } private LineRenderer Anillo(float ancho) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Anillo"); val.transform.SetParent(((Component)this).transform, false); LineRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = _mat; obj.useWorldSpace = false; obj.loop = true; obj.positionCount = 64; obj.widthMultiplier = ancho; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; return obj; } private void Update() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_009e: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) _t += Time.deltaTime; float num = Mathf.Clamp01(_t / Duracion); float num2 = Radio * (1f - (1f - num) * (1f - num)); Vector3 val = default(Vector3); for (int i = 0; i < 64; i++) { float num3 = (float)i / 64f * (float)Math.PI * 2f; ((Vector3)(ref val))..ctor(Mathf.Cos(num3), 0f, Mathf.Sin(num3)); _lr.SetPosition(i, val * num2); _lr2.SetPosition(i, val * num2 * 0.93f); } Color val2 = Color.Lerp(ColorInicio, ColorFin, num); val2.a = 1f - num; _mat.color = val2; if (_mat.HasProperty("_TintColor")) { _mat.SetColor("_TintColor", val2 * 0.5f); } _lr.widthMultiplier = Mathf.Lerp(0.5f, 0.1f, num) * Mathf.Max(1f, Radio / 6f); } private void OnDestroy() { if ((Object)(object)_mat != (Object)null) { Object.Destroy((Object)(object)_mat); } } } public class Apagar : MonoBehaviour { public float Segundos = 0.5f; private Light _l; private float _i0; private float _t; private void Start() { _l = ((Component)this).GetComponent(); _i0 = _l.intensity; Object.Destroy((Object)(object)((Component)this).gameObject, Segundos + 0.05f); } private void Update() { _t += Time.deltaTime; _l.intensity = _i0 * Mathf.Clamp01(1f - _t / Segundos) * (0.85f + 0.15f * Mathf.Sin(Time.time * 40f)); } } private static readonly Color Amarillo = new Color(1f, 0.85f, 0.35f); private static readonly Color Naranja = new Color(1f, 0.45f, 0.08f); private static readonly Color Rojo = new Color(0.85f, 0.12f, 0.03f); public static void Llamas(Vector3 pos, float radio, float segundos, float porSegundo, float tam = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //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) Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(Amarillo.r, Amarillo.g, Amarillo.b, 0.9f), ColorB = new Color(Naranja.r, Naranja.g, Naranja.b, 0.85f), LifeMin = 0.5f, LifeMax = 1f, SpeedMin = 0.5f, SpeedMax = 1.6f, SizeMin = 0.35f * tam, SizeMax = 0.8f * tam, Gravity = -0.35f, Radius = radio, Hemisphere = true, Rate = porSegundo, Duration = segundos, FadeIn = 0.1f, Grow = 0.25f, Max = 3000 }); } public static void Brasas(Vector3 pos, float radio, int cantidad, float fuerza = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(1f, 0.9f, 0.5f, 1f), ColorB = new Color(1f, 0.4f, 0.05f, 1f), LifeMin = 0.6f, LifeMax = 1.4f, SpeedMin = 3f * fuerza, SpeedMax = 9f * fuerza, SizeMin = 0.04f, SizeMax = 0.12f, Gravity = 0.8f, Radius = radio, Hemisphere = true, Burst = cantidad, FadeIn = 0.02f, Grow = 0.4f, Max = 3000 }); } public static void Humo(Vector3 pos, float radio, int cantidad, float segundos = 0.1f, float porSegundo = 0f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(0.18f, 0.15f, 0.13f, 0.55f), ColorB = new Color(0.32f, 0.28f, 0.25f, 0.4f), LifeMin = 2f, LifeMax = 3.5f, SpeedMin = 0.8f, SpeedMax = 2.2f, SizeMin = 0.8f * radio, SizeMax = 1.6f * radio, Gravity = -0.08f, Radius = radio, Hemisphere = true, Burst = cantidad, Rate = porSegundo, Duration = segundos, Additive = false, FadeIn = 0.15f, Grow = 2.5f, Max = 1500 }); } public static void Estallido(Vector3 pos, float radio, int cantidad) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(1f, 0.95f, 0.7f, 1f), ColorB = new Color(1f, 0.5f, 0.1f, 0.9f), LifeMin = 0.35f, LifeMax = 0.7f, SpeedMin = radio * 1.5f, SpeedMax = radio * 3f, SizeMin = radio * 0.35f, SizeMax = radio * 0.7f, Gravity = -0.2f, Radius = radio * 0.2f, Burst = cantidad, FadeIn = 0.02f, Grow = 1.8f, Max = 3000 }); } public static void Columna(Vector3 pos, float radio, float alto, float segundos) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) float num = alto / 0.9f; Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(1f, 0.9f, 0.55f, 1f), ColorB = new Color(1f, 0.35f, 0.05f, 0.9f), LifeMin = 0.7f, LifeMax = 1f, SpeedMin = num * 0.7f, SpeedMax = num, SizeMin = radio * 0.6f, SizeMax = radio * 1.1f, Gravity = 0f, Radius = radio * 0.5f, Hemisphere = true, Rate = 260f, Duration = segundos, FadeIn = 0.05f, Grow = 0.3f, Max = 3000 }); Llamas(pos, radio * 1.3f, segundos, 120f, 1.3f); } public static void Onda(Vector3 pos, float radio, float segundos = 0.45f, Color? inicio = null, Color? fin = null) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_OndaFuego"); val.transform.position = pos + Vector3.up * 0.15f; OndaFuego ondaFuego = val.AddComponent(); ondaFuego.Radio = radio; ondaFuego.Duracion = segundos; if (inicio.HasValue) { ondaFuego.ColorInicio = inicio.Value; } if (fin.HasValue) { ondaFuego.ColorFin = fin.Value; } } } public static void Destello(Vector3 pos, float alcance, float intensidad, float segundos, Color? color = null) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0051: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("MT_DestelloFuego"); val.transform.position = pos + Vector3.up * 1f; Light obj = LucesMagicas.Registrar(val.AddComponent()); obj.color = (Color)(((??)color) ?? new Color(1f, 0.55f, 0.2f)); obj.range = alcance; obj.intensity = intensidad; val.AddComponent().Segundos = segundos; } public static void SolNegroCarga(Vector3 pos, float segundos) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(0.05f, 0f, 0.08f, 0.95f), ColorB = new Color(0.25f, 0.05f, 0.1f, 0.85f), LifeMin = 0.5f, LifeMax = 0.8f, SpeedMin = -12f, SpeedMax = -7f, SizeMin = 0.4f, SizeMax = 0.9f, Radius = 7f, Rate = 220f, Duration = segundos, Additive = false, FadeIn = 0.2f, Grow = 0.2f, Max = 2000 }); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(0f, 0f, 0f, 1f), ColorB = new Color(0.15f, 0.02f, 0.05f, 1f), LifeMin = 0.3f, LifeMax = 0.5f, SpeedMin = 0f, SpeedMax = 0.2f, SizeMin = 2.5f, SizeMax = 3.5f, Radius = 0.3f, Rate = 60f, Duration = segundos, Additive = false, FadeIn = 0.3f, Grow = 1.2f, Max = 200 }); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(1f, 0.4f, 0.05f, 0.9f), ColorB = new Color(0.8f, 0.1f, 0.02f, 0.8f), LifeMin = 0.3f, LifeMax = 0.6f, SpeedMin = 0.2f, SpeedMax = 0.6f, SizeMin = 0.3f, SizeMax = 0.6f, Radius = 2.2f, Rate = 150f, Duration = segundos, FadeIn = 0.1f, Grow = 0.5f, Max = 1000 }); } } public static class Fx { private static readonly HashSet Missing = new HashSet(); public static float? HeatOverride; public static readonly Color Morado = new Color(0.62f, 0.25f, 1f); public static Vector3? OriginOverride; public static Vector3? DirOverride; public static float ScaleOverride = 1f; public static float ChargeMult = 1f; private static readonly Dictionary TipCache = new Dictionary(); private static int _aimMask; private static readonly RaycastHit[] _aimHits = (RaycastHit[])(object)new RaycastHit[64]; private static readonly List _bufPieces = new List(); private static Collider[] _bufArboles = (Collider[])(object)new Collider[128]; private static Collider[] _bufObras = (Collider[])(object)new Collider[128]; private static Collider[] _bufRompibles = (Collider[])(object)new Collider[128]; private static Collider[] _bufObjetos = (Collider[])(object)new Collider[128]; private static readonly HashSet _hechosArboles = new HashSet(); private static readonly HashSet _hechosRompibles = new HashSet(); private static readonly HashSet _hechosObjetos = new HashSet(); private static readonly HashSet _hechosObras = new HashSet(); private static readonly HashSet _hechosMuros = new HashSet(); public static float AreaMult => Mathf.Sqrt(ChargeMult); public static GameObject Prefab(string name) { if (!((Object)(object)ZNetScene.instance != (Object)null)) { return null; } return ZNetScene.instance.GetPrefab(name); } public static GameObject LocalCopy(GameObject prefab, Vector3 pos, Quaternion rot, Transform parent = null) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prefab == (Object)null) { return null; } bool forceDisableInit = ZNetView.m_forceDisableInit; ZNetView.m_forceDisableInit = true; GameObject val; try { val = (((Object)(object)parent != (Object)null) ? Object.Instantiate(prefab, parent) : Object.Instantiate(prefab, pos, rot)); } finally { ZNetView.m_forceDisableInit = forceDisableInit; } MonoBehaviour[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } return val; } public static void Visual(string name, Vector3 pos, float scale = 1f) { //IL_003d: 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_0058: 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) scale *= AreaMult; GameObject val = Prefab(name); if ((Object)(object)val == (Object)null) { if (Missing.Add(name)) { MTMagiaPlugin.Log.LogWarning((object)("Efecto no encontrado: " + name)); } return; } GameObject val2 = Object.Instantiate(val, pos, Quaternion.identity); if (scale != 1f) { Transform transform = val2.transform; transform.localScale *= scale; } if ((Object)(object)val2.GetComponent() == (Object)null || (Object)(object)val2.GetComponent() != (Object)null) { val2.AddComponent().Segundos = 15f; } } public static void Projectile(Player p, string prefabName, Vector3 dir, float speed, DamageTypes damage, SkillType skill, float push = 0f, Vector3? origin = null, string statusEffect = null, float scale = 1f, float aoe = 0f, float stagger = 1f) { //IL_003d: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0058: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: 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_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Expected O, but got Unknown //IL_02c8: 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_027d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Prefab(prefabName); if ((Object)(object)val == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)("Proyectil no encontrado: " + prefabName)); return; } Vector3 val2 = (Vector3)(((??)origin) ?? CastOrigin(p)); GameObject val3 = Object.Instantiate(val, val2, Quaternion.LookRotation(dir)); Transform transform = val3.transform; transform.localScale *= scale * ScaleOverride; Projectile component = val3.GetComponent(); if ((Object)(object)component == (Object)null) { return; } if (prefabName == "MT_BalaPiedra") { Spell s = SpellBook.All.Find((Spell spell) => spell.Id == "bala_piedra"); float num = HeatOverride ?? Mathf.InverseLerp(1f, Caster.MaxCharge(p, s), ChargeMult); ZNetView component2 = val3.GetComponent(); if ((Object)(object)component2 != (Object)null && component2.IsValid()) { component2.GetZDO().Set(StoneBullet.HeatKey, num); } } if (aoe > 0f) { component.m_aoe = Mathf.Max(component.m_aoe, aoe); } if (prefabName.Contains("fireball") || ChargeMult > 1.05f) { component.m_gravity = 0f; component.m_ttl = Mathf.Max(component.m_ttl, 4f + 2f * Mathf.Max(0f, ChargeMult - 1f)); } if (damage.m_fire > 0f) { Tint(val3, FireChargeColor(ChargeMult)); } float num2 = Concentration(p, damage); if (num2 > 1f) { damage.m_fire *= num2; damage.m_lightning *= num2; Tint(val3, Morado); } if (damage.m_lightning > 0f) { Rayo.Trail(val3, (num2 > 1f) ? Morado : Rayo.Azul); } component.m_spawnOnHit = null; if (ChargeMult > 1.2f) { component.m_aoe = Mathf.Max(component.m_aoe, Mathf.Min(6f, (ChargeMult - 1f) * 2.5f)); } if (statusEffect != null) { component.m_statusEffect = statusEffect; } if (damage.m_fire > 0f && MTMagiaPlugin.AllowDestruction.Value) { damage.m_chop = damage.m_fire * 1.5f; } HitData val4 = new HitData { m_damage = damage, m_skill = skill, m_pushForce = push, m_toolTier = 10, m_staggerMultiplier = stagger }; val4.SetAttacker((Character)(object)p); component.Setup((Character)(object)p, dir * speed, 10f, val4, (ItemData)null, (ItemData)null); } private static Color FireChargeColor(float charge) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0048: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.InverseLerp(1f, 4f, charge); if (num < 0.5f) { return Color.Lerp(new Color(1f, 0.45f, 0.1f), new Color(0.25f, 0.45f, 1f), num * 2f); } return Color.Lerp(new Color(0.25f, 0.45f, 1f), Morado, (num - 0.5f) * 2f); } public static float Concentration(Player p, DamageTypes damage) { //IL_0000: 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) Escuela? escuela = ((damage.m_fire > 0f) ? new Escuela?(Escuela.Fuego) : ((damage.m_lightning > 0f) ? new Escuela?(Escuela.Viento) : ((Escuela?)null))); float num = ConcentrationMultiplier(p, escuela, ChargeMult); if (num <= 1f) { return 1f; } ((Character)p).Message((MessageType)1, (escuela == Escuela.Fuego) ? Tr.Get("magia_concentrated_fire") : Tr.Get("magia_concentrated_lightning"), 0, (Sprite)null, false); return num; } public static float ConcentrationMultiplier(Player p, Escuela? school, float charge) { if ((Object)(object)p == (Object)null || charge < 1.5f || !school.HasValue) { return 1f; } int num = Escuelas.Rank(p, school.Value); if (num >= 3) { return 1.25f + 0.1f * (float)(num - 3); } return 1f; } public static void Tint(GameObject go, Color color) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_003c: 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_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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) Light[] componentsInChildren = go.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].color = color; } ParticleSystem[] componentsInChildren2 = go.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { MainModule main = componentsInChildren2[i].main; float r = color.r; float g = color.g; float b = color.b; MinMaxGradient startColor = ((MainModule)(ref main)).startColor; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(r, g, b, ((MinMaxGradient)(ref startColor)).color.a)); } Renderer[] componentsInChildren3 = go.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Material[] materials = componentsInChildren3[i].materials; foreach (Material val in materials) { if (val.HasProperty("_Color")) { val.SetColor("_Color", new Color(color.r, color.g, color.b, val.GetColor("_Color").a)); } if (val.HasProperty("_TintColor")) { val.SetColor("_TintColor", new Color(color.r, color.g, color.b, val.GetColor("_TintColor").a)); } if (val.HasProperty("_EmissionColor")) { Color color2 = val.GetColor("_EmissionColor"); val.SetColor("_EmissionColor", color * Mathf.Max(1f, ((Color)(ref color2)).maxColorComponent)); } } } } public static Vector3 HandOrigin(Player p) { //IL_0024: 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_0029: 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_0037: 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_0056: 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_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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform.forward : ((Component)p).transform.forward); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 0f, val.z); val2 = ((((Vector3)(ref val2)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val2)).normalized : ((Component)p).transform.forward); return ((Component)p).transform.position + Vector3.up * MTMagiaPlugin.OrigenAltura.Value + val2 * MTMagiaPlugin.OrigenAdelante.Value; } public static Vector3 StaffTip(Player p) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_0090: Unknown result type (might be due to invalid IL or missing references) string prefab; Transform val = Agarre.HeldModel(p, out prefab); MeshFilter val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); Mesh val3 = (((Object)(object)val2 != (Object)null) ? val2.sharedMesh : null); if ((Object)(object)val3 == (Object)null || !((Component)val).gameObject.activeInHierarchy) { return HandOrigin(p); } if (!TipCache.TryGetValue(val3, out var value)) { float num = -1f; Vector3[] vertices = val3.vertices; for (int i = 0; i < vertices.Length; i++) { Vector3 val4 = vertices[i]; if (((Vector3)(ref val4)).sqrMagnitude > num) { num = ((Vector3)(ref val4)).sqrMagnitude; value = val4; } } TipCache[val3] = value; } return val.TransformPoint(value); } public static Vector3 CastOrigin(Player p) { //IL_0018: 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) if (OriginOverride.HasValue) { return OriginOverride.Value; } return HandOrigin(p); } public static Vector3 AimDir(Player p) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0044: Unknown result type (might be due to invalid IL or missing references) if (DirOverride.HasValue) { return DirOverride.Value; } Vector3 val = CastOrigin(p); Vector3 val2 = AimPoint(p, 60f) - val; if (!(((Vector3)(ref val2)).sqrMagnitude > 0.01f)) { return ((Component)p).transform.forward; } return ((Vector3)(ref val2)).normalized; } public static Vector3 AimPoint(Player p, float maxDistance = 40f) { //IL_0079: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform : ((Component)p).transform); if (_aimMask == 0) { _aimMask = LayerMask.GetMask(new string[8] { "Default", "static_solid", "Default_small", "piece", "terrain", "character", "character_net", "vehicle" }); } RaycastHit val2 = default(RaycastHit); float num = float.MaxValue; int num2 = Physics.RaycastNonAlloc(new Ray(val.position, val.forward), _aimHits, maxDistance + 10f, _aimMask, (QueryTriggerInteraction)1); for (int i = 0; i < num2; i++) { RaycastHit val3 = _aimHits[i]; if (!(((RaycastHit)(ref val3)).distance >= num) && !((Object)(object)((Component)((RaycastHit)(ref val3)).collider).GetComponentInParent() == (Object)(object)p)) { val2 = val3; num = ((RaycastHit)(ref val3)).distance; } } Vector3 val4 = ((num < float.MaxValue) ? ((RaycastHit)(ref val2)).point : (((Component)p).transform.position + val.forward * maxDistance)); Vector3 val5 = val4 - ((Component)p).transform.position; if (((Vector3)(ref val5)).sqrMagnitude > maxDistance * maxDistance) { val4 = ((Component)p).transform.position + ((Vector3)(ref val5)).normalized * maxDistance; } Vector3 val6 = Vector3.ProjectOnPlane(val.forward, Vector3.up); if (((Vector3)(ref val6)).sqrMagnitude > 0.0001f && Vector3.Dot(val4 - ((Component)p).transform.position, ((Vector3)(ref val6)).normalized) < 3f) { val4 = ((Component)p).transform.position + Vector3.up * 1.2f + ((Vector3)(ref val6)).normalized * 3f + Vector3.down * Mathf.Max(0f, 0f - val.forward.y) * 3f; } return val4; } public static bool IsValidTarget(Player caster, Character c) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)c == (Object)null || (Object)(object)c == (Object)(object)caster || c.IsDead()) { return false; } if (c.IsPlayer()) { if (((Character)caster).IsPVPEnabled()) { return ((Character)(Player)c).IsPVPEnabled(); } return false; } if (c.IsTamed()) { return ((Character)caster).IsPVPEnabled(); } return true; } public static List EnemiesInRadius(Player p, Vector3 center, float radius) { //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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) List list = new List(); float num = radius * radius; foreach (Character allCharacter in Character.GetAllCharacters()) { if (IsValidTarget(p, allCharacter)) { Vector3 val = ((Component)allCharacter).transform.position - center; if (((Vector3)(ref val)).sqrMagnitude <= num) { list.Add(allCharacter); } } } return list; } public static List AlliesInRadius(Player p, Vector3 center, float radius) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Player.GetPlayersInRange(center, radius, list); return list; } public static void Damage(Player p, Character target, DamageTypes damage, SkillType skill, float push = 0f, float stagger = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_000c: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0048: 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_0059: Expected O, but got Unknown HitData val = new HitData { m_damage = damage, m_point = target.GetCenterPoint() }; Vector3 val2 = ((Component)target).transform.position - ((Component)p).transform.position; val.m_dir = ((Vector3)(ref val2)).normalized; val.m_skill = skill; val.m_pushForce = push; val.m_staggerMultiplier = stagger; HitData val3 = val; val3.SetAttacker((Character)(object)p); target.Damage(val3); } public static int DamageArea(Player p, Vector3 center, float radius, DamageTypes damage, SkillType skill, float push = 0f, float stagger = 1f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) DamageObjects(p, center, radius, damage); if (damage.m_fire > 0f) { SelfBurn(p, center, radius, damage.m_fire); } radius *= AreaMult; List list = EnemiesInRadius(p, center, radius); foreach (Character item in list) { Damage(p, item, damage, skill, push, stagger); } return list.Count; } public static void SelfBurn(Player p, Vector3 center, float radius, float fire) { //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_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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown if (!(fire <= 0f) && !(Vector3.Distance(((Component)p).transform.position, center) > radius)) { float num = Mathf.Lerp(0.25f, 0.05f, (float)Escuelas.Rank(p, Escuela.Fuego) / 6f); HitData val = new HitData { m_point = ((Character)p).GetCenterPoint() }; Vector3 val2 = ((Component)p).transform.position - center; val.m_dir = ((Vector3)(ref val2)).normalized; val.m_hitType = (HitType)5; HitData val3 = val; val3.m_damage.m_fire = fire * num; ((Character)p).Damage(val3); ((Character)p).Message((MessageType)1, Tr.Get("magia_own_fire_burns"), 0, (Sprite)null, false); } } public static void AddSE(Character c, string name, float skillLevel = 0f) { if (!((Object)(object)c == (Object)null)) { c.GetSEMan().AddStatusEffect(StringExtensionMethods.GetStableHashCode(name), true, 0, skillLevel, (short)(-1)); } } public static bool IsProtected(Vector3 pos, float radius) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) List guardas = Campos.Guardas; if (guardas != null) { foreach (PrivateArea item in guardas) { if ((Object)(object)item != (Object)null && Campos.DentroDeGuarda(item, pos, radius)) { return true; } } } List bufPieces = _bufPieces; bufPieces.Clear(); Piece.GetAllPiecesInRadius(pos, radius + MTMagiaPlugin.BaseProtectionRadius.Value, bufPieces); for (int i = 0; i < bufPieces.Count; i++) { Piece val = bufPieces[i]; if ((Object)(object)val != (Object)null && val.IsPlacedByPlayer()) { return true; } } return false; } public static void Crater(Vector3 pos, float radius) { //IL_0015: 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_0035: Unknown result type (might be due to invalid IL or missing references) radius *= AreaMult; if (MTMagiaPlugin.AllowDestruction.Value && !IsProtected(pos, radius)) { GameObject val = Prefab("digg_bombdynamite"); if ((Object)(object)val != (Object)null) { Object.Instantiate(val, pos, Quaternion.identity); } } } private static Collider[] Cerca(Vector3 center, float radius, ref Collider[] buf, out int n) { //IL_0001: 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) n = Physics.OverlapSphereNonAlloc(center, radius, buf); while (n == buf.Length && buf.Length < 8192) { buf = (Collider[])(object)new Collider[buf.Length * 2]; n = Physics.OverlapSphereNonAlloc(center, radius, buf); } return buf; } public static void DamageNearestTrees(Player p, Vector3 center, float radius, float chop, int max) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_00e6: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) if (!MTMagiaPlugin.AllowDestruction.Value || IsProtected(center, radius)) { return; } int n; Collider[] array = Cerca(center, radius, ref _bufArboles, out n); List list = new List(); for (int i = 0; i < n; i++) { TreeBase val = (((Object)(object)array[i] != (Object)null) ? ((Component)array[i]).GetComponentInParent() : null); if ((Object)(object)val != (Object)null && !list.Contains(val)) { list.Add(val); } } list.Sort(delegate(TreeBase a, TreeBase b) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) Vector3 val5 = ((Component)a).transform.position - center; float sqrMagnitude = ((Vector3)(ref val5)).sqrMagnitude; val5 = ((Component)b).transform.position - center; return sqrMagnitude.CompareTo(((Vector3)(ref val5)).sqrMagnitude); }); for (int num = 0; num < list.Count && num < max; num++) { Vector3 position = ((Component)list[num]).transform.position; HitData val2 = new HitData { m_point = position, m_toolTier = 10 }; Vector3 val3 = position - center; val2.m_dir = ((Vector3)(ref val3)).normalized; HitData val4 = val2; val4.m_damage.m_chop = chop; val4.SetAttacker((Character)(object)p); SinBotinLejano.Marcar(p, position); ((IDestructible)list[num]).Damage(val4); } } public static void DamageTrees(Player p, Vector3 center, float radius, float chop) { //IL_001e: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00df: 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_00e5: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Invalid comparison between Unknown and I4 radius *= AreaMult; chop *= ChargeMult; if (!MTMagiaPlugin.AllowDestruction.Value || IsProtected(center, radius)) { return; } HashSet hechosArboles = _hechosArboles; hechosArboles.Clear(); int n; Collider[] array = Cerca(center, radius, ref _bufArboles, out n); for (int i = 0; i < n; i++) { Collider val = array[i]; if ((Object)(object)val == (Object)null) { continue; } IDestructible componentInParent = ((Component)val).GetComponentInParent(); if (componentInParent == null || hechosArboles.Contains(componentInParent)) { continue; } if (!(componentInParent is TreeBase) && !(componentInParent is TreeLog)) { Destructible val2 = (Destructible)(object)((componentInParent is Destructible) ? componentInParent : null); if (val2 == null || (int)val2.GetDestructibleType() != 2) { continue; } } hechosArboles.Add(componentInParent); HitData val3 = new HitData { m_point = ((Component)val).transform.position, m_toolTier = 10 }; Vector3 val4 = ((Component)val).transform.position - center; val3.m_dir = ((Vector3)(ref val4)).normalized; HitData val5 = val3; val5.m_damage.m_chop = chop; val5.SetAttacker((Character)(object)p); SinBotinLejano.Marcar(p, ((Component)val).transform.position); componentInParent.Damage(val5); } } public static void DamageStructures(Player p, Vector3 center, float radius, float damage) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00e9: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) if (!MTMagiaPlugin.DanaConstrucciones.Value || damage <= 0f) { return; } radius *= AreaMult; HashSet hechosObras = _hechosObras; hechosObras.Clear(); HashSet hechosMuros = _hechosMuros; hechosMuros.Clear(); int n; Collider[] array = Cerca(center, radius, ref _bufObras, out n); for (int i = 0; i < n; i++) { Collider val = array[i]; if ((Object)(object)val == (Object)null) { continue; } MuroTierra componentInParent = ((Component)val).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && hechosMuros.Add(componentInParent)) { HitData val2 = new HitData { m_point = val.ClosestPoint(center) }; val2.m_damage.m_blunt = damage * ChargeMult; val2.SetAttacker((Character)(object)p); componentInParent.Damage(val2); } WearNTear componentInParent2 = ((Component)val).GetComponentInParent(); if (!((Object)(object)componentInParent2 == (Object)null) && !hechosObras.Contains(componentInParent2)) { hechosObras.Add(componentInParent2); if (PrivateArea.CheckAccess(((Component)componentInParent2).transform.position, 0f, false, false)) { HitData val3 = new HitData { m_point = ((Component)componentInParent2).transform.position }; Vector3 val4 = ((Component)componentInParent2).transform.position - center; val3.m_dir = ((Vector3)(ref val4)).normalized; val3.m_toolTier = 100; HitData val5 = val3; val5.m_damage.m_blunt = damage * ChargeMult; val5.m_damage.m_chop = damage * ChargeMult; val5.m_damage.m_pickaxe = damage * ChargeMult; val5.SetAttacker((Character)(object)p); SinBotinLejano.Marcar(p, ((Component)componentInParent2).transform.position); componentInParent2.Damage(val5); } } } } public static void DamageObjects(Player p, Vector3 center, float radius, DamageTypes damage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: 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: Expected O, but got Unknown //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Invalid comparison between Unknown and I4 //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) radius *= AreaMult; if (!MTMagiaPlugin.AllowDestruction.Value || IsProtected(center, radius)) { return; } float num = damage.m_blunt + damage.m_slash + damage.m_pierce + damage.m_lightning + damage.m_frost + damage.m_spirit; float num2 = (damage.m_fire * 1.5f + num * 0.5f) * ChargeMult; float num3 = ((DamageTypes)(ref damage)).GetTotalDamage() * 0.5f; HashSet hechosObjetos = _hechosObjetos; hechosObjetos.Clear(); int n; Collider[] array = Cerca(center, radius, ref _bufObjetos, out n); for (int i = 0; i < n; i++) { Collider val = array[i]; if ((Object)(object)val == (Object)null) { continue; } IDestructible componentInParent = ((Component)val).GetComponentInParent(); if (componentInParent == null || hechosObjetos.Contains(componentInParent) || componentInParent is Character || componentInParent is WearNTear) { continue; } int num4; if (!(componentInParent is TreeBase) && !(componentInParent is TreeLog)) { Destructible val2 = (Destructible)(object)((componentInParent is Destructible) ? componentInParent : null); num4 = ((val2 != null && (int)val2.GetDestructibleType() == 2) ? 1 : 0); } else { num4 = 1; } hechosObjetos.Add(componentInParent); Vector3 val4; if (num4 != 0) { if (!(num2 <= 0f)) { HitData val3 = new HitData { m_point = ((Component)val).transform.position, m_toolTier = 10 }; val4 = ((Component)val).transform.position - center; val3.m_dir = ((Vector3)(ref val4)).normalized; HitData val5 = val3; val5.m_damage.m_chop = num2; val5.SetAttacker((Character)(object)p); SinBotinLejano.Marcar(p, ((Component)val).transform.position); componentInParent.Damage(val5); } } else { HitData val6 = new HitData { m_point = ((Component)val).transform.position, m_toolTier = 10 }; val4 = ((Component)val).transform.position - center; val6.m_dir = ((Vector3)(ref val4)).normalized; val6.m_damage = damage; HitData val7 = val6; val7.m_damage.m_pickaxe += num3; val7.SetAttacker((Character)(object)p); SinBotinLejano.Marcar(p, ((Component)val).transform.position); componentInParent.Damage(val7); } } } public static void DamageDestructibles(Player p, Vector3 center, float radius, DamageTypes damage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Invalid comparison between Unknown and I4 radius *= AreaMult; if (!MTMagiaPlugin.AllowDestruction.Value || IsProtected(center, radius)) { return; } HashSet hechosRompibles = _hechosRompibles; hechosRompibles.Clear(); int n; Collider[] array = Cerca(center, radius, ref _bufRompibles, out n); for (int i = 0; i < n; i++) { Collider val = array[i]; if ((Object)(object)val == (Object)null) { continue; } IDestructible componentInParent = ((Component)val).GetComponentInParent(); if (componentInParent != null && !hechosRompibles.Contains(componentInParent) && !(componentInParent is Character) && !(componentInParent is WearNTear) && !(componentInParent is TreeBase) && !(componentInParent is TreeLog)) { Destructible val2 = (Destructible)(object)((componentInParent is Destructible) ? componentInParent : null); if (val2 == null || (int)val2.GetDestructibleType() != 2) { hechosRompibles.Add(componentInParent); HitData val3 = new HitData { m_point = ((Component)val).transform.position, m_toolTier = 10 }; Vector3 val4 = ((Component)val).transform.position - center; val3.m_dir = ((Vector3)(ref val4)).normalized; val3.m_damage = damage; HitData val5 = val3; val5.m_damage.m_pickaxe += ((DamageTypes)(ref damage)).GetTotalDamage() * 0.5f; val5.SetAttacker((Character)(object)p); SinBotinLejano.Marcar(p, ((Component)val).transform.position); componentInParent.Damage(val5); } } } } } [HarmonyPatch(typeof(Character), "Damage")] public static class RayoMojadoPatch { private static readonly int Wet = StringExtensionMethods.GetStableHashCode("Wet"); private static void Prefix(Character __instance, HitData hit) { if (hit != null && !(hit.m_damage.m_lightning <= 0f) && !((Object)(object)hit.GetAttacker() != (Object)(object)Player.m_localPlayer)) { SEMan sEMan = __instance.GetSEMan(); if (sEMan != null && sEMan.HaveStatusEffect(Wet)) { hit.m_damage.m_lightning *= 2f; } } } } public class VfxTemporal : MonoBehaviour { public float Segundos = 15f; private float _t; private void Update() { _t += Time.deltaTime; if (_t < Segundos) { return; } ZNetView component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null && component.IsValid()) { if (component.IsOwner()) { ZNetScene instance = ZNetScene.instance; if (instance != null) { instance.Destroy(((Component)this).gameObject); } } } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } } [HarmonyPatch(typeof(Player), "OnSpawned")] public static class LimpiarEfectosPatch { private static void Postfix(Player __instance) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } Stopwatch stopwatch = Stopwatch.StartNew(); _ = HudCueroArte.Fondo; MTMagiaPlugin.Log.LogInfo((object)$"HUD de magia precargado en {stopwatch.ElapsedMilliseconds} ms"); SpellRunner.After(5f, delegate { int num = 0; ZNetView[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (ZNetView val in array) { if (!((Object)(object)val == (Object)null) && val.IsValid() && val.IsOwner()) { string name = ((Object)((Component)val).gameObject).name; if ((name.StartsWith("fx_") || name.StartsWith("vfx_")) && !((Object)(object)((Component)val).GetComponent() != (Object)null)) { ZNetScene instance = ZNetScene.instance; if (instance != null) { instance.Destroy(((Component)val).gameObject); } num++; } } } if (num > 0) { MTMagiaPlugin.Log.LogInfo((object)$"Limpieza: {num} efectos que se habían quedado guardados en el mundo"); } }); } } public class GiveCommand : ConsoleCommand { public static readonly Dictionary Items = new Dictionary { { "mk1_armor", "MT_ArmaduraMk1" }, { "mk1_shield", "MT_EscudoMk1" }, { "mk1_cannon", "MT_CanonMk1" }, { "mk1_helmet", "MT_CascoMk1" }, { "mk1_core", "MT_CorazaMk1" }, { "mk1_greaves", "MT_GrebasMk1" }, { "apprentice_wand", "MT_VaritaAprendiz" }, { "apprentice_staff", "MT_BastonAprendiz" }, { "adept_staff", "MT_BastonAdepto" }, { "master_staff", "MT_BastonMaestro" }, { "archmage_staff", "MT_BastonArchimago" }, { "water_staff", "MT_BastonAgua" }, { "rock_staff", "MT_BastonRudeus" }, { "sylph_staff", "MT_BastonSilfide" }, { "tempest_staff", "MT_BastonTempestad" }, { "aqua_heartia", "MT_BastonAquaHeartia" }, { "azurith", "MT_BastonAzurith" }, { "ignivar", "MT_BastonIgnivar" }, { "aurelia", "MT_BastonAurelia" }, { "nihilum", "MT_BastonNihilum" }, { "zefiria", "MT_BastonZefiria" }, { "magic_scroll", "MT_PergaminoMagiaRara" }, { "gravity_scroll", "MT_PergaminoGravedad" }, { "runic_grimoire", "MT_GrimorioRunico" }, { "grand_grimoire", "MT_GranGrimorio" }, { "foresight_eye", "MT_OjoPrevision" }, { "farsight_eye", "MT_OjoVistaLejana" }, { "identification_eye", "MT_OjoIdentificacion" } }; public override string Name => "mt_give"; public override string Help => "[cheat] mt_give [amount] — give a mod item by its English name. No arguments: list. Items: " + string.Join(", ", Items.Keys); public override bool IsCheat => true; public override List CommandOptionList() { return Items.Keys.ToList(); } public override void Run(string[] args) { //IL_00a3: 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_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_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_00e0: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || args.Length == 0 || !Items.TryGetValue(args[0].ToLowerInvariant(), out var value)) { Console.instance.Print(((ConsoleCommand)this).Help); return; } int result; int num = ((args.Length <= 1 || !int.TryParse(args[1], out result)) ? 1 : Mathf.Clamp(result, 1, 100)); GameObject val = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab(value) : null); if ((Object)(object)val == (Object)null) { Console.instance.Print("Item not found: " + value); return; } for (int i = 0; i < num; i++) { Object.Instantiate(val, ((Component)localPlayer).transform.position + ((Component)localPlayer).transform.forward * 1.5f + Vector3.up * (1f + 0.2f * (float)i), Quaternion.identity); } Console.instance.Print($"Given {num} × {args[0]} ({value})"); } } public static class Grimorio { private const string Key = "MT.Magia.Ocultos"; public static HashSet Hidden(Player p) { if (!((Object)(object)p != (Object)null) || !p.m_customData.TryGetValue("MT.Magia.Ocultos", out var value) || string.IsNullOrEmpty(value)) { return new HashSet(); } return new HashSet(value.Split(new char[1] { ',' })); } public static bool IsHidden(Player p, string id) { return Hidden(p).Contains(id); } public static bool Toggle(Player p, string id) { HashSet hashSet = Hidden(p); bool num = hashSet.Add(id); if (!num) { hashSet.Remove(id); } p.m_customData["MT.Magia.Ocultos"] = string.Join(",", hashSet.OrderBy((string x) => x)); return num; } public static void Set(Player p, string id, bool hidden) { if (IsHidden(p, id) != hidden) { Toggle(p, id); } } } internal static class GrimorioArte { private static Texture2D _fondo; private static bool _intentado; internal static Texture2D Fondo { get { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0068: Expected O, but got Unknown if (_intentado) { return _fondo; } _intentado = true; try { using Stream stream = typeof(GrimorioArte).Assembly.GetManifestResourceStream("Grimorio/libro-arcano.png"); using MemoryStream memoryStream = new MemoryStream(); if (stream == null) { return null; } stream.CopyTo(memoryStream); _fondo = new Texture2D(2, 2, (TextureFormat)4, false) { hideFlags = (HideFlags)61, wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; if (!(bool)Type.GetType("UnityEngine.ImageConversion, UnityEngine.ImageConversionModule", throwOnError: true).GetMethod("LoadImage", new Type[3] { typeof(Texture2D), typeof(byte[]), typeof(bool) }).Invoke(null, new object[3] { _fondo, memoryStream.ToArray(), true })) { Object.Destroy((Object)(object)_fondo); _fondo = null; } } catch (Exception ex) { if ((Object)(object)_fondo != (Object)null) { Object.Destroy((Object)(object)_fondo); } _fondo = null; Debug.LogWarning((object)("MT.Magia: grimoire artwork unavailable: " + ex.Message)); } return _fondo; } } } public static class HieloAgua { private class Deshielo : MonoBehaviour { public float Until; private void Update() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (Time.time < Until) { return; } int num = 0; foreach (Transform item in ((Component)this).transform) { Transform val = item; if (num++ % 4 == 0) { Fx.Visual("vfx_ice_destroyed", val.position); } } Object.Destroy((Object)(object)((Component)this).gameObject); } } private const float Paso = 2.5f; private static Material _mat; public static int Freeze(Vector3 center, float radius, float seconds) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0059: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ZoneSystem.instance == (Object)null) { return 0; } float waterLevel = ZoneSystem.instance.m_waterLevel; GameObject val = new GameObject("MT_HieloAgua"); int num = LayerMask.NameToLayer("static_solid"); int num2 = 0; Vector3 val2 = default(Vector3); for (float num3 = 0f - radius; num3 <= radius; num3 += 2.5f) { for (float num4 = 0f - radius; num4 <= radius; num4 += 2.5f) { if (num3 * num3 + num4 * num4 > radius * radius) { continue; } ((Vector3)(ref val2))..ctor(center.x + num3, waterLevel, center.z + num4); if (!(waterLevel - ZoneSystem.instance.GetGroundHeight(val2) < 0.4f)) { GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val3).name = "MT_Hielo"; if (num >= 0) { val3.layer = num; } val3.transform.SetParent(val.transform, false); val3.transform.position = new Vector3(val2.x, waterLevel - 0.15f, val2.z); val3.transform.localScale = new Vector3(2.5f, 0.4f, 2.5f); Renderer component = val3.GetComponent(); component.sharedMaterial = Mat(); component.shadowCastingMode = (ShadowCastingMode)0; num2++; } } } if (num2 == 0) { Object.Destroy((Object)(object)val); return 0; } val.AddComponent().Until = Time.time + seconds; return num2; } private static Material Mat() { //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown if ((Object)(object)_mat != (Object)null) { return _mat; } if ((Object)(object)ZNetScene.instance != (Object)null) { foreach (GameObject prefab in ZNetScene.instance.m_prefabs) { if ((Object)(object)prefab == (Object)null) { continue; } MeshRenderer[] componentsInChildren = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material sharedMaterial = ((Renderer)componentsInChildren[i]).sharedMaterial; if (!((Object)(object)sharedMaterial == (Object)null)) { string text = ((Object)sharedMaterial).name.ToLowerInvariant(); if (text.StartsWith("ice") || text.Contains("_ice") || text.Contains(" ice")) { _mat = new Material(sharedMaterial); MTMagiaPlugin.Log.LogInfo((object)("Cero Absoluto: material de hielo " + ((Object)sharedMaterial).name + " (" + ((Object)prefab).name + ")")); return _mat; } } } } } _mat = Vfx.NewMaterial(Texture2D.whiteTexture, (Color?)new Color(0.6f, 0.85f, 1f, 0.6f)); MTMagiaPlugin.Log.LogInfo((object)"Cero Absoluto: sin material de hielo del juego, uso uno azul"); return _mat; } } public static class HogueraMagica { public const string Flag = "MT_HogueraMagica"; private const float CostoExtra = 10f; private const float Espera = 60f; private static float _listaEn; public static float Lena(Player p) { return 1f + (float)Escuelas.Rank(p, Escuela.Fuego); } public static bool PuedeCrear(Player p) { if (Time.time < _listaEn) { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_wait", new object[1] { Mathf.CeilToInt(_listaEn - Time.time) }), 0, (Sprite)null, false); return false; } if (p.GetEitr() < 10f) { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_no_mana"), 0, (Sprite)null, false); return false; } ((Character)p).UseEitr(10f); _listaEn = Time.time + 60f; return true; } public static void Marcar(GameObject go, Fireplace fp, Player p) { ZNetView component = go.GetComponent(); ZDO val = ((component != null) ? component.GetZDO() : null); if (val != null) { val.Set("MT_HogueraMagica", true); if ((Object)(object)fp != (Object)null) { val.Set(ZDOVars.s_fuel, Mathf.Min(fp.m_maxFuel, Lena(p))); } Cronica.AnotarUnaVez(p, "hoguera_magica", "cronica_campfire_created", Array.Empty()); } } } [HarmonyPatch(typeof(Piece), "DropResources")] public static class HogueraMagicaSinMaterialesPatch { private static bool Prefix(Piece __instance) { ZNetView component = ((Component)__instance).GetComponent(); ZDO val = ((component != null) ? component.GetZDO() : null); if (val != null) { return !val.GetBool("MT_HogueraMagica", false); } return true; } } internal static class HudCueroArte { private static Texture2D _fondo; private static bool _intentado; internal static Texture2D Fondo { get { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0068: Expected O, but got Unknown if (_intentado) { return _fondo; } _intentado = true; try { using Stream stream = typeof(HudCueroArte).Assembly.GetManifestResourceStream("Grimorio/hud-cuero.png"); using MemoryStream memoryStream = new MemoryStream(); if (stream == null) { return null; } stream.CopyTo(memoryStream); _fondo = new Texture2D(2, 2, (TextureFormat)4, false) { hideFlags = (HideFlags)61, wrapMode = (TextureWrapMode)1, filterMode = (FilterMode)1 }; if (!(bool)Type.GetType("UnityEngine.ImageConversion, UnityEngine.ImageConversionModule", throwOnError: true).GetMethod("LoadImage", new Type[3] { typeof(Texture2D), typeof(byte[]), typeof(bool) }).Invoke(null, new object[3] { _fondo, memoryStream.ToArray(), true })) { Object.Destroy((Object)(object)_fondo); _fondo = null; } } catch (Exception ex) { if ((Object)(object)_fondo != (Object)null) { Object.Destroy((Object)(object)_fondo); } _fondo = null; Debug.LogWarning((object)("MT.Magia: leather HUD artwork unavailable: " + ex.Message)); } return _fondo; } } } public static class Humo { private class Zona { public Vector3 Centro; public float Radio; public float Hasta; } private static readonly List Zonas = new List(); public static void Add(Vector3 center, float radius, float duration) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Zonas.Add(new Zona { Centro = center, Radio = radius, Hasta = Time.time + duration }); } public static bool Inside(Vector3 pos) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) for (int num = Zonas.Count - 1; num >= 0; num--) { Zona zona = Zonas[num]; if (Time.time > zona.Hasta) { Zonas.RemoveAt(num); } else { Vector3 val = pos - zona.Centro; if (((Vector3)(ref val)).sqrMagnitude <= zona.Radio * zona.Radio) { return true; } } } return false; } public static bool Blocks(Vector3 observer, Character target) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null && (Object)(object)target == (Object)(object)Player.m_localPlayer && Zonas.Count > 0) { if (!Inside(((Component)target).transform.position)) { return Inside(observer); } return true; } return false; } } [HarmonyPatch(typeof(BaseAI), "CanSeeTarget", new Type[] { typeof(Character) })] public static class HumoVistaPatch { private static void Postfix(BaseAI __instance, Character target, ref bool __result) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (__result && Humo.Blocks(((Component)__instance).transform.position, target)) { __result = false; } } } [HarmonyPatch(typeof(BaseAI), "CanHearTarget", new Type[] { typeof(Character) })] public static class HumoOidoPatch { private static void Postfix(BaseAI __instance, Character target, ref bool __result) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) if (__result && Humo.Blocks(((Component)__instance).transform.position, target)) { __result = false; } } } [HarmonyPatch] public static class HumoEstaticoPatch { private static IEnumerable TargetMethods() { foreach (MethodInfo declaredMethod in AccessTools.GetDeclaredMethods(typeof(BaseAI))) { if (declaredMethod.IsStatic && (declaredMethod.Name == "CanSeeTarget" || declaredMethod.Name == "CanHearTarget") && declaredMethod.ReturnType == typeof(bool) && declaredMethod.GetParameters().Length > 2 && declaredMethod.GetParameters()[0].ParameterType == typeof(Transform)) { yield return declaredMethod; } } } private static void Postfix(Transform __0, object[] __args, ref bool __result) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (__result) { object obj = __args[^1]; Character target = (Character)((obj is Character) ? obj : null); if (Humo.Blocks(__0.position, target)) { __result = false; } } } } public class InvocacionVfx : MonoBehaviour { public static readonly Color Arcano = new Color(0.6f, 0.45f, 1f); private float _radio; private float _vida; private float _t; private Color _color; private Material _mat; private Transform _giro; private Transform _contra; public static void Circulo(Vector3 pos, float radio, Color color, float segundos = 2.2f) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_CirculoInvocacion"); val.transform.position = pos + Vector3.up * 0.08f; InvocacionVfx invocacionVfx = val.AddComponent(); invocacionVfx._radio = radio; invocacionVfx._vida = segundos; invocacionVfx._color = color; } } public static void Aparicion(Vector3 pos, float alto, Color color) { //IL_0000: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00e1: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) FuegoVfx.Destello(pos, 12f, 4f, 0.6f, color); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(color.r, color.g, color.b, 1f), ColorB = Color.Lerp(color, Color.white, 0.5f), LifeMin = 0.6f, LifeMax = 1.2f, SpeedMin = alto * 1.2f, SpeedMax = alto * 2.4f, SizeMin = 0.08f, SizeMax = 0.2f, Gravity = -0.2f, Radius = 0.8f, Hemisphere = true, Burst = 90, FadeIn = 0.05f, Grow = 0.3f }); Particulas.Spawn(pos, new Particulas.Config { ColorA = new Color(0.35f, 0.3f, 0.4f, 0.5f), ColorB = new Color(0.5f, 0.45f, 0.55f, 0.35f), LifeMin = 1.2f, LifeMax = 2f, SpeedMin = 0.5f, SpeedMax = 1.6f, SizeMin = 0.8f, SizeMax = 1.6f, Radius = 1f, Hemisphere = true, Burst = 18, Additive = false, FadeIn = 0.1f, Grow = 2.2f }); } private void Start() { //IL_0007: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) _mat = Vfx.NewMaterial(Texture2D.whiteTexture, _color); _giro = new GameObject("Giro").transform; _giro.SetParent(((Component)this).transform, false); _contra = new GameObject("Contra").transform; _contra.SetParent(((Component)this).transform, false); Circunferencia(_giro, 1f, 0.06f); Circunferencia(_giro, 0.9f, 0.03f); Estrella(_contra, 0.85f, 0.035f); Circunferencia(_contra, 0.45f, 0.03f); Vector3 val = default(Vector3); for (int i = 0; i < 12; i++) { float num = (float)i * (float)Math.PI / 6f; ((Vector3)(ref val))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); Linea(_giro, (Vector3[])(object)new Vector3[2] { val * 0.91f, val * 0.99f }, 0.05f, cerrada: false); } Object.Destroy((Object)(object)((Component)this).gameObject, _vida + 0.1f); } private void Circunferencia(Transform padre, float r, float ancho) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[64]; for (int i = 0; i < 64; i++) { float num = (float)i / 64f * (float)Math.PI * 2f; array[i] = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * r; } Linea(padre, array, ancho, cerrada: true); } private void Estrella(Transform padre, float r, float ancho) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 2; i++) { Vector3[] array = (Vector3[])(object)new Vector3[3]; for (int j = 0; j < 3; j++) { float num = (float)Math.PI / 2f + (float)i * (float)Math.PI / 3f + (float)j * (float)Math.PI * 2f / 3f; array[j] = new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * r; } Linea(padre, array, ancho, cerrada: true); } } private void Linea(Transform padre, Vector3[] pts, float ancho, bool cerrada) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Trazo"); val.transform.SetParent(padre, false); LineRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterial = _mat; obj.useWorldSpace = false; obj.loop = cerrada; obj.positionCount = pts.Length; obj.SetPositions(pts); obj.widthMultiplier = ancho * _radio; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; } private void Update() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) _t += Time.deltaTime; float num = Mathf.Clamp01(_t / 0.3f); float num2 = Mathf.Clamp01((_vida - _t) / (_vida * 0.35f)); ((Component)this).transform.localScale = Vector3.one * _radio * (1f - (1f - num) * (1f - num)); _giro.localRotation = Quaternion.Euler(0f, _t * 60f, 0f); _contra.localRotation = Quaternion.Euler(0f, (0f - _t) * 90f, 0f); Color color = _color; color.a = num2 * (0.8f + 0.2f * Mathf.Sin(_t * 8f)); _mat.color = color; if (_mat.HasProperty("_TintColor")) { _mat.SetColor("_TintColor", color * 0.6f); } } private void OnDestroy() { if ((Object)(object)_mat != (Object)null) { Object.Destroy((Object)(object)_mat); } } } public static class Levitacion { private static bool _softLanding; private static float _slow; private static float _fast; private static readonly int ForwardSpeed = Animator.StringToHash("forward_speed"); private static readonly int SidewaySpeed = Animator.StringToHash("sideway_speed"); private static readonly int WetHash = StringExtensionMethods.GetStableHashCode("Wet"); public static bool Active => Estado.Levitando; public static void Toggle(Player p, float power) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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) if (Active) { Stop(p, Tr.Get("magia_stop_levitating")); return; } _slow = ((Character)p).m_flySlowSpeed; _fast = ((Character)p).m_flyFastSpeed; ((Character)p).m_flySlowSpeed = 5f + 1.5f * power; ((Character)p).m_flyFastSpeed = 10f + 3f * power; ((Character)p).m_flying = true; Estado.Levitando = true; Rigidbody val = Campos.Cuerpo.Invoke((Character)(object)p); if ((Object)(object)val != (Object)null) { val.position += Vector3.up * 0.4f; val.linearVelocity = Vector3.up * 6f; } if (!LevitarAnim.Enabled) { ZSyncAnimation obj = Campos.Anim.Invoke((Character)(object)p); if (obj != null) { obj.SetTrigger("jump"); } } Fx.Visual("vfx_featherfall", ((Component)p).transform.position, 1.2f); LevitarAnim.OnStart(p); LevitarRemolinos.Attach(p); ((Character)p).Message((MessageType)1, Tr.Get("magia_levitating_land", new object[1] { MTKeys.Aterrizar.Value }), 0, (Sprite)null, false); } public static void Stop(Player p, string msg) { if (!Active) { return; } Estado.Levitando = false; if ((Object)(object)p != (Object)null) { ((Character)p).m_flying = false; Transform val = ((Component)p).transform.Find("MT_GravedadAura"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } ((Character)p).m_flySlowSpeed = _slow; ((Character)p).m_flyFastSpeed = _fast; _softLanding = true; LevitarAnim.OnStop(p); LevitarRemolinos.Detach(p); if (msg != null) { ((Character)p).Message((MessageType)1, msg, 0, (Sprite)null, false); } } } public static void Tick(Player p) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) LevitarAnim.Tick(p); if ((Object)(object)p == (Object)null) { Estado.Levitando = false; return; } if (_softLanding) { Campos.AlturaMaxAire.Invoke((Character)(object)p) = ((Component)p).transform.position.y; if (((Character)p).IsOnGround() || ((Character)p).IsSwimming()) { _softLanding = false; } } if (!Active) { return; } if (((Character)p).IsDead()) { Stop(p, null); return; } if (LevitarAnim.CurrentState != LevitarAnim.Estado.Volar) { Animator componentInChildren = ((Component)p).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.SetFloat(ForwardSpeed, 0f); componentInChildren.SetFloat(SidewaySpeed, 0f); } ZSyncAnimation val = Campos.Anim.Invoke((Character)(object)p); if ((Object)(object)val != (Object)null) { val.SetBool("onGround", false); val.SetBool("flying", false); val.SetBool("falling", true); } } SEMan sEMan = ((Character)p).GetSEMan(); if (sEMan != null && !((Character)p).IsSwimming()) { StatusEffect statusEffect = sEMan.GetStatusEffect(WetHash); if ((Object)(object)statusEffect != (Object)null) { float num = (ZInput.GetButton("Run") ? 4f : 2f) * Time.deltaTime; statusEffect.GetRemaningTime(); float num2 = Campos.TiempoEfecto.Invoke(statusEffect) + num; float ttl = statusEffect.m_ttl; if (ttl > 0f && num2 >= ttl) { sEMan.RemoveStatusEffect(WetHash, false); Fx.Visual("vfx_featherfall", ((Component)p).transform.position + Vector3.up * 0.8f, 0.8f); ((Character)p).Message((MessageType)1, Tr.Get("magia_levitar_dried"), 0, (Sprite)null, false); } else { Campos.TiempoEfecto.Invoke(statusEffect) = num2; } } } float num3 = MTMagiaPlugin.LevitarCosto.Value * Caster.CostFactor(p, Escuela.Viento) * Time.deltaTime; if (((Character)p).IsRunning() || ZInput.GetButton("Run")) { num3 *= MTMagiaPlugin.LevitarCostoCorrer.Value; } if (p.GetEitr() <= num3 + 0.5f || Agotamiento.IsExhausted(p)) { Stop(p, Tr.Get("magia_mana_runs_out_descend")); return; } ((Character)p).UseEitr(num3); ((Character)p).RaiseSkill((SkillType)9, 0.02f * Time.deltaTime); } } [HarmonyPatch(typeof(Character), "UpdateFlying")] public static class LevitarVerticalPatch { private static bool _wasRising; private const float LevitarSubir = 12f; private const float LevitarBajar = 12f; private static void Postfix(Character __instance) { //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_0076: 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_008d: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) if (!Levitacion.Active || (Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } Rigidbody val = Campos.Cuerpo.Invoke(__instance); if ((Object)(object)val == (Object)null) { return; } bool button = ZInput.GetButton("Run"); float num = (ZInput.GetButton("Jump") ? 12f : (ZInput.GetButton("Crouch") ? (-12f) : 0f)); if (button) { num *= 2.2f; } Vector3 linearVelocity = val.linearVelocity; val.linearVelocity = new Vector3(linearVelocity.x, Mathf.Lerp(linearVelocity.y, num, 0.6f), linearVelocity.z); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(linearVelocity.x, 0f, linearVelocity.z); if (((Vector3)(ref val2)).sqrMagnitude > 0.5f) { Quaternion val3 = Quaternion.LookRotation(((Vector3)(ref val2)).normalized, Vector3.up); Quaternion rotation = Quaternion.Slerp(((Component)__instance).transform.rotation, val3, Mathf.Clamp01(Time.fixedDeltaTime * 10f)); ((Component)__instance).transform.rotation = rotation; val.rotation = rotation; } if (LevitarAnim.Enabled) { LevitarAnim.Estado st = ((!button || !(((Vector3)(ref val2)).sqrMagnitude >= 1f) || !(Vector3.Dot(((Component)__instance).transform.forward, ((Vector3)(ref val2)).normalized) > 0.35f)) ? ((!(num > 0f)) ? LevitarAnim.Estado.Flotar : LevitarAnim.Estado.Subir) : LevitarAnim.Estado.Volar); LevitarAnim.SetState((Player)(object)((__instance is Player) ? __instance : null), st); return; } ZSyncAnimation val4 = Campos.Anim.Invoke(__instance); if (!((Object)(object)val4 == (Object)null)) { val4.SetBool("flying", false); val4.SetBool("falling", true); val4.SetBool("onGround", false); bool num2 = num > 0f; if (num2 && !_wasRising) { val4.SetTrigger("jump"); } _wasRising = num2; } } } [HarmonyPatch(typeof(Character), "Jump")] public static class LevitarNoJumpPatch { private static bool Prefix(Character __instance) { if (Levitacion.Active) { return !((Object)(object)__instance == (Object)(object)Player.m_localPlayer); } return true; } } public static class LevitarAnim { public enum Estado { Volar, Flotar, Subir, Bajar } private static AssetBundle _bundle; private static readonly Dictionary Clips = new Dictionary(); private static PlayableGraph _graph; private static AnimationPlayableOutput _output; private static AnimationMixerPlayable _mixer; private static readonly AnimationClip[] Slot = (AnimationClip[])(object)new AnimationClip[2]; private static int _active; private static float _mix = 1f; private static float _outWeight; private static float _outTarget; private static float _until; private static bool _flying; private static bool _landingPending; private static bool _rising; private static bool _posing; private static Estado _estado = Estado.Volar; private static float Fade => Mathf.Max(0.05f, MTMagiaPlugin.AnimFundido.Value); public static bool Playing { get { if (((PlayableGraph)(ref _graph)).IsValid()) { return _outWeight > 0.01f; } return false; } } public static bool Enabled { get { if (MTMagiaPlugin.LevitarAnimaciones.Value) { return Clips.Count > 0; } return false; } } public static Estado CurrentState => _estado; public static void Load(string pluginDir) { string text = Path.Combine(pluginDir, "Bundles", "mt_anim"); if (!File.Exists(text)) { MTMagiaPlugin.Log.LogWarning((object)("No está el paquete de animaciones: " + text)); return; } try { _bundle = AssetBundle.LoadFromMemory(File.ReadAllBytes(text)); } catch (Exception ex) { MTMagiaPlugin.Log.LogWarning((object)("Error al cargar mt_anim desde memoria, intentando LoadFromFile: " + ex.Message)); _bundle = AssetBundle.LoadFromFile(text); } if ((Object)(object)_bundle == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)"No se pudo cargar mt_anim"); return; } AnimationClip[] array = _bundle.LoadAllAssets(); foreach (AnimationClip val in array) { Clips[((Object)val).name] = val; } MTMagiaPlugin.Log.LogInfo((object)("Animaciones cargadas: " + string.Join(", ", Clips.Keys))); } private static AnimationClip Clip(string name) { if (!Clips.TryGetValue(name, out var value)) { return null; } return value; } private static Animator AnimatorOf(Player p) { Animator componentInChildren = ((Component)p).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return null; } if (!componentInChildren.isHuman && Clips.Count > 0) { MTMagiaPlugin.Log.LogWarning((object)"El Animator del jugador no es humanoide: no se pueden usar las animaciones de Mixamo"); return null; } return componentInChildren; } private static bool EnsureGraph(Player p) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_006e: Unknown result type (might be due to invalid IL or missing references) if (((PlayableGraph)(ref _graph)).IsValid()) { return true; } Animator val = AnimatorOf(p); if ((Object)(object)val == (Object)null) { return false; } _graph = PlayableGraph.Create("MT_Levitar"); ((PlayableGraph)(ref _graph)).SetTimeUpdateMode((DirectorUpdateMode)1); _output = AnimationPlayableOutput.Create(_graph, "MT_Levitar", val); _mixer = AnimationMixerPlayable.Create(_graph, 2); PlayableOutputExtensions.SetSourcePlayable(_output, _mixer); PlayableOutputExtensions.SetWeight(_output, 0f); _outWeight = 0f; Slot[0] = (Slot[1] = null); _active = 0; _mix = 1f; ((PlayableGraph)(ref _graph)).Play(); return true; } private static void Play(Player p, AnimationClip clip, bool loop) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0090: 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_0056: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)clip == (Object)null) && EnsureGraph(p)) { int num = (((Object)(object)Slot[_active] == (Object)null) ? _active : (1 - _active)); if (PlayableExtensions.IsValid(PlayableExtensions.GetInput(_mixer, num))) { Playable input = PlayableExtensions.GetInput(_mixer, num); ((PlayableGraph)(ref _graph)).Disconnect(_mixer, num); PlayableExtensions.Destroy(input); } AnimationClipPlayable val = AnimationClipPlayable.Create(_graph, clip); PlayableExtensions.SetTime(val, 0.0); ((AnimationClipPlayable)(ref val)).SetApplyFootIK(true); ((PlayableGraph)(ref _graph)).Connect(val, 0, _mixer, num); bool num2 = (Object)(object)Slot[_active] == (Object)null; Slot[num] = clip; _active = num; _mix = (num2 ? 1f : 0f); ApplyMix(); _outTarget = 1f; _until = (loop ? float.MaxValue : (Time.time + clip.length)); } } private static void ApplyMix() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) PlayableExtensions.SetInputWeight(_mixer, _active, _mix); PlayableExtensions.SetInputWeight(_mixer, 1 - _active, ((Object)(object)Slot[1 - _active] != (Object)null) ? (1f - _mix) : 0f); } private static void FadeOut() { _outTarget = 0f; } private static void Destroy() { if (((PlayableGraph)(ref _graph)).IsValid()) { ((PlayableGraph)(ref _graph)).Destroy(); } Slot[0] = (Slot[1] = null); _outWeight = (_outTarget = 0f); } public static void OnStart(Player p) { if (Enabled) { _flying = true; _rising = false; _estado = Estado.Bajar; _landingPending = false; AnimationClip val = (string.IsNullOrEmpty(MTMagiaPlugin.AnimDespegue.Value) ? null : Clip(MTMagiaPlugin.AnimDespegue.Value)); if ((Object)(object)val != (Object)null) { Play(p, val, loop: false); } else { SetState(p, Estado.Flotar); } } } public static void SetState(Player p, Estado st) { if (!Enabled || !_flying || (Object)(object)p == (Object)null || st == _estado || ((Object)(object)Slot[_active] != (Object)null && _estado == Estado.Volar && !_rising && ((Object)Slot[_active]).name != MTMagiaPlugin.AnimVuelo.Value && Time.time < _until)) { return; } AnimationClip val = Clip(st switch { Estado.Bajar => MTMagiaPlugin.AnimBajar.Value, Estado.Subir => MTMagiaPlugin.AnimSubir.Value, Estado.Flotar => MTMagiaPlugin.AnimFlotar.Value, _ => MTMagiaPlugin.AnimVuelo.Value, }); _estado = st; _rising = st != Estado.Volar; if (st == Estado.Flotar || st == Estado.Bajar || ((Object)(object)val == (Object)null && st == Estado.Flotar)) { _until = float.MaxValue; FadeOut(); return; } if (val == null) { val = Clip(MTMagiaPlugin.AnimVuelo.Value); } if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)Slot[_active]) { Play(p, val, loop: true); } } public static void OnStop(Player p) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (Enabled) { _flying = false; _rising = false; _estado = Estado.Volar; _landingPending = true; AnimationClip val = Clip(MTMagiaPlugin.AnimCaida.Value); if (!((Character)p).IsOnGround() && (Object)(object)val != (Object)null && !Physics.Raycast(((Component)p).transform.position, Vector3.down, 1.5f)) { Play(p, val, loop: true); } else { FadeOut(); } } } public static void Pose(Player p, string clip) { if (Enabled && !_flying && !((Object)(object)p == (Object)null)) { AnimationClip val = Clip(clip); if (!((Object)(object)val == (Object)null)) { _posing = true; _landingPending = false; Play(p, val, loop: true); } } } public static void EndPose() { if (_posing) { _posing = false; FadeOut(); } } public static void Tick(Player p) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) if (!Enabled || (Object)(object)p == (Object)null) { Destroy(); } else if (((Character)p).IsDead()) { Destroy(); _flying = (_landingPending = false); } else { if (!((PlayableGraph)(ref _graph)).IsValid() && !_landingPending) { return; } float deltaTime = Time.deltaTime; if (((PlayableGraph)(ref _graph)).IsValid()) { _mix = Mathf.MoveTowards(_mix, 1f, deltaTime / Fade); ApplyMix(); _outWeight = Mathf.MoveTowards(_outWeight, _outTarget, deltaTime / Fade); PlayableOutputExtensions.SetWeight(_output, _outWeight); if (_outTarget <= 0f && _outWeight <= 0f && !_landingPending) { Destroy(); return; } } if (_flying && (Object)(object)Slot[_active] != (Object)null && Time.time >= _until - Fade) { Play(p, Clip(MTMagiaPlugin.AnimVuelo.Value), loop: true); } if (_landingPending && (((Character)p).IsOnGround() || ((Character)p).IsSwimming())) { _landingPending = false; if (!((Character)p).IsSwimming()) { Play(p, Clip(MTMagiaPlugin.AnimAterrizaje.Value), loop: false); } } if (_flying || _landingPending || _posing || !(_outTarget > 0f)) { return; } if (!(Time.time >= _until - Fade) && !((Character)p).InAttack()) { Vector3 velocity = ((Character)p).GetVelocity(); if (!(((Vector3)(ref velocity)).magnitude > 2f)) { return; } } FadeOut(); } } } [HarmonyPatch(typeof(Character), "AddRootMotion")] public static class LevitarRootMotionPatch { private static bool Prefix(Character __instance) { if (LevitarAnim.Playing) { return !((Object)(object)__instance == (Object)(object)Player.m_localPlayer); } return true; } } public class LevitarAnimCommand : ConsoleCommand { public override string Name => "mt_levitar_anim"; public override string Help => "mt_levitar_anim [0|1] — Animación al flotar sin moverte: 0=caída suave (default), 1=pose de pie. Sin argumentos: alternar."; public override bool IsCheat => false; public override List CommandOptionList() { return new List { "0", "1" }; } public override void Run(string[] args) { if ((Object)(object)Player.m_localPlayer == (Object)null) { Console.instance.Print("No player"); return; } if (args.Length != 0 && int.TryParse(args[0], out var result) && (result == 0 || result == 1)) { MTMagiaPlugin.LevitarFlotarAnimacion.Value = result; } else { MTMagiaPlugin.LevitarFlotarAnimacion.Value = 1 - MTMagiaPlugin.LevitarFlotarAnimacion.Value; } string text = ((MTMagiaPlugin.LevitarFlotarAnimacion.Value == 0) ? "caída suave" : "pose de pie"); Console.instance.Print("Levitar flotando: " + text); } } public class LevitarRemolinos : MonoBehaviour { private class Trazo { public LineRenderer Lr; public readonly Vector3[] Camino = (Vector3[])(object)new Vector3[40]; public float Edad = -1f; public Color Color; } private const int Max = 18; private const int Puntos = 40; private const float Viaje = 0.42f; private const float Cola = 0.5f; private const float Vida = 0.85f; private Player _player; private Transform _leftFoot; private Transform _rightFoot; private readonly Trazo[] _trazos = new Trazo[18]; private Material _mat; private float _proximo; private float _speedMult = 1f; private bool _izquierda; private Vector3 _lastPos; private Vector3 _vel; private bool _hasLast; private static readonly Color Aire = new Color(0.9f, 0.97f, 1f, 1f); public static void Attach(Player p) { //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) if (!((Object)(object)p == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { Detach(p); GameObject val = new GameObject("MT_LevitarRemolinos"); val.transform.SetParent(((Component)p).transform, false); val.AddComponent().Init(p); } } public static void Detach(Player p) { if (!((Object)(object)p == (Object)null)) { Transform val = ((Component)p).transform.Find("MT_LevitarRemolinos"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } private void Init(Player p) { //IL_003f: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) _player = p; Animator componentInChildren = ((Component)p).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.isHuman) { _leftFoot = componentInChildren.GetBoneTransform((HumanBodyBones)5); _rightFoot = componentInChildren.GetBoneTransform((HumanBodyBones)6); } _mat = Vfx.NewMaterial(Texture2D.whiteTexture, Color.white); AnimationCurve widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.004f), new Keyframe(0.55f, 0.035f), new Keyframe(1f, 0.012f) }); for (int i = 0; i < 18; i++) { GameObject val = new GameObject("Trazo"); val.transform.SetParent(((Component)this).transform, false); LineRenderer val2 = val.AddComponent(); ((Renderer)val2).sharedMaterial = _mat; val2.useWorldSpace = true; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; val2.numCapVertices = 2; val2.widthCurve = widthCurve; val2.positionCount = 0; _trazos[i] = new Trazo { Lr = val2 }; } } private void Update() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_0090: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0131: 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) if ((Object)(object)_player == (Object)null || !Levitacion.Active || ((Character)_player).IsDead()) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float deltaTime = Time.deltaTime; bool button = ZInput.GetButton("Run"); _speedMult = Mathf.MoveTowards(_speedMult, button ? 2f : 1f, deltaTime * 4f); Vector3 position = ((Component)_player).transform.position; Vector3 val = ((_hasLast && deltaTime > 0f) ? ((position - _lastPos) / deltaTime) : Vector3.zero); _lastPos = position; _hasLast = true; _vel = Vector3.Lerp(_vel, val, Mathf.Clamp01(deltaTime * 10f)); float magnitude = ((Vector3)(ref _vel)).magnitude; Vector3 val3; if (!(magnitude < 0.6f)) { Vector3 val2 = -_vel / magnitude + Vector3.down * Mathf.Clamp(1.2f / (magnitude + 0.1f), 0.05f, 0.45f); val3 = ((Vector3)(ref val2)).normalized; } else { val3 = Vector3.down; } Vector3 dir = val3; _proximo -= deltaTime * _speedMult; if (_proximo <= 0f) { _proximo = Random.Range(0.07f, 0.12f); _izquierda = !_izquierda; Lanzar(_izquierda, dir, magnitude); } for (int i = 0; i < 18; i++) { Animar(_trazos[i], deltaTime); } } private Vector3 Pie(bool izquierda) { //IL_002d: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //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) Transform val = (izquierda ? _leftFoot : _rightFoot); if ((Object)(object)val != (Object)null) { return val.position; } return ((Component)_player).transform.position + ((Component)_player).transform.right * (izquierda ? (-0.2f) : 0.2f) + Vector3.up * 0.1f; } private void Lanzar(bool izquierda, Vector3 dir, float speed) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_026f: 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_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) Trazo trazo = null; for (int i = 0; i < 18; i++) { if (_trazos[i].Edad < 0f) { trazo = _trazos[i]; break; } } if (trazo == null) { return; } Vector3 val = Vector3.Cross(dir, (Mathf.Abs(dir.y) > 0.9f) ? ((Component)_player).transform.forward : Vector3.up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (izquierda) { val2 = -val2; } val2 = Quaternion.AngleAxis(Random.Range(-35f, 35f), dir) * val2; Vector3 val3 = Pie(izquierda); float num = Random.Range(0.55f, 0.9f) * (1f + Mathf.Min(speed, 12f) * 0.04f); float num2 = Random.Range(0.1f, 0.18f); float num3 = ((Random.value < 0.5f) ? 1f : (-1f)); if (Random.value < 0.45f) { float num4 = Random.Range(2f, 3.2f); float num5 = num2 * 0.85f; for (int j = 0; j < 40; j++) { float num6 = (float)j / 39f; float num7 = num6 * (float)Math.PI * 2f * num4; float num8 = num5 * (0.5f + 0.5f * num6); trazo.Camino[j] = val3 + dir * (num * 1.1f * num6 + Mathf.Sin(num7) * num8) + val2 * ((1f - Mathf.Cos(num7)) * num8 * num3); } } else { Vector3 val4 = val3; for (int k = 0; k < 20; k++) { float num9 = (float)k / 19f; val4 = val3 + dir * (num * num9) + val2 * (Mathf.Sin(num9 * (float)Math.PI) * 0.06f * num3); trazo.Camino[k] = val4; } Vector3 val5 = val4 + val2 * (num2 * num3); for (int l = 20; l < 40; l++) { float num10 = ((float)(l - 20) + 1f) / 20f; float num11 = num10 * (float)Math.PI * 1.7f; float num12 = num2 * (1f - 0.4f * num10); trazo.Camino[l] = val5 - val2 * (Mathf.Cos(num11) * num12 * num3) + dir * (Mathf.Sin(num11) * num12); } } trazo.Color = Aire; trazo.Edad = 0f; } private void Animar(Trazo tr, float dt) { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) if (tr.Edad < 0f) { return; } tr.Edad += dt * _speedMult; if (tr.Edad >= 0.85f) { tr.Edad = -1f; tr.Lr.positionCount = 0; return; } int num = Mathf.Clamp(Mathf.CeilToInt(tr.Edad / 0.42f * 39f), 0, 39); int num2 = Mathf.Clamp(Mathf.FloorToInt((tr.Edad - 0.5f) / 0.42f * 39f), 0, num); int num3 = num - num2 + 1; if (num3 < 2) { tr.Lr.positionCount = 0; return; } float num4 = 0.35f * tr.Edad * tr.Edad; tr.Lr.positionCount = num3; for (int i = 0; i < num3; i++) { Vector3 val = tr.Camino[num2 + i]; val.y -= num4; tr.Lr.SetPosition(i, val); } float num5 = Mathf.Clamp01(1f - (tr.Edad - 0.42f) / 0.43000004f); float num6 = 0.8f * num5; Color val2 = default(Color); ((Color)(ref val2))..ctor(tr.Color.r * num6, tr.Color.g * num6, tr.Color.b * num6, num6); tr.Lr.startColor = val2; tr.Lr.endColor = val2; } private void OnDestroy() { if ((Object)(object)_mat != (Object)null) { Object.Destroy((Object)(object)_mat); } } } public static class MagiaLogros { private static int[] _needed; private static string _neededCfg; private static readonly string[,] _keys = new string[16, 8]; public static int[] Needed { get { string text = MTMagiaPlugin.LanzamientosPorRango?.Value; if (_neededCfg != text || _needed == null) { _needed = RangoRules.ParseInts(text, RangoRules.LanzamientosPorDefecto); _neededCfg = text; } return _needed; } } private static string Key(Escuela e, int spellRank) { if (spellRank < 0 || spellRank >= 8) { return $"MT.Magia.L.{e}.{spellRank}"; } return _keys[(int)e, spellRank] ?? (_keys[(int)e, spellRank] = $"MT.Magia.L.{e}.{spellRank}"); } private static string KillsKey(Escuela e) { return "MT.Magia.Kills." + e; } public static float CastsF(Player p, Escuela e, int spellRank) { if (!p.m_customData.TryGetValue(Key(e, spellRank), out var value) || !float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return 0f; } return result; } public static int Casts(Player p, Escuela e, int spellRank) { return (int)CastsF(p, e, spellRank); } public static float CastsDesde(Player p, Escuela e, int spellRank) { float num = 0f; for (int i = spellRank; i <= 6; i++) { num += CastsF(p, e, i); } return num; } public static void AddCast(Player p, Escuela e, int spellRank, float amount) { if (!(amount <= 0f)) { p.m_customData[Key(e, spellRank)] = (CastsF(p, e, spellRank) + amount).ToString("0.##", CultureInfo.InvariantCulture); } } public static void SetCasts(Player p, Escuela e, int spellRank, int value) { p.m_customData[Key(e, spellRank)] = value.ToString(CultureInfo.InvariantCulture); } public static int Kills(Player p, Escuela e) { if (!p.m_customData.TryGetValue(KillsKey(e), out var value) || !int.TryParse(value, out var result)) { return 0; } return result; } public static void AddKill(Player p, Escuela e) { p.m_customData[KillsKey(e)] = (Kills(p, e) + 1).ToString(CultureInfo.InvariantCulture); } } public abstract class MagicSE : StatusEffect { public float Value; public static void Register(string name, string display, string tooltip, float ttl, Sprite icon = null) where T : MagicSE { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown T val = ScriptableObject.CreateInstance(); ((Object)val).name = name; ((StatusEffect)val).m_name = display; ((StatusEffect)val).m_tooltip = tooltip; ((StatusEffect)val).m_ttl = ttl; ((StatusEffect)val).m_icon = icon; ItemManager.Instance.AddStatusEffect(new CustomStatusEffect((StatusEffect)(object)val, false)); } public override void SetLevel(int itemLevel, float skillLevel) { ((StatusEffect)this).SetLevel(itemLevel, skillLevel); Value = skillLevel; } } public class SE_EscudoMagico : MagicSE { public float Absorb(float damage) { float num = Mathf.Min(Value, damage); Value -= num; if (Value <= 0.01f) { ((StatusEffect)this).m_time = ((StatusEffect)this).m_ttl + 1f; } return num; } public override string GetIconText() { return Mathf.CeilToInt(Value).ToString(); } } public class SE_Lento : MagicSE { public override void ModifySpeed(float baseSpeed, ref float speed, Character character, Vector3 dir) { speed *= Mathf.Clamp01(1f - Value); } } public class SE_Paralisis : MagicSE { public override void SetLevel(int itemLevel, float skillLevel) { base.SetLevel(itemLevel, skillLevel); if (skillLevel > 0f) { ((StatusEffect)this).m_ttl = skillLevel; } } public override void Setup(Character character) { ((StatusEffect)this).Setup(character); Player val = (Player)(object)((character is Player) ? character : null); if (val != null) { if (((StatusEffect)this).m_ttl <= 0f) { ((StatusEffect)this).m_ttl = 2f; } ((StatusEffect)this).m_ttl = Mathf.Min(((StatusEffect)this).m_ttl, 6f) * (1f - ResistenciaEstado.De(val)); } Vfx.Electric(character, (((StatusEffect)this).m_ttl > 0f) ? ((StatusEffect)this).m_ttl : 2f); } public override void ModifySpeed(float baseSpeed, ref float speed, Character character, Vector3 dir) { speed = 0f; } public override void ModifyJump(Vector3 baseJump, ref Vector3 jump) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) jump = Vector3.zero; } } public class SE_Recitando : MagicSE { public override void ModifySpeed(float baseSpeed, ref float speed, Character character, Vector3 dir) { speed *= 0.5f; } } public class SE_Aligerar : MagicSE { public override void Setup(Character character) { ((StatusEffect)this).Setup(character); Vfx.Gravity(character, ((StatusEffect)this).m_ttl, 0.65f); } public override void ModifyMaxCarryWeight(float baseLimit, ref float limit) { limit += 100f; } public override void ModifyJump(Vector3 baseJump, ref Vector3 jump) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) jump *= 1.25f; } public override void ModifyFallDamage(float baseDamage, ref float damage) { damage = 0f; } } public class SE_PasoViento : MagicSE { public override void Setup(Character character) { ((StatusEffect)this).Setup(character); Vfx.WindFeet(character, ((StatusEffect)this).m_ttl); } public override void ModifySpeed(float baseSpeed, ref float speed, Character character, Vector3 dir) { speed *= 1.4f; } public override void ModifyFallDamage(float baseDamage, ref float damage) { damage = 0f; } } public class SE_ImpulsoCarrera : MagicSE { private float _hojas; public override void ModifySpeed(float baseSpeed, ref float speed, Character character, Vector3 dir) { speed *= 1.4f; } public override void ModifyJump(Vector3 baseJump, ref Vector3 jump) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) jump *= 1.4f; } public override void UpdateStatusEffect(float dt) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) ((StatusEffect)this).UpdateStatusEffect(dt); if (!((Object)(object)((StatusEffect)this).m_character == (Object)null) && !((_hojas -= dt) > 0f)) { _hojas = 0.2f; Vfx.Leaves(((Component)((StatusEffect)this).m_character).transform.position + Vector3.up * 0.15f, Vector3.up, 1.2f, 3); } } } public class SE_ImpulsoViento : MagicSE { private bool _landed; private float _hojas; protected virtual bool Hojas => true; public override void ModifyFallDamage(float baseDamage, ref float damage) { damage = 0f; } public override void UpdateStatusEffect(float dt) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) ((StatusEffect)this).UpdateStatusEffect(dt); if (Hojas && !_landed && (Object)(object)((StatusEffect)this).m_character != (Object)null && (_hojas -= dt) <= 0f) { _hojas = 0.08f; Vector3 velocity = ((StatusEffect)this).m_character.GetVelocity(); Vfx.Leaves(((Component)((StatusEffect)this).m_character).transform.position + Vector3.up * 0.6f, (((Vector3)(ref velocity)).sqrMagnitude > 0.1f) ? (-((Vector3)(ref velocity)).normalized) : Vector3.up, 2f, 6); } if (!_landed && ((StatusEffect)this).m_time > 0.35f && (Object)(object)((StatusEffect)this).m_character != (Object)null && (((StatusEffect)this).m_character.IsOnGround() || ((StatusEffect)this).m_character.IsSwimming() || ((StatusEffect)this).m_character.IsAttached())) { _landed = true; ((StatusEffect)this).m_ttl = ((StatusEffect)this).m_time + 0.15f; } } } public class SE_CaidaTierra : SE_ImpulsoViento { protected override bool Hojas => false; } public class SE_Resistencia : MagicSE { public override void ModifyDamageMods(ref DamageModifiers modifiers) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_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) ((DamageModifiers)(ref modifiers)).Apply(new List { new DamageModPair { m_type = (DamageType)256, m_modifier = (DamageModifier)1 }, new DamageModPair { m_type = (DamageType)32, m_modifier = (DamageModifier)1 } }); } } public class SE_Inmunidad : MagicSE { public override void ModifyDamageMods(ref DamageModifiers modifiers) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_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) ((DamageModifiers)(ref modifiers)).Apply(new List { new DamageModPair { m_type = (DamageType)256, m_modifier = (DamageModifier)3 }, new DamageModPair { m_type = (DamageType)32, m_modifier = (DamageModifier)3 } }); } } public class SE_Regeneracion : MagicSE { private float _tick; public override void Setup(Character character) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) ((StatusEffect)this).Setup(character); Vfx.Heal(character, Vfx.Verde, destellos: false, ((StatusEffect)this).m_ttl, loop: true); } public override void UpdateStatusEffect(float dt) { ((StatusEffect)this).UpdateStatusEffect(dt); _tick += dt; if (!(_tick < 1f)) { _tick -= 1f; if ((Object)(object)((StatusEffect)this).m_character != (Object)null && ((StatusEffect)this).m_character.IsOwner()) { ((StatusEffect)this).m_character.Heal(Value, true); } } } } public class SE_PactoSangre : MagicSE { } public class SE_SenorSangre : MagicSE { } public class SE_BarreraFlechas : MagicSE { } public class SE_Reflectante : MagicSE { } public class SE_ReduccionDano : MagicSE { } public class SE_FortalezaDivina : MagicSE { } public class SE_Renacer : MagicSE { } public class SE_Vigor : MagicSE { public override string GetIconText() { return $"+{Value:0}%\n{Mathf.Max(0f, ((StatusEffect)this).m_ttl - ((StatusEffect)this).m_time):0}s"; } } public class SE_PielPiedra : MagicSE { public override void UpdateStatusEffect(float dt) { ((StatusEffect)this).UpdateStatusEffect(dt); if (!PielPiedra.Activa) { ((StatusEffect)this).m_time = ((StatusEffect)this).m_ttl + 1f; } } public override string GetIconText() { return Mathf.CeilToInt(Mathf.Max(0f, PielPiedra.Vida)) + "\n" + Mathf.Max(0f, PielPiedra.Hasta - Time.time).ToString("0") + "s"; } } public static class MagicEffects { public const string PielPiedraSE = "MT_PielPiedra"; public const string ImpulsoViento = "MT_ImpulsoViento"; public const string ImpulsoCarrera = "MT_ImpulsoCarrera"; public const string CaidaTierra = "MT_CaidaTierra"; public const string Escudo = "MT_EscudoMagico"; public const string Lento = "MT_Lento"; public const string Paralisis = "MT_Paralisis"; public const string Recitando = "MT_Recitando"; public const string PasoViento = "MT_PasoViento"; public const string Aligerar = "MT_Aligerar"; public const string Resistencia = "MT_Resistencia"; public const string Inmunidad = "MT_Inmunidad"; public const string Regeneracion = "MT_Regeneracion"; public const string Pacto = "MT_PactoSangre"; public const string Senor = "MT_SenorSangre"; public const string BarreraFlechas = "MT_BarreraFlechas"; public const string Reflectante = "MT_Reflectante"; public const string ReduccionDano = "MT_ReduccionDano"; public const string FortalezaDivina = "MT_FortalezaDivina"; public const string Renacer = "MT_Renacer"; public const string Vigor = "MT_Vigor"; public static void RegisterAll() { MagicSE.Register("MT_ImpulsoCarrera", Tr.Token("magia_se_impulsocarrera"), Tr.Token("magia_se_impulsocarrera_tt"), 6f, MTMagiaPlugin.Icon("viento")); MagicSE.Register("MT_CaidaTierra", Tr.Token("magia_se_caidatierra"), Tr.Token("magia_se_caidatierra_tt"), 60f, MTMagiaPlugin.Icon("tierra")); MagicSE.Register("MT_ImpulsoViento", Tr.Token("magia_se_impulsoviento"), Tr.Token("magia_se_impulsoviento_tt"), 60f, MTMagiaPlugin.Icon("viento")); MagicSE.Register("MT_EscudoMagico", Tr.Token("magia_se_escudo"), Tr.Token("magia_se_escudo_tt"), 60f, MTMagiaPlugin.Icon("barrera")); MagicSE.Register("MT_Lento", Tr.Token("magia_se_lento"), Tr.Token("magia_se_lento_tt"), 4f); MagicSE.Register("MT_Paralisis", Tr.Token("magia_se_paralisis"), Tr.Token("magia_se_paralisis_tt"), 2f); MagicSE.Register("MT_Recitando", Tr.Token("magia_se_recitando"), Tr.Token("magia_se_recitando_tt"), 5f); MagicSE.Register("MT_Aligerar", Tr.Token("magia_se_aligerar"), Tr.Token("magia_se_aligerar_tt"), 120f, MTMagiaPlugin.Icon("gravedad")); MagicSE.Register("MT_PasoViento", Tr.Token("magia_se_pasoviento"), Tr.Token("magia_se_pasoviento_tt"), 10f, MTMagiaPlugin.Icon("viento")); MagicSE.Register("MT_Resistencia", Tr.Token("magia_se_resistencia"), Tr.Token("magia_se_resistencia_tt"), 120f, MTMagiaPlugin.Icon("desintoxicacion")); MagicSE.Register("MT_Inmunidad", Tr.Token("magia_se_inmunidad"), Tr.Token("magia_se_inmunidad_tt"), 30f, MTMagiaPlugin.Icon("desintoxicacion")); MagicSE.Register("MT_Regeneracion", Tr.Token("magia_se_regeneracion"), Tr.Token("magia_se_regeneracion_tt"), 20f, MTMagiaPlugin.Icon("sanacion")); MagicSE.Register("MT_PactoSangre", Tr.Token("magia_se_pacto"), Tr.Token("magia_se_pacto_tt"), 20f, MTMagiaPlugin.Icon("sangre")); MagicSE.Register("MT_SenorSangre", Tr.Token("magia_se_senor"), Tr.Token("magia_se_senor_tt"), 30f, MTMagiaPlugin.Icon("sangre")); MagicSE.Register("MT_BarreraFlechas", Tr.Token("magia_se_barreraflechas"), Tr.Token("magia_se_barreraflechas_tt"), 8f, MTMagiaPlugin.Icon("barrera")); MagicSE.Register("MT_Reflectante", Tr.Token("magia_se_reflectante"), Tr.Token("magia_se_reflectante_tt"), 10f, MTMagiaPlugin.Icon("barrera")); MagicSE.Register("MT_ReduccionDano", Tr.Token("magia_se_reducciondano"), Tr.Token("magia_se_reducciondano_tt"), 8f, MTMagiaPlugin.Icon("barrera")); MagicSE.Register("MT_FortalezaDivina", Tr.Token("magia_se_fortalezadivina"), Tr.Token("magia_se_fortalezadivina_tt"), 15f, MTMagiaPlugin.Icon("barrera")); MagicSE.Register("MT_Vigor", Tr.Token("magia_se_vigor"), Tr.Token("magia_se_vigor_tt"), 120f, MTMagiaPlugin.Icon("sanacion")); MagicSE.Register("MT_PielPiedra", Tr.Token("magia_se_pielpiedra"), Tr.Token("magia_se_pielpiedra_tt"), 8f, MTMagiaPlugin.Icon("hechizo_piel_piedra") ?? MTMagiaPlugin.Icon("tierra")); MagicSE.Register("MT_Renacer", Tr.Token("magia_se_renacer"), Tr.Token("magia_se_renacer_tt"), 60f, MTMagiaPlugin.Icon("sanacion")); } } public static class ResistenciaEstado { public static float De(Player p) { if ((Object)(object)p == (Object)null) { return 0f; } int num = 0; foreach (Escuela value in Enum.GetValues(typeof(Escuela))) { num = Mathf.Max(num, Escuelas.Rank(p, value)); } return Mathf.Clamp((float)ToukiRules.Level(p) * 0.04f + (float)num * 0.05f, 0f, MTMagiaPlugin.ResistenciaEstadoMax.Value); } } public static class PielPiedra { public static float Hasta; public static float TambaleoListo; public static float Vida; public static bool Activa { get { if (Time.time < Hasta) { return Vida > 0f; } return false; } } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class MagicDefensePatch { private static void Prefix(Character __instance, HitData hit) { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Invalid comparison between Unknown and I4 //IL_013a: 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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Invalid comparison between Unknown and I4 //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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_0455: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //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) Player p = Player.m_localPlayer; if ((Object)(object)p == (Object)null || (Object)(object)__instance != (Object)(object)p || hit == null || ((Character)p).IsDead()) { return; } SEMan sEMan = ((Character)p).GetSEMan(); float totalDamage = hit.GetTotalDamage(); if (totalDamage <= 0f) { return; } hit.m_damage.m_fire *= 1f - Res(Escuela.Fuego, 0.15f); hit.m_damage.m_frost *= 1f - Res(Escuela.Agua, 0.15f); hit.m_damage.m_lightning *= 1f - Res(Escuela.Viento, 0.15f); hit.m_damage.m_poison *= 1f - Mathf.Max(Res(Escuela.Desintoxicacion, 0.15f), Res(Escuela.Sangre, 0.15f)); hit.m_damage.m_blunt *= 1f - Res(Escuela.Tierra, 0.1f); totalDamage = hit.GetTotalDamage(); if ((int)hit.m_hitType != 3 && (int)hit.m_hitType != 14) { Caster.Interrupt(); } bool flag = Vector3.Dot(((Component)p).transform.forward, hit.m_dir) < 0f; Character attacker = hit.GetAttacker(); if (PielPiedra.Activa) { float num = hit.m_damage.m_blunt + hit.m_damage.m_slash + hit.m_damage.m_pierce; if (num > 0f) { float num2 = Mathf.Min(num * 0.8f, PielPiedra.Vida); float num3 = (num - num2) / num; hit.m_damage.m_blunt *= num3; hit.m_damage.m_slash *= num3; hit.m_damage.m_pierce *= num3; PielPiedra.Vida -= num2; Particulas.Tierra(hit.m_point, 0.35f, 0.5f); if (!hit.m_ranged && (Object)(object)attacker != (Object)null && (Object)(object)attacker != (Object)(object)p && !attacker.IsDead() && Time.time >= PielPiedra.TambaleoListo) { PielPiedra.TambaleoListo = Time.time + 1.5f; attacker.Stagger(-hit.m_dir); } if (PielPiedra.Vida <= 0f) { PielPiedra.Hasta = 0f; PielPiedraCapa.Romper(p); ((Character)p).Message((MessageType)1, Tr.Get("magia_stone_skin_broke"), 0, (Sprite)null, false); } } } if ((sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_EscudoMagico")) || sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_ReduccionDano")) || sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_FortalezaDivina"))) && !hit.m_ranged && (Object)(object)attacker != (Object)null && (Object)(object)attacker != (Object)(object)p && !attacker.IsDead() && Time.time >= PielPiedra.TambaleoListo) { PielPiedra.TambaleoListo = Time.time + 2f; attacker.Stagger(-hit.m_dir); } if (hit.m_ranged && flag && sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_BarreraFlechas"))) { ((DamageTypes)(ref hit.m_damage)).Modify(0f); Fx.Visual("fx_StaffShield_Hit", hit.m_point); return; } if (hit.m_ranged && sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Reflectante"))) { Character attacker2 = hit.GetAttacker(); if ((Object)(object)attacker2 != (Object)null && !attacker2.IsDead()) { Fx.Damage(p, attacker2, new DamageTypes { m_blunt = totalDamage * 0.3f }, (SkillType)0); } ((DamageTypes)(ref hit.m_damage)).Modify(0.7f); } if (sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_ReduccionDano"))) { ((DamageTypes)(ref hit.m_damage)).Modify(0.5f); } if (sEMan.GetStatusEffect(StringExtensionMethods.GetStableHashCode("MT_EscudoMagico")) is SE_EscudoMagico sE_EscudoMagico) { totalDamage = hit.GetTotalDamage(); float num4 = sE_EscudoMagico.Absorb(totalDamage); if (num4 > 0f) { ((DamageTypes)(ref hit.m_damage)).Modify(Mathf.Clamp01((totalDamage - num4) / totalDamage)); Fx.Visual("fx_StaffShield_Hit", hit.m_point); } } totalDamage = hit.GetTotalDamage(); float num5 = ((Character)p).GetMaxHealth() * 0.1f; if (totalDamage > num5 && sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_FortalezaDivina"))) { ((DamageTypes)(ref hit.m_damage)).Modify(num5 / totalDamage); } totalDamage = hit.GetTotalDamage(); if (!(totalDamage >= ((Character)p).GetHealth()) || !sEMan.HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Renacer"))) { return; } ((DamageTypes)(ref hit.m_damage)).Modify(Mathf.Max(0f, ((Character)p).GetHealth() - 1f) / totalDamage); sEMan.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Renacer"), false); SpellRunner.After(0.1f, delegate { //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (!((Character)p).IsDead()) { ((Character)p).Heal(((Character)p).GetMaxHealth() * 0.5f, true); Vfx.Heal((Character)(object)p, Vfx.Verde, destellos: false, 2.5f); } }); ((Character)p).Message((MessageType)2, Tr.Get("magia_are_reborn"), 0, (Sprite)null, false); float Res(Escuela e, float max) { return Mathf.Clamp01(Escuelas.Level(p, e) / 100f) * max; } } } [HarmonyPatch(typeof(Humanoid), "StartAttack")] public static class ParalysisPatch { private static bool Prefix(Humanoid __instance, ref bool __result) { if (!((Character)__instance).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Paralisis"))) { return true; } __result = false; return false; } } [HarmonyPatch(typeof(Character), "Damage")] public static class LifestealPatch { private static void Prefix(Character __instance, HitData hit) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && hit != null && !((Object)(object)__instance == (Object)(object)localPlayer) && !((Object)(object)hit.GetAttacker() != (Object)(object)localPlayer) && ((Character)localPlayer).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_SenorSangre"))) { ((Character)localPlayer).Heal(hit.GetTotalDamage() * 0.1f, false); } } } [HarmonyPatch(typeof(Menu), "Update")] public static class MenuMagiaEscPatch { private static bool Prefix() { if (!Caster.MenuOpen || !ZInput.GetKeyDown((KeyCode)27, false)) { return true; } Caster.ToggleMenu(open: false); return false; } } public static class Mk1Diaria { private const string SesionKey = "MT.Magia.Mk1.Sesion"; private const string UsadaKey = "MT.Magia.Mk1.Usada"; private static int Hoy { get { if (!((Object)(object)EnvMan.instance != (Object)null)) { return 0; } return EnvMan.instance.GetDay(); } } private static bool Dia(Player p, string key, out int dia) { dia = -1; if (p.m_customData.TryGetValue(key, out var value)) { return int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out dia); } return false; } public static bool EnSesion(Player p) { if ((Object)(object)p != (Object)null) { return p.m_customData.ContainsKey("MT.Magia.Mk1.Sesion"); } return false; } private static void RevisarMundo(Player p) { if (Mundo.Cambio(p, "MT.Magia.Mk1Diaria.Mundo")) { p.m_customData.Remove("MT.Magia.Mk1.Usada"); if (EnSesion(p)) { p.m_customData["MT.Magia.Mk1.Sesion"] = Hoy.ToString(CultureInfo.InvariantCulture); } } } public static bool UsadaHoy(Player p) { if ((Object)(object)p == (Object)null) { return false; } RevisarMundo(p); if (!EnSesion(p) && Dia(p, "MT.Magia.Mk1.Usada", out var dia)) { return dia >= Hoy; } return false; } public static bool PuedeEncender(Player p) { if ((Object)(object)p == (Object)null) { return false; } RevisarMundo(p); if (EnSesion(p)) { return true; } if (UsadaHoy(p)) { return false; } p.m_customData["MT.Magia.Mk1.Sesion"] = Hoy.ToString(CultureInfo.InvariantCulture); return true; } public static void Terminar(Player p) { if (!((Object)(object)p == (Object)null)) { RevisarMundo(p); if (EnSesion(p)) { int dia; int num = (Dia(p, "MT.Magia.Mk1.Sesion", out dia) ? dia : Hoy); p.m_customData.Remove("MT.Magia.Mk1.Sesion"); p.m_customData["MT.Magia.Mk1.Usada"] = num.ToString(CultureInfo.InvariantCulture); } } } } internal static class Mk1Material { private static Material _material; private static Material _joint; private static Material _body; private static Material _armas; internal static Material Joint() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_joint != (Object)null) { return _joint; } Material val = Get(); if ((Object)(object)val == (Object)null) { return null; } _joint = new Material(val) { name = "MT_Mk1_Junta" }; _joint.SetTexture("_MainTex", (Texture)(object)Texture2D.whiteTexture); _joint.SetColor("_Color", new Color(0.12f, 0.13f, 0.1f)); _joint.SetTexture("_MetallicGlossMap", (Texture)null); _joint.DisableKeyword("_METALLICGLOSSMAP"); _joint.SetFloat("_UseGlossmap", 0f); _joint.SetFloat("_Metallic", 0.2f); _joint.SetFloat("_Glossiness", 0.2f); return _joint; } private static Texture2D Load(string name, bool warn = true) { string text = Path.Combine(MTMagiaPlugin.ModelDir, "mk1_" + name + ".png"); if (!File.Exists(text)) { if (warn) { MTMagiaPlugin.Log.LogError((object)("Mk-I: falta textura " + text)); } return null; } Texture2D obj = AssetUtils.LoadTexture(text, true); ((Texture)obj).wrapMode = (TextureWrapMode)0; ((Texture)obj).anisoLevel = 4; return obj; } public static void ClearCache() { _material = null; _joint = null; _body = null; _armas = null; } internal static Material Body() { return _body ?? (_body = Con("cuerpo")); } internal static Material Armas() { return _armas ?? (_armas = Con("armas")); } private static Material Con(string prefijo) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_020e: 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_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Expected O, but got Unknown //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown Material val = Get(); if ((Object)(object)val == (Object)null) { return null; } Texture2D val2 = Load(prefijo + "_color", warn: false); if ((Object)(object)val2 == (Object)null) { return val; } Material val3 = new Material(val) { name = "MT_Mk1_" + prefijo }; val3.SetTexture("_MainTex", (Texture)(object)val2); val3.SetTextureScale("_MainTex", Vector2.one); val3.SetColor("_Color", MTMagiaPlugin.Mk1Tinte.Value); Texture2D val4 = Load(prefijo + "_metallic", warn: false); Texture2D val5 = Load(prefijo + "_roughness", warn: false); if ((Object)(object)val4 != (Object)null && (Object)(object)val5 != (Object)null && ((Texture)val4).width == ((Texture)val5).width && ((Texture)val4).height == ((Texture)val5).height) { Color[] pixels = val4.GetPixels(); Color[] pixels2 = val5.GetPixels(); float num = MTMagiaPlugin.Mk1Metal.Value * 4f; float num2 = MTMagiaPlugin.Mk1Brillo.Value * 2f; for (int i = 0; i < pixels.Length; i++) { pixels[i] = new Color(Mathf.Clamp01(pixels[i].r * num), 0f, 0f, Mathf.Clamp01((1f - pixels2[i].r) * num2)); } Texture2D val6 = new Texture2D(((Texture)val4).width, ((Texture)val4).height, (TextureFormat)4, true, true) { name = "Mk1_Cuerpo_MetalSmooth" }; val6.SetPixels(pixels); val6.Apply(true, true); val3.SetTexture("_MetallicGlossMap", (Texture)(object)val6); val3.EnableKeyword("_METALLICGLOSSMAP"); } Texture2D val7 = Load(prefijo + "_normal", warn: false); if ((Object)(object)val7 != (Object)null) { Color[] pixels3 = val7.GetPixels(); for (int j = 0; j < pixels3.Length; j++) { pixels3[j] = new Color(1f, pixels3[j].g, 1f, pixels3[j].r); } Texture2D val8 = new Texture2D(((Texture)val7).width, ((Texture)val7).height, (TextureFormat)4, true, true) { name = "Mk1_Cuerpo_NormalAG" }; val8.SetPixels(pixels3); val8.Apply(true, true); val3.SetTexture("_BumpMap", (Texture)(object)val8); val3.EnableKeyword("_NORMALMAP"); } return val3; } internal static Material Get() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0327: 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_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Expected O, but got Unknown //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: 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_0298: Expected O, but got Unknown if ((Object)(object)_material != (Object)null) { return _material; } GameObject prefab = PrefabManager.Instance.GetPrefab("ShieldIronTower"); Material val = null; if ((Object)(object)prefab != (Object)null) { Renderer[] componentsInChildren = prefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] sharedMaterials = componentsInChildren[i].sharedMaterials; foreach (Material val2 in sharedMaterials) { if ((Object)(object)val2 != (Object)null && val2.HasProperty("_MetallicGlossMap")) { val = val2; break; } } } } if ((Object)(object)val == (Object)null) { MTMagiaPlugin.Log.LogError((object)"Mk-I: falta el material metálico del escudo de hierro"); return null; } _material = new Material(val) { name = "MT_Mk1_Oliva_PBR" }; Texture2D val3 = Load("Camouflage") ?? Load("BaseColor"); Texture2D val4 = Load("Normal"); Texture2D val5 = Load("Metallic"); Texture2D val6 = Load("Roughness"); _material.SetTexture("_MainTex", (Texture)(object)val3); _material.SetColor("_Color", MTMagiaPlugin.Mk1Tinte.Value); _material.SetFloat("_UseStyles", 0f); _material.DisableKeyword("_USESTYLES_ON"); _material.SetTexture("_StyleTex", (Texture)null); _material.SetFloat("_Cutoff", 0f); _material.SetFloat("_Metallic", MTMagiaPlugin.Mk1Metal.Value); _material.SetFloat("_GlossMapScale", 1f); _material.SetFloat("_UseGlossmap", 1f); _material.SetFloat("_BumpScale", 0.65f); if ((Object)(object)val5 != (Object)null && (Object)(object)val6 != (Object)null && ((Texture)val5).width == ((Texture)val6).width && ((Texture)val5).height == ((Texture)val6).height) { Color[] pixels = val5.GetPixels(); Color[] pixels2 = val6.GetPixels(); float value = MTMagiaPlugin.Mk1Metal.Value; float value2 = MTMagiaPlugin.Mk1Brillo.Value; for (int k = 0; k < pixels.Length; k++) { pixels[k] = new Color(pixels[k].r * value, 0f, 0f, (1f - pixels2[k].r) * value2); } Texture2D val7 = new Texture2D(((Texture)val5).width, ((Texture)val5).height, (TextureFormat)4, true, true); ((Object)val7).name = "Mk1_MetalSmoothness"; val7.SetPixels(pixels); val7.Apply(true, true); _material.SetTexture("_MetallicGlossMap", (Texture)(object)val7); _material.EnableKeyword("_METALLICGLOSSMAP"); Object.Destroy((Object)(object)val5); Object.Destroy((Object)(object)val6); } if ((Object)(object)val4 != (Object)null) { Color[] pixels3 = val4.GetPixels(); for (int l = 0; l < pixels3.Length; l++) { pixels3[l] = new Color(1f, pixels3[l].g, 1f, pixels3[l].r); } Texture2D val8 = new Texture2D(((Texture)val4).width, ((Texture)val4).height, (TextureFormat)4, true, true); ((Object)val8).name = "Mk1_NormalAG"; val8.SetPixels(pixels3); val8.Apply(true, true); _material.SetTexture("_BumpMap", (Texture)(object)val8); _material.EnableKeyword("_NORMALMAP"); Object.Destroy((Object)(object)val4); } return _material; } } internal static class Mk1Rig { private static readonly Dictionary Names = new Dictionary { { (HumanBodyBones)0, "Hips" }, { (HumanBodyBones)8, "Spine2" }, { (HumanBodyBones)10, "Head" }, { (HumanBodyBones)13, "LeftArm" }, { (HumanBodyBones)14, "RightArm" }, { (HumanBodyBones)15, "LeftForeArm" }, { (HumanBodyBones)16, "RightForeArm" }, { (HumanBodyBones)17, "LeftHand" }, { (HumanBodyBones)18, "RightHand" }, { (HumanBodyBones)1, "LeftUpLeg" }, { (HumanBodyBones)2, "RightUpLeg" }, { (HumanBodyBones)3, "LeftLeg" }, { (HumanBodyBones)4, "RightLeg" }, { (HumanBodyBones)5, "LeftFoot" }, { (HumanBodyBones)6, "RightFoot" } }; internal static Transform Find(Transform root, HumanBodyBones bone) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) string text = Names[bone]; Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (((Object)val).name == text) { return val; } } return null; } internal static bool Attach(GameObject piece, Player player, HumanBodyBones id, string name) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) GameObject prefab = PrefabManager.Instance.GetPrefab("Player"); if ((Object)(object)prefab == (Object)null) { return false; } Transform val = Find(prefab.transform, id); Transform val2 = Find(((Component)player).transform, id); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { return false; } string text = null; float num = 0f; if (name.StartsWith("brazo_")) { text = (name.EndsWith("der") ? "RightForeArm" : "LeftForeArm"); num = 0.45f; } if (name.StartsWith("antebrazo_")) { text = (name.EndsWith("der") ? "RightHand" : "LeftHand"); num = 0.31f; } if (name.StartsWith("muslo_")) { text = (name.EndsWith("der") ? "RightLeg" : "LeftLeg"); num = 0.425f; } if (name.StartsWith("pierna_")) { text = (name.EndsWith("der") ? "RightFoot" : "LeftFoot"); num = 0.31f; } Transform val3 = val; if (name.StartsWith("mano_")) { val3 = val.parent; } if (name == "canon" || name == "escudo" || name.StartsWith("mano_")) { text = ((name == "canon" || name.EndsWith("der")) ? "RightHand" : "LeftHand"); } Vector3 val4 = prefab.transform.up; float num2 = 1f; if (text != null) { Transform[] componentsInChildren = ((Component)val3).GetComponentsInChildren(true); foreach (Transform val5 in componentsInChildren) { if (!(((Object)val5).name == text)) { continue; } Vector3 val6 = val5.position - val3.position; if (((Vector3)(ref val6)).sqrMagnitude > 1E-06f) { val4 = -((Vector3)(ref val6)).normalized; if (num > 0f) { num2 = ((Vector3)(ref val6)).magnitude / num; } } break; } } Vector3 val7 = Vector3.ProjectOnPlane(prefab.transform.forward, val4); Vector3 normalized = ((Vector3)(ref val7)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude < 0.1f) { return false; } Quaternion val8 = Quaternion.LookRotation(normalized, val4); piece.transform.SetParent(val2, false); piece.transform.localPosition = Vector3.zero; piece.transform.localRotation = Quaternion.Inverse(val.rotation) * val8; float num3 = Mathf.Clamp(MTMagiaPlugin.Mk1Escala.Value, 0.5f, 2f); if (ArmaduraMk1.Worn(player)) { num3 *= MTMagiaPlugin.Mk1Tamano.Value; } Vector3 lossyScale = val2.lossyScale; piece.transform.localScale = new Vector3(num3 / Mathf.Abs(lossyScale.x), num3 * num2 / Mathf.Abs(lossyScale.y), num3 / Mathf.Abs(lossyScale.z)); return true; } } public static class Mk1Skin { private class Seg { public Transform Bone; public Vector3 A; public Vector3 B; public int Side; } private class Junta { public string Name; public string Parent; public Vector3 Pos; } private class RigData { public Mesh Mesh; public string[] Bones; public List Juntas; public bool PoseActual; public bool TPose; } private static readonly HumanBodyBones[][] Cadenas = new HumanBodyBones[17][] { (HumanBodyBones[])(object)new HumanBodyBones[2] { default(HumanBodyBones), (HumanBodyBones)7 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)7, (HumanBodyBones)8 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)8, (HumanBodyBones)9 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)9, (HumanBodyBones)10 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)10, (HumanBodyBones)10 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)14, (HumanBodyBones)16 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)16, (HumanBodyBones)18 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)18, (HumanBodyBones)18 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)13, (HumanBodyBones)15 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)15, (HumanBodyBones)17 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)17, (HumanBodyBones)17 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)2, (HumanBodyBones)4 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)4, (HumanBodyBones)6 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)6, (HumanBodyBones)6 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)1, (HumanBodyBones)3 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)3, (HumanBodyBones)5 }, (HumanBodyBones[])(object)new HumanBodyBones[2] { (HumanBodyBones)5, (HumanBodyBones)5 } }; private static Mesh _source; private static Mesh _rigMesh; private static string[] _rigBones; private static List _juntas; private static readonly Dictionary _partes = new Dictionary(); public static bool Available { get { if (!File.Exists(Path.Combine(MTMagiaPlugin.ModelDir, "mk1_cuerpo.obj"))) { return File.Exists(RigPath); } return true; } } private static string RigPath => Path.Combine(MTMagiaPlugin.ModelDir, "mk1_cuerpo_rig.txt"); private static bool LoadRig() { //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0305: 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_0314: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0326: 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_033e: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_0280: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_rigMesh != (Object)null) { return true; } if (!File.Exists(RigPath)) { return false; } CultureInfo ci = CultureInfo.InvariantCulture; List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List(); List list7 = new List(); string[] array = File.ReadAllLines(RigPath); foreach (string text in array) { string[] p; if (text.Length >= 2) { p = text.Split(new char[1] { ' ' }); if (p[0] == "B") { list.Add(p[1]); } else if (p[0] == "J") { list2.Add(new Junta { Name = p[1], Parent = p[2], Pos = new Vector3(float.Parse(p[3], ci), float.Parse(p[4], ci), float.Parse(p[5], ci)) }); } else if (p[0] == "V") { list3.Add(new Vector3(F(1), F(2), F(3))); list4.Add(new Vector3(F(4), F(5), F(6))); list5.Add(new Vector2(F(7), F(8))); BoneWeight item = default(BoneWeight); ((BoneWeight)(ref item)).boneIndex0 = int.Parse(p[9]); ((BoneWeight)(ref item)).weight0 = F(10); ((BoneWeight)(ref item)).boneIndex1 = int.Parse(p[11]); ((BoneWeight)(ref item)).weight1 = F(12); ((BoneWeight)(ref item)).boneIndex2 = int.Parse(p[13]); ((BoneWeight)(ref item)).weight2 = F(14); ((BoneWeight)(ref item)).boneIndex3 = int.Parse(p[15]); ((BoneWeight)(ref item)).weight3 = F(16); list6.Add(item); } else if (p[0] == "T") { list7.Add(int.Parse(p[1])); list7.Add(int.Parse(p[2])); list7.Add(int.Parse(p[3])); } } float F(int num) { return float.Parse(p[num], ci); } } Mesh val = new Mesh { name = "MT_Mk1_CuerpoRig", indexFormat = (IndexFormat)1 }; val.SetVertices(list3); val.SetNormals(list4); val.SetUVs(0, list5); val.SetTriangles(list7, 0); val.boneWeights = list6.ToArray(); val.RecalculateBounds(); _rigMesh = val; _rigBones = list.ToArray(); _juntas = list2; MTMagiaPlugin.Log.LogInfo((object)$"Mk-I: esqueleto de Blender cargado ({list3.Count} vértices, {list.Count} huesos)"); return true; } private static GameObject BuildOwn(Player p, Animator anim) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00f2: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0231: 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) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)p).transform; Transform boneTransform = anim.GetBoneTransform((HumanBodyBones)10); float num = (((Object)(object)boneTransform != (Object)null) ? (transform.InverseTransformPoint(boneTransform.position).y + 0.3f) : 2f) * MTMagiaPlugin.Mk1Volumen.Value; Mesh val = Object.Instantiate(_rigMesh); Vector3[] vertices = val.vertices; for (int i = 0; i < vertices.Length; i++) { ref Vector3 reference = ref vertices[i]; reference *= num; } val.vertices = vertices; val.RecalculateBounds(); val.RecalculateTangents(); GameObject val2 = new GameObject("MT_Mk1_Cuerpo"); val2.layer = ((Component)p).gameObject.layer; val2.transform.SetParent(transform, false); Dictionary dictionary = new Dictionary(); foreach (Junta junta in _juntas) { Transform transform2 = new GameObject("MT_Mk1_Hueso_" + junta.Name).transform; transform2.SetParent(val2.transform, false); transform2.localPosition = junta.Pos * num; dictionary[junta.Name] = transform2; } foreach (Junta junta2 in _juntas) { if (junta2.Parent != "-" && dictionary.TryGetValue(junta2.Parent, out var value)) { dictionary[junta2.Name].SetParent(value, true); } } Transform[] array = (Transform[])(object)new Transform[_rigBones.Length]; Matrix4x4[] array2 = (Matrix4x4[])(object)new Matrix4x4[_rigBones.Length]; for (int j = 0; j < array.Length; j++) { if (!dictionary.TryGetValue(_rigBones[j], out var value2)) { value2 = (dictionary.ContainsKey("Hips") ? dictionary["Hips"] : val2.transform); } array[j] = value2; array2[j] = value2.worldToLocalMatrix * val2.transform.localToWorldMatrix; } val.bindposes = array2; SkinnedMeshRenderer val3 = val2.AddComponent(); val3.bones = array; val3.rootBone = (dictionary.ContainsKey("Hips") ? dictionary["Hips"] : val2.transform); val3.sharedMesh = val; val3.updateWhenOffscreen = true; Material val4 = Mk1Material.Body(); if ((Object)(object)val4 != (Object)null) { ((Renderer)val3).sharedMaterial = val4; } Dictionary dictionary2 = new Dictionary(); Transform[] componentsInChildren = ((Component)anim).GetComponentsInChildren(true); foreach (Transform val5 in componentsInChildren) { if (!dictionary2.ContainsKey(((Object)val5).name)) { dictionary2[((Object)val5).name] = val5; } } Mk1Retarget mk1Retarget = val2.AddComponent(); Dictionary dictionary3 = (MTMagiaPlugin.Mk1PoseBase.Value ? BindPose(p) : null); foreach (KeyValuePair item in dictionary) { if (dictionary2.TryGetValue(item.Key, out var value3)) { if (dictionary3 != null && dictionary3.TryGetValue(((Object)value3).name, out var value4)) { mk1Retarget.Add(item.Value, value3, transform, ((Matrix4x4)(ref value4)).rotation, Vector4.op_Implicit(((Matrix4x4)(ref value4)).GetColumn(3))); } else { mk1Retarget.Add(item.Value, value3, transform); } } } return val2; } public static void ClearCache() { _partes.Clear(); } public static bool PartAvailable(string pieza) { return File.Exists(Path.Combine(MTMagiaPlugin.ModelDir, "mk1_" + pieza + "_rig.txt")); } private static RigData LoadPart(string pieza) { //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) if (_partes.TryGetValue(pieza, out var value)) { return value; } string path = Path.Combine(MTMagiaPlugin.ModelDir, "mk1_" + pieza + "_rig.txt"); if (!File.Exists(path)) { return null; } CultureInfo ci = CultureInfo.InvariantCulture; value = new RigData { Juntas = new List() }; List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List(); string[] array = File.ReadAllLines(path); foreach (string text in array) { string[] p; if (text.Length >= 2) { p = text.Split(new char[1] { ' ' }); if (p[0] == "POSE") { value.PoseActual = p.Length > 1 && p[1] == "actual"; value.TPose = p.Length > 1 && p[1] == "tpose"; } else if (p[0] == "B") { list.Add(p[1]); } else if (p[0] == "J") { value.Juntas.Add(new Junta { Name = p[1], Parent = p[2], Pos = new Vector3(float.Parse(p[3], ci), float.Parse(p[4], ci), float.Parse(p[5], ci)) }); } else if (p[0] == "V") { list2.Add(new Vector3(F(1), F(2), F(3))); list3.Add(new Vector3(F(4), F(5), F(6))); list4.Add(new Vector2(F(7), F(8))); BoneWeight item = default(BoneWeight); ((BoneWeight)(ref item)).boneIndex0 = int.Parse(p[9]); ((BoneWeight)(ref item)).weight0 = F(10); ((BoneWeight)(ref item)).boneIndex1 = int.Parse(p[11]); ((BoneWeight)(ref item)).weight1 = F(12); ((BoneWeight)(ref item)).boneIndex2 = int.Parse(p[13]); ((BoneWeight)(ref item)).weight2 = F(14); ((BoneWeight)(ref item)).boneIndex3 = int.Parse(p[15]); ((BoneWeight)(ref item)).weight3 = F(16); list5.Add(item); } else if (p[0] == "T") { list6.Add(int.Parse(p[1])); list6.Add(int.Parse(p[2])); list6.Add(int.Parse(p[3])); } } float F(int num) { return float.Parse(p[num], ci); } } Mesh val = new Mesh { name = "MT_Mk1_" + pieza, indexFormat = (IndexFormat)1 }; val.SetVertices(list2); val.SetNormals(list3); val.SetUVs(0, list4); val.SetTriangles(list6, 0); val.boneWeights = list5.ToArray(); val.RecalculateBounds(); value.Mesh = val; value.Bones = list.ToArray(); _partes[pieza] = value; MTMagiaPlugin.Log.LogInfo((object)$"Mk-I: pieza «{pieza}» cargada ({list2.Count} vértices, {list.Count} huesos)"); return value; } public static GameObject BuildPart(Player p, Animator anim, string pieza) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_012a: 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_014f: 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_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) RigData rigData = LoadPart(pieza); if (rigData == null) { return null; } if (rigData.TPose) { GameObject val = BuildOnPlayerSkeleton(p, rigData, pieza); if ((Object)(object)val != (Object)null) { return val; } } Transform transform = ((Component)p).transform; Transform boneTransform = anim.GetBoneTransform((HumanBodyBones)10); float num = (((Object)(object)boneTransform != (Object)null) ? (transform.InverseTransformPoint(boneTransform.position).y + 0.3f) : 2f) * MTMagiaPlugin.Mk1Volumen.Value; Mesh val2 = Object.Instantiate(rigData.Mesh); Vector3[] vertices = val2.vertices; for (int i = 0; i < vertices.Length; i++) { ref Vector3 reference = ref vertices[i]; reference *= num; } val2.vertices = vertices; val2.RecalculateBounds(); val2.RecalculateTangents(); GameObject val3 = new GameObject("MT_Mk1_" + pieza); val3.layer = ((Component)p).gameObject.layer; val3.transform.SetParent(transform, false); Dictionary dictionary = new Dictionary(); foreach (Junta junta in rigData.Juntas) { Transform transform2 = new GameObject("MT_Mk1_Hueso_" + junta.Name).transform; transform2.SetParent(val3.transform, false); transform2.localPosition = junta.Pos * num; dictionary[junta.Name] = transform2; } foreach (Junta junta2 in rigData.Juntas) { if (junta2.Parent != "-" && dictionary.TryGetValue(junta2.Parent, out var value)) { dictionary[junta2.Name].SetParent(value, true); } } Transform[] array = (Transform[])(object)new Transform[rigData.Bones.Length]; Matrix4x4[] array2 = (Matrix4x4[])(object)new Matrix4x4[rigData.Bones.Length]; for (int j = 0; j < array.Length; j++) { if (!dictionary.TryGetValue(rigData.Bones[j], out var value2)) { value2 = (dictionary.ContainsKey("Hips") ? dictionary["Hips"] : val3.transform); } array[j] = value2; array2[j] = value2.worldToLocalMatrix * val3.transform.localToWorldMatrix; } val2.bindposes = array2; SkinnedMeshRenderer val4 = val3.AddComponent(); val4.bones = array; val4.rootBone = (dictionary.ContainsKey("Hips") ? dictionary["Hips"] : val3.transform); val4.sharedMesh = val2; val4.updateWhenOffscreen = true; Material val5 = Mk1Material.Body(); if ((Object)(object)val5 != (Object)null) { ((Renderer)val4).sharedMaterial = val5; } Dictionary dictionary2 = new Dictionary(); Transform[] componentsInChildren = ((Component)anim).GetComponentsInChildren(true); foreach (Transform val6 in componentsInChildren) { if (!dictionary2.ContainsKey(((Object)val6).name)) { dictionary2[((Object)val6).name] = val6; } } Mk1Retarget mk1Retarget = val3.AddComponent(); Dictionary dictionary3 = ((!rigData.PoseActual && MTMagiaPlugin.Mk1PoseBase.Value) ? BindPose(p) : null); foreach (KeyValuePair item in dictionary) { if (dictionary2.TryGetValue(item.Key, out var value3) && (!item.Key.Contains("Hand") || !(item.Key != "LeftHand") || !(item.Key != "RightHand"))) { if (dictionary3 != null && dictionary3.TryGetValue(((Object)value3).name, out var value4)) { mk1Retarget.Add(item.Value, value3, transform, ((Matrix4x4)(ref value4)).rotation, Vector4.op_Implicit(((Matrix4x4)(ref value4)).GetColumn(3))); } else { mk1Retarget.Add(item.Value, value3, transform); } } } return val3; } public static Mesh StaticMesh(string pieza) { RigData rigData = LoadPart(pieza); if (rigData == null) { return null; } Mesh obj = Object.Instantiate(rigData.Mesh); obj.boneWeights = (BoneWeight[])(object)new BoneWeight[0]; obj.RecalculateBounds(); return obj; } public static bool PartNeedsCalm(string pieza) { RigData rigData = LoadPart(pieza); if (rigData != null) { if (!rigData.TPose) { if (!rigData.PoseActual) { return !MTMagiaPlugin.Mk1PoseBase.Value; } return true; } return false; } return true; } private static GameObject BuildOnPlayerSkeleton(Player p, RigData d, string pieza) { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_0418: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0689: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0690: Unknown result type (might be due to invalid IL or missing references) //IL_0695: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_069c: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: Unknown result type (might be due to invalid IL or missing references) //IL_0a03: Unknown result type (might be due to invalid IL or missing references) //IL_0a19: Unknown result type (might be due to invalid IL or missing references) //IL_0a22: Expected O, but got Unknown //IL_0a7a: Unknown result type (might be due to invalid IL or missing references) //IL_0a7f: Unknown result type (might be due to invalid IL or missing references) //IL_0a90: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Unknown result type (might be due to invalid IL or missing references) //IL_0b15: Expected O, but got Unknown //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_07fc: Unknown result type (might be due to invalid IL or missing references) //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_07c6: Unknown result type (might be due to invalid IL or missing references) //IL_07c8: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Unknown result type (might be due to invalid IL or missing references) //IL_08ef: Unknown result type (might be due to invalid IL or missing references) //IL_08f4: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_090c: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_0916: Unknown result type (might be due to invalid IL or missing references) //IL_091a: Unknown result type (might be due to invalid IL or missing references) //IL_091f: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_0716: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_074a: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_08a6: Unknown result type (might be due to invalid IL or missing references) //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_08b8: Unknown result type (might be due to invalid IL or missing references) //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08c5: Unknown result type (might be due to invalid IL or missing references) //IL_08ca: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08db: Unknown result type (might be due to invalid IL or missing references) //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Unknown result type (might be due to invalid IL or missing references) //IL_09e6: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) SkinnedMeshRenderer val = ((Component)p).GetComponent()?.m_bodyModel; if ((Object)(object)val == (Object)null || (Object)(object)val.sharedMesh == (Object)null || val.bones == null) { return null; } Matrix4x4[] bindposes = val.sharedMesh.bindposes; if (bindposes == null || bindposes.Length != val.bones.Length) { return null; } Transform transform = ((Component)p).transform; Transform transform2 = ((Component)val).transform; Dictionary idx = new Dictionary(); Vector3[] rest = (Vector3[])(object)new Vector3[bindposes.Length]; for (int i = 0; i < bindposes.Length; i++) { if (!((Object)(object)val.bones[i] == (Object)null)) { if (!idx.ContainsKey(((Object)val.bones[i]).name)) { idx[((Object)val.bones[i]).name] = i; } Vector3[] array = rest; int num = i; Matrix4x4 inverse = ((Matrix4x4)(ref bindposes[i])).inverse; array[num] = transform.InverseTransformPoint(transform2.TransformPoint(Vector4.op_Implicit(((Matrix4x4)(ref inverse)).GetColumn(3)))); } } if (!idx.TryGetValue("Head", out var value) || !idx.ContainsKey("Hips")) { MTMagiaPlugin.Log.LogWarning((object)"Mk-I: el esqueleto del jugador no tiene Head/Hips; uso el esqueleto propio"); return null; } Dictionary J = new Dictionary(); foreach (Junta junta in d.Juntas) { J[junta.Name] = junta; } float num2 = float.MaxValue; string[] array2 = new string[4] { "LeftFoot", "RightFoot", "LeftToeBase", "RightToeBase" }; foreach (string key in array2) { if (idx.TryGetValue(key, out var value2)) { num2 = Mathf.Min(num2, rest[value2].y); } } if (num2 == float.MaxValue) { num2 = 0f; } float num3 = (J.ContainsKey("LeftFoot") ? J["LeftFoot"].Pos.y : 0f); float num4 = (J.ContainsKey("Head") ? J["Head"].Pos.y : 0.9f); float s = (rest[value].y - num2) / Mathf.Max(0.1f, num4 - num3) * MTMagiaPlugin.Mk1Volumen.Value; Dictionary> hijos = new Dictionary>(); foreach (Junta junta2 in d.Juntas) { if (idx.ContainsKey(junta2.Name)) { if (!hijos.ContainsKey(junta2.Parent)) { hijos[junta2.Parent] = new List(); } hijos[junta2.Parent].Add(junta2.Name); } } int num5 = d.Bones.Length; int[] array3 = new int[num5]; Vector3[] array4 = (Vector3[])(object)new Vector3[num5]; Vector3[] array5 = (Vector3[])(object)new Vector3[num5]; Quaternion[] array6 = (Quaternion[])(object)new Quaternion[num5]; for (int k = 0; k < num5; k++) { string text = (J.ContainsKey(d.Bones[k]) ? Pivote(d.Bones[k]) : (idx.ContainsKey(d.Bones[k]) ? d.Bones[k] : "Hips")); if (!J.ContainsKey(text)) { text = "Hips"; } array3[k] = idx[text]; array4[k] = J[text].Pos * s; array5[k] = rest[array3[k]]; array6[k] = RotOf(text); } float value3 = MTMagiaPlugin.Mk1BrazosGrados.Value; int[] array7 = new int[num5]; for (int l = 0; l < num5; l++) { string text2 = d.Bones[l]; if (text2.Contains("Arm") || text2.Contains("Hand")) { array7[l] = (text2.StartsWith("Left") ? 1 : (text2.StartsWith("Right") ? 2 : 0)); } } Vector3[] array8 = (Vector3[])(object)new Vector3[3]; Quaternion[] array9 = (Quaternion[])(object)new Quaternion[3]; for (int m = 1; m <= 2; m++) { string text3 = ((m == 1) ? "Left" : "Right"); array9[m] = Quaternion.identity; if (idx.TryGetValue(text3 + "Arm", out var value4) && idx.TryGetValue(text3 + "ForeArm", out var value5)) { array8[m] = rest[value4]; Vector3 val2 = rest[value5] - rest[value4]; array9[m] = Quaternion.AngleAxis((val2.x > 0f) ? (0f - value3) : value3, Vector3.forward); } } Mesh mesh = d.Mesh; Vector3[] vertices = mesh.vertices; Vector3[] normals = mesh.normals; BoneWeight[] boneWeights = mesh.boneWeights; Vector3[] array10 = (Vector3[])(object)new Vector3[vertices.Length]; Vector3[] array11 = (Vector3[])(object)new Vector3[vertices.Length]; BoneWeight[] array12 = (BoneWeight[])(object)new BoneWeight[vertices.Length]; int[] array13 = new int[4]; float[] array14 = new float[4]; for (int n = 0; n < vertices.Length; n++) { BoneWeight val3 = boneWeights[n]; array13[0] = ((BoneWeight)(ref val3)).boneIndex0; array13[1] = ((BoneWeight)(ref val3)).boneIndex1; array13[2] = ((BoneWeight)(ref val3)).boneIndex2; array13[3] = ((BoneWeight)(ref val3)).boneIndex3; array14[0] = ((BoneWeight)(ref val3)).weight0; array14[1] = ((BoneWeight)(ref val3)).weight1; array14[2] = ((BoneWeight)(ref val3)).weight2; array14[3] = ((BoneWeight)(ref val3)).weight3; Vector3 val4 = vertices[n] * s; Vector3 val5 = Vector3.zero; Vector3 val6 = Vector3.zero; float num6 = 0f; int[] array15 = new int[4]; float[] array16 = new float[4]; int num7 = 0; for (int num8 = 0; num8 < 4; num8++) { if (array14[num8] <= 0f || array13[num8] < 0 || array13[num8] >= num5) { continue; } int num9 = array13[num8]; val5 += (array5[num9] + array6[num9] * (val4 - array4[num9])) * array14[num8]; val6 += array6[num9] * normals[n] * array14[num8]; num6 += array14[num8]; int num10 = array3[num9]; int num11 = -1; for (int num12 = 0; num12 < num7; num12++) { if (array15[num12] == num10) { num11 = num12; } } if (num11 < 0) { num11 = num7++; array15[num11] = num10; } array16[num11] += array14[num8]; } if (num6 <= 0f) { val5 = val4; num6 = 1f; val6 = normals[n]; array15[0] = idx["Hips"]; array16[0] = 1f; num7 = 1; } Vector3 val7 = val5 / num6; if (value3 != 0f) { float num13 = 0f; float num14 = 0f; for (int num15 = 0; num15 < 4; num15++) { if (!(array14[num15] <= 0f) && array13[num15] >= 0 && array13[num15] < num5) { if (array7[array13[num15]] == 1) { num13 += array14[num15]; } else if (array7[array13[num15]] == 2) { num14 += array14[num15]; } } } int num16 = ((num13 >= num14) ? 1 : 2); float num17 = Mathf.Max(num13, num14) / num6; if (num17 > 0f) { Quaternion val8 = Quaternion.Slerp(Quaternion.identity, array9[num16], num17); val7 = array8[num16] + val8 * (val7 - array8[num16]); val6 = val8 * val6; } } array10[n] = transform2.InverseTransformPoint(transform.TransformPoint(val7)); int num18 = n; Vector3 val9 = transform2.InverseTransformDirection(transform.TransformDirection(((Vector3)(ref val6)).normalized)); array11[num18] = ((Vector3)(ref val9)).normalized; float num19 = 0f; for (int num20 = 0; num20 < num7; num20++) { num19 += array16[num20]; } int num21 = n; BoneWeight val10 = default(BoneWeight); ((BoneWeight)(ref val10)).boneIndex0 = array15[0]; ((BoneWeight)(ref val10)).weight0 = ((num7 > 0) ? (array16[0] / num19) : 0f); ((BoneWeight)(ref val10)).boneIndex1 = array15[1]; ((BoneWeight)(ref val10)).weight1 = ((num7 > 1) ? (array16[1] / num19) : 0f); ((BoneWeight)(ref val10)).boneIndex2 = array15[2]; ((BoneWeight)(ref val10)).weight2 = ((num7 > 2) ? (array16[2] / num19) : 0f); ((BoneWeight)(ref val10)).boneIndex3 = array15[3]; ((BoneWeight)(ref val10)).weight3 = ((num7 > 3) ? (array16[3] / num19) : 0f); array12[num21] = val10; } Mesh val11 = new Mesh { name = "MT_Mk1_" + pieza + "_vh", indexFormat = (IndexFormat)1 }; val11.vertices = array10; val11.normals = array11; val11.uv = mesh.uv; val11.triangles = mesh.triangles; val11.boneWeights = array12; val11.bindposes = bindposes; val11.RecalculateBounds(); val11.RecalculateTangents(); GameObject val12 = new GameObject("MT_Mk1_" + pieza) { layer = ((Component)p).gameObject.layer }; val12.transform.SetParent(transform2, false); SkinnedMeshRenderer val13 = val12.AddComponent(); val13.bones = val.bones; val13.rootBone = val.rootBone; val13.sharedMesh = val11; val13.updateWhenOffscreen = true; Material val14 = Mk1Material.Body(); if ((Object)(object)val14 != (Object)null) { ((Renderer)val13).sharedMaterial = val14; } MTMagiaPlugin.Log.LogInfo((object)$"Mk-I: «{pieza}» pegada al esqueleto de Valheim ({vertices.Length} vértices, escala {s:0.00})"); return val12; string Pivote(string name) { int num22 = 0; while (name != null && name != "-" && num22 < 64) { if (idx.ContainsKey(name) && J.ContainsKey(name)) { return name; } name = (J.TryGetValue(name, out var value6) ? value6.Parent : null); num22++; } return "Hips"; } Quaternion RotOf(string name) { //IL_00c7: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (hijos.TryGetValue(name, out var value6) && value6.Count == 1 && idx.ContainsKey(name)) { Vector3 val15 = (J[value6[0]].Pos - J[name].Pos) * s; Vector3 val16 = rest[idx[value6[0]]] - rest[idx[name]]; if (((Vector3)(ref val15)).sqrMagnitude > 1E-08f && ((Vector3)(ref val16)).sqrMagnitude > 1E-08f) { return Quaternion.FromToRotation(val15, val16); } } return Quaternion.identity; } } private static Dictionary BindPose(Player p) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) SkinnedMeshRenderer val = ((Component)p).GetComponent()?.m_bodyModel; if ((Object)(object)val == (Object)null || (Object)(object)val.sharedMesh == (Object)null || val.bones == null) { return null; } Matrix4x4[] bindposes = val.sharedMesh.bindposes; if (bindposes == null || bindposes.Length != val.bones.Length) { return null; } Dictionary dictionary = new Dictionary(); for (int i = 0; i < bindposes.Length; i++) { if ((Object)(object)val.bones[i] != (Object)null) { dictionary[((Object)val.bones[i]).name] = ((Component)val).transform.localToWorldMatrix * ((Matrix4x4)(ref bindposes[i])).inverse; } } return dictionary; } private static GameObject BuildRig(Player p, Animator anim) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_0142: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)p).transform; Transform boneTransform = anim.GetBoneTransform((HumanBodyBones)10); float num = (((Object)(object)boneTransform != (Object)null) ? (transform.InverseTransformPoint(boneTransform.position).y + 0.3f) : 2f); Mesh val = Object.Instantiate(_rigMesh); Vector3[] vertices = val.vertices; for (int i = 0; i < vertices.Length; i++) { ref Vector3 reference = ref vertices[i]; reference *= num; } val.vertices = vertices; val.RecalculateBounds(); val.RecalculateTangents(); GameObject val2 = new GameObject("MT_Mk1_Cuerpo"); val2.layer = ((Component)p).gameObject.layer; val2.transform.SetParent(transform, false); Transform[] array = (Transform[])(object)new Transform[_rigBones.Length]; Matrix4x4[] array2 = (Matrix4x4[])(object)new Matrix4x4[_rigBones.Length]; Dictionary dictionary = new Dictionary(); Transform[] componentsInChildren = ((Component)anim).GetComponentsInChildren(true); foreach (Transform val3 in componentsInChildren) { if (!dictionary.ContainsKey(((Object)val3).name)) { dictionary[((Object)val3).name] = val3; } } for (int k = 0; k < array.Length; k++) { array2[k] = (array[k] = Resolve(_rigBones[k], anim, dictionary)).worldToLocalMatrix * val2.transform.localToWorldMatrix; } val.bindposes = array2; SkinnedMeshRenderer val4 = val2.AddComponent(); val4.bones = array; val4.rootBone = anim.GetBoneTransform((HumanBodyBones)0); val4.sharedMesh = val; val4.updateWhenOffscreen = true; Material val5 = Mk1Material.Get(); if ((Object)(object)val5 != (Object)null) { ((Renderer)val4).sharedMaterial = val5; } return val2; } private static Transform Resolve(string name, Animator anim, Dictionary byName) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (byName.TryGetValue(name, out var value)) { return value; } if (Enum.TryParse(name, out HumanBodyBones result)) { Transform boneTransform = anim.GetBoneTransform(result); if ((Object)(object)boneTransform != (Object)null) { return boneTransform; } } string text = (name.StartsWith("Left") ? "Left" : (name.StartsWith("Right") ? "Right" : "")); if (name.Contains("Hand") && byName.TryGetValue(text + "Hand", out value)) { return value; } if ((name.Contains("Toe") || name.Contains("Foot")) && byName.TryGetValue(text + "Foot", out value)) { return value; } if (name.Contains("Head") && byName.TryGetValue("Head", out value)) { return value; } if (name.Contains("Shoulder") && byName.TryGetValue("Spine2", out value)) { return value; } if (name.StartsWith("Spine") && byName.TryGetValue("Spine2", out value)) { return value; } MTMagiaPlugin.Log.LogWarning((object)("Mk-I: hueso sin equivalente en el jugador: " + name + " (sigue a la cadera)")); return anim.GetBoneTransform((HumanBodyBones)0); } public static GameObject Build(Player p, Animator anim) { //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_00d2: 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_0222: 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_0151: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_014a: 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_011c: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) if (LoadRig()) { if (!MTMagiaPlugin.Mk1EsqueletoPropio.Value || _juntas == null || _juntas.Count <= 0) { return BuildRig(p, anim); } return BuildOwn(p, anim); } if ((Object)(object)_source == (Object)null) { _source = ObjModel.Load(Path.Combine(MTMagiaPlugin.ModelDir, "mk1_cuerpo.obj"), out var _); if ((Object)(object)_source == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)"Mk-I: falta Models/mk1_cuerpo.obj"); return null; } } Transform transform = ((Component)p).transform; List list = new List(); HumanBodyBones[][] cadenas = Cadenas; foreach (HumanBodyBones[] array in cadenas) { Transform boneTransform = anim.GetBoneTransform(array[0]); if ((Object)(object)boneTransform == (Object)null) { continue; } Transform boneTransform2 = anim.GetBoneTransform(array[1]); Vector3 val = transform.InverseTransformPoint(boneTransform.position); Vector3 val4; if (!((Object)(object)boneTransform2 != (Object)null) || !((Object)(object)boneTransform2 != (Object)(object)boneTransform)) { Vector3 val3; if ((int)array[0] != 10) { if (!((object)Unsafe.As(ref array[0])/*cast due to .constrained prefix*/).ToString().Contains("Foot")) { Vector3 val2 = val - transform.InverseTransformPoint(boneTransform.parent.position); val3 = ((Vector3)(ref val2)).normalized * 0.12f; } else { val3 = Vector3.forward * 0.15f; } } else { val3 = Vector3.up * 0.25f; } val4 = val + val3; } else { val4 = transform.InverseTransformPoint(boneTransform2.position); } Vector3 b = val4; string text = ((object)Unsafe.As(ref array[0])/*cast due to .constrained prefix*/).ToString(); int side = (text.StartsWith("Right") ? 1 : (text.StartsWith("Left") ? (-1) : 0)); list.Add(new Seg { Bone = boneTransform, A = val, B = b, Side = side }); } if (list.Count < 10) { MTMagiaPlugin.Log.LogWarning((object)"Mk-I: faltan huesos para el esqueleto"); return null; } Transform boneTransform3 = anim.GetBoneTransform((HumanBodyBones)10); float num = (((Object)(object)boneTransform3 != (Object)null) ? (transform.InverseTransformPoint(boneTransform3.position).y + 0.3f) : 2f); Mesh val5 = Object.Instantiate(_source); ((Object)val5).name = "MT_Mk1_Cuerpo"; Vector3[] vertices = val5.vertices; for (int j = 0; j < vertices.Length; j++) { ref Vector3 reference = ref vertices[j]; reference *= num; } val5.vertices = vertices; val5.RecalculateBounds(); val5.RecalculateTangents(); BoneWeight[] array2 = (BoneWeight[])(object)new BoneWeight[vertices.Length]; for (int k = 0; k < vertices.Length; k++) { Vector3 val6 = vertices[k]; int num2 = ((val6.x > 0.12f * num) ? 1 : ((val6.x < -0.12f * num) ? (-1) : 0)); int num3 = -1; int num4 = -1; float num5 = float.MaxValue; float num6 = float.MaxValue; for (int l = 0; l < list.Count; l++) { if (num2 == 0 || list[l].Side != -num2) { float num7 = DistSeg(val6, list[l].A, list[l].B); if (num7 < num5) { num6 = num5; num4 = num3; num5 = num7; num3 = l; } else if (num7 < num6) { num6 = num7; num4 = l; } } } float num8 = 1f / Mathf.Pow(num5 + 0.02f, 4f); float num9 = ((num4 >= 0) ? (1f / Mathf.Pow(num6 + 0.02f, 4f)) : 0f); float num10 = num8 + num9; int num11 = k; BoneWeight val7 = default(BoneWeight); ((BoneWeight)(ref val7)).boneIndex0 = num3; ((BoneWeight)(ref val7)).weight0 = num8 / num10; ((BoneWeight)(ref val7)).boneIndex1 = Mathf.Max(0, num4); ((BoneWeight)(ref val7)).weight1 = num9 / num10; array2[num11] = val7; } val5.boneWeights = array2; GameObject val8 = new GameObject("MT_Mk1_Cuerpo"); val8.layer = ((Component)p).gameObject.layer; val8.transform.SetParent(transform, false); Transform[] array3 = (Transform[])(object)new Transform[list.Count]; Matrix4x4[] array4 = (Matrix4x4[])(object)new Matrix4x4[list.Count]; for (int m = 0; m < list.Count; m++) { array3[m] = list[m].Bone; array4[m] = list[m].Bone.worldToLocalMatrix * val8.transform.localToWorldMatrix; } val5.bindposes = array4; SkinnedMeshRenderer val9 = val8.AddComponent(); val9.bones = array3; val9.rootBone = anim.GetBoneTransform((HumanBodyBones)0); val9.sharedMesh = val5; val9.updateWhenOffscreen = true; Material val10 = Mk1Material.Get(); if ((Object)(object)val10 != (Object)null) { ((Renderer)val9).sharedMaterial = val10; } return val8; } private static float DistSeg(Vector3 p, Vector3 a, Vector3 b) { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; float num = ((((Vector3)(ref val)).sqrMagnitude < 1E-06f) ? 0f : Mathf.Clamp01(Vector3.Dot(p - a, val) / ((Vector3)(ref val)).sqrMagnitude)); return Vector3.Distance(p, a + val * num); } } [DefaultExecutionOrder(1000)] public class Mk1Retarget : MonoBehaviour { private class Par { public Transform Own; public Transform Src; public Quaternion Offset; public bool Root; public Vector3 PosOffset; } private readonly List _pares = new List(); private Transform _root; public void Add(Transform own, Transform src, Transform root) { //IL_0005: 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) Add(own, src, root, src.rotation, src.position); } public void Add(Transform own, Transform src, Transform root, Quaternion srcRot, Vector3 srcPos) { //IL_001b: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_006c: Unknown result type (might be due to invalid IL or missing references) _root = root; Par par = new Par { Own = own, Src = src, Offset = Quaternion.Inverse(srcRot) * own.rotation }; par.Root = (Object)(object)own.parent == (Object)(object)((Component)this).transform; if (par.Root) { par.PosOffset = root.InverseTransformPoint(own.position) - root.InverseTransformPoint(srcPos); } _pares.Add(par); _pares.Sort((Par a, Par b) => Depth(a.Own).CompareTo(Depth(b.Own))); } private static int Depth(Transform t) { int num = 0; while ((Object)(object)t.parent != (Object)null) { num++; t = t.parent; } return num; } private void LateUpdate() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) foreach (Par pare in _pares) { if (!((Object)(object)pare.Src == (Object)null)) { if (pare.Root && (Object)(object)_root != (Object)null) { pare.Own.position = pare.Src.position + _root.TransformVector(pare.PosOffset); } pare.Own.rotation = pare.Src.rotation * pare.Offset; } } } } public class MTElectricVFX : MonoBehaviour { [Header("Texturas")] public Texture2D boltsTexture; public Texture2D sparkTexture; [Header("Aspecto")] public Color color = new Color(0.35f, 0.75f, 1f, 1f); public float radius = 0.45f; public float height = 1.8f; public float duration = 2f; public bool loop = true; private Character _target; private float _age; private void Update() { _age += Time.deltaTime; if (_age > duration + 0.5f || ((Object)(object)_target != (Object)null && _target.IsDead()) || (Object)(object)((Component)this).transform.parent == (Object)null || ((Object)(object)_target == (Object)null && _age > 0.1f)) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void Start() { _target = ((Component)this).GetComponentInParent(); CreateBolts(); CreateSparks(); } private ParticleSystem MakeSystem(string name, Texture2D tex, out ParticleSystemRenderer renderer) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); ParticleSystem obj = val.AddComponent(); obj.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = obj.main; ((MainModule)(ref main)).duration = duration; ((MainModule)(ref main)).loop = loop; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); renderer = val.GetComponent(); Material material = Vfx.NewMaterial(tex); ((Renderer)renderer).material = material; renderer.renderMode = (ParticleSystemRenderMode)0; return obj; } private void CreateBolts() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) ParticleSystemRenderer renderer; ParticleSystem obj = MakeSystem("Bolts", boltsTexture, out renderer); MainModule main = obj.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.06f, 0.14f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.25f, 0.5f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(0f, (float)Math.PI * 2f); ((MainModule)(ref main)).maxParticles = 20; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(28f); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)8; ((ShapeModule)(ref shape)).angle = 0f; ((ShapeModule)(ref shape)).radius = radius; ((ShapeModule)(ref shape)).radiusThickness = 0f; ((ShapeModule)(ref shape)).length = height; ((ShapeModule)(ref shape)).rotation = new Vector3(-90f, 0f, 0f); TextureSheetAnimationModule textureSheetAnimation = obj.textureSheetAnimation; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).enabled = true; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesX = 2; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).numTilesY = 2; ((TextureSheetAnimationModule)(ref textureSheetAnimation)).startFrame = new MinMaxCurve(0f, 3.99f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).frameOverTime = new MinMaxCurve(0f); ((TextureSheetAnimationModule)(ref textureSheetAnimation)).cycleCount = 1; obj.Play(); } private void CreateSparks() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_003c: 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_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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) ParticleSystemRenderer renderer; ParticleSystem obj = MakeSystem("Sparks", sparkTexture, out renderer); MainModule main = obj.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.15f, 0.35f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.8f, 2f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.03f, 0.06f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.Lerp(color, Color.white, 0.6f)); ((MainModule)(ref main)).maxParticles = 40; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(35f); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = new Vector3(radius * 2f, height * 0.9f, radius * 2f); ((ShapeModule)(ref shape)).position = new Vector3(0f, height * 0.5f, 0f); obj.Play(); } } public class MTHealVFX : MonoBehaviour { public enum Style { Cruces, Destellos } public Style style; [Header("Texturas (Textures/Heal)")] public Texture2D crossTexture; public Texture2D sparkTexture; public Texture2D columnTexture; public Texture2D star4Texture; public Texture2D streakTexture; public Texture2D groundGlowTexture; [Header("Aspecto")] public Color color = new Color(0.35f, 1f, 0.45f, 1f); public float radius = 0.6f; public float height = 2.2f; public float duration = 1.5f; public bool loop; private void Start() { if (style == Style.Cruces) { CreateColumn(); CreateCrosses(); } else { CreateGroundGlow(); CreateStars(); CreateStreaks(); } CreateSparks(); } private Material MakeMaterial(Texture2D tex) { Material obj = Vfx.NewMaterial(null); obj.mainTexture = (Texture)(object)tex; return obj; } private ParticleSystem MakeSystem(string name, Texture2D tex, out ParticleSystemRenderer renderer) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(((Component)this).transform, false); ParticleSystem obj = val.AddComponent(); obj.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = obj.main; ((MainModule)(ref main)).duration = duration; ((MainModule)(ref main)).loop = loop; ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); renderer = val.GetComponent(); ((Renderer)renderer).material = MakeMaterial(tex); return obj; } private static MinMaxGradient FadeInOut(Color c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(c, 0f), new GradientColorKey(c, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.2f), new GradientAlphaKey(1f, 0.6f), new GradientAlphaKey(0f, 1f) }); return new MinMaxGradient(val); } private void CreateColumn() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: 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_0108: 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_012e: Unknown result type (might be due to invalid IL or missing references) ParticleSystemRenderer renderer; ParticleSystem val = MakeSystem("Column", columnTexture, out renderer); MainModule main = val.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(duration); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize3D = true; ((MainModule)(ref main)).startSizeX = MinMaxCurve.op_Implicit(radius * 2.2f); ((MainModule)(ref main)).startSizeY = MinMaxCurve.op_Implicit(height); ((MainModule)(ref main)).startSizeZ = MinMaxCurve.op_Implicit(1f); ((MainModule)(ref main)).maxParticles = 3; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)2) }); ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).enabled = false; ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = FadeInOut(new Color(color.r, color.g, color.b, 0.5f)); renderer.renderMode = (ParticleSystemRenderMode)3; renderer.pivot = new Vector3(0f, 0.5f, 0f); val.Play(); } private void CreateCrosses() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) ParticleSystemRenderer renderer; ParticleSystem val = MakeSystem("Crosses", crossTexture, out renderer); MainModule main = val.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.8f, 1.3f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.6f, 1.2f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.12f, 0.28f); ((MainModule)(ref main)).maxParticles = 40; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(loop ? 8f : 0f); if (!loop) { ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[3] { new Burst(0f, (short)6), new Burst(0.25f, (short)5), new Burst(0.5f, (short)4) }); } ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = radius; ((ShapeModule)(ref shape)).rotation = new Vector3(-90f, 0f, 0f); ((ShapeModule)(ref shape)).position = new Vector3(0f, 0.3f, 0f); VelocityOverLifetimeModule velocityOverLifetime = val.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)1; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(0.4f, 0.9f); ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = FadeInOut(color); renderer.renderMode = (ParticleSystemRenderMode)0; val.Play(); } private void CreateGroundGlow() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_004c: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) ParticleSystemRenderer renderer; ParticleSystem val = MakeSystem("GroundGlow", groundGlowTexture, out renderer); MainModule main = val.main; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(duration); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(radius * 3.5f); ((MainModule)(ref main)).maxParticles = 1; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)1) }); ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).enabled = false; ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = FadeInOut(new Color(color.r, color.g, color.b, 0.6f)); renderer.renderMode = (ParticleSystemRenderMode)2; ((Component)val).transform.localPosition = new Vector3(0f, 0.05f, 0f); val.Play(); } private void CreateStars() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_01cf: 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_01df: 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_01f1: 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_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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) ParticleSystemRenderer renderer; ParticleSystem val = MakeSystem("Stars", star4Texture, out renderer); MainModule main = val.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.5f, 1.1f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.05f, 0.3f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.1f, 0.25f); ((MainModule)(ref main)).maxParticles = 50; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(loop ? 14f : 0f); if (!loop) { ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[3] { new Burst(0f, (short)10), new Burst(0.2f, (short)8), new Burst(0.45f, (short)6) }); } ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = new Vector3(radius * 2f, height * 0.8f, radius * 2f); ((ShapeModule)(ref shape)).position = new Vector3(0f, height * 0.45f, 0f); SizeOverLifetimeModule sizeOverLifetime = val.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; AnimationCurve val2 = new AnimationCurve((Keyframe[])(object)new Keyframe[5] { new Keyframe(0f, 0f), new Keyframe(0.2f, 1f), new Keyframe(0.4f, 0.4f), new Keyframe(0.6f, 1f), new Keyframe(1f, 0f) }); ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, val2); ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = FadeInOut(color); renderer.renderMode = (ParticleSystemRenderMode)0; val.Play(); } private void CreateStreaks() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) ParticleSystemRenderer renderer; ParticleSystem val = MakeSystem("Streaks", streakTexture, out renderer); MainModule main = val.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.3f, 0.6f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(2f, 4f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.05f, 0.09f); ((MainModule)(ref main)).maxParticles = 30; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(loop ? 6f : 0f); if (!loop) { ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[2] { new Burst(0f, (short)8), new Burst(0.3f, (short)5) }); } ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)2; ((ShapeModule)(ref shape)).radius = radius * 0.5f; ((ShapeModule)(ref shape)).position = new Vector3(0f, height * 0.4f, 0f); ((ShapeModule)(ref shape)).rotation = new Vector3(-90f, 0f, 0f); ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = FadeInOut(Color.Lerp(color, Color.white, 0.4f)); renderer.renderMode = (ParticleSystemRenderMode)1; renderer.velocityScale = 0.12f; renderer.lengthScale = 2f; val.Play(); } private void CreateSparks() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0053: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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) ParticleSystemRenderer renderer; ParticleSystem val = MakeSystem("Sparks", sparkTexture, out renderer); MainModule main = val.main; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.6f, 1.4f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.2f, 0.6f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.03f, 0.07f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Color.Lerp(color, Color.white, 0.7f)); ((MainModule)(ref main)).maxParticles = 60; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(loop ? 15f : 0f); if (!loop) { ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[2] { new Burst(0f, (short)20), new Burst(0.4f, (short)12) }); } ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = radius * 1.3f; ((ShapeModule)(ref shape)).rotation = new Vector3(-90f, 0f, 0f); ((ShapeModule)(ref shape)).position = new Vector3(0f, 0.8f, 0f); VelocityOverLifetimeModule velocityOverLifetime = val.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)1; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(0.2f, 0.7f); ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = FadeInOut(Color.white); renderer.renderMode = (ParticleSystemRenderMode)0; val.Play(); } } [BepInPlugin("mushokutensei.magia", "MT Magia", "2.5.9")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [SynchronizationMode(/*Could not decode attribute arguments.*/)] public class MTMagiaPlugin : BaseUnityPlugin { public const string Guid = "mushokutensei.magia"; public const string Version = "2.5.9"; public static ManualLogSource Log; public static ConfigEntry AllowDestruction; public static ConfigEntry BaseProtectionRadius; public static ConfigEntry DistanciaSinBotin; public static ConfigEntry ShowHud; public static ConfigEntry HudScale; public static ConfigEntry HudX; public static ConfigEntry HudY; public static ConfigEntry HudHelp; public static ConfigEntry HudFavorites; public static ConfigEntry FavoriteShortcuts; public static ConfigEntry VaritaModelo; public static ConfigEntry BastonesGrimorio; public static ConfigEntry OrigenAltura; public static ConfigEntry OrigenAdelante; public static ConfigEntry FuegoContraEsqueletos; public static ConfigEntry EfectosPropios; public static ConfigEntry DanaConstrucciones; public static ConfigEntry EspirituTamano; public static ConfigEntry EspirituOpacidad; public static ConfigEntry BalaPiedraTamano; public static ConfigEntry LevitarCosto; public static ConfigEntry LevitarCostoCorrer; public static ConfigEntry CofreGravedad; public static ConfigEntry AnimFundido; public static ConfigEntry LevitarAnimaciones; public static ConfigEntry LevitarFlotarAnimacion; public static ConfigEntry AnimDespegue; public static ConfigEntry AnimVuelo; public static ConfigEntry AnimAterrizaje; public static ConfigEntry AnimSubir; public static ConfigEntry AnimPilar; public static ConfigEntry AnimFlotar; public static ConfigEntry AnimBajar; public static ConfigEntry AnimCaida; public static ConfigEntry VaritaEscala; public static ConfigEntry Mk1Armadura; public static ConfigEntry Mk1ManaSegundo; public static ConfigEntry Mk1ManaDisparo; public static ConfigEntry Mk1DanoBala; public static ConfigEntry Mk1Reduccion; public static ConfigEntry Mk1Escala; public static ConfigEntry Mk1BloqueoEscudo; public static ConfigEntry Mk1DesgasteGolpe; public static ConfigEntry Mk1CalorBalas; public static ConfigEntry Mk1CalorEspera; public static ConfigEntry Mk1MasDano; public static ConfigEntry Mk1VidaPorPieza; public static ConfigEntry Mk1DanoCaida; public static ConfigEntry Mk1Cadencia; public static ConfigEntry MuroVida; public static ConfigEntry Mk1EscudoManoEscala; public static ConfigEntry Mk1EscudoManoSeparacion; public static ConfigEntry Mk1ConArmaduraEscala; public static ConfigEntry Mk1Tamano; public static ConfigEntry Mk1Salto; public static ConfigEntry Mk1Carrera; public static ConfigEntry Mk1VelocidadBala; public static ConfigEntry Mk1TamanoBala; public static ConfigEntry Mk1Metal; public static ConfigEntry Mk1Brillo; public static ConfigEntry Mk1EscudoEscala; public static ConfigEntry Mk1CanonEscala; public static ConfigEntry Mk1Esqueleto; public static ConfigEntry Mk1Temblor; public static ConfigEntry Mk1EsqueletoPropio; public static ConfigEntry Mk1PoseBase; public static ConfigEntry Mk1Volumen; public static ConfigEntry Mk1TemblorPaso; public static ConfigEntry Mk1TemblorCaida; public static ConfigEntry Mk1BrazosGrados; public static ConfigEntry Mk1CaidaMinima; public static ConfigEntry Mk1RegenVida; public static ConfigEntry Mk1Nado; public static ConfigEntry Mk1DisrupcionEspera; public static ConfigEntry Mk1DisrupcionMana; public static ConfigEntry Mk1DisrupcionDesgaste; public static ConfigEntry Mk1Durabilidad; public static ConfigEntry Mk1DesgasteSegundo; public static ConfigEntry Mk1CanonDurabilidad; public static ConfigEntry Mk1CanonDesgaste; public static ConfigEntry Mk1Camara; public static ConfigEntry RocaEfectoTierra; public static ConfigEntry FortalezaPisos; public static ConfigEntry MuroPisosMax; public static ConfigEntry MuroPisos; public static ConfigEntry PrecioPergamino; public static ConfigEntry LanzamientosPorRango; public static ConfigEntry JefesPorRango; public static ConfigEntry PracticaPrimera; public static ConfigEntry PracticaCada; public static ConfigEntry PergaminoProbMult; public static ConfigEntry LaplaceCaminoReserva; public static ConfigEntry LaplaceCaminoHechizos; public static ConfigEntry LaplaceCaminoRunas; public static ConfigEntry LaplaceCaminoActivo; public static ConfigEntry AprenderVarita; public static ConfigEntry AprenderRango; public static ConfigEntry Mk1EscudoManoVoltear; public static ConfigEntry Mk1CanonVolumen; public static ConfigEntry MagiaDanoMult; public static ConfigEntry CargaMantenerCosto; public static ConfigEntry CargaMantenerMax; public static ConfigEntry CargaVelocidadMovimiento; public static ConfigEntry CargaMana; public static ConfigEntry CargaExponente; public static ConfigEntry CargaVelocidad; public static ConfigEntry ResistenciaEstadoMax; public static ConfigEntry CargaVistaAltura; public static ConfigEntry CargaVistaDistancia; public static ConfigEntry CargaVistaLado; public static ConfigEntry Mk1EscudoManoGiro; public static ConfigEntry Mk1EscudoGiro; public static ConfigEntry Mk1EscudoPos; public static ConfigEntry Mk1CanonGiro; public static ConfigEntry Mk1CanonPos; public static ConfigEntry Mk1Tinte; public static ConfigEntry VaritaModeloPropio; public static ConfigEntry VaritaRotacion; public static ConfigEntry VaritaPosicion; public static ConfigEntry VaritaCinturaPosicion; public static ConfigEntry VaritaCinturaRotacion; public static ConfigEntry VaritaEnCintura; public static string ModelDir; private static string _iconDir; private static readonly Dictionary IconCache = new Dictionary(); public static Sprite Icon(string name) { if (IconCache.TryGetValue(name, out var value)) { return value; } string text = Path.Combine(_iconDir, name + ".png"); Sprite val = (File.Exists(text) ? AssetUtils.LoadSpriteFromFile(text) : null); IconCache[name] = val; return val; } private void Awake() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Expected O, but got Unknown //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Expected O, but got Unknown //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_0910: Unknown result type (might be due to invalid IL or missing references) //IL_0915: Unknown result type (might be due to invalid IL or missing references) //IL_1475: Unknown result type (might be due to invalid IL or missing references) //IL_147a: Unknown result type (might be due to invalid IL or missing references) //IL_1482: Unknown result type (might be due to invalid IL or missing references) //IL_148d: Unknown result type (might be due to invalid IL or missing references) //IL_1498: Unknown result type (might be due to invalid IL or missing references) //IL_14a3: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Unknown result type (might be due to invalid IL or missing references) //IL_14cd: Expected O, but got Unknown //IL_14cd: Unknown result type (might be due to invalid IL or missing references) //IL_14d2: Unknown result type (might be due to invalid IL or missing references) //IL_14da: Unknown result type (might be due to invalid IL or missing references) //IL_14e5: Unknown result type (might be due to invalid IL or missing references) //IL_14f0: Unknown result type (might be due to invalid IL or missing references) //IL_1516: Expected O, but got Unknown //IL_1516: Unknown result type (might be due to invalid IL or missing references) //IL_151b: Unknown result type (might be due to invalid IL or missing references) //IL_1523: Unknown result type (might be due to invalid IL or missing references) //IL_152e: Unknown result type (might be due to invalid IL or missing references) //IL_1539: Unknown result type (might be due to invalid IL or missing references) //IL_1544: Unknown result type (might be due to invalid IL or missing references) //IL_156e: Expected O, but got Unknown //IL_156e: Unknown result type (might be due to invalid IL or missing references) //IL_1573: Unknown result type (might be due to invalid IL or missing references) //IL_157b: Unknown result type (might be due to invalid IL or missing references) //IL_1586: Unknown result type (might be due to invalid IL or missing references) //IL_1591: Unknown result type (might be due to invalid IL or missing references) //IL_159c: Unknown result type (might be due to invalid IL or missing references) //IL_15c6: Expected O, but got Unknown //IL_0dd3: Unknown result type (might be due to invalid IL or missing references) //IL_0e06: Unknown result type (might be due to invalid IL or missing references) //IL_0e39: Unknown result type (might be due to invalid IL or missing references) //IL_0e90: Unknown result type (might be due to invalid IL or missing references) //IL_0ec3: Unknown result type (might be due to invalid IL or missing references) //IL_121b: Unknown result type (might be due to invalid IL or missing references) //IL_124e: Unknown result type (might be due to invalid IL or missing references) //IL_12c5: Unknown result type (might be due to invalid IL or missing references) //IL_12f8: Unknown result type (might be due to invalid IL or missing references) //IL_135a: Unknown result type (might be due to invalid IL or missing references) //IL_1364: Expected O, but got Unknown //IL_1397: Unknown result type (might be due to invalid IL or missing references) //IL_13a1: Expected O, but got Unknown //IL_13d4: Unknown result type (might be due to invalid IL or missing references) //IL_13de: Expected O, but got Unknown //IL_1789: Unknown result type (might be due to invalid IL or missing references) //IL_1793: Expected O, but got Unknown //IL_17a7: Unknown result type (might be due to invalid IL or missing references) //IL_17b1: Expected O, but got Unknown //IL_17c5: Unknown result type (might be due to invalid IL or missing references) //IL_17cf: Expected O, but got Unknown //IL_17e3: Unknown result type (might be due to invalid IL or missing references) //IL_17ed: Expected O, but got Unknown //IL_1801: Unknown result type (might be due to invalid IL or missing references) //IL_180b: Expected O, but got Unknown //IL_181f: Unknown result type (might be due to invalid IL or missing references) //IL_1829: Expected O, but got Unknown //IL_183d: Unknown result type (might be due to invalid IL or missing references) //IL_1847: Expected O, but got Unknown //IL_185b: Unknown result type (might be due to invalid IL or missing references) //IL_1865: Expected O, but got Unknown //IL_1879: Unknown result type (might be due to invalid IL or missing references) //IL_1883: Expected O, but got Unknown //IL_1897: Unknown result type (might be due to invalid IL or missing references) //IL_18a1: Expected O, but got Unknown //IL_18b5: Unknown result type (might be due to invalid IL or missing references) //IL_18bf: Expected O, but got Unknown Tr.Load(typeof(MTMagiaPlugin).Assembly, Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location)); Log = ((BaseUnityPlugin)this).Logger; _iconDir = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Icons"); Vfx.Dir = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "VFX"); ModelDir = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Models"); LevitarAnim.Load(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location)); Agarre.Init(((BaseUnityPlugin)this).Config); ConfigurationManagerAttributes val = new ConfigurationManagerAttributes { IsAdminOnly = true }; AllowDestruction = ((BaseUnityPlugin)this).Config.Bind("Destrucción", "Permitida", true, new ConfigDescription("La magia destructiva puede hacer cráteres y derribar árboles (nunca construcciones).", (AcceptableValueBase)null, new object[1] { val })); DistanciaSinBotin = ((BaseUnityPlugin)this).Config.Bind("Destrucción", "DistanciaSinBotin", 40f, new ConfigDescription("Rendimiento: árboles, rocas, rompibles y construcciones que la magia rompe a más de estos metros del lanzador se rompen sin troncos ni botín (los mobs siempre sueltan). 0 = siempre sueltan.", (AcceptableValueBase)null, new object[1] { val })); BaseProtectionRadius = ((BaseUnityPlugin)this).Config.Bind("Destrucción", "RadioProteccionBase", 20f, new ConfigDescription("Metros alrededor de construcciones de jugador donde la magia no destruye.", (AcceptableValueBase)null, new object[1] { val })); CofreGravedad = ((BaseUnityPlugin)this).Config.Bind("Equilibrio", "PergaminoGravedadEnCofres", 0.05f, new ConfigDescription("Probabilidad de un Pergamino de Gravedad en cofres de montaña, llanuras, niebla y ceniza.", (AcceptableValueBase)null, new object[1] { val })); LevitarAnimaciones = ((BaseUnityPlugin)this).Config.Bind("Levitar", "AnimacionesPropias", true, "Usar las animaciones de Mixamo (Bundles/mt_anim) al levitar."); LevitarFlotarAnimacion = ((BaseUnityPlugin)this).Config.Bind("Levitar", "FlotarAnimacion", 0, "Al levitar sin moverse (flotando): 0 = caída suave (como Capa de Plumas), 1 = pose de pie. Comando: mt_levitar_anim."); AnimFundido = ((BaseUnityPlugin)this).Config.Bind("Levitar", "FundidoSuave", 0.5f, "Segundos de transición suave entre animaciones (más alto = más suave)."); AnimDespegue = ((BaseUnityPlugin)this).Config.Bind("Levitar", "DespegueAnim", "", "Animación al despegar (vacío = directo al vuelo con fundido, se ve más natural): Jumping, Jumping_1, Stand_To_Freehang."); AnimFlotar = ((BaseUnityPlugin)this).Config.Bind("Levitar", "FlotarAnim", "Floating", "Animación al levitar quieto (flotando, mirando alrededor). Si no está en el paquete, se usa la de vuelo. Mixamo: «Floating»."); AnimBajar = ((BaseUnityPlugin)this).Config.Bind("Levitar", "BajarAnim", "Falling_To_Landing", "Animación al bajar (Ctrl). Mixamo: «Falling Idle»."); AnimCaida = ((BaseUnityPlugin)this).Config.Bind("Levitar", "CaidaAnim", "Falling_To_Landing", "Animación al aterrizar (K) desde lo alto, mientras caes."); AnimPilar = ((BaseUnityPlugin)this).Config.Bind("Levitar", "PilarAnim", "Stand_To_Freehang", "Animación mientras subes en el Pilar de Tierra (brazos arriba). Otras: Jumping_1, Flying."); AnimSubir = ((BaseUnityPlugin)this).Config.Bind("Levitar", "SubirAnim", "Stand_To_Freehang", "Animación al subir (Espacio) sin moverte: brazos arriba. Otras: Jumping_1, Flying."); LevitarCostoCorrer = ((BaseUnityPlugin)this).Config.Bind("Equilibrio", "LevitarCostoAcelerar", 2f, "Levitar acelerando (Shift) multiplica el gasto de maná por esto."); AnimVuelo = ((BaseUnityPlugin)this).Config.Bind("Levitar", "Vuelo", "Flying", "Animación en bucle mientras levitas."); AnimAterrizaje = ((BaseUnityPlugin)this).Config.Bind("Levitar", "Aterrizaje", "Landing", "Animación al aterrizar: Landing, Hard_Landing, Falling_To_Landing."); LevitarCosto = ((BaseUnityPlugin)this).Config.Bind("Equilibrio", "LevitarManaPorSegundo", 3f, new ConfigDescription("Maná por segundo mientras levitas (antes de descuentos).", (AcceptableValueBase)null, new object[1] { val })); BalaPiedraTamano = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "BalaPiedraTamano", 0.55f, "Tamaño de la Bala de Piedra, al cargarla y al lanzarla (1 = el de antes)."); EspirituTamano = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "EspirituGuiaTamano", 0.45f, "Tamaño del Espíritu Guía (1 = tamaño base; el espíritu es deliberadamente discreto)."); EspirituOpacidad = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "EspirituGuiaOpacidad", 0.45f, "Opacidad del Espíritu Guía (1 = opaco; menos = más transparente)."); DanaConstrucciones = ((BaseUnityPlugin)this).Config.Bind("Destrucción", "MagiaDanaConstrucciones", true, "Terremoto, Huracán, Tornado y Remolino de Fuego dañan también lo construido (no dentro de piedras de guardia ajenas)."); EfectosPropios = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "EfectosPropios", true, "Efectos propios de curación (cruces y destellos) y de electrocutado."); FuegoContraEsqueletos = ((BaseUnityPlugin)this).Config.Bind("Equilibrio", "FuegoContraEsqueletos", 0.4f, new ConfigDescription("Daño de fuego que reciben esqueletos y carbonizados (0.4 = −60 %).", (AcceptableValueBase)null, new object[1] { val })); BastonesGrimorio = ((BaseUnityPlugin)this).Config.Bind("Lanzar", "BastonesLanzanGrimorio", true, "Con un bastón de Valheim, el clic izquierdo lanza el hechizo del grimorio (false = el ataque original del bastón)."); OrigenAltura = ((BaseUnityPlugin)this).Config.Bind("Lanzar", "OrigenAltura", 1.5f, "Altura (m) desde los pies de donde sale la magia: 1.5 ≈ hombros."); OrigenAdelante = ((BaseUnityPlugin)this).Config.Bind("Lanzar", "OrigenAdelante", 0.9f, "Distancia (m) delante del pecho de donde sale la magia."); Mk1DesgasteGolpe = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "DesgastePorGolpe", 0.5f, "Durabilidad que pierde la Mk-I por cada punto de daño que recibe (los golpes fuertes la rompen antes)."); Mk1CalorBalas = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CalorBalas", 15f, "Balas seguidas del Cañón Mk-I antes de recalentarse."); Mk1CalorEspera = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CalorEspera", 3f, "Segundos que el Cañón Mk-I no dispara al recalentarse."); Mk1Cadencia = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CadenciaCanon", 0.3f, "Segundos entre balas del Cañón Mk-I mientras mantienes el ataque."); Mk1DanoCaida = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "DanoCaida", 40f, "Daño contundente del golpe al caer con la Mk-I encendida, por segundo de caída (hasta 3 s)."); Mk1MasDano = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "MasDanoPorPieza", 0.0667f, "Con la coraza encendida: +daño en todo (físico y mágico) por cada pieza de la Mk-I puesta (3 piezas = +36 %)."); Mk1VidaPorPieza = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "VidaPorPieza", 30f, "Con la coraza encendida: +vida máxima por cada pieza de la Mk-I puesta (3 piezas = +180)."); MuroVida = ((BaseUnityPlugin)this).Config.Bind("Tierra", "MuroVida", 600f, "Vida del Muro de Tierra (× poder del hechizo). Golpes, flechas y hechizos lo rompen."); MuroPisosMax = ((BaseUnityPlugin)this).Config.Bind("Tierra", "MuroPisosMax", 3, "Pisos máximos de los muros cargados (ya no se usa: Muro y Fortaleza tienen pisos fijos)."); RocaEfectoTierra = ((BaseUnityPlugin)this).Config.Bind("Tierra", "PilarEfectoTierra", true, "Al picar el Pilar y las Lanzas de Tierra: true = polvo y sonido de tierra; false = efectos de roca del juego. Requiere reiniciar."); MuroPisos = ((BaseUnityPlugin)this).Config.Bind("Tierra", "MuroPisosBase", 2, "Pisos de los tres muros en C del Muro de Piedra (cada piso, 2 m); +1 desde rango Rey de Tierra. Sin carga ni recitado."); CargaMana = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "ManaPorCarga", 6f, "Maná extra por cada ×1 de carga, en veces el coste del hechizo (6 = cargar a ×3 cuesta 12 veces más)."); CargaExponente = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "ExponentePoder", 1.25f, "Poder = carga^esto. Con 1.25: ×2 → ×2,4, ×3 → ×3,9, ×5 (Dios) → ×7,5."); MagiaDanoMult = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "MultiplicadorDano", 1f, "Multiplica el daño de toda la magia (1 = un poco más fuerte que las flechas de su etapa)."); CargaMantenerCosto = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "MantenerCosto", 0.25f, "Con la carga al máximo, maná por segundo en veces el costo del hechizo. Sin maná, el hechizo sale solo."); CargaMantenerMax = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "MantenerMaximo", 6f, "Segundos que se puede contener la carga máxima antes de que el hechizo salga solo."); CargaVelocidadMovimiento = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "VelocidadMovimiento", 0.65f, "Velocidad al moverse mientras se canaliza (sin correr)."); CargaVistaAltura = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "VistaAltura", 1.6f, "Altura (m) a la que se ve la piedra o el orbe que canalizas (y desde donde sale el proyectil)."); if (Mathf.Approximately(CargaVistaAltura.Value, 2.1f)) { CargaVistaAltura.Value = 1.6f; } CargaVistaLado = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "VistaLado", 0.7f, "Metros a la derecha (lado del bastón) a los que se ve lo que canalizas, para que el personaje no lo tape."); CargaVistaDistancia = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "VistaDistancia", 1.8f, "Distancia (m) delante de ti a la que se ve lo que canalizas."); CargaVelocidad = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "Velocidad", 0.4f, "Cuánto sube la carga por segundo manteniendo el clic (0,4: ×3 en 5 s, ×5 en 10 s)."); ResistenciaEstadoMax = ((BaseUnityPlugin)this).Config.Bind("Canalizacion", "ResistenciaEstadoMax", 0.6f, "Máximo que un jugador reduce parálisis y sellos por su tōki (4 %/nivel) y su magia (5 %/rango)."); FortalezaPisos = ((BaseUnityPlugin)this).Config.Bind("Tierra", "FortalezaPisos", 2, "Pisos de la Fortaleza de Piedra (cada piso, 2 m); +1 en rango Dios de Tierra. Sin carga ni recitado."); Mk1EscudoManoEscala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoManoEscala", 1.2f, "Tamaño del Escudo Mk-I en la mano, respecto al escudo torre del juego."); if (Mathf.Approximately(Mk1EscudoManoEscala.Value, 1.6f) || Mathf.Approximately(Mk1EscudoManoEscala.Value, 1.25f) || Mathf.Approximately(Mk1EscudoManoEscala.Value, 1f)) { Mk1EscudoManoEscala.Value = 1.2f; } Mk1EscudoManoVoltear = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoManoVoltear", true, "Da la vuelta al Escudo Mk-I (la cara hacia fuera, no hacia el brazo)."); Mk1EscudoManoSeparacion = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoManoSeparacion", -0.09f, "Metros que el Escudo Mk-I se aparta del brazo hacia fuera (para que no lo atraviese)."); if (Mathf.Approximately(Mk1EscudoManoSeparacion.Value, 0.15f)) { Mk1EscudoManoSeparacion.Value = -0.09f; } Mk1EscudoManoGiro = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoManoGiro", new Vector3(15f, 0f, 0f), "Giro extra del Escudo Mk-I en la mano (grados X, Y, Z)."); if (Mk1EscudoManoGiro.Value == Vector3.zero) { Mk1EscudoManoGiro.Value = new Vector3(15f, 0f, 0f); } Mk1ConArmaduraEscala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoYCanonConArmadura", 1.3f, "Con la Armadura Mk-I puesta, el escudo y el cañón crecen esto (para ir acorde a la armadura)."); Mk1Esqueleto = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CuerpoConEsqueleto", true, "Usar el cuerpo en una sola malla que se dobla con tus huesos (Models/mk1_cuerpo.obj). false = placas sueltas."); Mk1EsqueletoPropio = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EsqueletoPropio", true, "La Mk-I usa su propio esqueleto (sus proporciones) y copia solo los giros del jugador. false = se pega a los huesos del jugador (se junta)."); Mk1PoseBase = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "AlinearConPoseBase", true, "La Mk-I (en T-pose) se alinea con la pose base del jugador: se puede equipar en movimiento. false = se alinea con la postura del momento (equipar de pie y quieto)."); Mk1Volumen = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Volumen", 1f, "Tamaño de la Mk-I respecto a tu altura (1 = tu altura; más = más grande que tú)."); Mk1Tamano = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "TamanoConMk1", 1.4f, "Con la Coraza Mk-I el jugador crece hasta la altura de la armadura (en la novela mide 2,3 m: 1.28 × 1,8 m)."); Mk1Salto = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "SaltoConMana", 1.7f, "Con maná, el salto se multiplica por esto."); Mk1Carrera = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CarreraConMana", 1.3f, "Con maná, correr es esto más rápido."); Mk1BrazosGrados = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "BrazosGrados", 0f, "Grados que se giran las placas de los brazos hacia el cuerpo (+) o hacia fuera (−). Consola: mt_mk1_arms ."); Mk1RegenVida = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "RegeneracionVida", 0.5f, "Vida por segundo que regenera la Mk-I encendida."); Mk1Nado = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Nado", 2.5f, "Multiplicador de la velocidad de nado con la Mk-I encendida."); Mk1DisrupcionEspera = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "DisrupcionEspera", 6f, "Escudo Mk-I: segundos entre disrupciones mágicas (anular un proyectil)."); Mk1DisrupcionMana = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "DisrupcionMana", 15f, "Escudo Mk-I: maná que cuesta cada disrupción."); Mk1DisrupcionDesgaste = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "DisrupcionDesgaste", 0.08f, "Escudo Mk-I: fracción de la durabilidad máxima que pierde en cada disrupción (0.08 = 8 %)."); Mk1Durabilidad = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Durabilidad", 900f, "Durabilidad de la Armadura Mágica Mk-I (se repara gratis en la forja)."); if (Mathf.Approximately(Mk1Durabilidad.Value, 600f)) { Mk1Durabilidad.Value = 900f; } Mk1DesgasteSegundo = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "DesgastePorSegundo", 0.667f, "Durabilidad que pierde la Mk-I por segundo encendida (900 / 0,667 ≈ 22 minutos). Rota, se quita sola."); if (Mathf.Approximately(Mk1DesgasteSegundo.Value, 1f)) { Mk1DesgasteSegundo.Value = 0.5f; } Mk1CanonDurabilidad = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CanonDurabilidad", 300f, "Durabilidad del Cañón Mk-I (se repara gratis en la forja)."); if (Mathf.Approximately(Mk1CanonDurabilidad.Value, 200f)) { Mk1CanonDurabilidad.Value = 300f; } Mk1CanonDesgaste = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CanonDesgastePorDisparo", 1f, "Durabilidad que pierde el Cañón Mk-I por bala (300 / 1 = 300 balas). Quemado, no dispara."); if (Mathf.Approximately(Mk1CanonDesgaste.Value, 2.5f)) { Mk1CanonDesgaste.Value = 1f; } Mk1CanonVolumen = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CanonSonido", true, "Sonido de disparo del Cañón Mk-I (reutiliza uno del juego)."); Mk1Camara = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Camara", 1.45f, "Con la Mk-I puesta, la cámara se sube y se aleja esto (el personaje es más grande y tapaba la mira)."); Mk1CaidaMinima = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CaidaMinima", 2.5f, "Metros de caída desde los que tiembla la cámara y sale un poco de polvo al aterrizar, con o sin armadura (con la Mk-I, además, sonido pesado y golpe a enemigos). Un salto normal no."); Mk1TemblorPaso = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "TemblorPaso", 0.8f, "Fuerza del temblor de cámara en cada paso con la Mk-I (0 = nada). Consola: mt_mk1_shake [caida]."); Mk1TemblorCaida = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "TemblorCaida", 0.4f, "Fuerza del temblor al caer, por cada unidad de golpe (0 = nada)."); Mk1Temblor = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "PisadasTiemblan", true, "Cada paso tiembla la cámara y levanta polvo; al caer, un golpe fuerte."); Mk1VelocidadBala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "VelocidadBala", 60f, "Velocidad (m/s) de las balas del Cañón Mk-I (van rectas, sin gravedad)."); Mk1TamanoBala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "TamanoBala", 0.75f, "Tamaño de las balas del Cañón Mk-I (1 = como la Bala de Piedra)."); Mk1Metal = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Metalico", 0.25f, "Cuánto brilla como metal (0 = nada, 1 = acero pulido)."); Mk1Brillo = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Brillo", 0.35f, "Suavidad/brillo de la superficie (0 = mate, 1 = pulido)."); Mk1Tinte = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Tinte", new Color(0.95f, 0.85f, 0.7f, 1f), "Color que multiplica la textura (tono tierra)."); Mk1EscudoGiro = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoGiro", new Vector3(0f, -90f, 0f), "Giro del escudo sobre el antebrazo (grados X, Y, Z). Y gira alrededor del brazo."); Mk1EscudoPos = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoPosicion", new Vector3(-0.12f, 0.35f, 0f), "Desplazamiento del escudo (m): X hacia fuera del brazo, Y hacia el codo, Z hacia delante."); Mk1EscudoEscala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "EscudoEscala", 0.85f, "Tamaño del escudo."); Mk1CanonGiro = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CanonGiro", new Vector3(0f, 0f, 0f), "Giro del cañón sobre el antebrazo (grados X, Y, Z)."); Mk1CanonPos = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CanonPosicion", new Vector3(0.1f, 0.05f, 0f), "Desplazamiento del cañón (m): X hacia fuera del brazo, Y hacia el codo, Z hacia delante."); Mk1CanonEscala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "CanonTamano", 1f, "Tamaño del Cañón Mk-I sobre el antebrazo."); if (Mathf.Approximately(Mk1CanonEscala.Value, 1.25f)) { Mk1CanonEscala.Value = 1f; } Mk1Armadura = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Armadura", 52f, "Armadura base de la Mk-I (+4 por nivel de mejora)."); Mk1ManaSegundo = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "ManaPorSegundo", 2f, "Maná que gasta la Mk-I cada segundo mientras la llevas."); Mk1Reduccion = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "ReduccionDano", 0.25f, "Con maná: daño físico recibido menos esto (0.25 = −25 %), además de la armadura."); Mk1ManaDisparo = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "ManaPorDisparo", 4f, "Maná por bala del Cañón Mk-I."); Mk1BloqueoEscudo = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "BloqueoEscudo", 95f, "Poder de bloqueo del Escudo Mk-I (+6 por mejora)."); Mk1DanoBala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "DanoBala", 24f, "Daño contundente por bala del Cañón Mk-I (+6 por mejora, +1 % por nivel de magia elemental)."); Mk1Escala = ((BaseUnityPlugin)this).Config.Bind("Armadura Mk-I", "Escala", 1f, "Tamaño de las placas Mk-I; 1 ajusta sus articulaciones al esqueleto del jugador."); AprenderVarita = ((BaseUnityPlugin)this).Config.Bind("Aprendizaje", "AlFabricarVarita", true, "Sin efecto desde Magia 1.10: la varita despierta la magia y el primer hechizo sale de una piedra rúnica."); LaplaceCaminoActivo = ((BaseUnityPlugin)this).Config.Bind("Camino del mago", "Activo", true, "Descubrir el Factor de Laplace siguiendo el camino del mago (meditar de noche junto a una piedra rúnica)."); LaplaceCaminoReserva = ((BaseUnityPlugin)this).Config.Bind("Camino del mago", "Reserva", 30f, "Nivel de Reserva necesario para abrir el camino del mago."); LaplaceCaminoHechizos = ((BaseUnityPlugin)this).Config.Bind("Camino del mago", "Hechizos", 6, "Hechizos conocidos necesarios para abrir el camino del mago."); LaplaceCaminoRunas = ((BaseUnityPlugin)this).Config.Bind("Camino del mago", "PiedrasRunicas", 5, "Piedras rúnicas leídas necesarias para abrir el camino del mago."); PracticaPrimera = ((BaseUnityPlugin)this).Config.Bind("Aprendizaje", "PracticaPrimera", 25f, "Lanzamientos útiles de una escuela para que la práctica revele el primer hechizo nuevo."); PracticaCada = ((BaseUnityPlugin)this).Config.Bind("Aprendizaje", "PracticaCada", 40f, "Lanzamientos útiles para cada revelación siguiente (se suman a la primera)."); PergaminoProbMult = ((BaseUnityPlugin)this).Config.Bind("Aprendizaje", "PergaminoProbabilidad", 0.5f, "Multiplica la probabilidad de que caigan pergaminos de magia (0,5 = la mitad; las piedras rúnicas son la fuente principal)."); LanzamientosPorRango = ((BaseUnityPlugin)this).Config.Bind("Rangos", "LanzamientosPorRango", "0,40,100,200,350,500,800", "Lanzamientos útiles (que dañan a un enemigo, curan a un herido, protegen de un golpe; la utilidad cuenta la mitad) del rango anterior para Intermedio, Avanzado, Santo, Rey, Emperador y Dios."); JefesPorRango = ((BaseUnityPlugin)this).Config.Bind("Rangos", "JefesPorRango", ";;defeated_eikthyr;defeated_gdking|defeated_bonemass;defeated_dragon;;", "Jefe que pide cada rango (Principiante;Intermedio;Avanzado;Santo;Rey;Emperador;Dios). «a|b» = cualquiera. Vacío = ninguno. Intermedio pide además 25 enemigos vencidos con esa escuela. Moder (defeated_dragon) quita el limitador."); AprenderRango = ((BaseUnityPlugin)this).Config.Bind("Aprendizaje", "AlSubirRango", true, "Al subir de rango en una escuela aprendes solo un hechizo de esa escuela que tu rango ya permite."); PrecioPergamino = ((BaseUnityPlugin)this).Config.Bind("Aprendizaje", "PrecioPergamino", 150, "Monedas que cuesta un Pergamino de magia en el mercader Haldor (0 = no lo vende)."); VaritaModelo = ((BaseUnityPlugin)this).Config.Bind("Varita", "Modelo", "StaffGreenRoots", "Modelo del juego para la varita (p. ej. StaffGreenRoots, StaffFireball, Club)."); VaritaModeloPropio = ((BaseUnityPlugin)this).Config.Bind("Varita", "ModeloPropio", true, "Usar el modelo hecho en Blender (Models/varita_aprendiz.obj)."); VaritaRotacion = ((BaseUnityPlugin)this).Config.Bind("Varita", "RotacionEnMano", new Vector3(0f, 0f, 0f), "Giro del modelo propio en la mano (grados X, Y, Z), por si sale torcido."); VaritaPosicion = ((BaseUnityPlugin)this).Config.Bind("Varita", "PosicionEnMano", new Vector3(0f, 0f, 0f), "Desplazamiento del modelo propio en la mano (metros)."); VaritaEscala = ((BaseUnityPlugin)this).Config.Bind("Varita", "Escala", 0.6f, "Tamaño del modelo de la varita."); VaritaEnCintura = ((BaseUnityPlugin)this).Config.Bind("Varita", "EnCintura", true, "Al guardarla (ocultar armas), la varita cuelga de la cintura en vez de la espalda."); VaritaCinturaPosicion = ((BaseUnityPlugin)this).Config.Bind("Varita", "CinturaPosicion", new Vector3(-0.2f, 0.05f, 0.05f), "Posición en la cintura desde la cadera (metros: X derecha, Y arriba, Z delante). X negativa = lado izquierdo."); VaritaCinturaRotacion = ((BaseUnityPlugin)this).Config.Bind("Varita", "CinturaRotacion", new Vector3(165f, 0f, 0f), "Giro de la varita en la cintura (grados X, Y, Z). X≈180 = punta hacia abajo."); ShowHud = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "MostrarGrimorio", true, "Mostrar el hechizo seleccionado en pantalla."); HudScale = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "EscalaGrimorio", 1f, new ConfigDescription("Escala solo del HUD de magia.", (AcceptableValueBase)(object)new AcceptableValueRange(0.75f, 1.5f), Array.Empty())); HudX = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "PosicionGrimorioX", 1f, new ConfigDescription("Posición horizontal: 0 izquierda, 1 derecha. Se mantiene dentro de la pantalla.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); HudY = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "PosicionGrimorioY", 0.72f, new ConfigDescription("Posición vertical: 0 arriba, 1 abajo.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); HudHelp = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "MostrarAyudaGrimorio", true, "Mostrar los controles debajo del hechizo."); HudFavorites = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "MostrarFavoritos", true, "Mostrar los 9 favoritos en el panel del grimorio."); FavoriteShortcuts = ((BaseUnityPlugin)this).Config.Bind("Interfaz", "AtajosFavoritos", true, "Reservar Alt+1–9 solo con foco mágico y sin menús. Desactiva si otro mod usa esos atajos."); Escuelas.Register(); try { Caster.RegistrarRueda(); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("MT Magia: rueda: " + ex)); } try { GuiaInicio.Registrar(new PasoGuia { Orden = 20, TituloKey = "guia_wand", TextoKey = "guia_wand_d", Receta = "MT_VaritaAprendiz", Hecho = (Player p) => Aprendizaje.MagiaDespierta(p) || GuiaInicio.Fabricado(p, "MT_VaritaAprendiz") }); GuiaInicio.Registrar(new PasoGuia { Orden = 21, TituloKey = "guia_runestone", TextoKey = "guia_runestone_d", Hecho = Runas.AlgunaLeida }); GuiaInicio.Registrar(new PasoGuia { Orden = 22, TituloKey = "guia_paper", TextoKey = "guia_paper_d", Receta = "MT_PapelPergamino", Hecho = (Player p) => GuiaInicio.Fabricado(p, "MT_PapelPergamino") }); GuiaInicio.Registrar(new PasoGuia { Orden = 23, TituloKey = "guia_ink", TextoKey = "guia_ink_d", Receta = "MT_TintaMagica", Hecho = (Player p) => GuiaInicio.Fabricado(p, "MT_TintaMagica") }); } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogError((object)("MT Magia: guía: " + ex2)); } try { DiarioMagia.Registrar(); } catch (Exception ex3) { ((BaseUnityPlugin)this).Logger.LogError((object)("MT Magia: diario: " + ex3)); } MagicEffects.RegisterAll(); SpellBook.Build(); Caster.RegisterInput(); PrefabManager.OnVanillaPrefabsAvailable += Varita.Register; PrefabManager.OnVanillaPrefabsAvailable += Bastones.Register; PrefabManager.OnVanillaPrefabsAvailable += ArmaduraMk1.Register; PrefabManager.OnVanillaPrefabsAvailable += StoneBullet.Register; PrefabManager.OnVanillaPrefabsAvailable += RocaMagia.Register; ((Component)this).gameObject.AddComponent(); AtaqueSeguro.Reiniciar += Caster.Reiniciar; AtaqueSeguro.OcupadoAProposito.Add((Player p) => (Caster.IsActiveCasting && Focus.CastsGrimoire(p)) || Caster.BloqueoAtaque || ArmaduraMk1.HoldsCanon(p) || ((Character)p).GetSEMan().HaveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Paralisis"))); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new GiveCommand()); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_magic", "Show your magic schools, ranks and spells", (ConsoleCommand)(object)new MagiaCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_mk1_reload", "Reload the Mk-I model and textures from Models/ without restarting the game", (ConsoleCommand)(object)new Mk1RecargarCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_mk1_shake", "mt_mk1_shake [fall] — Mk-I camera shake (0 = none; default 0.8 and 0.6)", (ConsoleCommand)(object)new Mk1TemblorCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_mk1_arms", "mt_mk1_arms — close (+) or open (−) the Mk-I arms; 0 = as the model", (ConsoleCommand)(object)new Mk1BrazosCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_mk1_cannon", "mt_mk1_cannon [x y z] [rotX rotY rotZ] — Mk-I cannon on the forearm (x: out of the arm, y: to the elbow, z: forward; default 1 0.1 0.05 0 0 0 0)", (ConsoleCommand)(object)new Mk1CanonCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_mk1_shield", "mt_mk1_shield [offset] [flip 0|1] [rotX rotY rotZ] — Mk-I shield in hand (default 1.2 -0.09 1 15 0 0)", (ConsoleCommand)(object)new Mk1EscudoCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_mk1_camera", "mt_mk1_camera — camera height/distance with the Mk-I (1 = as without armor; default 1.45)", (ConsoleCommand)(object)new Mk1CamaraCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_spell", "mt_spell — show or hide spells in the grimoire. No arguments: list.", (ConsoleCommand)(object)new HechizoCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_school_rank", "[cheat] mt_school_rank <0-6>", (ConsoleCommand)(object)new EscuelaRangoCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_learn", "[cheat] mt_learn — learn without scrolls. school: all of that school · master: everything + every school at God (to cast them) · forget: remove them", (ConsoleCommand)(object)new AprenderCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)new AliasCommand("mt_grab", "mt_grab [rotX rotY rotZ] [posX posY posZ] — adjust how you hold the wand or staff in your hand (saved per item). mt_grab scale 0.7: size. No numbers: show values. mt_grab reset: rotation and position to 0.", (ConsoleCommand)(object)new AgarreCommand())); CommandManager.Instance.AddConsoleCommand((ConsoleCommand)(object)new LevitarAnimCommand()); Parches.Aplicar("mushokutensei.magia", ((object)this).GetType().Assembly, ((BaseUnityPlugin)this).Logger); RedVfxMagia.Registrar(); Log.LogInfo((object)string.Format("MT Magia {0} cargado: {1} hechizos", "2.5.9", SpellBook.All.Count)); } } public class MagiaCommand : ConsoleCommand { public override string Name => "mt_magic"; public override string Help => "Show your magic schools, ranks and spells"; public override void Run(string[] args) { Player p = Player.m_localPlayer; if ((Object)(object)p == (Object)null) { return; } StringBuilder stringBuilder = new StringBuilder(Tr.Get("magia_affinity") + ": " + Afinidad.Describe(p) + "\n" + Tr.Get("magia_schools") + ":\n"); Escuela[] all = Escuelas.All; foreach (Escuela e in all) { int num = Escuelas.Rank(p, e); string arg = ((num < 6) ? ($" ({(int)MagiaLogros.CastsDesde(p, e, num)}/{MagiaLogros.Needed[num + 1]} " + Tr.Get("magia_spells_3", new object[2] { Escuelas.RankNames[num], Escuelas.RankNames[num + 1] }) + ")") : ""); stringBuilder.AppendLine($" {Escuelas.Name(e),-16} {Escuelas.RankNames[num]}{arg}"); } List list = Caster.Known(p); stringBuilder.Append(Tr.Get("magia_spells_4") + string.Format(" ({0}): {1}", list.Count, string.Join(", ", list.Select((Spell s) => s.Name)))); List list2 = SpellBook.All.Where((Spell s) => Pergaminos.Knows(p, s.Id) && !Pergaminos.CanCast(p, s)).ToList(); if (list2.Count > 0) { stringBuilder.Append("\n" + Tr.Get("magia_learned_but_rank_not_reached") + string.Format(" ({0}): {1}", list2.Count, string.Join(", ", list2.Select((Spell s) => s.Name + " (" + Escuelas.RankNames[s.Rank] + ")")))); } Console.instance.Print(stringBuilder.ToString()); } } public class AprenderCommand : ConsoleCommand { public override string Name => "mt_learn"; public override string Help => "[cheat] mt_learn — learn without scrolls. school: all of that school · master: everything + every school at God (to cast them) · forget: remove them"; public override bool IsCheat => true; public override void Run(string[] args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return; } if (args.Length < 1) { Console.instance.Print(((ConsoleCommand)this).Help + "\n" + string.Join(", ", SpellBook.All.Select((Spell s) => s.Id))); return; } string a = args[0].ToLowerInvariant(); a = ((a == "forget") ? "olvidar" : ((a == "master") ? "maestro" : ((a == "all") ? "todos" : a))); if (a == "olvidar") { localPlayer.m_customData.Remove("MT.Magia.Aprendidos"); Console.instance.Print(Tr.Get("magia_forgot_all_spells")); return; } if (a == "maestro") { foreach (Spell item in SpellBook.All) { Pergaminos.Learn(localPlayer, item.Id); } Escuela[] all = Escuelas.All; foreach (Escuela e in all) { Escuelas.SetRank(localPlayer, e, 6); for (int num2 = 1; num2 <= 6; num2++) { MagiaLogros.SetCasts(localPlayer, e, num2 - 1, MagiaLogros.Needed[num2]); } } Console.instance.Print(Tr.Get("magia_spells_learned_every_school_god", new object[1] { SpellBook.All.Count })); return; } Escuela school; bool flag = Enum.TryParse(Escuelas.Arg(a), ignoreCase: true, out school); List list = ((a == "todos") ? SpellBook.All : (flag ? SpellBook.All.Where((Spell s) => s.School == school || s.School2 == school).ToList() : SpellBook.All.Where((Spell s) => s.Id == a).ToList())); foreach (Spell item2 in list) { Pergaminos.Learn(localPlayer, item2.Id); } Console.instance.Print(Tr.Get("magia_spell_s_learned", new object[1] { list.Count }) + (flag ? (" (" + Escuelas.Name(school) + ")") : "") + ". " + Tr.Get("magia_cast_them_need_rank_mt")); } } public class HechizoCommand : ConsoleCommand { public override string Name => "mt_spell"; public override string Help => "mt_spell — show or hide spells in the grimoire. No arguments: list."; public override void Run(string[] args) { Player p = Player.m_localPlayer; if ((Object)(object)p == (Object)null) { return; } List list = Caster.Learned(p); if (args.Length < 2) { Console.instance.Print(string.Join("\n", list.Select((Spell s) => string.Format(" {0} {1,-20} {2}", Grimorio.IsHidden(p, s.Id) ? "[ ]" : "[x]", s.Id, s.Name)))); Console.instance.Print(((ConsoleCommand)this).Help); return; } bool flag = args[1].ToLowerInvariant() == "off"; List list2 = ((args[0].ToLowerInvariant() == "todos" || args[0].ToLowerInvariant() == "all") ? list : list.Where((Spell s) => s.Id == args[0].ToLowerInvariant() || s.Name.ToLowerInvariant().Contains(args[0].ToLowerInvariant())).ToList()); foreach (Spell item in list2) { Grimorio.Set(p, item.Id, flag); } Console.instance.Print(flag ? Tr.Get("magia_spell_s_hidden", new object[1] { list2.Count }) : Tr.Get("magia_spell_s_enabled", new object[1] { list2.Count })); } } public class EscuelaRangoCommand : ConsoleCommand { public override string Name => "mt_school_rank"; public override string Help => "[cheat] mt_school_rank <0-6>"; public override bool IsCheat => true; public override void Run(string[] args) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || args.Length < 2 || !Enum.TryParse(Escuelas.Arg(args[0]), ignoreCase: true, out var result) || !int.TryParse(args[1], out var result2)) { Console.instance.Print(((ConsoleCommand)this).Help); return; } result2 = Mathf.Clamp(result2, 0, 6); Escuelas.SetRank(localPlayer, result, result2); for (int i = 1; i <= result2; i++) { MagiaLogros.SetCasts(localPlayer, result, i - 1, MagiaLogros.Needed[i]); } Console.instance.Print(Escuelas.Name(result) + " = " + Escuelas.RankNames[result2] + " " + Tr.Get("magia_saint_or_higher_also_requires")); } } public class Mk1RecargarCommand : ConsoleCommand { public override string Name => "mt_mk1_reload"; public override string Help => "Reload the Mk-I model and textures from Models/ without restarting the game"; public override void Run(string[] args) { ArmaduraMk1.Recargar(); Console.instance.Print(Tr.Get("magia_mk_i_reloaded_if_doesn")); } } public class Mk1TemblorCommand : ConsoleCommand { public override string Name => "mt_mk1_shake"; public override string Help => "mt_mk1_shake [fall] — Mk-I camera shake (0 = none; default 0.8 and 0.6)"; public override void Run(string[] args) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; if (args.Length >= 1 && float.TryParse(args[0].Replace(',', '.'), NumberStyles.Float, invariantCulture, out var result)) { MTMagiaPlugin.Mk1TemblorPaso.Value = Mathf.Max(0f, result); } if (args.Length >= 2 && float.TryParse(args[1].Replace(',', '.'), NumberStyles.Float, invariantCulture, out var result2)) { MTMagiaPlugin.Mk1TemblorCaida.Value = Mathf.Max(0f, result2); } Console.instance.Print($"Mk-I shake: step {MTMagiaPlugin.Mk1TemblorPaso.Value:0.##}, fall {MTMagiaPlugin.Mk1TemblorCaida.Value:0.##} ({((ConsoleCommand)this).Help})"); } } public class Mk1BrazosCommand : ConsoleCommand { public override string Name => "mt_mk1_arms"; public override string Help => "mt_mk1_arms — close (+) or open (−) the Mk-I arms; 0 = as the model"; public override void Run(string[] args) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; if (args.Length >= 1 && float.TryParse(args[0].Replace(',', '.'), NumberStyles.Float, invariantCulture, out var result)) { MTMagiaPlugin.Mk1BrazosGrados.Value = Mathf.Clamp(result, -60f, 60f); ArmaduraMk1.Recargar(); } Console.instance.Print($"Mk-I arms: {MTMagiaPlugin.Mk1BrazosGrados.Value:0.#}° ({((ConsoleCommand)this).Help})"); } } public class Mk1EscudoCommand : ConsoleCommand { public const string Uso = "mt_mk1_shield [offset] [flip 0|1] [rotX rotY rotZ] — Mk-I shield in hand (default 1.2 -0.09 1 15 0 0)"; public override string Name => "mt_mk1_shield"; public override string Help => "mt_mk1_shield [offset] [flip 0|1] [rotX rotY rotZ] — Mk-I shield in hand (default 1.2 -0.09 1 15 0 0)"; public override void Run(string[] args) { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_00e3: Unknown result type (might be due to invalid IL or missing references) CultureInfo ci = CultureInfo.InvariantCulture; if (args.Length >= 1) { MTMagiaPlugin.Mk1EscudoManoEscala.Value = Mathf.Clamp(F(0, MTMagiaPlugin.Mk1EscudoManoEscala.Value), 0.2f, 4f); } if (args.Length >= 2) { MTMagiaPlugin.Mk1EscudoManoSeparacion.Value = Mathf.Clamp(F(1, MTMagiaPlugin.Mk1EscudoManoSeparacion.Value), -1f, 1f); } if (args.Length >= 3) { MTMagiaPlugin.Mk1EscudoManoVoltear.Value = F(2, 1f) != 0f; } if (args.Length >= 6) { MTMagiaPlugin.Mk1EscudoManoGiro.Value = new Vector3(F(3, 0f), F(4, 0f), F(5, 0f)); } bool flag = ArmaduraMk1.ReaplicarEscudo(Player.m_localPlayer); Vector3 value = MTMagiaPlugin.Mk1EscudoManoGiro.Value; Console.instance.Print($"Mk-I shield: size {MTMagiaPlugin.Mk1EscudoManoEscala.Value:0.##} · offset {MTMagiaPlugin.Mk1EscudoManoSeparacion.Value:0.##} · " + $"flip {(MTMagiaPlugin.Mk1EscudoManoVoltear.Value ? 1 : 0)} · rotation {value.x:0} {value.y:0} {value.z:0}" + (flag ? "" : " (equip the Mk-I shield to see it)")); float F(int i, float def) { if (args.Length <= i || !float.TryParse(args[i].Replace(',', '.'), NumberStyles.Float, ci, out var result)) { return def; } return result; } } } public class Mk1CanonCommand : ConsoleCommand { public const string Uso = "mt_mk1_cannon [x y z] [rotX rotY rotZ] — Mk-I cannon on the forearm (x: out of the arm, y: to the elbow, z: forward; default 1 0.1 0.05 0 0 0 0)"; public override string Name => "mt_mk1_cannon"; public override string Help => "mt_mk1_cannon [x y z] [rotX rotY rotZ] — Mk-I cannon on the forearm (x: out of the arm, y: to the elbow, z: forward; default 1 0.1 0.05 0 0 0 0)"; public override void Run(string[] args) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_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_010c: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) CultureInfo ci = CultureInfo.InvariantCulture; if (args.Length >= 1) { MTMagiaPlugin.Mk1CanonEscala.Value = Mathf.Clamp(F(0, MTMagiaPlugin.Mk1CanonEscala.Value), 0.2f, 4f); } if (args.Length >= 4) { MTMagiaPlugin.Mk1CanonPos.Value = new Vector3(F(1, 0f), F(2, 0f), F(3, 0f)); } if (args.Length >= 7) { MTMagiaPlugin.Mk1CanonGiro.Value = new Vector3(F(4, 0f), F(5, 0f), F(6, 0f)); } ArmaduraMk1Ctrl.CanonReaplicar = true; Vector3 value = MTMagiaPlugin.Mk1CanonPos.Value; Vector3 value2 = MTMagiaPlugin.Mk1CanonGiro.Value; Console.instance.Print($"Mk-I cannon: size {MTMagiaPlugin.Mk1CanonEscala.Value:0.##} · position {value.x:0.##} {value.y:0.##} {value.z:0.##} · rotation {value2.x:0} {value2.y:0} {value2.z:0}"); float F(int i, float def) { if (args.Length <= i || !float.TryParse(args[i].Replace(',', '.'), NumberStyles.Float, ci, out var result)) { return def; } return result; } } } public class Mk1CamaraCommand : ConsoleCommand { public override string Name => "mt_mk1_camera"; public override string Help => "mt_mk1_camera — camera height/distance with the Mk-I (1 = as without armor; default 1.45)"; public override void Run(string[] args) { CultureInfo invariantCulture = CultureInfo.InvariantCulture; if (args.Length >= 1 && float.TryParse(args[0].Replace(',', '.'), NumberStyles.Float, invariantCulture, out var result)) { MTMagiaPlugin.Mk1Camara.Value = Mathf.Clamp(result, 0.5f, 3f); ArmaduraMk1Ctrl.CamaraReaplicar = true; } Console.instance.Print($"Mk-I camera: ×{MTMagiaPlugin.Mk1Camara.Value:0.##} ({((ConsoleCommand)this).Help})"); } } public class MuroEmerge : MonoBehaviour { private const float Duracion = 0.5f; private const float Hundido = 2.2f; private Vector3 _final; private float _edad; public static void Subir(Vector3 pos, bool sonido) { //IL_0030: 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_0020: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { if (sonido) { Fx.Visual("sfx_rock_destroyed", pos); Particulas.Tierra(pos, 1.6f, 1.3f); } Buscar(pos, 0); } } private static void Buscar(Vector3 pos, int intento) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_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) Collider[] array = Physics.OverlapSphere(pos + Vector3.up * 1f, 0.6f); for (int i = 0; i < array.Length; i++) { WearNTear componentInParent = ((Component)array[i]).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null) { continue; } Vector3 val = ((Component)componentInParent).transform.position - pos; if (!(((Vector3)(ref val)).sqrMagnitude > 0.05f)) { if (!((Object)(object)((Component)componentInParent).GetComponent() != (Object)null)) { MuroEmerge muroEmerge = ((Component)componentInParent).gameObject.AddComponent(); muroEmerge._final = ((Component)componentInParent).transform.position; ((Component)componentInParent).transform.position = muroEmerge._final - Vector3.up * 2.2f; } return; } } if (intento < 10) { SpellRunner.After(0.1f, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Buscar(pos, intento + 1); }); } } private void Update() { //IL_0041: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_009d: Unknown result type (might be due to invalid IL or missing references) _edad += Time.deltaTime; float num = Mathf.Clamp01(_edad / 0.5f); float num2 = 1f - (1f - num) * (1f - num); ((Component)this).transform.position = _final - Vector3.up * 2.2f * (1f - num2) + ((num < 1f) ? (Random.insideUnitSphere * 0.04f) : Vector3.zero); if (num >= 1f) { ((Component)this).transform.position = _final; Object.Destroy((Object)(object)this); } } } public class MuroTierra : MonoBehaviour, IDestructible { private float _health; public static MuroTierra Spawn(Vector3 center, Quaternion rot, float width, float height, float thick, float health, Material mat) { //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_0076: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("MT_MuroDeTierra"); val.transform.SetPositionAndRotation(center, rot); int num = LayerMask.NameToLayer("static_solid"); if (num >= 0) { val.layer = num; } Mesh sharedMesh = BuildMesh(val.transform, width, height, thick); val.AddComponent().sharedMesh = sharedMesh; ((Renderer)val.AddComponent()).sharedMaterial = mat; val.AddComponent().sharedMesh = sharedMesh; MuroTierra muroTierra = val.AddComponent(); muroTierra._health = health; Fx.Visual("vfx_RockDestroyed", center, 1.4f); return muroTierra; } private static Mesh BuildMesh(Transform t, float width, float height, float thick) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: 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_02da: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) Random random = new Random(Random.Range(0, 99999)); List list = new List(); List list2 = new List(); List list3 = new List(); int mask = LayerMask.GetMask(new string[4] { "Default", "static_solid", "terrain", "piece" }); RaycastHit val = default(RaycastHit); for (int i = 0; i <= 14; i++) { float num = (0f - width) / 2f + width * (float)i / 14f; float num2 = (Physics.Raycast(t.TransformPoint(new Vector3(num, 0f, 0f)) + Vector3.up * 6f, Vector3.down, ref val, 30f, mask, (QueryTriggerInteraction)1) ? (((RaycastHit)(ref val)).point.y - t.position.y) : 0f); float num3 = num2 + height * (0.85f + 0.3f * (float)random.NextDouble()); float num4 = num2 - 1f; float num5 = (float)(random.NextDouble() - 0.5) * 0.25f; list.Add(new Vector3(num, num4, (0f - thick) / 2f + num5)); list.Add(new Vector3(num, num3, (0f - thick) / 2f * 0.7f + num5)); list.Add(new Vector3(num, num3, thick / 2f * 0.7f + num5)); list.Add(new Vector3(num, num4, thick / 2f + num5)); float num6 = num / 1.5f; list3.Add(new Vector2(num6, num4 / 1.5f)); list3.Add(new Vector2(num6, num3 / 1.5f)); list3.Add(new Vector2(num6 + 0.3f, num3 / 1.5f)); list3.Add(new Vector2(num6 + 0.3f, num4 / 1.5f)); if (i != 0) { int num7 = (i - 1) * 4; int num8 = i * 4; for (int j = 0; j < 4; j++) { int num9 = (j + 1) % 4; list2.AddRange(new int[6] { num7 + j, num8 + j, num8 + num9, num7 + j, num8 + num9, num7 + num9 }); } } } int num10 = 56; list2.AddRange(new int[6] { 0, 1, 2, 0, 2, 3 }); list2.AddRange(new int[6] { num10, num10 + 2, num10 + 1, num10, num10 + 3, num10 + 2 }); Mesh val2 = new Mesh { name = "MT_MuroTierra" }; val2.SetVertices(list); val2.SetTriangles(list2, 0); val2.SetUVs(0, list3); val2.RecalculateNormals(); val2.RecalculateBounds(); return val2; } public DestructibleType GetDestructibleType() { return (DestructibleType)1; } public void Damage(HitData hit) { //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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_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_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) if (hit == null || _health <= 0f) { return; } float num = hit.m_damage.m_blunt + hit.m_damage.m_slash + hit.m_damage.m_pierce + hit.m_damage.m_chop + hit.m_damage.m_pickaxe * 2f + hit.m_damage.m_fire + hit.m_damage.m_frost + hit.m_damage.m_lightning + hit.m_damage.m_spirit; _health -= num; Fx.Visual("vfx_RockHit", hit.m_point); if (!(_health > 0f)) { Bounds bounds = ((Renderer)((Component)this).GetComponent()).bounds; for (int i = 0; i < 6; i++) { Fx.Visual("vfx_RockDestroyed", ((Bounds)(ref bounds)).center + new Vector3(Random.Range(0f - ((Bounds)(ref bounds)).extents.x, ((Bounds)(ref bounds)).extents.x), 0f, Random.Range(0f - ((Bounds)(ref bounds)).extents.z, ((Bounds)(ref bounds)).extents.z)), 1.2f); } Object.Destroy((Object)(object)((Component)this).gameObject); } } } public static class ObjModel { private class MtlColor { public Color Diffuse; public Color Emission; public string Texture; } private static readonly Dictionary Colors = new Dictionary { { "Madera", new Color(0.45f, 0.28f, 0.15f) }, { "Cuero", new Color(0.2f, 0.12f, 0.07f) }, { "Hierro", new Color(0.5f, 0.5f, 0.53f) }, { "Cristal", new Color(0.35f, 0.65f, 1f) } }; private static readonly Dictionary Textures = new Dictionary(); public static Mesh Load(string path, out List materialNames) { //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Expected O, but got Unknown //IL_0107: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0212: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) materialNames = new List(); if (!File.Exists(path)) { return null; } List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List(); List> list7 = new List>(); List list8 = null; CultureInfo invariantCulture = CultureInfo.InvariantCulture; string[] array = File.ReadAllLines(path); for (int i = 0; i < array.Length; i++) { string text = array[i].Trim(); if (text.Length == 0 || text[0] == '#') { continue; } string[] array2 = text.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries); switch (array2[0]) { case "v": list.Add(new Vector3(0f - float.Parse(array2[1], invariantCulture), float.Parse(array2[2], invariantCulture), float.Parse(array2[3], invariantCulture))); break; case "vn": list2.Add(new Vector3(0f - float.Parse(array2[1], invariantCulture), float.Parse(array2[2], invariantCulture), float.Parse(array2[3], invariantCulture))); break; case "vt": list3.Add(new Vector2(float.Parse(array2[1], invariantCulture), float.Parse(array2[2], invariantCulture))); break; case "usemtl": materialNames.Add((array2.Length > 1) ? array2[1] : "default"); list8 = new List(); list7.Add(list8); break; case "f": { if (list8 == null) { materialNames.Add("default"); list8 = new List(); list7.Add(list8); } List list9 = new List(); for (int j = 1; j < array2.Length; j++) { string[] array3 = array2[j].Split(new char[1] { '/' }); list4.Add(list[Index(array3[0], list.Count)]); list6.Add((array3.Length > 1 && array3[1].Length > 0) ? list3[Index(array3[1], list3.Count)] : Vector2.zero); list5.Add((array3.Length > 2 && array3[2].Length > 0) ? list2[Index(array3[2], list2.Count)] : Vector3.up); list9.Add(list4.Count - 1); } for (int k = 1; k + 1 < list9.Count; k++) { list8.Add(list9[0]); list8.Add(list9[k + 1]); list8.Add(list9[k]); } break; } } } Mesh val = new Mesh { name = Path.GetFileNameWithoutExtension(path) }; if (list4.Count > 65000) { val.indexFormat = (IndexFormat)1; } val.SetVertices(list4); val.SetNormals(list5); val.SetUVs(0, list6); val.subMeshCount = list7.Count; for (int l = 0; l < list7.Count; l++) { val.SetTriangles(list7[l], l); } val.RecalculateBounds(); return val; } private static int Index(string s, int count) { int num = int.Parse(s, CultureInfo.InvariantCulture); if (num <= 0) { return count + num; } return num - 1; } private static Texture2D LoadTexture(string path) { if (Textures.TryGetValue(path, out var value)) { return value; } value = (File.Exists(path) ? AssetUtils.LoadTexture(path, true) : null); return Textures[path] = value; } private static Dictionary ReadMtl(string path) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); if (path == null || !File.Exists(path)) { return dictionary; } CultureInfo invariantCulture = CultureInfo.InvariantCulture; MtlColor mtlColor = null; string[] array = File.ReadAllLines(path); Color val = default(Color); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Trim().Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries); if (array2.Length == 0) { continue; } if (mtlColor != null && array2[0] == "map_Kd" && array2.Length > 1) { mtlColor.Texture = Path.Combine(Path.GetDirectoryName(path), array2[^1]); } else if (array2[0] == "newmtl" && array2.Length > 1) { mtlColor = new MtlColor { Diffuse = Color.gray, Emission = Color.black }; dictionary[array2[1]] = mtlColor; } else if (mtlColor != null && array2.Length >= 4 && (array2[0] == "Kd" || array2[0] == "Ke")) { ((Color)(ref val))..ctor(Mathf.LinearToGammaSpace(float.Parse(array2[1], invariantCulture)), Mathf.LinearToGammaSpace(float.Parse(array2[2], invariantCulture)), Mathf.LinearToGammaSpace(float.Parse(array2[3], invariantCulture))); if (array2[0] == "Kd") { mtlColor.Diffuse = val; } else { mtlColor.Emission = val; } } } return dictionary; } public static Material[] Materials(List names, Material template, string mtlPath = null) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = ReadMtl(mtlPath); Material[] array = (Material[])(object)new Material[names.Count]; for (int i = 0; i < names.Count; i++) { Material val = (((Object)(object)template != (Object)null) ? new Material(template) : new Material(Shader.Find("Standard"))); ((Object)val).name = "MT_" + names[i]; if (!dictionary.ContainsKey(names[i])) { int num = names[i].LastIndexOf('.'); if (num > 0 && dictionary.TryGetValue(names[i].Substring(0, num), out var value)) { dictionary[names[i]] = value; } } MtlColor value2; Color value3; Color val2 = (dictionary.TryGetValue(names[i], out value2) ? value2.Diffuse : (Colors.TryGetValue(names[i], out value3) ? value3 : Color.gray)); Color val3 = value2?.Emission ?? ((names[i] == "Cristal") ? (val2 * 1.5f) : Color.black); Texture2D val4 = ((value2 != null && value2.Texture != null) ? LoadTexture(value2.Texture) : null); if (val.HasProperty("_MainTex")) { val.SetTexture("_MainTex", (Texture)(object)(((Object)(object)val4 != (Object)null) ? val4 : Texture2D.whiteTexture)); } if (val.HasProperty("_BumpMap")) { val.SetTexture("_BumpMap", (Texture)null); } if (val.HasProperty("_Color")) { val.SetColor("_Color", val2); } if (((Color)(ref val3)).maxColorComponent > 0.01f && val.HasProperty("_EmissionColor")) { val.EnableKeyword("_EMISSION"); val.SetColor("_EmissionColor", val3 * 1.5f); } array[i] = val; } return array; } public static void ReplaceVisual(GameObject itemPrefab, Mesh mesh, Material[] mats, Vector3 handEuler, Vector3 handOffset, Vector3? groundEuler = null) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_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_008a: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_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) Transform val = itemPrefab.transform.Find("attach"); Renderer[] componentsInChildren = itemPrefab.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Color val2 = StoneColor(mats); Light[] componentsInChildren2 = itemPrefab.GetComponentsInChildren(true); foreach (Light obj in componentsInChildren2) { ((Behaviour)obj).enabled = false; obj.color = val2; } ParticleSystem[] componentsInChildren3 = itemPrefab.GetComponentsInChildren(true); foreach (ParticleSystem obj2 in componentsInChildren3) { EmissionModule emission = obj2.emission; ((EmissionModule)(ref emission)).enabled = false; MainModule main = obj2.main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(val2); } if ((Object)(object)val != (Object)null) { Add(val, "MT_Modelo", mesh, mats, Quaternion.Euler(handEuler), handOffset); } else { Add(itemPrefab.transform, "MT_ModeloSuelo", mesh, mats, Quaternion.Euler((Vector3)(((??)groundEuler) ?? new Vector3(0f, 0f, 90f))), Vector3.zero); } } private static Color StoneColor(Material[] mats) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) Color val = Color.black; foreach (Material val2 in mats) { if ((Object)(object)val2 != (Object)null && val2.HasProperty("_EmissionColor") && val2.IsKeywordEnabled("_EMISSION")) { Color color = val2.GetColor("_EmissionColor"); if (((Color)(ref color)).maxColorComponent > ((Color)(ref val)).maxColorComponent) { val = color; } } } if (!(((Color)(ref val)).maxColorComponent > 0.01f)) { return new Color(1f, 0.9f, 0.7f); } return val / ((Color)(ref val)).maxColorComponent; } private static void Add(Transform parent, string name, Mesh mesh, Material[] mats, Quaternion rot, Vector3 pos, Transform skipIfParentIs = null) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); val.transform.localRotation = rot; val.transform.localPosition = pos; val.AddComponent().sharedMesh = mesh; ((Renderer)val.AddComponent()).sharedMaterials = mats; val.layer = ((Component)parent).gameObject.layer; } } public static class Particulas { public class Config { public Color ColorA = Color.white; public Color ColorB = Color.white; public float LifeMin = 1f; public float LifeMax = 2f; public float SpeedMin; public float SpeedMax = 1f; public float SizeMin = 0.2f; public float SizeMax = 0.5f; public float Gravity; public float Radius = 1f; public bool Hemisphere; public bool Additive = true; public int Burst; public float Rate; public float Duration = 0.1f; public float FadeIn = 0.1f; public float Grow = 1f; public int Max = 1000; } private struct Expiracion { public ParticleSystem Ps; public float Hasta; } private class PoolTicker : MonoBehaviour { private void Update() { float time = Time.time; for (int num = _activas.Count - 1; num >= 0; num--) { Expiracion expiracion = _activas[num]; if (time >= expiracion.Hasta || (Object)(object)expiracion.Ps == (Object)null || !((Component)expiracion.Ps).gameObject.activeInHierarchy) { if ((Object)(object)expiracion.Ps != (Object)null) { Guardar(expiracion.Ps); } else { Perf.VfxActivos = Mathf.Max(0, Perf.VfxActivos - 1); } int index = _activas.Count - 1; _activas[num] = _activas[index]; _activas.RemoveAt(index); } } } } private const int MaxGuardados = 200; private static readonly Stack _libres = new Stack(); private static Material _matAditivo; private static Material _matNormal; private static Transform _raiz; private static readonly Burst[] _sinRafagas = (Burst[])(object)new Burst[0]; private static readonly Burst[] _rafaga = (Burst[])(object)new Burst[1]; private static readonly List _activas = new List(128); private static Material Mat(bool aditivo) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown Material val = (aditivo ? _matAditivo : _matNormal); if ((Object)(object)val != (Object)null) { return val; } val = new Material((aditivo ? Shader.Find("Legacy Shaders/Particles/Additive") : Shader.Find("Legacy Shaders/Particles/Alpha Blended")) ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)ToukiManos.Dot() }; if (aditivo) { _matAditivo = val; } else { _matNormal = val; } return val; } private static ParticleSystem Tomar() { //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) while (_libres.Count > 0) { ParticleSystem val = _libres.Pop(); if (!((Object)(object)val == (Object)null)) { Perf.VfxLibres = _libres.Count; Perf.VfxReusados++; return val; } } GameObject val2 = new GameObject("MT_Particulas"); val2.SetActive(false); ParticleSystem val3 = val2.AddComponent(); val3.Stop(true, (ParticleSystemStopBehavior)0); val2.GetComponent().renderMode = (ParticleSystemRenderMode)0; ColorOverLifetimeModule colorOverLifetime = val3.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; SizeOverLifetimeModule sizeOverLifetime = val3.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).enabled = true; Perf.VfxCreados++; return val3; } private static void AsegurarRaiz() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_raiz == (Object)null) { GameObject val = new GameObject("MT_PoolParticulas"); Object.DontDestroyOnLoad((Object)val); val.AddComponent(); _raiz = val.transform; } } internal static void Guardar(ParticleSystem ps) { Perf.VfxActivos = Mathf.Max(0, Perf.VfxActivos - 1); if (!((Object)(object)ps == (Object)null)) { ps.Stop(true, (ParticleSystemStopBehavior)0); ps.Clear(true); if (_libres.Count >= 200) { Object.Destroy((Object)(object)((Component)ps).gameObject); return; } AsegurarRaiz(); ((Component)ps).transform.SetParent(_raiz, false); ((Component)ps).gameObject.SetActive(false); _libres.Push(ps); Perf.VfxLibres = _libres.Count; } } public static ParticleSystem Spawn(Vector3 pos, Config c, Transform follow = null) { //IL_006b: 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_003c: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_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_01fd: 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_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_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Expected O, but got Unknown //IL_0220: 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_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) if (!MTMagiaPlugin.EfectosPropios.Value) { return null; } AsegurarRaiz(); ParticleSystem val = Tomar(); GameObject gameObject = ((Component)val).gameObject; if ((Object)(object)follow != (Object)null) { gameObject.transform.SetParent(follow, false); gameObject.transform.localPosition = Vector3.zero; gameObject.transform.localRotation = Quaternion.identity; } else { gameObject.transform.SetParent((Transform)null, false); gameObject.transform.SetPositionAndRotation(pos, Quaternion.identity); } gameObject.transform.localScale = Vector3.one; MainModule main = val.main; ((MainModule)(ref main)).duration = Mathf.Max(0.05f, c.Duration); ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(c.LifeMin, c.LifeMax); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(c.SpeedMin, c.SpeedMax); ((MainModule)(ref main)).startSize = new MinMaxCurve(c.SizeMin, c.SizeMax); ((MainModule)(ref main)).startColor = new MinMaxGradient(c.ColorA, c.ColorB); ((MainModule)(ref main)).startRotation = new MinMaxCurve(0f, (float)Math.PI * 2f); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(c.Gravity); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).maxParticles = c.Max; EmissionModule emission = val.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(c.Rate); if (c.Burst > 0) { _rafaga[0] = new Burst(0f, (short)Mathf.Min(c.Burst, 32767)); ((EmissionModule)(ref emission)).SetBursts(_rafaga); } else { ((EmissionModule)(ref emission)).SetBursts(_sinRafagas); } ShapeModule shape = val.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)(c.Hemisphere ? 2 : 0); ((ShapeModule)(ref shape)).radius = Mathf.Max(0.01f, c.Radius); ((ShapeModule)(ref shape)).rotation = (Vector3)(c.Hemisphere ? new Vector3(-90f, 0f, 0f) : Vector3.zero); ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; Gradient val2 = new Gradient(); val2.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, Mathf.Clamp(c.FadeIn, 0.01f, 0.9f)), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val2); SizeOverLifetimeModule sizeOverLifetime = val.sizeOverLifetime; ((SizeOverLifetimeModule)(ref sizeOverLifetime)).size = new MinMaxCurve(1f, AnimationCurve.Linear(0f, 1f, 1f, c.Grow)); ((Renderer)gameObject.GetComponent()).sharedMaterial = Mat(c.Additive); _activas.Add(new Expiracion { Ps = val, Hasta = Time.time + c.Duration + c.LifeMax + 0.5f }); gameObject.SetActive(true); val.Clear(true); val.Play(); Perf.VfxActivos++; Perf.VfxLibres = _libres.Count; return val; } public static void Tierra(Vector3 pos, float radius = 1f, float fuerza = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) Spawn(pos, new Config { ColorA = new Color(0.4f, 0.32f, 0.23f, 1f), ColorB = new Color(0.55f, 0.52f, 0.47f, 1f), LifeMin = 0.6f, LifeMax = 1.1f, SpeedMin = 2f * Mathf.Sqrt(fuerza), SpeedMax = 4.5f * Mathf.Sqrt(fuerza), SizeMin = 0.05f, SizeMax = 0.14f, Gravity = 1.4f, Radius = radius, Hemisphere = true, Burst = Mathf.RoundToInt(14f * fuerza), Additive = false, FadeIn = 0.02f, Grow = 0.8f }); Spawn(pos, new Config { ColorA = new Color(0.55f, 0.46f, 0.34f, 0.55f), ColorB = new Color(0.44f, 0.37f, 0.29f, 0.4f), LifeMin = 0.8f, LifeMax = 1.4f, SpeedMin = 0.4f, SpeedMax = 1.2f * Mathf.Sqrt(fuerza), SizeMin = 0.25f * radius, SizeMax = 0.5f * radius, Gravity = -0.03f, Radius = radius, Hemisphere = true, Burst = Mathf.RoundToInt(8f * fuerza), Additive = false, Grow = 2f }); } public static void IceCage(Character target, float seconds) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00f5: Expected O, but got Unknown //IL_0177: 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_01dd: 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_0222: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { Collider componentInChildren = ((Component)target).GetComponentInChildren(); ? val; if (!((Object)(object)componentInChildren != (Object)null)) { val = new Vector3(1f, 2f, 1f); } else { Bounds bounds = componentInChildren.bounds; val = ((Bounds)(ref bounds)).size; } Vector3 val2 = (Vector3)val; float num = Mathf.Clamp(Mathf.Max(val2.x, val2.z) * 0.55f, 0.5f, 3f); float num2 = Mathf.Clamp(val2.y, 1f, 5f); Transform transform = new GameObject("MT_JaulaHielo").transform; transform.position = ((Component)target).transform.position; Material val3 = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)Texture2D.whiteTexture, color = new Color(0.65f, 0.88f, 1f, 0.55f) }; for (int i = 0; i < 9; i++) { float num3 = (float)i / 9f * (float)Math.PI * 2f + Random.Range(-0.2f, 0.2f); GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); Object.Destroy((Object)(object)obj.GetComponent()); ((Object)obj).name = "Cristal"; obj.transform.SetParent(transform, false); float num4 = num2 * Random.Range(0.6f, 1.1f); obj.transform.localScale = new Vector3(num * 0.35f, num4, num * 0.35f); obj.transform.localPosition = new Vector3(Mathf.Cos(num3) * num, num4 * 0.45f, Mathf.Sin(num3) * num); obj.transform.localRotation = Quaternion.Euler(Random.Range(-15f, 15f), num3 * 57.29578f + 45f, Random.Range(-20f, 20f)); ((Renderer)obj.GetComponent()).sharedMaterial = val3; } Spawn(target.GetCenterPoint(), new Config { ColorA = new Color(0.7f, 0.9f, 1f, 0.9f), ColorB = Color.white, LifeMin = 0.5f, LifeMax = 1f, SpeedMin = 0.1f, SpeedMax = 0.4f, SizeMin = 0.08f, SizeMax = 0.2f, Radius = num, Rate = 40f, Duration = seconds }); Object.Destroy((Object)(object)((Component)transform).gameObject, seconds); Object.Destroy((Object)(object)val3, seconds); } } } public static class Pergaminos { private const string Key = "MT.Magia.Aprendidos"; private static Player _cachedP; private static string _cachedRaw; private static readonly HashSet _cachedKnown = new HashSet(); public const int PergaminoMax = 4; public const int GrimorioMin = 5; public const float GranGrimorioGravedad = 0.25f; public static HashSet Known(Player p) { if ((Object)(object)p == (Object)null) { _cachedKnown.Clear(); _cachedP = null; _cachedRaw = null; return _cachedKnown; } if (p.m_customData.TryGetValue("MT.Magia.Aprendidos", out var value) && !string.IsNullOrEmpty(value)) { if ((Object)(object)p == (Object)(object)_cachedP && (object)value == _cachedRaw) { return _cachedKnown; } _cachedP = p; _cachedRaw = value; _cachedKnown.Clear(); int num = 0; while (num < value.Length) { int num2 = value.IndexOf(',', num); if (num2 < 0) { num2 = value.Length; } if (num2 > num) { string item = value.Substring(num, num2 - num); _cachedKnown.Add(item); } num = num2 + 1; } return _cachedKnown; } if ((Object)(object)_cachedP != (Object)(object)p || _cachedRaw != null) { _cachedP = p; _cachedRaw = null; _cachedKnown.Clear(); } return _cachedKnown; } public static bool Knows(Player p, string id) { return Known(p).Contains(id); } public static void Learn(Player p, string id) { if (!((Object)(object)p == (Object)null) && !string.IsNullOrEmpty(id)) { HashSet hashSet = Known(p); if (hashSet.Add(id)) { List list = new List(hashSet); list.Sort(StringComparer.Ordinal); string text = string.Join(",", list); p.m_customData["MT.Magia.Aprendidos"] = text; _cachedP = p; _cachedRaw = text; } } } public static bool CanCast(Player p, Spell s) { if (Escuelas.Rank(p, s.School) >= s.Rank) { if (s.School2.HasValue) { return Escuelas.Rank(p, s.School2.Value) >= s.Rank; } return true; } return false; } public static Spell Pick(Player p, int minRank, int maxRank) { HashSet known = Known(p); List list = SpellBook.All.Where((Spell s) => !known.Contains(s.Id) && s.School != Escuela.Gravedad && s.Rank >= minRank && s.Rank <= maxRank).ToList(); if (list.Count == 0) { return null; } float num = list.Sum(Weight(p)); float num2 = Random.value * num; foreach (Spell item in list) { num2 -= Weight(p)(item); if (num2 <= 0f) { return item; } } return list[list.Count - 1]; } private static Func Weight(Player p) { return (Spell s) => (!CanCast(p, s)) ? 1f : 4f; } public static bool ReadGravity(Player p) { List list = SpellBook.All.Where((Spell s) => s.School == Escuela.Gravedad && !Knows(p, s.Id)).ToList(); if (list.Count == 0) { ((Character)p).Message((MessageType)2, Tr.Get("magia_already_master_everything_this_scroll"), 0, (Sprite)null, false); return false; } foreach (Spell item in list) { Learn(p, item.Id); DiarioMagia.HechizoAprendido(p, item); } ((Character)p).Message((MessageType)1, Tr.Get("magia_understand_gravity_magic", new object[1] { string.Join(", ", list.Select((Spell s) => s.Name)) }) + "\n" + Tr.Get("magia_raise_gravity_rank_by_casting"), 0, (Sprite)null, false); return true; } public static bool ReadGran(Player p) { bool gravedad = Random.value < 0.25f; List list = SpellBook.All.Where((Spell s) => !Knows(p, s.Id) && (gravedad || s.School != Escuela.Gravedad)).ToList(); int num = 0; foreach (Escuela value in Enum.GetValues(typeof(Escuela))) { if (value != Escuela.Gravedad && Escuelas.Rank(p, value) < 4) { Escuelas.SetRank(p, value, 4); num++; } } if (list.Count == 0 && num == 0) { ((Character)p).Message((MessageType)2, Tr.Get("magia_gran_grimorio_nada"), 0, (Sprite)null, false); return false; } foreach (Spell item in list) { Learn(p, item.Id); } Cronica.Anotar(p, "magia_gran_grimorio_leido", new string[2] { list.Count.ToString(), num.ToString() }); ((Character)p).Message((MessageType)1, Tr.Get("magia_gran_grimorio_leido", new object[2] { list.Count, num }), 0, (Sprite)null, false); if (list.Any((Spell s) => s.School == Escuela.Gravedad)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_gran_grimorio_gravedad"), 0, (Sprite)null, false); } return true; } public static bool Read(Player p, bool grimorio = false) { if (grimorio) { return ReadGrimorio(p); } Spell spell = Pick(p, 0, 4); if (spell == null) { ((Character)p).Message((MessageType)2, Tr.Get("magia_already_know_every_spell_scrolls"), 0, (Sprite)null, false); return false; } ((Character)p).Message((MessageType)1, Teach(p, spell), 0, (Sprite)null, false); return true; } private static bool ReadGrimorio(Player p) { List list = new List(); Spell spell = Pick(p, 5, 6); if (spell != null) { list.Add(Teach(p, spell)); } Spell spell2 = Pick(p, 3, 4) ?? Pick(p, 0, 4); if (spell2 != null) { list.Add(Teach(p, spell2)); } Spell spell3 = Pick(p, 0, 2) ?? Pick(p, 0, 4); if (spell3 != null) { list.Add(Teach(p, spell3)); } if (list.Count == 0) { ((Character)p).Message((MessageType)2, Tr.Get("magia_already_know_all_emperor_god"), 0, (Sprite)null, false); return false; } foreach (string item in list) { ((Character)p).Message((MessageType)1, item, 0, (Sprite)null, false); } return true; } private static string Teach(Player p, Spell s) { Learn(p, s.Id); DiarioMagia.HechizoAprendido(p, s); string text = Escuelas.Name(s.School) + (s.School2.HasValue ? (" + " + Escuelas.Name(s.School2.Value)) : ""); string text2 = Escuelas.RankNames[s.Rank]; string text3 = Tr.Get("magia_learned", new object[3] { s.Name, text, text2 }); if (!CanCast(p, s)) { text3 = text3 + " " + Tr.Get("magia_can_cast_once_reach", new object[1] { text2 }); } return text3; } } [HarmonyPatch(typeof(Humanoid), "UseItem")] public static class PergaminoUsePatch { private static bool Prefix(Humanoid __instance, Inventory __0, ItemData __1) { object obj; if (__1 == null) { obj = null; } else { GameObject dropPrefab = __1.m_dropPrefab; obj = ((dropPrefab != null) ? ((Object)dropPrefab).name : null); } string text = (string)obj; if (text != "MT_PergaminoMagiaRara" && text != "MT_PergaminoGravedad" && text != "MT_GrimorioRunico" && text != "MT_GranGrimorio") { return true; } Player p = (Player)(object)((__instance is Player) ? __instance : null); if (p == null || (Object)(object)p != (Object)(object)Player.m_localPlayer) { return false; } Inventory val = __0 ?? ((Humanoid)p).GetInventory(); HashSet antes = new HashSet(Pergaminos.Known(p)); if ((text == "MT_PergaminoGravedad") ? Pergaminos.ReadGravity(p) : ((text == "MT_GranGrimorio") ? Pergaminos.ReadGran(p) : Pergaminos.Read(p, text == "MT_GrimorioRunico"))) { val.RemoveOneItem(__1); RecitarLetras.Leer(SpellBook.All.Where((Spell x) => !antes.Contains(x.Id) && Pergaminos.Knows(p, x.Id)).ToList(), (text == "MT_GranGrimorio") ? 5.5f : ((text == "MT_PergaminoMagiaRara") ? 2.5f : 3.5f)); } return false; } } public static class PergaminosConsumibles { public const string Papel = "MT_PapelPergamino"; public const string Tinta = "MT_TintaMagica"; public const string Curacion = "MT_PergaminoCuracion"; public const string Desintoxicacion = "MT_PergaminoDesintoxicacion"; private const float Espera = 30f; private const float CuraInstantanea = 30f; private static float _listoEn; public static string HechizoDe(string prefab) { if (!(prefab == "MT_PergaminoCuracion")) { if (!(prefab == "MT_PergaminoDesintoxicacion")) { return null; } return "antidoto"; } return "curar"; } public static void Registrar() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown Bastones.Objeto("MT_PapelPergamino", "papel_pergamino", Tr.Token("magia_papel_pergamino"), Tr.Token("magia_papel_pergamino_d"), 0.1f, 50, usable: false, (RequirementConfig[])(object)new RequirementConfig[2] { new RequirementConfig("LeatherScraps", 2, 0, true), new RequirementConfig("Resin", 1, 0, true) }, CraftingStations.Workbench, 2); Bastones.Objeto("MT_TintaMagica", "tinta_magica", Tr.Token("magia_tinta_magica"), Tr.Token("magia_tinta_magica_d"), 0.3f, 20, usable: false, (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig("Coal", 1, 0, true), new RequirementConfig("Blueberries", 2, 0, true), new RequirementConfig("GreydwarfEye", 1, 0, true) }, CraftingStations.Cauldron, 2); Bastones.Objeto("MT_PergaminoCuracion", "pergamino_curacion", Tr.Token("magia_pergamino_curacion"), Tr.Token("magia_pergamino_curacion_d"), 0.2f, 10, usable: true, (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig("MT_PapelPergamino", 1, 0, true), new RequirementConfig("MT_TintaMagica", 1, 0, true), new RequirementConfig("Dandelion", 2, 0, true) }, CraftingStations.Workbench); Bastones.Objeto("MT_PergaminoDesintoxicacion", "pergamino_desintoxicacion", Tr.Token("magia_pergamino_desintoxicacion"), Tr.Token("magia_pergamino_desintoxicacion_d"), 0.2f, 10, usable: true, (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig("MT_PapelPergamino", 1, 0, true), new RequirementConfig("MT_TintaMagica", 1, 0, true), new RequirementConfig("Thistle", 1, 0, true) }, CraftingStations.Workbench); } public static bool Usar(Player p, string prefab) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (Time.time < _listoEn) { ((Character)p).Message((MessageType)1, Tr.Get("magia_scroll_wait", new object[1] { Mathf.CeilToInt(_listoEn - Time.time) }), 0, (Sprite)null, false); return false; } _listoEn = Time.time + 30f; if (prefab == "MT_PergaminoCuracion") { ((Character)p).Heal(30f, true); Vfx.Heal((Character)(object)p, Vfx.Verde, destellos: true); Fx.AddSE((Character)(object)p, "MT_Regeneracion"); ((Character)p).Message((MessageType)1, Tr.Get("magia_scroll_heal_used"), 0, (Sprite)null, false); } else { Purify.Local(p, poisonOnly: false); ((Character)p).Message((MessageType)1, Tr.Get("magia_scroll_detox_used"), 0, (Sprite)null, false); } Cronica.AnotarUnaVez(p, "pergamino_efecto", "cronica_scroll_used", Array.Empty()); return true; } } [HarmonyPatch(typeof(Humanoid), "UseItem")] public static class PergaminoConsumibleUsePatch { private static bool Prefix(Humanoid __instance, Inventory __0, ItemData __1) { object obj; if (__1 == null) { obj = null; } else { GameObject dropPrefab = __1.m_dropPrefab; obj = ((dropPrefab != null) ? ((Object)dropPrefab).name : null); } string text = (string)obj; if (text != "MT_PergaminoCuracion" && text != "MT_PergaminoDesintoxicacion") { return true; } Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val == null || (Object)(object)val != (Object)(object)Player.m_localPlayer) { return false; } if (PergaminosConsumibles.Usar(val, text)) { (__0 ?? ((Humanoid)val).GetInventory()).RemoveOneItem(__1); } return false; } } [HarmonyPatch(typeof(InventoryGui), "DoCrafting")] public static class PergaminoConsumibleEscribirPatch { public const float ManaMult = 1.5f; private static string _nombre; private static int _antes; private static float _costo; public static float Costo(Player p, Spell s) { if (s != null) { return Caster.ManaCost(p, s) * 1.5f; } return 0f; } private static bool Prefix(InventoryGui __instance, Player player) { _nombre = null; Recipe value = Traverse.Create((object)__instance).Field("m_craftRecipe").GetValue(); string hechizo = (((Object)(object)value?.m_item != (Object)null) ? PergaminosConsumibles.HechizoDe(((Object)((Component)value.m_item).gameObject).name) : null); if (hechizo == null || (Object)(object)player == (Object)null) { return true; } Spell spell = SpellBook.All.Find((Spell x) => x.Id == hechizo); if (!Pergaminos.Knows(player, hechizo)) { ((Character)player).Message((MessageType)2, Tr.Get("magia_scroll_need_spell", new object[1] { (spell != null) ? spell.Name : hechizo }), 0, (Sprite)null, false); return false; } float num = Costo(player, spell); if (player.GetEitr() < num) { ((Character)player).Message((MessageType)2, Tr.Get("magia_scroll_need_mana", new object[1] { Mathf.CeilToInt(num) }), 0, (Sprite)null, false); return false; } _nombre = value.m_item.m_itemData.m_shared.m_name; _antes = ((Humanoid)player).GetInventory().CountItems(_nombre, -1, true); _costo = num; return true; } private static void Postfix(Player player) { if (_nombre != null && !((Object)(object)player == (Object)null)) { if (((Humanoid)player).GetInventory().CountItems(_nombre, -1, true) > _antes) { ((Character)player).UseEitr(_costo); } _nombre = null; } } } public class PielPiedraCapa : MonoBehaviour { private const string CopiaNombre = "MT_PielPiedraCopia"; private static Material _mat; private static readonly int Aparicion = Shader.PropertyToID("_Appear"); private readonly Dictionary _copias = new Dictionary(); private readonly List _piezas = new List(); private MaterialPropertyBlock _bloque; private float _nace; private float _hasta; private float _revisar; public static void Mostrar(Player p, float segundos) { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)p == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { PielPiedraCapa obj = ((Component)p).GetComponent() ?? ((Component)p).gameObject.AddComponent(); obj._nace = Time.time; obj._hasta = Time.time + segundos; obj._revisar = 0f; Particulas.Tierra(((Component)p).transform.position, 0.8f, 0.8f); } } public static void Romper(Player p) { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0060: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)p == (Object)null)) { PielPiedraCapa component = ((Component)p).GetComponent(); if ((Object)(object)component != (Object)null) { component.Quitar(); } Vector3 centerPoint = ((Character)p).GetCenterPoint(); Particulas.Tierra(centerPoint - Vector3.up * 0.6f, 1.1f, 2.2f); Fx.Visual("vfx_RockDestroyed", centerPoint, 0.9f); Fx.Visual("sfx_rock_destroyed", centerPoint); } } private void Update() { //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_0049: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Expected O, but got Unknown //IL_00ff: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) if (Time.time >= _hasta) { Quitar(); return; } if ((Object)(object)_mat == (Object)null) { Material val = MTBundle.Material("MT_PielPiedra"); if ((Object)(object)val == (Object)null) { return; } _mat = new Material(val) { hideFlags = (HideFlags)61 }; _mat.SetColor("_CrackColor", new Color(0.3f, 0.16f, 0.06f, 1f)); } if (Time.time >= _revisar) { _revisar = Time.time + 0.5f; ((Component)this).GetComponentsInChildren(_piezas); foreach (SkinnedMeshRenderer pieza in _piezas) { if (!((Object)(object)pieza == (Object)null) && !((Object)(object)pieza.sharedMesh == (Object)null) && !((Object)pieza).name.StartsWith("MT_") && !_copias.ContainsKey(pieza)) { GameObject val2 = new GameObject("MT_PielPiedraCopia") { layer = ((Component)pieza).gameObject.layer }; val2.transform.SetParent(((Component)pieza).transform.parent, false); val2.transform.localPosition = ((Component)pieza).transform.localPosition; val2.transform.localRotation = ((Component)pieza).transform.localRotation; val2.transform.localScale = ((Component)pieza).transform.localScale; SkinnedMeshRenderer val3 = val2.AddComponent(); val3.sharedMesh = pieza.sharedMesh; val3.bones = pieza.bones; val3.rootBone = pieza.rootBone; val3.updateWhenOffscreen = true; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0; Material[] array = (Material[])(object)new Material[pieza.sharedMesh.subMeshCount]; for (int i = 0; i < array.Length; i++) { array[i] = _mat; } ((Renderer)val3).sharedMaterials = array; _copias[pieza] = val3; } } } float num = Mathf.Clamp01((Time.time - _nace) / 0.25f) * Mathf.Clamp01((_hasta - Time.time) / 0.5f); if (_bloque == null) { _bloque = new MaterialPropertyBlock(); } _bloque.SetFloat(Aparicion, num); foreach (KeyValuePair copia in _copias) { if (!((Object)(object)copia.Value == (Object)null)) { ((Renderer)copia.Value).enabled = (Object)(object)copia.Key != (Object)null && ((Renderer)copia.Key).enabled && ((Component)copia.Key).gameObject.activeInHierarchy; ((Renderer)copia.Value).SetPropertyBlock(_bloque); } } } private void Quitar() { foreach (SkinnedMeshRenderer value in _copias.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); } } _copias.Clear(); Object.Destroy((Object)(object)this); } private void OnDestroy() { foreach (SkinnedMeshRenderer value in _copias.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); } } } } public static class RangoRules { public enum Falta { Nada, Lanzamientos, Enemigos, Jefe, Reserva } public const int Principiante = 0; public const int Intermedio = 1; public const int Avanzado = 2; public const int Santo = 3; public const int Rey = 4; public const int Emperador = 5; public const int Dios = 6; public static readonly int[] LanzamientosPorDefecto = new int[7] { 0, 40, 100, 200, 350, 500, 800 }; public static readonly float[] Reserva = new float[7] { 0f, 0f, 0f, 40f, 55f, 70f, 85f }; public const int KillsIntermedio = 25; public static readonly string[] JefesPorDefecto = new string[7] { "", "", "defeated_eikthyr", "defeated_gdking|defeated_bonemass", "defeated_dragon", "", "" }; public static int Rango(Func casts, int[] needed, int kills, int killsNeeded, Func jefeOk, float reserva, out Falta falta) { falta = Falta.Nada; int result = 0; for (int i = 1; i <= 6; i++) { if (casts(i - 1) < (float)needed[Math.Min(i, needed.Length - 1)]) { falta = Falta.Lanzamientos; break; } if (i == 1 && kills < killsNeeded) { falta = Falta.Enemigos; break; } if (!jefeOk(i)) { falta = Falta.Jefe; break; } if (reserva < Reserva[i]) { falta = Falta.Reserva; break; } result = i; } return result; } public static float Valor(bool utilidad, int estrellas, bool jefe, bool favorita) { float num = (utilidad ? 0.5f : 1f); if (jefe || estrellas >= 2) { num *= 2f; } else if (estrellas == 1) { num *= 1.5f; } if (favorita) { num *= 1.5f; } return num; } public static int TopeRuna(int rangoBioma, int mejorRango, bool primera) { if (!primera) { return Math.Max(0, Math.Min(rangoBioma, mejorRango + 1)); } return 0; } public static float PracticaUmbral(int n, float primera, float cada) { if (n > 0) { return cada; } return primera; } public static int[] ParseInts(string s, int[] fallback) { if (string.IsNullOrEmpty(s)) { return fallback; } string[] array = s.Split(new char[1] { ',' }); int[] array2 = new int[fallback.Length]; for (int i = 0; i < array2.Length; i++) { array2[i] = ((i < array.Length && int.TryParse(array[i].Trim(), out var result)) ? result : fallback[i]); } return array2; } } public class Rayo : MonoBehaviour { public static readonly Color Azul = new Color(0.45f, 0.6f, 1f); private Transform _quad; private Vector3 _localAxis = Vector3.up; public static void Bolt(Vector3 from, Vector3 to, Color color, float width = 1.2f, float duration = 0.35f) { //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) Arco.Spawn(from, to, color, Mathf.Clamp(width * 0.35f, 0.12f, 0.6f), duration); } public static Vector3 Beam(Player p, Vector3 from, Vector3 dir, float range, Color color, float duration = 0.45f, float grow = 0.1f, float reach = 1f) { //IL_004c: 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_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_0059: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) int mask = LayerMask.GetMask(new string[8] { "Default", "static_solid", "Default_small", "piece", "terrain", "character", "character_net", "vehicle" }); Vector3 val = from + dir * range; float num = range; RaycastHit[] array = Physics.RaycastAll(from, dir, range, mask, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val2 = array[i]; if (!(((RaycastHit)(ref val2)).distance >= num) && (!((Object)(object)p != (Object)null) || !((Object)(object)((Component)((RaycastHit)(ref val2)).collider).GetComponentInParent() == (Object)(object)p))) { num = ((RaycastHit)(ref val2)).distance; val = ((RaycastHit)(ref val2)).point; } } if (!MTMagiaPlugin.EfectosPropios.Value) { return val; } Arco.Spawn(from, Vector3.Lerp(from, val, Mathf.Clamp01(reach)), color, 0.3f, duration); return val; } public static void EikthyrStrike(Vector3 point, float scale = 1f) { //IL_000a: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Fx.LocalCopy(Fx.Prefab("lightningAOE"), point, Quaternion.identity); if ((Object)(object)val != (Object)null) { Transform transform = val.transform; transform.localScale *= scale; Collider[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } Object.Destroy((Object)(object)val, 2.5f); } Fx.Visual("fx_eikthyr_stomp", point, 0.7f * scale); Fx.Visual("fx_chainlightning_hit", point); } public static void Chain(Player p, Character first, DamageTypes damage, Color color, int jumps = 3, float range = 8f, float stagger = 1.5f) { //IL_002e: 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_0033: 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_0079: 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_00c5: 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_00cc: 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_00cf: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) HashSet hashSet = new HashSet(); if ((Object)(object)first != (Object)null) { hashSet.Add(first); } Vector3 val = (((Object)(object)first != (Object)null) ? first.GetCenterPoint() : ((Component)p).transform.position); float[] array = new float[5] { 0.7f, 0.5f, 0.35f, 0.25f, 0.2f }; for (int i = 0; i < jumps; i++) { Character val2 = null; float num = range; foreach (Character item in Fx.EnemiesInRadius(p, val, range)) { if (!hashSet.Contains(item)) { float num2 = Vector3.Distance(val, item.GetCenterPoint()); if (num2 < num) { num = num2; val2 = item; } } } if ((Object)(object)val2 == (Object)null) { break; } hashSet.Add(val2); Vector3 centerPoint = val2.GetCenterPoint(); Bolt(val, centerPoint, color, 0.6f, 0.4f); Sparks(centerPoint, color, 4, 0.8f); EikthyrStrike(((Component)val2).transform.position, 0.6f); DamageTypes damage2 = damage; ((DamageTypes)(ref damage2)).Modify(array[Mathf.Min(i, array.Length - 1)]); Fx.Damage(p, val2, damage2, (SkillType)9, 0f, stagger); val = centerPoint; } } public static void Sparks(Vector3 point, Color color, int count = 6, float size = 1.2f) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < count; i++) { Bolt(point, point + Random.onUnitSphere * size, color, 0.25f, 0.2f); } } public static void Trail(GameObject projectile, Color color, float length = 4f, float width = 0.9f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value && !((Object)(object)projectile == (Object)null)) { GameObject val = new GameObject("MT_RayoEstela"); val.transform.SetParent(projectile.transform, false); val.transform.localPosition = new Vector3(0f, 0f, (0f - length) / 2f); Vector3 lossyScale = projectile.transform.lossyScale; val.transform.localScale = new Vector3(1f / Mathf.Max(lossyScale.x, 0.01f), 1f / Mathf.Max(lossyScale.y, 0.01f), 1f / Mathf.Max(lossyScale.z, 0.01f)); Rayo rayo = val.AddComponent(); rayo._localAxis = Vector3.forward; if ((Object)(object)rayo.Build(length, width, color) == (Object)null) { Object.Destroy((Object)(object)val); } } } private Transform Build(float length, float width, Color color) { //IL_001c: 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) Material val = MTBundle.Material("MT_Rayo"); if ((Object)(object)val == (Object)null) { return null; } val.SetColor("_EffectColor", color); val.SetFloat("_YSize", Mathf.Clamp(length / width * 0.5f, 2f, 40f)); val.SetFloat("_EmissionPower", 3f); GameObject val2 = GameObject.CreatePrimitive((PrimitiveType)5); Object.Destroy((Object)(object)val2.GetComponent()); ((Object)val2).name = "MT_RayoQuad"; val2.transform.SetParent(((Component)this).transform, false); val2.transform.localScale = new Vector3(width, length, 1f); MeshRenderer component = val2.GetComponent(); ((Renderer)component).sharedMaterial = val; ((Renderer)component).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)component).receiveShadows = false; _quad = val2.transform; Face(); return _quad; } private void LateUpdate() { Face(); } private void Face() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0060: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_quad == (Object)null)) { Transform val = (((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform : null); Vector3 val2 = ((Component)this).transform.TransformDirection(_localAxis); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = Vector3.ProjectOnPlane(((Object)(object)val != (Object)null) ? (val.position - _quad.position) : (-((Component)this).transform.forward), normalized); if (!(((Vector3)(ref val3)).sqrMagnitude < 0.0001f)) { _quad.rotation = Quaternion.LookRotation(-((Vector3)(ref val3)).normalized, normalized); } } } } public class RecitarLetras : MonoBehaviour { private class Letra { public string Texto; public bool Lectura; public Color Color; public float Nace; public float Angulo; public float Radio; public float Altura; public float Tamano; } private static readonly FieldRef CamRef = AccessTools.FieldRefAccess("m_camera"); private static float _lecturaHasta; private static float _lecturaInicio; private static float _lecturaDur = 1f; private static string _lecturaTexto = ""; private static readonly List _lecturaColores = new List(); private static int _lecturaLetra; private static float _lecturaSiguiente; private const float Vida = 1.6f; private const float Cada = 0.15f; private const int Max = 16; private static readonly string[] SinNorse = new string[6] { "Russian", "Ukrainian", "Chinese", "Chinese_Trad", "Japanese", "Korean" }; private readonly List _letras = new List(); private string _conjuro; private Spell _de; private Color _color; private int _siguienteLetra; private float _siguiente; private GUIStyle _estilo; private GUIStyle _halo; private Font _norse; private bool _buscada; private static Camera Camara() { Camera val = (((Object)(object)GameCamera.instance != (Object)null) ? CamRef.Invoke(GameCamera.instance) : null); if (!((Object)(object)val != (Object)null)) { return Camera.main; } return val; } private static Vector3 APantalla(Camera cam, Vector3 mundo) { //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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) Vector3 val = cam.WorldToViewportPoint(mundo); Vector2 val2 = GUIUtility.ScreenToGUIPoint(new Vector2(val.x * (float)Screen.width, (1f - val.y) * (float)Screen.height)); return new Vector3(val2.x, val2.y, val.z); } public static void Leer(IEnumerable aprendidos, float duracion) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder(); _lecturaColores.Clear(); foreach (Spell aprendido in aprendidos) { string text = aprendido.Name.ToUpperInvariant(); foreach (char c in text) { if (char.IsLetter(c)) { stringBuilder.Append(c); _lecturaColores.Add(Caster.SchoolColor(aprendido.School)); } } } if (stringBuilder.Length == 0) { stringBuilder.Append("MAGIA"); for (int j = 0; j < 5; j++) { _lecturaColores.Add(Color.white); } } _lecturaTexto = stringBuilder.ToString(); _lecturaLetra = 0; _lecturaInicio = Time.time; _lecturaDur = duracion; _lecturaHasta = Time.time + duracion; } private void Update() { //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_01fe: 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) Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ((Character)localPlayer).IsDead() || !MTMagiaPlugin.EfectosPropios.Value) { _lecturaHasta = 0f; _letras.Clear(); } if ((Object)(object)localPlayer != (Object)null && Time.time < _lecturaInicio + _lecturaDur * 0.7f && Time.time >= _lecturaSiguiente && _letras.Count < 40) { _lecturaSiguiente = Time.time + 0.08f; int index = _lecturaLetra++ % _lecturaTexto.Length; _letras.Add(new Letra { Texto = _lecturaTexto[index].ToString(), Lectura = true, Color = _lecturaColores[index], Nace = Time.time, Angulo = Random.Range(0f, 360f), Radio = Random.Range(0.7f, 1.15f), Altura = Random.Range(0.4f, 1.6f), Tamano = Random.Range(0.9f, 1.3f) }); } Player localPlayer2 = Player.m_localPlayer; Spell spell = Caster.Recitando ?? Caster.Canalizando; if ((Object)(object)localPlayer2 != (Object)null && spell != null && MTMagiaPlugin.EfectosPropios.Value) { if (_conjuro == null || _de != spell) { StringBuilder stringBuilder = new StringBuilder(); string text = spell.Name.ToUpperInvariant(); foreach (char c in text) { if (char.IsLetter(c)) { stringBuilder.Append(c); } } _conjuro = ((stringBuilder.Length > 0) ? stringBuilder.ToString() : "MAGIA"); _color = Caster.SchoolColor(spell.School); _siguienteLetra = 0; _de = spell; } if (Time.time >= _siguiente && _letras.Count < 16) { _siguiente = Time.time + 0.15f; _letras.Add(new Letra { Texto = _conjuro[_siguienteLetra++ % _conjuro.Length].ToString(), Nace = Time.time, Angulo = Random.Range(0f, 360f), Radio = Random.Range(0.55f, 1f), Altura = Random.Range(0.6f, 1.4f), Tamano = Random.Range(0.8f, 1.25f) }); } } else { _conjuro = null; } _letras.RemoveAll((Letra l) => (!l.Lectura) ? (Time.time - l.Nace > 1.6f) : (Time.time >= _lecturaHasta)); } private Font Norse() { if (Array.IndexOf(SinNorse, Tr.Current) >= 0) { return null; } if (!_buscada) { _buscada = true; string[] array = new string[3] { "Norsebold", "Norse", "AveriaSerifLibre-Bold" }; foreach (string value in array) { Font[] array2 = Resources.FindObjectsOfTypeAll(); foreach (Font val in array2) { if ((Object)(object)_norse == (Object)null && ((Object)val).name.StartsWith(value)) { _norse = val; } } } } return _norse; } private void OnGUI() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_044c: 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_00f6: 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_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: 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_0224: 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_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) if (_letras.Count == 0 || (int)Event.current.type != 7) { return; } Player localPlayer = Player.m_localPlayer; Camera val = Camara(); if ((Object)(object)localPlayer == (Object)null || (Object)(object)val == (Object)null) { return; } if (_estilo == null) { _estilo = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4, fontStyle = (FontStyle)1 }; _halo = new GUIStyle(_estilo); } GUIStyle estilo = _estilo; Font font = (_halo.font = Norse()); estilo.font = font; Color color = GUI.color; Rect val5 = default(Rect); foreach (Letra letra in _letras) { float num = (letra.Lectura ? Mathf.Clamp01((Time.time - _lecturaInicio) / _lecturaDur) : ((Time.time - letra.Nace) / 1.6f)); Color val3 = (letra.Lectura ? letra.Color : _color); float num2 = (letra.Angulo + (letra.Lectura ? ((Time.time - letra.Nace) * 160f) : (num * 140f))) * ((float)Math.PI / 180f); float num3 = (letra.Lectura ? Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.7f, 1f, num)) : 0f); float num4 = (letra.Lectura ? (letra.Radio * (1f - num3)) : (letra.Radio * (1f + 0.4f * num))); Vector3 mundo = ((Component)localPlayer).transform.position + new Vector3(Mathf.Cos(num2) * num4, letra.Lectura ? Mathf.Lerp(letra.Altura + Mathf.Sin((Time.time - letra.Nace) * 2f + letra.Angulo) * 0.15f, 1.2f, num3) : (letra.Altura + num * 1.3f), Mathf.Sin(num2) * num4); Vector3 val4 = APantalla(val, mundo); if (!(val4.z <= 0.2f)) { float num5 = (letra.Lectura ? (Mathf.Clamp01((Time.time - letra.Nace) / 0.3f) * Mathf.Clamp01((1f - num) / 0.08f)) : (Mathf.Clamp01(num / 0.15f) * Mathf.Clamp01((1f - num) / 0.35f))); float num6 = Mathf.Clamp(6f / val4.z, 0.5f, 1.6f) * letra.Tamano; int num7 = Mathf.Clamp(Mathf.RoundToInt(26f * num6 / 2f) * 2, 10, 44); GUIStyle estilo2 = _estilo; int fontSize = (_halo.fontSize = num7); estilo2.fontSize = fontSize; ((Rect)(ref val5))..ctor(val4.x - 30f, val4.y - 30f, 60f, 60f); _halo.normal.textColor = val3; GUI.color = new Color(1f, 1f, 1f, num5 * 0.45f); for (int i = 0; i < 4; i++) { float num9 = ((i < 2) ? ((i == 0) ? (-2f) : 2f) : 0f); float num10 = ((i >= 2) ? ((i == 2) ? (-2f) : 2f) : 0f); GUI.Label(new Rect(((Rect)(ref val5)).x + num9, ((Rect)(ref val5)).y + num10, ((Rect)(ref val5)).width, ((Rect)(ref val5)).height), letra.Texto, _halo); } _estilo.normal.textColor = Color.Lerp(val3, Color.white, 0.65f); GUI.color = new Color(1f, 1f, 1f, num5); GUI.Label(val5, letra.Texto, _estilo); } } GUI.color = color; } } public static class RedVfxMagia { private static float _carga = 1f; private static float _escala = 1f; public static void Registrar() { RedVfx.RegistrarPlano(typeof(Particulas.Config)); RedVfx.EscribirContexto = (Action)Delegate.Combine(RedVfx.EscribirContexto, (Action)delegate(ZPackage z) { z.Write(Fx.ChargeMult); z.Write(Fx.ScaleOverride); }); RedVfx.LeerContexto = (Action)Delegate.Combine(RedVfx.LeerContexto, (Action)delegate(ZPackage z) { _carga = Fx.ChargeMult; _escala = Fx.ScaleOverride; Fx.ChargeMult = z.ReadSingle(); Fx.ScaleOverride = z.ReadSingle(); }); RedVfx.RestaurarContexto = (Action)Delegate.Combine(RedVfx.RestaurarContexto, (Action)delegate { Fx.ChargeMult = _carga; Fx.ScaleOverride = _escala; }); RedVfx.Visual(typeof(Fx), "Visual", (Func)delegate(object[] args) { GameObject val = Fx.Prefab(args[0] as string); return (Object)(object)val != (Object)null && (Object)(object)val.GetComponent() == (Object)null; }, Array.Empty()); RedVfx.Visual(typeof(Particulas), "Spawn", (Func)null, Array.Empty()); RedVfx.Visual(typeof(Particulas), "Tierra", (Func)null, Array.Empty()); RedVfx.Visual(typeof(Particulas), "IceCage", (Func)null, Array.Empty()); string[] array = new string[8] { "Llamas", "Brasas", "Humo", "Estallido", "Columna", "Onda", "Destello", "SolNegroCarga" }; foreach (string text in array) { RedVfx.Visual(typeof(FuegoVfx), text, (Func)null, Array.Empty()); } array = new string[11] { "HealHand", "Heal", "Electric", "Wind", "Leaves", "Blade", "Gravity", "GravityPoint", "GravedadBrillo", "GravityPull", "WindFeet" }; foreach (string text2 in array) { RedVfx.Visual(typeof(Vfx), text2, (Func)null, Array.Empty()); } RedVfx.Visual(typeof(VientoLineas), "Spawn", (Func)null, Array.Empty()); RedVfx.Visual(typeof(VientoLineas), "Anillo", (Func)null, Array.Empty()); RedVfx.Visual(typeof(PielPiedraCapa), "Mostrar", (Func)null, Array.Empty()); RedVfx.Visual(typeof(PielPiedraCapa), "Romper", (Func)null, Array.Empty()); RedVfx.Visual(typeof(MuroEmerge), "Subir", (Func)null, Array.Empty()); } } public class RocaMagia : MonoBehaviour { public const string Prefab = "MT_RocaMagia"; private static readonly int EscalaKey = StringExtensionMethods.GetStableHashCode("mt_roca_escala"); private static readonly int PuntaKey = StringExtensionMethods.GetStableHashCode("mt_roca_punta"); public bool Vestida; private ZNetView _nv; private Vector3 _escala; private Vector3 _pos; public static void Register() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown PrefabManager.OnVanillaPrefabsAvailable -= Register; GameObject val = PrefabManager.Instance.CreateEmptyPrefab("MT_RocaMagia", false); (val.GetComponent() ?? val.AddComponent()).m_persistent = true; Renderer[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } MeshFilter[] componentsInChildren2 = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren2[i]); } Collider[] componentsInChildren3 = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren3.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren3[i]); } val.AddComponent(); HacerRompible(val); PrefabManager.Instance.AddPrefab(new CustomPrefab(val, false)); } private static void HacerRompible(GameObject go) { //IL_0023: 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_0034: 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_0044: 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_0054: 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_0064: 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_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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Expected O, but got Unknown //IL_01d4: 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) Destructible val = go.AddComponent(); val.m_health = 120f; val.m_minToolTier = 0; val.m_spawnWhenDestroyed = null; val.m_damages = new DamageModifiers { m_blunt = (DamageModifier)3, m_slash = (DamageModifier)3, m_pierce = (DamageModifier)3, m_chop = (DamageModifier)3, m_pickaxe = (DamageModifier)0, m_fire = (DamageModifier)3, m_frost = (DamageModifier)3, m_lightning = (DamageModifier)3, m_poison = (DamageModifier)3, m_spirit = (DamageModifier)3 }; GameObject prefab = PrefabManager.Instance.GetPrefab("Rock_3"); object obj = ((prefab != null) ? prefab.GetComponent() : null); if (obj == null) { GameObject prefab2 = PrefabManager.Instance.GetPrefab("rock4_coast"); obj = ((prefab2 != null) ? prefab2.GetComponent() : null); } Destructible val2 = (Destructible)obj; val.m_hitEffect = (EffectList)(((Object)(object)val2 != (Object)null) ? ((object)val2.m_hitEffect) : ((object)new EffectList())); val.m_destroyedEffect = (EffectList)(((Object)(object)val2 != (Object)null) ? ((object)val2.m_destroyedEffect) : ((object)new EffectList())); if (MTMagiaPlugin.RocaEfectoTierra.Value) { GameObject prefab3 = PrefabManager.Instance.GetPrefab("PickaxeAntler"); EffectList val3 = ((prefab3 == null) ? null : prefab3.GetComponent()?.m_itemData?.m_shared?.m_hitTerrainEffect); if (val3 != null && val3.m_effectPrefabs != null && val3.m_effectPrefabs.Length != 0) { val.m_hitEffect = val3; val.m_destroyedEffect = val3; } go.AddComponent(); } if ((Object)(object)val2 == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)"RocaMagia: sin roca del juego para copiar efectos (se rompe sin ellos)."); } GameObject prefab4 = PrefabManager.Instance.GetPrefab("Stone"); if ((Object)(object)prefab4 != (Object)null) { DropOnDestroyed obj2 = go.AddComponent(); obj2.m_dropWhenDestroyed = new DropTable { m_dropMin = 1, m_dropMax = 1, m_dropChance = 1f }; obj2.m_dropWhenDestroyed.m_drops.Add(new DropData { m_item = prefab4, m_stackMin = 2, m_stackMax = 4, m_weight = 1f }); } } public static GameObject Crear(Vector3 at) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) GameObject val = (((Object)(object)ZNetScene.instance != (Object)null) ? ZNetScene.instance.GetPrefab("MT_RocaMagia") : null); GameObject val2; if ((Object)(object)val != (Object)null) { val2 = Object.Instantiate(val, at, Quaternion.identity); RocaMagia component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.Vestida = true; } } else { val2 = new GameObject("MT_PilarDeTierra"); } SpellBook.VestirRoca(val2, punta: false); return val2; } public static void MarcarPunta(GameObject go) { ZNetView component = go.GetComponent(); if ((Object)(object)component != (Object)null && component.IsValid()) { component.GetZDO().Set(PuntaKey, true); } } private void Awake() { _nv = ((Component)this).GetComponent(); } private void Start() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_006b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_nv == (Object)null || !_nv.IsValid()) { return; } ZDO zDO = _nv.GetZDO(); if (!Vestida) { SpellBook.VestirRoca(((Component)this).gameObject, zDO.GetBool(PuntaKey, false)); Vector3 vec = zDO.GetVec3(EscalaKey, Vector3.zero); if (vec != Vector3.zero) { SpellBook.EscalarRoca(((Component)this).transform, vec); } Vestida = true; _escala = ((Component)this).transform.localScale; _pos = ((Component)this).transform.position; } } private void LateUpdate() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_nv == (Object)null) && _nv.IsValid() && _nv.IsOwner() && (!(((Component)this).transform.localScale == _escala) || !(((Component)this).transform.position == _pos))) { _escala = ((Component)this).transform.localScale; _pos = ((Component)this).transform.position; ZDO zDO = _nv.GetZDO(); zDO.Set(EscalaKey, _escala); zDO.SetPosition(_pos); zDO.SetRotation(((Component)this).transform.rotation); } } } public class RocaPolvo : MonoBehaviour { private void Start() { Destructible component = ((Component)this).GetComponent(); if (!((Object)(object)component == (Object)null)) { component.m_onDamaged = (Action)Delegate.Combine(component.m_onDamaged, (Action)delegate { //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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Particulas.Tierra(((Component)this).transform.position + Vector3.up * Mathf.Min(1.5f, ((Component)this).transform.localScale.y * 0.5f), 0.6f, 0.6f); }); component.m_onDestroyed = (Action)Delegate.Combine(component.m_onDestroyed, (Action)delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Particulas.Tierra(((Component)this).transform.position, 1.2f, 1.8f); }); } } } public static class Runas { private const string Prefix = "MT.Magia.Runa."; public static bool AlgunaLeida(Player p) { if ((Object)(object)p != (Object)null) { return p.m_customData.Keys.Any((string k) => k.StartsWith("MT.Magia.Runa.")); } return false; } public static int RangoBioma(Biome b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected I4, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 if ((int)b <= 8) { switch (b - 1) { default: if ((int)b == 8) { goto case 0; } goto IL_0037; case 0: return 0; case 1: case 3: break; case 2: goto IL_0037; } } else { if ((int)b == 16) { return 2; } if ((int)b != 256) { goto IL_0037; } } return 1; IL_0037: return 3; } private static string Clave(Vector3 pos) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) return "MT.Magia.Runa." + Mathf.RoundToInt(pos.x / 4f).ToString(CultureInfo.InvariantCulture) + "_" + Mathf.RoundToInt(pos.z / 4f).ToString(CultureInfo.InvariantCulture); } public static int MejorRango(Player p) { return Escuelas.All.Max((Escuela e) => Escuelas.Rank(p, e)); } public static void Leer(Player p, RuneStone piedra) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_01d0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p == (Object)null || (Object)(object)piedra == (Object)null) { return; } string key = Clave(((Component)piedra).transform.position); if (p.m_customData.ContainsKey(key)) { return; } if (!Aprendizaje.MagiaDespierta(p)) { ((Character)p).Message((MessageType)2, Tr.Get("magia_runes_not_understood"), 0, (Sprite)null, false); return; } p.m_customData[key] = "1"; HashSet known = Pergaminos.Known(p); bool flag = known.Count == 0; int maxRank = RangoRules.TopeRuna(RangoBioma(Heightmap.FindBiome(((Component)piedra).transform.position)), MejorRango(p), flag); Escuela? school = null; List list = Escuelas.All.Where((Escuela escuela) => escuela != Escuela.Gravedad && !SpellBook.All.Any((Spell s) => s.School == escuela && known.Contains(s.Id))).ToList(); if (list.Count > 0 && Random.value < 0.6f) { school = list[Random.Range(0, list.Count)]; } Spell spell = Aprendizaje.Nuevo(p, school, 0, maxRank); if (spell == null) { Escuela e = Escuelas.All.FirstOrDefault((Escuela escuela) => SpellBook.All.Any((Spell s) => s.School == escuela && known.Contains(s.Id))); MagiaLogros.AddCast(p, e, Mathf.Max(0, Escuelas.Rank(p, e)), 5f); ((Character)p).Message((MessageType)2, Tr.Get("magia_runes_already_understood"), 0, (Sprite)null, false); } else { Aprendizaje.Teach(p, spell, Tr.Get(flag ? "magia_runes_first_spell" : "magia_runes_decipher")); Cronica.Anotar(p, "cronica_rune_spell", new string[1] { "@magia_spell_" + spell.Id }); } Recetario.RevelarUna(p); Laminas.Desbloquear(p, "pagina_runas"); p.m_skillLevelupEffects.Create(((Character)p).GetHeadPoint(), ((Component)p).transform.rotation, ((Component)p).transform, 1f, -1, default(ZDOID)); } } public static class Practica { private static string Key(Escuela e) { return "MT.Magia.Practica." + e; } private static string NKey(Escuela e) { return "MT.Magia.PracticaN." + e; } private static float Leer(Player p, string k) { if (!p.m_customData.TryGetValue(k, out var value) || !float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return 0f; } return result; } public static float Umbral(int revelaciones) { return RangoRules.PracticaUmbral(revelaciones, MTMagiaPlugin.PracticaPrimera.Value, MTMagiaPlugin.PracticaCada.Value); } public static float Progreso(Player p, Escuela e) { return Leer(p, Key(e)); } public static float Siguiente(Player p, Escuela e) { return Umbral((int)Leer(p, NKey(e))); } public static void Sumar(Player p, Escuela e, float cantidad) { if ((Object)(object)p == (Object)null || cantidad <= 0f) { return; } float num = Leer(p, Key(e)) + cantidad; int num2 = (int)Leer(p, NKey(e)); if (num >= Umbral(num2)) { Spell spell = Aprendizaje.Nuevo(p, e, 0, Escuelas.Rank(p, e)); if (spell != null) { num = 0f; p.m_customData[NKey(e)] = (num2 + 1).ToString(CultureInfo.InvariantCulture); Aprendizaje.Teach(p, spell, Tr.Get("magia_practice_reveals", new object[1] { Escuelas.Name(e) })); } } p.m_customData[Key(e)] = num.ToString("0.##", CultureInfo.InvariantCulture); } } [HarmonyPatch(typeof(RuneStone), "Interact")] public static class RunasLeerPatch { private static void Postfix(RuneStone __instance, Humanoid character, bool hold) { if (hold) { return; } Player val = (Player)(object)((character is Player) ? character : null); if (val == null || (Object)(object)val != (Object)(object)Player.m_localPlayer) { return; } try { Runas.Leer(val, __instance); } catch (Exception ex) { MTMagiaPlugin.Log.LogError((object)("Runas: " + ex)); } } } [HarmonyPatch(typeof(Humanoid), "EquipItem")] public static class DespertarAlEmpunarPatch { private static void Postfix(Humanoid __instance) { Player val = (Player)(object)((__instance is Player) ? __instance : null); if (val != null && (Object)(object)val == (Object)(object)Player.m_localPlayer && Focus.HasFocus(val)) { Aprendizaje.Despertar(val); } } } public class SelloCadenas : MonoBehaviour { private const float Velocidad = 32f; private const float Tensas = 0.6f; private const float Apagado = 0.35f; private static readonly Color Luz = new Color(0.55f, 0.85f, 1f, 1f); private Player _caster; private Character _target; private Action _alLlegar; private LineRenderer[] _cadenas; private float _avance; private float _llegada = -1f; private Vector3 _objetivo; private static Texture2D _tex; public static void Lanzar(Player caster, Character target, Action alLlegar) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if (!MTMagiaPlugin.EfectosPropios.Value) { alLlegar(); return; } GameObject val = new GameObject("MT_SelloCadenas"); SelloCadenas selloCadenas = val.AddComponent(); selloCadenas._caster = caster; selloCadenas._target = target; selloCadenas._alLlegar = alLlegar; selloCadenas._cadenas = (LineRenderer[])(object)new LineRenderer[2] { selloCadenas.Cadena(val.transform), selloCadenas.Cadena(val.transform) }; } private LineRenderer Cadena(Transform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_0089: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Cadena"); val.transform.SetParent(parent, false); LineRenderer obj = val.AddComponent(); obj.positionCount = 16; obj.widthMultiplier = 0.16f; obj.textureMode = (LineTextureMode)1; obj.numCapVertices = 2; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; ((Renderer)obj).material = new Material(Shader.Find("Legacy Shaders/Particles/Alpha Blended") ?? Shader.Find("Sprites/Default")) { mainTexture = (Texture)(object)Eslabones() }; ((Renderer)obj).material.mainTextureScale = new Vector2(3f, 1f); Color startColor = (obj.endColor = Luz); obj.startColor = startColor; return obj; } private void Update() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0177: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019d: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028c: 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_0296: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_caster == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Vector3 val = ((Component)_caster).transform.position + Vector3.up * 1.3f + ((Component)_caster).transform.right * 0.35f; if ((Object)(object)_target != (Object)null && !_target.IsDead()) { _objetivo = _target.GetCenterPoint(); } float num = Vector3.Distance(val, _objetivo); if (_llegada < 0f) { _avance += 32f * Time.deltaTime; if (_avance >= num) { _avance = num; _llegada = Time.time; Fx.Visual("fx_StaffShield_Hit", _objetivo, 2f); try { _alLlegar?.Invoke(); } catch (Exception ex) { MTMagiaPlugin.Log.LogWarning((object)("Sello: " + ex.Message)); } } } float num2 = ((_llegada < 0f) ? 0f : (Time.time - _llegada)); if (num2 > 0.95000005f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num3 = ((num2 <= 0.6f) ? 1f : (1f - (num2 - 0.6f) / 0.35f)); Vector3 val2 = _objetivo - val; Vector3 normalized = ((Vector3)(ref val2)).normalized; val2 = Vector3.Cross(normalized, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = ((Component)_caster).transform.right; } Color val6 = default(Color); for (int i = 0; i < _cadenas.Length; i++) { LineRenderer val4 = _cadenas[i]; float num4 = ((i == 0) ? 1f : (-1f)); int positionCount = val4.positionCount; for (int j = 0; j < positionCount; j++) { float num5 = (float)j / (float)(positionCount - 1); float num6 = _avance * num5; float num7 = ((_llegada < 0f) ? 0.35f : 0.06f) * Mathf.Sin(num5 * (float)Math.PI); float num8 = num5 * 10f + Time.time * 8f; Vector3 val5 = (val3 * Mathf.Cos(num8) + Vector3.up * Mathf.Sin(num8)) * num7 * num4; val4.SetPosition(j, val + normalized * num6 + val5); } ((Color)(ref val6))..ctor(Luz.r, Luz.g, Luz.b, num3); Color startColor = (val4.endColor = val6); val4.startColor = startColor; ((Renderer)val4).material.mainTextureOffset = new Vector2((0f - Time.time) * ((_llegada < 0f) ? 4f : 0.5f), 0f); } } private static Texture2D Eslabones() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_tex != (Object)null) { return _tex; } _tex = new Texture2D(64, 16, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)0 }; for (int i = 0; i < 16; i++) { for (int j = 0; j < 64; j++) { float num = 0f; float num2 = ((float)i + 0.5f) / 16f * 2f - 1f; if (j < 32) { float num3 = ((float)j + 0.5f) / 32f * 2f - 1f; float num4 = Mathf.Sqrt(num3 * num3 / 0.9f + num2 * num2 / 0.75f); num = Mathf.Clamp01(1f - Mathf.Abs(num4 - 0.78f) / 0.2f); } else { num = ((Mathf.Abs(((float)(j - 32) + 0.5f) / 32f * 2f - 1f) < 0.85f) ? Mathf.Clamp01(1f - Mathf.Abs(num2) / 0.3f) : 0f); } _tex.SetPixel(j, i, new Color(1f, 1f, 1f, num)); } } _tex.Apply(); return _tex; } } public class SelloVisual : MonoBehaviour { private static readonly Color Azul = new Color(0.35f, 0.7f, 1f); private readonly List _rings = new List(); private readonly List _bars = new List(); private Character _target; private Light _light; private float _until; private float _radius; private float _height; private float _born; public static void Attach(Character target, float seconds) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_SelloJaula"); SelloVisual selloVisual = val.AddComponent(); selloVisual._target = target; selloVisual._until = Time.time + seconds; selloVisual._born = Time.time; Collider componentInChildren = ((Component)target).GetComponentInChildren(); ? val2; if (!((Object)(object)componentInChildren != (Object)null)) { val2 = new Vector3(1f, 2f, 1f); } else { Bounds bounds = componentInChildren.bounds; val2 = ((Bounds)(ref bounds)).size; } Vector3 val3 = (Vector3)val2; selloVisual._radius = Mathf.Clamp(Mathf.Max(val3.x, val3.z) * 0.7f, 0.8f, 4f); selloVisual._height = Mathf.Clamp(val3.y * 1.1f, 1.2f, 6f); for (int i = 0; i < 3; i++) { selloVisual._rings.Add(selloVisual.Line(64, 0.07f, loop: true)); } for (int j = 0; j < 8; j++) { selloVisual._bars.Add(selloVisual.Line(2, 0.04f, loop: false)); } selloVisual._light = LucesMagicas.Registrar(new GameObject("Luz").AddComponent()); ((Component)selloVisual._light).transform.SetParent(val.transform, false); selloVisual._light.color = Azul; selloVisual._light.range = selloVisual._radius * 4f; selloVisual._light.intensity = 2f; } } private LineRenderer Line(int points, float width, bool loop) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_005d: 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) GameObject val = new GameObject("Linea"); val.transform.SetParent(((Component)this).transform, false); LineRenderer obj = val.AddComponent(); obj.useWorldSpace = true; obj.loop = loop; obj.positionCount = points; ((Renderer)obj).material = Vfx.NewMaterial(Vfx.Tex("heal_streak"), Azul); Color startColor = (obj.endColor = Azul); obj.startColor = startColor; obj.widthMultiplier = width; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)obj).receiveShadows = false; return obj; } private void LateUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028f: 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_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: 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_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_target == (Object)null || _target.IsDead() || Time.time > _until) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } Vector3 position = ((Component)_target).transform.position; ((Component)this).transform.position = position; ((Component)_light).transform.position = position + Vector3.up * _height * 0.5f; float num = Mathf.Clamp01((Time.time - _born) / 0.3f); float num2 = _until - Time.time; float num3 = ((num2 < 1f) ? ((Mathf.PingPong(Time.time * 6f, 1f) * 0.6f + 0.4f) * num2) : 1f); Color val = default(Color); ((Color)(ref val))..ctor(Azul.r, Azul.g, Azul.b, num3); _light.intensity = 2f * num3; float num4 = _radius * num; float[] array = new float[3] { 0.05f, 0.5f, 0.95f }; for (int i = 0; i < _rings.Count; i++) { LineRenderer val2 = _rings[i]; float num5 = Time.time * ((i % 2 == 0) ? 60f : (-80f)) * ((float)Math.PI / 180f); float num6 = _height * array[i] * num; for (int j = 0; j < val2.positionCount; j++) { float num7 = num5 + (float)j / (float)val2.positionCount * (float)Math.PI * 2f; float num8 = num4 * (1f + 0.06f * Mathf.Sin(num7 * 8f)); val2.SetPosition(j, position + new Vector3(Mathf.Cos(num7) * num8, num6, Mathf.Sin(num7) * num8)); } Color startColor = (val2.endColor = val); val2.startColor = startColor; } float num9 = Time.time * 25f * ((float)Math.PI / 180f); Vector3 val4 = default(Vector3); for (int k = 0; k < _bars.Count; k++) { float num10 = num9 + (float)k / (float)_bars.Count * (float)Math.PI * 2f; ((Vector3)(ref val4))..ctor(Mathf.Cos(num10) * num4, 0f, Mathf.Sin(num10) * num4); _bars[k].SetPosition(0, position + val4 + Vector3.up * _height * 0.05f * num); _bars[k].SetPosition(1, position + val4 + Vector3.up * _height * 0.95f * num); LineRenderer obj = _bars[k]; Color startColor = (_bars[k].endColor = val); obj.startColor = startColor; } } } public class SinBotinLejano : MonoBehaviour { private class Zona { public Vector3 Pos; public float Hasta; } private const float Radio = 6f; private const float Duracion = 10f; private static readonly List _zonas = new List(); private static readonly List _borrar = new List(); internal static int BotinMob; public static void Marcar(Player p, Vector3 pos) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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 = MTMagiaPlugin.DistanciaSinBotin.Value; if (!((Object)(object)p == (Object)null) && !(value <= 0f)) { Vector3 val = pos - ((Component)p).transform.position; if (!(((Vector3)(ref val)).sqrMagnitude <= value * value)) { _zonas.Add(new Zona { Pos = pos, Hasta = Time.time + 10f }); } } } internal static bool EnZona(Vector3 pos) { //IL_004b: 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_0061: Unknown result type (might be due to invalid IL or missing references) if (_zonas.Count == 0 || BotinMob > 0) { return false; } float time = Time.time; for (int num = _zonas.Count - 1; num >= 0; num--) { if (time >= _zonas[num].Hasta) { _zonas.RemoveAt(num); } else { Vector3 val = pos - _zonas[num].Pos; if (((Vector3)(ref val)).sqrMagnitude <= 36f) { return true; } } } return false; } internal static void Borrar(GameObject go) { _borrar.Add(go); } private void Update() { if (_borrar.Count == 0) { return; } for (int i = 0; i < _borrar.Count; i++) { GameObject val = _borrar[i]; if (!((Object)(object)val == (Object)null)) { ZNetView component = val.GetComponent(); if ((Object)(object)component != (Object)null && component.IsValid() && component.IsOwner() && (Object)(object)ZNetScene.instance != (Object)null) { ZNetScene.instance.Destroy(val); } } } _borrar.Clear(); } } [HarmonyPatch(typeof(TreeBase), "SpawnLog")] public static class SinBotinTroncoPatch { private static bool Prefix(TreeBase __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!SinBotinLejano.EnZona(((Component)__instance).transform.position)) { return true; } __instance.m_destroyedEffect.Create(((Component)__instance).transform.position, ((Component)__instance).transform.rotation, (Transform)null, 1f, -1, default(ZDOID)); return false; } } [HarmonyPatch(typeof(TreeLog), "Awake")] public static class SinBotinTrozosPatch { private static void Postfix(TreeLog __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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) if (SinBotinLejano.EnZona(((Component)__instance).transform.position)) { __instance.m_destroyedEffect.Create(((Component)__instance).transform.position, ((Component)__instance).transform.rotation, (Transform)null, 1f, -1, default(ZDOID)); SinBotinLejano.Borrar(((Component)__instance).gameObject); } } } [HarmonyPatch(typeof(ItemDrop), "Awake")] public static class SinBotinObjetosPatch { private static void Postfix(ItemDrop __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) if (SinBotinLejano.EnZona(((Component)__instance).transform.position)) { SinBotinLejano.Borrar(((Component)__instance).gameObject); } } } [HarmonyPatch(typeof(CharacterDrop), "DropItems")] public static class SinBotinMobPatch { private static void Prefix() { SinBotinLejano.BotinMob++; } private static void Finalizer() { SinBotinLejano.BotinMob--; } } [HarmonyPatch(typeof(Ragdoll), "SpawnLoot")] public static class SinBotinMobRagdollPatch { private static void Prefix() { SinBotinLejano.BotinMob++; } private static void Finalizer() { SinBotinLejano.BotinMob--; } } public enum SpellType { Instantaneo, Canalizado } public enum Rol { Ofensivo, Defensivo, Apoyo, Utilidad } public class Spell { public string Id; public string NameEs; public string DescriptionEs; public Escuela School; public int Rank; public Escuela? School2; public SpellType Type; public float Mana; public float Health; public float HealthFraction; public float Cooldown = 1f; public bool Destructive; public bool Rare; public Action Cast; public bool Chargeable = true; public bool Sustained; public float SustainTick = 0.3f; public float SustainCost = 0.25f; public float SustainPower = 0.45f; public float SustainMax; public float SustainRamp = 1f; public float Radius; public bool RadiusOnSelf; public Rol Rol; public string Name { get { return Tr.GetOr("magia_spell_" + Id, NameEs); } set { NameEs = value; } } public string Description { get { return Tr.GetOr("magia_spell_" + Id + "_d", DescriptionEs); } set { DescriptionEs = value; } } public bool IsCombined => School2.HasValue; public static string RolName(Rol r) { return r switch { Rol.Apoyo => Tr.Get("magia_support"), Rol.Defensivo => Tr.Get("magia_defensive"), Rol.Ofensivo => Tr.Get("magia_offensive"), _ => Tr.Get("magia_utility"), }; } } public class SpellRunner : MonoBehaviour { public static SpellRunner Instance; private void Awake() { Instance = this; } public static void Repeat(float interval, float duration, Action tick) { if ((Object)(object)Instance != (Object)null) { ((MonoBehaviour)Instance).StartCoroutine(Instance.RepeatRoutine(interval, duration, WithCharge(tick))); } } public static void After(float delay, Action action) { if ((Object)(object)Instance != (Object)null) { ((MonoBehaviour)Instance).StartCoroutine(Instance.AfterRoutine(delay, WithCharge(action))); } } private static Action WithCharge(Action a) { float charge = Fx.ChargeMult; return delegate { float chargeMult = Fx.ChargeMult; Fx.ChargeMult = charge; try { a(); } finally { Fx.ChargeMult = chargeMult; } }; } private IEnumerator RepeatRoutine(float interval, float duration, Action tick) { float end = Time.time + duration; while (Time.time < end) { try { tick(); } catch (Exception ex) { MTMagiaPlugin.Log.LogError((object)ex); break; } yield return (object)new WaitForSeconds(interval); } } private IEnumerator AfterRoutine(float delay, Action action) { yield return (object)new WaitForSeconds(delay); try { action(); } catch (Exception ex) { MTMagiaPlugin.Log.LogError((object)ex); } } } public static class SpellBook { private class Escuelas2 { public Escuela Main; public Escuela? Second; public Escuelas2(Escuela m, Escuela? s) { Main = m; Second = s; } } private struct Area { public float R; public bool Self; public Area(float r, bool self) { R = r; Self = self; } } public static readonly List All = new List(); private static float _relampagoStagger; private static readonly float[] Base = new float[7] { 20f, 30f, 45f, 70f, 95f, 130f, 180f }; private static readonly Dictionary Clasificacion = new Dictionary { { "electric", new Escuelas2(Escuela.Viento, Escuela.Agua) }, { "cumulonimbus", new Escuelas2(Escuela.Agua, Escuela.Viento) }, { "cortina_vapor", new Escuelas2(Escuela.Agua, Escuela.Fuego) }, { "barro_profundo", new Escuelas2(Escuela.Tierra, Escuela.Agua) } }; private static readonly HashSet Defensivos = new HashSet { "escudo_menor", "barrera_flechas", "escudo_grupo", "barrera_sagrada", "barrera_reflectante", "fortaleza_divina", "escudo_sangre", "muro_tierra", "fortaleza_tierra", "resistencia", "inmunidad", "paso_atras", "piel_piedra" }; private static readonly HashSet Apoyos = new HashSet { "curar", "curacion_mayor", "curacion_area", "regeneracion", "curacion_total", "santuario", "renacer", "aura_sagrada", "antidoto", "purificar", "purificacion_area", "pacto_sangre", "senor_sangre", "paso_viento", "invocar_lobo", "espiritus_fuego", "invocar_bestia", "invocar_golem", "invocar_draken", "invocar_dragon", "alzar_muertos", "invocar_troll" }; private static readonly HashSet Utilidades = new HashSet { "muro_tierra", "fortaleza_tierra", "espiritu_guia", "levitar", "aligerar", "impulso_viento", "encender", "pilar_tierra", "esculpir", "lavar", "despejar_cielo", "cortina_vapor" }; private static readonly HashSet NoCharge = new HashSet { "muro_tierra", "fortaleza_tierra", "espiritu_guia", "levitar", "aligerar", "atraer", "paso_viento", "pilar_tierra", "esculpir", "lavar", "pacto_sangre", "senor_sangre", "escudo_sangre", "alzar_muertos", "paso_atras", "piel_piedra", "invocar_troll", "cortina_vapor", "cumulonimbus", "diluvio", "ventisca", "pantano", "barro_profundo" }; private static readonly Dictionary Radius = new Dictionary { { "pilar_fuego", new Area(4f, self: false) }, { "explosion", new Area(6f, self: false) }, { "infierno", new Area(8f, self: false) }, { "sol_negro", new Area(12f, self: false) }, { "nova_hielo", new Area(7f, self: true) }, { "cero_absoluto", new Area(15f, self: true) }, { "lanzas_tierra", new Area(5f, self: false) }, { "terremoto", new Area(15f, self: true) }, { "tornado", new Area(4f, self: false) }, { "huracan", new Area(18f, self: true) }, { "lava", new Area(4f, self: false) }, { "hemorragia", new Area(8f, self: true) }, { "tormenta_fuego", new Area(4f, self: false) }, { "relampago", new Area(2.5f, self: false) }, { "canon_piedra", new Area(3f, self: false) }, { "tormenta_electrica", new Area(20f, self: true) }, { "presion_gravitatoria", new Area(6f, self: false) } }; private static Vector3 _pilarStart; private static float _pilarPolvo; private static readonly string[] PilarRocas = new string[5] { "rock4_forest", "Rock_3", "rock1_mountain", "rock4_coast", "stone_wall_4x2" }; private static Transform _pilar; private const float PilarAncho = 2.6f; private const float PilarSeguridad = 80f; private static Mesh _rockColumn; private static Mesh _spike; private static float _paralisisNext; private static int _electricTick; private static float _electricStart; private const float ElectricSpeed = 22f; private static readonly Color VientoLineas = new Color(0.95f, 0.95f, 1f, 0.5f); private static DamageTypes D(float power, float blunt = 0f, float slash = 0f, float pierce = 0f, float fire = 0f, float frost = 0f, float lightning = 0f, float poison = 0f, float spirit = 0f) { //IL_0026: 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) power *= (MTMagiaPlugin.MagiaDanoMult?.Value ?? 1f) * Ritmo.Poder(Player.m_localPlayer); return new DamageTypes { m_blunt = blunt * power, m_slash = slash * power, m_pierce = pierce * power, m_fire = fire * power, m_frost = frost * power, m_lightning = lightning * power, m_poison = poison * power, m_spirit = spirit * power }; } private static Spell Add(string id, string name, Escuela school, int rank, SpellType type, float mana, float cooldown, string description, Action cast, bool destructive = false, Escuela? school2 = null, float health = 0f, float healthFraction = 0f) { Spell spell = new Spell { Id = id, Name = name, School = school, Rank = rank, Type = type, Mana = mana, Cooldown = cooldown, Description = description, Cast = cast, Destructive = destructive, School2 = school2, Health = health, HealthFraction = healthFraction }; All.Add(spell); return spell; } private static SkillType Sk(Escuela e) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return Escuelas.Skill(e); } private static bool At(Player p, Escuela e, int rank) { return Escuelas.Rank(p, e) >= rank; } private static void Fan(Player p, int count, float step, Action shoot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Fx.AimDir(p); for (int i = 0; i < count; i++) { shoot(Quaternion.AngleAxis(((float)i - (float)(count - 1) / 2f) * step, Vector3.up) * val); } } private static Player NearestAlly(Player p, float radius) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) return (from a in Fx.AlliesInRadius(p, ((Component)p).transform.position, radius) where (Object)(object)a != (Object)(object)p && !((Character)a).IsDead() orderby Vector3.Distance(((Component)a).transform.position, ((Component)p).transform.position) select a).FirstOrDefault(); } public static void Build() { All.Clear(); Add("bola_fuego", "Bola de Fuego", Escuela.Fuego, 0, SpellType.Instantaneo, 9f, 2f, "Una bola de fuego que se vuelve más grande y letal al canalizar. Santo: explota en área.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Vector3 dir = Fx.AimDir(p); DamageTypes damage = D(pw, 3f, 0f, 0f, Base[0] * 0.7f); SkillType skill = Sk(Escuela.Fuego); float aoe = (At(p, Escuela.Fuego, 3) ? 2.5f : 0f); Fx.Projectile(p, "staff_fireball_projectile", dir, 30f, damage, skill, 0f, null, null, 1f, aoe); }); Add("lluvia_brasas", "Lluvia de Brasas", Escuela.Fuego, 2, SpellType.Instantaneo, 38f, 5f, "Tres bolas de fuego en abanico.", delegate(Player p, float pw) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[3] { -8f, 0f, 8f }; foreach (float num in array) { Fx.Projectile(p, "staff_fireball_projectile", Quaternion.AngleAxis(num, Vector3.up) * Fx.AimDir(p), 30f, D(pw, 5f, 0f, 0f, Base[2]), Sk(Escuela.Fuego)); } FuegoVfx.Brasas(Fx.CastOrigin(p), 0.3f, 40, 0.6f); FuegoVfx.Destello(Fx.CastOrigin(p), 6f, 2.5f, 0.3f); }); Add("pilar_fuego", "Pilar de Fuego", Escuela.Fuego, 3, SpellType.Canalizado, 60f, 10f, "Columna de fuego en área con quemadura larga.", delegate(Player p, float pw) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0066: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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_00e6: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Fx.AimPoint(p); Fx.Visual("fx_fireball_staff_explosion", val, 2f); FuegoVfx.Columna(val, 1.6f, 9f, 1.5f); FuegoVfx.Onda(val, 4f); FuegoVfx.Brasas(val, 1.5f, 80); FuegoVfx.Humo(val + Vector3.up * 4f, 1.5f, 12); FuegoVfx.Destello(val, 14f, 4f, 1.5f); Fx.DamageArea(p, val, 4f, D(pw, 0f, 0f, 0f, Base[3]), Sk(Escuela.Fuego)); }); Add("explosion", "Explosión", Escuela.Fuego, 4, SpellType.Canalizado, 90f, 15f, "Gran explosión que lanza a los enemigos.", delegate(Player p, float pw) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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_0040: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Fx.AimPoint(p); Fx.Visual("fx_fireball_staff_explosion", val, 3f); FuegoVfx.Estallido(val + Vector3.up * 1f, 3f, 180); FuegoVfx.Onda(val, 7f, 0.5f); FuegoVfx.Brasas(val, 1f, 150, 1.4f); FuegoVfx.Humo(val + Vector3.up * 2f, 2.5f, 30); FuegoVfx.Destello(val, 25f, 6f, 0.8f); GameCamera instance = GameCamera.instance; if (instance != null) { instance.AddShake(val, 30f, 1f, false); } Fx.DamageArea(p, val, 6f, D(pw, Base[4] * 0.6f, 0f, 0f, Base[4] * 0.6f), Sk(Escuela.Fuego), 80f, 2f); }); Add("infierno", "Infierno", Escuela.Fuego, 5, SpellType.Canalizado, 135f, 45f, "Área en llamas 15 s que quema árboles.", delegate(Player p, float pw) { //IL_0020: 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_0031: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bb: Unknown result type (might be due to invalid IL or missing references) Vector3 pt = Fx.AimPoint(p); Fx.DamageTrees(p, pt, 8f, 300f); FuegoVfx.Onda(pt, 8f, 0.6f); FuegoVfx.Llamas(pt, 7.5f, 15f, 380f, 1.3f); FuegoVfx.Humo(pt + Vector3.up * 1.5f, 3f, 0, 15f, 6f); FuegoVfx.Destello(pt, 22f, 3.5f, 15f); SpellRunner.Repeat(1f, 15f, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) FuegoVfx.Brasas(pt + Random.insideUnitSphere * 5f, 1f, 25, 0.8f); Fx.Visual("fx_fireball_staff_explosion", pt + Random.insideUnitSphere * 5f); Fx.DamageArea(p, pt, 8f, D(pw, 0f, 0f, 0f, Base[5] * 0.25f), Sk(Escuela.Fuego)); }); }, destructive: true); Add("sol_negro", "Sol Negro", Escuela.Fuego, 6, SpellType.Canalizado, 190f, 100f, "Explosión enorme que quema el terreno.", delegate(Player p, float pw) { //IL_0020: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) Vector3 pt = Fx.AimPoint(p); FuegoVfx.SolNegroCarga(pt + Vector3.up * 6f, 1.2f); GameCamera instance = GameCamera.instance; if (instance != null) { instance.AddShake(pt, 60f, 0.6f, false); } SpellRunner.After(1.2f, delegate { //IL_0006: 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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: 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_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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_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_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) Fx.Visual("fx_fireball_staff_explosion", pt, 5f); FuegoVfx.Destello(pt, 60f, 10f, 1.2f, (Color?)new Color(1f, 0.85f, 0.6f)); FuegoVfx.Estallido(pt + Vector3.up * 2f, 6f, 400); FuegoVfx.Onda(pt, 14f, 0.7f); SpellRunner.After(0.2f, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) FuegoVfx.Onda(pt, 10f, 0.6f); }); FuegoVfx.Brasas(pt, 3f, 400, 2f); FuegoVfx.Humo(pt + Vector3.up * 3f, 5f, 60, 3f, 25f); FuegoVfx.Llamas(pt, 10f, 6f, 300f, 1.5f); GameCamera instance2 = GameCamera.instance; if (instance2 != null) { instance2.AddShake(pt, 60f, 3f, false); } Fx.DamageArea(p, pt, 12f, D(pw, Base[6] * 0.5f, 0f, 0f, Base[6] * 1.5f), Sk(Escuela.Fuego), 120f, 3f); Fx.DamageTrees(p, pt, 12f, 1000f); for (int num = 0; num < 3; num++) { Fx.Crater(pt + Random.insideUnitSphere * 4f, 4f); } }); }, destructive: true); Add("bala_agua", "Bala de Hielo", Escuela.Agua, 0, SpellType.Instantaneo, 6f, 1f, "Esquirla de hielo que hiela y frena al enemigo. Santo: 3 esquirlas.", delegate(Player p, float pw) { Fan(p, (!At(p, Escuela.Agua, 3)) ? 1 : 3, 6f, delegate(Vector3 dir) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) Fx.Projectile(p, "staff_iceshard_projectile", dir, 30f, D(pw, 0f, 0f, Base[0] * 0.3f, 0f, Base[0] * 0.55f), Sk(Escuela.Agua), 20f, null, "Frost"); }); }); Add("cascada", "Aliento Helado", Escuela.Agua, 1, SpellType.Instantaneo, 14f, 4f, "Ráfaga de frío a corta distancia: hiela, frena mucho y aparta.", delegate(Player p, float pw) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) float[] array = new float[5] { -18f, -9f, 0f, 9f, 18f }; foreach (float num in array) { Fx.Projectile(p, "staff_iceshard_projectile", Quaternion.AngleAxis(num, Vector3.up) * Fx.AimDir(p), 18f, D(pw, 0f, 0f, 0f, 0f, Base[1] * 0.25f), Sk(Escuela.Agua), 15f, null, "Frost", 0.7f); } Vfx.Wind(Fx.CastOrigin(p), Fx.AimDir(p), 6f, 25f, new Color(0.7f, 0.9f, 1f, 0.6f)); foreach (Character item in Cone(p, 6f, 0.5f)) { Fx.Damage(p, item, D(pw, 0f, 0f, 0f, 0f, Base[1]), Sk(Escuela.Agua), 60f); Fx.AddSE(item, "Frost"); Fx.AddSE(item, "MT_Lento", 0.5f); Fx.Visual("fx_DvergerMage_Ice_hit", item.GetCenterPoint()); } }); Add("lanza_hielo", "Lanza de Hielo", Escuela.Agua, 2, SpellType.Instantaneo, 24f, 2f, "Proyectil que congela.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) Fx.Projectile(p, "dragon_ice_projectile", Fx.AimDir(p), 35f, D(pw, 0f, 0f, Base[2] * 0.5f, 0f, Base[2]), Sk(Escuela.Agua)); }); Add("cumulonimbus", "Cumulonimbus", Escuela.Agua, 3, SpellType.Canalizado, 60f, 60f, "Una nube de tormenta se forma sobre ti y descarga rayos sobre los enemigos cercanos: 5 en Santo, 8 en Rey, 10 en Emperador y 12 en Dios (el último, mayor). Mojados, el rayo les hace el doble.", delegate(Player p, float pw) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Weather.Force(p, "ThunderStorm", 60f); Cumulonimbus.Lanzar(p, D(pw, 0f, 0f, 0f, 0f, 0f, Base[3] * 1.2f), Sk(Escuela.Viento)); }); Add("nova_hielo", "Nova de Hielo", Escuela.Agua, 4, SpellType.Canalizado, 75f, 20f, "Onda helada a tu alrededor que congela.", delegate(Player p, float pw) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) Fx.Visual("fx_fenring_icenova", ((Component)p).transform.position, 1.5f); Fx.Visual("fx_DvergerMage_Nova_ring", ((Component)p).transform.position); foreach (Character item2 in Fx.EnemiesInRadius(p, ((Component)p).transform.position, 7f)) { Fx.Damage(p, item2, D(pw, 0f, 0f, 0f, 0f, Base[4]), Sk(Escuela.Agua)); Fx.AddSE(item2, "Frost"); Fx.AddSE(item2, "MT_Lento", 0.5f); Fx.Visual("vfx_ColdBall_Hit", item2.GetCenterPoint()); } }); Add("despejar_cielo", "Despejar Cielo", Escuela.Viento, 2, SpellType.Instantaneo, 60f, 600f, "Aparta las nubes: cielo despejado 3 min (quita lluvia, tormenta o nieve) y te seca.", delegate(Player p, float pw) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) Weather.Force(p, "Clear", 180f); Cronica.AnotarUnaVez(p, "despejar_cielo", "cronica_sky_cleared", Array.Empty()); ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("Wet"), false); Vfx.Wind(Fx.CastOrigin(p), Vector3.up, 12f, 60f, new Color(0.95f, 0.95f, 1f, 0.5f)); MT.Magia.VientoLineas.Anillo(((Component)p).transform.position + Vector3.up * 1f, 9f, 8); ((Character)p).Message((MessageType)1, Tr.Get("magia_sky_clears"), 0, (Sprite)null, false); }); Add("diluvio", "Diluvio", Escuela.Agua, 5, SpellType.Canalizado, 110f, 60f, "Lluvia torrencial 90 s que frena a los enemigos.", delegate(Player p, float pw) { //IL_002d: 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_0060: Unknown result type (might be due to invalid IL or missing references) Weather.Force(p, "Rain", 90f); AguaVfx.Diluvio(((Component)p).transform.position); ClimaInvocado(p, new Color(0.35f, 0.6f, 1f), new Color(0.6f, 0.85f, 1f)); SpellRunner.Repeat(2f, 90f, delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) foreach (Character item3 in Fx.EnemiesInRadius(p, ((Component)p).transform.position, 25f)) { Fx.AddSE(item3, "MT_Lento", 0.3f); Fx.AddSE(item3, "Wet"); } }); }); Add("cero_absoluto", "Cero Absoluto", Escuela.Agua, 6, SpellType.Canalizado, 170f, 90f, "Onda de frío de 15 m: congela a los enemigos 1.2 s y luego se rompen en hielo con mucho daño.", delegate(Player p, float pw) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_01ce: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_03dc: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)p).transform.position; Fx.Visual("fx_DvergerMage_Nova_start", position); Fx.Visual("fx_DvergerMage_Nova_ring", position, 2f); Fx.Visual("fx_fenring_icenova", position, 3f); Particulas.Spawn(position + Vector3.up * 1f, new Particulas.Config { ColorA = new Color(0.6f, 0.85f, 1f), ColorB = Color.white, LifeMin = 0.6f, LifeMax = 1.2f, SpeedMin = 10f, SpeedMax = 18f, SizeMin = 0.15f, SizeMax = 0.4f, Radius = 0.5f, Burst = 400, Gravity = 0.4f }); Particulas.Spawn(position + Vector3.up * 0.3f, new Particulas.Config { ColorA = new Color(0.75f, 0.92f, 1f, 0.8f), ColorB = new Color(0.9f, 0.97f, 1f, 0.6f), LifeMin = 1.2f, LifeMax = 1.6f, SpeedMin = 11f, SpeedMax = 12f, SizeMin = 1.2f, SizeMax = 2f, Radius = 0.5f, Hemisphere = true, Burst = 250, Additive = false, Grow = 1.8f }); Particulas.Spawn(position + Vector3.up * 9f, new Particulas.Config { ColorA = Color.white, ColorB = new Color(0.8f, 0.92f, 1f), LifeMin = 3f, LifeMax = 4f, SpeedMin = 0f, SpeedMax = 0.3f, SizeMin = 0.08f, SizeMax = 0.18f, Radius = 15f, Rate = 300f, Duration = 5f, Gravity = 0.15f, Max = 3000 }); for (int i = 0; i < 2; i++) { float num = 5f + (float)i * 5f; int num2 = 8 + i * 6; float delay = 0.15f + (float)i * 0.25f; for (int j = 0; j < num2; j++) { float num3 = (float)j * (float)Math.PI * 2f / (float)num2; Vector3 pt = position + new Vector3(Mathf.Cos(num3), 0f, Mathf.Sin(num3)) * num; SpellRunner.After(delay, delegate { //IL_0006: Unknown result type (might be due to invalid IL or missing references) Fx.Visual("fx_dragon_coldball_explode", pt, 0.8f); }); } } HieloAgua.Freeze(position, 15f, 30f); foreach (Character item4 in Fx.EnemiesInRadius(p, position, 15f)) { Character target = item4; Fx.AddSE(target, "Frost"); if (!target.IsBoss()) { Fx.AddSE(target, "MT_Paralisis", 1.5f); } Fx.AddSE(target, "MT_Lento", 0.6f); Fx.Visual("vfx_ColdBall_Hit", target.GetCenterPoint()); Particulas.IceCage(target, 1.2f); SpellRunner.After(1.2f, delegate { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null) && !target.IsDead()) { Particulas.Spawn(target.GetCenterPoint(), new Particulas.Config { ColorA = new Color(0.6f, 0.85f, 1f), ColorB = Color.white, LifeMin = 0.5f, LifeMax = 1f, SpeedMin = 3f, SpeedMax = 7f, SizeMin = 0.1f, SizeMax = 0.3f, Radius = 0.6f, Burst = 80, Gravity = 1.2f }); Fx.Visual("vfx_ice_destroyed", target.GetCenterPoint(), 1.5f); Fx.Visual("fx_iceshard_hit", target.GetCenterPoint()); Fx.Damage(p, target, D(pw, 0f, 0f, 0f, 0f, Base[6]), Sk(Escuela.Agua)); } }); } }); Add("rafaga", "Ráfaga de Empuje", Escuela.Viento, 0, SpellType.Instantaneo, 8f, 2f, "Empuja a los enemigos frente a ti.", delegate(Player p, float pw) { //IL_0001: 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_000c: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0153: 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_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Fx.CastOrigin(p); Vector3 val2 = Fx.AimDir(p); Vfx.Wind(val, val2, 9f, 30f, new Color(0.9f, 0.95f, 0.9f, 0.6f)); Vfx.Wind(val + Vector3.up * 0.4f, val2, 11f, 18f, new Color(0.85f, 1f, 0.9f, 0.5f)); Vfx.Leaves(val, val2, 10f, 70); Vfx.Leaves(((Component)p).transform.position + Vector3.up * 0.3f, val2, 7f, 40); MT.Magia.VientoLineas.Spawn(val, val2, 8f); foreach (Character item5 in Cone(p, 7f, 0.5f)) { Fx.Damage(p, item5, D(pw, Base[0] * 0.3f), Sk(Escuela.Viento), 150f, 2f); Rigidbody val3 = Campos.Cuerpo.Invoke(item5); if ((Object)(object)val3 != (Object)null && !item5.IsBoss()) { Vector3 val4 = new Vector3(val2.x, 0f, val2.z); Vector3 normalized = ((Vector3)(ref val4)).normalized; val3.linearVelocity = normalized * 9f + Vector3.up * 13f; Vfx.Leaves(((Component)item5).transform.position + Vector3.up * 0.5f, Vector3.up, 5f, 20); } } }); Add("hoja_viento", "Hoja de Viento", Escuela.Viento, 1, SpellType.Instantaneo, 15f, 3f, "Corte de aire en línea que atraviesa enemigos.", delegate(Player p, float pw) { //IL_0001: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0050: 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_00b2: 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) Vfx.Blade(Fx.CastOrigin(p), Fx.AimDir(p), 15f, new Color(0.85f, 1f, 0.9f, 0.8f)); Vfx.Wind(Fx.CastOrigin(p), Fx.AimDir(p), 15f, 10f, VientoLineas); MT.Magia.VientoLineas.Spawn(Fx.CastOrigin(p), Fx.AimDir(p), 12f, 3); foreach (Character item6 in Line(p, 15f, 1.2f)) { Fx.Damage(p, item6, D(pw, 0f, Base[1]), Sk(Escuela.Viento)); } }); Add("aligerar", "Aligerar", Escuela.Gravedad, 0, SpellType.Instantaneo, 12f, 30f, "Reduces tu propia gravedad 2 min: +100 de carga, saltas más y sin daño por caída.", delegate(Player p, float pw) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) Fx.AddSE((Character)(object)p, "MT_Aligerar"); Fx.Visual("fx_land", ((Component)p).transform.position); }); Add("atraer", "Atraer", Escuela.Gravedad, 1, SpellType.Instantaneo, 18f, 6f, "Atrae hacia ti al enemigo bajo la mira y lo tambalea.", delegate(Player p, float pw) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_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_004c: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_00b3: 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_00c4: 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) Character val = Line(p, 25f, 1.5f).FirstOrDefault(); if ((Object)(object)val == (Object)null) { ((Character)p).Message((MessageType)1, Tr.Get("magia_no_target"), 0, (Sprite)null, false); } else { HitData val2 = new HitData { m_point = val.GetCenterPoint() }; Vector3 val3 = ((Component)p).transform.position - ((Component)val).transform.position; val2.m_dir = ((Vector3)(ref val3)).normalized; val2.m_pushForce = 120f * pw; val2.m_staggerMultiplier = 3f; val2.m_skill = Sk(Escuela.Gravedad); HitData val4 = val2; val4.m_damage.m_blunt = 1f; val4.SetAttacker((Character)(object)p); val.Damage(val4); Vfx.GravityPull(Fx.CastOrigin(p), val.GetCenterPoint()); Vfx.GravityPoint(val.GetCenterPoint(), 1.2f, 28); Fx.Visual("fx_land", ((Component)val).transform.position); } }); Add("levitar", "Levitar", Escuela.Gravedad, 2, SpellType.Instantaneo, 20f, 2f, "Anulas tu gravedad y vuelas mientras tengas maná (3/s; con Shift vas más rápido y gasta el doble). K: aterrizar.", delegate(Player p, float pw) { Levitacion.Toggle(p, pw); }); Add("presion_gravitatoria", "Presión Gravitatoria", Escuela.Gravedad, 3, SpellType.Canalizado, 70f, 25f, "Multiplicas la gravedad en un área: aplasta, frena mucho y derriba a los enemigos.", delegate(Player p, float pw) { //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_000c: 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_0031: 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_008c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Fx.AimPoint(p); PresionVisual(val, 6f * Fx.AreaMult); Vfx.GravityPoint(val, 6f * Fx.AreaMult, 100); foreach (Character item7 in Fx.EnemiesInRadius(p, val, 6f * Fx.AreaMult)) { Fx.Damage(p, item7, D(pw, Base[3] * 0.8f), Sk(Escuela.Gravedad), 0f, 3f); Vfx.Gravity(item7, 1.5f, 0.48f); Fx.AddSE(item7, "MT_Lento", 0.7f); } }); Add("paso_viento", "Pasos de Viento", Escuela.Viento, 2, SpellType.Instantaneo, 20f, 12f, "+40 % de velocidad 10 s, con viento y hojas en los pies; sin daño por caída.", delegate(Player p, float pw) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Fx.AddSE((Character)(object)p, "MT_PasoViento"); Vfx.Wind(((Component)p).transform.position, Vector3.up, 6f, 50f, VientoLineas); MT.Magia.VientoLineas.Anillo(((Component)p).transform.position + Vector3.up * 0.3f, 3f, 5, 1); }); Add("tornado", "Tornado", Escuela.Viento, 3, SpellType.Canalizado, 50f, 25f, "Remolino que arrastra y golpea enemigos durante 8 s.", delegate(Player p, float pw) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_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) Vector3 punto = Fx.AimPoint(p, 25f); Whirlwind(p, pw, punto, D(pw, Base[3] * 0.1f)); Vector3 avance = ((Component)p).transform.forward; float t0 = Time.time; SpellRunner.Repeat(1.5f, 8f, delegate { //IL_0001: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) MT.Magia.VientoLineas.Anillo(punto + avance * ((Time.time - t0) * 1.5f) + Vector3.up * 0.8f, 5f, 4, 1); }); }); Add("relampago", "Relámpago de Eikthyr", Escuela.Viento, 4, SpellType.Instantaneo, 65f, 6f, "Rayo como el de Eikthyr: impacta donde apuntas y salta en cadena a 2 enemigos cercanos. Se mantiene hasta 2,5 s (3 s en Dios); cuanto más lo mantienes, más maná chupa.", delegate(Player p, float pw) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_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_006c: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_0117: 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_014a: Unknown result type (might be due to invalid IL or missing references) DamageTypes damage = D(pw, 0f, 0f, 0f, 0f, 0f, Base[4]); float num = Fx.Concentration(p, damage); damage.m_lightning *= num; Color color = ((num > 1f) ? Fx.Morado : Rayo.Azul); Vector3 val = Rayo.Beam(p, Fx.CastOrigin(p), Fx.AimDir(p), 60f, color); Rayo.Sparks(val, color); Rayo.EikthyrStrike(val); bool flag = Time.time >= _relampagoStagger; if (flag) { _relampagoStagger = Time.time + 1.5f; } Fx.DamageArea(p, val, 2.5f, damage, Sk(Escuela.Viento), 0f, flag ? 2f : 0f); Character first = null; float num2 = 3f; foreach (Character item8 in Fx.EnemiesInRadius(p, val, 3f)) { float num3 = Vector3.Distance(item8.GetCenterPoint(), val); if (num3 < num2) { num2 = num3; first = item8; } } Rayo.Chain(p, first, damage, color, 2, 8f, flag ? 1.5f : 0f); }); Add("tormenta_electrica", "Tormenta Eléctrica", Escuela.Viento, 5, SpellType.Canalizado, 110f, 30f, "8 rayos sobre enemigos cercanos.", delegate(Player p, float pw) { Weather.Force(p, "ThunderStorm", 20f); SpellRunner.Repeat(0.5f, 4f, delegate { //IL_0041: Unknown result type (might be due to invalid IL or missing references) StrikeRandom(p, 20f, D(pw, 0f, 0f, 0f, 0f, 0f, Base[5] * 0.6f)); }); }); Add("huracan", "Huracán", Escuela.Viento, 6, SpellType.Canalizado, 160f, 90f, "Vientos enormes 20 s: derriba árboles y lanza enemigos.", delegate(Player p, float pw) { //IL_0020: 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) Vector3 center = ((Component)p).transform.position; Weather.Force(p, "ThunderStorm", 20f); SpellRunner.Repeat(1f, 20f, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_0039: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00ff: Unknown result type (might be due to invalid IL or missing references) Vfx.Wind(center + Vector3.up * 0.5f, Vector3.up, 16f, 75f, VientoLineas); Vfx.Wind(center + Random.insideUnitSphere * 8f + Vector3.up, Random.onUnitSphere, 12f, 25f, VientoLineas); MT.Magia.VientoLineas.Anillo(center + Vector3.up * 1.2f, 14f); foreach (Character item9 in Fx.EnemiesInRadius(p, center, 18f)) { Fx.Damage(p, item9, D(pw, Base[6] * 0.1f), Sk(Escuela.Viento), 200f, 3f); } }); SpellRunner.Repeat(5f, 20f, delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Fx.DamageTrees(p, center, 18f, 400f); }); SpellRunner.Repeat(2f, 20f, delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Fx.DamageStructures(p, center, 18f, Base[6] * pw * 0.15f); }); }, destructive: true); Add("bala_piedra", "Bala de Piedra", Escuela.Tierra, 0, SpellType.Instantaneo, 8f, 1f, "Cono de piedra que vuela recto. Mantén el clic: aparece frente a ti, gira y se vuelve rojo; aumenta daño, velocidad e impacto. Avanzado: estalla en área. Rey: tambalea siempre.", delegate(Player p, float pw) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = StoneBullet.Origin(p); Vector3 val2 = Fx.AimPoint(p, 60f) - val; Vector3 val3 = ((((Vector3)(ref val2)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val2)).normalized : ((Component)p).transform.forward); Fx.Projectile(p, "MT_BalaPiedra", val3, 35f * Mathf.Sqrt(Fx.ChargeMult), D(pw, Base[0], 0f, Base[0] * 0.5f), Sk(Escuela.Tierra), 30f * Fx.ChargeMult, val, null, aoe: At(p, Escuela.Tierra, 2) ? 1.5f : 0f, stagger: At(p, Escuela.Tierra, 4) ? 10f : 1f, scale: MTMagiaPlugin.BalaPiedraTamano.Value); }); Add("pantano", "Pantano de Barro", Escuela.Tierra, 1, SpellType.Instantaneo, 15f, 10f, "Suelo de barro 12 s: los enemigos se atascan.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Swamp(p, Fx.AimPoint(p, 25f), 5f, 12f); }); Add("muro_tierra", "Muro de Piedra", Escuela.Tierra, 2, SpellType.Instantaneo, 25f, 4f, "Al instante, te giras hacia la mira y alzas delante de ti una C de tres muros de piedra que te cubre de frente y por los lados: 2 pisos (3 desde rango Rey de Tierra). Se quedan para siempre y se pueden romper como cualquier muro.", delegate(Player p, float pw) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_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) //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_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_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_012a: 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_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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) p.FaceLookDirection(); Vector3 val = Vector3.ProjectOnPlane(((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform.forward : ((Component)p).transform.forward, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { val = ((Component)p).transform.forward; } Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); int pisos = Mathf.Max(1, MTMagiaPlugin.MuroPisos.Value) + ((Escuelas.Rank(p, Escuela.Tierra) >= 4) ? 1 : 0); float num = float.MaxValue; for (int i = -1; i <= 1; i++) { Quaternion val3 = val2 * Quaternion.Euler(0f, (float)i * 60f, 0f); Vector3 val4 = ((Component)p).transform.position + val3 * Vector3.forward * 3.46f; Vector3 val5 = val3 * Vector3.right; for (int j = -2; j <= 2; j++) { num = Mathf.Min(num, GroundY(val4 + val5 * (float)j)); } } for (int k = -1; k <= 1; k++) { Quaternion val6 = val2 * Quaternion.Euler(0f, (float)k * 60f, 0f); Vector3 val7 = ((Component)p).transform.position + val6 * Vector3.forward * 3.46f; StoneWall(val7, val6, pisos, relleno: false, num - 0.2f); Particulas.Tierra(val7, 1.5f, 1.2f); } }); Add("lanzas_tierra", "Lanzas de Tierra", Escuela.Tierra, 3, SpellType.Canalizado, 45f, 10f, "Púas de roca brotan del suelo en área: atraviesan y tambalean. Se quedan.", delegate(Player p, float pw) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0108: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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) Vector3 val = Fx.AimPoint(p); for (int i = 0; i < 12; i++) { Vector2 val2 = Random.insideUnitCircle * 4f; Transform val3 = RockColumn(val + new Vector3(val2.x, 0f, val2.y), Random.Range(0.35f, 0.6f), Random.Range(1.6f, 3f), pointed: true); if ((Object)(object)val3 != (Object)null) { val3.rotation = Quaternion.Euler(Random.Range(-18f, 18f), Random.Range(0f, 360f), Random.Range(-18f, 18f)); } Fx.Visual("vfx_RockHit", val + new Vector3(val2.x, 0f, val2.y)); Particulas.Tierra(val + new Vector3(val2.x, 0f, val2.y), 0.6f, 0.6f); } Fx.DamageArea(p, val, 5f, D(pw, 0f, 0f, Base[3]), Sk(Escuela.Tierra), 0f, 2f); }); Add("fortaleza_tierra", "Fortaleza de Piedra", Escuela.Tierra, 5, SpellType.Canalizado, 110f, 60f, "Recitando (sin cargar), un anillo de muros de piedra a tu alrededor: 2 pisos (3 en rango Dios de Tierra). Se quedan para siempre; si el suelo baja, se apoyan en más piedras.", delegate(Player p, float pw) { //IL_0038: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) int pisos = Mathf.Max(1, MTMagiaPlugin.FortalezaPisos.Value) + ((Escuelas.Rank(p, Escuela.Tierra) >= 6) ? 1 : 0); for (int i = 0; i < 6; i++) { Quaternion val = Quaternion.Euler(0f, (float)i * 60f, 0f); StoneWall(((Component)p).transform.position + val * Vector3.forward * 5f, val, pisos); Particulas.Tierra(((Component)p).transform.position + val * Vector3.forward * 5f, 1.5f); } }); Add("terremoto", "Terremoto", Escuela.Tierra, 6, SpellType.Canalizado, 170f, 90f, "Golpeas el suelo: 3 ondas de choque (5, 10 y 15 m) dañan y tambalean a los enemigos y tumban hasta 3 árboles cercanos.", delegate(Player p, float pw) { //IL_0020: 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) Vector3 center = ((Component)p).transform.position; float carga = Fx.ChargeMult; float escala = Fx.ScaleOverride; for (int i = 0; i < 3; i++) { int ola = i; SpellRunner.After((float)ola * 0.5f, delegate { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p == (Object)null) { return; } Fx.ChargeMult = carga; Fx.ScaleOverride = escala; try { float num = 5f * (float)(ola + 1); OndaTerremoto(center, num); GameCamera instance = GameCamera.instance; if (instance != null) { instance.AddShake(center, 40f, (ola == 0) ? 1f : 0.5f, false); } Fx.DamageArea(p, center, num, D(pw / 3f, Base[6]), Sk(Escuela.Tierra), 25f, 3f); if (ola == 0) { Fx.DamageNearestTrees(p, center, 15f, 600f, 3); } } finally { Fx.ChargeMult = 1f; Fx.ScaleOverride = 1f; } }); } }, destructive: true); Add("curar", "Curar", Escuela.Sanacion, 0, SpellType.Instantaneo, 10f, 2f, "Cura 20 de vida. Santo: también al aliado más cercano.", delegate(Player p, float pw) { Heal((Character)(object)p, 20f * pw); Player val = (At(p, Escuela.Sanacion, 3) ? NearestAlly(p, 10f) : null); if ((Object)(object)val != (Object)null) { Heal((Character)(object)val, 20f * pw); } }); Add("curacion_mayor", "Curación Mayor", Escuela.Sanacion, 1, SpellType.Instantaneo, 20f, 3f, "Cura 50 de vida.", delegate(Player p, float pw) { Heal((Character)(object)p, 50f * pw); }); Add("curacion_area", "Curación en Área", Escuela.Sanacion, 2, SpellType.Instantaneo, 30f, 6f, "Cura a ti y a los aliados cercanos.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item10 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 8f)) { Heal((Character)(object)item10, 35f * pw); } }); Add("sueno_reparador", "Sueño reparador", Escuela.Sanacion, 2, SpellType.Instantaneo, 60f, 5f, "Calma el cuerpo: asimila el esfuerzo del día como si durmieras (50 % en Avanzado, hasta 90 % en Dios) y quita Trasnochado. No sube el tōki. Una vez por día, fuera de combate.", delegate(Player p, float pw) { SuenoReparador.Lanzar(p); }); Add("regeneracion", "Regeneración", Escuela.Sanacion, 3, SpellType.Instantaneo, 40f, 20f, "Cura por tiempo 20 s a ti y a un aliado cercano.", delegate(Player p, float pw) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) Fx.AddSE((Character)(object)p, "MT_Regeneracion", 4f * pw); Player val = ((IEnumerable)Fx.AlliesInRadius(p, ((Component)p).transform.position, 10f)).FirstOrDefault((Func)((Player a) => (Object)(object)a != (Object)(object)p)); if ((Object)(object)val != (Object)null) { Fx.AddSE((Character)(object)val, "MT_Regeneracion", 4f * pw); } }); Add("curacion_total", "Curación Total", Escuela.Sanacion, 4, SpellType.Canalizado, 80f, 60f, "Llena la vida del grupo cercano y da Vigor 2 min: +35 % de vida máxima (Emperador +45 %, Dios +55 %).", delegate(Player p, float pw) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) float skillLevel = (At(p, Escuela.Sanacion, 6) ? 55f : (At(p, Escuela.Sanacion, 5) ? 45f : 35f)); foreach (Player item11 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 10f)) { Fx.AddSE((Character)(object)item11, "MT_Vigor", skillLevel); Heal((Character)(object)item11, ((Character)item11).GetMaxHealth()); Fx.AddSE((Character)(object)item11, "MT_Regeneracion", 4f * pw); } }); Add("santuario", "Santuario", Escuela.Sanacion, 5, SpellType.Canalizado, 110f, 60f, "Zona de 20 s que cura a los aliados dentro.", delegate(Player p, float pw) { //IL_0020: 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) Vector3 center = ((Component)p).transform.position; SpellRunner.Repeat(1f, 20f, delegate { //IL_0006: 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_004d: Unknown result type (might be due to invalid IL or missing references) Fx.Visual("vfx_Potion_health_medium", center); foreach (Player item12 in Fx.AlliesInRadius(p, center, 8f)) { ((Character)item12).Heal(8f * pw, true); Vfx.Heal((Character)(object)item12, Vfx.Verde, destellos: false, 1f); } }); }); Add("renacer", "Renacer", Escuela.Sanacion, 6, SpellType.Canalizado, 150f, 1800f, "60 s: el próximo golpe mortal a un aliado lo deja con vida y lo cura.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item13 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 10f)) { Fx.AddSE((Character)(object)item13, "MT_Renacer"); } }); Add("antidoto", "Antídoto", Escuela.Desintoxicacion, 0, SpellType.Instantaneo, 8f, 2f, "Quita el veneno. Santo: también al aliado más cercano.", delegate(Player p, float pw) { Purify.Local(p, poisonOnly: true); Player val = (At(p, Escuela.Desintoxicacion, 3) ? NearestAlly(p, 10f) : null); if ((Object)(object)val != (Object)null) { Purify.Local(val, poisonOnly: true); } }); Add("purificar", "Purificar", Escuela.Desintoxicacion, 1, SpellType.Instantaneo, 15f, 4f, "Quita fuego, frío, mojado, alquitrán y veneno.", delegate(Player p, float pw) { Purify.Local(p, poisonOnly: false); }); Add("resistencia", "Resistencia", Escuela.Desintoxicacion, 2, SpellType.Instantaneo, 25f, 30f, "Resistente al veneno y al fuego 2 min.", delegate(Player p, float pw) { Fx.AddSE((Character)(object)p, "MT_Resistencia"); }); Add("purificacion_area", "Purificación en Área", Escuela.Desintoxicacion, 3, SpellType.Instantaneo, 40f, 15f, "Purifica a todo el grupo.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item14 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 8f)) { Purify.Send(item14); } }); Add("inmunidad", "Inmunidad", Escuela.Desintoxicacion, 4, SpellType.Canalizado, 70f, 90f, "Inmune a veneno y quemaduras 30 s (tú y tus aliados).", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item15 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 8f)) { Fx.AddSE((Character)(object)item15, "MT_Inmunidad"); } }); Add("paso_atras", "Paso Atrás", Escuela.Viento, 2, SpellType.Instantaneo, 22f, 8f, "Una ráfaga empuja y tambalea a quien tengas delante y te lanza 6 m hacia atrás, sin daño de caída.", delegate(Player p, float pw) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_008e: 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_00d2: 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_00ff: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((Component)p).transform.forward; forward.y = 0f; ((Vector3)(ref forward)).Normalize(); foreach (Character item16 in Fx.EnemiesInRadius(p, ((Component)p).transform.position + forward * 1.5f, 3f)) { Fx.Damage(p, item16, new DamageTypes { m_blunt = 6f * pw }, (SkillType)9, 60f, 3f); } ((Character)p).ForceJump(new Vector3((0f - forward.x) * 22f, 7f, (0f - forward.z) * 22f), false); Color verde = new Color(0.45f, 1f, 0.4f, 0.9f); Vector3 val = ((Component)p).transform.position + Vector3.up * 1.1f; Vfx.Wind(val + forward * 0.5f, forward, 7f, 22f, verde); MT.Magia.VientoLineas.Spawn(val, forward, 5f); Vfx.Leaves(((Component)p).transform.position + Vector3.up * 0.8f, forward, 4f, 40); for (int i = 0; i < 6; i++) { SpellRunner.After((float)i * 0.07f, delegate { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)p == (Object)null)) { Particulas.Spawn(((Component)p).transform.position + Vector3.up * 1f, new Particulas.Config { ColorA = verde, ColorB = new Color(0.2f, 0.75f, 0.3f, 0.7f), LifeMin = 0.35f, LifeMax = 0.6f, SpeedMin = 1.5f, SpeedMax = 3f, SizeMin = 0.12f, SizeMax = 0.3f, Radius = 0.7f, Burst = 28, Grow = 0.3f }); } }); } ((Character)p).GetSEMan().AddStatusEffect(StringExtensionMethods.GetStableHashCode("MT_ImpulsoViento"), true, 0, 0f, (short)(-1)); }); Add("piel_piedra", "Piel de Piedra", Escuela.Tierra, 3, SpellType.Instantaneo, 35f, 12f, "8–20 s (más con tu rango de Tierra): tu cuerpo se cubre de roca que absorbe el 80 % del daño físico hasta romperse; quien te golpea cuerpo a cuerpo se tambalea.", delegate(Player p, float pw) { int num = Mathf.Clamp(Escuelas.Rank(p, Escuela.Tierra) - 3, 0, 3); float num2 = Mathf.Min(20f, 8f + 4f * (float)num); PielPiedra.Hasta = Time.time + num2; PielPiedra.Vida = 60f * (1f + 0.5f * (float)num) * pw; SEMan sEMan = ((Character)p).GetSEMan(); sEMan.RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_PielPiedra"), true); StatusEffect val = sEMan.AddStatusEffect(StringExtensionMethods.GetStableHashCode("MT_PielPiedra"), true, 0, 0f, (short)(-1)); if ((Object)(object)val != (Object)null) { val.m_ttl = num2; } PielPiedraCapa.Mostrar(p, num2); }); Add("escudo_menor", "Escudo Menor", Escuela.Barrera, 0, SpellType.Instantaneo, 10f, 10f, "Escudo que absorbe 30 de daño. Santo: también al aliado más cercano. Quien te golpee cuerpo a cuerpo se tambalea (cada 2 s).", delegate(Player p, float pw) { Fx.AddSE((Character)(object)p, "MT_EscudoMagico", 30f * pw); Player val = (At(p, Escuela.Barrera, 3) ? NearestAlly(p, 10f) : null); if ((Object)(object)val != (Object)null) { Fx.AddSE((Character)(object)val, "MT_EscudoMagico", 30f * pw); } }); Add("barrera_flechas", "Barrera de Flechas", Escuela.Barrera, 1, SpellType.Instantaneo, 18f, 12f, "Bloquea los proyectiles de frente 8 s.", delegate(Player p, float pw) { Fx.AddSE((Character)(object)p, "MT_BarreraFlechas"); }); Add("escudo_grupo", "Escudo de Grupo", Escuela.Barrera, 2, SpellType.Instantaneo, 45f, 45f, "Escudo a los aliados cercanos (absorbe 25, más con el rango).", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item17 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 8f)) { Fx.AddSE((Character)(object)item17, "MT_EscudoMagico", 25f * pw); } }); Add("barrera_sagrada", "Barrera Sagrada", Escuela.Barrera, 3, SpellType.Canalizado, 50f, 40f, "8 s: tú y tus aliados cercanos recibís la mitad de daño. Quien te golpee cuerpo a cuerpo se tambalea (cada 2 s).", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item18 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 6f)) { Fx.AddSE((Character)(object)item18, "MT_ReduccionDano"); } }); Add("barrera_reflectante", "Barrera Reflectante", Escuela.Barrera, 4, SpellType.Canalizado, 75f, 30f, "Devuelve el 30 % de los proyectiles 10 s.", delegate(Player p, float pw) { Fx.AddSE((Character)(object)p, "MT_Reflectante"); }); Add("sello", "Sello de Contención", Escuela.Barrera, 5, SpellType.Canalizado, 100f, 30f, "Encierra a cualquier enemigo, jefes incluidos: 8–20 s según la carga y más con tu rango (a otros jugadores, máx. 6 s menos su resistencia). Los animales domesticables ganan confianza.", delegate(Player p, float pw) { Character target = Line(p, 25f, 2f).FirstOrDefault(); if ((Object)(object)target == (Object)null) { ((Character)p).Message((MessageType)1, Tr.Get("magia_no_target"), 0, (Sprite)null, false); } else { float carga = Mathf.InverseLerp(1f, Caster.MaxCharge(p, All.First((Spell s) => s.Id == "sello")), Fx.ChargeMult); float seconds = Mathf.Lerp(8f, 20f, carga) * (1f + 0.2f * (float)Mathf.Max(0, Escuelas.Rank(p, Escuela.Barrera) - 5)); SelloCadenas.Lanzar(p, target, delegate { if (!((Object)(object)target == (Object)null) && !target.IsDead()) { Fx.AddSE(target, "MT_Paralisis", seconds); SelloVisual.Attach(target, seconds); Contencion.Tame(target, 0.05f + 0.1f * carga); } }); } }); Add("fortaleza_divina", "Fortaleza Divina", Escuela.Barrera, 6, SpellType.Canalizado, 150f, 120f, "15 s: ningún golpe quita más del 10 % de la vida a tus aliados. Quien te golpee cuerpo a cuerpo se tambalea (cada 2 s).", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item19 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 10f)) { Fx.AddSE((Character)(object)item19, "MT_FortalezaDivina"); } }); Add("espiritu_guia", "Espíritu Guía", Escuela.Invocacion, 0, SpellType.Instantaneo, 5f, 30f, "La luz de un wisp flota contigo durante 5 min.", delegate(Player p, float pw) { GuideLight.Spawn(p, 300f); }); Add("invocar_lobo", "Invocar Lobo", Escuela.Invocacion, 1, SpellType.Canalizado, 20f, 10f, "Un lobo aliado resistente (nivel 2) durante 180 s.", delegate(Player p, float pw) { Summons.Spawn(p, "Wolf", 1, 180f, big: false, 1f, 2); }); Add("espiritus_fuego", "Espíritus de Fuego", Escuela.Invocacion, 2, SpellType.Canalizado, 30f, 15f, "2 Surtlings aliados resistentes (nivel 2) durante 135 s.", delegate(Player p, float pw) { Summons.Spawn(p, "Surtling", 2, 135f, big: false, 1f, 2); }); Add("invocar_bestia", "Invocar Bestia", Escuela.Invocacion, 3, SpellType.Canalizado, 55f, 30f, "Un Lox aliado poderoso (nivel 3) durante 150 s.", delegate(Player p, float pw) { Summons.Spawn(p, "Lox", 1, 150f, big: true, 1f, 3); }); Add("invocar_golem", "Invocar Golem", Escuela.Invocacion, 4, SpellType.Canalizado, 80f, 45f, "Un golem de piedra poderoso (nivel 3) durante 180 s.", delegate(Player p, float pw) { Summons.Spawn(p, "StoneGolem", 1, 180f, big: true, 1f, 3); }); Add("invocar_draken", "Invocar Draken", Escuela.Invocacion, 5, SpellType.Canalizado, 110f, 60f, "2 Draken aliados resistentes (nivel 3) durante 150 s.", delegate(Player p, float pw) { Summons.Spawn(p, "Hatchling", 2, 150f, big: false, 1f, 3); }); Add("invocar_dragon", "Invocar Dragón", Escuela.Invocacion, 6, SpellType.Canalizado, 180f, 120f, "Un dragón joven enorme y poderoso (nivel 3) durante 180 s.", delegate(Player p, float pw) { Summons.Spawn(p, "Hatchling", 1, 180f, big: true, 2.5f, 3); }); Add("impulso_viento", "Impulso de Viento", Escuela.Viento, 0, SpellType.Instantaneo, 10f, 8f, "Te impulsas con aire (canalizando, más lejos); anula el daño de caída hasta aterrizar y luego 6 s corres y saltas más.", delegate(Player p, float pw) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_008d: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Fx.AimDir(p); float num = Mathf.InverseLerp(1f, Caster.MaxCharge(p, All.First((Spell s) => s.Id == "impulso_viento")), Fx.ChargeMult); float num2 = Mathf.Lerp(1f, 2.5f, num); ((Character)p).ForceJump(new Vector3(val.x * 26f * num2, Mathf.Max(11f, val.y * 22f) * Mathf.Lerp(1f, 1.6f, num), val.z * 26f * num2), false); Vfx.Leaves(((Component)p).transform.position + Vector3.up * 0.5f, -val, 4f + 4f * num, (int)(30f + 50f * num)); ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_ImpulsoViento"), false); ((Character)p).GetSEMan().AddStatusEffect(StringExtensionMethods.GetStableHashCode("MT_ImpulsoViento"), true, 0, 0f, (short)(-1)); Fx.AddSE((Character)(object)p, "MT_ImpulsoCarrera"); WindImpulseVfx.Spawn(p, val); }); Add("encender", "Encender Fuego", Escuela.Fuego, 0, SpellType.Instantaneo, 3f, 2f, "Clic: aviva un fuego existente. Mantén clic 1 segundo hasta completar la carga y suelta: crea una fogata encendida sobre el suelo. Una carga incompleta no crea fogatas.", delegate(Player p, float pw) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) Vector3 pt = Fx.AimPoint(p, 15f); if (FogataCarga.Complete(Fx.ChargeMult)) { RaycastHit val = default(RaycastHit); if (!Physics.Raycast(pt + Vector3.up * 0.5f, Vector3.down, ref val, 2f, LayerMask.GetMask(new string[4] { "terrain", "piece", "static_solid", "Default" }), (QueryTriggerInteraction)1) || Vector3.Distance(((Component)p).transform.position, ((RaycastHit)(ref val)).point) > 15f) { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_no_ground"), 0, (Sprite)null, false); } else if (((RaycastHit)(ref val)).normal.y < 0.65f) { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_too_steep"), 0, (Sprite)null, false); } else { pt = ((RaycastHit)(ref val)).point; if ((Object)(object)ZoneSystem.instance != (Object)null && pt.y < ZoneSystem.instance.m_waterLevel + 0.05f) { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_water"), 0, (Sprite)null, false); } else if (!PrivateArea.CheckAccess(pt, 0f, false, false)) { ((Character)p).Message((MessageType)2, Tr.Get("magia_can_t_create_campfire_this"), 0, (Sprite)null, false); } else { Collider[] array = Physics.OverlapSphere(pt + Vector3.up * 0.7f, 0.55f, LayerMask.GetMask(new string[4] { "piece", "static_solid", "Default", "Default_small" }), (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { if (!((Object)(object)((Component)array[i]).transform.root == (Object)(object)((Component)p).transform.root)) { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_blocked"), 0, (Sprite)null, false); return; } } if (HogueraMagica.PuedeCrear(p)) { GameObject val2 = Fx.Prefab("fire_pit"); if ((Object)(object)val2 != (Object)null) { GameObject obj = Object.Instantiate(val2, pt, Quaternion.Euler(0f, ((Component)p).transform.eulerAngles.y, 0f)); Fireplace component = obj.GetComponent(); HogueraMagica.Marcar(obj, component, p); Fx.Visual("vfx_FireballHit", pt, 0.5f); } else { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_object_not_available"), 0, (Sprite)null, false); } } } } } else if (Fx.ChargeMult > 1.02f) { ((Character)p).Message((MessageType)2, Tr.Get("magia_campfire_hold_longer"), 0, (Sprite)null, false); } else { Fireplace val3 = (from f in Object.FindObjectsByType((FindObjectsSortMode)0) orderby Vector3.Distance(((Component)f).transform.position, pt) select f).FirstOrDefault(); if ((Object)(object)val3 != (Object)null && Vector3.Distance(((Component)val3).transform.position, pt) < 4f) { val3.AddFuel(1f); ((Character)p).Message((MessageType)1, Tr.Get("magia_fire_stoked"), 0, (Sprite)null, false); } else { ((Character)p).Message((MessageType)1, Tr.Get("magia_there_no_fire_stoke_there") + " · " + Tr.Get("magia_campfire_hold_longer"), 0, (Sprite)null, false); } } }); Add("pilar_tierra", "Pilar de Tierra", Escuela.Tierra, 1, SpellType.Instantaneo, 12f, 4f, "Mantén el clic: una columna de tierra se alza bajo tus pies y te sube sin límite mientras la mantengas. Para ponerte a salvo.", PilarStep); Add("esculpir", "Esculpir Terreno", Escuela.Tierra, 2, SpellType.Instantaneo, 12f, 0f, "Construcción: sube el terreno donde apuntas, como «Subir terreno» de la azada.", delegate(Player p, float pw) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) Vector3 pos = Fx.AimPoint(p, 8f); Temporary.TerrainOp(p, "raise_v2", pos, 0, Tr.Get("magia_terrain_raised")); Particulas.Tierra(pos, 0.8f, 0.5f); }); Add("lavar", "Lavar Alquitrán", Escuela.Agua, 1, SpellType.Instantaneo, 5f, 3f, "Quita el alquitrán y te deja mojado.", delegate(Player p, float pw) { ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("Tared"), false); Fx.AddSE((Character)(object)p, "Wet"); AguaVfx.Lavar(p); }); Add("barro_profundo", "Gran Pantano", Escuela.Agua, 1, SpellType.Instantaneo, 25f, 15f, "Pantano más grande y largo.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Swamp(p, Fx.AimPoint(p, 25f), 8f, 18f); }, destructive: false, Escuela.Tierra); Add("cortina_vapor", "Cortina de Vapor", Escuela.Fuego, 1, SpellType.Instantaneo, 15f, 30f, "Nube de vapor blanco de 12 m durante 20 s: dentro no te ven ni te oyen, y quien te perseguía pierde tu rastro.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) Smoke(p, ((Component)p).transform.position, 12f, 20f); }, destructive: false, Escuela.Agua); Add("electric", "Rayo en Cadena", Escuela.Agua, 2, SpellType.Instantaneo, 35f, 8f, "Mantén el clic: rayo continuo desde tu bastón hasta lo que apuntas (30 m) que salta a 4 enemigos cercanos, cada vez más débil; daña y paraliza (a los jefes solo los tambalea).", ElectricStep, destructive: false, Escuela.Viento); Add("tormenta_fuego", "Remolino de Fuego", Escuela.Fuego, 3, SpellType.Canalizado, 100f, 45f, "Remolino de fuego.", delegate(Player p, float pw) { //IL_0008: 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) Whirlwind(p, pw, Fx.AimPoint(p, 25f), D(pw, 0f, 0f, 0f, Base[3] * 0.2f), fire: true); }, destructive: false, Escuela.Viento); Add("lava", "Charco de Lava", Escuela.Fuego, 3, SpellType.Canalizado, 110f, 45f, "Charco de lava 15 s.", delegate(Player p, float pw) { //IL_0020: 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_002b: 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_0062: 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_0090: 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_00b0: 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) Vector3 pt = Fx.AimPoint(p, 25f); Fx.Crater(pt, 2f); FuegoVfx.Onda(pt, 4f, 0.5f); FuegoVfx.Llamas(pt, 3.5f, 15f, 200f, 0.8f); FuegoVfx.Humo(pt + Vector3.up * 0.5f, 1.5f, 0, 15f, 3f); FuegoVfx.Destello(pt, 12f, 3f, 15f, (Color?)new Color(1f, 0.3f, 0.05f)); SpellRunner.Repeat(1f, 15f, delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) FuegoVfx.Brasas(pt + Random.insideUnitSphere * 2.5f, 0.4f, 15, 0.5f); Fx.Visual("fx_fireball_staff_explosion", pt + Random.insideUnitSphere * 2f, 0.6f); Fx.DamageArea(p, pt, 4f, D(pw, 0f, 0f, 0f, Base[3] * 0.4f), Sk(Escuela.Fuego)); }); }, destructive: true, Escuela.Tierra); Add("ventisca", "Ventisca", Escuela.Agua, 3, SpellType.Canalizado, 85f, 60f, "Tormenta de nieve 60 s: congela y frena.", delegate(Player p, float pw) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) Weather.Force(p, "SnowStorm", 60f); AguaVfx.Ventisca(((Component)p).transform.position); ClimaInvocado(p, new Color(0.85f, 0.93f, 1f), Color.white); SpellRunner.Repeat(2f, 60f, delegate { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) foreach (Character item20 in Fx.EnemiesInRadius(p, ((Component)p).transform.position, 20f)) { Fx.Damage(p, item20, D(pw, 0f, 0f, 0f, 0f, Base[3] * 0.1f), Sk(Escuela.Agua)); Fx.AddSE(item20, "MT_Lento", 0.3f); } }); }, destructive: false, Escuela.Viento); Add("aura_sagrada", "Aura Sagrada", Escuela.Sanacion, 4, SpellType.Canalizado, 110f, 60f, "Escudo y curación por tiempo al grupo.", delegate(Player p, float pw) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) foreach (Player item21 in Fx.AlliesInRadius(p, ((Component)p).transform.position, 8f)) { Fx.AddSE((Character)(object)item21, "MT_EscudoMagico", 40f * pw); Fx.AddSE((Character)(object)item21, "MT_Regeneracion", 4f * pw); } }, destructive: false, Escuela.Barrera); Reclasificar(); Balance(); MarkCharge(); foreach (Spell item22 in All) { if (item22.Id == "relampago") { item22.Sustained = true; item22.SustainMax = 2.5f; item22.SustainCost = 0.15f; item22.SustainRamp = 2f; } } foreach (Spell item23 in All) { if (item23.Cooldown >= 10f && item23.Id != "renacer") { item23.Cooldown = Mathf.Round(item23.Cooldown * 0.6f); } } foreach (Spell item24 in All) { if (item24.Id == "electric") { item24.Sustained = true; item24.SustainTick = 0.12f; item24.SustainCost = 0.12f; item24.SustainPower = 0.3f; } } foreach (Spell item25 in All) { if (item25.Id == "pilar_tierra") { item25.Sustained = true; item25.SustainTick = 0.1f; item25.SustainCost = 0.08f; item25.Chargeable = false; } } } private static void Reclasificar() { foreach (Spell item in All) { if (Clasificacion.TryGetValue(item.Id, out var value)) { item.School = value.Main; item.School2 = value.Second; } item.Rol = (Defensivos.Contains(item.Id) ? Rol.Defensivo : (Apoyos.Contains(item.Id) ? Rol.Apoyo : (Utilidades.Contains(item.Id) ? Rol.Utilidad : Rol.Ofensivo))); } } private static void MarkCharge() { foreach (Spell item in All) { bool flag = item.School == Escuela.Sanacion || item.School == Escuela.Desintoxicacion || item.School == Escuela.Barrera || item.School == Escuela.Invocacion || item.Id.StartsWith("invocar") || item.Id.StartsWith("espiritus"); item.Chargeable = (item.Id == "sello" || !flag) && !NoCharge.Contains(item.Id); if (Radius.TryGetValue(item.Id, out var value)) { item.Radius = value.R; item.RadiusOnSelf = value.Self; } } } private static void Balance() { foreach (Spell item in All) { if (item.School != Escuela.Fuego) { bool flag = item.School == Escuela.Agua || item.School == Escuela.Viento || item.School == Escuela.Tierra || item.School == Escuela.Sangre; item.Mana = Mathf.Round(item.Mana * (flag ? 1.35f : 1.2f)); item.Cooldown *= (flag ? 1.25f : 1.1f); } } } private static IEnumerable Cone(Player p, float range, float minDot) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) Vector3 fwd = Fx.AimDir(p); fwd.y = 0f; ((Vector3)(ref fwd)).Normalize(); return Fx.EnemiesInRadius(p, ((Component)p).transform.position, range).Where(delegate(Character c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Vector3 val = fwd; Vector3 val2 = ((Component)c).transform.position - ((Component)p).transform.position; return Vector3.Dot(val, ((Vector3)(ref val2)).normalized) >= minDot; }); } private static IEnumerable Line(Player p, float range, float width) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //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_004c: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform : ((Component)p).transform); Vector3 origin = val.position; Vector3 dir = val.forward; return from x in (from c in Fx.EnemiesInRadius(p, ((Component)p).transform.position, range + 5f) select new { c = c, v = c.GetCenterPoint() - origin }).Where(x => { //IL_0001: 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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (Vector3.Dot(x.v, dir) > 0f) { Vector3 val2 = Vector3.Cross(dir, x.v); return ((Vector3)(ref val2)).magnitude <= width; } return false; }).OrderBy(x => { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) Vector3 v = x.v; return ((Vector3)(ref v)).magnitude; }) select x.c; } private static void PilarStep(Player p, float pw) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) if (Caster.SustainStarted || (Object)(object)_pilar == (Object)null) { _pilarStart = ((Component)p).transform.position; if (!PrivateArea.CheckAccess(_pilarStart, 3f, true, false)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_can_t_raise_ground_here"), 0, (Sprite)null, false); Caster.StopSustain(); return; } _pilar = NewPillar(_pilarStart); ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode("MT_CaidaTierra"), false); ((Character)p).GetSEMan().AddStatusEffect(StringExtensionMethods.GetStableHashCode("MT_CaidaTierra"), true, 0, 0f, (short)(-1)); Particulas.Tierra(_pilarStart, 1.2f, 1.5f); } float num = ((Component)p).transform.position.y - _pilarStart.y; if (num >= 80f) { Caster.StopSustain(); return; } float num2 = Mathf.Max(0.3f, num - 0.05f); _pilar.localScale = new Vector3(2.6f, num2 + 2f, 2.6f); _pilar.position = new Vector3(_pilarStart.x, _pilarStart.y + (num2 - 2f) / 2f, _pilarStart.z); MeshRenderer component = ((Component)_pilar).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).sharedMaterial != (Object)null) { ((Renderer)component).sharedMaterial.mainTextureScale = new Vector2(1f, (num2 + 2f) / 2.6f); } if (Time.time >= _pilarPolvo) { _pilarPolvo = Time.time + 0.3f; Particulas.Tierra(_pilarStart + Random.insideUnitSphere * 0.6f, 1f, 0.5f); } ((Character)p).ForceJump(Vector3.up * 4.5f, false); } private static Mesh RockColumnMesh() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_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_01fc: Expected O, but got Unknown //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_027b: 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) if ((Object)(object)_rockColumn != (Object)null) { return _rockColumn; } Random random = new Random(7); List list = new List(); List list2 = new List(); for (int i = 0; i <= 5; i++) { float num = -0.5f + (float)i / 5f; float num2 = Mathf.Lerp(0.56f, 0.46f, (float)i / 5f); for (int j = 0; j < 9; j++) { float num3 = (float)j / 9f * (float)Math.PI * 2f; float num4 = num2 * (0.85f + 0.3f * (float)random.NextDouble()); list.Add(new Vector3(Mathf.Cos(num3) * num4, num, Mathf.Sin(num3) * num4)); } } for (int k = 0; k < 5; k++) { for (int l = 0; l < 9; l++) { int num5 = k * 9 + l; int num6 = k * 9 + (l + 1) % 9; int num7 = num5 + 9; int num8 = num6 + 9; list2.AddRange(new int[6] { num5, num7, num6, num6, num7, num8 }); } } int num9 = 45; int count = list.Count; list.Add(new Vector3(0f, 0.5f, 0f)); for (int m = 0; m < 9; m++) { list2.AddRange(new int[3] { num9 + m, count, num9 + (m + 1) % 9 }); } int count2 = list.Count; list.Add(new Vector3(0f, -0.5f, 0f)); for (int n = 0; n < 9; n++) { list2.AddRange(new int[3] { n, (n + 1) % 9, count2 }); } _rockColumn = new Mesh { name = "MT_ColumnaRoca" }; _rockColumn.SetVertices(list); _rockColumn.SetTriangles(list2, 0); _rockColumn.RecalculateNormals(); _rockColumn.RecalculateBounds(); Vector2[] array = (Vector2[])(object)new Vector2[list.Count]; for (int num10 = 0; num10 < list.Count; num10++) { array[num10] = new Vector2(Mathf.Atan2(list[num10].z, list[num10].x) / ((float)Math.PI * 2f) + 0.5f, list[num10].y + 0.5f); } _rockColumn.uv = array; return _rockColumn; } public static Transform RockColumn(Vector3 at, float width, float height, bool pointed = false) { //IL_0000: 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_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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: 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_005a: 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) float num = GroundY(at); Transform val = NewPillar(new Vector3(at.x, num, at.z)); if ((Object)(object)val == (Object)null) { return null; } val.localScale = new Vector3(width, height + 1f, width); val.position = new Vector3(at.x, num + (height - 1f) / 2f, at.z); if (pointed) { MeshFilter component = ((Component)val).GetComponent(); component.sharedMesh = SpikeMesh(); MeshCollider component2 = ((Component)val).GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.sharedMesh = component.sharedMesh; } RocaMagia.MarcarPunta(((Component)val).gameObject); } MeshRenderer component3 = ((Component)val).GetComponent(); if ((Object)(object)component3 != (Object)null && (Object)(object)((Renderer)component3).sharedMaterial != (Object)null) { ((Renderer)component3).sharedMaterial.mainTextureScale = new Vector2(1f, (height + 1f) / Mathf.Max(0.3f, width)); } return val; } private static Mesh SpikeMesh() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Expected O, but got Unknown if ((Object)(object)_spike != (Object)null) { return _spike; } Mesh val = RockColumnMesh(); Vector3[] vertices = val.vertices; for (int i = 0; i < vertices.Length; i++) { float num = Mathf.Clamp01(1f - (vertices[i].y + 0.5f)); vertices[i] = new Vector3(vertices[i].x * Mathf.Lerp(0.05f, 1f, num), vertices[i].y, vertices[i].z * Mathf.Lerp(0.05f, 1f, num)); } _spike = new Mesh { name = "MT_PuaRoca" }; _spike.vertices = vertices; _spike.triangles = val.triangles; _spike.uv = val.uv; _spike.RecalculateNormals(); _spike.RecalculateBounds(); return _spike; } private static float GroundY(Vector3 at) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0070: Unknown result type (might be due to invalid IL or missing references) int mask = LayerMask.GetMask(new string[4] { "Default", "static_solid", "terrain", "piece" }); RaycastHit val = default(RaycastHit); if (Physics.Raycast(at + Vector3.up * 6f, Vector3.down, ref val, 30f, mask, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point.y; } if (!((Object)(object)ZoneSystem.instance != (Object)null)) { return at.y; } return ZoneSystem.instance.GetGroundHeight(at); } private static void StoneWall(Vector3 at, Quaternion rot, int pisos, bool relleno = true, float? baseFija = null) { //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_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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b7: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: 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) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: 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_0209: 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_021a: 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_0227: Unknown result type (might be due to invalid IL or missing references) Vector3 val = rot * Vector3.right; float num = float.MinValue; float num2 = float.MaxValue; for (int i = -2; i <= 2; i++) { float num3 = GroundY(at + val * ((float)i * 4f / 4f)); num = Mathf.Max(num, num3); num2 = Mathf.Min(num2, num3); } float num4 = baseFija ?? (relleno ? (num - 0.1f) : (num2 - 0.2f)); Temporary.Spawn("stone_wall_4x2", new Vector3(at.x, num4, at.z), rot, 0f); MuroEmerge.Subir(new Vector3(at.x, num4, at.z), sonido: true); for (int j = 1; j < pisos; j++) { Temporary.Spawn("stone_wall_4x2", new Vector3(at.x, num4 + 2f * (float)j, at.z), rot, 0f); MuroEmerge.Subir(new Vector3(at.x, num4 + 2f * (float)j, at.z), sonido: false); Particulas.Tierra(new Vector3(at.x, num4 + 2f * (float)j, at.z), 2f, 0.7f); } Particulas.Tierra(at - val * 1.8f, 1.2f); Particulas.Tierra(at + val * 1.8f, 1.2f); FuegoVfx.Onda(new Vector3(at.x, GroundY(at), at.z), 2.6f, 0.45f, (Color?)new Color(0.55f, 0.45f, 0.32f), (Color?)new Color(0.35f, 0.28f, 0.2f)); for (int k = 0; k < 4 && relleno; k++) { if (!(num4 - num2 > 0.15f)) { break; } num4 -= 2f; Temporary.Spawn("stone_wall_4x2", new Vector3(at.x, num4, at.z), rot, 0f); MuroEmerge.Subir(new Vector3(at.x, num4, at.z), sonido: false); } Fx.Visual("vfx_RockDestroyed", at); } private static void OndaTerremoto(Vector3 c, float r) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) FuegoVfx.Onda(new Vector3(c.x, GroundY(c) + 0.1f, c.z), r, 0.5f, (Color?)new Color(0.55f, 0.45f, 0.32f), (Color?)new Color(0.32f, 0.25f, 0.18f)); for (int i = 0; i < 6; i++) { float num = (float)i * 60f * ((float)Math.PI / 180f) + r; Vector3 val = c + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * r; Particulas.Tierra(new Vector3(val.x, GroundY(val), val.z), 0.8f, 0.5f); } Fx.Visual("sfx_rock_destroyed", c); } private static void PresionVisual(Vector3 c, float radius) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) Particulas.Spawn(c + Vector3.up * 6f, new Particulas.Config { ColorA = new Color(0.6f, 0.3f, 1f), ColorB = new Color(0.35f, 0.1f, 0.7f), LifeMin = 0.5f, LifeMax = 0.8f, SpeedMin = 0f, SpeedMax = 0.5f, SizeMin = 0.2f, SizeMax = 0.45f, Radius = radius, Rate = 500f, Duration = 0.8f, Gravity = 6f, Max = 2000 }); Particulas.Spawn(c + Vector3.up * 0.2f, new Particulas.Config { ColorA = new Color(0.45f, 0.2f, 0.8f, 0.8f), ColorB = new Color(0.3f, 0.25f, 0.35f, 0.6f), LifeMin = 1f, LifeMax = 1.6f, SpeedMin = radius * 1.2f, SpeedMax = radius * 1.5f, SizeMin = 1f, SizeMax = 2f, Radius = 0.3f, Hemisphere = true, Burst = 160, Additive = false, Grow = 1.6f }); Fx.Visual("vfx_RockDestroyed", c, 1.5f); } public static Material RockMaterial() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) string[] pilarRocas = PilarRocas; for (int i = 0; i < pilarRocas.Length; i++) { GameObject obj = Fx.Prefab(pilarRocas[i]); object obj2; if (obj == null) { obj2 = null; } else { MeshRenderer componentInChildren = obj.GetComponentInChildren(true); obj2 = ((componentInChildren != null) ? ((Renderer)componentInChildren).sharedMaterial : null); } Material val = (Material)obj2; if ((Object)(object)val != (Object)null) { return new Material(val); } } GameObject obj3 = Fx.Prefab("Club"); object obj4; if (obj3 == null) { obj4 = null; } else { MeshRenderer componentInChildren2 = obj3.GetComponentInChildren(true); obj4 = ((componentInChildren2 != null) ? ((Renderer)componentInChildren2).sharedMaterial : null); } Material val2 = (Material)obj4; Material val3 = (((Object)(object)val2 != (Object)null) ? new Material(val2) : new Material(Shader.Find("Standard"))); if (val3.HasProperty("_Color")) { val3.SetColor("_Color", new Color(0.42f, 0.36f, 0.3f)); } return val3; } private static Transform NewPillar(Vector3 at) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0036: 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) GameObject obj = RocaMagia.Crear(at); obj.transform.position = at; obj.transform.localScale = new Vector3(2.6f, 0.3f, 2.6f); Fx.Visual("vfx_RockDestroyed", at, 0.8f); Fx.Visual("sfx_rock_destroyed", at); return obj.transform; } public static void VestirRoca(GameObject go, bool punta) { //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) MeshFilter component = go.GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.sharedMesh != (Object)null && ((Object)component.sharedMesh).name.StartsWith("MT_")) { return; } Renderer[] components = go.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } MeshFilter[] components2 = go.GetComponents(); for (int i = 0; i < components2.Length; i++) { Object.DestroyImmediate((Object)(object)components2[i]); } Collider[] components3 = go.GetComponents(); for (int i = 0; i < components3.Length; i++) { Object.DestroyImmediate((Object)(object)components3[i]); } Mesh sharedMesh = (punta ? SpikeMesh() : RockColumnMesh()); go.AddComponent().sharedMesh = sharedMesh; go.AddComponent(); MeshCollider obj = go.AddComponent(); obj.sharedMesh = sharedMesh; obj.convex = true; int num = LayerMask.NameToLayer("static_solid"); if (num >= 0) { go.layer = num; } Material val = null; string[] pilarRocas = PilarRocas; for (int i = 0; i < pilarRocas.Length; i++) { GameObject obj2 = Fx.Prefab(pilarRocas[i]); object obj3; if (obj2 == null) { obj3 = null; } else { MeshRenderer componentInChildren = obj2.GetComponentInChildren(true); obj3 = ((componentInChildren != null) ? ((Renderer)componentInChildren).sharedMaterial : null); } val = (Material)obj3; if ((Object)(object)val != (Object)null) { break; } } Material val2; if ((Object)(object)val != (Object)null) { val2 = new Material(val); } else { GameObject obj4 = Fx.Prefab("Club"); object obj5; if (obj4 == null) { obj5 = null; } else { MeshRenderer componentInChildren2 = obj4.GetComponentInChildren(true); obj5 = ((componentInChildren2 != null) ? ((Renderer)componentInChildren2).sharedMaterial : null); } Material val3 = (Material)obj5; val2 = (((Object)(object)val3 != (Object)null) ? new Material(val3) : new Material(Shader.Find("Standard"))); if (val2.HasProperty("_MainTex")) { val2.SetTexture("_MainTex", (Texture)(object)Texture2D.whiteTexture); } if (val2.HasProperty("_BumpMap")) { val2.SetTexture("_BumpMap", (Texture)null); } if (val2.HasProperty("_Color")) { val2.SetColor("_Color", new Color(0.42f, 0.36f, 0.3f)); } } ((Renderer)go.GetComponent()).sharedMaterial = val2; } public static void EscalarRoca(Transform t, Vector3 escala) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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) t.localScale = escala; MeshRenderer component = ((Component)t).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)((Renderer)component).sharedMaterial != (Object)null) { ((Renderer)component).sharedMaterial.mainTextureScale = new Vector2(1f, escala.y / Mathf.Max(0.3f, escala.x)); } } private static void ElectricStep(Player p, float pw) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031a: 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) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Fx.StaffTip(p); Vector3 dir = Fx.AimPoint(p, 60f) - val; dir = ((((Vector3)(ref dir)).sqrMagnitude > 0.01f) ? ((Vector3)(ref dir)).normalized : ((Component)p).transform.forward); if (Caster.SustainStarted) { _electricStart = Time.time; } Vector3 val2 = Rayo.Beam(p, val, dir, 30f, Rayo.Azul, 0f, 0f, 0f); float num = Mathf.Clamp01((Time.time - _electricStart) * 22f / Mathf.Max(0.5f, Vector3.Distance(val, val2))); Vector3 val3 = Rayo.Beam(p, val, dir, 30f, Rayo.Azul, 0.15f, 0.1f, num); if (Caster.SustainStarted) { _electricTick = 0; Fx.Visual("sfx_staff_lightning_fire", val); Fx.Visual("fx_chainlightning_spread", val, 0.6f); } _electricTick++; if (Random.value < 0.5f) { Rayo.Sparks(val, Rayo.Azul, 1, 0.3f); } if (num < 1f) { return; } if (_electricTick % 4 == 1) { Fx.Visual("sfx_weapons_lightning_impact", val3); } bool flag = Caster.SustainStarted || Time.time >= _paralisisNext; HashSet hashSet = new HashSet(Fx.EnemiesInRadius(p, val3, 1.5f)); foreach (Character item in hashSet) { Fx.Damage(p, item, D(pw, 0f, 0f, 0f, 0f, 0f, Base[2] * 0.5f), Sk(Escuela.Viento), 0f, 0.5f); if (flag) { Fx.AddSE(item, "MT_Paralisis"); } } if (flag) { _paralisisNext = Time.time + 2f; } Fx.DamageObjects(p, val3, 1.2f, D(pw, 0f, 0f, 0f, 0f, 0f, Base[2] * 0.5f)); if (Random.value < 0.4f) { Rayo.Sparks(val3, Rayo.Azul, 2, 0.5f); } Vector3 val4 = val3; float num2 = 0.35f; float num3 = 0f; for (int i = 0; i < 4; i++) { Character val5 = null; float num4 = 8f; foreach (Character item2 in Fx.EnemiesInRadius(p, val4, 8f)) { if (!hashSet.Contains(item2)) { float num5 = Vector3.Distance(val4, item2.GetCenterPoint()); if (num5 < num4) { num4 = num5; val5 = item2; } } } if ((Object)(object)val5 == (Object)null) { break; } hashSet.Add(val5); Vector3 a = val4; Vector3 b = val5.GetCenterPoint(); Character target = val5; float m = num2; float width = 0.2f - 0.03f * (float)i; bool showHit = _electricTick % 3 == 0; float travel = Vector3.Distance(a, b) / 22f; SpellRunner.After(num3, delegate { //IL_0001: 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_000c: Unknown result type (might be due to invalid IL or missing references) Arco.Spawn(a, b, Rayo.Azul, width, travel + 0.18f, travel); }); num3 += travel; SpellRunner.After(num3, delegate { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null) && !target.IsDead()) { Fx.Damage(p, target, D(pw, 0f, 0f, 0f, 0f, 0f, Base[2] * m), Sk(Escuela.Viento), 0f, 0.5f); if (showHit) { Fx.Visual("fx_chainlightning_hit", b, 0.6f); } } }); val4 = b; num2 *= 0.75f; } } private static void Strike(Player p, Vector3 point, float radius, DamageTypes damage) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_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_008c: 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) Fx.Visual("fx_Lightning", point); Rayo.Bolt(point + Vector3.up * 30f, point, Rayo.Azul, 1.6f); Fx.Visual("fx_chainlightning_hit", point); FuegoVfx.Destello(point, 30f, 7f, 0.35f, (Color?)new Color(0.6f, 0.75f, 1f)); Rayo.Sparks(point, Rayo.Azul, 8, 1.4f); Fx.DamageArea(p, point, radius, damage, Sk(Escuela.Viento), 0f, 2f); } private static void ClimaInvocado(Player p, Color a, Color b) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_0041: 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) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_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_00da: Unknown result type (might be due to invalid IL or missing references) Vector3 pos = ((Component)p).transform.position; FuegoVfx.Onda(pos, 10f, 0.9f, a, b); SpellRunner.After(0.3f, delegate { //IL_0001: 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) FuegoVfx.Onda(pos, 6f, 0.7f, b, a); }); FuegoVfx.Destello(pos, 18f, 3f, 1f, a); Vfx.Wind(pos + Vector3.up * 0.5f, Vector3.up, 20f, 30f, new Color(b.r, b.g, b.b, 0.6f)); } private static Vector3 SueloAlAzar(Player p, float min, float max) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //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) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * Random.Range(min, max); Vector3 val2 = ((Component)p).transform.position + new Vector3(val.x, 0f, val.y); val2.y = GroundY(val2); return val2; } private static void StrikeRandom(Player p, float radius, DamageTypes damage) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) List list = Fx.EnemiesInRadius(p, ((Component)p).transform.position, radius); Vector3 point = ((list.Count > 0) ? ((Component)list[Random.Range(0, list.Count)]).transform.position : SueloAlAzar(p, 6f, radius)); Strike(p, point, 2f, damage); } private static void Swamp(Player p, Vector3 center, float radius, float duration) { //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) SpellRunner.Repeat(1f, duration, delegate { //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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_006f: Unknown result type (might be due to invalid IL or missing references) Fx.Visual("fx_blobtar_tarball_hit", center + Random.insideUnitSphere * radius * 0.6f); Particulas.Tierra(center + Random.insideUnitSphere * radius * 0.6f, 0.8f, 0.4f); foreach (Character item in Fx.EnemiesInRadius(p, center, radius)) { Fx.AddSE(item, "Tared"); Fx.AddSE(item, "MT_Lento", 0.6f); } }); } private static void Smoke(Player p, Vector3 center, float radius, float duration) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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) Particulas.Spawn(center + Vector3.up * 1.2f, new Particulas.Config { ColorA = new Color(1f, 1f, 1f, 0.75f), ColorB = new Color(0.9f, 0.93f, 0.96f, 0.6f), LifeMin = 3f, LifeMax = 5f, SpeedMin = 0.05f, SpeedMax = 0.4f, SizeMin = 2.5f, SizeMax = 4.5f, Radius = radius, Hemisphere = true, Additive = false, Burst = (int)(radius * 12f), Rate = radius * 14f, Duration = duration, FadeIn = 0.25f, Grow = 1.4f, Gravity = -0.01f, Max = 2500 }); Fx.Visual("vfx_steam", center); Humo.Add(center, radius, duration); SpellRunner.Repeat(0.5f, duration, delegate { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)p == (Object)null || !Humo.Inside(((Component)p).transform.position)) { return; } foreach (Character item in Fx.EnemiesInRadius(p, center, radius + 25f)) { MonsterAI component = ((Component)item).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)Traverse.Create((object)component).Field("m_targetCreature").GetValue() != (Object)(object)p)) { Traverse.Create((object)component).Field("m_targetCreature").SetValue((object)null); Traverse.Create((object)component).Method("SetAlerted", new object[1] { false }).GetValue(); } } }); } private static void Whirlwind(Player p, float power, Vector3 start, DamageTypes tick, bool fire = false) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Vector3 dir = ((Component)p).transform.forward; float t0 = Time.time; SpellRunner.Repeat(0.5f, 8f, delegate { //IL_0001: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_005f: 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_00d4: 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_008e: 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_009e: 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_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown Vector3 val = start + dir * ((Time.time - t0) * 1.5f); Fx.Visual(fire ? "fx_fireball_staff_explosion" : "vfx_SawDust", val, fire ? 0.5f : 1.5f); if (fire) { FuegoVfx.Columna(val, 1.1f, 6f, 0.5f); FuegoVfx.Brasas(val, 1f, 20, 0.8f); } if (!fire) { Vfx.Wind(val, Vector3.up, 9f, 35f, VientoLineas); Vfx.Leaves(val + Vector3.up * 0.5f, Vector3.up, 4f, 12); } Fx.DamageStructures(p, val, 4f, (tick.m_blunt + tick.m_fire) * 2f); foreach (Character item in Fx.EnemiesInRadius(p, val, 4f)) { HitData val2 = new HitData { m_damage = tick, m_point = item.GetCenterPoint() }; Vector3 val3 = val - ((Component)item).transform.position; val2.m_dir = ((Vector3)(ref val3)).normalized; val2.m_skill = Sk(Escuela.Viento); val2.m_pushForce = 40f; val2.m_staggerMultiplier = 1.5f; HitData val4 = val2; val4.SetAttacker((Character)(object)p); item.Damage(val4); } }); } private static void Heal(Character c, float amount) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) c.Heal(amount, true); Vfx.Heal(c, Vfx.Verde, destellos: true, (amount >= 60f) ? 2.5f : 1.5f); Vfx.HealHand(Player.m_localPlayer); AuraCurativa.Start(c, Player.m_localPlayer); } public static string DamagePreview(Player p, Spell s, float charge = 1f, bool sustaining = false) { string arg = Tr.Get("magia_per_hit"); float num = Fx.ConcentrationMultiplier(p, Escuela.Fuego, charge); float num2; switch (s.Id) { case "bola_fuego": num2 = 3f + Base[0] * 0.7f * num; arg = Tr.Get("magia_per_projectile"); break; case "lluvia_brasas": num2 = 5f + Base[2] * num; arg = Tr.Get("magia_per_projectile_3"); break; case "pilar_fuego": num2 = Base[3]; break; case "explosion": num2 = Base[4] * 1.2f; break; case "infierno": num2 = Base[5] * 0.25f; arg = Tr.Get("magia_every_1_s_15_s"); break; case "sol_negro": num2 = Base[6] * 2f; break; case "bala_agua": num2 = Base[0] * 0.85f; arg = Tr.Get("magia_per_projectile"); break; case "cascada": num2 = Base[1]; arg = Tr.Get("magia_cone_shards"); break; case "lanza_hielo": num2 = Base[2] * 1.5f; arg = Tr.Get("magia_per_projectile"); break; case "cumulonimbus": num2 = Base[3] * 1.2f; arg = Tr.Get("magia_per_bolt_2_wet"); break; case "nova_hielo": num2 = Base[4]; break; case "cero_absoluto": num2 = Base[6]; break; case "rafaga": num2 = Base[0] * 0.3f; break; case "hoja_viento": num2 = Base[1]; break; case "atraer": return Tr.Get("magia_estimated_damage") + ": 1 · " + Tr.Get("magia_per_hit"); case "presion_gravitatoria": num2 = Base[3] * 0.8f; break; case "tornado": num2 = Base[3] * 0.1f; arg = Tr.Get("magia_every_0_5_s_8"); break; case "relampago": num2 = Base[4] * Fx.ConcentrationMultiplier(p, Escuela.Viento, charge); break; case "tormenta_electrica": num2 = Base[5] * 0.6f; arg = Tr.Get("magia_per_bolt_8"); break; case "huracan": num2 = Base[6] * 0.1f; arg = Tr.Get("magia_every_1_s_20_s"); break; case "bala_piedra": num2 = Base[2] * 1.5f; arg = Tr.Get("magia_per_projectile"); break; case "lanzas_tierra": num2 = Base[3]; break; case "canon_piedra": num2 = Base[4] * 1.5f; arg = Tr.Get("magia_projectile_area"); break; case "terremoto": num2 = Base[6]; break; case "drenar": num2 = Base[0]; break; case "hemorragia": num2 = Base[5]; arg = Tr.Get("magia_total_poison"); break; case "electric": num2 = Base[2] * 0.5f; break; case "tormenta_fuego": num2 = Base[3] * 0.2f; arg = Tr.Get("magia_every_0_5_s_8"); break; case "lava": num2 = Base[3] * 0.4f; arg = Tr.Get("magia_every_1_s_15_s"); break; case "ventisca": num2 = Base[3] * 0.1f; arg = Tr.Get("magia_every_2_s_60_s"); break; case "barrera_reflectante": return Tr.Get("magia_reflected_damage_30_projectile"); default: return null; } float num3 = Caster.Power(p, s) * Caster.PowerOfCharge(charge); if (sustaining && s.Sustained) { num3 = Caster.Power(p, s) * s.SustainPower; arg = Tr.Get("magia_every") + $" {s.SustainTick:0.##} s"; } return Tr.Get("magia_estimated_damage") + $": {num2 * num3:0.#} · {arg}"; } } internal static class SpellSearch { internal static bool Matches(Spell s, string query) { string haystack = s.Name + " " + s.Description + " " + Escuelas.Name(s.School) + " " + (s.School2.HasValue ? Escuelas.Name(s.School2.Value) : "") + " " + Spell.RolName(s.Rol) + " " + Escuelas.RankNames[s.Rank]; return (query ?? "").Split(new char[4] { ' ', '\t', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries).All((string word) => CultureInfo.InvariantCulture.CompareInfo.IndexOf(haystack, word, CompareOptions.IgnoreCase | CompareOptions.IgnoreNonSpace) >= 0); } } public static class StoneBullet { public const string PrefabName = "MT_BalaPiedra"; internal static readonly int HeatKey = StringExtensionMethods.GetStableHashCode("MT_StoneHeat"); private static Mesh _mesh; private static Material[] _materials; public static void Register() { //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown PrefabManager.OnVanillaPrefabsAvailable -= Register; string text = Path.Combine(MTMagiaPlugin.ModelDir, "bala_piedra_cono.obj"); _mesh = ObjModel.Load(text, out var materialNames); if ((Object)(object)_mesh == (Object)null) { MTMagiaPlugin.Log.LogError((object)("Falta el modelo: " + text)); return; } GameObject prefab = PrefabManager.Instance.GetPrefab("troll_throw_projectile"); if (!((Object)(object)prefab == (Object)null)) { MeshRenderer componentInChildren = prefab.GetComponentInChildren(true); Material template = ((componentInChildren != null) ? ((Renderer)componentInChildren).sharedMaterial : null); _materials = ObjModel.Materials(materialNames, template, Path.ChangeExtension(text, ".mtl")); Material[] materials = _materials; for (int i = 0; i < materials.Length; i++) { materials[i].EnableKeyword("_EMISSION"); } GameObject val = PrefabManager.Instance.CreateClonedPrefab("MT_BalaPiedra", prefab); Renderer[] componentsInChildren = val.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Projectile component = val.GetComponent(); component.m_gravity = 0f; component.m_rotateVisual = 0f; component.m_rotateVisualY = 0f; component.m_rotateVisualZ = 0f; component.m_rayRadius = 0.15f; component.m_aoe = 0f; component.m_ttl = 8f; component.m_spawnOnHit = null; component.m_visual = ((Component)AddVisual(val.transform)).gameObject; PrefabManager.Instance.AddPrefab(new CustomPrefab(val, false)); } } public static StoneBulletVisual AddVisual(Transform parent = null) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0036: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_mesh == (Object)null) { return null; } GameObject val = new GameObject("MT_ConoPiedra"); val.transform.SetParent(parent, false); val.AddComponent().sharedMesh = _mesh; ((Renderer)val.AddComponent()).sharedMaterials = _materials; return val.AddComponent(); } public static Vector3 Origin(Player p) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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_0193: 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_019b: 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_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)p).transform.position + Vector3.up * MTMagiaPlugin.CargaVistaAltura.Value; Vector3 val2 = Vector3.ProjectOnPlane(((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform.forward : ((Component)p).transform.forward, Vector3.up); Vector3 val3 = ((((Vector3)(ref val2)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val2)).normalized : ((Component)p).transform.forward); Vector3 val4 = Vector3.Cross(Vector3.up, val3); float num = MTMagiaPlugin.CargaVistaLado.Value; int mask = LayerMask.GetMask(new string[6] { "Default", "static_solid", "Default_small", "piece", "terrain", "vehicle" }); RaycastHit val5 = default(RaycastHit); if (Physics.Raycast(val, val4, ref val5, num + 0.2f, mask, (QueryTriggerInteraction)1)) { num = Mathf.Max(0f, ((RaycastHit)(ref val5)).distance - 0.3f); } val += val4 * num; float value = MTMagiaPlugin.CargaVistaDistancia.Value; int mask2 = LayerMask.GetMask(new string[6] { "Default", "static_solid", "Default_small", "piece", "terrain", "vehicle" }); RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(val, val3, ref val6, value + 0.2f, mask2, (QueryTriggerInteraction)1)) { return val + val3 * Mathf.Max(0f, ((RaycastHit)(ref val6)).distance - 0.3f); } return val + val3 * value; } } public class StoneBulletVisual : MonoBehaviour { public float Heat; private Renderer _renderer; private MaterialPropertyBlock _properties; private ZNetView _view; private readonly LineRenderer[] _espirales = (LineRenderer[])(object)new LineRenderer[3]; private Material _matEspiral; private void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_009c: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: 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_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_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Expected O, but got Unknown _renderer = ((Component)this).GetComponent(); _properties = new MaterialPropertyBlock(); _view = ((Component)this).GetComponentInParent(); foreach (Transform item in ((Component)this).transform) { Transform val = item; if (((Object)val).name.StartsWith("MT_EspiralPiedra_")) { Object.Destroy((Object)(object)((Component)val).gameObject); } } if (!MTMagiaPlugin.EfectosPropios.Value) { return; } _matEspiral = Vfx.NewMaterial(Texture2D.whiteTexture, (Color?)new Color(1f, 1f, 1f, 0f)); for (int i = 0; i < _espirales.Length; i++) { GameObject val2 = new GameObject("MT_EspiralPiedra_" + i); val2.transform.SetParent(((Component)this).transform, false); LineRenderer val3 = val2.AddComponent(); ((Renderer)val3).sharedMaterial = _matEspiral; val3.useWorldSpace = false; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val3).receiveShadows = false; ((Renderer)val3).enabled = false; val3.widthMultiplier = 0f; val3.positionCount = 24; for (int j = 0; j < 24; j++) { float num = (float)j / 23f; float num2 = (float)i * (float)Math.PI * 2f / (float)_espirales.Length + num * (float)Math.PI * 1.2f; float num3 = Mathf.Lerp(0.42f, 0.18f, num); val3.SetPosition(j, new Vector3(Mathf.Cos(num2) * num3, Mathf.Sin(num2) * num3, Mathf.Lerp(-0.7f, 0.25f, num))); } val3.widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.01f), new Keyframe(0.5f, 0.05f), new Keyframe(1f, 0.005f) }); _espirales[i] = val3; } } private void OnDestroy() { if ((Object)(object)_matEspiral != (Object)null) { Object.Destroy((Object)(object)_matEspiral); } } private void Update() { //IL_0099: 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: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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) if ((Object)(object)_view != (Object)null && _view.IsValid()) { Heat = _view.GetZDO().GetFloat(StoneBullet.HeatKey, 0f); } if ((Object)(object)((Component)this).transform.parent != (Object)null) { ((Component)this).transform.Rotate(0f, 0f, Mathf.Lerp(100f, 1800f, Heat) * Time.deltaTime, (Space)1); } _properties.SetColor("_Color", Color.Lerp(new Color(0.36f, 0.33f, 0.29f), new Color(1f, 0.07f, 0.015f), Heat)); _properties.SetColor("_EmissionColor", new Color(1f, 0.035f, 0.005f) * Heat * 3f); _renderer.SetPropertyBlock(_properties); if (!((Object)(object)_matEspiral != (Object)null)) { return; } Color val = Color.Lerp(new Color(0.85f, 0.78f, 0.65f), new Color(1f, 0.35f, 0.08f), Heat); float num = Mathf.InverseLerp(0.02f, 0.4f, Heat); float num2 = 1f - (1f - num) * (1f - num); float num3 = Mathf.Lerp(0.55f, 0.95f, Heat); val.a = num3 * num2 * (0.85f + 0.15f * Mathf.Sin(Time.time * 20f)); _matEspiral.color = val; if (_matEspiral.HasProperty("_TintColor")) { _matEspiral.SetColor("_TintColor", val * 0.5f); } float widthMultiplier = Mathf.Lerp(0.6f, 1.4f, Heat) * num2; float num4 = Mathf.Lerp(0.85f, 1.2f, Heat); LineRenderer[] espirales = _espirales; foreach (LineRenderer val2 in espirales) { if (!((Object)(object)val2 == (Object)null)) { ((Renderer)val2).enabled = num2 > 0.01f; val2.widthMultiplier = widthMultiplier; ((Component)val2).transform.localScale = new Vector3(num4, num4, 1f); } } } } [HarmonyPatch(typeof(Projectile), "OnHit")] public static class StoneBulletHitPatch { private static void Postfix(Projectile __instance, Vector3 hitPoint) { //IL_004a: 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 (!((Object)(object)__instance == (Object)null) && ((Object)__instance).name.StartsWith("MT_BalaPiedra")) { ZNetView component = ((Component)__instance).GetComponent(); ZDO val = ((component != null) ? component.GetZDO() : null); float num = ((val != null) ? val.GetFloat(StoneBullet.HeatKey, 0f) : 0f); Particulas.Tierra(hitPoint, 0.6f + 0.4f * num, 0.9f + 0.6f * num); if (num > 0.8f) { Fx.Visual("vfx_FireballHit", hitPoint, 0.35f); } } } } public static class SuenoReparador { private const string DiaKey = "MT.Magia.SuenoReparador.Dia"; private const float Costo = 60f; private static int Hoy { get { if (!((Object)(object)EnvMan.instance != (Object)null)) { return 0; } return EnvMan.instance.GetDay(); } } public static float Factor(Player p) { if (Escuelas.Rank(p, Escuela.Sanacion) < 6) { if (Escuelas.Rank(p, Escuela.Sanacion) < 5) { if (Escuelas.Rank(p, Escuela.Sanacion) < 4) { if (Escuelas.Rank(p, Escuela.Sanacion) < 3) { return 0.5f; } return 0.6f; } return 0.7f; } return 0.8f; } return 0.9f; } public static bool UsadoHoy(Player p) { if (p.m_customData.TryGetValue("MT.Magia.SuenoReparador.Dia", out var value)) { return value == Mundo.Dia(Hoy); } return false; } public static void Lanzar(Player p) { if (!((Object)(object)p == (Object)null)) { if (Esfuerzo.EnCombate) { ((Character)p).AddEitr(60f); ((Character)p).Message((MessageType)2, Tr.Get("magia_sleep_spell_in_combat"), 0, (Sprite)null, false); } else if (UsadoHoy(p)) { ((Character)p).AddEitr(60f); ((Character)p).Message((MessageType)2, Tr.Get("magia_sleep_spell_cooldown"), 0, (Sprite)null, false); } else { p.m_customData["MT.Magia.SuenoReparador.Dia"] = Mundo.Dia(Hoy); DescansoNocturno.Consolidar(p, Factor(p), false, Tr.Get("magia_sleep_spell_used")); Cronica.AnotarUnaVez(p, "sueno_reparador", "cronica_sleep_spell_first", Array.Empty()); } } } } public static class TiendaMagia { internal class Oferta { public string Item; public string Clave; public int Precio; public int Stack; public float Prob; public bool UnoAlDia; } private const string Key = "MT.Magia.TiendaCompras"; private static Oferta O(string item, int precio, float prob, string clave = "", int stack = 1, bool unoAlDia = true) { return new Oferta { Item = item, Precio = precio, Prob = prob, Clave = clave, Stack = stack, UnoAlDia = unoAlDia }; } internal static List Ofertas() { return new List { O("MT_PergaminoMagiaRara", MTMagiaPlugin.PrecioPergamino.Value, 0.6f), O("MT_PergaminoCuracion", 90, 0.7f, "", 3, unoAlDia: false), O("MT_PergaminoDesintoxicacion", 75, 0.5f, "", 3, unoAlDia: false), O("MT_VaritaAprendiz", 40, 1f), O("MT_BastonAprendiz", 150, 0.5f, "defeated_eikthyr"), O("MT_BastonAdepto", 300, 0.35f, "defeated_gdking"), O("MT_BastonMaestro", 500, 0.25f, "defeated_bonemass"), O("MT_BastonArchimago", 750, 0.15f, "defeated_goblinking"), O("MT_BastonAgua", 1000, 0.06f, "defeated_bonemass"), O("MT_BastonSilfide", 1000, 0.06f, "defeated_dragon"), O("MT_BastonRudeus", 1000, 0.06f, "defeated_goblinking"), O("MT_BastonTempestad", 1000, 0.06f, "defeated_queen"), O("MT_GrimorioRunico", 1200, 0.08f, "defeated_queen") }; } internal static int Dia() { if (!((Object)(object)EnvMan.instance != (Object)null)) { return 0; } return EnvMan.instance.GetDay(); } internal static bool HayHoy(Oferta o) { if (o.Prob >= 1f) { return true; } int num = ((WorldGenerator.instance != null) ? WorldGenerator.instance.GetSeed() : 0); uint num2 = 2166136261u; string text = num + ":" + Dia() + ":" + o.Item; foreach (char c in text) { num2 ^= c; num2 *= 16777619; } return (float)(num2 % 10000) / 10000f < o.Prob; } private static HashSet CompradosHoy(Player p) { if ((Object)(object)p == (Object)null || !p.m_customData.TryGetValue("MT.Magia.TiendaCompras", out var value)) { return new HashSet(); } string[] array = value.Split(new char[1] { ':' }); if (array.Length != 2 || !(array[0] == Mundo.Dia(Dia()).Replace(":", ""))) { return new HashSet(); } return new HashSet(from x in array[1].Split(new char[1] { ',' }) where x.Length > 0 select x); } internal static void MarcarComprado(Player p, string item) { HashSet hashSet = CompradosHoy(p); hashSet.Add(item); p.m_customData["MT.Magia.TiendaCompras"] = Mundo.Dia(Dia()).Replace(":", "") + ":" + string.Join(",", hashSet); } internal static bool EsUnoAlDia(string item) { return Ofertas().Any((Oferta o) => o.Item == item && o.UnoAlDia); } internal static IEnumerable Hoy(Player p, TradeItem plantilla) { HashSet comprados = CompradosHoy(p); foreach (Oferta item in Ofertas()) { if (item.Precio <= 0 || !HayHoy(item) || (item.UnoAlDia && comprados.Contains(item.Item))) { continue; } ObjectDB instance = ObjectDB.instance; object obj; if (instance == null) { obj = null; } else { GameObject itemPrefab = instance.GetItemPrefab(item.Item); obj = ((itemPrefab != null) ? itemPrefab.GetComponent() : null); } ItemDrop val = (ItemDrop)obj; if ((Object)(object)val == (Object)null) { continue; } TradeItem val2 = new TradeItem(); if (plantilla != null) { FieldInfo[] fields = typeof(TradeItem).GetFields(); foreach (FieldInfo fieldInfo in fields) { fieldInfo.SetValue(val2, fieldInfo.GetValue(plantilla)); } } val2.m_prefab = val; val2.m_stack = item.Stack; val2.m_price = item.Precio; val2.m_requiredGlobalKey = item.Clave; val2.m_name = ""; val2.m_tooltip = ""; val2.m_icon = null; val2.m_buyKey = ""; val2.m_incrementKey = ""; val2.m_levelUpEffect = false; if (val2.m_buyPlayerEffects == null) { val2.m_buyPlayerEffects = new EffectList(); } yield return val2; } } } [HarmonyPatch(typeof(Trader), "GetAvailableItems")] public static class TiendaMagiaPatch { [HarmonyPriority(600)] private static void Postfix(Trader __instance, ref List __result) { if (__result != null && !((Object)(object)__instance == (Object)null) && ((Object)__instance).name.StartsWith("Haldor") && !__result.Any((TradeItem t) => (Object)(object)t.m_prefab != (Object)null && ((Object)t.m_prefab).name.StartsWith("MT_"))) { TradeItem plantilla = ((IEnumerable)__result).FirstOrDefault((Func)((TradeItem t) => (Object)(object)t.m_prefab != (Object)null)); IEnumerable second = from t in TiendaMagia.Hoy(Player.m_localPlayer, plantilla) where string.IsNullOrEmpty(t.m_requiredGlobalKey) || ZoneSystem.instance.GetGlobalKey(t.m_requiredGlobalKey) select t; __result = new List(__result.Concat(second)); } } } [HarmonyPatch(typeof(Trader), "OnBought")] public static class TiendaMagiaCompraPatch { private static void Postfix(TradeItem item) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && (Object)(object)item?.m_prefab != (Object)null && TiendaMagia.EsUnoAlDia(((Object)item.m_prefab).name)) { TiendaMagia.MarcarComprado(localPlayer, ((Object)item.m_prefab).name); } } } public static class UsoMagia { private class Pendiente { public Spell S; public float Hasta; public bool Usado; } private static readonly List Pendientes = new List(); private static Spell _ultimoOfensivo; private static float _ultimoOfensivoHasta; public static void Lanzado(Player p, Spell s) { if ((Object)(object)p == (Object)null || s == null) { return; } Desgaste.AlLanzar(p, s); if (s.Rol == Rol.Utilidad) { Contar(p, s, 0, jefe: false); return; } if (s.Rol == Rol.Apoyo && (s.School == Escuela.Invocacion || s.School == Escuela.Desintoxicacion)) { Contar(p, s, 0, jefe: false); return; } Pendientes.RemoveAll((Pendiente x) => x.Usado || Time.time > x.Hasta); Pendientes.Add(new Pendiente { S = s, Hasta = Time.time + ((s.Rol == Rol.Defensivo) ? 12f : 6f) }); if (s.Rol == Rol.Ofensivo) { _ultimoOfensivo = s; _ultimoOfensivoHasta = Time.time + 6f; } } private static void Usar(Player p, Rol rol, int estrellas, bool jefe) { for (int num = Pendientes.Count - 1; num >= 0; num--) { Pendiente pendiente = Pendientes[num]; if (!pendiente.Usado && !(Time.time > pendiente.Hasta) && pendiente.S.Rol == rol) { pendiente.Usado = true; Contar(p, pendiente.S, estrellas, jefe); break; } } } private static void Contar(Player p, Spell s, int estrellas, bool jefe) { float num = RangoRules.Valor(s.Rol == Rol.Utilidad, estrellas, jefe, Afinidad.IsFavorite(p, s.School)); MagiaLogros.AddCast(p, s.School, s.Rank, num); Practica.Sumar(p, s.School, num); if (s.School2.HasValue) { MagiaLogros.AddCast(p, s.School2.Value, s.Rank, RangoRules.Valor(s.Rol == Rol.Utilidad, estrellas, jefe, Afinidad.IsFavorite(p, s.School2.Value))); } } private static bool EsMagia(HitData hit) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 if ((int)hit.m_skill != 9) { return (int)hit.m_skill == 10; } return true; } public static void AlGolpear(Player p, Character objetivo, HitData hit) { if (!EsMagia(hit) || objetivo is Player || objetivo.IsTamed() || !BaseAI.IsEnemy((Character)(object)p, objetivo)) { return; } int estrellas = Mathf.Max(0, objetivo.GetLevel() - 1); Usar(p, Rol.Ofensivo, estrellas, objetivo.IsBoss()); if (_ultimoOfensivo != null && Time.time < _ultimoOfensivoHasta && !objetivo.IsDead() && objetivo.GetHealth() > 0f && objetivo.GetHealth() <= hit.GetTotalDamage() && Vencidos.Nuevo(objetivo)) { MagiaLogros.AddKill(p, _ultimoOfensivo.School); if (_ultimoOfensivo.School2.HasValue) { MagiaLogros.AddKill(p, _ultimoOfensivo.School2.Value); } } } public static void AlCurar(Player p, Character objetivo) { if (!((Object)(object)objetivo == (Object)null) && !(objetivo.GetHealth() >= objetivo.GetMaxHealth() - 0.5f)) { Usar(p, Rol.Apoyo, 0, jefe: false); } } public static void AlRecibirGolpe(Player p) { Usar(p, Rol.Defensivo, 0, jefe: false); } } public static class Vencidos { private static readonly Dictionary Recientes = new Dictionary(); public static bool Nuevo(Character c) { int instanceID = ((Object)c).GetInstanceID(); if (Recientes.TryGetValue(instanceID, out var value) && Time.time - value < 10f) { return false; } if (Recientes.Count > 64) { Recientes.Clear(); } Recientes[instanceID] = Time.time; return true; } } [HarmonyPatch(typeof(Character), "Damage")] public static class UsoMagiaGolpePatch { private static void Prefix(Character __instance, HitData hit) { Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && hit != null && !((Object)(object)__instance == (Object)null)) { if ((Object)(object)hit.GetAttacker() == (Object)(object)localPlayer && (Object)(object)__instance != (Object)(object)localPlayer) { UsoMagia.AlGolpear(localPlayer, __instance, hit); } else if (__instance is Player && (Object)(object)hit.GetAttacker() != (Object)null && !(hit.GetAttacker() is Player)) { UsoMagia.AlRecibirGolpe(localPlayer); } } } } [HarmonyPatch(typeof(Character), "Heal")] public static class UsoMagiaCuraPatch { private static void Prefix(Character __instance, float hp) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && hp >= 5f) { UsoMagia.AlCurar(localPlayer, __instance); } } } public static class Varita { public static void Register() { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025e: 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_0120: 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_020a: 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_023f: 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_01c5: Unknown result type (might be due to invalid IL or missing references) PrefabManager.OnVanillaPrefabsAvailable -= Register; string text = MTMagiaPlugin.VaritaModelo.Value; GameObject prefab = PrefabManager.Instance.GetPrefab("Club"); if ((Object)(object)((prefab != null) ? prefab.GetComponent() : null) == (Object)null || (Object)(object)PrefabManager.Instance.GetPrefab(text) == (Object)null) { text = "Club"; } string text2 = text; ItemConfig val = new ItemConfig(); val.Name = Tr.Token("magia_varita_aprendiz"); val.Description = Tr.Token("magia_varita_aprendiz_d"); val.CraftingStation = CraftingStations.Workbench; val.RepairStation = CraftingStations.Workbench; val.Icon = MTMagiaPlugin.Icon("varita"); val.Requirements = (RequirementConfig[])(object)new RequirementConfig[3] { new RequirementConfig("Wood", 5, 3, true), new RequirementConfig("Resin", 3, 2, true), new RequirementConfig("GreydwarfEye", 2, 2, true) }; CustomItem val2 = new CustomItem("MT_VaritaAprendiz", text2, val); SharedData shared = val2.ItemDrop.m_itemData.m_shared; if (text != "Club") { shared.m_skillType = (SkillType)9; shared.m_attack.m_attackEitr = 0f; shared.m_secondaryAttack.m_attackEitr = 0f; shared.m_attackStatusEffect = null; List materialNames; Mesh val3 = ObjModel.Load(Path.Combine(MTMagiaPlugin.ModelDir, "varita_aprendiz.obj"), out materialNames); if ((Object)(object)val3 != (Object)null && MTMagiaPlugin.VaritaModeloPropio.Value) { GameObject prefab2 = PrefabManager.Instance.GetPrefab("Club"); object obj; if (prefab2 == null) { obj = null; } else { MeshRenderer componentInChildren = prefab2.GetComponentInChildren(true); obj = ((componentInChildren != null) ? ((Renderer)componentInChildren).sharedMaterial : null); } Material template = (Material)obj; ObjModel.ReplaceVisual(val2.ItemPrefab, val3, ObjModel.Materials(materialNames, template), Agarre.Rotation("MT_VaritaAprendiz"), Agarre.Offset("MT_VaritaAprendiz")); Agarre.Setup("MT_VaritaAprendiz", val2.ItemPrefab); } else { float value = MTMagiaPlugin.VaritaEscala.Value; Transform transform = val2.ItemPrefab.transform; transform.localScale *= value; Transform val4 = val2.ItemPrefab.transform.Find("attach"); if ((Object)(object)val4 != (Object)null) { val4.localScale *= value; } } } shared.m_damages = new DamageTypes { m_blunt = 2f }; shared.m_weight = 0.5f; shared.m_maxQuality = 4; Desgaste.Configurar(shared, 100f, 25f); ItemManager.Instance.AddItem(val2); MTMagiaPlugin.Log.LogInfo((object)("Varita de aprendiz registrada (modelo: " + text + ")")); } } [HarmonyPatch(typeof(VisEquipment), "AttachBackItem")] public static class VaritaCinturaPatch { private static void Postfix(VisEquipment __instance, int hash, GameObject __result) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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) //IL_010d: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012f: 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_013e: 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) if ((Object)(object)__result == (Object)null || (Object)(object)ObjectDB.instance == (Object)null || !MTMagiaPlugin.VaritaEnCintura.Value) { return; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(hash); if ((Object)(object)itemPrefab == (Object)null || !((Object)itemPrefab).name.StartsWith("MT_Varita")) { return; } GameObject value = Traverse.Create((object)__instance).Field("m_visual").GetValue(); if (!((Object)(object)value == (Object)null)) { Transform val = Find(value.transform, "Hips"); if ((Object)(object)val == (Object)null) { Animator componentInChildren = value.GetComponentInChildren(); val = ((componentInChildren != null) ? componentInChildren.GetBoneTransform((HumanBodyBones)0) : null); } if ((Object)(object)val == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)"Varita en la cintura: no se encontró el hueso de la cadera"); return; } Transform transform = value.transform; Vector3 value2 = MTMagiaPlugin.VaritaCinturaPosicion.Value; __result.transform.SetParent(val, true); __result.transform.position = val.position + transform.right * value2.x + transform.up * value2.y + transform.forward * value2.z; __result.transform.rotation = transform.rotation * Quaternion.Euler(MTMagiaPlugin.VaritaCinturaRotacion.Value); } } private static Transform Find(Transform t, string name) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown if (((Object)t).name == name) { return t; } foreach (Transform item in t) { Transform val = Find(item, name); if ((Object)(object)val != (Object)null) { return val; } } return null; } } public static class Vfx { private class RingWatcher : MonoBehaviour { private void Update() { if ((Object)(object)_ring != (Object)null && ((Renderer)_ring).enabled && Time.time - _ringSeen > 0.2f) { ((Renderer)_ring).enabled = false; } } } private static readonly Dictionary Textures = new Dictionary(); public static string Dir; private static Material _template; public static readonly Color Verde = new Color(0.35f, 1f, 0.45f); public static readonly Color Dorado = new Color(1f, 0.85f, 0.35f); public static readonly Color Azul = new Color(0.45f, 0.75f, 1f); public static readonly Color Rojo = new Color(1f, 0.25f, 0.25f); public static readonly Color Violeta = new Color(0.75f, 0.5f, 1f); public static readonly Color LuzCura = new Color(0.85f, 1f, 0.5f); private static Texture2D _leaf; internal static readonly Color GravedadMorada = new Color(0.7f, 0.35f, 1f, 1f); private static LineRenderer _ring; private static float _ringSeen; public static Material NewMaterial(Texture2D tex, Color? tint = null) { //IL_00d3: 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_00d9: Expected O, but got Unknown //IL_0111: 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) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_template == (Object)null) { string[] array = new string[3] { "fx_fireball_staff_explosion", "vfx_Potion_health_medium", "fx_DvergerMage_Support_hit" }; for (int i = 0; i < array.Length; i++) { GameObject val = Fx.Prefab(array[i]); if ((Object)(object)val == (Object)null) { continue; } ParticleSystemRenderer[] componentsInChildren = val.GetComponentsInChildren(true); foreach (ParticleSystemRenderer val2 in componentsInChildren) { if ((Object)(object)((Renderer)val2).sharedMaterial != (Object)null && (Object)(object)((Renderer)val2).sharedMaterial.mainTexture != (Object)null) { _template = ((Renderer)val2).sharedMaterial; break; } } if ((Object)(object)_template != (Object)null) { break; } } } Material val3 = (((Object)(object)_template != (Object)null) ? new Material(_template) : new Material(Shader.Find("Sprites/Default"))); if ((Object)(object)tex != (Object)null) { val3.mainTexture = (Texture)(object)tex; } if (val3.HasProperty("_TintColor")) { val3.SetColor("_TintColor", (Color)(((??)tint) ?? Color.white)); } if (val3.HasProperty("_Color")) { val3.SetColor("_Color", (Color)(((??)tint) ?? Color.white)); } return val3; } public static Texture2D Tex(string name) { if (Textures.TryGetValue(name, out var value)) { return value; } string text = Path.Combine(Dir, name + ".png"); if (File.Exists(text)) { value = AssetUtils.LoadTexture(text, true); } Textures[name] = value; return value; } public static void HealHand(Player p) { //IL_0017: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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_017a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)p == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { Vector3 val = Fx.HandOrigin(p); Particulas.Spawn(val, new Particulas.Config { ColorA = LuzCura, ColorB = Color.white, LifeMin = 0.5f, LifeMax = 1f, SpeedMin = 0.5f, SpeedMax = 2f, SizeMin = 0.08f, SizeMax = 0.25f, Radius = 0.15f, Burst = 45, Gravity = -0.2f }); Particulas.Spawn(val, new Particulas.Config { ColorA = new Color(LuzCura.r, LuzCura.g, LuzCura.b, 0.6f), ColorB = new Color(1f, 1f, 0.8f, 0.5f), LifeMin = 0.6f, LifeMax = 0.8f, SpeedMin = 0f, SpeedMax = 0.1f, SizeMin = 0.8f, SizeMax = 1.2f, Radius = 0.05f, Burst = 6, Grow = 1.5f }); Light obj = LucesMagicas.Registrar(new GameObject("MT_LuzManoCura").AddComponent()); ((Component)obj).transform.position = val; obj.color = LuzCura; obj.range = 6f; obj.intensity = 3f; Object.Destroy((Object)(object)((Component)obj).gameObject, 0.8f); } } public static void Heal(Character target, Color color, bool destellos = false, float duration = 1.5f, bool loop = false) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0055: 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_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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { if (color == Verde) { color = LuzCura; } GameObject val = new GameObject("MT_HealVFX"); val.transform.SetParent(((Component)target).transform, false); MTHealVFX mTHealVFX = val.AddComponent(); mTHealVFX.style = MTHealVFX.Style.Destellos; mTHealVFX.color = color; mTHealVFX.duration = duration; mTHealVFX.loop = loop; mTHealVFX.crossTexture = Tex("heal_cross"); mTHealVFX.sparkTexture = Tex("heal_spark"); mTHealVFX.columnTexture = Tex("heal_column"); mTHealVFX.star4Texture = Tex("heal_star4"); mTHealVFX.streakTexture = Tex("heal_streak"); mTHealVFX.groundGlowTexture = Tex("heal_ground_glow"); Particulas.Spawn(((Component)target).transform.position + Vector3.up * 1f, new Particulas.Config { ColorA = color, ColorB = new Color(1f, 0.95f, 0.7f), LifeMin = 1.2f, LifeMax = 2f, SpeedMin = 0.2f, SpeedMax = 0.6f, SizeMin = 0.05f, SizeMax = 0.14f, Radius = 0.9f, Rate = 40f, Duration = duration, Gravity = -0.12f, Burst = 25 }, ((Component)target).transform); Light obj = LucesMagicas.Registrar(new GameObject("MT_LuzCura").AddComponent()); ((Component)obj).transform.SetParent(val.transform, false); ((Component)obj).transform.localPosition = Vector3.up * 1.2f; obj.color = color; obj.range = 5f; obj.intensity = 1.8f; Object.Destroy((Object)(object)val, duration + 2f); } } public static void Electric(Character target, float duration = 2f) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown if (!((Object)(object)target == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_ElectricVFX"); val.transform.SetParent(((Component)target).transform, false); MTElectricVFX mTElectricVFX = val.AddComponent(); mTElectricVFX.duration = duration; mTElectricVFX.boltsTexture = Tex("electric_bolts"); mTElectricVFX.sparkTexture = Tex("heal_spark"); Object.Destroy((Object)val, duration + 0.5f); } } public static void Wind(Vector3 origin, Vector3 dir, float range, float spreadDeg, Color color) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_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_0083: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_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_00dc: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_Viento"); val.transform.position = origin; val.transform.rotation = Quaternion.LookRotation((((Vector3)(ref dir)).sqrMagnitude > 0.01f) ? dir : Vector3.forward); ParticleSystem val2 = val.AddComponent(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).duration = 0.3f; float num = range / 0.45f; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.45f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(num * 0.7f, num); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.08f, 0.16f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[2] { new Burst(0f, (short)40), new Burst(0.1f, (short)25) }); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = spreadDeg; ((ShapeModule)(ref shape)).radius = 0.2f; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(1f, 0.15f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); ParticleSystemRenderer component = val.GetComponent(); component.renderMode = (ParticleSystemRenderMode)1; component.velocityScale = 0.06f; component.lengthScale = 2f; Material val4 = (((Renderer)component).sharedMaterial = NewMaterial(Tex("heal_streak"), color)); val2.Play(); Object.Destroy((Object)(object)val, 1.5f); Object.Destroy((Object)(object)val4, 1.5f); Leaves(origin, dir, range, 18); } } private static Texture2D LeafTex() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_leaf != (Object)null) { return _leaf; } _leaf = new Texture2D(32, 32, (TextureFormat)4, false) { wrapMode = (TextureWrapMode)1 }; for (int i = 0; i < 32; i++) { for (int j = 0; j < 32; j++) { float num = ((float)j + 0.5f) / 32f * 2f - 1f; float num2 = ((float)i + 0.5f) / 32f * 2f - 1f; float num3 = 0.55f * (1f - num2 * num2); float num4 = Mathf.Abs(num) / Mathf.Max(0.01f, num3); float num5 = Mathf.Clamp01((1f - num4) * 4f) * ((Mathf.Abs(num2) < 0.95f) ? 1f : 0f); float num6 = ((Mathf.Abs(num) < 0.05f) ? 1.3f : 1f); _leaf.SetPixel(j, i, new Color(0.45f * num6, 0.8f * num6, 0.3f * num6, num5)); } } _leaf.Apply(); return _leaf; } public static void Leaves(Vector3 origin, Vector3 dir, float range, int count) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_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_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0212: 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_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0264: 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_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_Hojas"); val.transform.position = origin; val.transform.rotation = Quaternion.LookRotation((((Vector3)(ref dir)).sqrMagnitude > 0.01f) ? dir : Vector3.forward); ParticleSystem val2 = val.AddComponent(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).duration = 0.3f; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(1.8f, 2.7f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(range * 0.6f, range * 1.2f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.14f, 0.28f); ((MainModule)(ref main)).startRotation = new MinMaxCurve(0f, (float)Math.PI * 2f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.55f, 1f, 0.45f), new Color(0.9f, 0.85f, 0.35f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(0.15f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)count) }); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 30f; ((ShapeModule)(ref shape)).radius = 0.4f; RotationOverLifetimeModule rotationOverLifetime = val2.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = new MinMaxCurve(-8f, 8f); LimitVelocityOverLifetimeModule limitVelocityOverLifetime = val2.limitVelocityOverLifetime; ((LimitVelocityOverLifetimeModule)(ref limitVelocityOverLifetime)).enabled = true; ((LimitVelocityOverLifetimeModule)(ref limitVelocityOverLifetime)).drag = MinMaxCurve.op_Implicit(2.5f); NoiseModule noise = val2.noise; ((NoiseModule)(ref noise)).enabled = true; ((NoiseModule)(ref noise)).strength = MinMaxCurve.op_Implicit(1.2f); ((NoiseModule)(ref noise)).frequency = 0.8f; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(1f, 0.7f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val3); ParticleSystemRenderer component = val.GetComponent(); component.renderMode = (ParticleSystemRenderMode)0; Material val4 = (((Renderer)component).sharedMaterial = NewMaterial(LeafTex(), Color.white)); val2.Play(); Object.Destroy((Object)(object)val, 4.2f); Object.Destroy((Object)(object)val4, 4.2f); } } public static void Blade(Vector3 origin, Vector3 dir, float range, Color color) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_009a: 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_00b2: 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_00d5: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0144: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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) if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_HojaViento"); val.transform.position = origin; val.transform.rotation = Quaternion.LookRotation(dir); ParticleSystem val2 = val.AddComponent(); val2.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val2.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).duration = 0.05f; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.35f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.1f, 0.2f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)50) }); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 0.9f; ((ShapeModule)(ref shape)).arc = 120f; ((ShapeModule)(ref shape)).rotation = new Vector3(90f, 0f, 30f); ((ShapeModule)(ref shape)).position = new Vector3(0f, 0f, -0.9f); VelocityOverLifetimeModule velocityOverLifetime = val2.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).z = MinMaxCurve.op_Implicit(range / 0.35f); ParticleSystemRenderer component = val.GetComponent(); component.renderMode = (ParticleSystemRenderMode)1; component.velocityScale = 0.04f; component.lengthScale = 3f; ((Renderer)component).material = NewMaterial(Tex("heal_streak"), color); val2.Play(); Object.Destroy((Object)(object)val, 1f); Leaves(origin, dir, range, 32); } } public static void Gravity(Character target, float duration, float radius = 0.7f) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00c8: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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_0233: 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_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_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { Transform val = ((Component)target).transform.Find("MT_GravedadAura"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } GameObject val2 = new GameObject("MT_GravedadAura"); val2.transform.SetParent(((Component)target).transform, false); val2.transform.localPosition = Vector3.up * 0.9f; ParticleSystem val3 = val2.AddComponent(); val3.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val3.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(1.1f, 2f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.05f, 0.18f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.07f, 0.14f); ((MainModule)(ref main)).startColor = new MinMaxGradient(GravedadMorada, new Color(0.4f, 0.2f, 0.9f, 1f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; ((MainModule)(ref main)).maxParticles = 90; EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(22f); ShapeModule shape = val3.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = radius; ((ShapeModule)(ref shape)).radiusThickness = 0.12f; ((ShapeModule)(ref shape)).rotation = new Vector3(90f, 0f, 0f); VelocityOverLifetimeModule velocityOverLifetime = val3.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalY = new MinMaxCurve(-1.6f, 2.4f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(-0.2f, 0.35f); ColorOverLifetimeModule colorOverLifetime = val3.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val4 = new Gradient(); val4.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[4] { new GradientAlphaKey(0f, 0f), new GradientAlphaKey(0.95f, 0.18f), new GradientAlphaKey(0.65f, 0.78f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(val4); ParticleSystemRenderer component = val2.GetComponent(); component.renderMode = (ParticleSystemRenderMode)0; ((Renderer)component).sharedMaterial = NewMaterial(Tex("heal_spark"), GravedadMorada); Light obj = LucesMagicas.Registrar(val2.AddComponent()); obj.color = GravedadMorada; obj.range = 2.5f; obj.intensity = 0.9f; val3.Play(); Object.Destroy((Object)(object)val2, duration + 0.3f); Object.Destroy((Object)(object)((Renderer)component).sharedMaterial, duration + 0.3f); } } public static void GravityPoint(Vector3 point, float radius, int count = 48) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_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_0074: 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_0096: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_0107: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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) //IL_019b: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_GravedadImpacto"); val.transform.position = point; GameObject val2 = val; ParticleSystem val3 = val2.AddComponent(); val3.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val3.main; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).duration = 0.2f; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.65f, 1.25f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(radius * 0.35f, radius * 1.1f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.07f, 0.16f); ((MainModule)(ref main)).startColor = new MinMaxGradient(GravedadMorada, new Color(0.45f, 0.2f, 1f, 1f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(0f); ((EmissionModule)(ref emission)).SetBursts((Burst[])(object)new Burst[1] { new Burst(0f, (short)Mathf.Clamp(count, 1, 120)) }); ShapeModule shape = val3.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = radius * 0.15f; NoiseModule noise = val3.noise; ((NoiseModule)(ref noise)).enabled = true; ((NoiseModule)(ref noise)).strength = MinMaxCurve.op_Implicit(0.45f); ((NoiseModule)(ref noise)).frequency = 1.1f; ParticleSystemRenderer component = val2.GetComponent(); ((Renderer)component).sharedMaterial = NewMaterial(Tex("heal_spark"), GravedadMorada); val3.Play(); Object.Destroy((Object)(object)val2, 2f); Object.Destroy((Object)(object)((Renderer)component).sharedMaterial, 2f); GravedadBrillo(point, radius); } } public static void GravedadBrillo(Vector3 point, float radius) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0089: 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_00b8: Expected O, but got Unknown if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_GravedadBrillo"); val.transform.position = point; Light val2 = LucesMagicas.Registrar(val.AddComponent()); val2.color = GravedadMorada; val2.range = Mathf.Max(3f, radius * 1.6f); val2.intensity = 2.2f; LineRenderer val3 = val.AddComponent(); val3.useWorldSpace = false; val3.loop = true; val3.positionCount = 48; val3.widthMultiplier = 0.06f; Material val4 = (((Renderer)val3).sharedMaterial = NewMaterial(Texture2D.whiteTexture, GravedadMorada)); val.AddComponent().Init(radius, val2, val3); Object.Destroy((Object)val, 1.3f); Object.Destroy((Object)(object)val4, 1.3f); } } public static void GravityPull(Vector3 from, Vector3 to) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_00a8: 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_00b0: 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_00bc: Unknown result type (might be due to invalid IL or missing references) if (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_GravedadAtraccion"); LineRenderer val2 = val.AddComponent(); val2.useWorldSpace = true; val2.positionCount = 12; val2.widthMultiplier = 0.13f; Color startColor = (val2.endColor = GravedadMorada); val2.startColor = startColor; ((Renderer)val2).sharedMaterial = NewMaterial(Tex("heal_streak"), GravedadMorada); for (int i = 0; i < val2.positionCount; i++) { float num = (float)i / (float)(val2.positionCount - 1); float num2 = Mathf.Sin(num * (float)Math.PI * 4f + Time.time * 7f) * 0.08f; val2.SetPosition(i, Vector3.Lerp(from, to, num) + Vector3.up * num2); } Object.Destroy((Object)(object)val, 0.45f); Object.Destroy((Object)(object)((Renderer)val2).sharedMaterial, 0.45f); } } public static void WindFeet(Character target, float duration) { //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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_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_009b: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown if (!((Object)(object)target == (Object)null) && MTMagiaPlugin.EfectosPropios.Value) { Transform val = ((Component)target).transform.Find("MT_VientoPies"); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)((Component)val).gameObject); } GameObject val2 = new GameObject("MT_VientoPies"); val2.transform.SetParent(((Component)target).transform, false); val2.transform.localPosition = Vector3.up * 0.12f; ParticleSystem val3 = val2.AddComponent(); val3.Stop(true, (ParticleSystemStopBehavior)0); MainModule main = val3.main; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.45f, 0.8f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.4f, 1.1f); ((MainModule)(ref main)).startSize = new MinMaxCurve(0.08f, 0.16f); ((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(0.55f, 1f, 0.45f), new Color(0.9f, 0.85f, 0.35f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)0; EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(14f); ShapeModule shape = val3.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)10; ((ShapeModule)(ref shape)).radius = 0.45f; VelocityOverLifetimeModule velocityOverLifetime = val3.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).space = (ParticleSystemSimulationSpace)0; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).orbitalY = MinMaxCurve.op_Implicit(2.5f); ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = MinMaxCurve.op_Implicit(0.35f); RotationOverLifetimeModule rotationOverLifetime = val3.rotationOverLifetime; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).enabled = true; ((RotationOverLifetimeModule)(ref rotationOverLifetime)).z = new MinMaxCurve(-8f, 8f); ParticleSystemRenderer component = val2.GetComponent(); ((Renderer)component).sharedMaterial = NewMaterial(LeafTex(), Color.white); val3.Play(); Object.Destroy((Object)val2, duration + 0.2f); Object.Destroy((Object)(object)((Renderer)component).sharedMaterial, duration + 0.2f); } } public static void Ring(Vector3 center, float radius) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_ring == (Object)null) { GameObject val = new GameObject("MT_Alcance"); Object.DontDestroyOnLoad((Object)val); _ring = val.AddComponent(); _ring.loop = true; _ring.positionCount = 48; _ring.useWorldSpace = true; _ring.widthMultiplier = 0.08f; ((Renderer)_ring).material = NewMaterial(Tex("heal_spark"), (Color?)new Color(1f, 0.6f, 0.2f, 0.9f)); LineRenderer ring = _ring; LineRenderer ring2 = _ring; Color val2 = default(Color); ((Color)(ref val2))..ctor(1f, 0.6f, 0.2f, 0.9f); ring2.endColor = val2; ring.startColor = val2; val.AddComponent(); } ((Renderer)_ring).enabled = true; _ringSeen = Time.time; RaycastHit val4 = default(RaycastHit); for (int i = 0; i < 48; i++) { float num = (float)i / 48f * (float)Math.PI * 2f; Vector3 val3 = center + new Vector3(Mathf.Cos(num) * radius, 0f, Mathf.Sin(num) * radius); if (Physics.Raycast(val3 + Vector3.up * 5f, Vector3.down, ref val4, 12f, LayerMask.GetMask(new string[4] { "terrain", "static_solid", "Default", "piece" }), (QueryTriggerInteraction)1)) { val3.y = ((RaycastHit)(ref val4)).point.y + 0.1f; } _ring.SetPosition(i, val3); } } public static void HideRing() { if ((Object)(object)_ring != (Object)null) { ((Renderer)_ring).enabled = false; } } } public class GravedadAnillo : MonoBehaviour { private float _r; private float _t; private Light _luz; private LineRenderer _ring; public void Init(float r, Light luz, LineRenderer ring) { _r = Mathf.Max(0.6f, r); _luz = luz; _ring = ring; } private void Update() { //IL_008b: 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_00dc: Unknown result type (might be due to invalid IL or missing references) _t += Time.deltaTime; float num = Mathf.Clamp01(_t / 1.2f); float num2 = Mathf.Lerp(_r, 0.1f, num * num); for (int i = 0; i < 48; i++) { float num3 = (float)i * (float)Math.PI * 2f / 48f + _t * 3f; _ring.SetPosition(i, new Vector3(Mathf.Cos(num3) * num2, Mathf.Sin(num3 * 3f) * 0.05f, Mathf.Sin(num3) * num2)); } Color val = default(Color); ((Color)(ref val))..ctor(Vfx.GravedadMorada.r, Vfx.GravedadMorada.g, Vfx.GravedadMorada.b, 1f - num); _ring.startColor = val; _ring.endColor = val; if ((Object)(object)_luz != (Object)null) { _luz.intensity = 2.2f * (1f - num) * (0.75f + 0.25f * Mathf.Sin(_t * 18f)); } } } public class VientoLineas : MonoBehaviour { private const int Puntos = 48; private const float Viaje = 0.45f; private const float Cola = 0.22f; private const float Vida = 0.9f; private LineRenderer[] _lineas; private Vector3[][] _caminos; private float[] _retraso; private Material _mat; private float _edad; public static void Spawn(Vector3 origen, Vector3 dir, float alcance, int trazos = 5) { //IL_000d: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_003e: 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_006d: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected O, but got Unknown if (MTMagiaPlugin.EfectosPropios.Value) { Vector3 val = Vector3.ProjectOnPlane(dir, Vector3.up); if (((Vector3)(ref val)).sqrMagnitude < 0.001f) { val = Vector3.forward; } GameObject val2 = new GameObject("MT_VientoLineas"); val2.transform.position = origen; val2.transform.rotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); VientoLineas vientoLineas = val2.AddComponent(); vientoLineas._mat = Vfx.NewMaterial(Texture2D.whiteTexture, Color.white); vientoLineas._lineas = (LineRenderer[])(object)new LineRenderer[trazos]; vientoLineas._caminos = new Vector3[trazos][]; vientoLineas._retraso = new float[trazos]; for (int i = 0; i < trazos; i++) { float lado = ((trazos == 1) ? 0f : Mathf.Lerp(-1f, 1f, (float)i / ((float)trazos - 1f))); vientoLineas._caminos[i] = Camino(lado, alcance * Random.Range(0.8f, 1.05f), Random.Range(0.25f, 0.5f)); vientoLineas._retraso[i] = Random.Range(0f, 0.12f); GameObject val3 = new GameObject("Trazo"); val3.transform.SetParent(val2.transform, false); LineRenderer val4 = val3.AddComponent(); ((Renderer)val4).sharedMaterial = vientoLineas._mat; val4.useWorldSpace = false; ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val4).receiveShadows = false; val4.numCapVertices = 3; val4.widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.01f), new Keyframe(0.6f, 0.07f), new Keyframe(1f, 0.02f) }); val4.positionCount = 0; vientoLineas._lineas[i] = val4; } Object.Destroy((Object)(object)val2, 1.2f); } } public static void Anillo(Vector3 centro, float alcance, int direcciones = 6, int trazosPorDireccion = 2) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, 360f); for (int i = 0; i < direcciones; i++) { Vector3 val = Quaternion.Euler(0f, num + (float)i * 360f / (float)direcciones, 0f) * Vector3.forward; Spawn(centro + val * 0.4f, val, alcance, trazosPorDireccion); } } private static Vector3[] Camino(float lado, float alcance, float radioRizo) { //IL_0020: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[48]; int num = 36; float num2 = ((lado >= 0f) ? 1f : (-1f)); Vector3 zero = Vector3.zero; for (int i = 0; i < num; i++) { float num3 = (float)i / ((float)num - 1f); float num4 = lado * (0.3f + alcance * 0.35f * num3 * num3); float num5 = 0.2f * lado * lado * num3 + 0.6f * num3 * num3; int num6 = i; ((Vector3)(ref zero))..ctor(num4, num5, alcance * num3); array[num6] = zero; } float num7 = Mathf.Max(0.2f, radioRizo * (0.8f + Mathf.Abs(lado))); Vector3 val = zero + new Vector3(num2 * num7, 0f, 0f); for (int j = num; j < 48; j++) { float num8 = ((float)(j - num) + 1f) / (float)(48 - num); float num9 = num8 * (float)Math.PI * 1.6f; float num10 = num7 * (1f - 0.35f * num8); array[j] = val + new Vector3((0f - num2) * Mathf.Cos(num9) * num10, 0.15f * num8, Mathf.Sin(num9) * num10); } return array; } private void Update() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) _edad += Time.deltaTime; float num = Mathf.Clamp01(1f - (_edad - 0.45f) / 0.45f); Color val = default(Color); ((Color)(ref val))..ctor(0.9f, 1f, 0.95f, 0.85f * num); _mat.color = val; if (_mat.HasProperty("_TintColor")) { _mat.SetColor("_TintColor", val * 0.5f); } for (int i = 0; i < _lineas.Length; i++) { float num2 = _edad - _retraso[i]; if (num2 <= 0f) { continue; } int num3 = Mathf.Clamp(Mathf.CeilToInt(num2 / 0.45f * 47f), 0, 47); int num4 = Mathf.Clamp(Mathf.FloorToInt((num2 - 0.22f) / 0.45f * 47f), 0, num3); LineRenderer val2 = _lineas[i]; int num5 = num3 - num4 + 1; if (num5 < 2) { val2.positionCount = 0; continue; } val2.positionCount = num5; for (int j = 0; j < num5; j++) { val2.SetPosition(j, _caminos[i][num4 + j]); } } } private void OnDestroy() { if ((Object)(object)_mat != (Object)null) { Object.Destroy((Object)(object)_mat); } } } [HarmonyPatch(typeof(Player), "GetTotalFoodValue")] [HarmonyPriority(200)] public static class VigorPatch { private static void Postfix(Player __instance, ref float hp) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { SE_Vigor sE_Vigor = ((Character)__instance).GetSEMan().GetStatusEffect(StringExtensionMethods.GetStableHashCode("MT_Vigor")) as SE_Vigor; if ((Object)(object)sE_Vigor != (Object)null) { hp *= 1f + sE_Vigor.Value / 100f; } } } } public class WindImpulseVfx : MonoBehaviour { private Player _player; private Vector3 _direction; private LineRenderer _ring; private Material _material; private float _age; private int _burst; public static void Spawn(Player player, Vector3 direction) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_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_0108: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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 (MTMagiaPlugin.EfectosPropios.Value) { GameObject val = new GameObject("MT_ImpulsoVientoVFX"); val.transform.position = ((Component)player).transform.position + Vector3.up * 0.12f; WindImpulseVfx windImpulseVfx = val.AddComponent(); windImpulseVfx._player = player; windImpulseVfx._direction = ((Vector3)(ref direction)).normalized; windImpulseVfx._material = Vfx.NewMaterial(Texture2D.whiteTexture, (Color?)new Color(0.65f, 0.95f, 1f, 1f)); windImpulseVfx._ring = val.AddComponent(); ((Renderer)windImpulseVfx._ring).sharedMaterial = windImpulseVfx._material; windImpulseVfx._ring.useWorldSpace = false; windImpulseVfx._ring.loop = true; windImpulseVfx._ring.positionCount = 48; windImpulseVfx._ring.widthMultiplier = 0.07f; Object.Destroy((Object)(object)val, 0.8f); Vector3 val2 = Vector3.ProjectOnPlane(direction, Vector3.up); if (((Vector3)(ref val2)).sqrMagnitude > 0.25f) { VientoLineas.Spawn(((Component)player).transform.position + Vector3.up * 0.8f, -val2, 5f, 4); } else { VientoLineas.Anillo(((Component)player).transform.position + Vector3.up * 0.2f, 3f, 5, 1); } } } private void Update() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0076: 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_009e: Unknown result type (might be due to invalid IL or missing references) _age += Time.deltaTime; if ((Object)(object)_player != (Object)null && !((Character)_player).IsDead() && _burst < 3 && _age >= (float)_burst * 0.12f) { Vfx.Wind(((Component)_player).transform.position + Vector3.up * 0.85f, -_direction, 5f, 24f, new Color(0.65f, 0.95f, 1f, 1f)); _burst++; } float num = Mathf.Clamp01(_age / 0.75f); float num2 = Mathf.Lerp(0.25f, 2f, num); for (int i = 0; i < 48; i++) { float num3 = (float)i * (float)Math.PI * 2f / 48f; _ring.SetPosition(i, new Vector3(Mathf.Cos(num3) * num2, 0f, Mathf.Sin(num3) * num2)); } Color val = default(Color); ((Color)(ref val))..ctor(0.65f, 0.95f, 1f, 1f - num); _ring.startColor = val; _ring.endColor = val; } private void OnDestroy() { if ((Object)(object)_material != (Object)null) { Object.Destroy((Object)(object)_material); } } } public class Temporary : MonoBehaviour { public const string ExpireKey = "mt_expire"; public const string SummonerKey = "mt_summoner"; private ZNetView _nview; public static GameObject Spawn(string prefabName, Vector3 pos, Quaternion rot, float seconds) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) GameObject val = Fx.Prefab(prefabName); if ((Object)(object)val == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)("Prefab no encontrado: " + prefabName)); return null; } GameObject val2 = Object.Instantiate(val, pos, rot); if (seconds > 0f) { Mark(val2, seconds); } return val2; } public static void Mark(GameObject go, float seconds) { ZNetView component = go.GetComponent(); if (!((Object)(object)component == (Object)null) && component.GetZDO() != null && !((Object)(object)ZNet.instance == (Object)null)) { component.GetZDO().Set("mt_expire", (float)(ZNet.instance.GetTimeSeconds() + (double)seconds)); if ((Object)(object)go.GetComponent() == (Object)null) { go.AddComponent(); } } } private static GameObject HoePiece(string name) { GameObject obj = (((Object)(object)ObjectDB.instance != (Object)null) ? ObjectDB.instance.GetItemPrefab("Hoe") : null); List list = ((obj == null) ? null : obj.GetComponent()?.m_itemData?.m_shared?.m_buildPieces?.m_pieces); if (list == null) { return null; } string value = name.Split(new char[1] { '_' })[0]; GameObject val = null; foreach (GameObject item in list) { if (!((Object)(object)item == (Object)null)) { if (((Object)item).name == name) { return item; } if ((Object)(object)val == (Object)null && ((Object)item).name.ToLowerInvariant().Contains(value)) { val = item; } } } return val; } private static string HoePieceNames() { GameObject obj = (((Object)(object)ObjectDB.instance != (Object)null) ? ObjectDB.instance.GetItemPrefab("Hoe") : null); List list = ((obj == null) ? null : obj.GetComponent()?.m_itemData?.m_shared?.m_buildPieces?.m_pieces); if (list != null) { return string.Join(", ", list.ConvertAll((GameObject x) => (!((Object)(object)x != (Object)null)) ? "?" : ((Object)x).name)); } return "(sin azada)"; } public static bool TerrainOp(Player p, string prefabName, Vector3 pos, int spread = 0, string done = null) { //IL_0000: 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_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) if (!PrivateArea.CheckAccess(pos, 2f + (float)spread * 1.5f, true, false)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_can_t_modify_terrain_here"), 0, (Sprite)null, false); return false; } GameObject val = Fx.Prefab(prefabName) ?? HoePiece(prefabName); if ((Object)(object)val == (Object)null) { MTMagiaPlugin.Log.LogWarning((object)("Operación de terreno no encontrada: " + prefabName + " · piezas de la azada: " + HoePieceNames())); ((Character)p).Message((MessageType)1, Tr.Get("magia_terrain_could_not_be_modified"), 0, (Sprite)null, false); return false; } for (int i = -spread; i <= spread; i++) { for (int j = -spread; j <= spread; j++) { GameObject val2 = Object.Instantiate(val, pos + new Vector3((float)i * 1.5f, 0f, (float)j * 1.5f), Quaternion.identity); Renderer[] componentsInChildren = val2.GetComponentsInChildren(true); for (int k = 0; k < componentsInChildren.Length; k++) { componentsInChildren[k].enabled = false; } ParticleSystem[] componentsInChildren2 = val2.GetComponentsInChildren(true); for (int k = 0; k < componentsInChildren2.Length; k++) { componentsInChildren2[k].Stop(true, (ParticleSystemStopBehavior)0); } } } if (done != null) { ((Character)p).Message((MessageType)1, done, 0, (Sprite)null, false); } return true; } private void Awake() { _nview = ((Component)this).GetComponent(); } private void Update() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_nview == (Object)null || !_nview.IsValid() || !_nview.IsOwner() || (Object)(object)ZNet.instance == (Object)null) { return; } float num = _nview.GetZDO().GetFloat("mt_expire", 0f); if (num > 0f && ZNet.instance.GetTimeSeconds() > (double)num) { Character component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { Fx.Visual("vfx_SawDust", component.GetCenterPoint()); } ZNetScene.instance.Destroy(((Component)this).gameObject); } } } [HarmonyPatch(typeof(ZNetView), "Awake")] public static class TemporaryAwakePatch { private static void Postfix(ZNetView __instance) { ZDO zDO = __instance.GetZDO(); if (zDO != null && zDO.GetFloat("mt_expire", 0f) > 0f && (Object)(object)((Component)__instance).GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } } } public static class Summons { public static int Limit(Player p) { int num = Mathf.Max(Escuelas.Rank(p, Escuela.Invocacion), Escuelas.Rank(p, Escuela.Sangre)); if (num < 6) { if (num < 4) { return 3; } return 4; } return 5; } public static int Used(Player p) { long playerID = p.GetPlayerID(); int num = 0; foreach (Character allCharacter in Character.GetAllCharacters()) { ZNetView component = ((Component)allCharacter).GetComponent(); ZDO val = ((component != null) ? component.GetZDO() : null); if (val != null && !allCharacter.IsDead() && val.GetLong("mt_summoner", 0L) == playerID) { num += ((!val.GetBool("mt_big", false)) ? 1 : 2); } } return num; } public static void Spawn(Player p, string prefab, int count, float seconds, bool big = false, float scale = 1f, int level = 1) { //IL_0070: 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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) int num = count * ((!big) ? 1 : 2); if (Used(p) + num > Limit(p)) { ((Character)p).Message((MessageType)1, Tr.Get("magia_too_many_summons_max_slots", new object[1] { Limit(p) }), 0, (Sprite)null, false); return; } for (int i = 0; i < count; i++) { Vector3 pos = ((Component)p).transform.position + ((Component)p).transform.forward * 2.5f + ((Component)p).transform.right * ((float)i - (float)(count - 1) / 2f) * 1.5f; Color color = (Color)((prefab == "Surtling") ? new Color(1f, 0.5f, 0.12f) : InvocacionVfx.Arcano); InvocacionVfx.Circulo(pos, big ? 2.6f : 1.5f, color); InvocacionVfx.Aparicion(pos, big ? 2.5f : 1.5f, color); GameObject val = Temporary.Spawn(prefab, pos, ((Component)p).transform.rotation, seconds); if ((Object)(object)val == (Object)null) { break; } GameObject ida = val; SpellRunner.After(Mathf.Max(0.5f, seconds - 0.3f), delegate { //IL_0038: 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_0071: 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) if (!((Object)(object)ida == (Object)null)) { Character component2 = ida.GetComponent(); if (!((Object)(object)component2 != (Object)null) || !component2.IsDead()) { InvocacionVfx.Circulo(ida.transform.position, big ? 2.6f : 1.5f, color, 1.4f); InvocacionVfx.Aparicion(ida.transform.position, big ? 2.5f : 1.5f, color); } } }); if (scale != 1f) { Transform transform = val.transform; transform.localScale *= scale; } ZDO zDO = val.GetComponent().GetZDO(); zDO.Set("mt_summoner", p.GetPlayerID()); zDO.Set("mt_big", big); Character component = val.GetComponent(); if (!((Object)(object)component == (Object)null)) { if (level > 1) { component.SetLevel(level); } component.SetTamed(true); } } } } public class GuideLight : MonoBehaviour { private Player _owner; private float _until; private Transform _model; private Transform[] _motes; private static Mesh _mesh; private static List _names; private static Material[] _mats; private static void ApartarBruma(Transform parent) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Fx.Prefab("demister_ball"); if ((Object)(object)val == (Object)null) { return; } MonoBehaviour[] componentsInChildren = val.GetComponentsInChildren(true); foreach (MonoBehaviour val2 in componentsInChildren) { if (((object)val2).GetType().Name != "Demister") { continue; } bool forceDisableInit = ZNetView.m_forceDisableInit; ZNetView.m_forceDisableInit = true; GameObject val3; try { val3 = Object.Instantiate(((Component)val2).gameObject, parent); } finally { ZNetView.m_forceDisableInit = forceDisableInit; } val3.transform.localPosition = Vector3.zero; Renderer[] componentsInChildren2 = val3.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { componentsInChildren2[j].enabled = false; } Light[] componentsInChildren3 = val3.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren3.Length; j++) { ((Behaviour)componentsInChildren3[j]).enabled = false; } MonoBehaviour[] componentsInChildren4 = val3.GetComponentsInChildren(true); foreach (MonoBehaviour val4 in componentsInChildren4) { if (((object)val4).GetType().Name != "Demister") { Object.Destroy((Object)(object)val4); } } MTMagiaPlugin.Log.LogInfo((object)("Espíritu Guía: aparta la bruma (" + ((Object)val3).name + ")")); return; } MTMagiaPlugin.Log.LogWarning((object)"Espíritu Guía: no se encontró el Demister del wisp"); } public static void Spawn(Player p, float seconds) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_003e: 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_007a: 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_0178: 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_00bc: 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_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) GuideLight[] array = Object.FindObjectsByType((FindObjectsSortMode)0); for (int i = 0; i < array.Length; i++) { Object.Destroy((Object)(object)((Component)array[i]).gameObject); } GameObject val = new GameObject("MT_EspirituGuia"); val.transform.position = Target(p, 0f); GuideLight guideLight = val.AddComponent(); guideLight._model = Wisp(val.transform, 1f); val.transform.localScale = Vector3.one * MTMagiaPlugin.EspirituTamano.Value * 0.75f; GameObject val2 = (((Object)(object)guideLight._model == (Object)null) ? Fx.Prefab("demister_ball") : null); if ((Object)(object)val2 != (Object)null) { GameObject val3 = Fx.LocalCopy(val2, Vector3.zero, Quaternion.identity, val.transform); val3.transform.localPosition = Vector3.zero; ParticleSystemForceField[] componentsInChildren = val3.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } Dim(val3, 0.5f); Light[] componentsInChildren2 = val3.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Behaviour)componentsInChildren2[i]).enabled = false; } } ApartarBruma(val.transform); Light obj = val.AddComponent(); obj.type = (LightType)2; obj.range = 28f; obj.intensity = 0.85f; obj.color = new Color(1f, 0.92f, 0.78f); obj.shadows = (LightShadows)0; if ((Object)(object)guideLight._model != (Object)null) { float num = MTMagiaPlugin.EspirituTamano.Value * 0.75f; float num2 = Mathf.Clamp01(MTMagiaPlugin.EspirituOpacidad.Value); Trail(val, 0.28f * num, 0.6f, new Color(0.5f, 0.8f, 1f, 0.8f * num2)); guideLight._motes = (Transform[])(object)new Transform[2]; for (int j = 0; j < 2; j++) { Transform transform = new GameObject("MT_Chispa").transform; transform.SetParent(val.transform, false); Wisp(transform, 0.25f); Trail(((Component)transform).gameObject, 0.07f * num, 0.35f, new Color(0.7f, 0.9f, 1f, 0.9f * num2)); guideLight._motes[j] = transform; } } guideLight._owner = p; guideLight._until = Time.time + seconds; } private static Transform Wisp(Transform parent, float scale) { //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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) if ((Object)(object)_mesh == (Object)null) { _mesh = ObjModel.Load(Path.Combine(MTMagiaPlugin.ModelDir, "espiritu_guia.obj"), out _names); if ((Object)(object)_mesh == (Object)null) { return null; } _mats = (Material[])(object)new Material[_names.Count]; for (int i = 0; i < _names.Count; i++) { float num = Mathf.Clamp01(MTMagiaPlugin.EspirituOpacidad.Value); _mats[i] = Vfx.NewMaterial(Texture2D.whiteTexture, (Color?)((_names[i] == "Nucleo") ? new Color(0.85f, 0.95f, 1f, 1f * num) : ((_names[i] == "Halo") ? new Color(0.3f, 0.6f, 1f, 0.3f * num) : new Color(0.5f, 0.8f, 1f, 0.75f * num)))); } } GameObject val = new GameObject("MT_Wisp"); val.transform.SetParent(parent, false); val.transform.localScale = Vector3.one * scale; val.AddComponent().sharedMesh = _mesh; MeshRenderer obj = val.AddComponent(); ((Renderer)obj).sharedMaterials = _mats; ((Renderer)obj).shadowCastingMode = (ShadowCastingMode)0; return val.transform; } private static void Trail(GameObject go, float width, float time, Color c) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_005d: 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_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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) TrailRenderer val = go.AddComponent(); val.time = time; val.widthCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0f, width), new Keyframe(1f, 0f) }); val.minVertexDistance = 0.05f; ((Renderer)val).material = Vfx.NewMaterial(Vfx.Tex("heal_streak"), c); val.startColor = c; val.endColor = new Color(c.r, c.g, c.b, 0f); ((Renderer)val).shadowCastingMode = (ShadowCastingMode)0; } private static void Dim(GameObject ball, float k) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00e2: 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_00f2: Unknown result type (might be due to invalid IL or missing references) ParticleSystem[] componentsInChildren = ball.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { MainModule main = componentsInChildren[i].main; MinMaxGradient startColor = ((MainModule)(ref main)).startColor; Color color = ((MinMaxGradient)(ref startColor)).color; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(color.r, color.g, color.b, color.a * k)); } Renderer[] componentsInChildren2 = ball.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { Material[] materials = componentsInChildren2[i].materials; foreach (Material val in materials) { if (val.HasProperty("_EmissionColor")) { val.SetColor("_EmissionColor", val.GetColor("_EmissionColor") * k); } if (val.HasProperty("_TintColor")) { Color color2 = val.GetColor("_TintColor"); val.SetColor("_TintColor", new Color(color2.r, color2.g, color2.b, color2.a * k)); } } } } private static Vector3 Target(Player p, float t) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_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) return ((Component)p).transform.position + Vector3.up * 2.6f + ((Component)p).transform.right * 0.85f + ((Component)p).transform.forward * 0.15f + new Vector3(Mathf.Sin(t * 1.3f) * 0.2f, Mathf.Sin(t * 2f) * 0.12f, Mathf.Cos(t * 1.1f) * 0.2f); } private void Update() { //IL_0040: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_owner == (Object)null || ((Character)_owner).IsDead() || Time.time > _until) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } ((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, Target(_owner, Time.time), Time.deltaTime * 4f); if (!((Object)(object)_model == (Object)null)) { float time = Time.time; _model.localRotation = Quaternion.Euler(Mathf.Sin(time * 0.7f) * 25f, time * 140f, Mathf.Cos(time * 0.5f) * 20f); _model.localScale = Vector3.one * (1f + Mathf.Sin(time * 3f) * 0.08f); for (int i = 0; i < _motes.Length; i++) { float num = time * 3.2f + (float)i * (float)Math.PI; _motes[i].localPosition = new Vector3(Mathf.Cos(num) * 0.45f, Mathf.Sin(num * 0.7f + (float)i) * 0.2f, Mathf.Sin(num) * 0.45f); _motes[i].localRotation = Quaternion.Euler(0f, (0f - time) * 300f, 0f); } } } } public static class Weather { private const string Rpc = "MT_Clima"; private const float Range = 300f; private static float _endTime; private static Vector3 _center; private static string _requestedEnv = ""; private static Biome _currentBiome = (Biome)0; private static readonly Dictionary Alternativas = new Dictionary { { "ThunderStorm", new string[3] { "ThunderStorm", "Mistlands_thunder", "Rain" } }, { "Rain", new string[3] { "Rain", "LightRain", "SwampRain" } }, { "SnowStorm", new string[4] { "SnowStorm", "Twilight_SnowStorm", "Snow", "Twilight_Snow" } } }; private static bool _listaEnLog; public static void RegisterRpc() { ZRoutedRpc.instance.Register("MT_Clima", (Action)OnWeather); } public static void Force(Player p, string env, float seconds) { //IL_0010: 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) if (!((Object)(object)p == (Object)null)) { Apply(((Component)p).transform.position, env, seconds); if (ZRoutedRpc.instance != null) { ZRoutedRpc.instance.InvokeRoutedRPC(0L, "MT_Clima", new object[3] { ((Component)p).transform.position, env, seconds }); } } } public static bool Request(Player p, string env, float seconds) { Force(p, env, seconds); return true; } private static bool HasEnv(string name) { if ((Object)(object)EnvMan.instance != (Object)null) { return EnvMan.instance.m_environments.Any((EnvSetup e) => e != null && e.m_name == name); } return false; } private static string ClaroDe(string env) { if (HasEnv(env)) { return env; } Existente(env); return "Clear"; } private static string Existente(string env) { if (!Alternativas.TryGetValue(env, out var value)) { value = new string[1] { env }; } string[] array = value; foreach (string text in array) { if (HasEnv(text)) { return text; } } if (!_listaEnLog) { _listaEnLog = true; MTMagiaPlugin.Log.LogWarning((object)("Clima «" + env + "» no existe en este juego. Climas disponibles: " + string.Join(", ", from e in EnvMan.instance.m_environments where e != null select e.m_name))); } return env; } public static string GetClearEnvironmentForBiome(Biome biome) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 if ((Object)(object)EnvMan.instance == (Object)null) { return "Clear"; } if ((int)biome <= 16) { if ((int)biome == 4) { goto IL_0032; } if ((int)biome == 16) { return ClaroDe("Heath clear"); } } else { if ((int)biome == 64) { goto IL_0032; } if ((int)biome == 512) { return ClaroDe("Mistlands_clear"); } } return "Clear"; IL_0032: return ClaroDe("Twilight_Clear"); } private static void Apply(Vector3 center, string env, float seconds) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0037: 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_006e: Unknown result type (might be due to invalid IL or missing references) Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && !((Object)(object)EnvMan.instance == (Object)null) && !(Vector3.Distance(((Component)localPlayer).transform.position, center) > 300f)) { _center = center; _endTime = Time.time + seconds; _requestedEnv = env; _currentBiome = localPlayer.GetCurrentBiome(); string text = ((env == "Clear") ? GetClearEnvironmentForBiome(_currentBiome) : Existente(env)); EnvMan.instance.SetForceEnvironment(text); if (!string.IsNullOrEmpty(text)) { EnvMan.instance.ForceInstantEnvironmentSwitch(); } } } private static void OnWeather(long sender, Vector3 center, string env, float seconds) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) Apply(center, env, seconds); } public static void Tick() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00b0: Unknown result type (might be due to invalid IL or missing references) if (_endTime <= 0f || (Object)(object)EnvMan.instance == (Object)null) { return; } Player localPlayer = Player.m_localPlayer; if (Time.time > _endTime || (Object)(object)localPlayer == (Object)null || Vector3.Distance(((Component)localPlayer).transform.position, _center) > 300f) { _endTime = 0f; _requestedEnv = ""; _currentBiome = (Biome)0; EnvMan.instance.SetForceEnvironment(""); EnvMan.instance.ForceInstantEnvironmentSwitch(); } else if (_requestedEnv == "Clear") { Biome currentBiome = localPlayer.GetCurrentBiome(); if (currentBiome != _currentBiome) { _currentBiome = currentBiome; EnvMan.instance.SetForceEnvironment(GetClearEnvironmentForBiome(currentBiome)); } } } } public static class Purify { private const string Rpc = "MT_Purificar"; private static readonly string[] Bad = new string[6] { "Burning", "Frost", "Wet", "Tared", "Poison", "Smoked" }; public static void RegisterRpc() { ZRoutedRpc.instance.Register("MT_Purificar", (Action)delegate { Local(Player.m_localPlayer, poisonOnly: false); }); } public static void Local(Player p, bool poisonOnly) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)p == (Object)null)) { string[] array = ((!poisonOnly) ? Bad : new string[1] { "Poison" }); foreach (string text in array) { ((Character)p).GetSEMan().RemoveStatusEffect(StringExtensionMethods.GetStableHashCode(text), false); } Vfx.Heal((Character)(object)p, Vfx.Dorado); } } public static void Send(Player target) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)(object)Player.m_localPlayer) { Local(target, poisonOnly: false); return; } ZRoutedRpc instance = ZRoutedRpc.instance; ZDOID zDOID = ((Character)target).GetZDOID(); instance.InvokeRoutedRPC(((ZDOID)(ref zDOID)).UserID, "MT_Purificar", Array.Empty()); } } [HarmonyPatch(typeof(Game), "Start")] public static class RegisterRpcsPatch { private static void Postfix() { Weather.RegisterRpc(); Purify.RegisterRpc(); } } }