Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of KeenCombat v0.1.2
KeenCombat/KeenCombat.dll
Decompiled 6 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using KeenCombat.HUD; using KeenCombat.Skills; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("KeenCombat")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("KeenCombat")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("d7d97222-a81d-4684-bd01-f7d0b9549eb5")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.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 KeenCombat { public class Class1 { } [BepInPlugin("Bhimas.KeenCombat", "KeenCombat", "0.1.2")] public class Plugin : BaseUnityPlugin { private sealed class ConfigurationManagerAttributes { public bool? Browsable; } [CompilerGenerated] private sealed class <LoadAudioClip>d__65 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string filename; public Action<AudioClip?> onLoaded; private string <pluginDir>5__1; private string <path>5__2; private string <uri>5__3; private UnityWebRequest <request>5__4; private AudioClip <clip>5__5; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <LoadAudioClip>d__65(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <pluginDir>5__1 = null; <path>5__2 = null; <uri>5__3 = null; <request>5__4 = null; <clip>5__5 = null; <>1__state = -2; } private bool MoveNext() { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Invalid comparison between Unknown and I4 bool result; try { switch (<>1__state) { default: result = false; break; case 0: <>1__state = -1; <pluginDir>5__1 = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); <path>5__2 = Path.Combine(<pluginDir>5__1, "audio", filename); if (!File.Exists(<path>5__2)) { <path>5__2 = Path.Combine(<pluginDir>5__1, filename); } if (!File.Exists(<path>5__2)) { Log.LogWarning((object)("Audio file not found: " + filename)); onLoaded(null); result = false; break; } <uri>5__3 = "file:///" + <path>5__2.Replace("\\", "/"); <request>5__4 = UnityWebRequestMultimedia.GetAudioClip(<uri>5__3, (AudioType)14); <>1__state = -3; <>2__current = <request>5__4.SendWebRequest(); <>1__state = 1; result = true; break; case 1: <>1__state = -3; if ((int)<request>5__4.result != 1) { Log.LogWarning((object)("Failed to load audio clip: " + filename + " — " + <request>5__4.error)); onLoaded(null); result = false; } else { <clip>5__5 = DownloadHandlerAudioClip.GetContent(<request>5__4); ((Object)<clip>5__5).name = Path.GetFileNameWithoutExtension(filename); onLoaded(<clip>5__5); result = false; } <>m__Finally1(); break; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } return result; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<request>5__4 != null) { ((IDisposable)<request>5__4).Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string PluginGUID = "Bhimas.KeenCombat"; public const string PluginName = "KeenCombat"; public const string PluginVersion = "0.1.2"; internal static ManualLogSource Log; internal static Plugin instance; internal static ConfigEntry<bool> AutoShieldEnabled; internal static ConfigEntry<bool> ExcludeAxe; internal static ConfigEntry<bool> ExcludeKnife; internal static ConfigEntry<float> HoldThreshold; internal static ConfigEntry<KeyCode> SkillKey; internal static ConfigEntry<float> SkillWidgetX; internal static ConfigEntry<float> SkillWidgetY; internal static ConfigEntry<float> SwordSkillCooldown; internal static ConfigEntry<float> SwordSkillDamage; internal static ConfigEntry<float> SwordBlinkDistance; internal static ConfigEntry<float> SwordAnimSpeed; internal static ConfigEntry<string> SwordAnimName; internal static ConfigEntry<float> SwordHitRadius; internal static ConfigEntry<float> SwordHitExtendFront; internal static ConfigEntry<float> SwordHitExtendBack; internal static ConfigEntry<float> SwordHitHeightTop; internal static ConfigEntry<float> SwordHitHeightBottom; internal static ConfigEntry<float> MaceSkillCooldown; internal static ConfigEntry<float> MaceBuffDuration; internal static ConfigEntry<float> MaceDamageReduction; internal static ConfigEntry<float> MaceRegenPerSec; internal static ConfigEntry<float> AxeSkillCooldown; internal static ConfigEntry<float> AxeBuffDuration; internal static ConfigEntry<float> AxeAttackSpeedBonus; internal static ConfigEntry<float> AxeMoveSpeedBonus; internal static ConfigEntry<float> AtgeirSkillCooldown; internal static ConfigEntry<float> AtgeirSkillDamage; internal static ConfigEntry<float> CrossbowSkillCooldown; internal static ConfigEntry<float> CrossbowSkillDamage; internal static ConfigEntry<float> KnifeSkillCooldown; internal static ConfigEntry<float> KnifeSkillDamage; internal static ConfigEntry<float> KnifeStealthDuration; internal static ConfigEntry<float> GreatswordSkillCooldown; internal static ConfigEntry<float> GreatswordSkillDamage; internal static ConfigEntry<float> GreatswordAnimSpeed; internal static ConfigEntry<float> GreatswordStartSpeed; internal static ConfigEntry<float> GreatswordHoldDuration; internal static ConfigEntry<float> GreatswordSecondSpin; internal static ConfigEntry<float> GreatswordMoveDistance; internal static ConfigEntry<float> BowSkillCooldown; internal static ConfigEntry<float> BowSummonDuration; internal static ConfigEntry<string> BowCreatureMap; internal static ConfigEntry<float> DualKnifeSkillCooldown; internal static ConfigEntry<float> DualKnifeSkillDamage; internal static ConfigEntry<float> DualKnifeLeapBack; internal static ConfigEntry<float> DualKnifeLeapUp; internal static ConfigEntry<int> DualKnifeNumBombs; internal static ConfigEntry<float> DualKnifeSpread; internal static ConfigEntry<float> FistSkillCooldown; internal static ConfigEntry<float> FistSkillDamage; internal static ConfigEntry<float> TwoHandedMaceSkillCooldown; internal static ConfigEntry<float> TwoHandedMaceSkillDamage; internal static ConfigEntry<bool> TestMode; internal static ConfigEntry<float> GlobalAttackSpeed; internal static InputAction? RightTriggerAction; private Harmony _harmony = null; private void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown instance = this; Log = ((BaseUnityPlugin)this).Logger; Log.LogInfo((object)"KeenCombat v0.1.2 loading..."); BindConfig(); RightTriggerAction = new InputAction("RightTrigger", (InputActionType)0, "<Gamepad>/rightTrigger", (string)null, (string)null, (string)null); RightTriggerAction.Enable(); _harmony = new Harmony("Bhimas.KeenCombat"); _harmony.PatchAll(); Log.LogInfo((object)"KeenCombat loaded successfully."); } private void BindConfig() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Expected O, but got Unknown //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Expected O, but got Unknown //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Expected O, but got Unknown //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Expected O, but got Unknown //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Expected O, but got Unknown //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Expected O, but got Unknown //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Expected O, but got Unknown //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Expected O, but got Unknown //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Expected O, but got Unknown //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Expected O, but got Unknown //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Expected O, but got Unknown //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Expected O, but got Unknown //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Expected O, but got Unknown //IL_0738: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Expected O, but got Unknown //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0772: Expected O, but got Unknown //IL_079c: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Expected O, but got Unknown //IL_085c: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Expected O, but got Unknown //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_08be: Expected O, but got Unknown //IL_08e8: Unknown result type (might be due to invalid IL or missing references) //IL_08f2: Expected O, but got Unknown ConfigurationManagerAttributes configurationManagerAttributes = new ConfigurationManagerAttributes { Browsable = false }; AutoShieldEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Shield", "AutoEquipShield", true, "Automatically equip the best shield when equipping a one-handed weapon."); ExcludeAxe = ((BaseUnityPlugin)this).Config.Bind<bool>("Shield", "ExcludeAxe", true, "Don't auto-equip a shield when equipping an axe."); ExcludeKnife = ((BaseUnityPlugin)this).Config.Bind<bool>("Shield", "ExcludeKnife", true, "Don't auto-equip a shield when equipping a knife or dual knife."); HoldThreshold = ((BaseUnityPlugin)this).Config.Bind<float>("Input", "HoldThreshold", 0.25f, new ConfigDescription("Seconds to hold Attack before triggering heavy attack.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SkillKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Input", "SkillKey", (KeyCode)325, new ConfigDescription("Key to activate the equipped weapon's special skill.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "Cooldown", 15f, "Cooldown in seconds for Sword Blink Strike."); SwordSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "DamageMultiplier", 1.1f, "Damage multiplier (1.0 = weapon base damage)."); SwordBlinkDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "BlinkDistance", 8f, new ConfigDescription("Maximum blink distance in meters.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordAnimSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "AnimationSpeed", 1.2f, new ConfigDescription("Speed multiplier for the blink animation.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordAnimName = ((BaseUnityPlugin)this).Config.Bind<string>("Sword Blink Strike", "AnimationName", "battleaxe_secondary", new ConfigDescription("Animator state name for the blink animation.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordHitRadius = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "HitboxRadius", 2.5f, new ConfigDescription("Width (radius in meters) of the blink damage capsule.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordHitExtendFront = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "HitboxExtendFront", 3f, new ConfigDescription("How far the hitbox extends past the blink end point.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordHitExtendBack = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "HitboxExtendBack", 2f, new ConfigDescription("How far the hitbox extends behind the blink start point.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordHitHeightTop = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "HitboxHeightTop", 4.2f, new ConfigDescription("Height of the hitbox above the end position.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SwordHitHeightBottom = ((BaseUnityPlugin)this).Config.Bind<float>("Sword Blink Strike", "HitboxHeightBottom", 2f, new ConfigDescription("How far below ground the hitbox extends.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); MaceSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Mace Bulwark", "Cooldown", 30f, "Cooldown in seconds for Bulwark."); MaceBuffDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Mace Bulwark", "BuffDuration", 10f, "Duration of the Mace Bulwark buff in seconds."); MaceDamageReduction = ((BaseUnityPlugin)this).Config.Bind<float>("Mace Bulwark", "DamageReduction", 0.2f, "Damage reduction while Bulwark is active (0.20 = 20% less damage taken)."); MaceRegenPerSec = ((BaseUnityPlugin)this).Config.Bind<float>("Mace Bulwark", "RegenPerSec", 5f, "HP regeneration per second granted by Bulwark."); AxeSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Axe Frenzy", "Cooldown", 25f, "Cooldown in seconds for Frenzy."); AxeBuffDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Axe Frenzy", "BuffDuration", 8f, "Duration of the Axe Frenzy buff in seconds."); AxeAttackSpeedBonus = ((BaseUnityPlugin)this).Config.Bind<float>("Axe Frenzy", "AttackSpeedBonus", 0.3f, "Attack speed bonus while Frenzy is active (0.30 = 30% faster attacks)."); AxeMoveSpeedBonus = ((BaseUnityPlugin)this).Config.Bind<float>("Axe Frenzy", "MoveSpeedBonus", 0.2f, "Move speed bonus while Frenzy is active (0.20 = 20% faster movement)."); AtgeirSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Atgeir Falcon Blitz", "Cooldown", 20f, "Cooldown in seconds for Falcon Blitz."); AtgeirSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Atgeir Falcon Blitz", "DamageMultiplier", 0.5f, "Damage multiplier per hit (0.50 = 50% of normal attack damage)."); CrossbowSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Crossbow Rapid Fire", "Cooldown", 20f, "Cooldown in seconds for Rapid Fire."); CrossbowSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Crossbow Rapid Fire", "DamageMultiplier", 0.3f, "Damage multiplier per shot (0.30 = 30% of normal bolt damage)."); KnifeSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Knife Assassination", "Cooldown", 20f, "Cooldown in seconds for Assassination."); KnifeSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Knife Assassination", "DamageMultiplier", 2f, "Damage multiplier for the assassination strike (2.0 = 2x normal damage)."); KnifeStealthDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Knife Assassination", "StealthDuration", 8f, "How long stealth lasts before expiring (seconds)."); GreatswordSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Greatsword Whirlwind", "Cooldown", 15f, "Cooldown in seconds for Whirlwind."); GreatswordSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Greatsword Whirlwind", "DamageMultiplier", 0.8f, "Damage multiplier per spin hit (0.80 = 80% of normal weapon damage)."); GreatswordStartSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Greatsword Whirlwind", "StartSpeed", 1f, new ConfigDescription("Starting animation speed for the whirlwind.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); GreatswordAnimSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Greatsword Whirlwind", "PeakAnimSpeed", 4f, new ConfigDescription("Peak animation speed for the whirlwind spin.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); GreatswordHoldDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Greatsword Whirlwind", "SpinDuration", 1.2f, new ConfigDescription("Duration of the first spin in seconds.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); GreatswordSecondSpin = ((BaseUnityPlugin)this).Config.Bind<float>("Greatsword Whirlwind", "SecondSpinDuration", 1f, new ConfigDescription("Duration of the second spin in seconds.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); GreatswordMoveDistance = ((BaseUnityPlugin)this).Config.Bind<float>("Greatsword Whirlwind", "MoveDistance", 10f, new ConfigDescription("How far the player moves forward during Whirlwind (meters).", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); BowSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Bow Primal Rally", "Cooldown", 120f, "Cooldown in seconds for Primal Rally (default 2 minutes)."); BowSummonDuration = ((BaseUnityPlugin)this).Config.Bind<float>("Bow Primal Rally", "SummonDuration", 60f, "How long the summoned creature lasts before despawning (seconds)."); BowCreatureMap = ((BaseUnityPlugin)this).Config.Bind<string>("Bow Primal Rally", "BowCreatureMap", "$item_bow:Boar:0,$item_bow_finewood:Boar:2,$item_bow_huntsman:Wolf:0,$item_bow_draugrfang:BlobElite:0,$item_bow_snipesnap:Seeker:0,$item_bow_ashlands:Asksvin:0,$item_bow_ashlandsroot:Asksvin:0,$item_bow_ashlandsblood:Asksvin:0,$item_bow_ashlandsstorm:Asksvin:0,$bow_trollbone_tw:Troll:0,$bow_blackmetal_tw:Lox:0,$greatbow_blackmetal_tw:Lox:1,$greatbow_dvergr_tw:Dverger:0,$greatbow_moder_tw:Hatchling:2", "Comma-separated bow→creature mappings. Format: bowItemName:CreaturePrefab:starLevel."); DualKnifeSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Dual Knife Poison Mayhem", "Cooldown", 20f, "Cooldown in seconds for Poison Mayhem."); DualKnifeSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Dual Knife Poison Mayhem", "DamageMultiplier", 0.4f, "Damage multiplier per bomb hit (0.40 = 40% of weapon damage, applied as direct + poison)."); DualKnifeLeapBack = ((BaseUnityPlugin)this).Config.Bind<float>("Dual Knife Poison Mayhem", "LeapBackSpeed", 4.5f, new ConfigDescription("Backward leap distance in meters.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); DualKnifeLeapUp = ((BaseUnityPlugin)this).Config.Bind<float>("Dual Knife Poison Mayhem", "LeapUpSpeed", 1.25f, new ConfigDescription("Upward leap height in meters.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); DualKnifeNumBombs = ((BaseUnityPlugin)this).Config.Bind<int>("Dual Knife Poison Mayhem", "NumBombs", 3, new ConfigDescription("Number of ooze bombs dropped.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); DualKnifeSpread = ((BaseUnityPlugin)this).Config.Bind<float>("Dual Knife Poison Mayhem", "BombSpread", 1.5f, new ConfigDescription("Spread radius of the bomb cluster in meters.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); FistSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Fist Onslaught", "Cooldown", 20f, "Cooldown in seconds for Onslaught."); FistSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("Fist Onslaught", "DamageMultiplier", 1f, "Base damage multiplier (1.0 = normal fist damage). Combo hits use 50%, finisher uses 100%."); TwoHandedMaceSkillCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("2H Mace Earthquake", "Cooldown", 15f, "Cooldown in seconds for Earthquake."); TwoHandedMaceSkillDamage = ((BaseUnityPlugin)this).Config.Bind<float>("2H Mace Earthquake", "DamageMultiplier", 0.6f, "Damage multiplier per stomp explosion (0.60 = 60% of normal weapon damage)."); TestMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "TestMode", false, new ConfigDescription("When true, enemies hit by skills survive at 1hp.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); GlobalAttackSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Debug", "GlobalAttackSpeed", 1f, "Global attack animation speed multiplier. 1.0 = normal."); SkillWidgetX = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "SkillWidgetX", 605f, new ConfigDescription("Horizontal position of the skill slot widget.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); SkillWidgetY = ((BaseUnityPlugin)this).Config.Bind<float>("HUD", "SkillWidgetY", -44f, new ConfigDescription("Vertical position of the skill slot widget.", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes })); } internal static Sprite? LoadEmbeddedSprite(string filename) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0159: 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) string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string path = Path.Combine(directoryName, "icons", filename); if (!File.Exists(path)) { path = Path.Combine(directoryName, filename); } if (!File.Exists(path)) { Log.LogWarning((object)("Icon file not found: " + filename)); return null; } byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(64, 64, (TextureFormat)4, false); MethodInfo methodInfo = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { Type type = assembly.GetType("UnityEngine.ImageConversion"); if (!(type == null)) { methodInfo = type.GetMethod("LoadImage", new Type[2] { typeof(Texture2D), typeof(byte[]) }); if (methodInfo != null) { break; } } } if (methodInfo == null) { Log.LogWarning((object)"UnityEngine.ImageConversion.LoadImage not found."); return null; } methodInfo.Invoke(null, new object[2] { val, array }); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } [IteratorStateMachine(typeof(<LoadAudioClip>d__65))] internal static IEnumerator LoadAudioClip(string filename, Action<AudioClip?> onLoaded) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <LoadAudioClip>d__65(0) { filename = filename, onLoaded = onLoaded }; } } } namespace KeenCombat.Skills { public class AtgeirSkill : IWeaponSkill { [CompilerGenerated] private sealed class <FlurryRoutine>d__16 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player player; public ItemData weapon; private bool <isSpear>5__1; private float <hitInterval>5__2; private float <rangeMultiplier>5__3; private float <savedSpeed>5__4; private float <savedRunSpeed>5__5; private float <savedTurnSpeed>5__6; private Vector3 <lockedLookDir>5__7; private Animator <animator>5__8; private GameObject <vfxPrefab>5__9; private GameObject <sfxPrefab>5__10; private int <i>5__11; private int <animIndex>5__12; private Vector3 <vfxPos>5__13; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FlurryRoutine>d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <animator>5__8 = null; <vfxPrefab>5__9 = null; <sfxPrefab>5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Invalid comparison between Unknown and I4 //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_0170: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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_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_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_0236: 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_0252: 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_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Expected O, but got Unknown //IL_0281: 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) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <isSpear>5__1 = (int)weapon.m_shared.m_skillType == 5; <hitInterval>5__2 = (<isSpear>5__1 ? 0.25f : 0.33f); <rangeMultiplier>5__3 = (<isSpear>5__1 ? 2f : 1f); <savedSpeed>5__4 = ((Character)player).m_speed; <savedRunSpeed>5__5 = ((Character)player).m_runSpeed; <savedTurnSpeed>5__6 = ((Character)player).m_turnSpeed; <lockedLookDir>5__7 = ((Component)player).transform.forward; ((Character)player).m_speed = 0f; ((Character)player).m_runSpeed = 0f; ((Character)player).m_turnSpeed = 0f; <animator>5__8 = ((Component)player).GetComponentInChildren<Animator>(); ZNetScene instance = ZNetScene.instance; <vfxPrefab>5__9 = ((instance != null) ? instance.GetPrefab("vfx_crossbow_lightning_fire") : null); ZNetScene instance2 = ZNetScene.instance; <sfxPrefab>5__10 = ((instance2 != null) ? instance2.GetPrefab("sfx_sword_swing") : null); <i>5__11 = 0; break; } case 1: <>1__state = -1; <i>5__11++; break; } if (<i>5__11 < 6 && !((Object)(object)player == (Object)null) && !((Character)player).IsDead()) { ((Component)player).transform.forward = <lockedLookDir>5__7; ((Character)player).m_lookDir = <lockedLookDir>5__7; if ((Object)(object)<animator>5__8 != (Object)null) { if (<isSpear>5__1) { <animator>5__8.SetTrigger("spear_poke"); } else { <animIndex>5__12 = <i>5__11 % 3; <animator>5__8.SetTrigger($"atgeir_attack{<animIndex>5__12}"); } } if ((Object)(object)<vfxPrefab>5__9 != (Object)null) { <vfxPos>5__13 = ((Component)player).transform.position + <lockedLookDir>5__7 * (1.5f * <rangeMultiplier>5__3) + Vector3.up; Object.Instantiate<GameObject>(<vfxPrefab>5__9, <vfxPos>5__13, ((Component)player).transform.rotation); } if ((Object)(object)<sfxPrefab>5__10 != (Object)null) { Object.Instantiate<GameObject>(<sfxPrefab>5__10, ((Component)player).transform.position, ((Component)player).transform.rotation); } ApplyHit(player, weapon, <lockedLookDir>5__7, <rangeMultiplier>5__3); <>2__current = (object)new WaitForSeconds(<hitInterval>5__2); <>1__state = 1; return true; } if ((Object)(object)player != (Object)null) { ((Character)player).m_speed = <savedSpeed>5__4; ((Character)player).m_runSpeed = <savedRunSpeed>5__5; ((Character)player).m_turnSpeed = <savedTurnSpeed>5__6; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Sprite? _icon; private static bool _iconLoaded; public string SkillName => "Falcon Blitz"; public string Description => "Unleash a rapid flurry of strikes, hitting your target six times in quick succession."; public float Cooldown => Plugin.AtgeirSkillCooldown.Value; public string CooldownSEName => "SE_Cooldown_Atgeir"; public Sprite? Icon { get { if (!_iconLoaded) { _icon = Plugin.LoadEmbeddedSprite("FalconBlitzIcon.png"); _iconLoaded = true; } return _icon; } } public bool IsOnCooldown(Player player) { return SE_SkillCooldown.IsOnCooldown(player, CooldownSEName); } public void OnPress(Player player, ItemData weapon) { SE_SkillCooldown.Apply(player, Cooldown, CooldownSEName); if (((Humanoid)player).m_currentAttack != null) { ((Humanoid)player).m_currentAttack.Stop(); ((Humanoid)player).m_previousAttack = ((Humanoid)player).m_currentAttack; ((Humanoid)player).m_currentAttack = null; } ((Humanoid)player).ClearActionQueue(); ((MonoBehaviour)player).StartCoroutine(FlurryRoutine(player, weapon)); } public void OnHold(Player player, ItemData weapon, float heldDuration) { } public void OnRelease(Player player, ItemData weapon, float heldDuration) { } [IteratorStateMachine(typeof(<FlurryRoutine>d__16))] private static IEnumerator FlurryRoutine(Player player, ItemData weapon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FlurryRoutine>d__16(0) { player = player, weapon = weapon }; } private static void ApplyHit(Player player, ItemData weapon, Vector3 direction, float rangeMultiplier = 1f) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0009: 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_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_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_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_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_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_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_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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Invalid comparison between Unknown and I4 //IL_016e: 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_0183: 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_018e: 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_01ad: 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) HitData val = new HitData(); val.m_damage = weapon.GetDamage(); ((DamageTypes)(ref val.m_damage)).Modify(Plugin.AtgeirSkillDamage.Value); val.m_pushForce = 1f; val.m_staggerMultiplier = 1f; val.m_dir = direction; val.m_attacker = ((Character)player).GetZDOID(); val.m_point = ((Component)player).transform.position + direction * 2f; float num = ((weapon.m_shared.m_attack.m_attackRange > 0f) ? (weapon.m_shared.m_attack.m_attackRange * rangeMultiplier) : (3f * rangeMultiplier)); int mask = LayerMask.GetMask(new string[1] { "character" }); Collider[] array = Physics.OverlapSphere(((Component)player).transform.position + direction * (num * 0.5f) + Vector3.up, num * 0.5f, mask); Collider[] array2 = array; foreach (Collider val2 in array2) { Character componentInParent = ((Component)val2).GetComponentInParent<Character>(); if ((Object)(object)componentInParent == (Object)null || (Object)(object)componentInParent == (Object)(object)player || (componentInParent.IsPlayer() && !((Character)player).IsPVPEnabled()) || (int)componentInParent.m_faction == 0) { continue; } Vector3 val3 = ((Component)componentInParent).transform.position - ((Component)player).transform.position; Vector3 normalized = ((Vector3)(ref val3)).normalized; if (!(Vector3.Dot(direction, normalized) < 0.3f)) { val.m_point = ((Component)componentInParent).transform.position; componentInParent.Damage(val); if (Plugin.TestMode.Value && componentInParent.GetHealth() <= 0f) { componentInParent.SetHealth(1f); } } } } } public class AxeSkill : IWeaponSkill { [CompilerGenerated] private sealed class <FrenzyRoutine>d__18 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player player; private Animator <animator>5__1; private ZSyncAnimation <zsync>5__2; private GameObject <vfxPrefab>5__3; private AudioSource <src>5__4; private GameObject <vfx>5__5; private ParticleSystem[] <>s__6; private int <>s__7; private ParticleSystem <ps>5__8; private MainModule <main>5__9; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <FrenzyRoutine>d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) <animator>5__1 = null; <zsync>5__2 = null; <vfxPrefab>5__3 = null; <src>5__4 = null; <vfx>5__5 = null; <>s__6 = null; <ps>5__8 = null; <main>5__9 = default(MainModule); <>1__state = -2; } private bool MoveNext() { //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Expected O, but got Unknown //IL_01b6: 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_020b: 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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: 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) ZNetScene instance; switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } <animator>5__1 = ((Component)player).GetComponentInChildren<Animator>(); if (!_roarLoaded) { <>2__current = ((MonoBehaviour)player).StartCoroutine(Plugin.LoadAudioClip("FrenzyRoar.ogg", delegate(AudioClip? clip) { _cachedRoar = clip; _roarLoaded = true; })); <>1__state = 1; return true; } goto IL_00bc; case 1: <>1__state = -1; goto IL_00bc; case 2: { <>1__state = -1; if ((Object)(object)<animator>5__1 != (Object)null) { <animator>5__1.speed = 1f; } if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } SE_AxeSkillBuff.Apply(player, Plugin.AxeBuffDuration.Value, Plugin.AxeAttackSpeedBonus.Value, Plugin.AxeMoveSpeedBonus.Value); return false; } IL_00bc: if ((Object)(object)<animator>5__1 != (Object)null) { <animator>5__1.speed = 1.5f; } <zsync>5__2 = ((Component)player).GetComponent<ZSyncAnimation>(); if ((Object)(object)<zsync>5__2 != (Object)null) { <zsync>5__2.SetTrigger("emote_roar"); } if ((Object)(object)_cachedRoar != (Object)null) { <src>5__4 = ((Component)player).GetComponent<AudioSource>() ?? ((Component)player).gameObject.AddComponent<AudioSource>(); <src>5__4.spatialBlend = 1f; <src>5__4.PlayOneShot(_cachedRoar); <src>5__4 = null; } instance = ZNetScene.instance; <vfxPrefab>5__3 = ((instance != null) ? instance.GetPrefab("fx_Fader_Roar") : null); if ((Object)(object)<vfxPrefab>5__3 != (Object)null) { <vfx>5__5 = Object.Instantiate<GameObject>(<vfxPrefab>5__3, ((Component)player).transform.position, ((Component)player).transform.rotation); <>s__6 = <vfx>5__5.GetComponentsInChildren<ParticleSystem>(); for (<>s__7 = 0; <>s__7 < <>s__6.Length; <>s__7++) { <ps>5__8 = <>s__6[<>s__7]; <main>5__9 = <ps>5__8.main; ((MainModule)(ref <main>5__9)).startColor = new MinMaxGradient(Color.red); <main>5__9 = default(MainModule); <ps>5__8 = null; } <>s__6 = null; <vfx>5__5 = null; } <>2__current = (object)new WaitForSeconds(1.3333334f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Sprite? _icon; private static bool _iconLoaded; private static AudioClip? _cachedRoar; private static bool _roarLoaded; public string SkillName => "Frenzy"; public string Description => "Let out a battle roar, boosting your attack and movement speed."; public float Cooldown => Plugin.AxeSkillCooldown.Value; public string CooldownSEName => "SE_Cooldown_Axe"; public Sprite? Icon { get { if (!_iconLoaded) { _icon = Plugin.LoadEmbeddedSprite("FrenzyIcon.png"); _iconLoaded = true; } return _icon; } } public bool IsOnCooldown(Player player) { return SE_SkillCooldown.IsOnCooldown(player, CooldownSEName); } public void OnPress(Player player, ItemData weapon) { SE_SkillCooldown.Apply(player, Cooldown, CooldownSEName); ((MonoBehaviour)player).StartCoroutine(FrenzyRoutine(player)); } public void OnHold(Player player, ItemData weapon, float heldDuration) { } public void OnRelease(Player player, ItemData weapon, float heldDuration) { } [IteratorStateMachine(typeof(<FrenzyRoutine>d__18))] private static IEnumerator FrenzyRoutine(Player player) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <FrenzyRoutine>d__18(0) { player = player }; } } public class BowSkill : IWeaponSkill { [CompilerGenerated] private sealed class <>c__DisplayClass19_0 { public Player player; internal void <PrimalRallyRoutine>b__0(AudioClip? clip) { if (!((Object)(object)clip == (Object)null)) { AudioSource val = ((Component)player).GetComponent<AudioSource>() ?? ((Component)player).gameObject.AddComponent<AudioSource>(); val.spatialBlend = 1f; val.PlayOneShot(clip); } } } [CompilerGenerated] private sealed class <PrimalRallyRoutine>d__19 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player player; public ItemData weapon; private <>c__DisplayClass19_0 <>8__1; private ZSyncAnimation <zsync>5__2; private string <prefabName>5__3; private int <starLevel>5__4; private GameObject <creaturePrefab>5__5; private Vector3 <spawnPos>5__6; private GameObject <spawnedObj>5__7; private Character <character>5__8; private ZNetView <nview>5__9; private Tameable <tameable>5__10; private MonsterAI <monsterAI>5__11; private ZNetView <nviewLevel>5__12; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PrimalRallyRoutine>d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <zsync>5__2 = null; <prefabName>5__3 = null; <creaturePrefab>5__5 = null; <spawnedObj>5__7 = null; <character>5__8 = null; <nview>5__9 = null; <tameable>5__10 = null; <monsterAI>5__11 = null; <nviewLevel>5__12 = null; <>1__state = -2; } private bool MoveNext() { //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown //IL_01a4: 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_01c3: 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_01dd: 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_01f1: 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_031e: 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: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass19_0(); <>8__1.player = player; if ((Object)(object)_activeSummon != (Object)null && !_activeSummon.IsDead()) { DespawnSummon(_activeSummon); } <zsync>5__2 = ((Component)<>8__1.player).GetComponent<ZSyncAnimation>(); if ((Object)(object)<zsync>5__2 != (Object)null) { <zsync>5__2.SetTrigger("emote_comehere"); } ((MonoBehaviour)<>8__1.player).StartCoroutine(Plugin.LoadAudioClip("PetCall.ogg", delegate(AudioClip? clip) { if (!((Object)(object)clip == (Object)null)) { AudioSource val = ((Component)<>8__1.player).GetComponent<AudioSource>() ?? ((Component)<>8__1.player).gameObject.AddComponent<AudioSource>(); val.spatialBlend = 1f; val.PlayOneShot(clip); } })); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: { <>1__state = -1; if ((Object)(object)<>8__1.player == (Object)null || ((Character)<>8__1.player).IsDead()) { return false; } (string, int) creatureForBow = GetCreatureForBow(weapon); <prefabName>5__3 = creatureForBow.Item1; <starLevel>5__4 = creatureForBow.Item2; ZNetScene instance = ZNetScene.instance; <creaturePrefab>5__5 = ((instance != null) ? instance.GetPrefab(<prefabName>5__3) : null); if ((Object)(object)<creaturePrefab>5__5 == (Object)null) { Plugin.Log.LogWarning((object)("PrimalRally: prefab '" + <prefabName>5__3 + "' not found!")); return false; } <spawnPos>5__6 = ((Component)<>8__1.player).transform.position + ((Component)<>8__1.player).transform.right * 1.5f - ((Component)<>8__1.player).transform.forward * 1.5f; <spawnedObj>5__7 = Object.Instantiate<GameObject>(<creaturePrefab>5__5, <spawnPos>5__6, Quaternion.identity); <character>5__8 = <spawnedObj>5__7.GetComponent<Character>(); if ((Object)(object)<character>5__8 == (Object)null) { Plugin.Log.LogWarning((object)("PrimalRally: '" + <prefabName>5__3 + "' has no Character!")); Object.Destroy((Object)(object)<spawnedObj>5__7); return false; } if (<starLevel>5__4 > 0) { <character>5__8.SetLevel(<starLevel>5__4 + 1); <nviewLevel>5__12 = <spawnedObj>5__7.GetComponent<ZNetView>(); ZNetView obj = <nviewLevel>5__12; if (obj != null) { ZDO zDO = obj.GetZDO(); if (zDO != null) { zDO.Set(ZDOVars.s_level, <starLevel>5__4 + 1, false); } } <nviewLevel>5__12 = null; } if (<prefabName>5__3 == "Troll" || <prefabName>5__3 == "Lox") { <spawnedObj>5__7.transform.localScale = Vector3.one * 0.5f; } <character>5__8.m_faction = (Faction)0; <nview>5__9 = <spawnedObj>5__7.GetComponent<ZNetView>(); if ((Object)(object)<nview>5__9 != (Object)null && <nview>5__9.GetZDO() != null) { <nview>5__9.GetZDO().Set(ZDOVars.s_tamed, true); <nview>5__9.GetZDO().Set(ZDOVars.s_tamedName, "Ally"); <nview>5__9.GetZDO().Set(ZDOVars.s_follow, <>8__1.player.GetPlayerName()); <nview>5__9.GetZDO().Set("KeenCombat_PrimalRally", true); } <tameable>5__10 = <spawnedObj>5__7.GetComponent<Tameable>(); if ((Object)(object)<tameable>5__10 != (Object)null) { <tameable>5__10.Tame(); } else { <spawnedObj>5__7.AddComponent<Tameable>(); } <monsterAI>5__11 = <spawnedObj>5__7.GetComponent<MonsterAI>(); if ((Object)(object)<monsterAI>5__11 != (Object)null) { <monsterAI>5__11.SetFollowTarget(((Component)<>8__1.player).gameObject); <monsterAI>5__11.m_enableHuntPlayer = false; } _activeSummon = <character>5__8; if (_summonCoroutine != null) { ((MonoBehaviour)<>8__1.player).StopCoroutine(_summonCoroutine); } _summonCoroutine = ((MonoBehaviour)<>8__1.player).StartCoroutine(SummonTimer(<>8__1.player, <character>5__8, Plugin.BowSummonDuration.Value)); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <SummonTimer>d__20 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player player; public Character summon; public float duration; private float <elapsed>5__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SummonTimer>d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <elapsed>5__1 = 0f; break; case 1: <>1__state = -1; break; } if (<elapsed>5__1 < duration) { if ((Object)(object)summon == (Object)null || summon.IsDead()) { _activeSummon = null; return false; } <elapsed>5__1 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)summon != (Object)null && !summon.IsDead()) { DespawnSummon(summon); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const string ZdoKeyPrimalRally = "KeenCombat_PrimalRally"; private static Character? _activeSummon; private static Coroutine? _summonCoroutine; private static Sprite? _icon; private static bool _iconLoaded; public string SkillName => "Primal Rally"; public string Description => "Call upon a wild beast to fight by your side."; public float Cooldown => Plugin.BowSkillCooldown.Value; public string CooldownSEName => "SE_Cooldown_Bow"; public Sprite? Icon { get { if (!_iconLoaded) { _icon = Plugin.LoadEmbeddedSprite("PrimalRallyIcon.png"); _iconLoaded = true; } return _icon; } } public bool IsOnCooldown(Player player) { return SE_SkillCooldown.IsOnCooldown(player, CooldownSEName); } public void OnPress(Player player, ItemData weapon) { SE_SkillCooldown.Apply(player, Cooldown, CooldownSEName); ((MonoBehaviour)player).StartCoroutine(PrimalRallyRoutine(player, weapon)); } public void OnHold(Player player, ItemData weapon, float heldDuration) { } public void OnRelease(Player player, ItemData weapon, float heldDuration) { } [IteratorStateMachine(typeof(<PrimalRallyRoutine>d__19))] private static IEnumerator PrimalRallyRoutine(Player player, ItemData weapon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <PrimalRallyRoutine>d__19(0) { player = player, weapon = weapon }; } [IteratorStateMachine(typeof(<SummonTimer>d__20))] private static IEnumerator SummonTimer(Player player, Character summon, float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SummonTimer>d__20(0) { player = player, summon = summon, duration = duration }; } private static void DespawnSummon(Character summon) { //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) if (!((Object)(object)summon == (Object)null)) { ZNetScene instance = ZNetScene.instance; GameObject val = ((instance != null) ? instance.GetPrefab("fx_perfectdodge") : null); if ((Object)(object)val != (Object)null) { Object.Instantiate<GameObject>(val, ((Component)summon).transform.position, ((Component)summon).transform.rotation); } ZNetView component = ((Component)summon).GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && (Object)(object)ZNetScene.instance != (Object)null) { ZNetScene.instance.Destroy(((Component)summon).gameObject); } else { Object.Destroy((Object)(object)((Component)summon).gameObject); } _activeSummon = null; } } private static (string prefab, int star) GetCreatureForBow(ItemData weapon) { string key = weapon.m_shared.m_name.ToLowerInvariant(); string value = Plugin.BowCreatureMap.Value; Dictionary<string, (string, int)> dictionary = new Dictionary<string, (string, int)>(); string[] array = value.Split(new char[1] { ',' }); foreach (string text in array) { string[] array2 = text.Trim().Split(new char[1] { ':' }); if (array2.Length >= 2) { string key2 = array2[0].Trim().ToLowerInvariant(); string item = array2[1].Trim(); int result; int item2 = ((array2.Length >= 3 && int.TryParse(array2[2].Trim(), out result)) ? result : 0); dictionary[key2] = (item, item2); } } if (dictionary.TryGetValue(key, out var value2)) { return value2; } return ("Neck", 0); } } [HarmonyPatch(typeof(CharacterDrop), "OnDeath")] public static class CharacterDrop_PrimalRally_NoDrop { private static bool Prefix(CharacterDrop __instance) { ZNetView component = ((Component)__instance).GetComponent<ZNetView>(); if (component != null) { ZDO zDO = component.GetZDO(); if (((zDO != null) ? new bool?(zDO.GetBool("KeenCombat_PrimalRally", false)) : null).GetValueOrDefault()) { return false; } } return true; } } [HarmonyPatch(typeof(WearNTear), "Damage")] public static class WearNTear_PrimalRally_NoDamage { private static bool Prefix(WearNTear __instance, HitData hit) { if (hit == null) { return true; } Character attacker = hit.GetAttacker(); if ((Object)(object)attacker == (Object)null) { return true; } ZNetView component = ((Component)attacker).GetComponent<ZNetView>(); if (component != null) { ZDO zDO = component.GetZDO(); if (((zDO != null) ? new bool?(zDO.GetBool("KeenCombat_PrimalRally", false)) : null).GetValueOrDefault()) { return false; } } return true; } } [HarmonyPatch(typeof(Character), "Damage")] public static class Character_Damage_PrimalRallyTrollNerf { private static void Prefix(Character __instance, ref HitData hit) { if (hit == null) { return; } Character attacker = hit.GetAttacker(); if (!((Object)(object)attacker == (Object)null)) { ZNetView component = ((Component)attacker).GetComponent<ZNetView>(); if ((Object)(object)component != (Object)null && component.GetZDO() != null && component.GetZDO().GetBool("KeenCombat_PrimalRally", false) && attacker.m_name == "$enemy_troll") { ((DamageTypes)(ref hit.m_damage)).Modify(0.5f); } } } } public class CrossbowSkill : IWeaponSkill { [CompilerGenerated] private sealed class <RapidFireRoutine>d__18 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player player; public ItemData weapon; private float <savedSpeed>5__1; private float <savedRunSpeed>5__2; private float <savedTurnSpeed>5__3; private float <savedMouseSens>5__4; private Animator <animator>5__5; private GameObject <vfxPrefab>5__6; private GameObject <sfxPrefab>5__7; private int <i>5__8; private Vector3 <shotDir>5__9; private Vector3 <flatDir>5__10; private Vector3 <vfxPos>5__11; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RapidFireRoutine>d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <animator>5__5 = null; <vfxPrefab>5__6 = null; <sfxPrefab>5__7 = null; <>1__state = -2; } private bool MoveNext() { //IL_0161: 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_0166: 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_019b: 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_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_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_0217: 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_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_023b: 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_0251: 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_025c: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: 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_02d3: Expected O, but got Unknown //IL_028b: 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) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <savedSpeed>5__1 = ((Character)player).m_speed; <savedRunSpeed>5__2 = ((Character)player).m_runSpeed; <savedTurnSpeed>5__3 = ((Character)player).m_turnSpeed; ((Character)player).m_speed = <savedSpeed>5__1 * 0.5f; ((Character)player).m_runSpeed = <savedRunSpeed>5__2 * 0.5f; ((Character)player).m_turnSpeed = <savedTurnSpeed>5__3 * 0.3f; PlayerController.m_mouseSens *= 0.3f; <savedMouseSens>5__4 = PlayerController.m_mouseSens / 0.3f; <animator>5__5 = ((Component)player).GetComponentInChildren<Animator>(); ZNetScene instance = ZNetScene.instance; <vfxPrefab>5__6 = ((instance != null) ? instance.GetPrefab("vfx_crossbow_lightning_fire") : null); ZNetScene instance2 = ZNetScene.instance; <sfxPrefab>5__7 = ((instance2 != null) ? instance2.GetPrefab("sfx_arbalest_fire") : null); <i>5__8 = 0; break; } case 1: <>1__state = -1; <i>5__8++; break; } if (<i>5__8 < 6 && !((Object)(object)player == (Object)null) && !((Character)player).IsDead()) { <shotDir>5__9 = (((Object)(object)GameCamera.instance != (Object)null) ? ((Component)GameCamera.instance).transform.forward : ((Component)player).transform.forward); ((Vector3)(ref <shotDir>5__9)).Normalize(); Vector3 val = new Vector3(<shotDir>5__9.x, 0f, <shotDir>5__9.z); <flatDir>5__10 = ((Vector3)(ref val)).normalized; if (<flatDir>5__10 != Vector3.zero) { ((Component)player).transform.rotation = Quaternion.LookRotation(<flatDir>5__10); } if ((Object)(object)<animator>5__5 != (Object)null) { <animator>5__5.SetTrigger("crossbow_fire"); } if ((Object)(object)<vfxPrefab>5__6 != (Object)null) { <vfxPos>5__11 = ((Component)player).transform.position + <shotDir>5__9 * 2f + Vector3.up * 1.2f; Object.Instantiate<GameObject>(<vfxPrefab>5__6, <vfxPos>5__11, Quaternion.LookRotation(<shotDir>5__9)); } if ((Object)(object)<sfxPrefab>5__7 != (Object)null) { Object.Instantiate<GameObject>(<sfxPrefab>5__7, ((Component)player).transform.position, ((Component)player).transform.rotation); } ApplyShot(player, weapon, <shotDir>5__9, 60f); <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } if ((Object)(object)player != (Object)null) { ((Character)player).m_speed = <savedSpeed>5__1; ((Character)player).m_runSpeed = <savedRunSpeed>5__2; ((Character)player).m_turnSpeed = <savedTurnSpeed>5__3; } PlayerController.m_mouseSens = <savedMouseSens>5__4; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const string VfxPrefabName = "vfx_crossbow_lightning_fire"; private const string SfxPrefabName = "sfx_arbalest_fire"; private static Sprite? _icon; private static bool _iconLoaded; public string SkillName => "Rapid Fire"; public string Description => "Unleash a rapid volley of six shots, each aimed where your crossbow is pointing."; public float Cooldown => Plugin.CrossbowSkillCooldown.Value; public string CooldownSEName => "SE_Cooldown_Crossbow"; public Sprite? Icon { get { if (!_iconLoaded) { _icon = Plugin.LoadEmbeddedSprite("RapidFireIcon.png"); _iconLoaded = true; } return _icon; } } public bool IsOnCooldown(Player player) { return SE_SkillCooldown.IsOnCooldown(player, CooldownSEName); } public void OnPress(Player player, ItemData weapon) { SE_SkillCooldown.Apply(player, Cooldown, CooldownSEName); if (((Humanoid)player).m_currentAttack != null) { ((Humanoid)player).m_currentAttack.Stop(); ((Humanoid)player).m_previousAttack = ((Humanoid)player).m_currentAttack; ((Humanoid)player).m_currentAttack = null; } ((Humanoid)player).ClearActionQueue(); ((MonoBehaviour)player).StartCoroutine(RapidFireRoutine(player, weapon)); } public void OnHold(Player player, ItemData weapon, float heldDuration) { } public void OnRelease(Player player, ItemData weapon, float heldDuration) { } [IteratorStateMachine(typeof(<RapidFireRoutine>d__18))] private static IEnumerator RapidFireRoutine(Player player, ItemData weapon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RapidFireRoutine>d__18(0) { player = player, weapon = weapon }; } private static void ApplyShot(Player player, ItemData weapon, Vector3 direction, float range) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0009: 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_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_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_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_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Invalid comparison between Unknown and I4 //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) HitData val = new HitData(); val.m_damage = weapon.GetDamage(); ((DamageTypes)(ref val.m_damage)).Modify(Plugin.CrossbowSkillDamage.Value); val.m_pushForce = 2f; val.m_staggerMultiplier = 1.5f; val.m_dir = direction; val.m_attacker = ((Character)player).GetZDOID(); Vector3 val2 = ((Component)player).transform.position + Vector3.up * 1.4f; int mask = LayerMask.GetMask(new string[4] { "Default", "static_solid", "terrain", "piece" }); float num = range; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(val2, direction, ref val3, range, mask)) { num = ((RaycastHit)(ref val3)).distance; } int mask2 = LayerMask.GetMask(new string[1] { "character" }); RaycastHit[] array = Physics.SphereCastAll(val2, 0.3f, direction, num, mask2); RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit val4 = array2[i]; Character componentInParent = ((Component)((RaycastHit)(ref val4)).collider).GetComponentInParent<Character>(); if (!((Object)(object)componentInParent == (Object)null) && !((Object)(object)componentInParent == (Object)(object)player) && (!componentInParent.IsPlayer() || ((Character)player).IsPVPEnabled()) && (int)componentInParent.m_faction != 0) { val.m_point = ((RaycastHit)(ref val4)).point; componentInParent.Damage(val); if (Plugin.TestMode.Value && componentInParent.GetHealth() <= 0f) { componentInParent.SetHealth(1f); } break; } } } } public class DualKnifeSkill : IWeaponSkill { [CompilerGenerated] private sealed class <PoisonMayhemRoutine>d__16 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player player; public ItemData weapon; private Vector3 <bombOrigin>5__1; private Vector3 <startPos>5__2; private Vector3 <backDir>5__3; private float <backDist>5__4; private float <upHeight>5__5; private float <leapTime>5__6; private ZSyncAnimation <zsync>5__7; private float <elapsed>5__8; private int <numBombs>5__9; private float <spreadRadius>5__10; private GameObject <bombPrefab>5__11; private GameObject <vfxPoison>5__12; private GameObject <vfxCinder>5__13; private float <t>5__14; private float <smoothT>5__15; private Vector3 <horizontal>5__16; private float <arc>5__17; private int <i>5__18; private Vector3 <offset>5__19; private Vector3 <spawnPos>5__20; private GameObject <spawnedBomb>5__21; private Projectile <projectile>5__22; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <PoisonMayhemRoutine>d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <zsync>5__7 = null; <bombPrefab>5__11 = null; <vfxPoison>5__12 = null; <vfxCinder>5__13 = null; <spawnedBomb>5__21 = null; <projectile>5__22 = null; <>1__state = -2; } private bool MoveNext() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_009e: 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_0292: Expected O, but got Unknown //IL_0261: 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_0272: 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_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038a: 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_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_03a1: 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_03c4: 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_0185: 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_01a1: 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_03e8: 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_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Expected O, but got Unknown //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0475: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } <bombOrigin>5__1 = ((Component)player).transform.position; <startPos>5__2 = ((Component)player).transform.position; <backDir>5__3 = -((Component)player).transform.forward; <backDir>5__3.y = 0f; ((Vector3)(ref <backDir>5__3)).Normalize(); <backDist>5__4 = Plugin.DualKnifeLeapBack.Value; <upHeight>5__5 = Plugin.DualKnifeLeapUp.Value; <leapTime>5__6 = 0.4f; <zsync>5__7 = ((Component)player).GetComponent<ZSyncAnimation>(); if ((Object)(object)<zsync>5__7 != (Object)null) { <zsync>5__7.SetTrigger("jump"); } <elapsed>5__8 = 0f; goto IL_022c; case 1: <>1__state = -1; goto IL_022c; case 2: { <>1__state = -1; if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } <numBombs>5__9 = Plugin.DualKnifeNumBombs.Value; <spreadRadius>5__10 = Plugin.DualKnifeSpread.Value; ZNetScene instance = ZNetScene.instance; <bombPrefab>5__11 = ((instance != null) ? instance.GetPrefab("oozebomb_projectile") : null); ZNetScene instance2 = ZNetScene.instance; <vfxPoison>5__12 = ((instance2 != null) ? instance2.GetPrefab("vfx_swamp_poison_hit") : null); ZNetScene instance3 = ZNetScene.instance; <vfxCinder>5__13 = ((instance3 != null) ? instance3.GetPrefab("fx_Cinder_storm_hit") : null); <i>5__18 = 0; break; } case 3: { <>1__state = -1; <i>5__18++; break; } IL_022c: if (<elapsed>5__8 < <leapTime>5__6) { if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } <t>5__14 = <elapsed>5__8 / <leapTime>5__6; <smoothT>5__15 = Mathf.SmoothStep(0f, 1f, <t>5__14); <horizontal>5__16 = <startPos>5__2 + <backDir>5__3 * (<backDist>5__4 * <smoothT>5__15); <arc>5__17 = Mathf.Sin(<t>5__14 * (float)Math.PI) * <upHeight>5__5; ((Component)player).transform.position = new Vector3(<horizontal>5__16.x, <startPos>5__2.y + <arc>5__17, <horizontal>5__16.z); <elapsed>5__8 += Time.deltaTime; <>2__current = null; <>1__state = 1; return true; } if ((Object)(object)player != (Object)null) { ((Component)player).transform.position = <startPos>5__2 + <backDir>5__3 * <backDist>5__4; } <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } if (<i>5__18 < <numBombs>5__9) { if ((Object)(object)player == (Object)null) { return false; } <offset>5__19 = new Vector3(Random.Range(0f - <spreadRadius>5__10, <spreadRadius>5__10), 0.1f, Random.Range(0f - <spreadRadius>5__10, <spreadRadius>5__10)); <spawnPos>5__20 = <bombOrigin>5__1 + <offset>5__19; if ((Object)(object)<vfxPoison>5__12 != (Object)null) { Object.Instantiate<GameObject>(<vfxPoison>5__12, <spawnPos>5__20, Quaternion.identity); } if ((Object)(object)<vfxCinder>5__13 != (Object)null) { Object.Instantiate<GameObject>(<vfxCinder>5__13, <spawnPos>5__20, Quaternion.identity); } if ((Object)(object)<bombPrefab>5__11 != (Object)null) { <spawnedBomb>5__21 = Object.Instantiate<GameObject>(<bombPrefab>5__11, <spawnPos>5__20, Quaternion.identity); <projectile>5__22 = <spawnedBomb>5__21.GetComponent<Projectile>(); if ((Object)(object)<projectile>5__22 != (Object)null) { <projectile>5__22.Setup((Character)(object)player, Vector3.zero, -1f, (HitData)null, (ItemData)null, (ItemData)null); <projectile>5__22.OnHit((Collider)null, <spawnPos>5__20, true, Vector3.up); } <spawnedBomb>5__21 = null; <projectile>5__22 = null; } ApplyBombHit(player, weapon, <spawnPos>5__20); <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 3; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Sprite? _icon; private static bool _iconLoaded; public string SkillName => "Poison Mayhem"; public string Description => "Leap backward and drop a cluster of poison bombs at your feet."; public float Cooldown => Plugin.DualKnifeSkillCooldown.Value; public string CooldownSEName => "SE_Cooldown_DualKnife"; public Sprite? Icon { get { if (!_iconLoaded) { _icon = Plugin.LoadEmbeddedSprite("PoisonMayhemIcon.png"); _iconLoaded = true; } return _icon; } } public bool IsOnCooldown(Player player) { return SE_SkillCooldown.IsOnCooldown(player, CooldownSEName); } public void OnPress(Player player, ItemData weapon) { SE_SkillCooldown.Apply(player, Cooldown, CooldownSEName); ((MonoBehaviour)player).StartCoroutine(PoisonMayhemRoutine(player, weapon)); } public void OnHold(Player player, ItemData weapon, float heldDuration) { } public void OnRelease(Player player, ItemData weapon, float heldDuration) { } [IteratorStateMachine(typeof(<PoisonMayhemRoutine>d__16))] private static IEnumerator PoisonMayhemRoutine(Player player, ItemData weapon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <PoisonMayhemRoutine>d__16(0) { player = player, weapon = weapon }; } private static void ApplyBombHit(Player player, ItemData weapon, Vector3 origin) { //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_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_0027: 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_003b: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Invalid comparison between Unknown and I4 //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) DamageTypes damage = weapon.GetDamage(); float value = Plugin.DualKnifeSkillDamage.Value; float num = damage.m_slash + damage.m_pierce + damage.m_blunt + damage.m_poison; HitData val = new HitData(); val.m_damage.m_slash = damage.m_slash * value; val.m_damage.m_pierce = damage.m_pierce * value; val.m_damage.m_blunt = damage.m_blunt * value; val.m_damage.m_poison = num * value; val.m_pushForce = 1f; val.m_staggerMultiplier = 0.5f; val.m_dir = Vector3.up; val.m_attacker = ((Character)player).GetZDOID(); val.m_point = origin; float num2 = Plugin.DualKnifeSpread.Value + 1.5f; int mask = LayerMask.GetMask(new string[1] { "character" }); Collider[] array = Physics.OverlapSphere(origin + Vector3.up, num2, mask); Collider[] array2 = array; foreach (Collider val2 in array2) { Character componentInParent = ((Component)val2).GetComponentInParent<Character>(); if (!((Object)(object)componentInParent == (Object)null) && !((Object)(object)componentInParent == (Object)(object)player) && (!componentInParent.IsPlayer() || ((Character)player).IsPVPEnabled()) && (int)componentInParent.m_faction != 0) { val.m_point = ((Component)componentInParent).transform.position; componentInParent.Damage(val); } } } } public class FistSkill : IWeaponSkill { [CompilerGenerated] private sealed class <OnslaughtRoutine>d__20 : IEnumerator<object>, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Player player; public ItemData weapon; private Animator <animator>5__1; private Vector3 <attackDir>5__2; private Transform <rightHand>5__3; private float <totalDistance>5__4; private int <comboHits>5__5; private float <hitInterval>5__6; private GameObject <comboVfx>5__7; private GameObject <comboSfx>5__8; private GameObject <finisherVfx>5__9; private GameObject <finisherSfx>5__10; private Vector3 <finisherFistPos>5__11; private int <i>5__12; private Vector3 <fistPos>5__13; private float <movePerHit>5__14; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <OnslaughtRoutine>d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <animator>5__1 = null; <rightHand>5__3 = null; <comboVfx>5__7 = null; <comboSfx>5__8 = null; <finisherVfx>5__9 = null; <finisherSfx>5__10 = null; <>1__state = -2; } private bool MoveNext() { //IL_05fc: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Expected O, but got Unknown //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Expected O, but got Unknown //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_0502: Unknown result type (might be due to invalid IL or missing references) //IL_0507: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_0532: 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_0541: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0550: Unknown result type (might be due to invalid IL or missing references) //IL_0555: 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_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_00e6: 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_02a5: 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_0567: 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_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_0326: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0300: 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_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0590: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Expected O, but got Unknown //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_0349: 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_0354: 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) //IL_03eb: 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) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Expected O, but got Unknown //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_0388: 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_0258: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } <animator>5__1 = ((Component)player).GetComponentInChildren<Animator>(); if ((Object)(object)<animator>5__1 == (Object)null) { return false; } Vector3 val; if (!((Object)(object)GameCamera.instance != (Object)null)) { val = ((Component)player).transform.forward; } else { Vector3 val2 = new Vector3(((Component)GameCamera.instance).transform.forward.x, 0f, ((Component)GameCamera.instance).transform.forward.z); val = ((Vector3)(ref val2)).normalized; } <attackDir>5__2 = val; ((Component)player).transform.rotation = Quaternion.LookRotation(<attackDir>5__2); <rightHand>5__3 = FindBone(player, "RightHand"); <totalDistance>5__4 = 2f; <comboHits>5__5 = 4; <hitInterval>5__6 = 0.4f; ZNetScene instance = ZNetScene.instance; <comboVfx>5__7 = ((instance != null) ? instance.GetPrefab("fx_redlightning_burst") : null); ZNetScene instance2 = ZNetScene.instance; <comboSfx>5__8 = ((instance2 != null) ? instance2.GetPrefab("sfx_bear_claw_attack slash") : null); ZNetScene instance3 = ZNetScene.instance; <finisherVfx>5__9 = ((instance3 != null) ? instance3.GetPrefab("fx_DvergerMage_Mistile_attack") : null); ZNetScene instance4 = ZNetScene.instance; <finisherSfx>5__10 = ((instance4 != null) ? instance4.GetPrefab("sfx_bonemaw_serpent_bite") : null); if ((Object)(object)<comboVfx>5__7 == (Object)null) { Plugin.Log.LogWarning((object)"FistSkill: 'fx_redlightning_burst' not found!"); } if ((Object)(object)<comboSfx>5__8 == (Object)null) { Plugin.Log.LogWarning((object)"FistSkill: 'sfx_bear_claw_attack slash' not found!"); } if ((Object)(object)<finisherVfx>5__9 == (Object)null) { Plugin.Log.LogWarning((object)"FistSkill: 'fx_DvergerMage_Mistile_attack' not found!"); } if ((Object)(object)<finisherSfx>5__10 == (Object)null) { Plugin.Log.LogWarning((object)"FistSkill: 'sfx_bonemaw_serpent_bite' not found!"); } <animator>5__1.speed = 1.2f; <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 1; return true; } case 1: <>1__state = -1; <i>5__12 = 0; goto IL_0440; case 2: <>1__state = -1; <i>5__12++; goto IL_0440; case 3: { <>1__state = -1; if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } ((Component)player).transform.rotation = Quaternion.LookRotation(<attackDir>5__2); <animator>5__1.speed = 1f; <animator>5__1.Play("mace_secondary", 0, 0.5f); Transform transform = ((Component)player).transform; transform.position += <attackDir>5__2 * (<totalDistance>5__4 * 0.3f); <finisherFistPos>5__11 = (((Object)(object)<rightHand>5__3 != (Object)null) ? <rightHand>5__3.position : (((Component)player).transform.position + <attackDir>5__2 * 0.8f + Vector3.up * 1.2f)); if ((Object)(object)<finisherVfx>5__9 != (Object)null) { Object.Instantiate<GameObject>(<finisherVfx>5__9, <finisherFistPos>5__11, Quaternion.LookRotation(<attackDir>5__2)); } if ((Object)(object)<finisherSfx>5__10 != (Object)null) { Object.Instantiate<GameObject>(<finisherSfx>5__10, <finisherFistPos>5__11, ((Component)player).transform.rotation); } <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 4; return true; } case 4: <>1__state = -1; ApplyRectangleHit(player, weapon, <attackDir>5__2, Plugin.FistSkillDamage.Value * 1f, 10f); <>2__current = (object)new WaitForSeconds(0.4f); <>1__state = 5; return true; case 5: { <>1__state = -1; if ((Object)(object)<animator>5__1 != (Object)null) { <animator>5__1.speed = 1f; } return false; } IL_0440: if (<i>5__12 < <comboHits>5__5) { if ((Object)(object)player == (Object)null || ((Character)player).IsDead()) { return false; } ((Component)player).transform.rotation = Quaternion.LookRotation(<attackDir>5__2); <animator>5__1.SetTrigger($"dualaxes{<i>5__12}"); <fistPos>5__13 = (((Object)(object)<rightHand>5__3 != (Object)null) ? <rightHand>5__3.position : (((Component)player).transform.position + <attackDir>5__2 * 0.8f + Vector3.up * 1.2f)); if ((Object)(object)<comboVfx>5__7 != (Object)null) { Object.Instantiate<GameObject>(<comboVfx>5__7, <fistPos>5__13, Quaternion.LookRotation(<attackDir>5__2)); } if ((Object)(object)<comboSfx>5__8 != (Object)null) { Object.Instantiate<GameObject>(<comboSfx>5__8, <fistPos>5__13, ((Component)player).transform.rotation); } ApplyConeHit(player, weapon, <attackDir>5__2, Plugin.FistSkillDamage.Value * 0.5f, 60f, 3f); <movePerHit>5__14 = <totalDistance>5__4 * 0.7f / (float)<comboHits>5__5; Transform transform2 = ((Component)player).transform; transform2.position += <attackDir>5__2 * <movePerHit>5__14; <>2__current = (object)new WaitForSeconds(<hitInterval>5__6); <>1__state = 2; return true; } <>2__current = (object)new WaitForSeconds(0.25f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const string ComboVfxName = "fx_redlightning_burst"; private const string ComboSfxName = "sfx_bear_claw_attack slash"; private const string FinisherVfxName = "fx_DvergerMage_Mistile_attack"; private const string FinisherSfxName = "sfx_bonemaw_serpent_bite"; private static Sprite? _icon; private static bool _iconLoaded; public string SkillName => "Onslaught"; public string Description => "Unleash a ferocious combo, lunging forward with a devastating finishing blow."; public float Cooldown => Plugin.FistSkillCooldown.Value; public string CooldownSEName => "SE_Cooldown_Fist"; public Sprite? Icon { get { if (!_iconLoaded) { _icon = Plugin.LoadEmbeddedSprite("OnslaughtIcon.png"); _iconLoaded = true; } return _icon; } } public bool IsOnCooldown(Player player) { return SE_SkillCooldown.IsOnCooldown(player, CooldownSEName); } public void OnPress(Player player, ItemData weapon) { SE_SkillCooldown.Apply(player, Cooldown, CooldownSEName); if (((Humanoid)player).m_currentAttack != null) { ((Humanoid)player).m_currentAttack.Stop(); ((Humanoid)player).m_previousAttack = ((Humanoid)player).m_currentAttack; ((Humanoid)player).m_currentAttack = null; } ((Humanoid)player).ClearActionQueue(); ((MonoBehaviour)player).StartCoroutine(OnslaughtRoutine(player, weapon)); } public void OnHold(Player player, ItemData weapon, float heldDuration) { } public void OnRelease(Player player, ItemData weapon, float heldDuration) { } [IteratorStateMachine(typeof(<OnslaughtRoutine>d__20))] private static IEnumerator OnslaughtRoutine(Player player, ItemData weapon) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <OnslaughtRoutine>d__20(0) { player = player, weapon = weapon }; } private static Transform? FindBone(Player player, string boneName) { Transform[] componentsInChildren = ((Component)player).GetComponentsInChildren<Transform>(); foreach (Transform val in componentsInChildren) { if (((Object)val).name == boneName) { return val; } } return null; } private static void ApplyConeHit(Player player, ItemData weapon, Vector3 direction, float damageMultiplier, float coneAngle, float range) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0009: 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_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_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_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_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_0073: 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_00ea: Invalid comparison between Unknown and I4 //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_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) HitData val = new HitData(); val.m_damage = weapon.GetDamage(); ((DamageTypes)(ref val.m_damage)).Modify(damageMultiplier); val.m_pushForce = 2f; val.m_staggerMultiplier = 1f; val.m_dir = direction; val.m_attacker = ((Character)player).GetZDOID(); int mask = LayerMask.GetMask(new string[1] { "character" }); Collider[] array = Physics.OverlapSphere(((Component)player).transform.position + Vector3.up + direction, range, mask); Collider[] array2 = array; foreach (Collider val2 in array2) {