using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Mage.Weapon; using On.EntityStates.Engi.EngiMissilePainter; using On.EntityStates.Mage.Weapon; using On.RoR2; using On.RoR2.Skills; using R2API; using R2API.Utils; using RoR2; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Skills; using Smite_Items.Artifact; using Smite_Items.Equipment; using Smite_Items.Equipment.EliteEquipment; using Smite_Items.Items; using Smite_Items.Utils; using Smite_Items.Utils.Components; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Smite Items")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+5bc82e13ef7a2b829e566dec00be714fcf36c73c")] [assembly: AssemblyProduct("Smite Items")] [assembly: AssemblyTitle("Smite Items")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Smite_Items { [BepInPlugin("com.irule4567.SmiteItems", "Smite Items", "1.2.0")] [BepInDependency("com.bepis.r2api", "5.3.0")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { public const string ModGuid = "com.irule4567.SmiteItems"; public const string ModName = "Smite Items"; public const string ModVer = "1.2.0"; public static AssetBundle MainAssets; public static Dictionary ShaderLookup = new Dictionary { { "stubbed hopoo games/deferred/standard", "shaders/deferred/hgstandard" } }; public List Artifacts = new List(); public List Items = new List(); public List Equipments = new List(); public List EliteEquipments = new List(); public static ManualLogSource ModLogger; private void Awake() { ModLogger = ((BaseUnityPlugin)this).Logger; using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Smite_Items.smiteitemsassets")) { MainAssets = AssetBundle.LoadFromStream(stream); } using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("Smite_Items.SmiteItems.bnk")) { byte[] array = new byte[stream2.Length]; stream2.Read(array, 0, array.Length); SoundBanks.Add(array); } ShaderConversion(MainAssets); foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)) select type) { ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item); if (ValidateArtifact(artifactBase, Artifacts)) { artifactBase.Init(((BaseUnityPlugin)this).Config); } } foreach (Type item2 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)) select type) { ItemBase itemBase = (ItemBase)Activator.CreateInstance(item2); if (ValidateItem(itemBase, Items)) { itemBase.Init(((BaseUnityPlugin)this).Config); } } foreach (Type item3 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase)) select type) { EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item3); if (ValidateEquipment(equipmentBase, Equipments)) { equipmentBase.Init(((BaseUnityPlugin)this).Config); } } foreach (Type item4 in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase)) select type) { EliteEquipmentBase eliteEquipmentBase = (EliteEquipmentBase)Activator.CreateInstance(item4); if (ValidateEliteEquipment(eliteEquipmentBase, EliteEquipments)) { eliteEquipmentBase.Init(((BaseUnityPlugin)this).Config); } } } public static void ShaderConversion(AssetBundle assets) { foreach (Material item in from material in assets.LoadAllAssets() where ((Object)material.shader).name.StartsWith("stubbed") select material) { Shader val = LegacyResourcesAPI.Load(ShaderLookup[((Object)item.shader).name.ToLowerInvariant()]); if (Object.op_Implicit((Object)(object)val)) { item.shader = val; } } } public bool ValidateArtifact(ArtifactBase artifact, List artifactList) { bool value = ((BaseUnityPlugin)this).Config.Bind("Artifact: " + artifact.ArtifactName, "Enable Artifact?", true, "Should this artifact appear for selection?").Value; if (value) { artifactList.Add(artifact); } return value; } public bool ValidateItem(ItemBase item, List itemList) { string text = item.ItemName.Replace("'", string.Empty); Debug.Log((object)("name in main: " + text)); bool value = ((BaseUnityPlugin)this).Config.Bind("Item: " + item.ItemName, "Enable Item?", true, "Should this item appear in runs?").Value; bool value2 = ((BaseUnityPlugin)this).Config.Bind("Item: " + item.ItemName, "Blacklist Item from AI Use?", false, "Should the AI not be able to obtain this item?").Value; if (value) { itemList.Add(item); if (value2) { item.AIBlacklisted = true; } } return value; } public bool ValidateEquipment(EquipmentBase equipment, List equipmentList) { if (((BaseUnityPlugin)this).Config.Bind("Equipment: " + equipment.EquipmentName, "Enable Equipment?", true, "Should this equipment appear in runs?").Value) { equipmentList.Add(equipment); return true; } return false; } public bool ValidateEliteEquipment(EliteEquipmentBase eliteEquipment, List eliteEquipmentList) { if (((BaseUnityPlugin)this).Config.Bind("Equipment: " + eliteEquipment.EliteEquipmentName, "Enable Elite Equipment?", true, "Should this elite equipment appear in runs? If disabled, the associated elite will not appear in runs either.").Value) { eliteEquipmentList.Add(eliteEquipment); return true; } return false; } } } namespace Smite_Items.Utils { public static class ItemHelpers { public static RendererInfo[] ItemDisplaySetup(GameObject obj, bool debugmode = false) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) List list = new List(); MeshRenderer[] componentsInChildren = obj.GetComponentsInChildren(); if (componentsInChildren.Length != 0) { list.AddRange((IEnumerable)(object)componentsInChildren); } SkinnedMeshRenderer[] componentsInChildren2 = obj.GetComponentsInChildren(); if (componentsInChildren2.Length != 0) { list.AddRange((IEnumerable)(object)componentsInChildren2); } RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[list.Count]; for (int i = 0; i < list.Count; i++) { if (debugmode) { ((Component)list[i]).gameObject.AddComponent().Renderer = list[i]; } array[i] = new RendererInfo { defaultMaterial = ((list[i] is SkinnedMeshRenderer) ? list[i].sharedMaterial : list[i].material), renderer = list[i], defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false }; } return array; } public static string OrderManifestLoreFormatter(string deviceName, string estimatedDelivery, string sentTo, string trackingNumber, string devicePickupDesc, string shippingMethod, string orderDetails) { string[] value = new string[19] { "Estimated Delivery:Sent To:", "" + estimatedDelivery + "" + sentTo + "", "", " Shipping Details:\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0", "", "-Order: " + deviceName + "", "Tracking Number: " + trackingNumber + "", "", "-Order Description: " + devicePickupDesc + "", "", "-Shipping Method: " + shippingMethod + "", "", "", "", "-Order Details: " + orderDetails + "", "", "", "", "Delivery being brought to you by the brand new Orbital Drop-Crate System (TM). No refunds." }; return string.Join("\n", value); } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float duration) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = duration; } } } public static void RefreshTimedBuffs(CharacterBody body, BuffDef buffDef, float taperStart, float taperDuration) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || body.GetBuffCount(buffDef) <= 0) { return; } int num = 0; foreach (TimedBuff timedBuff in body.timedBuffs) { if (buffDef.buffIndex == timedBuff.buffIndex) { timedBuff.timer = taperStart + (float)num * taperDuration; num++; } } } public static DotIndex FindAssociatedDotForBuff(BuffDef buff) { return (DotIndex)Array.FindIndex(DotController.dotDefs, (DotDef dotDef) => (Object)(object)dotDef.associatedBuff == (Object)(object)buff); } } public static class MathHelpers { public static string FloatToPercentageString(float number, float numberBase = 100f) { return (number * numberBase).ToString("##0") + "%"; } public static Vector3 ClosestPointOnSphereToPoint(Vector3 origin, float radius, Vector3 targetPosition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Vector3 val = targetPosition - origin; val = Vector3.Normalize(val); val *= radius; return origin + val; } public static List DistributePointsEvenlyAroundSphere(int points, float radius, Vector3 origin) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0076: Unknown result type (might be due to invalid IL or missing references) List list = new List(); double num = Math.PI * (3.0 - Math.Sqrt(5.0)); for (int i = 0; i < points; i++) { int num2 = 1 - i / (points - 1) * 2; double num3 = Math.Sqrt(1 - num2 * num2); double num4 = num * (double)i; float num5 = (float)(Math.Cos(num4) * num3); float num6 = (float)(Math.Sin(num4) * num3); Vector3 val = origin + new Vector3(num5, (float)num2, num6); list.Add(val * radius); } return list; } public static List DistributePointsEvenlyAroundCircle(int points, float radius, Vector3 origin, float angleOffset = 0f) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector3 item = default(Vector3); for (int i = 0; i < points; i++) { double num = Math.PI * 2.0 / (double)points * (double)i + (double)angleOffset; ((Vector3)(ref item))..ctor((float)((double)radius * Math.Cos(num) + (double)origin.x), origin.y, (float)((double)radius * Math.Sin(num) + (double)origin.z)); list.Add(item); } return list; } public static Vector3 GetPointOnUnitSphereCap(Quaternion targetDirection, float angle) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) float num = Random.Range(0f, angle) * (MathF.PI / 180f); Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * Mathf.Sin(num); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, val.y, Mathf.Cos(num)); return targetDirection * val2; } public static Vector3 GetPointOnUnitSphereCap(Vector3 targetDirection, float angle) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) return GetPointOnUnitSphereCap(Quaternion.LookRotation(targetDirection), angle); } public static Vector3 RandomPointOnCircle(Vector3 origin, float radius, Xoroshiro128Plus random) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) float num = random.RangeFloat(0f, MathF.PI * 2f); return origin + new Vector3(Mathf.Cos(num), 0f, Mathf.Sin(num)) * radius; } public static float InverseHyperbolicScaling(float baseValue, float additionalValue, float maxValue, int itemCount) { return baseValue + (maxValue - baseValue) * (1f - 1f / (1f + additionalValue * (float)(itemCount - 1))); } } public static class MiscUtils { public static Vector3? RaycastToDirection(Vector3 position, float maxDistance, Vector3 direction, int layer) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Ray(position, direction), ref val, maxDistance, layer, (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val)).point; } return null; } public static IEnumerable Shuffle(this IEnumerable toShuffle, Xoroshiro128Plus random) { List list = new List(); foreach (T item in toShuffle) { list.Insert(random.RangeInt(0, list.Count + 1), item); } return list; } public static Vector3 FindClosestNodeToPosition(Vector3 position, HullClassification hullClassification, bool checkAirNodes = false) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) NodeGraph val = (checkAirNodes ? SceneInfo.instance.airNodes : SceneInfo.instance.groundNodes); NodeIndex val2 = val.FindClosestNode(position, hullClassification, float.PositiveInfinity); if (val2 != NodeIndex.invalid) { Vector3 result = default(Vector3); val.GetNodePosition(val2, ref result); return result; } Main.ModLogger.LogInfo((object)$"No closest node to be found for XYZ: {position}, returning 0,0,0"); return Vector3.zero; } public static bool TeleportBody(CharacterBody characterBody, GameObject target, GameObject teleportEffect, HullClassification hullClassification, Xoroshiro128Plus rng, float minDistance = 20f, float maxDistance = 45f, bool teleportAir = false) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_0084: 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) if (!Object.op_Implicit((Object)(object)characterBody)) { return false; } SpawnCard val = ScriptableObject.CreateInstance(); val.hullSize = hullClassification; val.nodeGraphType = (GraphType)(teleportAir ? 1 : 0); val.prefab = Resources.Load("SpawnCards/HelperPrefab"); GameObject val2 = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest(val, new DirectorPlacementRule { placementMode = (PlacementMode)1, position = target.transform.position, minDistance = minDistance, maxDistance = maxDistance }, rng)); if (Object.op_Implicit((Object)(object)val2)) { TeleportHelper.TeleportBody(characterBody, val2.transform.position); if (Object.op_Implicit((Object)(object)teleportEffect)) { EffectManager.SimpleEffect(teleportEffect, val2.transform.position, Quaternion.identity, true); } Object.Destroy((Object)(object)val2); Object.Destroy((Object)(object)val); return true; } Object.Destroy((Object)(object)val); return false; } public static Vector3? AboveTargetVectorFromDamageInfo(DamageInfo damageInfo, float distanceAboveTarget) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) if (damageInfo.rejected || !Object.op_Implicit((Object)(object)damageInfo.attacker)) { return null; } CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { TeamMask enemyTeams = TeamMask.GetEnemyTeams(component.teamComponent.teamIndex); HurtBox val = new SphereSearch { radius = 1f, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = damageInfo.position }.RefreshCandidates().FilterCandidatesByHurtBoxTeam(enemyTeams).OrderCandidatesByDistance() .FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes() .FirstOrDefault(); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && Object.op_Implicit((Object)(object)val.healthComponent.body)) { CharacterBody body = val.healthComponent.body; Vector3 val2 = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f)); Vector3? val3 = RaycastToDirection(val2, distanceAboveTarget, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (val3.HasValue) { return val3.Value; } return val2 + Vector3.up * distanceAboveTarget; } } return null; } public static Vector3? AboveTargetBody(CharacterBody body, float distanceAbove) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body)) { return null; } Vector3 val = body.mainHurtBox.collider.ClosestPointOnBounds(body.transform.position + new Vector3(0f, 10000f, 0f)); Vector3? val2 = RaycastToDirection(val, distanceAbove, Vector3.up, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (val2.HasValue) { return val2.Value; } return val + Vector3.up * distanceAbove; } public static Dictionary GetAimSurfaceAlignmentInfo(Ray ray, int layerMask, float distance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); RaycastHit val = default(RaycastHit); if (!Physics.Raycast(ray, ref val, distance, layerMask, (QueryTriggerInteraction)1)) { Main.ModLogger.LogInfo((object)$"GetAimSurfaceAlignmentInfo did not hit anything in the aim direction on the specified layer ({layerMask})."); return null; } Vector3 point = ((RaycastHit)(ref val)).point; Vector3 val2 = Vector3.Cross(((Ray)(ref ray)).direction, Vector3.up); Vector3 val3 = Vector3.ProjectOnPlane(((RaycastHit)(ref val)).normal, val2); Vector3 value = Vector3.Cross(val2, val3); dictionary.Add("Position", point); dictionary.Add("Right", val2); dictionary.Add("Forward", value); dictionary.Add("Up", val3); return dictionary; } } public static class NetworkingHelpers { public static T GetObjectFromNetIdValue(uint netIdValue) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) NetworkInstanceId key = default(NetworkInstanceId); ((NetworkInstanceId)(ref key))..ctor(netIdValue); NetworkIdentity value = null; if (NetworkServer.active) { NetworkServer.objects.TryGetValue(key, out value); } else { ClientScene.objects.TryGetValue(key, out value); } if (Object.op_Implicit((Object)(object)value)) { T component = ((Component)value).GetComponent(); if (component != null) { return component; } } return default(T); } } } namespace Smite_Items.Utils.Components { public class MaterialControllerComponents { public class HGControllerFinder : MonoBehaviour { public Renderer Renderer; public Material Material; public void Start() { if (Object.op_Implicit((Object)(object)Renderer)) { Material = Renderer.materials[0]; if (Object.op_Implicit((Object)(object)Material)) { switch (((Object)Material.shader).name) { case "Hopoo Games/Deferred/Standard": { HGStandardController hGStandardController = ((Component)this).gameObject.AddComponent(); hGStandardController.Material = Material; hGStandardController.Renderer = Renderer; break; } case "Hopoo Games/FX/Cloud Remap": { HGCloudRemapController hGCloudRemapController = ((Component)this).gameObject.AddComponent(); hGCloudRemapController.Material = Material; hGCloudRemapController.Renderer = Renderer; break; } case "Hopoo Games/FX/Cloud Intersection Remap": { HGIntersectionController hGIntersectionController = ((Component)this).gameObject.AddComponent(); hGIntersectionController.Material = Material; hGIntersectionController.Renderer = Renderer; break; } } } } Object.Destroy((Object)(object)this); } } public class HGStandardController : MonoBehaviour { public enum _RampInfoEnum { TwoTone = 0, SmoothedTwoTone = 1, Unlitish = 3, Subsurface = 4, Grass = 5 } public enum _DecalLayerEnum { Default, Environment, Character, Misc } public enum _CullEnum { Off, Front, Back } public enum _PrintDirectionEnum { BottomUp = 0, TopDown = 1, BackToFront = 3 } public Material Material; public Renderer Renderer; public string MaterialName; public bool _EnableCutout; public Color _Color; public Texture _MainTex; public Vector2 _MainTexScale; public Vector2 _MainTexOffset; [Range(0f, 5f)] public float _NormalStrength; public Texture _NormalTex; public Vector2 _NormalTexScale; public Vector2 _NormalTexOffset; public Color _EmColor; public Texture _EmTex; [Range(0f, 10f)] public float _EmPower; [Range(0f, 1f)] public float _Smoothness; public bool _IgnoreDiffuseAlphaForSpeculars; public _RampInfoEnum _RampChoice; public _DecalLayerEnum _DecalLayer; [Range(0f, 1f)] public float _SpecularStrength; [Range(0.1f, 20f)] public float _SpecularExponent; public _CullEnum _Cull_Mode; public bool _EnableDither; [Range(0f, 1f)] public float _FadeBias; public bool _EnableFresnelEmission; public Texture _FresnelRamp; [Range(0.1f, 20f)] public float _FresnelPower; public Texture _FresnelMask; [Range(0f, 20f)] public float _FresnelBoost; public bool _EnablePrinting; [Range(-25f, 25f)] public float _SliceHeight; [Range(0f, 10f)] public float _PrintBandHeight; [Range(0f, 1f)] public float _PrintAlphaDepth; public Texture _PrintAlphaTexture; public Vector2 _PrintAlphaTextureScale; public Vector2 _PrintAlphaTextureOffset; [Range(0f, 10f)] public float _PrintColorBoost; [Range(0f, 4f)] public float _PrintAlphaBias; [Range(0f, 1f)] public float _PrintEmissionToAlbedoLerp; public _PrintDirectionEnum _PrintDirection; public Texture _PrintRamp; [Range(-10f, 10f)] public float _EliteBrightnessMin; [Range(-10f, 10f)] public float _EliteBrightnessMax; public bool _EnableSplatmap; public bool _UseVertexColorsInstead; [Range(0f, 1f)] public float _BlendDepth; public Texture _SplatmapTex; public Vector2 _SplatmapTexScale; public Vector2 _SplatmapTexOffset; [Range(0f, 20f)] public float _SplatmapTileScale; public Texture _GreenChannelTex; public Texture _GreenChannelNormalTex; [Range(0f, 1f)] public float _GreenChannelSmoothness; [Range(-2f, 5f)] public float _GreenChannelBias; public Texture _BlueChannelTex; public Texture _BlueChannelNormalTex; [Range(0f, 1f)] public float _BlueChannelSmoothness; [Range(-2f, 5f)] public float _BlueChannelBias; public bool _EnableFlowmap; public Texture _FlowTexture; public Texture _FlowHeightmap; public Vector2 _FlowHeightmapScale; public Vector2 _FlowHeightmapOffset; public Texture _FlowHeightRamp; public Vector2 _FlowHeightRampScale; public Vector2 _FlowHeightRampOffset; [Range(-1f, 1f)] public float _FlowHeightBias; [Range(0.1f, 20f)] public float _FlowHeightPower; [Range(0.1f, 20f)] public float _FlowEmissionStrength; [Range(0f, 15f)] public float _FlowSpeed; [Range(0f, 5f)] public float _MaskFlowStrength; [Range(0f, 5f)] public float _NormalFlowStrength; [Range(0f, 10f)] public float _FlowTextureScaleFactor; public bool _EnableLimbRemoval; public void Start() { GrabMaterialValues(); } public void GrabMaterialValues() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_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_03fe: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { _EnableCutout = Material.IsKeywordEnabled("CUTOUT"); _Color = Material.GetColor("_Color"); _MainTex = Material.GetTexture("_MainTex"); _MainTexScale = Material.GetTextureScale("_MainTex"); _MainTexOffset = Material.GetTextureOffset("_MainTex"); _NormalStrength = Material.GetFloat("_NormalStrength"); _NormalTex = Material.GetTexture("_NormalTex"); _NormalTexScale = Material.GetTextureScale("_NormalTex"); _NormalTexOffset = Material.GetTextureOffset("_NormalTex"); _EmColor = Material.GetColor("_EmColor"); _EmTex = Material.GetTexture("_EmTex"); _EmPower = Material.GetFloat("_EmPower"); _Smoothness = Material.GetFloat("_Smoothness"); _IgnoreDiffuseAlphaForSpeculars = Material.IsKeywordEnabled("FORCE_SPEC"); _RampChoice = (_RampInfoEnum)Material.GetFloat("_RampInfo"); _DecalLayer = (_DecalLayerEnum)Material.GetFloat("_DecalLayer"); _SpecularStrength = Material.GetFloat("_SpecularStrength"); _SpecularExponent = Material.GetFloat("_SpecularExponent"); _Cull_Mode = (_CullEnum)Material.GetFloat("_Cull"); _EnableDither = Material.IsKeywordEnabled("DITHER"); _FadeBias = Material.GetFloat("_FadeBias"); _EnableFresnelEmission = Material.IsKeywordEnabled("FRESNEL_EMISSION"); _FresnelRamp = Material.GetTexture("_FresnelRamp"); _FresnelPower = Material.GetFloat("_FresnelPower"); _FresnelMask = Material.GetTexture("_FresnelMask"); _FresnelBoost = Material.GetFloat("_FresnelBoost"); _EnablePrinting = Material.IsKeywordEnabled("PRINT_CUTOFF"); _SliceHeight = Material.GetFloat("_SliceHeight"); _PrintBandHeight = Material.GetFloat("_SliceBandHeight"); _PrintAlphaDepth = Material.GetFloat("_SliceAlphaDepth"); _PrintAlphaTexture = Material.GetTexture("_SliceAlphaTex"); _PrintAlphaTextureScale = Material.GetTextureScale("_SliceAlphaTex"); _PrintAlphaTextureOffset = Material.GetTextureOffset("_SliceAlphaTex"); _PrintColorBoost = Material.GetFloat("_PrintBoost"); _PrintAlphaBias = Material.GetFloat("_PrintBias"); _PrintEmissionToAlbedoLerp = Material.GetFloat("_PrintEmissionToAlbedoLerp"); _PrintDirection = (_PrintDirectionEnum)Material.GetFloat("_PrintDirection"); _PrintRamp = Material.GetTexture("_PrintRamp"); _EliteBrightnessMin = Material.GetFloat("_EliteBrightnessMin"); _EliteBrightnessMax = Material.GetFloat("_EliteBrightnessMax"); _EnableSplatmap = Material.IsKeywordEnabled("SPLATMAP"); _UseVertexColorsInstead = Material.IsKeywordEnabled("USE_VERTEX_COLORS"); _BlendDepth = Material.GetFloat("_Depth"); _SplatmapTex = Material.GetTexture("_SplatmapTex"); _SplatmapTexScale = Material.GetTextureScale("_SplatmapTex"); _SplatmapTexOffset = Material.GetTextureOffset("_SplatmapTex"); _SplatmapTileScale = Material.GetFloat("_SplatmapTileScale"); _GreenChannelTex = Material.GetTexture("_GreenChannelTex"); _GreenChannelNormalTex = Material.GetTexture("_GreenChannelNormalTex"); _GreenChannelSmoothness = Material.GetFloat("_GreenChannelSmoothness"); _GreenChannelBias = Material.GetFloat("_GreenChannelBias"); _BlueChannelTex = Material.GetTexture("_BlueChannelTex"); _BlueChannelNormalTex = Material.GetTexture("_BlueChannelNormalTex"); _BlueChannelSmoothness = Material.GetFloat("_BlueChannelSmoothness"); _BlueChannelBias = Material.GetFloat("_BlueChannelBias"); _EnableFlowmap = Material.IsKeywordEnabled("FLOWMAP"); _FlowTexture = Material.GetTexture("_FlowTex"); _FlowHeightmap = Material.GetTexture("_FlowHeightmap"); _FlowHeightmapScale = Material.GetTextureScale("_FlowHeightmap"); _FlowHeightmapOffset = Material.GetTextureOffset("_FlowHeightmap"); _FlowHeightRamp = Material.GetTexture("_FlowHeightRamp"); _FlowHeightRampScale = Material.GetTextureScale("_FlowHeightRamp"); _FlowHeightRampOffset = Material.GetTextureOffset("_FlowHeightRamp"); _FlowHeightBias = Material.GetFloat("_FlowHeightBias"); _FlowHeightPower = Material.GetFloat("_FlowHeightPower"); _FlowEmissionStrength = Material.GetFloat("_FlowEmissionStrength"); _FlowSpeed = Material.GetFloat("_FlowSpeed"); _MaskFlowStrength = Material.GetFloat("_FlowMaskStrength"); _NormalFlowStrength = Material.GetFloat("_FlowNormalStrength"); _FlowTextureScaleFactor = Material.GetFloat("_FlowTextureScaleFactor"); _EnableLimbRemoval = Material.IsKeywordEnabled("LIMBREMOVAL"); MaterialName = ((Object)Material).name; } } public void Update() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_07a1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer)) { GrabMaterialValues(); PutMaterialIntoMeshRenderer(Renderer, Material); } SetShaderKeywordBasedOnBool(_EnableCutout, Material, "CUTOUT"); Material.SetColor("_Color", _Color); if (Object.op_Implicit((Object)(object)_MainTex)) { Material.SetTexture("_MainTex", _MainTex); Material.SetTextureScale("_MainTex", _MainTexScale); Material.SetTextureOffset("_MainTex", _MainTexOffset); } else { Material.SetTexture("_MainTex", (Texture)null); } Material.SetFloat("_NormalStrength", _NormalStrength); if (Object.op_Implicit((Object)(object)_NormalTex)) { Material.SetTexture("_NormalTex", _NormalTex); Material.SetTextureScale("_NormalTex", _NormalTexScale); Material.SetTextureOffset("_NormalTex", _NormalTexOffset); } else { Material.SetTexture("_NormalTex", (Texture)null); } Material.SetColor("_EmColor", _EmColor); if (Object.op_Implicit((Object)(object)_EmTex)) { Material.SetTexture("_EmTex", _EmTex); } else { Material.SetTexture("_EmTex", (Texture)null); } Material.SetFloat("_EmPower", _EmPower); Material.SetFloat("_Smoothness", _Smoothness); SetShaderKeywordBasedOnBool(_IgnoreDiffuseAlphaForSpeculars, Material, "FORCE_SPEC"); Material.SetFloat("_RampInfo", Convert.ToSingle(_RampChoice)); Material.SetFloat("_DecalLayer", Convert.ToSingle(_DecalLayer)); Material.SetFloat("_SpecularStrength", _SpecularStrength); Material.SetFloat("_SpecularExponent", _SpecularExponent); Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode)); SetShaderKeywordBasedOnBool(_EnableDither, Material, "DITHER"); Material.SetFloat("_FadeBias", _FadeBias); SetShaderKeywordBasedOnBool(_EnableFresnelEmission, Material, "FRESNEL_EMISSION"); if (Object.op_Implicit((Object)(object)_FresnelRamp)) { Material.SetTexture("_FresnelRamp", _FresnelRamp); } else { Material.SetTexture("_FresnelRamp", (Texture)null); } Material.SetFloat("_FresnelPower", _FresnelPower); if (Object.op_Implicit((Object)(object)_FresnelMask)) { Material.SetTexture("_FresnelMask", _FresnelMask); } else { Material.SetTexture("_FresnelMask", (Texture)null); } Material.SetFloat("_FresnelBoost", _FresnelBoost); SetShaderKeywordBasedOnBool(_EnablePrinting, Material, "PRINT_CUTOFF"); Material.SetFloat("_SliceHeight", _SliceHeight); Material.SetFloat("_SliceBandHeight", _PrintBandHeight); Material.SetFloat("_SliceAlphaDepth", _PrintAlphaDepth); if (Object.op_Implicit((Object)(object)_PrintAlphaTexture)) { Material.SetTexture("_SliceAlphaTex", _PrintAlphaTexture); Material.SetTextureScale("_SliceAlphaTex", _PrintAlphaTextureScale); Material.SetTextureOffset("_SliceAlphaTex", _PrintAlphaTextureOffset); } else { Material.SetTexture("_SliceAlphaTex", (Texture)null); } Material.SetFloat("_PrintBoost", _PrintColorBoost); Material.SetFloat("_PrintBias", _PrintAlphaBias); Material.SetFloat("_PrintEmissionToAlbedoLerp", _PrintEmissionToAlbedoLerp); Material.SetFloat("_PrintDirection", Convert.ToSingle(_PrintDirection)); if (Object.op_Implicit((Object)(object)_PrintRamp)) { Material.SetTexture("_PrintRamp", _PrintRamp); } else { Material.SetTexture("_PrintRamp", (Texture)null); } Material.SetFloat("_EliteBrightnessMin", _EliteBrightnessMin); Material.SetFloat("_EliteBrightnessMax", _EliteBrightnessMax); SetShaderKeywordBasedOnBool(_EnableSplatmap, Material, "SPLATMAP"); SetShaderKeywordBasedOnBool(_UseVertexColorsInstead, Material, "USE_VERTEX_COLORS"); Material.SetFloat("_Depth", _BlendDepth); if (Object.op_Implicit((Object)(object)_SplatmapTex)) { Material.SetTexture("_SplatmapTex", _SplatmapTex); Material.SetTextureScale("_SplatmapTex", _SplatmapTexScale); Material.SetTextureOffset("_SplatmapTex", _SplatmapTexOffset); } else { Material.SetTexture("_SplatmapTex", (Texture)null); } Material.SetFloat("_SplatmapTileScale", _SplatmapTileScale); if (Object.op_Implicit((Object)(object)_GreenChannelTex)) { Material.SetTexture("_GreenChannelTex", _GreenChannelTex); } else { Material.SetTexture("_GreenChannelTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_GreenChannelNormalTex)) { Material.SetTexture("_GreenChannelNormalTex", _GreenChannelNormalTex); } else { Material.SetTexture("_GreenChannelNormalTex", (Texture)null); } Material.SetFloat("_GreenChannelSmoothness", _GreenChannelSmoothness); Material.SetFloat("_GreenChannelBias", _GreenChannelBias); if (Object.op_Implicit((Object)(object)_BlueChannelTex)) { Material.SetTexture("_BlueChannelTex", _BlueChannelTex); } else { Material.SetTexture("_BlueChannelTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_BlueChannelNormalTex)) { Material.SetTexture("_BlueChannelNormalTex", _BlueChannelNormalTex); } else { Material.SetTexture("_BlueChannelNormalTex", (Texture)null); } Material.SetFloat("_BlueChannelSmoothness", _BlueChannelSmoothness); Material.SetFloat("_BlueChannelBias", _BlueChannelBias); SetShaderKeywordBasedOnBool(_EnableFlowmap, Material, "FLOWMAP"); if (Object.op_Implicit((Object)(object)_FlowTexture)) { Material.SetTexture("_FlowTex", _FlowTexture); } else { Material.SetTexture("_FlowTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_FlowHeightmap)) { Material.SetTexture("_FlowHeightmap", _FlowHeightmap); Material.SetTextureScale("_FlowHeightmap", _FlowHeightmapScale); Material.SetTextureOffset("_FlowHeightmap", _FlowHeightmapOffset); } else { Material.SetTexture("_FlowHeightmap", (Texture)null); } if (Object.op_Implicit((Object)(object)_FlowHeightRamp)) { Material.SetTexture("_FlowHeightRamp", _FlowHeightRamp); Material.SetTextureScale("_FlowHeightRamp", _FlowHeightRampScale); Material.SetTextureOffset("_FlowHeightRamp", _FlowHeightRampOffset); } else { Material.SetTexture("_FlowHeightRamp", (Texture)null); } Material.SetFloat("_FlowHeightBias", _FlowHeightBias); Material.SetFloat("_FlowHeightPower", _FlowHeightPower); Material.SetFloat("_FlowEmissionStrength", _FlowEmissionStrength); Material.SetFloat("_FlowSpeed", _FlowSpeed); Material.SetFloat("_FlowMaskStrength", _MaskFlowStrength); Material.SetFloat("_FlowNormalStrength", _NormalFlowStrength); Material.SetFloat("_FlowTextureScaleFactor", _FlowTextureScaleFactor); SetShaderKeywordBasedOnBool(_EnableLimbRemoval, Material, "LIMBREMOVAL"); } } } public class HGCloudRemapController : MonoBehaviour { public enum _SrcBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _DstBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _CullEnum { Off, Front, Back } public enum _ZTestEnum { Disabled, Never, Less, Equal, LessEqual, Greater, NotEqual, GreaterEqual, Always } public Material Material; public Renderer Renderer; public string MaterialName; public _SrcBlendFloatEnum _Source_Blend_Mode; public _DstBlendFloatEnum _Destination_Blend_Mode; public int _InternalSimpleBlendMode; public Color _Tint; public bool _DisableRemapping; public Texture _MainTex; public Vector2 _MainTexScale; public Vector2 _MainTexOffset; public Texture _RemapTex; public Vector2 _RemapTexScale; public Vector2 _RemapTexOffset; [Range(0f, 2f)] public float _SoftFactor; [Range(1f, 20f)] public float _BrightnessBoost; [Range(0f, 20f)] public float _AlphaBoost; [Range(0f, 1f)] public float _AlphaBias; public bool _UseUV1; public bool _FadeWhenNearCamera; [Range(0f, 1f)] public float _FadeCloseDistance; public _CullEnum _Cull_Mode; public _ZTestEnum _ZTest_Mode; [Range(-10f, 10f)] public float _DepthOffset; public bool _CloudRemapping; public bool _DistortionClouds; [Range(-2f, 2f)] public float _DistortionStrength; public Texture _Cloud1Tex; public Vector2 _Cloud1TexScale; public Vector2 _Cloud1TexOffset; public Texture _Cloud2Tex; public Vector2 _Cloud2TexScale; public Vector2 _Cloud2TexOffset; public Vector4 _CutoffScroll; public bool _VertexColors; public bool _LuminanceForVertexAlpha; public bool _LuminanceForTextureAlpha; public bool _VertexOffset; public bool _FresnelFade; public bool _SkyboxOnly; [Range(-20f, 20f)] public float _FresnelPower; [Range(0f, 3f)] public float _VertexOffsetAmount; public void Start() { GrabMaterialValues(); } public void GrabMaterialValues() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { _Source_Blend_Mode = (_SrcBlendFloatEnum)Material.GetFloat("_SrcBlend"); _Destination_Blend_Mode = (_DstBlendFloatEnum)Material.GetFloat("_DstBlend"); _InternalSimpleBlendMode = (int)Material.GetFloat("_InternalSimpleBlendMode"); _Tint = Material.GetColor("_TintColor"); _DisableRemapping = Material.IsKeywordEnabled("DISABLEREMAP"); _MainTex = Material.GetTexture("_MainTex"); _MainTexScale = Material.GetTextureScale("_MainTex"); _MainTexOffset = Material.GetTextureOffset("_MainTex"); _RemapTex = Material.GetTexture("_RemapTex"); _RemapTexScale = Material.GetTextureScale("_RemapTex"); _RemapTexOffset = Material.GetTextureOffset("_RemapTex"); _SoftFactor = Material.GetFloat("_InvFade"); _BrightnessBoost = Material.GetFloat("_Boost"); _AlphaBoost = Material.GetFloat("_AlphaBoost"); _AlphaBias = Material.GetFloat("_AlphaBias"); _UseUV1 = Material.IsKeywordEnabled("USE_UV1"); _FadeWhenNearCamera = Material.IsKeywordEnabled("FADECLOSE"); _FadeCloseDistance = Material.GetFloat("_FadeCloseDistance"); _Cull_Mode = (_CullEnum)Material.GetFloat("_Cull"); _ZTest_Mode = (_ZTestEnum)Material.GetFloat("_ZTest"); _DepthOffset = Material.GetFloat("_DepthOffset"); _CloudRemapping = Material.IsKeywordEnabled("USE_CLOUDS"); _DistortionClouds = Material.IsKeywordEnabled("CLOUDOFFSET"); _DistortionStrength = Material.GetFloat("_DistortionStrength"); _Cloud1Tex = Material.GetTexture("_Cloud1Tex"); _Cloud1TexScale = Material.GetTextureScale("_Cloud1Tex"); _Cloud1TexOffset = Material.GetTextureOffset("_Cloud1Tex"); _Cloud2Tex = Material.GetTexture("_Cloud2Tex"); _Cloud2TexScale = Material.GetTextureScale("_Cloud2Tex"); _Cloud2TexOffset = Material.GetTextureOffset("_Cloud2Tex"); _CutoffScroll = Material.GetVector("_CutoffScroll"); _VertexColors = Material.IsKeywordEnabled("VERTEXCOLOR"); _LuminanceForVertexAlpha = Material.IsKeywordEnabled("VERTEXALPHA"); _LuminanceForTextureAlpha = Material.IsKeywordEnabled("CALCTEXTUREALPHA"); _VertexOffset = Material.IsKeywordEnabled("VERTEXOFFSET"); _FresnelFade = Material.IsKeywordEnabled("FRESNEL"); _SkyboxOnly = Material.IsKeywordEnabled("SKYBOX_ONLY"); _FresnelPower = Material.GetFloat("_FresnelPower"); _VertexOffsetAmount = Material.GetFloat("_OffsetAmount"); MaterialName = ((Object)Material).name; } } public void Update() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer)) { GrabMaterialValues(); PutMaterialIntoMeshRenderer(Renderer, Material); } Material.SetFloat("_SrcBlend", Convert.ToSingle(_Source_Blend_Mode)); Material.SetFloat("_DstBlend", Convert.ToSingle(_Destination_Blend_Mode)); Material.SetFloat("_InternalSimpleBlendMode", (float)_InternalSimpleBlendMode); Material.SetColor("_TintColor", _Tint); SetShaderKeywordBasedOnBool(_DisableRemapping, Material, "DISABLEREMAP"); if (Object.op_Implicit((Object)(object)_MainTex)) { Material.SetTexture("_MainTex", _MainTex); Material.SetTextureScale("_MainTex", _MainTexScale); Material.SetTextureOffset("_MainTex", _MainTexOffset); } else { Material.SetTexture("_MainTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_RemapTex)) { Material.SetTexture("_RemapTex", _RemapTex); Material.SetTextureScale("_RemapTex", _RemapTexScale); Material.SetTextureOffset("_RemapTex", _RemapTexOffset); } else { Material.SetTexture("_RemapTex", (Texture)null); } Material.SetFloat("_InvFade", _SoftFactor); Material.SetFloat("_Boost", _BrightnessBoost); Material.SetFloat("_AlphaBoost", _AlphaBoost); Material.SetFloat("_AlphaBias", _AlphaBias); SetShaderKeywordBasedOnBool(_UseUV1, Material, "USE_UV1"); SetShaderKeywordBasedOnBool(_FadeWhenNearCamera, Material, "FADECLOSE"); Material.SetFloat("_FadeCloseDistance", _FadeCloseDistance); Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode)); Material.SetFloat("_ZTest", Convert.ToSingle(_ZTest_Mode)); Material.SetFloat("_DepthOffset", _DepthOffset); SetShaderKeywordBasedOnBool(_CloudRemapping, Material, "USE_CLOUDS"); SetShaderKeywordBasedOnBool(_DistortionClouds, Material, "CLOUDOFFSET"); Material.SetFloat("_DistortionStrength", _DistortionStrength); if (Object.op_Implicit((Object)(object)_Cloud1Tex)) { Material.SetTexture("_Cloud1Tex", _Cloud1Tex); Material.SetTextureScale("_Cloud1Tex", _Cloud1TexScale); Material.SetTextureOffset("_Cloud1Tex", _Cloud1TexOffset); } else { Material.SetTexture("_Cloud1Tex", (Texture)null); } if (Object.op_Implicit((Object)(object)_Cloud2Tex)) { Material.SetTexture("_Cloud2Tex", _Cloud2Tex); Material.SetTextureScale("_Cloud2Tex", _Cloud2TexScale); Material.SetTextureOffset("_Cloud2Tex", _Cloud2TexOffset); } else { Material.SetTexture("_Cloud2Tex", (Texture)null); } Material.SetVector("_CutoffScroll", _CutoffScroll); SetShaderKeywordBasedOnBool(_VertexColors, Material, "VERTEXCOLOR"); SetShaderKeywordBasedOnBool(_LuminanceForVertexAlpha, Material, "VERTEXALPHA"); SetShaderKeywordBasedOnBool(_LuminanceForTextureAlpha, Material, "CALCTEXTUREALPHA"); SetShaderKeywordBasedOnBool(_VertexOffset, Material, "VERTEXOFFSET"); SetShaderKeywordBasedOnBool(_FresnelFade, Material, "FRESNEL"); SetShaderKeywordBasedOnBool(_SkyboxOnly, Material, "SKYBOX_ONLY"); Material.SetFloat("_FresnelPower", _FresnelPower); Material.SetFloat("_OffsetAmount", _VertexOffsetAmount); } } } public class HGIntersectionController : MonoBehaviour { public enum _SrcBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _DstBlendFloatEnum { Zero, One, DstColor, SrcColor, OneMinusDstColor, SrcAlpha, OneMinusSrcColor, DstAlpha, OneMinusDstAlpha, SrcAlphaSaturate, OneMinusSrcAlpha } public enum _CullEnum { Off, Front, Back } public Material Material; public Renderer Renderer; public string MaterialName; public _SrcBlendFloatEnum _Source_Blend_Mode; public _DstBlendFloatEnum _Destination_Blend_Mode; public Color _Tint; public Texture _MainTex; public Vector2 _MainTexScale; public Vector2 _MainTexOffset; public Texture _Cloud1Tex; public Vector2 _Cloud1TexScale; public Vector2 _Cloud1TexOffset; public Texture _Cloud2Tex; public Vector2 _Cloud2TexScale; public Vector2 _Cloud2TexOffset; public Texture _RemapTex; public Vector2 _RemapTexScale; public Vector2 _RemapTexOffset; public Vector4 _CutoffScroll; [Range(0f, 30f)] public float _SoftFactor; [Range(0.1f, 20f)] public float _SoftPower; [Range(0f, 5f)] public float _BrightnessBoost; [Range(0.1f, 20f)] public float _RimPower; [Range(0f, 5f)] public float _RimStrength; [Range(0f, 20f)] public float _AlphaBoost; [Range(0f, 20f)] public float _IntersectionStrength; public _CullEnum _Cull_Mode; public bool _FadeFromVertexColorsOn; public bool _EnableTriplanarProjectionsForClouds; public void Start() { GrabMaterialValues(); } public void GrabMaterialValues() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)Material)) { _Source_Blend_Mode = (_SrcBlendFloatEnum)Material.GetFloat("_SrcBlendFloat"); _Destination_Blend_Mode = (_DstBlendFloatEnum)Material.GetFloat("_DstBlendFloat"); _Tint = Material.GetColor("_TintColor"); _MainTex = Material.GetTexture("_MainTex"); _MainTexScale = Material.GetTextureScale("_MainTex"); _MainTexOffset = Material.GetTextureOffset("_MainTex"); _Cloud1Tex = Material.GetTexture("_Cloud1Tex"); _Cloud1TexScale = Material.GetTextureScale("_Cloud1Tex"); _Cloud1TexOffset = Material.GetTextureOffset("_Cloud1Tex"); _Cloud2Tex = Material.GetTexture("_Cloud2Tex"); _Cloud2TexScale = Material.GetTextureScale("_Cloud2Tex"); _Cloud2TexOffset = Material.GetTextureOffset("_Cloud2Tex"); _RemapTex = Material.GetTexture("_RemapTex"); _RemapTexScale = Material.GetTextureScale("_RemapTex"); _RemapTexOffset = Material.GetTextureOffset("_RemapTex"); _CutoffScroll = Material.GetVector("_CutoffScroll"); _SoftFactor = Material.GetFloat("_InvFade"); _SoftPower = Material.GetFloat("_SoftPower"); _BrightnessBoost = Material.GetFloat("_Boost"); _RimPower = Material.GetFloat("_RimPower"); _RimStrength = Material.GetFloat("_RimStrength"); _AlphaBoost = Material.GetFloat("_AlphaBoost"); _IntersectionStrength = Material.GetFloat("_IntersectionStrength"); _Cull_Mode = (_CullEnum)Material.GetFloat("_Cull"); _FadeFromVertexColorsOn = Material.IsKeywordEnabled("FADE_FROM_VERTEX_COLORS"); _EnableTriplanarProjectionsForClouds = Material.IsKeywordEnabled("TRIPLANAR"); MaterialName = ((Object)Material).name; } } public void Update() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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_020d: 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) if (Object.op_Implicit((Object)(object)Material)) { if (((Object)Material).name != MaterialName && Object.op_Implicit((Object)(object)Renderer)) { GrabMaterialValues(); PutMaterialIntoMeshRenderer(Renderer, Material); } Material.SetFloat("_SrcBlendFloat", Convert.ToSingle(_Source_Blend_Mode)); Material.SetFloat("_DstBlendFloat", Convert.ToSingle(_Destination_Blend_Mode)); Material.SetColor("_TintColor", _Tint); if (Object.op_Implicit((Object)(object)_MainTex)) { Material.SetTexture("_MainTex", _MainTex); Material.SetTextureScale("_MainTex", _MainTexScale); Material.SetTextureOffset("_MainTex", _MainTexOffset); } else { Material.SetTexture("_MainTex", (Texture)null); } if (Object.op_Implicit((Object)(object)_Cloud1Tex)) { Material.SetTexture("_Cloud1Tex", _Cloud1Tex); Material.SetTextureScale("_Cloud1Tex", _Cloud1TexScale); Material.SetTextureOffset("_Cloud1Tex", _Cloud1TexOffset); } else { Material.SetTexture("_Cloud1Tex", (Texture)null); } if (Object.op_Implicit((Object)(object)_Cloud2Tex)) { Material.SetTexture("_Cloud2Tex", _Cloud2Tex); Material.SetTextureScale("_Cloud2Tex", _Cloud2TexScale); Material.SetTextureOffset("_Cloud2Tex", _Cloud2TexOffset); } else { Material.SetTexture("_Cloud2Tex", (Texture)null); } if (Object.op_Implicit((Object)(object)_RemapTex)) { Material.SetTexture("_RemapTex", _RemapTex); Material.SetTextureScale("_RemapTex", _RemapTexScale); Material.SetTextureOffset("_RemapTex", _RemapTexOffset); } else { Material.SetTexture("_RemapTex", (Texture)null); } Material.SetVector("_CutoffScroll", _CutoffScroll); Material.SetFloat("_InvFade", _SoftFactor); Material.SetFloat("_SoftPower", _SoftPower); Material.SetFloat("_Boost", _BrightnessBoost); Material.SetFloat("_RimPower", _RimPower); Material.SetFloat("_RimStrength", _RimStrength); Material.SetFloat("_AlphaBoost", _AlphaBoost); Material.SetFloat("_IntersectionStrength", _IntersectionStrength); Material.SetFloat("_Cull", Convert.ToSingle(_Cull_Mode)); SetShaderKeywordBasedOnBool(_FadeFromVertexColorsOn, Material, "FADE_FROM_VERTEX_COLORS"); SetShaderKeywordBasedOnBool(_EnableTriplanarProjectionsForClouds, Material, "TRIPLANAR"); } } } public static void SetShaderKeywordBasedOnBool(bool enabled, Material material, string keyword) { if (!Object.op_Implicit((Object)(object)material)) { return; } if (enabled) { if (!material.IsKeywordEnabled(keyword)) { material.EnableKeyword(keyword); } } else if (material.IsKeywordEnabled(keyword)) { material.DisableKeyword(keyword); } } public static void PutMaterialIntoMeshRenderer(Renderer renderer, Material material) { if (Object.op_Implicit((Object)(object)material) && Object.op_Implicit((Object)(object)renderer)) { renderer.materials[0] = material; } } } } namespace Smite_Items.Items { public abstract class ItemBase : ItemBase where T : ItemBase { public static T instance { get; private set; } public ItemBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ItemBase was instantiated twice"); } instance = this as T; } } public abstract class ItemBase { public ItemDef ItemDef; public abstract string ItemName { get; } public abstract string ItemLangTokenName { get; } public abstract string ItemPickupDesc { get; } public abstract string ItemFullDescription { get; } public abstract string ItemLore { get; } public abstract ItemTier Tier { get; } public virtual ItemTag[] ItemTags { get; set; } = (ItemTag[])(object)new ItemTag[0]; public abstract GameObject ItemModel { get; } public abstract Sprite ItemIcon { get; } public virtual bool CanRemove { get; } = true; public virtual bool AIBlacklisted { get; set; } public abstract void Init(ConfigFile config); public virtual void CreateConfig(ConfigFile config) { } protected virtual void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", ItemName); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateItem() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Expected O, but got Unknown if (AIBlacklisted) { ItemTags = new List(ItemTags) { (ItemTag)4 }.ToArray(); } ItemDef = ScriptableObject.CreateInstance(); ((Object)ItemDef).name = "ITEM_" + ItemLangTokenName; ItemDef.nameToken = "ITEM_" + ItemLangTokenName + "_NAME"; ItemDef.pickupToken = "ITEM_" + ItemLangTokenName + "_PICKUP"; ItemDef.descriptionToken = "ITEM_" + ItemLangTokenName + "_DESCRIPTION"; ItemDef.loreToken = "ITEM_" + ItemLangTokenName + "_LORE"; ItemDef.pickupModelPrefab = ItemModel; ItemDef.pickupIconSprite = ItemIcon; ItemDef.hidden = false; ItemDef.canRemove = CanRemove; ItemDef.deprecatedTier = Tier; if (ItemTags.Length != 0) { ItemDef.tags = ItemTags; } ItemAPI.Add(new CustomItem(ItemDef, CreateItemDisplayRules())); } public virtual void Hooks() { } public int GetCount(CharacterBody body) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCount(ItemDef); } public int GetCount(CharacterMaster master) { if (!Object.op_Implicit((Object)(object)master) || !Object.op_Implicit((Object)(object)master.inventory)) { return 0; } return master.inventory.GetItemCount(ItemDef); } public int GetCountSpecific(CharacterBody body, ItemDef itemDef) { if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.inventory)) { return 0; } return body.inventory.GetItemCount(itemDef); } } public class GluttonousGrimoire : ItemBase { public ConfigEntry PercentHealingConverted; public ConfigEntry PercentHealingConvertedAtMax; public static BuffDef storedBonusDamage; private Dictionary cachedHealingConverted = new Dictionary(); private Dictionary cachedHealingConvertedAtMax = new Dictionary(); private Dictionary lastPrimaryUseTime = new Dictionary(); private const float PRIMARY_SKILL_WINDOW = 0.5f; public override string ItemName => "Gluttonous Grimoire"; public override string ItemLangTokenName => "GLUTTONOUS_GRIMOIRE_ITEM"; public override string ItemPickupDesc => "Convert healing to bonus damage."; public override string ItemFullDescription => $"Convert {PercentHealingConverted.Value * 100f}% (+{PercentHealingConverted.Value * 100f}% per stack hyperbolically) of healing or {PercentHealingConvertedAtMax.Value * 100f}% (+{PercentHealingConvertedAtMax.Value * 100f}% per stack hyperbolically) of healing at full health into a stored damage bonus on the next hit of your primary skill."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)3; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)2, (ItemTag)1 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("GluttonousGrimoireModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Gluttonous Grimoire Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } public void CreateBuff() { storedBonusDamage = ScriptableObject.CreateInstance(); storedBonusDamage.canStack = true; storedBonusDamage.isDebuff = false; ((Object)storedBonusDamage).name = "storedBonusDamage"; storedBonusDamage.isCooldown = false; storedBonusDamage.iconSprite = Main.MainAssets.LoadAsset("Gluttonous Grimoire Icon.png"); ContentAddition.AddBuffDef(storedBonusDamage); } public override void CreateConfig(ConfigFile config) { PercentHealingConverted = config.Bind("Item: " + ItemName, "Percent healing converted", 0.25f, "What percentage of healing is converted to bonus damage on next primary skill hit?"); PercentHealingConvertedAtMax = config.Bind("Item: " + ItemName, "Percent healing converted while at max health", 0.4f, "What percentage of healing is converted to bonus damage on next primary skill hit while at maximum health?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AdjustHealingConversion); HealthComponent.Heal += new hook_Heal(HandleHealingConversion); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(TrackPrimarySkillUse); HealthComponent.TakeDamage += new hook_TakeDamage(GrimoireDamageBonus); GlobalEventManager.onCharacterDeathGlobal += CleanupDictionaries; } private void CleanupDictionaries(DamageReport report) { if (Object.op_Implicit((Object)(object)report.victimBody)) { CharacterBody victimBody = report.victimBody; lastPrimaryUseTime.Remove(victimBody); cachedHealingConverted.Remove(victimBody); cachedHealingConvertedAtMax.Remove(victimBody); } } private void GrimoireDamageBonus(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_00a5: 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) orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component.inventory) && GetCount(component) > 0) { bool flag = false; if (lastPrimaryUseTime.ContainsKey(component)) { flag = Time.time - lastPrimaryUseTime[component] < 0.5f; } if (component.HasBuff(storedBonusDamage) && flag) { int buffCount = component.GetBuffCount(storedBonusDamage); damageInfo.damage = buffCount; damageInfo.damageColorIndex = (DamageColorIndex)3; damageInfo.procCoefficient = 0f; damageInfo.crit = false; damageInfo.inflictor = damageInfo.attacker; component.SetBuffCount(storedBonusDamage.buffIndex, 0); self.TakeDamage(damageInfo); } } } private void TrackPrimarySkillUse(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { orig.Invoke(self, skill); if (Object.op_Implicit((Object)(object)self.skillLocator.primary) && Object.op_Implicit((Object)(object)skill) && (Object)(object)self.skillLocator.primary.skillDef == (Object)(object)skill.skillDef) { lastPrimaryUseTime[self] = Time.time; } } private void AdjustHealingConversion(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int count = GetCount(self); if (count > 0) { cachedHealingConverted[self] = 1f - 1f / (1f + PercentHealingConverted.Value * (float)count); cachedHealingConvertedAtMax[self] = 1f - 1f / (1f + PercentHealingConvertedAtMax.Value * (float)count); } else { cachedHealingConverted.Remove(self); cachedHealingConvertedAtMax.Remove(self); } } private float HandleHealingConversion(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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) if (!NetworkServer.active) { return orig.Invoke(self, amount, procChainMask, nonRegen); } if (Object.op_Implicit((Object)(object)self) && self.alive && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory) && GetCount(self.body) > 0 && nonRegen) { float num; int num2; if (self.health >= self.fullHealth) { num = amount * (1f - cachedHealingConvertedAtMax.GetValueOrDefault(self.body, 0f)); num2 = Mathf.RoundToInt(amount * cachedHealingConvertedAtMax.GetValueOrDefault(self.body, 0f)); } else { num = amount * (1f - cachedHealingConverted.GetValueOrDefault(self.body, 0f)); num2 = Mathf.RoundToInt(amount * cachedHealingConverted.GetValueOrDefault(self.body, 0f)); } int buffCount = self.body.GetBuffCount(storedBonusDamage); self.body.SetBuffCount(storedBonusDamage.buffIndex, num2 + buffCount); return orig.Invoke(self, num, procChainMask, nonRegen); } return orig.Invoke(self, amount, procChainMask, nonRegen); } } public class SacrificialShroud : ItemBase { public ConfigEntry SkillBonusDamage; public ConfigEntry SkillBonusDamagePerStack; public ConfigEntry PercentHealthCostPerSecond; public ConfigEntry PercentHealthCostPerSecondPerStack; public override string ItemName => "Sacrificial Shroud"; public override string ItemLangTokenName => "SACRIFICIAL_SHROUD_ITEM"; public override string ItemPickupDesc => "Skills deal bonus damage... BUT cost health to use."; public override string ItemFullDescription => $"All non-Primary skills deal {SkillBonusDamage.Value * 100f}% (+{SkillBonusDamagePerStack.Value * 100f}% per stack) bonus damage. Activating a non-Primary skill deals {PercentHealthCostPerSecond.Value * 100f}% (+{PercentHealthCostPerSecondPerStack.Value * 100f}% per stack) of your max health per second of the skill's base cooldown to you."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)3; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("SacrificialShroudModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Sacrificial Shroud Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); Hooks(); } public override void CreateConfig(ConfigFile config) { SkillBonusDamage = config.Bind("Item: " + ItemName, "Percent skill bonus damage", 0.5f, "By what percent is skill damage increased by?"); SkillBonusDamagePerStack = config.Bind("Item: " + ItemName, "Percent skill bonus damage per item stack", 0.5f, "By what percent is skill damage increased by per additional item stack?"); PercentHealthCostPerSecond = config.Bind("Item: " + ItemName, "Percent maximum health cost per skill cooldown second", 0.01f, "What percentage of maximum health is taken as damage per second of cooldown of a skill?"); PercentHealthCostPerSecondPerStack = config.Bind("Item: " + ItemName, "Additional percent maximum health cost per skill cooldown second per item stack", 0.01f, "What percentage of maximum health is taken as damage per second of cooldown of a skill per additional stack of the item?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown GenericSkill.DeductStock += new hook_DeductStock(ApplySacrificeSelfDamageStock); SkillDef.OnExecute += new hook_OnExecute(ApplySacrificeSelfDamage); PrepWall.OnExit += new hook_OnExit(ApplySacrificeSelfDamageOnIceWall); Fire.FireMissile += new hook_FireMissile(ApplySacrificeSelfDamageOnHarpoon); HealthComponent.TakeDamage += new hook_TakeDamage(ApplySacrificeBonusDamage); } private void ApplySacrificeSelfDamageOnHarpoon(orig_FireMissile orig, Fire self, HurtBox target, Vector3 position) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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) orig.Invoke(self, target, position); int count = GetCount(((EntityState)self).characterBody); if (count > 0) { GenericSkill utilityBonusStockSkill = ((EntityState)self).skillLocator.utilityBonusStockSkill; float damage = ((EntityState)self).characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count - 1)) * utilityBonusStockSkill.baseRechargeInterval; DamageInfo val = new DamageInfo(); val.damage = damage; val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)1); val.crit = false; val.position = ((EntityState)self).characterBody.corePosition; val.inflictor = ((Component)((EntityState)self).characterBody).gameObject; val.attacker = ((Component)((EntityState)self).characterBody).gameObject; ((EntityState)self).characterBody.healthComponent.TakeDamage(val); } } private void ApplySacrificeSelfDamageOnIceWall(orig_OnExit orig, PrepWall self) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (self.goodPlacement && Object.op_Implicit((Object)(object)((EntityState)self).characterBody)) { int count = GetCount(((EntityState)self).characterBody); if (count > 0) { GenericSkill utilityBonusStockSkill = ((EntityState)self).skillLocator.utilityBonusStockSkill; float damage = ((EntityState)self).characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count - 1)) * utilityBonusStockSkill.baseRechargeInterval; DamageInfo val = new DamageInfo(); val.damage = damage; val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)1); val.crit = false; val.position = ((EntityState)self).characterBody.corePosition; val.inflictor = ((Component)((EntityState)self).characterBody).gameObject; val.attacker = ((Component)((EntityState)self).characterBody).gameObject; ((EntityState)self).characterBody.healthComponent.TakeDamage(val); } } orig.Invoke(self); } private void ApplySacrificeSelfDamage(orig_OnExecute orig, SkillDef self, GenericSkill skillSlot) { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, skillSlot); int count = GetCount(skillSlot.characterBody); if (self.stockToConsume >= 1 && count > 0 && !((Object)(object)skillSlot.characterBody.skillLocator.primary.skillDef == (Object)(object)skillSlot.skillDef) && self.baseRechargeInterval > 0f && (skillSlot.cooldownRemaining > 0f || skillSlot.stock < skillSlot.maxStock) && skillSlot.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME" && skillSlot.skillDef.skillNameToken != "ENGI_SKILL_HARPOON_NAME") { float damage = skillSlot.characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count - 1)) * self.baseRechargeInterval; DamageInfo val = new DamageInfo(); val.damage = damage; val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)1); val.crit = false; val.position = skillSlot.characterBody.corePosition; val.inflictor = ((Component)skillSlot.characterBody).gameObject; val.attacker = ((Component)skillSlot.characterBody).gameObject; skillSlot.characterBody.healthComponent.TakeDamage(val); } } private void ApplySacrificeSelfDamageStock(orig_DeductStock orig, GenericSkill self, int count) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, count); int count2 = GetCount(self.characterBody); if (count2 > 0 && !((Object)(object)self.characterBody.skillLocator.primary.skillDef == (Object)(object)self.skillDef) && self.baseRechargeInterval > 0f && (self.cooldownRemaining > 0f || self.stock < self.maxStock) && self.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME" && self.skillDef.skillNameToken != "ENGI_SKILL_HARPOON_NAME") { float damage = self.characterBody.maxHealth * 2f * (PercentHealthCostPerSecond.Value + PercentHealthCostPerSecondPerStack.Value * (float)(count2 - 1)) * self.baseRechargeInterval; DamageInfo val = new DamageInfo(); val.damage = damage; val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)1); val.crit = false; val.position = self.characterBody.corePosition; val.inflictor = ((Component)self.characterBody).gameObject; val.attacker = ((Component)self.characterBody).gameObject; self.characterBody.healthComponent.TakeDamage(val); } } private void ApplySacrificeBonusDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0 && (damageInfo.damageType.damageSource & 0xE) != 0) { damageInfo.damage *= 1f + (SkillBonusDamage.Value + SkillBonusDamagePerStack.Value * (float)(count - 1)); } } } orig.Invoke(self, damageInfo); } } public class BladedBoomerang : ItemBase { public class BladePickup : MonoBehaviour { public GameObject baseObject; private void OnTriggerEnter(Collider other) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)((Component)this).GetComponent()) && Object.op_Implicit((Object)(object)other) && TeamComponent.GetObjectTeam(((Component)other).gameObject) == ((Component)this).GetComponent().teamIndex) { CharacterBody component = ((Component)other).GetComponent(); if ((Object)(object)component != (Object)null) { AddBladeBuff(component); Object.Destroy((Object)(object)((Component)this).gameObject); } } } } public static class PickupSpawner { private static GameObject _pickupPrefab; public static void Init() { } public static void SpawnPickupAt(Vector3 position, TeamIndex team) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) _pickupPrefab = CreatePickupPrefab(); if (!((Object)(object)_pickupPrefab == (Object)null)) { TeamFilter component = Object.Instantiate(_pickupPrefab, position, Quaternion.identity).GetComponent(); if ((Object)(object)component != (Object)null) { component.teamIndex = team; } } } } public ConfigEntry CritChanceBuff; public ConfigEntry BonusCritChanceBuffPerStack; public ConfigEntry MaxBuffStacks; public ConfigEntry BuffDuration; public ConfigEntry BladeCooldown; public ConfigEntry BladeDropLifetime; public static Dictionary bladeRechargeTimers = new Dictionary(); public static BuffDef bladedBoomerangCritChance; public static BuffDef bladedBoomerangReady; public static GameObject bladeDropPrefab; public override string ItemName => "Bladed Boomerang"; public override string ItemLangTokenName => "BLADED_BOOMERANG_ITEM"; public override string ItemPickupDesc => "Hitting enemies spawns pickups that grant critical strike chance."; public override string ItemFullDescription => $"Once every {BladeCooldown.Value} seconds, hitting an enemy spawns a blade that when picked up grants +{CritChanceBuff.Value}% (+{BonusCritChanceBuffPerStack.Value}% per stack) critical strike chance up to {MaxBuffStacks.Value} times. Lasts {BuffDuration.Value} seconds."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => Main.MainAssets.LoadAsset("BladedBoomerangModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Bladed Boomerang Icon.png"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateBuff(); CreateItem(); Hooks(); } public override void CreateConfig(ConfigFile config) { CritChanceBuff = config.Bind("Item: " + ItemName, "Bonus Crit Chance from Buff", 6f, "How much crit chance does each stack of the bladed boomerang buff give?"); BonusCritChanceBuffPerStack = config.Bind("Item: " + ItemName, "Bonus Crit Chance from Buff per stack", 6f, "How much additional crit chance does each stack of the bladed boomerang buff give per additional stack of the item?"); MaxBuffStacks = config.Bind("Item: " + ItemName, "Max buff stacks", 3, "What is the maximum number of bladed boomerang buff stacks a player can have?"); BuffDuration = config.Bind("Item: " + ItemName, "Blade Buff Duration", 8f, "How long, in seconds, does the bladed boomerang buff last?"); BladeCooldown = config.Bind("Item: " + ItemName, "Blade cooldown", 2f, "How much time, in seconds, must pass from a blade dropping for a new blade to be allowed to spawn?"); BladeDropLifetime = config.Bind("Item: " + ItemName, "Blade drop lifetime", 10f, "How much time, in seconds, does a bladed boomerang drop last after being spawned?"); } private void CreateBuff() { bladedBoomerangCritChance = ScriptableObject.CreateInstance(); bladedBoomerangCritChance.canStack = true; bladedBoomerangCritChance.isDebuff = false; ((Object)bladedBoomerangCritChance).name = "bladedBoomerangCritChance"; bladedBoomerangCritChance.isCooldown = false; bladedBoomerangCritChance.iconSprite = Main.MainAssets.LoadAsset("Bladed Boomerang Icon.png"); ContentAddition.AddBuffDef(bladedBoomerangCritChance); bladedBoomerangReady = ScriptableObject.CreateInstance(); bladedBoomerangReady.canStack = false; bladedBoomerangReady.isDebuff = false; ((Object)bladedBoomerangReady).name = "bladedBoomerangReady"; bladedBoomerangReady.isCooldown = false; bladedBoomerangReady.iconSprite = Main.MainAssets.LoadAsset("Bladed Boomerang Icon.png"); ContentAddition.AddBuffDef(bladedBoomerangReady); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(CheckAndSpawnBlade); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(StartCooldowns); CharacterBody.FixedUpdate += new hook_FixedUpdate(HandleBladeRecharge); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(HandleBuff); } private void HandleBuff(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(bladedBoomerangCritChance); int count = GetCount(sender); if (buffCount > 0 && count > 0) { args.critAdd += (float)buffCount * (CritChanceBuff.Value + (float)(count - 1) * BonusCritChanceBuffPerStack.Value); } } private void StartCooldowns(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (!NetworkServer.active) { return; } if (GetCount(self) > 0) { if (!bladeRechargeTimers.ContainsKey(self)) { bladeRechargeTimers[self] = BladeCooldown.Value; } return; } bladeRechargeTimers.Remove(self); if (self.GetBuffCount(bladedBoomerangReady) > 0) { self.RemoveBuff(bladedBoomerangReady); } } private void HandleBladeRecharge(orig_FixedUpdate orig, CharacterBody self) { orig.Invoke(self); int count = GetCount(self); if (NetworkServer.active && count > 0) { if (!bladeRechargeTimers.ContainsKey(self)) { bladeRechargeTimers[self] = BladeCooldown.Value; } if (bladeRechargeTimers[self] > 0f && self.GetBuffCount(bladedBoomerangReady) == 0) { bladeRechargeTimers[self] -= Time.fixedDeltaTime; } if (bladeRechargeTimers[self] <= 0f && self.GetBuffCount(bladedBoomerangReady) == 0) { self.AddBuff(bladedBoomerangReady); } } } private void CheckAndSpawnBlade(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo, victim); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { CharacterBody component = damageInfo.attacker.GetComponent(); if (GetCount(component) > 0 && component.GetBuffCount(bladedBoomerangReady) >= 1) { TeamIndex team = (TeamIndex)((!Object.op_Implicit((Object)(object)component.teamComponent)) ? (-1) : ((int)component.teamComponent.teamIndex)); PickupSpawner.SpawnPickupAt(victim.GetComponent().corePosition + Vector3.up * 1f, team); component.RemoveBuff(bladedBoomerangReady); bladeRechargeTimers[component] += BladeCooldown.Value; } } } public static void AddBladeBuff(CharacterBody originalPickupBody) { if (originalPickupBody.GetBuffCount(bladedBoomerangCritChance) < ItemBase.instance.MaxBuffStacks.Value) { originalPickupBody.AddTimedBuff(bladedBoomerangCritChance, ItemBase.instance.BuffDuration.Value); ItemHelpers.RefreshTimedBuffs(originalPickupBody, bladedBoomerangCritChance, ItemBase.instance.BuffDuration.Value); } } public static GameObject CreatePickupPrefab() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BladeOrb"); GameObject obj = GameObject.CreatePrimitive((PrimitiveType)0); obj.transform.SetParent(val.transform); obj.transform.localScale = Vector3.one * 0.5f; Object.Destroy((Object)(object)obj.GetComponent()); SphereCollider obj2 = val.AddComponent(); ((Collider)obj2).isTrigger = true; obj2.radius = 1.5f; Rigidbody obj3 = val.AddComponent(); obj3.isKinematic = false; obj3.useGravity = true; obj3.drag = 2f; obj3.angularDrag = 0.05f; obj3.mass = 1f; obj3.detectCollisions = true; obj3.collisionDetectionMode = (CollisionDetectionMode)0; val.AddComponent(); DestroyOnTimer obj4 = val.AddComponent(); obj4.duration = ItemBase.instance.BladeDropLifetime.Value; ((Behaviour)obj4).enabled = true; val.AddComponent(); Light obj5 = val.AddComponent(); obj5.color = Color.cyan; obj5.intensity = 2f; obj5.range = 5f; return val; } } public class Hydras : ItemBase { public ConfigEntry BonusDamage; public static BuffDef hydrasBonusDamage; public override string ItemName => "Hydras Lament"; public override string ItemLangTokenName => "HYDRAS_ITEM"; public override string ItemPickupDesc => "Using a skill gives your next primary skill bonus damage."; public override string ItemFullDescription => $"Using a non-primary skill makes your next primary skill deals an extra hit equal to {BonusDamage.Value * 100f}% (+{BonusDamage.Value * 100f}% per stack) base damage."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("HydrasLamentModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Hydras Lament Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } private void CreateBuff() { hydrasBonusDamage = ScriptableObject.CreateInstance(); hydrasBonusDamage.canStack = false; hydrasBonusDamage.isDebuff = false; ((Object)hydrasBonusDamage).name = "hydrasBonusDamage"; hydrasBonusDamage.isCooldown = false; hydrasBonusDamage.iconSprite = Main.MainAssets.LoadAsset("Hydras Lament Icon.png"); ContentAddition.AddBuffDef(hydrasBonusDamage); } public override void CreateConfig(ConfigFile config) { BonusDamage = config.Bind("Item: " + ItemName, "Bonus primary damage", 0.3f, "What percentage of base damage is added to primary skill?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } protected override void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", "Hydra's Lament"); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown GenericSkill.DeductStock += new hook_DeductStock(ApplyHydrasBuffStock); SkillDef.OnExecute += new hook_OnExecute(ApplyHydrasBuff); PrepWall.OnExit += new hook_OnExit(ApplyHydrasBuffOnIceWall); Fire.FireMissile += new hook_FireMissile(ApplyHydrasBuffOnHarpoon); HealthComponent.TakeDamage += new hook_TakeDamage(HydrasDamageBonus); } private void ApplyHydrasBuffOnHarpoon(orig_FireMissile orig, Fire self, HurtBox target, Vector3 position) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, target, position); if (GetCount(((EntityState)self).characterBody) > 0 && ((EntityState)self).characterBody.GetBuffCount(hydrasBonusDamage) == 0) { ((EntityState)self).characterBody.AddBuff(hydrasBonusDamage); } } private void ApplyHydrasBuffOnIceWall(orig_OnExit orig, PrepWall self) { if (self.goodPlacement && GetCount(((EntityState)self).characterBody) > 0 && ((EntityState)self).characterBody.GetBuffCount(hydrasBonusDamage) == 0) { ((EntityState)self).characterBody.AddBuff(hydrasBonusDamage); } orig.Invoke(self); } private void ApplyHydrasBuff(orig_OnExecute orig, SkillDef self, GenericSkill skillSlot) { orig.Invoke(self, skillSlot); if (GetCount(skillSlot.characterBody) > 0) { bool flag = (Object)(object)skillSlot.characterBody.skillLocator.primary.skillDef == (Object)(object)skillSlot.skillDef; if (!flag && self.baseRechargeInterval > 0f && (skillSlot.cooldownRemaining > 0f || skillSlot.stock < skillSlot.maxStock) && skillSlot.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME" && skillSlot.skillDef.skillNameToken != "ENGI_SKILL_HARPOON_NAME" && !flag && skillSlot.characterBody.GetBuffCount(hydrasBonusDamage) == 0) { skillSlot.characterBody.AddBuff(hydrasBonusDamage); } } } private void ApplyHydrasBuffStock(orig_DeductStock orig, GenericSkill self, int count) { orig.Invoke(self, count); if (GetCount(self.characterBody) > 0) { bool flag = (Object)(object)self.characterBody.skillLocator.primary.skillDef == (Object)(object)self.skillDef; if (!flag && self.baseRechargeInterval > 0f && (self.cooldownRemaining > 0f || self.stock < self.maxStock) && self.skillDef.skillNameToken != "MAGE_UTILITY_ICE_NAME" && self.skillDef.skillNameToken != "ENGI_SKILL_HARPOON_NAME" && !flag && self.characterBody.GetBuffCount(hydrasBonusDamage) == 0) { self.characterBody.AddBuff(hydrasBonusDamage); } } } private void HydrasDamageBonus(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0 && damageInfo.procCoefficient != 0f && Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent()) && component.HasBuff(hydrasBonusDamage) && (damageInfo.damageType.damageSource & 1) != 0) { DamageInfo val = new DamageInfo(); val.damage = component.baseDamage * (BonusDamage.Value * (float)count); val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.crit = false; val.position = damageInfo.position; val.inflictor = damageInfo.inflictor; val.attacker = damageInfo.attacker; component.RemoveBuff(hydrasBonusDamage); self.TakeDamage(val); } } } orig.Invoke(self, damageInfo); } } public class Ichaival : ItemBase { public ConfigEntry DamageBuff; public ConfigEntry DamageDebuff; public ConfigEntry HardMaxDamageDebuffStacks; public ConfigEntry MaxBuffStacks; public ConfigEntry MaxDebuffStacks; public ConfigEntry AdditionalMaxBuffStacksPerStack; public ConfigEntry AdditionalMaxDebuffStacksPerStack; public ConfigEntry BuffDuration; public ConfigEntry DebuffDuration; public static BuffDef ichDamageBuff; public static BuffDef ichDamageDebuff; public override string ItemName => "Ichaival"; public override string ItemLangTokenName => "ICHAIVAL_ITEM"; public override string ItemPickupDesc => "Steal damage from enemies"; public override string ItemFullDescription => $"Dealing damage increases your damage by {DamageBuff.Value * 100f}% up to {MaxBuffStacks.Value} (+{AdditionalMaxBuffStacksPerStack.Value} per stack) times, for {BuffDuration.Value}s. " + $"The enemy hit has their damage reduced by {DamageDebuff.Value * 100f}% up to {MaxDebuffStacks.Value} (+{AdditionalMaxDebuffStacksPerStack.Value} per stack) times, for {DebuffDuration.Value}s. Maximum damage reduction through this method is {(float)HardMaxDamageDebuffStacks.Value * DamageDebuff.Value * 100f}%."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("IchaivalModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Ichaival Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } public void CreateBuff() { ichDamageBuff = ScriptableObject.CreateInstance(); ichDamageBuff.canStack = true; ichDamageBuff.isDebuff = false; ((Object)ichDamageBuff).name = "ichDamageBuff"; ichDamageBuff.isCooldown = false; ichDamageBuff.iconSprite = Main.MainAssets.LoadAsset("Ichaival Icon.png"); ContentAddition.AddBuffDef(ichDamageBuff); ichDamageDebuff = ScriptableObject.CreateInstance(); ichDamageDebuff.canStack = true; ichDamageDebuff.isDebuff = true; ((Object)ichDamageDebuff).name = "ichDamageDebuff"; ichDamageDebuff.isCooldown = false; ichDamageDebuff.iconSprite = Main.MainAssets.LoadAsset("Ichaival Icon.png"); ContentAddition.AddBuffDef(ichDamageDebuff); } public override void CreateConfig(ConfigFile config) { DamageBuff = config.Bind("Item: " + ItemName, "Damage buff per buff stack", 0.025f, "By how much does each stack of the Ichaival damage buff increase damage?"); DamageDebuff = config.Bind("Item: " + ItemName, "Damage debuff per debuff stack", 0.025f, "By how much does each stack of the Ichaival damage debuff decrease damage?"); HardMaxDamageDebuffStacks = config.Bind("Item: " + ItemName, "Maximum number of damage debuff stacks from Ichaival that can be afflicted at once", 20, "What is the hard limit on the number of Ichaival damage debuff stacks that can be applied to a single character?"); MaxBuffStacks = config.Bind("Item: " + ItemName, "Maximum number of buff stacks", 4, "What is the maximum number of buff stacks that one stack of Ichaival can apply to a single character?"); MaxDebuffStacks = config.Bind("Item: " + ItemName, "Maximum number of debuff stacks", 4, "What is the maximum number of debuff stacks that one stack of Ichaival can apply to a single character?"); AdditionalMaxBuffStacksPerStack = config.Bind("Item: " + ItemName, "Increased maximum buff stacks per item stack", 4, "How many additional buff stacks can be applied per additional stack of Ichaival?"); AdditionalMaxDebuffStacksPerStack = config.Bind("Item: " + ItemName, "Increased maximum debuff stacks per item stack", 4, "How many additional debuff stacks can be applied per additional stack of Ichaival?"); BuffDuration = config.Bind("Item: " + ItemName, "Duration in seconds of Ichaival buff stacks", 6, "How long (in seconds) does the Ichaival damage buff last?"); DebuffDuration = config.Bind("Item: " + ItemName, "Duration in seconds of Ichaival debuff stacks", 6, "How long (in seconds) does the Ichaival damage debuff last?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(ApplyBuffAndDebuff); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CalculateIchBuff); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CalculateIchDebuff); } private void CalculateIchBuff(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(ichDamageBuff); if (buffCount > 0) { args.damageMultAdd += (float)buffCount * DamageBuff.Value; } } private void CalculateIchDebuff(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(ichDamageDebuff); if (buffCount > 0) { args.damageMultAdd -= (float)buffCount * DamageDebuff.Value; } } private void ApplyBuffAndDebuff(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0) { if (component.GetBuffCount(ichDamageBuff) < MaxBuffStacks.Value + (count - 1) * AdditionalMaxBuffStacksPerStack.Value) { component.AddTimedBuff(ichDamageBuff, (float)BuffDuration.Value); } ItemHelpers.RefreshTimedBuffs(component, ichDamageBuff, BuffDuration.Value); if (Object.op_Implicit((Object)(object)self.body)) { if (self.body.GetBuffCount(ichDamageDebuff) < MaxDebuffStacks.Value + (count - 1) * AdditionalMaxDebuffStacksPerStack.Value && self.body.GetBuffCount(ichDamageDebuff) < HardMaxDamageDebuffStacks.Value) { self.body.AddTimedBuff(ichDamageDebuff, (float)DebuffDuration.Value); } ItemHelpers.RefreshTimedBuffs(self.body, ichDamageDebuff, DebuffDuration.Value); } } } } orig.Invoke(self, damageInfo); } } public class MysticalMail : ItemBase { public ConfigEntry Frequency; public ConfigEntry Damage; public ConfigEntry DamagePerStack; public ConfigEntry Radius; public static GameObject originalPulseEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/moon2/MoonBatteryDesignPulse.prefab").WaitForCompletion(); public static GameObject cachedPulseEffect; public static GameObject AOEDamageField; public override string ItemName => "Mystical Mail"; public override string ItemLangTokenName => "MYSTICALMAIL_ITEM"; public override string ItemPickupDesc => "Damage nearby enemies every second"; public override string ItemFullDescription => $"Every {Frequency.Value} second, deal {Damage.Value} (+{DamagePerStack.Value} per stack) damage to all enemies within {Radius.Value} meters."; public override string ItemLore => "Item taken from Smite 2"; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)4 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("MysticalMailModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Mystical Mail Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateEffect(); CreateItem(); Hooks(); } private void CreateEffect() { cachedPulseEffect = Object.Instantiate(originalPulseEffect); ((Object)cachedPulseEffect).name = "MysticalMailEffect"; Object.DontDestroyOnLoad((Object)(object)cachedPulseEffect); cachedPulseEffect.SetActive(false); ((Behaviour)cachedPulseEffect.GetComponent()).enabled = false; if (!Object.op_Implicit((Object)(object)cachedPulseEffect.GetComponent())) { cachedPulseEffect.AddComponent(); } ContentAddition.AddEffect(cachedPulseEffect); } public override void CreateConfig(ConfigFile config) { Frequency = config.Bind("Item: " + ItemName, "Item Frequency", 1f, "How often does the item effect activate?"); Damage = config.Bind("Item: " + ItemName, "Damage", 15f, "How much damage does each item activation do?"); DamagePerStack = config.Bind("Item: " + ItemName, "Damage per stack", 15f, "How much damage does each stack of the item add to the effect?"); Radius = config.Bind("Item: " + ItemName, "Radius", 12f, "In what radius around the player does the effect occur?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged); } private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); self.AddItemBehavior(GetCount(self)); } } public class MysticalMailBehavior : ItemBehavior { private float aoeDamageTimer; private void FixedUpdate() { //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_008a: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)base.body) && Object.op_Implicit((Object)(object)base.body.skillLocator) && NetworkServer.active && base.stack > 0) { aoeDamageTimer += Time.fixedDeltaTime; if (aoeDamageTimer >= ItemBase.instance.Frequency.Value) { aoeDamageTimer = 0f; float value = ItemBase.instance.Radius.Value; EffectManager.SpawnEffect(MysticalMail.cachedPulseEffect, new EffectData { origin = base.body.corePosition, scale = value, rotation = base.body.transform.rotation }, true); new BlastAttack { attacker = ((Component)base.body).gameObject, baseDamage = ItemBase.instance.Damage.Value + (float)(base.stack - 1) * ItemBase.instance.DamagePerStack.Value, baseForce = 0f, bonusForce = Vector3.zero, crit = base.body.RollCrit(), damageColorIndex = (DamageColorIndex)3, falloffModel = (FalloffModel)0, position = base.body.corePosition, procChainMask = default(ProcChainMask), procCoefficient = 0f, radius = value, teamIndex = base.body.teamComponent.teamIndex, inflictor = ((Component)base.body).gameObject }.Fire(); } } } } public class Phalanx : ItemBase { public ConfigEntry AttackSpeedBonus; public ConfigEntry MaxBuffStacks; public ConfigEntry MaxBuffStacksPerStack; public ConfigEntry BuffRadius; public ConfigEntry BuffDuration; public static BuffDef attackSpeedOnDamageBuff; public static Dictionary radiusIndicators = new Dictionary(); public override string ItemName => "Phalanx"; public override string ItemLangTokenName => "PHALANX_ITEM"; public override string ItemPickupDesc => "You and nearby allies gain attack speed when you take damage."; public override string ItemFullDescription => $"Increase the attack speed of you and allies in a {BuffRadius.Value}m radius around you by {AttackSpeedBonus.Value * 100f}% (+{AttackSpeedBonus.Value * 100f}% per stack) when you get hit up to {MaxBuffStacks.Value} (+{MaxBuffStacksPerStack.Value} per stack) times for {BuffDuration.Value}s."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)0; public override GameObject ItemModel => Main.MainAssets.LoadAsset("PhalanxModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Phalanx Icon.png"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } public override void CreateConfig(ConfigFile config) { AttackSpeedBonus = config.Bind("Item: " + ItemName, "Attack Speed Buff", 0.075f, "How much does each buff stack increase attack speed by?"); MaxBuffStacks = config.Bind("Item: " + ItemName, "Max stacks of buff", 3, "What is the maximum number of stacks of the attack speed buff a character can have at once?"); MaxBuffStacksPerStack = config.Bind("Item: " + ItemName, "Additional max stacks of buff per stack", 3, "How many additional stacks of the buff are allowed per additional stack of the item?"); BuffRadius = config.Bind("Item: " + ItemName, "Buff Radius", 20f, "What is the radius, in meters, in which the attack speed buff is shared?"); BuffDuration = config.Bind("Item: " + ItemName, "Buff Duration", 10, "How long, in seconds, does the item buff last?"); } public void CreateBuff() { attackSpeedOnDamageBuff = ScriptableObject.CreateInstance(); attackSpeedOnDamageBuff.canStack = true; attackSpeedOnDamageBuff.isDebuff = false; ((Object)attackSpeedOnDamageBuff).name = "attackSpeedOnDamageBuff"; attackSpeedOnDamageBuff.isCooldown = false; attackSpeedOnDamageBuff.isHidden = false; attackSpeedOnDamageBuff.iconSprite = Main.MainAssets.LoadAsset("Phalanx Icon.png"); ContentAddition.AddBuffDef(attackSpeedOnDamageBuff); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(ApplyPhalanxBuff); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(ApplyBuffStats); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(AddIndicator); CharacterBody.OnDestroy += new hook_OnDestroy(CleanupIndicator); } private void CleanupIndicator(orig_OnDestroy orig, CharacterBody self) { orig.Invoke(self); if (radiusIndicators.TryGetValue(self, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } radiusIndicators.Remove(self); } } private void AddIndicator(orig_OnInventoryChanged orig, CharacterBody self) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active) { return; } GameObject value; if (GetCount(self) > 0) { if (!radiusIndicators.ContainsKey(self) || (Object)(object)radiusIndicators[self] == (Object)null) { GameObject val = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/NearbyDamageBonusIndicator"), self.corePosition, Quaternion.identity); Transform transform = val.transform; transform.localScale *= BuffRadius.Value / 13f * 2f; Renderer componentInChildren = val.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { MaterialPropertyBlock val2 = new MaterialPropertyBlock(); componentInChildren.GetPropertyBlock(val2); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.5f, 0.2f, 1f, 0.3f); val2.SetColor("_TintColor", val3); componentInChildren.SetPropertyBlock(val2); } val.GetComponent().AttachToGameObjectAndSpawn(((Component)self).gameObject, (string)null); radiusIndicators[self] = val; } } else if (radiusIndicators.TryGetValue(self, out value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } radiusIndicators.Remove(self); } } private void ApplyBuffStats(CharacterBody sender, StatHookEventArgs args) { if (!((Object)(object)sender == (Object)null)) { int buffCount = sender.GetBuffCount(attackSpeedOnDamageBuff); if (buffCount > 0) { args.attackSpeedMultAdd += (float)buffCount * AttackSpeedBonus.Value; } } } private void ApplyPhalanxBuff(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self) || !self.alive || !Object.op_Implicit((Object)(object)self.body) || !Object.op_Implicit((Object)(object)self.body.inventory)) { return; } int count = GetCount(self.body); if (count <= 0) { return; } TeamIndex teamIndex = self.body.teamComponent.teamIndex; SphereSearch val = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = self.body.corePosition, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = BuffRadius.Value }; TeamMask val2 = default(TeamMask); ((TeamMask)(ref val2)).AddTeam(teamIndex); List list = new List(); val.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val2).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(list); foreach (HurtBox item in list) { HealthComponent healthComponent = item.healthComponent; if (!Object.op_Implicit((Object)(object)healthComponent)) { continue; } int buffCount = healthComponent.body.GetBuffCount(attackSpeedOnDamageBuff); int num = MaxBuffStacks.Value + (count - 1) * MaxBuffStacksPerStack.Value; for (int i = 0; i < count; i++) { if (buffCount < num) { healthComponent.body.AddTimedBuff(attackSpeedOnDamageBuff, (float)BuffDuration.Value); buffCount = healthComponent.body.GetBuffCount(attackSpeedOnDamageBuff); } } ItemHelpers.RefreshTimedBuffs(healthComponent.body, attackSpeedOnDamageBuff, BuffDuration.Value); } list.Clear(); } } public class ShiftersShield : ItemBase { public ConfigEntry PercentBonusDamage; public ConfigEntry LowHealthArmor; public ConfigEntry ShiftHealthThreshold; public override string ItemName => "Shifters Shield"; public override string ItemLangTokenName => "SHIFTER_ITEM"; public override string ItemPickupDesc => "Deal bonus damage while above half health, reduce incoming damage when below half health"; public override string ItemFullDescription => $"While above {ShiftHealthThreshold.Value * 100f}% health, increase damage by {PercentBonusDamage.Value * 100f}% (+{PercentBonusDamage.Value * 100f}% per stack)." + $" While at or below {ShiftHealthThreshold.Value * 100f}% health, increase armor by {LowHealthArmor.Value} (+{LowHealthArmor.Value} per stack)."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("ShiftersShieldModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Shifters Shield Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); Hooks(); } public override void CreateConfig(ConfigFile config) { PercentBonusDamage = config.Bind("Item: " + ItemName, "Percent bonus damage", 0.1f, "How much bonus damage is given when above the health threshold?"); LowHealthArmor = config.Bind("Item: " + ItemName, "Low health armor", 10, "How much armor is given when below the health threshold?"); ShiftHealthThreshold = config.Bind("Item: " + ItemName, "Shift health threshold", 0.5f, "What percentage of maximum health is treated as the threshold to swap conditions?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStats); } protected override void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", "Shifter's Shield"); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } private void RecalculateStats(CharacterBody sender, StatHookEventArgs args) { int count = GetCount(sender); if (count > 0 && (Object)(object)sender.healthComponent != (Object)null && sender.maxHealth > 0f) { if (sender.healthComponent.combinedHealthFraction > ShiftHealthThreshold.Value) { args.damageMultAdd += PercentBonusDamage.Value * (float)count; } else { args.armorAdd += (float)(LowHealthArmor.Value * count); } } } } public class SoulGem : ItemBase { public ConfigEntry BonusDamage; public ConfigEntry BonusDamagePerStack; public ConfigEntry StacksNeeded; public ConfigEntry HealValue; public ConfigEntry HealValuePerStack; public ConfigEntry HealRadius; public ConfigEntry HealRadiusPerStack; public static BuffDef soulGemStack; private static GameObject cachedPulseEffect; public override string ItemName => "Soul Gem"; public override string ItemLangTokenName => "SOUL_GEM_ITEM"; public override string ItemPickupDesc => "Charge by using skills to get bonus damage and area healing."; public override string ItemFullDescription => "Activating a Non-Primary skill stores a charge, up to 3 charges. " + $"Requires 3 charges for your next hit to hit with an extra {BonusDamage.Value * 100f}% (+{BonusDamagePerStack.Value * 100f}% per stack) base damage and heal yourself and allies for {HealValue.Value} (+{HealValuePerStack.Value} per stack) within {HealRadius.Value}m (+{HealRadiusPerStack.Value}m per stack)."; public override string ItemLore => "Item taken from Smite 2"; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)2 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("SoulGemModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Soul Gem Icon.png"); public override void Init(ConfigFile config) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); cachedPulseEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/TPHealingNova/TeleporterHealNovaPulse.prefab").WaitForCompletion(); cachedPulseEffect.AddComponent(); ContentAddition.AddEffect(cachedPulseEffect); Hooks(); } private void CreateBuff() { soulGemStack = ScriptableObject.CreateInstance(); soulGemStack.canStack = true; soulGemStack.isDebuff = false; ((Object)soulGemStack).name = "soulGemStack"; soulGemStack.isCooldown = false; soulGemStack.iconSprite = Main.MainAssets.LoadAsset("Soul Gem Icon.png"); ContentAddition.AddBuffDef(soulGemStack); } public override void CreateConfig(ConfigFile config) { BonusDamage = config.Bind("Item: " + ItemName, "Bonus Damage", 0.4f, "How much bonus damage (as a percent of base damage) does a proc of Soul Gem deal?"); BonusDamagePerStack = config.Bind("Item: " + ItemName, "Bonus Damage Per Stack", 0.4f, "How much additional bonus damage (as a percent of base damage) does a proc of Soul Gem deal per additional stack of the item?"); StacksNeeded = config.Bind("Item: " + ItemName, "Stacks Needed", 3, "How many Soul Gem buff stacks until Soul Gem activates?"); HealValue = config.Bind("Item: " + ItemName, "Heal Value", 30f, "How much health does an activation of Soul Gem heal?"); HealValuePerStack = config.Bind("Item: " + ItemName, "Heal Value Per Stack", 30f, "How much extra health does an activation of Soul Gem heal per additional stack of the item?"); HealRadius = config.Bind("Item: " + ItemName, "Heal Radius", 5f, "In what radius around the character does the Soul Gem activation heal in meters?"); HealRadiusPerStack = config.Bind("Item: " + ItemName, "Heal Radius Per Stack", 2.5f, "How much does each stack of the item increase the heal radius by in meters?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown CharacterBody.OnSkillActivated += new hook_OnSkillActivated(GiveSoulGemStack); HealthComponent.TakeDamage += new hook_TakeDamage(ActivateSoulGem); } private void ActivateSoulGem(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0 && damageInfo.procCoefficient != 0f && Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent()) && NetworkServer.active && component.GetBuffCount(soulGemStack) >= StacksNeeded.Value) { DamageInfo val = new DamageInfo(); val.damage = component.baseDamage * (BonusDamage.Value + BonusDamagePerStack.Value * (float)(count - 1)); val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.crit = false; val.position = damageInfo.position; val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.inflictor = damageInfo.inflictor; val.attacker = damageInfo.attacker; component.SetBuffCount(soulGemStack.buffIndex, 0); self.TakeDamage(val); float num = HealRadius.Value + HealRadiusPerStack.Value * (float)(count - 1); float num2 = HealValue.Value + HealValuePerStack.Value * (float)(count - 1); EffectManager.SpawnEffect(cachedPulseEffect, new EffectData { origin = component.corePosition, scale = num, rotation = component.transform.rotation }, true); TeamIndex teamIndex = component.teamComponent.teamIndex; SphereSearch val2 = new SphereSearch { mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, origin = component.corePosition, queryTriggerInteraction = (QueryTriggerInteraction)2, radius = num }; TeamMask val3 = default(TeamMask); ((TeamMask)(ref val3)).AddTeam(teamIndex); List list = new List(); val2.RefreshCandidates().FilterCandidatesByHurtBoxTeam(val3).FilterCandidatesByDistinctHurtBoxEntities() .GetHurtBoxes(list); foreach (HurtBox item in list) { HealthComponent healthComponent = item.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent)) { healthComponent.Heal(num2, default(ProcChainMask), true); } } list.Clear(); } } } orig.Invoke(self, damageInfo); } private void GiveSoulGemStack(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { orig.Invoke(self, skill); if (GetCount(self) > 0 && !((Object)(object)self.skillLocator.primary.skillDef == (Object)(object)skill.skillDef) && self.GetBuffCount(soulGemStack) < StacksNeeded.Value) { self.AddBuff(soulGemStack); } } } public class TekkoKagi : ItemBase { public ConfigEntry MaxStacks; public ConfigEntry MoveSpeedPerStack; public ConfigEntry StackDuration; public static BuffDef tekkoMoveSpeed; private SkillLocator skillLocator; public override string ItemName => "Tekko-Kagi"; public override string ItemLangTokenName => "TEKKOKAGI_ITEM"; public override string ItemPickupDesc => "Gain movement speed on skill use."; public override string ItemFullDescription => $"Activating a non-Primary skill grants a stack of {MoveSpeedPerStack.Value * 100f}% movement speed up to {(float)MaxStacks.Value * MoveSpeedPerStack.Value * 100f}% (+{(float)MaxStacks.Value * MoveSpeedPerStack.Value * 100f}% per stack) that lasts {StackDuration.Value} seconds."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)0; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("TekkoKagiModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Tekko Kagi Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } private void CreateBuff() { tekkoMoveSpeed = ScriptableObject.CreateInstance(); tekkoMoveSpeed.canStack = true; tekkoMoveSpeed.isDebuff = false; ((Object)tekkoMoveSpeed).name = "tekkoMoveSpeed"; tekkoMoveSpeed.isCooldown = false; tekkoMoveSpeed.iconSprite = Main.MainAssets.LoadAsset("Tekko Kagi Icon.png"); ContentAddition.AddBuffDef(tekkoMoveSpeed); } public override void CreateConfig(ConfigFile config) { MaxStacks = config.Bind("Item: " + ItemName, "Maximum Stacks", 3, "What is the maximum number of stacks of movement speed?"); MoveSpeedPerStack = config.Bind("Item: " + ItemName, "Percent movement speed increase per stack", 0.08f, "How much movement speed does the character get per stack of the buff?"); StackDuration = config.Bind("Item: " + ItemName, "Duration of movement speed stacks in seconds", 10, "How long do movement speed stacks last before reseting?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown CharacterBody.OnSkillActivated += new hook_OnSkillActivated(AddMoveStack); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStats); } private void RecalculateStats(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(tekkoMoveSpeed); if (buffCount > 0) { args.moveSpeedMultAdd += (float)buffCount * MoveSpeedPerStack.Value; } } private void AddMoveStack(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { orig.Invoke(self, skill); int count = GetCount(self); if (count > 0 && !((Object)(object)self.skillLocator.primary.skillDef == (Object)(object)skill.skillDef) && self.GetBuffCount(tekkoMoveSpeed) < MaxStacks.Value * count) { self.AddTimedBuff(tekkoMoveSpeed, (float)StackDuration.Value); ItemHelpers.RefreshTimedBuffs(self, tekkoMoveSpeed, StackDuration.Value); } } } public class BancroftsClaw : ItemBase { public ConfigEntry BaseDamage; public ConfigEntry BonusBaseDamagePerStack; public ConfigEntry Recharge; public ConfigEntry MaxHungerStacks; public ConfigEntry BonusMaxHungerStacksPerStack; public ConfigEntry MaxHPBarrier; public ConfigEntry Radius; public static BuffDef clawCharge; public static Dictionary clawRadiusIndicators = new Dictionary(); public static Dictionary clawRechargeTimers = new Dictionary(); public static GameObject cachedDamageEffect; public override string ItemName => "Bancrofts Claw"; public override string ItemLangTokenName => "BANCROFTS_CLAW_ITEM"; public override string ItemPickupDesc => "Activating non-Primary skills also blasts nearby enemies and grants temporary barrier. Recharges over time."; public override string ItemFullDescription => $"Activating a Non-Primary skill unleashes a consuming blast around you, dealing {BaseDamage.Value}% (+{BonusBaseDamagePerStack.Value}% per stack) base damage. Each target hit also grants a temporary barrier for {MaxHPBarrier.Value}% of maximum health. " + $"Can hold up to {MaxHungerStacks.Value} (+{BonusMaxHungerStacksPerStack.Value} per stack) charges which all reload over {Recharge.Value} seconds."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => Main.MainAssets.LoadAsset("BancroftsClawModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Bancrofts Claw Icon.png"); public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override void Init(ConfigFile config) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) CreateConfig(config); CreateLang(); CreateBuff(); CreateItem(); cachedDamageEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/ExplosionVFX.prefab").WaitForCompletion(); Hooks(); } public override void CreateConfig(ConfigFile config) { BaseDamage = config.Bind("Item: " + ItemName, "Base Damage", 500f, "What percentage of base damage does the blast deal?"); BonusBaseDamagePerStack = config.Bind("Item: " + ItemName, "Bonus Base Damage Per Stack", 100f, "How much does additional stack of the item increase the percentage base damage by?"); Recharge = config.Bind("Item: " + ItemName, "Recharge", 20, "How long, in seconds, does it take for all stacks of hunger to recharge?"); MaxHungerStacks = config.Bind("Item: " + ItemName, "Max Hunger Stacks", 3, "What is the maximum number of stacks of hunger that can be stored at a time?"); BonusMaxHungerStacksPerStack = config.Bind("Item: " + ItemName, "Bonus Max Hunger Stacks Per Stack", 1, "How many additional stacks of hunger can be stored per additional item stack?"); MaxHPBarrier = config.Bind("Item: " + ItemName, "Max HP Barrier", 10f, "What percentage of maximum HP is given as barrier?"); Radius = config.Bind("Item: " + ItemName, "Radius", 10f, "What is the radius of the claw effect?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } protected override void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", "Bancroft's Claw"); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public void CreateBuff() { clawCharge = ScriptableObject.CreateInstance(); clawCharge.canStack = true; clawCharge.isDebuff = false; ((Object)clawCharge).name = "clawCharge"; clawCharge.isCooldown = true; clawCharge.iconSprite = Main.MainAssets.LoadAsset("Bancrofts Claw Icon.png"); ContentAddition.AddBuffDef(clawCharge); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(StartCooldowns); CharacterBody.FixedUpdate += new hook_FixedUpdate(HandleClawCharge); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(CheckAndApplyHunger); CharacterBody.OnDeathStart += new hook_OnDeathStart(CleanupOnDeath); } private void CleanupOnDeath(orig_OnDeathStart orig, CharacterBody self) { orig.Invoke(self); clawRechargeTimers.Remove(self); if (clawRadiusIndicators.TryGetValue(self, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } clawRadiusIndicators.Remove(self); } } private void StartCooldowns(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (!NetworkServer.active) { return; } int count = GetCount(self); if (count > 0) { if (!clawRechargeTimers.ContainsKey(self)) { clawRechargeTimers[self] = Recharge.Value / (count + 2); } return; } clawRechargeTimers.Remove(self); while (self.HasBuff(clawCharge)) { self.RemoveBuff(clawCharge); } if (clawRadiusIndicators.TryGetValue(self, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } clawRadiusIndicators.Remove(self); } } private void HandleClawCharge(orig_FixedUpdate orig, CharacterBody self) { //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_0197: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); int count = GetCount(self); if (!NetworkServer.active || count <= 0) { return; } if (!clawRechargeTimers.ContainsKey(self)) { clawRechargeTimers[self] = Recharge.Value / (count + 2); } int buffCount = self.GetBuffCount(clawCharge); int num = MaxHungerStacks.Value + (count - 1) * BonusMaxHungerStacksPerStack.Value; if (buffCount < num) { clawRechargeTimers[self] -= Time.fixedDeltaTime; } if (clawRechargeTimers[self] <= 0f && buffCount < num) { clawRechargeTimers[self] += Recharge.Value / (count + 2); self.AddBuff(clawCharge); } GameObject value; if (buffCount > 0) { if (!clawRadiusIndicators.ContainsKey(self) || (Object)(object)clawRadiusIndicators[self] == (Object)null) { GameObject val = Object.Instantiate(LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/NearbyDamageBonusIndicator"), self.corePosition, Quaternion.identity); Transform transform = val.transform; transform.localScale *= Radius.Value / 13f * 2f; Renderer componentInChildren = val.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { MaterialPropertyBlock val2 = new MaterialPropertyBlock(); componentInChildren.GetPropertyBlock(val2); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.31f, 0.588f, 0.8588f, 0.6f); val2.SetColor("_TintColor", val3); componentInChildren.SetPropertyBlock(val2); } val.GetComponent().AttachToGameObjectAndSpawn(((Component)self).gameObject, (string)null); clawRadiusIndicators[self] = val; } } else if (clawRadiusIndicators.TryGetValue(self, out value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } clawRadiusIndicators.Remove(self); } } private void CheckAndApplyHunger(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_018a: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown orig.Invoke(self, skill); int count = GetCount(self); if (count <= 0 || (Object)(object)self.skillLocator.primary.skillDef == (Object)(object)skill.skillDef || !self.HasBuff(clawCharge)) { return; } SphereSearch val = new SphereSearch { origin = self.corePosition, radius = Radius.Value, mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask }; val.RefreshCandidates(); val.FilterCandidatesByHurtBoxTeam(TeamMask.GetEnemyTeams(self.teamComponent.teamIndex)); val.FilterCandidatesByDistinctHurtBoxEntities(); List list = new List(); val.GetHurtBoxes(list); val.ClearCandidates(); if (list.Count > 0) { if (cachedDamageEffect != null) { EffectManager.SpawnEffect(cachedDamageEffect, new EffectData { origin = self.corePosition, scale = Radius.Value }, true); } new BlastAttack { attacker = ((Component)self).gameObject, baseDamage = self.baseDamage * (BaseDamage.Value / 100f + (float)(count - 1) * BonusBaseDamagePerStack.Value / 100f), baseForce = 0f, bonusForce = Vector3.zero, crit = self.RollCrit(), damageColorIndex = (DamageColorIndex)3, falloffModel = (FalloffModel)0, position = self.corePosition, procChainMask = default(ProcChainMask), procCoefficient = 0f, radius = Radius.Value, teamIndex = self.teamComponent.teamIndex, inflictor = ((Component)self).gameObject }.Fire(); self.healthComponent.AddBarrier(self.maxHealth * (float)list.Count * (MaxHPBarrier.Value / 100f)); self.RemoveBuff(clawCharge); } list.Clear(); } } public class BreastplateValor : ItemBase { public ConfigEntry CooldownsReducedPerActivation; public ConfigEntry PercentHealthLostToTrigger; public static BuffDef breastplateHealthTracker; public override string ItemName => "Breastplate of Valor"; public override string ItemLangTokenName => "VALOR_BREASTPLATE_ITEM"; public override string ItemPickupDesc => "Reduce skill cooldowns after losing enough health"; public override string ItemFullDescription => $"For every {PercentHealthLostToTrigger.Value * 100f}% of your max health you lose your skill cooldowns are reduced by {CooldownsReducedPerActivation.Value} (+{CooldownsReducedPerActivation.Value} per stack) seconds."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("BreastplateModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Breastplate Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } public void CreateBuff() { breastplateHealthTracker = ScriptableObject.CreateInstance(); breastplateHealthTracker.canStack = true; breastplateHealthTracker.isDebuff = false; ((Object)breastplateHealthTracker).name = "breastplateHealthTracker"; breastplateHealthTracker.isCooldown = false; breastplateHealthTracker.isHidden = false; breastplateHealthTracker.iconSprite = Main.MainAssets.LoadAsset("Breastplate Icon.png"); ContentAddition.AddBuffDef(breastplateHealthTracker); } public override void CreateConfig(ConfigFile config) { CooldownsReducedPerActivation = config.Bind("Item: " + ItemName, "Ability cooldowns reduced per activation", 1f, "How many seconds removed from each ability cooldown per item proc?"); PercentHealthLostToTrigger = config.Bind("Item: " + ItemName, "Percent health lost to trigger item", 0.25f, "How much of a characters max health needs to be lost to trigger the item?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(CalculateHealthLost); } private void CalculateHealthLost(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_00fe: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self) || !self.alive || !Object.op_Implicit((Object)(object)self.body) || !Object.op_Implicit((Object)(object)self.body.inventory)) { return; } int count = GetCount(self.body); if (!Object.op_Implicit((Object)(object)self.body.skillLocator) || count <= 0) { return; } int num = Mathf.RoundToInt(damageInfo.damage / self.body.maxHealth * 1000f); if (num > 0) { int buffCount = self.body.GetBuffCount(breastplateHealthTracker); int num2 = num + buffCount; int num3 = Mathf.FloorToInt((float)num2 / (PercentHealthLostToTrigger.Value * 1000f)); if (num3 > 0) { self.body.skillLocator.DeductCooldownFromAllSkillsServer(CooldownsReducedPerActivation.Value * (float)count * (float)num3); num2 %= 250; } self.body.SetBuffCount(breastplateHealthTracker.buffIndex, num2); } } } public class ChronosPendant : ItemBase { public ConfigEntry ItemCooldown; public ConfigEntry CooldownsRemovedPerActivation; public static BuffDef chronosPendantCooldown; public override string ItemName => "Chronos Pendant"; public override string ItemLangTokenName => "CHRONOSPENDANT_ITEM"; public override string ItemPickupDesc => "Periodically lower ability cooldowns."; public override string ItemFullDescription => $"Every {ItemCooldown.Value} seconds, lower all skill cooldowns by {CooldownsRemovedPerActivation.Value} (+{CooldownsRemovedPerActivation.Value} per stack) seconds."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("ChronosPendantModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Chronos Pendant Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } public override void CreateConfig(ConfigFile config) { ItemCooldown = config.Bind("Item: " + ItemName, "Item Cooldown", 10, "How many seconds between each item proc?"); CooldownsRemovedPerActivation = config.Bind("Item: " + ItemName, "Ability cooldowns removed per activation", 1f, "How many seconds removed from each ability cooldown per item proc?"); } protected override void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", "Chronos' Pendant"); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged); } private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); self.AddItemBehavior(GetCount(self)); } public void CreateBuff() { chronosPendantCooldown = ScriptableObject.CreateInstance(); chronosPendantCooldown.canStack = true; chronosPendantCooldown.isDebuff = false; ((Object)chronosPendantCooldown).name = "ChronosPendantCooldown"; chronosPendantCooldown.isCooldown = true; chronosPendantCooldown.iconSprite = Main.MainAssets.LoadAsset("Chronos Pendant Icon.png"); ContentAddition.AddBuffDef(chronosPendantCooldown); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } } public class ChronosPendantBehavior : ItemBehavior { private void OnDisable() { if (Object.op_Implicit((Object)(object)base.body) && base.body.HasBuff(ChronosPendant.chronosPendantCooldown)) { base.body.ClearTimedBuffs(ChronosPendant.chronosPendantCooldown); } } private void FixedUpdate() { if (!Object.op_Implicit((Object)(object)base.body) || !Object.op_Implicit((Object)(object)base.body.skillLocator) || !NetworkServer.active || base.body.HasBuff(ChronosPendant.chronosPendantCooldown)) { return; } if (ItemBase.instance == null) { Debug.Log((object)"ChronosPendant.instance was somehow null"); return; } float num = ItemBase.instance.CooldownsRemovedPerActivation.Value * (float)base.stack; base.body.skillLocator.DeductCooldownFromAllSkillsServer(num); for (int i = 1; i <= ItemBase.instance.ItemCooldown.Value; i++) { base.body.AddTimedBuff(ChronosPendant.chronosPendantCooldown, (float)i); } } } public class DraconicScale : ItemBase { public class DraconicScaleBehavior : ItemBehavior { private float StackCooldownTimer; private void OnDisable() { while (Object.op_Implicit((Object)(object)base.body) && base.body.HasBuff(scaleArmorBuff)) { base.body.RemoveBuff(scaleArmorBuff); } } private void FixedUpdate() { if (Object.op_Implicit((Object)(object)base.body) && NetworkServer.active && base.body.HasBuff(scaleArmorBuff)) { StackCooldownTimer += Time.deltaTime; if (StackCooldownTimer >= ItemBase.instance.BuffDuration.Value) { base.body.RemoveBuff(scaleArmorBuff); StackCooldownTimer = 0f; } } } } public ConfigEntry ScaleArmorFlat; public ConfigEntry ScaleArmorPercent; public ConfigEntry BuffDuration; public ConfigEntry MaxStacks; public static BuffDef scaleArmorBuff; public override string ItemName => "Draconic Scale"; public override string ItemLangTokenName => "SCALE_ITEM"; public override string ItemPickupDesc => "Gain temporary armor after taking damage"; public override string ItemFullDescription => $"Each time you take damage, gain a buff that grants {ScaleArmorFlat.Value} armor and increases armor by {ScaleArmorPercent.Value * 100f}% for {BuffDuration.Value} seconds up to a maximum of {MaxStacks.Value} (+{MaxStacks.Value} per stack) times. This buff decays by 1 stack at a time."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("DraconicScaleModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Draconic Scale Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } private void CreateBuff() { scaleArmorBuff = ScriptableObject.CreateInstance(); scaleArmorBuff.canStack = true; scaleArmorBuff.isDebuff = false; ((Object)scaleArmorBuff).name = "scaleArmorBuff"; scaleArmorBuff.isCooldown = false; scaleArmorBuff.iconSprite = Main.MainAssets.LoadAsset("Draconic Scale Icon.png"); ContentAddition.AddBuffDef(scaleArmorBuff); } public override void CreateConfig(ConfigFile config) { ScaleArmorFlat = config.Bind("Item: " + ItemName, "Flat armor per scale stack", 2f, "How much flat armor is given per stack of Draconic Scale buff?"); ScaleArmorPercent = config.Bind("Item: " + ItemName, "Percent armor boost per scale stack", 0.03f, "By what percentage does each stack of Draconic Scale buff increase armor?"); BuffDuration = config.Bind("Item: " + ItemName, "Duration of buff stacks", 1.5f, "How long does each stack of the Draconic Scale buff last?"); MaxStacks = config.Bind("Item: " + ItemName, "Maximum scale buff stacks", 7, "What is the maximum amount of buff stacks Draconic Scale can apply?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged); HealthComponent.TakeDamage += new hook_TakeDamage(AddArmor); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CalculateScaleArmor); } private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); self.AddItemBehavior(GetCount(self)); } private void CalculateScaleArmor(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int buffCount = sender.GetBuffCount(scaleArmorBuff); sender.inventory.GetItemCount(ItemBase.instance.ItemDef); if (buffCount > 0) { args.armorAdd += ScaleArmorFlat.Value * (float)buffCount; args.armorTotalMult += ScaleArmorPercent.Value * (float)buffCount; } } } private void AddArmor(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory) && GetCount(self.body) > 0) { ItemHelpers.RefreshTimedBuffs(self.body, scaleArmorBuff, BuffDuration.Value); if (self.body.GetBuffCount(scaleArmorBuff) < MaxStacks.Value * GetCount(self.body)) { self.body.AddBuff(scaleArmorBuff); } } } } public class Equinox : ItemBase { public ConfigEntry FrontHeal; public ConfigEntry FrontHealPerStack; public ConfigEntry BackDamageBonus; public ConfigEntry BackDamageBonusPerStack; public override string ItemName => "Equinox"; public override string ItemLangTokenName => "EQUINOX_ITEM"; public override string ItemPickupDesc => "Attacks heal from the front and deal bonus damage from behind."; public override string ItemFullDescription => $"Dealing damage from the front heals you for {FrontHeal.Value} (+{FrontHealPerStack.Value} per stack) health. Damage dealt from behind deal a bonus {BackDamageBonus.Value * 100f}% TOTAL damage (+{BackDamageBonusPerStack.Value * 100f}% per stack)."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => Main.MainAssets.LoadAsset("EquinoxModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Equinox Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); Hooks(); } public override void CreateConfig(ConfigFile config) { FrontHeal = config.Bind("Item: " + ItemName, "Health restored on front attack", 1, "How much health is restored on a front attack?"); FrontHealPerStack = config.Bind("Item: " + ItemName, "Health restored on front attack per stack", 1, "How much health is restored on a front attack per additional stack of the item?"); BackDamageBonus = config.Bind("Item: " + ItemName, "Back attack damage bonus", 0.3f, "What percentage of bonus damage does a back attack deal?"); BackDamageBonusPerStack = config.Bind("Item: " + ItemName, "Back attack damage bonus per stack", 0.3f, "What percentage of bonus damage does a back attack deal per additional stack of the item?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(HandleEquinox); } private void HandleEquinox(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0 && damageInfo.procCoefficient != 0f) { if (BackstabManager.IsBackstab(-(component.corePosition - damageInfo.position), self.body)) { DamageInfo val = new DamageInfo(); val.damage = damageInfo.damage * (BackDamageBonus.Value + BackDamageBonusPerStack.Value * (float)(count - 1)); val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.crit = false; val.position = damageInfo.position; val.inflictor = damageInfo.inflictor; val.attacker = damageInfo.attacker; self.TakeDamage(val); } else { int num = FrontHeal.Value + FrontHealPerStack.Value * (count - 1); component.healthComponent.Heal((float)num, default(ProcChainMask), true); } } } } orig.Invoke(self, damageInfo); } } public class Musashis : ItemBase { public ConfigEntry baseCritChance; public ConfigEntry moveSpeedPerStack; public ConfigEntry stackDuration; public ConfigEntry baseStackCount; public ConfigEntry stackCountPerAdditionalItem; public static BuffDef musashiMoveSpeed; public override string ItemName => "Musashis Dual Swords"; public override string ItemLangTokenName => "MUSASHIS_DUAL_SWORDS"; public override string ItemPickupDesc => "'Critical Strikes' increase movement speed. Stacks 3 times."; public override string ItemFullDescription => $"Gain {baseCritChance.Value}% critical chance. Critical strikes increase movement speed by {moveSpeedPerStack.Value * 100f}% for {stackDuration.Value}s. " + $"Maximum cap of {(float)baseStackCount.Value * moveSpeedPerStack.Value * 100f}% (+{(float)stackCountPerAdditionalItem.Value * moveSpeedPerStack.Value * 100f}% per stack) movement speed."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("MusashisModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Dual Blades Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } private void CreateBuff() { musashiMoveSpeed = ScriptableObject.CreateInstance(); musashiMoveSpeed.canStack = true; musashiMoveSpeed.isDebuff = false; ((Object)musashiMoveSpeed).name = "musashiMoveSpeed"; musashiMoveSpeed.isCooldown = false; musashiMoveSpeed.iconSprite = Main.MainAssets.LoadAsset("Dual Blades Icon.png"); ContentAddition.AddBuffDef(musashiMoveSpeed); } public override void CreateConfig(ConfigFile config) { baseCritChance = config.Bind("Item: " + ItemName, "Base critical hit chance", 5f, "How much critical chance is granted on the first item stack?"); moveSpeedPerStack = config.Bind("Item: " + ItemName, "Percentage movement speed increase per critical strike", 0.12f, "How much movement speed is granted for each critical strike?"); stackDuration = config.Bind("Item: " + ItemName, "Movement speed duration", 3f, "How many seconds does the movement speed buff last?"); baseStackCount = config.Bind("Item: " + ItemName, "Base maximum movement speed stacks", 3, "What is the maximum number of stacks of the movement speed buff the first stack of the item allows?"); stackCountPerAdditionalItem = config.Bind("Item: " + ItemName, "Additional movement speed stacks allowed per additional item stack", 2, "By how many stacks does the maximum stack count of the movement speed buff increase per additional item?"); } protected override void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", "Musashi's Dual Swords"); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(CheckAndApplyMusashis); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStats); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(AddBaseCrit); } private void AddBaseCrit(CharacterBody sender, StatHookEventArgs args) { if (GetCount(sender) > 0) { args.critAdd += baseCritChance.Value; } } private void RecalculateStats(CharacterBody sender, StatHookEventArgs args) { int buffCount = sender.GetBuffCount(musashiMoveSpeed); if (buffCount > 0) { args.moveSpeedMultAdd += (float)buffCount * moveSpeedPerStack.Value; } } private void CheckAndApplyMusashis(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { if (damageInfo.crit && Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0 && component.GetBuffCount(musashiMoveSpeed) < baseStackCount.Value + (count - 1) * stackCountPerAdditionalItem.Value) { component.AddTimedBuff(musashiMoveSpeed, stackDuration.Value); ItemHelpers.RefreshTimedBuffs(component, musashiMoveSpeed, stackDuration.Value); } } } orig.Invoke(self, damageInfo); } } public class Pridwen : ItemBase { public ConfigEntry ShieldPercent; public ConfigEntry ExplosionRadius; public ConfigEntry ExplosionRadiusStack; public ConfigEntry ShieldDamageMultiplier; public ConfigEntry ShieldDamageMultiplierPerStack; private static GameObject cachedExplosionEffect; public override string ItemName => "Glorious Pridwen"; public override string ItemLangTokenName => "GLORIOUS_PRIDWEN_ITEM"; public override string ItemPickupDesc => "Gain a shield that explodes when destroyed."; public override string ItemFullDescription => $"Whenever your shield breaks, explode in a {ExplosionRadius.Value}m (+{ExplosionRadiusStack.Value}m per stack) radius for {ShieldDamageMultiplier.Value} (+{ShieldDamageMultiplierPerStack.Value} per stack) times your maximum shield in damage." + $"Gain a shield equal to {ShieldPercent.Value * 100f}% of your maximum health. "; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)1, (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("GloriousPridwenModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Glorious Pridwen Icon.png"); public override void Init(ConfigFile config) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) CreateConfig(config); CreateLang(); CreateItem(); cachedExplosionEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/moon2/MoonBatteryDesignPulse.prefab").WaitForCompletion(); cachedExplosionEffect.AddComponent(); ContentAddition.AddEffect(cachedExplosionEffect); Hooks(); } public override void CreateConfig(ConfigFile config) { ShieldPercent = config.Bind("Item: " + ItemName, "Percent Max Health Shield", 0.1f, "What percentage of maximum health should the first stack of the item provide in shield?"); ExplosionRadius = config.Bind("Item: " + ItemName, "Explosion Radius", 20f, "What is the base radius of the explosion when losing all shield?"); ExplosionRadiusStack = config.Bind("Item: " + ItemName, "Explosion Radius Per Stack", 4f, "How much does each stack of the item increase the explosion radius by?"); ShieldDamageMultiplier = config.Bind("Item: " + ItemName, "Shield Damage Multiplier", 10f, "How much is the characters max shield multiplied by to get the explosion damage?"); ShieldDamageMultiplierPerStack = config.Bind("Item: " + ItemName, "Shield Damage Multiplier Per Stack", 6f, "How much does each additional stack of the item add to the shield damage multiplier?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStats); HealthComponent.TakeDamage += new hook_TakeDamage(CheckShield); } private void CheckShield(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) float shield = self.shield; orig.Invoke(self, damageInfo); float shield2 = self.shield; if (Object.op_Implicit((Object)(object)self.body) && Object.op_Implicit((Object)(object)self.body.inventory)) { int count = GetCount(self.body); if (count > 0 && shield > 0f && shield2 <= 0f && NetworkServer.active) { float baseDamage = self.body.maxShield * (ShieldDamageMultiplier.Value + (float)(count - 1) * ShieldDamageMultiplierPerStack.Value); float num = ExplosionRadius.Value + ExplosionRadiusStack.Value * (float)(count - 1); EffectManager.SpawnEffect(cachedExplosionEffect, new EffectData { origin = self.body.corePosition, scale = num, rotation = self.body.transform.rotation }, true); new BlastAttack { attacker = ((Component)self.body).gameObject, baseDamage = baseDamage, baseForce = 0f, bonusForce = Vector3.zero, crit = self.body.RollCrit(), damageColorIndex = (DamageColorIndex)3, falloffModel = (FalloffModel)0, position = self.body.corePosition, procChainMask = default(ProcChainMask), procCoefficient = 1f, radius = num, teamIndex = TeamComponent.GetObjectTeam(((Component)self.body).gameObject), inflictor = ((Component)self.body).gameObject }.Fire(); } } } private void RecalculateStats(CharacterBody sender, StatHookEventArgs args) { if (GetCount(sender) > 0 && (Object)(object)sender.healthComponent != (Object)null) { float maxHealth = sender.maxHealth; if (maxHealth > 0f) { args.baseShieldAdd += maxHealth * ShieldPercent.Value; } } } } public class RegrowthStriders : ItemBase { public class IndependentStackTracker : MonoBehaviour { private CharacterBody body; private readonly List stackTimers = new List(); public BuffDef trackedBuff; public int maxStacks = ItemBase.instance.MaxBuffStacks.Value; public int CurrentStacks => stackTimers.Count; private void Awake() { body = ((Component)this).GetComponent(); } private void FixedUpdate() { if (!Object.op_Implicit((Object)(object)body) || !NetworkServer.active || !body.HasBuff(regrowthMoveSpeed)) { return; } stackTimers[stackTimers.Count - 1] -= Time.fixedDeltaTime; if (stackTimers[stackTimers.Count - 1] <= 0f) { stackTimers.RemoveAt(stackTimers.Count - 1); if (body.HasBuff(trackedBuff)) { body.RemoveBuff(trackedBuff); } } } public void AddStack(float duration) { if (maxStacks <= 0 || stackTimers.Count < maxStacks) { stackTimers.Add(duration); body.AddBuff(trackedBuff); } } public void ClearAllStacks() { while (body.HasBuff(trackedBuff)) { body.RemoveBuff(trackedBuff); } stackTimers.Clear(); } } public ConfigEntry MoveSpeedPerStack; public ConfigEntry BaseBuffDuration; public ConfigEntry AddedBuffDurationPerStack; public ConfigEntry MaxBuffStacks; public ConfigEntry PercentMaxHpForBuff; public static BuffDef regrowthMoveSpeed; public static Dictionary storedHealingValues = new Dictionary(); public override string ItemName => "Regrowth Striders"; public override string ItemLangTokenName => "REGROWTH_STRIDERS_ITEM"; public override string ItemPickupDesc => "Gain bursts of movement speed by healing."; public override string ItemFullDescription => $"Every {PercentMaxHpForBuff.Value * 100f}% of your maximum health that you heal increases movement speed by {MoveSpeedPerStack.Value * 100f}%, up to a {(float)MaxBuffStacks.Value * MoveSpeedPerStack.Value * 100f}% increase, fading at a rate of {MoveSpeedPerStack.Value * 100f}% movement speed every {BaseBuffDuration.Value} (+{AddedBuffDurationPerStack.Value} per stack) seconds."; public override string ItemLore => "Item based on the item of the same name from Smite 2."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)3 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("RegrowthStridersModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Regrowth Striders Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } private void CreateBuff() { regrowthMoveSpeed = ScriptableObject.CreateInstance(); regrowthMoveSpeed.canStack = true; regrowthMoveSpeed.isDebuff = false; ((Object)regrowthMoveSpeed).name = "regrowthMoveSpeed"; regrowthMoveSpeed.isCooldown = false; regrowthMoveSpeed.iconSprite = Main.MainAssets.LoadAsset("Regrowth Striders Icon.png"); ContentAddition.AddBuffDef(regrowthMoveSpeed); } public override void CreateConfig(ConfigFile config) { MoveSpeedPerStack = config.Bind("Item: " + ItemName, "Bonus Movement Speed per Buff Stack", 0.01f, "By what percentage is movement speed increased per buff stack?"); BaseBuffDuration = config.Bind("Item: " + ItemName, "Base Duration of Buff", 0.5f, "How long, in seconds, does each buff stack last when only having one stack of the item?"); AddedBuffDurationPerStack = config.Bind("Item: " + ItemName, "Added Duration of Buff Per Stack", 0.1f, "How much longer, in seconds, does each buff stack last per additional stack of the item?"); MaxBuffStacks = config.Bind("Item: " + ItemName, "Maximum Buff Stacks", 50, "What is the maximum number of buff stacks a character can have?"); PercentMaxHpForBuff = config.Bind("Item: " + ItemName, "Percent Max Health Healed for Buff", 0.01f, "What percentage of maximum health needs to be healed to get one buff stack?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(InitializeDict); HealthComponent.Heal += new hook_Heal(ApplyRegrowthBuff); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CalculateRegrowthSpeed); CharacterBody.OnDeathStart += new hook_OnDeathStart(CleanupOnDeath); } private void CalculateRegrowthSpeed(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int buffCount = sender.GetBuffCount(regrowthMoveSpeed); if (buffCount > 0) { args.moveSpeedMultAdd += MoveSpeedPerStack.Value * (float)buffCount; } } } private void CleanupOnDeath(orig_OnDeathStart orig, CharacterBody self) { orig.Invoke(self); storedHealingValues.Remove(self); } private void InitializeDict(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); if (!NetworkServer.active) { return; } if (GetCount(self) > 0) { if (!storedHealingValues.ContainsKey(self)) { storedHealingValues[self] = 0f; } } else { storedHealingValues.Remove(self); } } private float ApplyRegrowthBuff(orig_Heal orig, HealthComponent self, float amount, ProcChainMask procChainMask, bool nonRegen) { //IL_010c: Unknown result type (might be due to invalid IL or missing references) CharacterBody body = self.body; int count = GetCount(body); if (NetworkServer.active && count > 0 && nonRegen) { int buffCount = body.GetBuffCount(regrowthMoveSpeed); if (!storedHealingValues.ContainsKey(body)) { storedHealingValues[body] = 0f; } if (buffCount < MaxBuffStacks.Value) { IndependentStackTracker independentStackTracker = ((Component)body).GetComponent(); if ((Object)(object)independentStackTracker == (Object)null) { independentStackTracker = ((Component)body).gameObject.AddComponent(); independentStackTracker.trackedBuff = regrowthMoveSpeed; } float num = body.maxHealth * PercentMaxHpForBuff.Value; float duration = BaseBuffDuration.Value + AddedBuffDurationPerStack.Value * (float)(count - 1); storedHealingValues[body] += amount; while (storedHealingValues[body] >= num) { independentStackTracker.AddStack(duration); storedHealingValues[body] -= num; } } } return orig.Invoke(self, amount, procChainMask, nonRegen); } } public class SpiritRobe : ItemBase { public ConfigEntry BuffArmor; public ConfigEntry ExtraArmorPerStack; public ConfigEntry PercentMaxHpPerSecond; public ConfigEntry BonusPercentMaxHpPerStack; public ConfigEntry BuffDuration; public static BuffDef spiritRobeBuff; public override string ItemName => "Spirit Robe"; public override string ItemLangTokenName => "SPIRIT_ROBE_ITEM"; public override string ItemPickupDesc => "Gain armor and healing when debuffed"; public override string ItemFullDescription => $"Upon being inflicted with a debuff, increase armor by {BuffArmor.Value} (+{ExtraArmorPerStack.Value} per stack) for {BuffDuration.Value}s and heal for {PercentMaxHpPerSecond.Value * 100f}% (+{BonusPercentMaxHpPerStack.Value * 100f}% per stack) of your health every second while the buff is active."; public override string ItemLore => "Item taken from Smite 2."; public override ItemTier Tier => (ItemTier)1; public override GameObject ItemModel => Main.MainAssets.LoadAsset("SpiritRobeModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Spirit Robe Icon.png"); public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[2] { (ItemTag)3, (ItemTag)2 }; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateBuff(); CreateItem(); Hooks(); } private void CreateBuff() { spiritRobeBuff = ScriptableObject.CreateInstance(); spiritRobeBuff.canStack = false; spiritRobeBuff.isDebuff = false; ((Object)spiritRobeBuff).name = "spiritRobeBuff"; spiritRobeBuff.isCooldown = false; spiritRobeBuff.iconSprite = Main.MainAssets.LoadAsset("Spirit Robe Icon.png"); ContentAddition.AddBuffDef(spiritRobeBuff); } public override void CreateConfig(ConfigFile config) { BuffArmor = config.Bind("Item: " + ItemName, "Armor from buff", 40, "How much armor does the Spirit Robe buff provide?"); ExtraArmorPerStack = config.Bind("Item: " + ItemName, "Additional armor from buff per stack", 40, "How much armor does the Spirit Robe buff provide per additional stack of the item?"); PercentMaxHpPerSecond = config.Bind("Item: " + ItemName, "Percent max hp healed per second from buff", 0.01f, "What percentage of maximum health is restored per second while the Spirit Robe buff is active?"); BonusPercentMaxHpPerStack = config.Bind("Item: " + ItemName, "Percent max hp healed per second from buff per additional stack", 0.01f, "What additional percentage of maximum health is restored per second while the Spirit Robe buff is active per item stack?"); BuffDuration = config.Bind("Item: " + ItemName, "Spirit Robe buff duration", 6, "How many seconds does the Spirit Robe buff last?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown CharacterBody.AddTimedBuff_BuffDef_float += new hook_AddTimedBuff_BuffDef_float(CheckDebuff); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CalculateSpiritRobeBuff); CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged); } private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); self.AddItemBehavior(GetCount(self)); } private void CheckDebuff(orig_AddTimedBuff_BuffDef_float orig, CharacterBody self, BuffDef buffDef, float duration) { orig.Invoke(self, buffDef, duration); if (buffDef.isDebuff && GetCount(self) > 0) { if (self.HasBuff(spiritRobeBuff)) { ItemHelpers.RefreshTimedBuffs(self, spiritRobeBuff, BuffDuration.Value); } else { self.AddTimedBuff(spiritRobeBuff, (float)BuffDuration.Value); } } } private void CalculateSpiritRobeBuff(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int count = GetCount(sender); if (count > 0 && sender.HasBuff(spiritRobeBuff)) { args.armorAdd += (float)(BuffArmor.Value + (count - 1) * ExtraArmorPerStack.Value); } } } } public class SpiritRobeHealingBehavior : ItemBehavior { private const float healPeriodSeconds = 0.5f; private float healTimer; private void OnEnable() { healTimer = 0f; } private void FixedUpdate() { //IL_0078: 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) if (Object.op_Implicit((Object)(object)base.body) && NetworkServer.active && base.body.HasBuff(SpiritRobe.spiritRobeBuff)) { healTimer += Time.deltaTime; while (healTimer > 0.5f) { ((Component)base.body).GetComponent().HealFraction((ItemBase.instance.PercentMaxHpPerSecond.Value + (float)(base.stack - 1) * ItemBase.instance.BonusPercentMaxHpPerStack.Value) * 0.5f, default(ProcChainMask)); healTimer -= 0.5f; } } } } public class StoneOfBinding : ItemBase { public ConfigEntry ArmorReduction; public ConfigEntry ArmorReductionDuration; public ConfigEntry ArmorReductionDurationPerStack; public ConfigEntry MaxDebuffStacks; public static BuffDef bindingArmorReduction; public override string ItemName => "Stone of Binding"; public override string ItemLangTokenName => "STONE_OF_BINDING_ITEM"; public override string ItemPickupDesc => "Applying debuffs reduces enemy armor."; public override string ItemFullDescription => $"After applying a new debuff to an enemy, reduce their armor by {ArmorReduction.Value} for {ArmorReductionDuration.Value} (+{ArmorReductionDurationPerStack.Value} per stack) seconds, up to a maximum of {MaxDebuffStacks.Value} times."; public override string ItemLore => "Item taken from Smite 2"; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("StoneOfBindingModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Stone of Binding Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); } private void CreateBuff() { bindingArmorReduction = ScriptableObject.CreateInstance(); bindingArmorReduction.canStack = true; bindingArmorReduction.isDebuff = true; ((Object)bindingArmorReduction).name = "bindingArmorReduction"; bindingArmorReduction.isCooldown = false; bindingArmorReduction.iconSprite = Main.MainAssets.LoadAsset("Stone of Binding Icon.png"); ContentAddition.AddBuffDef(bindingArmorReduction); } public override void CreateConfig(ConfigFile config) { ArmorReduction = config.Bind("Item: " + ItemName, "Armor Reduction", 10f, "How much armor is reduced by per debuff stack?"); ArmorReductionDuration = config.Bind("Item: " + ItemName, "Armor Reduction Duration", 4f, "How long does the armor reduction debuff last?"); ArmorReductionDurationPerStack = config.Bind("Item: " + ItemName, "Armor Reduction Duration per Stack", 4f, "How much longer does each stack of the item make the debuff?"); MaxDebuffStacks = config.Bind("Item: " + ItemName, "Max Armor Reduction Stacks", 4, "What is the maximum amount of instances of the armor reduction debuff?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(ApplyBinding); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(CalculateBindingDebuff); } private void CalculateBindingDebuff(CharacterBody sender, StatHookEventArgs args) { if (Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.inventory)) { int buffCount = sender.GetBuffCount(bindingArmorReduction); if (buffCount > 0) { args.armorAdd -= ArmorReduction.Value * (float)buffCount; } } } private void ApplyBinding(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00c4: 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_00e1: Invalid comparison between Unknown and I4 //IL_00ca: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (!Object.op_Implicit((Object)(object)component.inventory)) { return; } int count = GetCount(component); if (count <= 0) { return; } int num = 0; int buffCount = self.body.GetBuffCount(bindingArmorReduction); BuffIndex[] debuffBuffIndices = BuffCatalog.debuffBuffIndices; foreach (BuffIndex val in debuffBuffIndices) { if (self.body.HasBuff(val) && val != bindingArmorReduction.buffIndex) { num++; } } DotController val2 = DotController.FindDotController(((Component)self).gameObject); if (Object.op_Implicit((Object)(object)val2)) { for (DotIndex val3 = (DotIndex)0; (int)val3 < 12; val3 = (DotIndex)(val3 + 1)) { if (val2.HasDotActive(val3)) { num++; } } } if (num <= 0 || num <= buffCount) { return; } for (int j = 0; j < num - buffCount; j++) { if (self.body.GetBuffCount(bindingArmorReduction) < MaxDebuffStacks.Value) { self.body.AddTimedBuff(bindingArmorReduction, ArmorReductionDuration.Value + ArmorReductionDurationPerStack.Value * (float)(count - 1)); } } } } public class Stormseeker : ItemBase { public ConfigEntry AttackSpeedPerStack; public ConfigEntry MaxStacksPerStack; public override string ItemName => "Stormseeker"; public override string ItemLangTokenName => "STORMSEEKER_ITEM"; public override string ItemPickupDesc => "Gain permanent increased attack speed by hitting enemies"; public override string ItemFullDescription => $"Dealing damage increases your attack speed permanently by {AttackSpeedPerStack.Value * 100f}% (+{AttackSpeedPerStack.Value * 100f}% per stack), up to a maximum increase of {(float)MaxStacksPerStack.Value * AttackSpeedPerStack.Value * 100f}% (+{(float)MaxStacksPerStack.Value * AttackSpeedPerStack.Value * 100f}% per stack)."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)1; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("StormseekerModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Stormseeker Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); Hooks(); } public override void CreateConfig(ConfigFile config) { AttackSpeedPerStack = config.Bind("Item: " + ItemName, "Attack speed per stack", 0.0005f, "How much permanent additional attack speed is given per stacks from hits?"); MaxStacksPerStack = config.Bind("Item: " + ItemName, "Max attack speed stacks", 1000, "How many stacks of bonus attack speed can each stack of the item provide?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(ApplyStormBuff); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStats); } private void ApplyStormBuff(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { orig.Invoke(self, damageInfo, victim); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)damageInfo.attacker) || !(damageInfo.procCoefficient > 0f)) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } int count = GetCount(component); if (count <= 0) { return; } CharacterMaster master = component.master; if (!Object.op_Implicit((Object)(object)master)) { return; } StormseekerTracker stormseekerTracker = ((Component)master).GetComponent(); if (!Object.op_Implicit((Object)(object)stormseekerTracker)) { stormseekerTracker = ((Component)master).gameObject.AddComponent(); } if (stormseekerTracker.attackSpeedStacks < count * MaxStacksPerStack.Value) { stormseekerTracker.attackSpeedStacks += count; if (stormseekerTracker.attackSpeedStacks > count * MaxStacksPerStack.Value) { stormseekerTracker.attackSpeedStacks = count * MaxStacksPerStack.Value; } component.statsDirty = true; } } private void RecalculateStats(CharacterBody sender, StatHookEventArgs args) { if (!Object.op_Implicit((Object)(object)sender)) { return; } int count = GetCount(sender); if (count <= 0 || !((Object)(object)sender.healthComponent != (Object)null)) { return; } CharacterMaster master = sender.master; StormseekerTracker stormseekerTracker = ((master != null) ? ((Component)master).GetComponent() : null); if (Object.op_Implicit((Object)(object)stormseekerTracker)) { int num = count * MaxStacksPerStack.Value; if (stormseekerTracker.attackSpeedStacks > num) { stormseekerTracker.attackSpeedStacks = num; } args.baseAttackSpeedAdd += (float)stormseekerTracker.attackSpeedStacks * AttackSpeedPerStack.Value; } } } public class StormseekerTracker : MonoBehaviour { public int attackSpeedStacks; } public class CannoneersCuirass : ItemBase { public ConfigEntry ItemCooldown; public ConfigEntry ExplosionRadius; public ConfigEntry BonusExplosionRadiusPerStack; public ConfigEntry PercentHealthExplosionDamage; public ConfigEntry BonusPercentHealthExplosionDamagePerStack; public ConfigEntry BaseGoldOnProc; public ConfigEntry BonusGoldPerStack; public static BuffDef cannoneerCooldown; public static BuffDef cannoneerReady; public static GameObject cachedExplosionEffect; public override string ItemName => "Cannoneers Cuirass"; public override string ItemLangTokenName => "CANNONEERS_CUIRASS_ITEM"; public override string ItemPickupDesc => "Explode non-boss enemies for bonus gold. Recharges over time."; public override string ItemFullDescription => $"Your next attack will instantly kill a non-Boss enemy and create an explosion in a {ExplosionRadius.Value}m (+{BonusExplosionRadiusPerStack.Value}m per stack) radius for {PercentHealthExplosionDamage.Value * 100f}% (+{BonusPercentHealthExplosionDamagePerStack.Value * 100f}% per stack) of that enemy's health." + $" Additionally, you gain {BaseGoldOnProc.Value} (+{BonusGoldPerStack.Value} per stack) gold that scales over time. Recharges every {ItemCooldown.Value} seconds."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[5]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => Main.MainAssets.LoadAsset("CannoneersCuirassModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Cannoneers Cuirass Icon.png"); public override void Init(ConfigFile config) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) CreateConfig(config); CreateLang(); CreateItem(); CreateBuff(); Hooks(); cachedExplosionEffect = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/VFX/ExplosionVFX.prefab").WaitForCompletion(); } public override void CreateConfig(ConfigFile config) { ItemCooldown = config.Bind("Item: " + ItemName, "Time between each activation of the item", 7f, "How many seconds does the item need before it can activate again?"); ExplosionRadius = config.Bind("Item: " + ItemName, "Radius of the item explosion in meters", 10f, "What is the radius of the explosion triggered by the item effect?"); BonusExplosionRadiusPerStack = config.Bind("Item: " + ItemName, "Additional radius of the item explosion in meters per additional stack", 2f, "How much does each additional stack of the item increase the explosion radius by?"); PercentHealthExplosionDamage = config.Bind("Item: " + ItemName, "Percent maximum health explosion damage", 0.1f, "What percentage of the targets maximum health does the explosion deal?"); BonusPercentHealthExplosionDamagePerStack = config.Bind("Item: " + ItemName, "Additional percent maximum health explosion damage per additional stack", 0.05f, "How much does each additional stack of the item increase the percentage of maximum health the explosion deals?"); BaseGoldOnProc = config.Bind("Item: " + ItemName, "Base gold on item proc", 8, "What is the base gold an activation of the item grants?"); BonusGoldPerStack = config.Bind("Item: " + ItemName, "Additional base gold on item proc per additional item stack", 8, "How much does each additional stack of the item increase the base gold of an item activation?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(CharacterBody_OnInventoryChanged); HealthComponent.TakeDamage += new hook_TakeDamage(ProcExplosion); CharacterBody.FixedUpdate += new hook_FixedUpdate(CheckCooldown); } private void CheckCooldown(orig_FixedUpdate orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && Object.op_Implicit((Object)(object)self.inventory) && GetCount(self) > 0 && !self.HasBuff(cannoneerReady) && !self.HasBuff(cannoneerCooldown)) { self.AddBuff(cannoneerReady); } } private void ProcExplosion(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0206: 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_0233: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Expected O, but got Unknown //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent()) && NetworkServer.active) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0 && component.HasBuff(cannoneerReady) && Object.op_Implicit((Object)(object)self.body) && !self.body.isBoss) { component.RemoveBuff(cannoneerReady); for (int i = 1; (float)i <= ItemCooldown.Value; i++) { component.AddTimedBuff(cannoneerCooldown, (float)i); } DamageReport val = new DamageReport(damageInfo, self, damageInfo.damage, self.combinedHealth); float num = Mathf.Max(self.combinedHealth, 0f); if (self.health > 0f) { self.Networkhealth = 0f; } if (self.shield > 0f) { self.Networkshield = 0f; } if (self.barrier > 0f) { self.Networkbarrier = 0f; } GlobalEventManager.ServerCharacterExecuted(val, num); if (cachedExplosionEffect != null) { EffectManager.SpawnEffect(cachedExplosionEffect, new EffectData { origin = self.body.corePosition, scale = ExplosionRadius.Value + (float)(count - 1) * BonusExplosionRadiusPerStack.Value }, true); } new BlastAttack { attacker = ((Component)component).gameObject, baseDamage = self.body.maxHealth * (PercentHealthExplosionDamage.Value + (float)(count - 1) * BonusPercentHealthExplosionDamagePerStack.Value), baseForce = 0f, bonusForce = Vector3.zero, crit = component.RollCrit(), damageColorIndex = (DamageColorIndex)3, falloffModel = (FalloffModel)0, position = self.body.corePosition, procChainMask = default(ProcChainMask), procCoefficient = 0f, radius = ExplosionRadius.Value + (float)(count - 1) * BonusExplosionRadiusPerStack.Value, teamIndex = component.teamComponent.teamIndex, inflictor = ((Component)component).gameObject }.Fire(); GoldOrb val2 = new GoldOrb(); ((Orb)val2).origin = damageInfo.position; ((Orb)val2).target = component.mainHurtBox; val2.goldAmount = (uint)((float)(BaseGoldOnProc.Value + (count - 1) * BonusGoldPerStack.Value) * Run.instance.difficultyCoefficient); OrbManager.instance.AddOrb((Orb)(object)val2); } } } orig.Invoke(self, damageInfo); } private void CharacterBody_OnInventoryChanged(orig_OnInventoryChanged orig, CharacterBody self) { orig.Invoke(self); int count = GetCount(self); if (count >= 1 && !self.HasBuff(cannoneerReady) && !self.HasBuff(cannoneerCooldown)) { self.AddBuff(cannoneerReady); } else if (count < 1) { self.RemoveBuff(cannoneerReady); while (self.HasBuff(cannoneerCooldown)) { self.RemoveBuff(cannoneerCooldown); } } } protected override void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", "Cannoneer's Cuirass"); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public void CreateBuff() { cannoneerCooldown = ScriptableObject.CreateInstance(); cannoneerCooldown.canStack = true; cannoneerCooldown.isDebuff = false; ((Object)cannoneerCooldown).name = "cannoneerCooldown"; cannoneerCooldown.isCooldown = true; cannoneerCooldown.iconSprite = Main.MainAssets.LoadAsset("Cannoneers Cuirass Icon.png"); ContentAddition.AddBuffDef(cannoneerCooldown); cannoneerReady = ScriptableObject.CreateInstance(); cannoneerReady.canStack = false; cannoneerReady.isDebuff = false; ((Object)cannoneerReady).name = "cannoneerReady"; cannoneerReady.isCooldown = false; cannoneerReady.iconSprite = Main.MainAssets.LoadAsset("Cannoneers Cuirass Icon.png"); ContentAddition.AddBuffDef(cannoneerReady); } } public class Curseweaver : ItemBase { public class CurseTracker : MonoBehaviour { public CharacterBody inflictorBody; public GameObject inflictorGameObject; public float duration; private float timer; private CharacterBody victimBody; private HealthComponent victimHealth; private void Start() { victimBody = ((Component)this).GetComponent(); victimHealth = ((Component)this).GetComponent(); } private void FixedUpdate() { timer += Time.fixedDeltaTime; if (!victimBody.HasBuff(curse)) { Object.Destroy((Object)(object)this); } } public void DealTrackedDamage(DamageInfo info) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)inflictorBody == (Object)null) && !((Object)(object)victimBody == (Object)null)) { info.inflictor = inflictorGameObject; info.position = victimBody.corePosition; victimBody.healthComponent.TakeDamage(info); OnDebuffDamageDealt(info); } } private void OnDebuffDamageDealt(DamageInfo damageInfo) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)inflictorBody != (Object)null && (Object)(object)inflictorBody.healthComponent != (Object)null) { inflictorBody.healthComponent.Heal(damageInfo.damage * ItemBase.instance.PercentDamageHealed.Value, default(ProcChainMask), true); } } } public ConfigEntry DebuffDuration; public ConfigEntry BonusDebuffDurationPerStack; public ConfigEntry PercentMaxHPDamage; public ConfigEntry PercentDamageHealed; public static BuffDef curse; public override string ItemName => "Curseweaver"; public override string ItemLangTokenName => "CURSEWEAVER_ITEM"; public override string ItemPickupDesc => "Apply debuffs to enemies that cause damage on attacking."; public override string ItemFullDescription => $"Curse enemies on hit for {DebuffDuration.Value} (+{BonusDebuffDurationPerStack.Value} per stack) seconds. When a cursed enemy activates a skill, they take {PercentMaxHPDamage.Value * 100f}% of their max health as damage and you are healed for {PercentDamageHealed.Value * 100f}% of the damage dealt."; public override string ItemLore => "Item taken from Smite 1."; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags { get { ItemTag[] array = new ItemTag[3]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); return (ItemTag[])(object)array; } } public override GameObject ItemModel => Main.MainAssets.LoadAsset("CurseweaverModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Curseweaver Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateBuff(); CreateItem(); Hooks(); } private void CreateBuff() { curse = ScriptableObject.CreateInstance(); curse.canStack = false; curse.isDebuff = true; ((Object)curse).name = "curse"; curse.isCooldown = false; curse.iconSprite = Main.MainAssets.LoadAsset("Curseweaver Icon.png"); ContentAddition.AddBuffDef(curse); } public override void CreateConfig(ConfigFile config) { DebuffDuration = config.Bind("Item: " + ItemName, "Duration of debuff in seconds", 4, "How long does the Curseweaver debuff last?"); BonusDebuffDurationPerStack = config.Bind("Item: " + ItemName, "Added duration of debuff per item stack", 4, "How much longer does the Curseweaver debuff last per additional item stack?"); PercentMaxHPDamage = config.Bind("Item: " + ItemName, "Percent max hp damage", 0.05f, "What percentage of max health is dealt to the target when a skill is used with the debuff active?"); PercentDamageHealed = config.Bind("Item: " + ItemName, "Percent damage healed", 0.01f, "What percentage of damage dealt by the Curseweaver debuff is healed to the debuff applier?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(ApplyCurse); CharacterBody.OnSkillActivated += new hook_OnSkillActivated(ApplyCurseDamage); } private void ApplyCurseDamage(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, skill); if (self.HasBuff(curse)) { CurseTracker component = ((Component)self).GetComponent(); DamageInfo val = new DamageInfo(); val.damage = PercentMaxHPDamage.Value * self.maxHealth; val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.crit = false; if ((Object)(object)component != (Object)null) { component.DealTrackedDamage(val); } } } private void ApplyCurse(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); if (!Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (!Object.op_Implicit((Object)(object)component.inventory)) { return; } int count = GetCount(component); if (count > 0 && !self.body.HasBuff(curse)) { self.body.AddTimedBuff(curse, (float)(DebuffDuration.Value + (count - 1) * BonusDebuffDurationPerStack.Value)); CurseTracker curseTracker = ((Component)self.body).GetComponent(); if ((Object)(object)curseTracker == (Object)null) { curseTracker = ((Component)self.body).gameObject.AddComponent(); } curseTracker.inflictorBody = damageInfo.inflictor.GetComponent(); curseTracker.inflictorGameObject = damageInfo.inflictor; curseTracker.duration = DebuffDuration.Value + (count - 1) * BonusDebuffDurationPerStack.Value; } } } public class QinsBlade : ItemBase { public ConfigEntry PercentHPBonusDamage; public ConfigEntry PercentHPBonusDamagePerStack; public override string ItemName => "Qins Blade"; public override string ItemLangTokenName => "QINS_BLADE_ITEM"; public override string ItemPickupDesc => "Deal bonus damage based on enemy maximum health."; public override string ItemFullDescription => $"All attacks deal bonus damage equal to {PercentHPBonusDamage.Value * 100f}% (+{PercentHPBonusDamagePerStack.Value * 100f}% per stack) of the enemy's Max Health."; public override string ItemLore => "Item taken from Smite 2, based on a previous version of the item."; public override ItemTier Tier => (ItemTier)2; public override ItemTag[] ItemTags => (ItemTag[])(object)new ItemTag[1] { (ItemTag)1 }; public override GameObject ItemModel => Main.MainAssets.LoadAsset("QinsBladeModel.prefab"); public override Sprite ItemIcon => Main.MainAssets.LoadAsset("Qins Blade Icon.png"); public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateItem(); Hooks(); } public override void CreateConfig(ConfigFile config) { PercentHPBonusDamage = config.Bind("Item: " + ItemName, "Percent Max Health Bonus Damage", 0.01f, "What percentage of the targets maximum health is taken as bonus damage?"); PercentHPBonusDamagePerStack = config.Bind("Item: " + ItemName, "Percent Max Health Bonus Damage Added Per Additional Stack", 0.01f, "How much does each additional stack of the item increase the maximum health bonus damage by?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = ItemModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(ItemModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(ItemModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } protected override void CreateLang() { LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_NAME", "Qin's Blade"); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_PICKUP", ItemPickupDesc); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_DESCRIPTION", ItemFullDescription); LanguageAPI.Add("ITEM_" + ItemLangTokenName + "_LORE", ItemLore); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(QinsBonusDamage); } private void QinsBonusDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component.inventory)) { int count = GetCount(component); if (count > 0 && damageInfo.procCoefficient != 0f && Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent()) && NetworkServer.active && Object.op_Implicit((Object)(object)self.body)) { DamageInfo val = new DamageInfo(); val.damage = (PercentHPBonusDamage.Value + (float)(count - 1) * PercentHPBonusDamagePerStack.Value) * self.body.maxHealth * damageInfo.procCoefficient; val.damageColorIndex = (DamageColorIndex)3; val.procCoefficient = 0f; val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.crit = false; val.inflictor = damageInfo.inflictor; val.attacker = damageInfo.attacker; val.position = damageInfo.position; self.TakeDamage(val); } } } orig.Invoke(self, damageInfo); } } } namespace Smite_Items.Equipment { public class AegisAmulet : EquipmentBase { public ConfigEntry InvulnDuration; public override string EquipmentName => "Aegis Amulet"; public override string EquipmentLangTokenName => "AEGIS_AMULET_EQUIPMENT"; public override string EquipmentPickupDesc => "Grants temporary invulernability"; public override string EquipmentFullDescription => $"Become invulnerable for {InvulnDuration.Value} seconds."; public override string EquipmentLore => "Item taken from Smite 2"; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset("AegisAmuletModel.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset("Aegis Amulet Icon.png"); public override float Cooldown => 40f; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateEquipment(); Hooks(); } protected override void CreateConfig(ConfigFile config) { InvulnDuration = config.Bind("Equipment: " + EquipmentName, "Number of seconds of invulnerability from the equipment", 1.5f, "How many seconds does the equipment effect last?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = EquipmentModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(EquipmentModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(EquipmentModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } protected override bool ActivateEquipment(EquipmentSlot slot) { slot.characterBody.AddTimedBuff(Buffs.Immune, InvulnDuration.Value); return true; } } public class BlinkingAbyss : EquipmentBase { [CompilerGenerated] private sealed class d__29 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BlinkingAbyss <>4__this; public CharacterBody body; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__29(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; BlinkingAbyss blinkingAbyss = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(blinkingAbyss.AOEDelay.Value); <>1__state = 1; return true; case 1: <>1__state = -1; if (Object.op_Implicit((Object)(object)body) && NetworkServer.active) { EffectManager.SpawnEffect(cachedExplosionEffect, new EffectData { origin = body.corePosition, scale = blinkingAbyss.DamageRadius.Value, rotation = body.transform.rotation }, true); int hitCount = new BlastAttack { attacker = ((Component)body).gameObject, baseDamage = body.baseDamage * blinkingAbyss.Damage.Value, baseForce = 0f, bonusForce = Vector3.zero, crit = body.RollCrit(), damageColorIndex = (DamageColorIndex)3, falloffModel = (FalloffModel)0, position = body.corePosition, procChainMask = default(ProcChainMask), procCoefficient = 1f, radius = blinkingAbyss.DamageRadius.Value, teamIndex = TeamComponent.GetObjectTeam(((Component)body).gameObject), inflictor = ((Component)body).gameObject }.Fire().hitCount; float num2 = 1f; for (int i = 0; i < hitCount; i++) { num2 *= 1f - blinkingAbyss.CooldownRefund.Value; body.inventory.DeductActiveEquipmentCooldown(blinkingAbyss.Cooldown * num2); } } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public ConfigEntry MaxBlinkDistance; public ConfigEntry DamageRadius; public ConfigEntry AOEDelay; public ConfigEntry CooldownRefund; public ConfigEntry Damage; private static GameObject cachedExplosionEffect; private NetworkSoundEventDef blinkSoundEvent; public override string EquipmentName => "Blinking Abyss"; public override string EquipmentLangTokenName => "BLINKING_ABYSS_EQUIP"; public override string EquipmentPickupDesc => "Teleport forward and damage enemies after a short delay."; public override string EquipmentFullDescription => $"Blink up to {MaxBlinkDistance.Value}m forward. After {AOEDelay.Value} second, damage enemies within a {DamageRadius.Value}m radius for {Damage.Value * 100f}% base damage. Each enemy damaged this way reduces your next equipment cooldown by {CooldownRefund.Value * 100f}% (multiplicatively)."; public override string EquipmentLore => "Equipment taken from Smite 2."; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset("BlinkingAbyssModel.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset("Blinking Abyss Icon.png"); public override float Cooldown => 140f; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateEffects(); CreateSound(); CreateEquipment(); Hooks(); } private void CreateSound() { blinkSoundEvent = ScriptableObject.CreateInstance(); blinkSoundEvent.eventName = "Blink_sfx"; ContentAddition.AddNetworkSoundEventDef(blinkSoundEvent); } private void CreateEffects() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) cachedExplosionEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync((object)"RoR2/Base/moon2/MoonBatteryDesignPulse.prefab").WaitForCompletion(), "BlinkingAbyssExplosion"); if (!Object.op_Implicit((Object)(object)cachedExplosionEffect.GetComponent())) { cachedExplosionEffect.AddComponent(); } ContentAddition.AddEffect(cachedExplosionEffect); } protected override void CreateConfig(ConfigFile config) { MaxBlinkDistance = config.Bind("Equipment: " + EquipmentName, "Maximum distance of blink", 50f, "What is the maximum distance of the blink effect?"); DamageRadius = config.Bind("Equipment: " + EquipmentName, "Damage radius", 25f, "What is the radius of the post-blink damage effect?"); AOEDelay = config.Bind("Equipment: " + EquipmentName, "Damage delay", 1f, "How long, in seconds, does it take for the post-blink damage effect to activate after blinking?"); CooldownRefund = config.Bind("Equipment: " + EquipmentName, "Cooldown refund per enemy", 0.5f, "What percentage of the equipment cooldown is removed per enemy hit by the post-blink damage effect?"); Damage = config.Bind("Equipment: " + EquipmentName, "Damage", 3f, "What percentage of base damage is dealt by the post-blink damage effect?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = EquipmentModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(EquipmentModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(EquipmentModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = slot.GetAimRay(); RaycastHit val = default(RaycastHit); if (Physics.Raycast(aimRay, ref val, MaxBlinkDistance.Value, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { TeleportHelper.TeleportBody(slot.characterBody, ((RaycastHit)(ref val)).point + ((RaycastHit)(ref val)).normal, false); } else { Vector3 point = ((Ray)(ref aimRay)).GetPoint(MaxBlinkDistance.Value); TeleportHelper.TeleportBody(slot.characterBody, point, false); } if (NetworkServer.active) { EffectManager.SimpleSoundEffect(blinkSoundEvent.index, slot.characterBody.transform.position, true); } ((MonoBehaviour)slot).StartCoroutine(DelayedExplosion(slot.characterBody)); return true; } [IteratorStateMachine(typeof(d__29))] private IEnumerator DelayedExplosion(CharacterBody body) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__29(0) { <>4__this = this, body = body }; } } public class DaggerOfFrenzy : EquipmentBase { public ConfigEntry BonusAttackSpeed; public ConfigEntry NumAttacks; public ConfigEntry SecondsReducedPerKill; public static BuffDef daggerBuff; public override string EquipmentName => "Dagger of Frenzy"; public override string EquipmentLangTokenName => "DAGGER_FRENZY_EQUIPMENT"; public override string EquipmentPickupDesc => $"Your next {NumAttacks.Value} Primary skill uses are buffed. Kills reduce cooldown."; public override string EquipmentFullDescription => $"Your next {NumAttacks.Value} uses of your Primary skill have their attack speed increased by {BonusAttackSpeed.Value * 100f}%. Kills reduce your equipment cooldown by {SecondsReducedPerKill.Value}s."; public override string EquipmentLore => "Item taken from Smite 2."; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset("DaggerOfFrenzyModel.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset("Dagger of Frenzy Icon.png"); public override float Cooldown => 30f; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateBuff(); CreateEquipment(); Hooks(); } protected override void CreateConfig(ConfigFile config) { BonusAttackSpeed = config.Bind("Equipment: " + EquipmentName, "Percentage increase in primary skill attack speed", 0.5f, "How much bonus attack speed is the primary skill given from the buff?"); NumAttacks = config.Bind("Equipment: " + EquipmentName, "Number of buffed attacks", 6, "How many primary skill activations does the buff apply to?"); SecondsReducedPerKill = config.Bind("Equipment: " + EquipmentName, "Seconds reduced off cooldown per kill", 2, "How much is the equipment cooldown reduced by on kill?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = EquipmentModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(EquipmentModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(EquipmentModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown GenericSkill.OnExecute += new hook_OnExecute(ApplyDaggerAttackSpeedBuff); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(ApplyDaggerCooldownReduction); } private void ApplyDaggerCooldownReduction(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageReport); if (Object.op_Implicit((Object)(object)damageReport.attacker) && Object.op_Implicit((Object)(object)damageReport.attackerBody) && Object.op_Implicit((Object)(object)damageReport.victim) && Object.op_Implicit((Object)(object)damageReport.victimBody)) { CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody.equipmentSlot) && attackerBody.equipmentSlot.equipmentIndex == EquipmentDef.equipmentIndex) { attackerBody.inventory.DeductActiveEquipmentCooldown((float)SecondsReducedPerKill.Value); } } } private void ApplyDaggerAttackSpeedBuff(orig_OnExecute orig, GenericSkill self) { if ((Object)(object)self != (Object)null && (Object)(object)self.characterBody != (Object)null && (Object)(object)self.characterBody.skillLocator.primary.skillDef == (Object)(object)self.skillDef && self.characterBody.HasBuff(daggerBuff)) { CharacterBody characterBody = self.characterBody; characterBody.attackSpeed *= 1f + BonusAttackSpeed.Value; if (NetworkServer.active) { self.characterBody.RemoveBuff(daggerBuff); } } orig.Invoke(self); } public void CreateBuff() { daggerBuff = ScriptableObject.CreateInstance(); daggerBuff.canStack = true; daggerBuff.isDebuff = false; ((Object)daggerBuff).name = "daggerBuff"; daggerBuff.isCooldown = false; daggerBuff.iconSprite = Main.MainAssets.LoadAsset("Dagger of Frenzy Icon.png"); ContentAddition.AddBuffDef(daggerBuff); } protected override bool ActivateEquipment(EquipmentSlot slot) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) slot.characterBody.SetBuffCount(daggerBuff.buffIndex, NumAttacks.Value); return true; } } public abstract class EquipmentBase : EquipmentBase where T : EquipmentBase { public static T instance { get; private set; } public EquipmentBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EquipmentBoilerplate/Equipment was instantiated twice"); } instance = this as T; } } public abstract class EquipmentBase { public enum TargetingType { Enemies, Friendlies } public class TargetingControllerComponent : MonoBehaviour { public GameObject TargetObject; public GameObject VisualizerPrefab; public Indicator Indicator; public BullseyeSearch TargetFinder; public Action AdditionalBullseyeFunctionality = delegate { }; public void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Indicator = new Indicator(((Component)this).gameObject, (GameObject)null); } public void OnDestroy() { Invalidate(); } public void Invalidate() { TargetObject = null; Indicator.targetTransform = null; } public void ConfigureTargetFinderBase(EquipmentSlot self) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown if (TargetFinder == null) { TargetFinder = new BullseyeSearch(); } TargetFinder.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.sortMode = (SortMode)2; TargetFinder.filterByLoS = true; float num = default(float); Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num); TargetFinder.searchOrigin = ((Ray)(ref val)).origin; TargetFinder.searchDirection = ((Ray)(ref val)).direction; TargetFinder.maxAngleFilter = 10f; TargetFinder.viewer = self.characterBody; } public void ConfigureTargetFinderForEnemies(EquipmentSlot self) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void ConfigureTargetFinderForFriendlies(EquipmentSlot self) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.none; ((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void PlaceTargetingIndicator(IEnumerable TargetFinderResults) { HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null); if (Object.op_Implicit((Object)(object)val)) { TargetObject = ((Component)val.healthComponent).gameObject; Indicator.visualizerPrefab = VisualizerPrefab; Indicator.targetTransform = ((Component)val).transform; } else { Invalidate(); } Indicator.active = Object.op_Implicit((Object)(object)val); } } public EquipmentDef EquipmentDef; public GameObject TargetingIndicatorPrefabBase; public abstract string EquipmentName { get; } public abstract string EquipmentLangTokenName { get; } public abstract string EquipmentPickupDesc { get; } public abstract string EquipmentFullDescription { get; } public abstract string EquipmentLore { get; } public abstract GameObject EquipmentModel { get; } public abstract Sprite EquipmentIcon { get; } public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public virtual bool CanDrop { get; } = true; public virtual float Cooldown { get; } = 60f; public virtual bool EnigmaCompatible { get; } = true; public virtual bool IsBoss { get; } public virtual bool IsLunar { get; } public virtual bool UseTargeting { get; } public virtual TargetingType TargetingTypeEnum { get; } public abstract ItemDisplayRuleDict CreateItemDisplayRules(); public abstract void Init(ConfigFile config); protected virtual void CreateConfig(ConfigFile config) { } protected virtual void CreateLang() { LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_NAME", EquipmentName); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP", EquipmentPickupDesc); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION", EquipmentFullDescription); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_LORE", EquipmentLore); } protected void CreateEquipment() { //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Expected O, but got Unknown EquipmentDef = ScriptableObject.CreateInstance(); ((Object)EquipmentDef).name = "EQUIPMENT_" + EquipmentLangTokenName; EquipmentDef.nameToken = "EQUIPMENT_" + EquipmentLangTokenName + "_NAME"; EquipmentDef.pickupToken = "EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP"; EquipmentDef.descriptionToken = "EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION"; EquipmentDef.loreToken = "EQUIPMENT_" + EquipmentLangTokenName + "_LORE"; EquipmentDef.pickupModelPrefab = EquipmentModel; EquipmentDef.pickupIconSprite = EquipmentIcon; EquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer; EquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer; EquipmentDef.canDrop = CanDrop; EquipmentDef.cooldown = Cooldown; EquipmentDef.enigmaCompatible = EnigmaCompatible; EquipmentDef.isBoss = IsBoss; EquipmentDef.isLunar = IsLunar; ItemAPI.Add(new CustomEquipment(EquipmentDef, CreateItemDisplayRules())); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); } private bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)EquipmentDef) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); } protected abstract bool ActivateEquipment(EquipmentSlot slot); public virtual void Hooks() { } protected void UpdateTargeting(orig_Update orig, EquipmentSlot self) { //IL_0008: 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) orig.Invoke(self); if (self.equipmentIndex != EquipmentDef.equipmentIndex) { return; } TargetingControllerComponent targetingControllerComponent = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)targetingControllerComponent)) { targetingControllerComponent = ((Component)self).gameObject.AddComponent(); targetingControllerComponent.VisualizerPrefab = TargetingIndicatorPrefabBase; } if (self.stock > 0) { switch (TargetingTypeEnum) { case TargetingType.Enemies: targetingControllerComponent.ConfigureTargetFinderForEnemies(self); break; case TargetingType.Friendlies: targetingControllerComponent.ConfigureTargetFinderForFriendlies(self); break; } } else { targetingControllerComponent.Invalidate(); targetingControllerComponent.Indicator.active = false; } } } internal class ErosBow : EquipmentBase { public ConfigEntry PercentMaxHpHeal; private Dictionary erosPairs = new Dictionary(); public override string EquipmentName => "Eros Bow"; public override string EquipmentLangTokenName => "EROS_BOW_EQUIP"; public override string EquipmentPickupDesc => "Heal on hit. Activate to direct healing to ally."; public override string EquipmentFullDescription => $"Whenever you deal damage, heals a friendly target for {PercentMaxHpHeal.Value * 100f}% of their maximum health. Activating the equipment assigns a new target, or yourself if there are no targets available."; public override string EquipmentLore => "Equipment taken from Smite 2."; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset("ErosBowModel.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset("Eros Bow Icon.png"); public override float Cooldown => 15f; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateTargetingIndicator(); CreateEquipment(); Hooks(); } protected override void CreateConfig(ConfigFile config) { PercentMaxHpHeal = config.Bind("Equipment: " + EquipmentName, "Percent Max Health Heal", 0.01f, "What percentage of max health is healed to the target when the effect activates?"); } protected override void CreateLang() { LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_NAME", "Eros' Bow"); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_PICKUP", EquipmentPickupDesc); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_DESCRIPTION", EquipmentFullDescription); LanguageAPI.Add("EQUIPMENT_" + EquipmentLangTokenName + "_LORE", EquipmentLore); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown CharacterBody.OnInventoryChanged += new hook_OnInventoryChanged(GiveErosEffect); GlobalEventManager.OnHitEnemy += new hook_OnHitEnemy(GiveHealth); EquipmentSlot.UpdateTargets += new hook_UpdateTargets(ErosTarget); CharacterBody.OnDeathStart += new hook_OnDeathStart(CleanupOnDeath); } private void CleanupOnDeath(orig_OnDeathStart orig, CharacterBody self) { orig.Invoke(self); foreach (CharacterBody item in (from kvp in erosPairs where (Object)(object)kvp.Value == (Object)(object)self select kvp.Key).ToList()) { erosPairs[item] = item; } erosPairs.Remove(self); } private void ErosTarget(orig_UpdateTargets orig, EquipmentSlot self, EquipmentIndex targetingEquipmentIndex, bool userShouldAnticipateTarget) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) if (targetingEquipmentIndex != EquipmentDef.equipmentIndex) { orig.Invoke(self, targetingEquipmentIndex, userShouldAnticipateTarget); } else if (self.equipmentIndex == EquipmentDef.equipmentIndex) { self.ConfigureTargetFinderForFriendlies(); HurtBox val = self.targetFinder.GetResults().FirstOrDefault(); if ((Object)(object)val != (Object)null && self.stock > 0) { self.targetIndicator.visualizerPrefab = TargetingIndicatorPrefabBase; self.targetIndicator.targetTransform = ((Component)val).transform; self.targetIndicator.active = true; self.currentTarget = new UserTargetInfo(val); } else { self.currentTarget = new UserTargetInfo(self.characterBody.mainHurtBox); self.targetIndicator.active = false; } } } private void GiveErosEffect(orig_OnInventoryChanged orig, CharacterBody self) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active) { return; } if ((Object)(object)self.inventory.GetActiveEquipment().equipmentDef == (Object)(object)EquipmentDef) { if (!erosPairs.ContainsKey(self)) { erosPairs[self] = self; } } else { erosPairs.Remove(self); } } private void GiveHealth(orig_OnHitEnemy orig, GlobalEventManager self, DamageInfo damageInfo, GameObject victim) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: 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) orig.Invoke(self, damageInfo, victim); if (!Object.op_Implicit((Object)(object)damageInfo.attacker) || !Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component.equipmentSlot) && component.equipmentSlot.equipmentIndex == EquipmentDef.equipmentIndex && erosPairs.ContainsKey(component) && (Object)(object)erosPairs[component] != (Object)null) { CharacterBody val = erosPairs[component]; if (Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) { val.healthComponent.HealFraction(PercentMaxHpHeal.Value, default(ProcChainMask)); } } } private void CreateTargetingIndicator() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) TargetingIndicatorPrefabBase = PrefabAPI.InstantiateClone(Resources.Load("Prefabs/WoodSpriteIndicator"), "ErosBowIndicator", false); TargetingIndicatorPrefabBase.GetComponentInChildren().color = new Color(1f, 0.753f, 0.797f); ((Component)TargetingIndicatorPrefabBase.GetComponentInChildren()).transform.rotation = Quaternion.identity; ((Graphic)TargetingIndicatorPrefabBase.GetComponentInChildren()).color = new Color(1f, 0.714f, 0.757f); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = EquipmentModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(EquipmentModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(EquipmentModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } protected override bool ActivateEquipment(EquipmentSlot slot) { if (!NetworkServer.active) { return false; } if (!Object.op_Implicit((Object)(object)slot.characterBody) || !Object.op_Implicit((Object)(object)slot.characterBody.inputBank)) { return false; } GameObject rootObject = slot.currentTarget.rootObject; CharacterBody val = ((rootObject != null) ? rootObject.GetComponent() : null) ?? slot.characterBody; if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)slot.characterBody) { erosPairs[slot.characterBody] = val; } else { erosPairs[slot.characterBody] = slot.characterBody; } return true; } } public class OmenDrum : EquipmentBase { public ConfigEntry Duration; public ConfigEntry PercentEchoedDamage; private List MarkedEnemies = new List(); private float storedDamage; public static BuffDef omenBuff; public override string EquipmentName => "Omen Drum"; public override string EquipmentLangTokenName => "OMEN_DRUM_EQUIP"; public override string EquipmentPickupDesc => "Mark all enemies hit for 5 seconds. Afterwards, deal a fraction of damage dealt to all marked targets to all marked targets."; public override string EquipmentFullDescription => $"All enemies hit for the next {Duration.Value} seconds are marked, with the mark duplicating {PercentEchoedDamage.Value * 100f}% of all damage taken and sending it to a global damage pool. When the duration expires, ALL marked enemies suffer 100% pooled damage."; public override string EquipmentLore => "Item taken from Smite 2."; public override GameObject EquipmentModel => Main.MainAssets.LoadAsset("OmenDrumModel.prefab"); public override Sprite EquipmentIcon => Main.MainAssets.LoadAsset("Omen Drum Icon.png"); public override float Cooldown => 90f; public override void Init(ConfigFile config) { CreateConfig(config); CreateLang(); CreateBuff(); CreateEquipment(); Hooks(); } protected override void CreateConfig(ConfigFile config) { Duration = config.Bind("Equipment: " + EquipmentName, "Duration", 5f, "How long does the equipment effect last?"); PercentEchoedDamage = config.Bind("Equipment: " + EquipmentName, "Percentage damage echoed", 0.15f, "What percentage of damage dealt to all marked targets is dealt again to all marked targets at the end of the duration?"); } public override ItemDisplayRuleDict CreateItemDisplayRules() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown ModelPanelParameters obj = EquipmentModel.AddComponent(); GameObject val = new GameObject("FocusPoint"); val.transform.SetParent(EquipmentModel.transform); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("CameraPosition"); val2.transform.SetParent(EquipmentModel.transform); val2.transform.localPosition = new Vector3(1f, 0f, 0f); val2.transform.localRotation = Quaternion.identity; obj.focusPointTransform = val.transform; obj.cameraPositionTransform = val2.transform; obj.minDistance = 100f; obj.maxDistance = 200f; obj.modelRotation = Quaternion.Euler(new Vector3(0f, 90f, 0f)); obj.modelPositionOffset = new Vector3(0f, 50f, 0f); return new ItemDisplayRuleDict(Array.Empty()); } public override void Hooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(HandleMark); CharacterBody.OnBuffFinalStackLost += new hook_OnBuffFinalStackLost(EchoDamage); } private void EchoDamage(orig_OnBuffFinalStackLost orig, CharacterBody self, BuffDef buffDef) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, buffDef); if ((Object)(object)buffDef == (Object)(object)omenBuff) { float damage = storedDamage * PercentEchoedDamage.Value; ProcChainMask procChainMask = default(ProcChainMask); ((ProcChainMask)(ref procChainMask)).AddProc((ProcType)24); DamageInfo val = new DamageInfo { attacker = null, damage = damage, procChainMask = procChainMask, damageColorIndex = (DamageColorIndex)16, damageType = DamageTypeCombo.op_Implicit((DamageType)2), procCoefficient = 0f }; for (int i = 0; i < MarkedEnemies.Count; i++) { CharacterBody val2 = MarkedEnemies[i]; DamageInfo val3 = val; val3.position = val2.corePosition; val2.healthComponent.TakeDamage(val3); } } } private void HandleMark(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { orig.Invoke(self, damageInfo); if (Object.op_Implicit((Object)(object)damageInfo.attacker) && Object.op_Implicit((Object)(object)damageInfo.attacker.GetComponent())) { if (damageInfo.attacker.GetComponent().HasBuff(omenBuff) && !MarkedEnemies.Contains(self.body)) { MarkedEnemies.Add(self.body); } if (MarkedEnemies.Contains(self.body)) { storedDamage += damageInfo.damage; } } } public void CreateBuff() { omenBuff = ScriptableObject.CreateInstance(); omenBuff.canStack = false; omenBuff.isDebuff = false; ((Object)omenBuff).name = "omenBuff"; omenBuff.isCooldown = false; omenBuff.iconSprite = Main.MainAssets.LoadAsset("Omen Drum Icon.png"); ContentAddition.AddBuffDef(omenBuff); } protected override bool ActivateEquipment(EquipmentSlot slot) { slot.characterBody.AddTimedBuff(omenBuff, Duration.Value); return true; } } } namespace Smite_Items.Equipment.EliteEquipment { public abstract class EliteEquipmentBase : EliteEquipmentBase where T : EliteEquipmentBase { public static T instance { get; private set; } public EliteEquipmentBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting EliteEquipmentBase was instantiated twice"); } instance = this as T; } } public abstract class EliteEquipmentBase { public class EliteOverlayManager : MonoBehaviour { public TemporaryOverlay Overlay; public CharacterBody Body; public BuffDef EliteBuffDef; public void FixedUpdate() { if (!Body.HasBuff(EliteBuffDef)) { Object.Destroy((Object)(object)Overlay); Object.Destroy((Object)(object)this); } } } public enum TargetingType { Enemies, Friendlies } public class TargetingControllerComponent : MonoBehaviour { public GameObject TargetObject; public GameObject VisualizerPrefab; public Indicator Indicator; public BullseyeSearch TargetFinder; public Action AdditionalBullseyeFunctionality = delegate { }; public void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Indicator = new Indicator(((Component)this).gameObject, (GameObject)null); } public void OnDestroy() { Invalidate(); } public void Invalidate() { TargetObject = null; Indicator.targetTransform = null; } public void ConfigureTargetFinderBase(EquipmentSlot self) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown if (TargetFinder == null) { TargetFinder = new BullseyeSearch(); } TargetFinder.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref TargetFinder.teamMaskFilter)).RemoveTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.sortMode = (SortMode)2; TargetFinder.filterByLoS = true; float num = default(float); Ray val = CameraRigController.ModifyAimRayIfApplicable(self.GetAimRay(), ((Component)self).gameObject, ref num); TargetFinder.searchOrigin = ((Ray)(ref val)).origin; TargetFinder.searchDirection = ((Ray)(ref val)).direction; TargetFinder.maxAngleFilter = 10f; TargetFinder.viewer = self.characterBody; } public void ConfigureTargetFinderForEnemies(EquipmentSlot self) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.GetUnprotectedTeams(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void ConfigureTargetFinderForFriendlies(EquipmentSlot self) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) ConfigureTargetFinderBase(self); TargetFinder.teamMaskFilter = TeamMask.none; ((TeamMask)(ref TargetFinder.teamMaskFilter)).AddTeam(self.characterBody.teamComponent.teamIndex); TargetFinder.RefreshCandidates(); TargetFinder.FilterOutGameObject(((Component)self).gameObject); AdditionalBullseyeFunctionality(TargetFinder); PlaceTargetingIndicator(TargetFinder.GetResults()); } public void PlaceTargetingIndicator(IEnumerable TargetFinderResults) { HurtBox val = (TargetFinderResults.Any() ? TargetFinderResults.First() : null); if (Object.op_Implicit((Object)(object)val)) { TargetObject = ((Component)val.healthComponent).gameObject; Indicator.visualizerPrefab = VisualizerPrefab; Indicator.targetTransform = ((Component)val).transform; } else { Invalidate(); } Indicator.active = Object.op_Implicit((Object)(object)val); } } public EquipmentDef EliteEquipmentDef; public BuffDef EliteBuffDef; public EliteDef EliteDef; public GameObject TargetingIndicatorPrefabBase; public abstract string EliteEquipmentName { get; } public abstract string EliteAffixToken { get; } public abstract string EliteEquipmentPickupDesc { get; } public abstract string EliteEquipmentFullDescription { get; } public abstract string EliteEquipmentLore { get; } public abstract string EliteModifier { get; } public virtual bool AppearsInSinglePlayer { get; } = true; public virtual bool AppearsInMultiPlayer { get; } = true; public virtual bool CanDrop { get; } public virtual float Cooldown { get; } = 60f; public virtual bool EnigmaCompatible { get; } public virtual bool IsBoss { get; } public virtual bool IsLunar { get; } public abstract GameObject EliteEquipmentModel { get; } public abstract Sprite EliteEquipmentIcon { get; } public abstract Sprite EliteBuffIcon { get; } public virtual EliteTierDef[] CanAppearInEliteTiers { get; set; } = EliteAPI.GetCombatDirectorEliteTiers(); public virtual Material EliteMaterial { get; set; } public virtual float HealthMultiplier { get; set; } = 1f; public virtual float DamageMultiplier { get; set; } = 1f; public virtual bool UseTargeting { get; } public virtual TargetingType TargetingTypeEnum { get; } public abstract void Init(ConfigFile config); public abstract ItemDisplayRuleDict CreateItemDisplayRules(); protected void CreateLang() { LanguageAPI.Add("ELITE_EQUIPMENT_" + EliteAffixToken + "_NAME", EliteEquipmentName); LanguageAPI.Add("ELITE_EQUIPMENT_" + EliteAffixToken + "_PICKUP", EliteEquipmentName); LanguageAPI.Add("ELITE_EQUIPMENT_" + EliteAffixToken + "_DESCRIPTION", EliteEquipmentName); LanguageAPI.Add("ELITE_" + EliteAffixToken + "_MODIFIER", EliteModifier + " {0}"); } protected void CreateEquipment() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Expected O, but got Unknown EliteBuffDef = ScriptableObject.CreateInstance(); ((Object)EliteBuffDef).name = EliteAffixToken; EliteBuffDef.buffColor = Color32.op_Implicit(new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue)); EliteBuffDef.iconSprite = EliteBuffIcon; EliteBuffDef.canStack = false; EliteEquipmentDef = ScriptableObject.CreateInstance(); ((Object)EliteEquipmentDef).name = "ELITE_EQUIPMENT_" + EliteAffixToken; EliteEquipmentDef.nameToken = "ELITE_EQUIPMENT_" + EliteAffixToken + "_NAME"; EliteEquipmentDef.pickupToken = "ELITE_EQUIPMENT_" + EliteAffixToken + "_PICKUP"; EliteEquipmentDef.descriptionToken = "ELITE_EQUIPMENT_" + EliteAffixToken + "_DESCRIPTION"; EliteEquipmentDef.pickupModelPrefab = EliteEquipmentModel; EliteEquipmentDef.pickupIconSprite = EliteEquipmentIcon; EliteEquipmentDef.appearsInSinglePlayer = AppearsInSinglePlayer; EliteEquipmentDef.appearsInMultiPlayer = AppearsInMultiPlayer; EliteEquipmentDef.canDrop = CanDrop; EliteEquipmentDef.cooldown = Cooldown; EliteEquipmentDef.enigmaCompatible = EnigmaCompatible; EliteEquipmentDef.isBoss = IsBoss; EliteEquipmentDef.isLunar = IsLunar; EliteEquipmentDef.passiveBuffDef = EliteBuffDef; ItemAPI.Add(new CustomEquipment(EliteEquipmentDef, CreateItemDisplayRules())); EquipmentSlot.PerformEquipmentAction += new hook_PerformEquipmentAction(PerformEquipmentAction); if (UseTargeting && Object.op_Implicit((Object)(object)TargetingIndicatorPrefabBase)) { EquipmentSlot.Update += new hook_Update(UpdateTargeting); } if (Object.op_Implicit((Object)(object)EliteMaterial)) { CharacterBody.FixedUpdate += new hook_FixedUpdate(OverlayManager); } } private void OverlayManager(orig_FixedUpdate orig, CharacterBody self) { if (Object.op_Implicit((Object)(object)self.modelLocator) && Object.op_Implicit((Object)(object)self.modelLocator.modelTransform) && self.HasBuff(EliteBuffDef)) { EliteOverlayManager[] components = ((Component)self).gameObject.GetComponents(); EliteOverlayManager eliteOverlayManager = null; if (!components.Any()) { eliteOverlayManager = ((Component)self).gameObject.AddComponent(); } else { EliteOverlayManager[] array = components; for (int i = 0; i < array.Length; i++) { if ((Object)(object)array[i].EliteBuffDef == (Object)(object)EliteBuffDef) { orig.Invoke(self); return; } } TemporaryOverlay val = ((Component)self.modelLocator.modelTransform).gameObject.AddComponent(); val.duration = float.PositiveInfinity; val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val.animateShaderAlpha = true; val.destroyComponentOnEnd = true; val.originalMaterial = EliteMaterial; val.AddToCharacerModel(((Component)self.modelLocator.modelTransform).GetComponent()); if (!Object.op_Implicit((Object)(object)eliteOverlayManager)) { eliteOverlayManager = ((Component)self).gameObject.AddComponent(); } eliteOverlayManager.Overlay = val; eliteOverlayManager.Body = self; eliteOverlayManager.EliteBuffDef = EliteBuffDef; } } orig.Invoke(self); } protected void CreateElite() { //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Expected O, but got Unknown EliteDef = ScriptableObject.CreateInstance(); ((Object)EliteDef).name = "ELITE_" + EliteAffixToken; EliteDef.modifierToken = "ELITE_" + EliteAffixToken + "_MODIFIER"; EliteDef.eliteEquipmentDef = EliteEquipmentDef; EliteTierDef[] baseEliteTierDefs = EliteAPI.GetCombatDirectorEliteTiers(); if (!CanAppearInEliteTiers.All((EliteTierDef x) => baseEliteTierDefs.Contains(x))) { foreach (EliteTierDef eliteTierDef in CanAppearInEliteTiers.Except(baseEliteTierDefs)) { int num = Array.FindIndex(baseEliteTierDefs, (EliteTierDef x) => x.costMultiplier >= eliteTierDef.costMultiplier); if (num >= 0) { EliteAPI.AddCustomEliteTier(eliteTierDef, num); } else { EliteAPI.AddCustomEliteTier(eliteTierDef); } baseEliteTierDefs = EliteAPI.GetCombatDirectorEliteTiers(); } } EliteAPI.Add(new CustomElite(EliteDef, (IEnumerable)CanAppearInEliteTiers)); EliteBuffDef.eliteDef = EliteDef; ContentAddition.AddBuffDef(EliteBuffDef); } protected bool PerformEquipmentAction(orig_PerformEquipmentAction orig, EquipmentSlot self, EquipmentDef equipmentDef) { if ((Object)(object)equipmentDef == (Object)(object)EliteEquipmentDef) { return ActivateEquipment(self); } return orig.Invoke(self, equipmentDef); } protected abstract bool ActivateEquipment(EquipmentSlot slot); public abstract void Hooks(); protected void UpdateTargeting(orig_Update orig, EquipmentSlot self) { //IL_0008: 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) orig.Invoke(self); if (self.equipmentIndex != EliteEquipmentDef.equipmentIndex) { return; } TargetingControllerComponent targetingControllerComponent = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)targetingControllerComponent)) { targetingControllerComponent = ((Component)self).gameObject.AddComponent(); targetingControllerComponent.VisualizerPrefab = TargetingIndicatorPrefabBase; } if (self.stock > 0) { switch (TargetingTypeEnum) { case TargetingType.Enemies: targetingControllerComponent.ConfigureTargetFinderForEnemies(self); break; case TargetingType.Friendlies: targetingControllerComponent.ConfigureTargetFinderForFriendlies(self); break; } } else { targetingControllerComponent.Invalidate(); targetingControllerComponent.Indicator.active = false; } } } } namespace Smite_Items.Artifact { public abstract class ArtifactBase : ArtifactBase where T : ArtifactBase { public static T instance { get; private set; } public ArtifactBase() { if (instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting ArtifactBase was instantiated twice"); } instance = this as T; } } public abstract class ArtifactBase { public ArtifactDef ArtifactDef; public abstract string ArtifactName { get; } public abstract string ArtifactLangTokenName { get; } public abstract string ArtifactDescription { get; } public abstract Sprite ArtifactEnabledIcon { get; } public abstract Sprite ArtifactDisabledIcon { get; } public bool ArtifactEnabled => RunArtifactManager.instance.IsArtifactEnabled(ArtifactDef); public abstract void Init(ConfigFile config); protected void CreateLang() { LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_NAME", ArtifactName); LanguageAPI.Add("ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION", ArtifactDescription); } protected void CreateArtifact() { ArtifactDef = ScriptableObject.CreateInstance(); ArtifactDef.cachedName = "ARTIFACT_" + ArtifactLangTokenName; ArtifactDef.nameToken = "ARTIFACT_" + ArtifactLangTokenName + "_NAME"; ArtifactDef.descriptionToken = "ARTIFACT_" + ArtifactLangTokenName + "_DESCRIPTION"; ArtifactDef.smallIconSelectedSprite = ArtifactEnabledIcon; ArtifactDef.smallIconDeselectedSprite = ArtifactDisabledIcon; ContentAddition.AddArtifactDef(ArtifactDef); } public abstract void Hooks(); } }