Decompiled source of Xerath v1.0.1

Xerath.dll

Decompiled 7 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using EntityStates;
using EntityStates.Commando;
using EntityStates.Huntress;
using HG.BlendableTypes;
using KinematicCharacterController;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Audio;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Xerath")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Xerath")]
[assembly: AssemblyTitle("Xerath")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Xerath;

internal class Assets
{
	public static AssetBundle MainAssetBundle;

	public static void PopulateAssets()
	{
		if ((Object)(object)MainAssetBundle == (Object)null)
		{
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Xerath.xerathassets");
			MainAssetBundle = AssetBundle.LoadFromStream(stream);
		}
		using Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("Xerath.Xerath.bnk");
		byte[] array = new byte[stream2.Length];
		stream2.Read(array, 0, array.Length);
		SoundBanks.Add(array);
	}
}
internal class eeeee : MonoBehaviour
{
	private GameObject obj;

	private Tracer tracer;

	private void OnEnable()
	{
		tracer = ((Component)this).GetComponent<Tracer>();
	}

	private void Update()
	{
		//IL_004f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)obj) && Object.op_Implicit((Object)(object)tracer) && Object.op_Implicit((Object)(object)tracer.beamObject))
		{
			obj = tracer.beamObject;
			Vector3 localPosition = obj.transform.localPosition;
			obj.transform.localPosition = new Vector3(localPosition.x, localPosition.y, localPosition.z + 5f);
		}
	}
}
internal class ProjectileLinePathing : MonoBehaviour
{
	private Rigidbody rigidbody;

	public Vector3[] positions = (Vector3[])(object)new Vector3[0];

	public float speed;

	private int index = 0;

	private void OnEnable()
	{
		rigidbody = ((Component)this).GetComponent<Rigidbody>();
		ProjectileSimple component = ((Component)this).GetComponent<ProjectileSimple>();
		if (Object.op_Implicit((Object)(object)component))
		{
			((Behaviour)component).enabled = false;
		}
	}

	private void Update()
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: 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_0093: 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_00af: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)rigidbody) && positions.Length != 0 && index != positions.Length)
		{
			((Component)this).transform.rotation = Quaternion.LookRotation(Vector3.RotateTowards(((Component)this).transform.forward, ((Component)this).transform.position - positions[index], speed * Time.deltaTime, 0f));
			((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, positions[index], speed);
			if (((Component)this).transform.position == positions[index])
			{
				index++;
			}
		}
	}
}
internal class XerathProjectileTeleport : MonoBehaviour
{
	private GameObject owner;

	private ProjectileController proj;

	private void OnEnable()
	{
		proj = ((Component)this).GetComponent<ProjectileController>();
	}

	private void FixedUpdate()
	{
		if (!Object.op_Implicit((Object)(object)owner) && Object.op_Implicit((Object)(object)proj) && Object.op_Implicit((Object)(object)proj.owner))
		{
			owner = proj.owner;
		}
	}

	private void OnCollisionEnter(Collision collision)
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)collision.collider) && Object.op_Implicit((Object)(object)((Component)collision.collider).gameObject) && !Object.op_Implicit((Object)(object)((Component)collision.collider).gameObject.GetComponent<HurtBox>()) && Object.op_Implicit((Object)(object)owner))
		{
			owner.GetComponent<XerathTPHandler>().SetTP(((Component)this).transform.position);
		}
	}
}
internal class XerathTPHandler : MonoBehaviour
{
	public Vector3 pos;

	private SkillLocator skillLocator;

	public static SkillDef tpOverride;

	private bool hasOverride;

	private float stopwatch;

	private GameObject tpLocationEffect;

	private void OnEnable()
	{
		skillLocator = ((Component)this).GetComponent<SkillLocator>();
	}

	private void FixedUpdate()
	{
		if (hasOverride)
		{
			stopwatch += Time.fixedDeltaTime;
			if (stopwatch >= 3f)
			{
				UnSet();
			}
		}
		else if (stopwatch > 0f)
		{
			stopwatch = 0f;
		}
	}

	public void SetTP(Vector3 position)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: 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)
		pos = position;
		hasOverride = true;
		tpLocationEffect = Object.Instantiate<GameObject>(Prefabs.tpLocEffect, position, Quaternion.Euler(90f, 0f, 0f));
		if (Object.op_Implicit((Object)(object)skillLocator))
		{
			skillLocator.utility.SetSkillOverride((object)this, tpOverride, (SkillOverridePriority)4);
		}
	}

	public void UnSet()
	{
		hasOverride = false;
		if (Object.op_Implicit((Object)(object)tpLocationEffect))
		{
			Object.Destroy((Object)(object)tpLocationEffect);
		}
		if (Object.op_Implicit((Object)(object)skillLocator))
		{
			skillLocator.utility.UnsetSkillOverride((object)this, tpOverride, (SkillOverridePriority)4);
		}
	}
}
internal class Hook
{
	internal static void Hooks()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
	}

	private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
	{
		if (Object.op_Implicit((Object)(object)((Component)sender).GetComponent<XerathTPHandler>()))
		{
			args.armorAdd += sender.damage * 0.25f;
		}
	}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.Dragonyck.Xerath", "Xerath", "1.0.1")]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
public class MainPlugin : BaseUnityPlugin
{
	public const string MODUID = "com.Dragonyck.Xerath";

	public const string MODNAME = "Xerath";

	public const string VERSION = "1.0.1";

	public const string SURVIVORNAME = "Xerath";

	public const string SURVIVORNAMEKEY = "XERATH";

	public static GameObject characterPrefab;

	private static readonly Color characterColor = new Color(0.2902f, 0.70588f, 0.98431f);

	private void Awake()
	{
		Assets.PopulateAssets();
		Prefabs.CreatePrefabs();
		CreatePrefab();
		RegisterStates();
		RegisterCharacter();
		Hook.Hooks();
	}

	internal static void CreatePrefab()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b5: Expected O, but got Unknown
		//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_025e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0263: Unknown result type (might be due to invalid IL or missing references)
		//IL_02db: Unknown result type (might be due to invalid IL or missing references)
		//IL_040c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0446: Unknown result type (might be due to invalid IL or missing references)
		//IL_044b: Unknown result type (might be due to invalid IL or missing references)
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_056f: Unknown result type (might be due to invalid IL or missing references)
		//IL_059f: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_065f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0854: Unknown result type (might be due to invalid IL or missing references)
		//IL_086b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0870: Unknown result type (might be due to invalid IL or missing references)
		//IL_0878: Unknown result type (might be due to invalid IL or missing references)
		//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a0c: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion();
		characterPrefab = PrefabAPI.InstantiateClone(val, "XerathBody", true);
		characterPrefab.AddComponent<XerathTPHandler>();
		characterPrefab.GetComponent<NetworkIdentity>().localPlayerAuthority = true;
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("ModelBase")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("CameraPivot")).gameObject);
		Object.Destroy((Object)(object)((Component)characterPrefab.transform.Find("AimOrigin")).gameObject);
		GameObject val2 = Assets.MainAssetBundle.LoadAsset<GameObject>("xerath");
		LineRenderer[] componentsInChildren = val2.GetComponentsInChildren<LineRenderer>(true);
		foreach (LineRenderer val3 in componentsInChildren)
		{
			ChildLocator component = ((Component)val3).GetComponent<ChildLocator>();
			if (Object.op_Implicit((Object)(object)component) && component.transformPairs.Length != 0)
			{
				val3.widthMultiplier = 2f;
				LineBetweenTransforms val4 = ((Component)val3).gameObject.AddComponent<LineBetweenTransforms>();
				val4._transformNodes = (Transform[])(object)new Transform[2]
				{
					((Component)val3).transform,
					component.transformPairs[0].transform
				};
			}
		}
		GameObject val5 = new GameObject("ModelBase");
		val5.transform.parent = characterPrefab.transform;
		val5.transform.localPosition = new Vector3(0f, -0.94f, 0f);
		val5.transform.localRotation = Quaternion.identity;
		val5.transform.localScale = Vector3.one;
		GameObject val6 = new GameObject("AimOrigin");
		val6.transform.parent = val5.transform;
		val6.transform.localPosition = new Vector3(0f, 2.4f, 0f);
		val6.transform.localRotation = Quaternion.identity;
		val6.transform.localScale = Vector3.one;
		Transform transform = val2.transform;
		transform.parent = val5.transform;
		transform.localPosition = Vector3.zero;
		transform.localScale = Vector3.one * 1.7f;
		transform.localRotation = Quaternion.identity;
		CharacterDirection component2 = characterPrefab.GetComponent<CharacterDirection>();
		component2.moveVector = Vector3.zero;
		component2.targetTransform = val5.transform;
		component2.overrideAnimatorForwardTransform = null;
		component2.rootMotionAccumulator = null;
		component2.modelAnimator = val2.GetComponentInChildren<Animator>();
		component2.driveFromRootRotation = false;
		component2.turnSpeed = 720f;
		CharacterBody component3 = characterPrefab.GetComponent<CharacterBody>();
		((Object)component3).name = "XerathBody";
		component3.baseNameToken = "XERATH_NAME";
		component3.subtitleNameToken = "XERATH_SUBTITLE";
		component3.bodyFlags = (BodyFlags)16;
		component3.rootMotionInMainState = false;
		component3.mainRootSpeed = 0f;
		component3.baseMaxHealth = 100f;
		component3.levelMaxHealth = 35f;
		component3.baseRegen = 1f;
		component3.levelRegen = 0.33f;
		component3.baseMaxShield = 0f;
		component3.levelMaxShield = 0f;
		component3.baseMoveSpeed = 7f;
		component3.levelMoveSpeed = 0f;
		component3.baseAcceleration = 110f;
		component3.baseJumpPower = 15f;
		component3.levelJumpPower = 0f;
		component3.baseDamage = 12f;
		component3.levelDamage = 2.4f;
		component3.baseAttackSpeed = 1f;
		component3.levelAttackSpeed = 0f;
		component3.baseCrit = 1f;
		component3.levelCrit = 0f;
		component3.baseArmor = 0f;
		component3.levelArmor = 0f;
		component3.baseJumpCount = 1;
		component3.sprintingSpeedMultiplier = 1.45f;
		component3.wasLucky = false;
		component3.hideCrosshair = false;
		component3.aimOriginTransform = val6.transform;
		component3.hullClassification = (HullClassification)0;
		component3.portraitIcon = (Texture)(object)Assets.MainAssetBundle.LoadAsset<Sprite>("portrait").texture;
		component3.isChampion = false;
		component3.currentVehicle = null;
		component3.skinIndex = 0u;
		component3.bodyColor = characterColor;
		CharacterMotor component4 = characterPrefab.GetComponent<CharacterMotor>();
		component4.walkSpeedPenaltyCoefficient = 1f;
		component4.characterDirection = component2;
		component4.muteWalkMotion = false;
		component4.mass = 160f;
		component4.airControl = 0.25f;
		component4.disableAirControlUntilCollision = false;
		component4.generateParametersOnAwake = true;
		InputBankTest component5 = characterPrefab.GetComponent<InputBankTest>();
		component5.moveVector = Vector3.zero;
		CameraTargetParams component6 = characterPrefab.GetComponent<CameraTargetParams>();
		component6.cameraParams = val.GetComponent<CameraTargetParams>().cameraParams;
		component6.cameraPivotTransform = null;
		component6.recoil = Vector2.zero;
		component6.dontRaycastToPivot = false;
		ModelLocator component7 = characterPrefab.GetComponent<ModelLocator>();
		component7.modelTransform = transform;
		component7.modelBaseTransform = val5.transform;
		component7.dontReleaseModelOnDeath = false;
		component7.autoUpdateModelTransform = true;
		component7.dontDetatchFromParent = false;
		component7.noCorpse = false;
		component7.normalizeToFloor = false;
		component7.preserveModel = false;
		ChildLocator component8 = val2.GetComponent<ChildLocator>();
		CharacterModel val7 = val2.AddComponent<CharacterModel>();
		SkinnedMeshRenderer[] componentsInChildren2 = val2.GetComponentsInChildren<SkinnedMeshRenderer>();
		List<RendererInfo> list = new List<RendererInfo>();
		for (int j = 0; j < componentsInChildren2.Length; j++)
		{
			list.Add(new RendererInfo
			{
				renderer = (Renderer)(object)componentsInChildren2[j],
				defaultMaterial = Utils.InstantiateMaterial(((Renderer)componentsInChildren2[j]).material.mainTexture),
				defaultShadowCastingMode = (ShadowCastingMode)1,
				ignoreOverlays = false
			});
		}
		RendererInfo[] array = list.ToArray();
		val7.body = component3;
		val7.baseRendererInfos = array;
		val7.autoPopulateLightInfos = true;
		val7.invisibilityCount = 0;
		val7.temporaryOverlays = new List<TemporaryOverlay>();
		Reflection.SetFieldValue<SkinnedMeshRenderer>((object)val7, "mainSkinnedMeshRenderer", componentsInChildren2[0]);
		GameObject gameObject = ((Component)transform).gameObject;
		CharacterModel component9 = gameObject.GetComponent<CharacterModel>();
		ModelSkinController val8 = gameObject.AddComponent<ModelSkinController>();
		ChildLocator component10 = gameObject.GetComponent<ChildLocator>();
		LanguageAPI.Add("XERATHBODY_DEFAULT_SKIN_NAME", "Default");
		val8.skins = (SkinDef[])(object)new SkinDef[1] { LoadoutAPI.CreateNewSkinDef(Utils.CreateNewSkinDefInfo(array, gameObject, "XERATHBODY_DEFAULT_SKIN_NAME", "base", array)) };
		HealthComponent component11 = characterPrefab.GetComponent<HealthComponent>();
		component11.health = component3.baseMaxHealth;
		component11.shield = 0f;
		component11.barrier = 0f;
		component11.magnetiCharge = 0f;
		component11.body = null;
		component11.dontShowHealthbar = false;
		component11.globalDeathEventChanceCoefficient = 1f;
		characterPrefab.GetComponent<Interactor>().maxInteractionDistance = 3f;
		characterPrefab.GetComponent<InteractionDriver>().highlightInteractor = true;
		SfxLocator component12 = characterPrefab.GetComponent<SfxLocator>();
		component12.deathSound = "Play_ui_player_death";
		component12.barkSound = "";
		component12.openSound = "";
		component12.landingSound = "Play_char_land";
		component12.fallDamageSound = "Play_char_land_fall_damage";
		component12.aliveLoopStart = "";
		component12.aliveLoopStop = "";
		Rigidbody component13 = characterPrefab.GetComponent<Rigidbody>();
		component13.mass = 100f;
		component13.drag = 0f;
		component13.angularDrag = 0f;
		component13.useGravity = false;
		component13.isKinematic = true;
		component13.interpolation = (RigidbodyInterpolation)0;
		component13.collisionDetectionMode = (CollisionDetectionMode)0;
		component13.constraints = (RigidbodyConstraints)0;
		CapsuleCollider component14 = ((Component)component8.FindChild("collider")).GetComponent<CapsuleCollider>();
		((Collider)component14).isTrigger = false;
		((Collider)component14).material = null;
		KinematicCharacterMotor component15 = characterPrefab.GetComponent<KinematicCharacterMotor>();
		component15.CharacterController = (BaseCharacterController)(object)component4;
		component15.Capsule = component14;
		component15.Rigidbody = component13;
		component15.DetectDiscreteCollisions = false;
		component15.GroundDetectionExtraDistance = 0f;
		component15.MaxStepHeight = 0.2f;
		component15.MinRequiredStepDepth = 0.1f;
		component15.MaxStableSlopeAngle = 55f;
		component15.MaxStableDistanceFromLedge = 0.5f;
		component15.PreventSnappingOnLedges = false;
		component15.MaxStableDenivelationAngle = 55f;
		component15.RigidbodyInteractionType = (RigidbodyInteractionType)0;
		component15.PreserveAttachedRigidbodyMomentum = true;
		component15.HasPlanarConstraint = false;
		component15.PlanarConstraintAxis = Vector3.up;
		component15.StepHandling = (StepHandlingMethod)0;
		component15.LedgeHandling = true;
		component15.InteractiveRigidbodyHandling = true;
		component15.SafeMovement = false;
		HurtBoxGroup val9 = val2.AddComponent<HurtBoxGroup>();
		HurtBox val10 = ((Component)component14).gameObject.AddComponent<HurtBox>();
		((Component)val10).gameObject.layer = LayerIndex.entityPrecise.intVal;
		val10.healthComponent = component11;
		val10.isBullseye = true;
		val10.damageModifier = (DamageModifier)0;
		val10.hurtBoxGroup = val9;
		val10.indexInGroup = 0;
		val9.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val10 };
		val9.mainHurtBox = val10;
		val9.bullseyeCount = 1;
		AimAnimator val11 = val2.AddComponent<AimAnimator>();
		val11.inputBank = component5;
		val11.directionComponent = component2;
		val11.pitchRangeMax = 55f;
		val11.pitchRangeMin = -50f;
		val11.yawRangeMin = -44f;
		val11.yawRangeMax = 44f;
		val11.pitchGiveupRange = 30f;
		val11.yawGiveupRange = 10f;
		val11.giveupDuration = 8f;
		FootstepHandler val12 = val2.AddComponent<FootstepHandler>();
		val12.baseFootstepString = "Play_player_footstep";
		val12.sprintFootstepOverrideString = "";
		val12.enableFootstepDust = true;
		val12.footstepDustPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/GenericFootstepDust.prefab").WaitForCompletion();
		EntityStateMachine component16 = ((Component)component3).GetComponent<EntityStateMachine>();
		component16.mainStateType = new SerializableEntityStateType(typeof(CharacterMain));
		CharacterDeathBehavior component17 = characterPrefab.GetComponent<CharacterDeathBehavior>();
		component17.deathStateMachine = characterPrefab.GetComponent<EntityStateMachine>();
		component17.deathState = new SerializableEntityStateType(typeof(DeathState));
		ContentAddition.AddBody(characterPrefab);
	}

	private void RegisterCharacter()
	{
		//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_012a: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		string text = "<style=cSub>\r\n\r\n< ! > " + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > " + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > " + Environment.NewLine + "<style=cSub>\r\n\r\n< ! > ";
		string text2 = "..and so he left.";
		string text3 = "..and so he vanished.";
		LanguageAPI.Add("XERATH_NAME", "Xerath");
		LanguageAPI.Add("XERATH_DESCRIPTION", text);
		LanguageAPI.Add("XERATH_SUBTITLE", "");
		LanguageAPI.Add("XERATH_OUTRO", text2);
		LanguageAPI.Add("XERATH_FAIL", text3);
		SurvivorDef val = ScriptableObject.CreateInstance<SurvivorDef>();
		val.cachedName = "XERATH_NAME";
		val.unlockableDef = null;
		val.descriptionToken = "XERATH_DESCRIPTION";
		val.primaryColor = characterColor;
		val.bodyPrefab = characterPrefab;
		val.displayPrefab = Utils.NewDisplayModel(((Component)characterPrefab.GetComponent<ModelLocator>().modelBaseTransform).gameObject, "XerathDisplay");
		val.outroFlavorToken = "XERATH_OUTRO";
		val.desiredSortPosition = 0.2f;
		val.mainEndingEscapeFailureFlavorToken = "XERATH_FAIL";
		ContentAddition.AddSurvivorDef(val);
		SkillSetup();
		GameObject val2 = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoMonsterMaster.prefab").WaitForCompletion(), "XerathMaster", true);
		ContentAddition.AddMaster(val2);
		CharacterMaster component = val2.GetComponent<CharacterMaster>();
		component.bodyPrefab = characterPrefab;
	}

	private void RegisterStates()
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		bool flag = default(bool);
		ContentAddition.AddEntityState<Primary>(ref flag);
		ContentAddition.AddEntityState<PrimaryCast>(ref flag);
		ContentAddition.AddEntityState<Secondary>(ref flag);
		ContentAddition.AddEntityState<SecondaryCast>(ref flag);
		ContentAddition.AddEntityState<Utility>(ref flag);
		ContentAddition.AddEntityState<Special>(ref flag);
		ContentAddition.AddEntityState<UltPrimary>(ref flag);
		ContentAddition.AddEntityState<CharacterMain>(ref flag);
		ContentAddition.AddEntityState<Teleport>(ref flag);
	}

	private void SkillSetup()
	{
		GenericSkill[] componentsInChildren = characterPrefab.GetComponentsInChildren<GenericSkill>();
		foreach (GenericSkill val in componentsInChildren)
		{
			Object.DestroyImmediate((Object)(object)val);
		}
		PassiveSetup();
		PrimarySetup();
		SecondarySetup();
		UtilitySetup();
		SpecialSetup();
	}

	private void PassiveSetup()
	{
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("XERATH_PASSIVE_NAME", "Ascended Form");
		LanguageAPI.Add("XERATH_PASSIVE_DESCRIPTION", "Xerath feeds on arcane power, becoming increasingly resilient to physical harm, granting him <style=cIsDamage>25%</style> of his <style=cIsDamage>damage</style> as bonus <style=cIsDamage>armor</style>.");
		component.passiveSkill.enabled = true;
		component.passiveSkill.skillNameToken = "XERATH_PASSIVE_NAME";
		component.passiveSkill.skillDescriptionToken = "XERATH_PASSIVE_DESCRIPTION";
		component.passiveSkill.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("passive");
	}

	private void PrimarySetup()
	{
		//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_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Unknown result type (might be due to invalid IL or missing references)
		//IL_0168: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Expected O, but got Unknown
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("XERATH_M1", "Arcanopulse");
		LanguageAPI.Add("XERATH_M1_DESCRIPTION", "Xerath fires a beam of energy in a line in the target direction that deals <style=cIsDamage>200-540% damage</style> to enemies hit. It can be charged to increase Arcanopulse's range and damage.");
		LanguageAPI.Add("XERATH_M1OVER", "Arcane Barrage");
		LanguageAPI.Add("XERATH_M1OVER_DESCRIPTION", "Xerath calls down a blast of arcane energy that strike the target location, dealing <style=cIsDamage>800% damage</style> to enemies hit.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Primary));
		val.activationStateMachineName = "Weapon";
		val.baseMaxStock = 0;
		val.baseRechargeInterval = 0f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = true;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = false;
		val.cancelSprintingOnActivation = true;
		val.rechargeStock = 0;
		val.requiredStock = 0;
		val.stockToConsume = 0;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("primary");
		val.skillDescriptionToken = "XERATH_M1_DESCRIPTION";
		val.skillName = "XERATH_M1";
		val.skillNameToken = "XERATH_M1";
		ContentAddition.AddSkillDef(val);
		component.primary = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.primary, "_skillFamily", val2);
		SkillFamily skillFamily = component.primary.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = val
		};
		((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
		Special.primaryOverride = ScriptableObject.CreateInstance<SkillDef>();
		Special.primaryOverride.activationState = new SerializableEntityStateType(typeof(UltPrimary));
		Special.primaryOverride.activationStateMachineName = "Weapon";
		Special.primaryOverride.baseMaxStock = 6;
		Special.primaryOverride.baseRechargeInterval = 0f;
		Special.primaryOverride.beginSkillCooldownOnSkillEnd = true;
		Special.primaryOverride.canceledFromSprinting = false;
		Special.primaryOverride.fullRestockOnAssign = true;
		Special.primaryOverride.interruptPriority = (InterruptPriority)0;
		Special.primaryOverride.isCombatSkill = true;
		Special.primaryOverride.mustKeyPress = false;
		Special.primaryOverride.cancelSprintingOnActivation = true;
		Special.primaryOverride.rechargeStock = 0;
		Special.primaryOverride.requiredStock = 1;
		Special.primaryOverride.stockToConsume = 1;
		Special.primaryOverride.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("primary2");
		Special.primaryOverride.skillDescriptionToken = "XERATH_M1OVER_DESCRIPTION";
		Special.primaryOverride.skillName = "XERATH_M1OVER";
		Special.primaryOverride.skillNameToken = "XERATH_M1OVER";
		ContentAddition.AddSkillDef(Special.primaryOverride);
	}

	private void SecondarySetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("XERATH_M2", "Eye of Destruction");
		LanguageAPI.Add("XERATH_M2_DESCRIPTION", "Xerath casts down a blast of arcane energy that strikes the target location, dealing <style=cIsDamage>500% damage</style> and <style=cIsUtility>slows</style>.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Secondary));
		val.activationStateMachineName = "Slide";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 5f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("secondary");
		val.skillDescriptionToken = "XERATH_M2_DESCRIPTION";
		val.skillName = "XERATH_M2";
		val.skillNameToken = "XERATH_M2";
		ContentAddition.AddSkillDef(val);
		component.secondary = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.secondary, "_skillFamily", val2);
		SkillFamily skillFamily = component.secondary.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = val
		};
		((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
	}

	private void UtilitySetup()
	{
		//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_009b: 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_017c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0186: Expected O, but got Unknown
		//IL_0187: Unknown result type (might be due to invalid IL or missing references)
		//IL_0189: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("XERATH_UTIL", "Shocking Orb");
		LanguageAPI.Add("XERATH_UTIL_DESCRIPTION", "Xerath fires an orb of energy in the target direction that detonates on contact for <style=cIsDamage>400% damage</style> in a small area. If it hits terrain, Xerath can recast this ability to instantly <style=cIsDamage>teleport</style> to the hit location.");
		LanguageAPI.Add("XERATH_UTILTP", "Rematerialize");
		LanguageAPI.Add("XERATH_UTILTP_DESCRIPTION", "Activate to instantly <style=cIsDamage>teleport</style> to the hit location.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Utility));
		val.activationStateMachineName = "Body";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 5f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("utility");
		val.skillDescriptionToken = "XERATH_UTIL_DESCRIPTION";
		val.skillName = "XERATH_UTIL";
		val.skillNameToken = "XERATH_UTIL";
		val.keywordTokens = new string[1] { "KEYWORD_STUNNING" };
		ContentAddition.AddSkillDef(val);
		component.utility = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.utility, "_skillFamily", val2);
		SkillFamily skillFamily = component.utility.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = val
		};
		((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
		XerathTPHandler.tpOverride = ScriptableObject.CreateInstance<SkillDef>();
		XerathTPHandler.tpOverride.activationState = new SerializableEntityStateType(typeof(Teleport));
		XerathTPHandler.tpOverride.activationStateMachineName = "Body";
		XerathTPHandler.tpOverride.baseMaxStock = 1;
		XerathTPHandler.tpOverride.baseRechargeInterval = 0f;
		XerathTPHandler.tpOverride.beginSkillCooldownOnSkillEnd = true;
		XerathTPHandler.tpOverride.canceledFromSprinting = false;
		XerathTPHandler.tpOverride.fullRestockOnAssign = true;
		XerathTPHandler.tpOverride.interruptPriority = (InterruptPriority)0;
		XerathTPHandler.tpOverride.isCombatSkill = false;
		XerathTPHandler.tpOverride.mustKeyPress = true;
		XerathTPHandler.tpOverride.cancelSprintingOnActivation = false;
		XerathTPHandler.tpOverride.rechargeStock = 0;
		XerathTPHandler.tpOverride.requiredStock = 1;
		XerathTPHandler.tpOverride.stockToConsume = 1;
		XerathTPHandler.tpOverride.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("utility2");
		XerathTPHandler.tpOverride.skillDescriptionToken = "XERATH_UTILTP_DESCRIPTION";
		XerathTPHandler.tpOverride.skillName = "XERATH_UTILTP";
		XerathTPHandler.tpOverride.skillNameToken = "XERATH_UTILTP";
		ContentAddition.AddSkillDef(XerathTPHandler.tpOverride);
	}

	private void SpecialSetup()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0148: Unknown result type (might be due to invalid IL or missing references)
		//IL_0152: Expected O, but got Unknown
		//IL_0153: Unknown result type (might be due to invalid IL or missing references)
		//IL_0155: Unknown result type (might be due to invalid IL or missing references)
		SkillLocator component = characterPrefab.GetComponent<SkillLocator>();
		LanguageAPI.Add("XERATH_SPEC", "Rite of the Arcane");
		LanguageAPI.Add("XERATH_SPEC_DESCRIPTION", "Xerath channels for up to <style=cIsUtility>10s</style> gaining the ability to cast up to 5 arcane missiles that strike the target location, dealing <style=cIsDamage>800% damage</style> to enemies hit.");
		SkillDef val = ScriptableObject.CreateInstance<SkillDef>();
		val.activationState = new SerializableEntityStateType(typeof(Special));
		val.activationStateMachineName = "Body";
		val.baseMaxStock = 1;
		val.baseRechargeInterval = 8f;
		val.beginSkillCooldownOnSkillEnd = true;
		val.canceledFromSprinting = false;
		val.fullRestockOnAssign = false;
		val.interruptPriority = (InterruptPriority)0;
		val.isCombatSkill = true;
		val.mustKeyPress = true;
		val.cancelSprintingOnActivation = false;
		val.rechargeStock = 1;
		val.requiredStock = 1;
		val.stockToConsume = 1;
		val.icon = Assets.MainAssetBundle.LoadAsset<Sprite>("special");
		val.skillDescriptionToken = "XERATH_SPEC_DESCRIPTION";
		val.skillName = "XERATH_SPEC";
		val.skillNameToken = "XERATH_SPEC";
		ContentAddition.AddSkillDef(val);
		component.special = characterPrefab.AddComponent<GenericSkill>();
		SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>();
		val2.variants = (Variant[])(object)new Variant[1];
		Reflection.SetFieldValue<SkillFamily>((object)component.special, "_skillFamily", val2);
		SkillFamily skillFamily = component.special.skillFamily;
		Variant[] variants = skillFamily.variants;
		Variant val3 = new Variant
		{
			skillDef = val
		};
		((Variant)(ref val3)).viewableNode = new Node(val.skillNameToken, false, (Node)null);
		variants[0] = val3;
		ContentAddition.AddSkillFamily(skillFamily);
	}
}
internal class Prefabs
{
	internal static GameObject blastImpactEffect;

	internal static GameObject tracerEffect;

	internal static GameObject tracerEffectBig;

	internal static GameObject chargeEffect;

	internal static GameObject tpPropjectile;

	internal static GameObject tpPropjectileGhost;

	internal static GameObject tpPropjectileHitEffect;

	internal static GameObject ultLineIndicator;

	internal static GameObject ultProjectile;

	internal static GameObject ultProjectileGhost;

	internal static GameObject ultProjectileHitEffect;

	internal static GameObject tpEffect;

	internal static GameObject tpLocEffect;

	internal static CharacterCameraParams ultCameraParams;

	internal static void CreatePrefabs()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_029c: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ac: Expected O, but got Unknown
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0302: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: Unknown result type (might be due to invalid IL or missing references)
		//IL_0329: Unknown result type (might be due to invalid IL or missing references)
		//IL_032e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_033f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0344: Unknown result type (might be due to invalid IL or missing references)
		//IL_0349: Unknown result type (might be due to invalid IL or missing references)
		//IL_034b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0355: Unknown result type (might be due to invalid IL or missing references)
		//IL_035a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0391: Unknown result type (might be due to invalid IL or missing references)
		//IL_039b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0403: Unknown result type (might be due to invalid IL or missing references)
		//IL_0408: Unknown result type (might be due to invalid IL or missing references)
		//IL_0444: Unknown result type (might be due to invalid IL or missing references)
		//IL_0449: Unknown result type (might be due to invalid IL or missing references)
		//IL_0467: Unknown result type (might be due to invalid IL or missing references)
		//IL_046c: Unknown result type (might be due to invalid IL or missing references)
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_053e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0543: Unknown result type (might be due to invalid IL or missing references)
		//IL_0621: Unknown result type (might be due to invalid IL or missing references)
		//IL_0626: Unknown result type (might be due to invalid IL or missing references)
		//IL_0697: Unknown result type (might be due to invalid IL or missing references)
		//IL_069c: Unknown result type (might be due to invalid IL or missing references)
		//IL_056d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0572: Unknown result type (might be due to invalid IL or missing references)
		//IL_07cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_080b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0810: Unknown result type (might be due to invalid IL or missing references)
		//IL_087c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0881: Unknown result type (might be due to invalid IL or missing references)
		//IL_08af: Unknown result type (might be due to invalid IL or missing references)
		//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_08cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0907: Unknown result type (might be due to invalid IL or missing references)
		//IL_0911: Unknown result type (might be due to invalid IL or missing references)
		//IL_0923: Unknown result type (might be due to invalid IL or missing references)
		//IL_0928: Unknown result type (might be due to invalid IL or missing references)
		//IL_0971: Unknown result type (might be due to invalid IL or missing references)
		//IL_0976: Unknown result type (might be due to invalid IL or missing references)
		//IL_0993: Unknown result type (might be due to invalid IL or missing references)
		//IL_0998: Unknown result type (might be due to invalid IL or missing references)
		//IL_09fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0724: 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_0792: Unknown result type (might be due to invalid IL or missing references)
		//IL_0797: Unknown result type (might be due to invalid IL or missing references)
		tpEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressBlinkEffect.prefab").WaitForCompletion(), "XerathTPEffect", false);
		ParticleSystemRenderer[] componentsInChildren = tpEffect.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val in componentsInChildren)
		{
			string name = ((Object)val).name;
			if (name == "Dash")
			{
				((Renderer)val).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolemMuzzleFlash.mat").WaitForCompletion();
			}
			if (name == "DashRings")
			{
				((Renderer)val).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/EliteLunar/matEliteLunarDonut.mat").WaitForCompletion();
			}
			if (name == "Cubes")
			{
				val.mesh = Assets.MainAssetBundle.LoadAsset<GameObject>("circleMesh").GetComponent<MeshFilter>().mesh;
				((Renderer)val).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/EliteLunar/matEliteLunarParticleReplacement.mat").WaitForCompletion();
			}
			if (name == "Flash, White (1)")
			{
				((Renderer)val).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolemMuzzleFlash.mat").WaitForCompletion();
			}
		}
		tpEffect.GetComponent<EffectComponent>().soundName = "Play_Xerath_R_Cast2";
		ContentAddition.AddEffect(tpEffect);
		tpLocEffect = PrefabAPI.InstantiateClone(tpEffect, "TPLocEffect", false);
		ParticleSystem[] componentsInChildren2 = tpLocEffect.GetComponentsInChildren<ParticleSystem>(true);
		foreach (ParticleSystem val2 in componentsInChildren2)
		{
			MainModule main = val2.main;
			((MainModule)(ref main)).loop = true;
			((MainModule)(ref main)).duration = 0.5f;
			EmissionModule emission = val2.emission;
			((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(15f);
			((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0;
		}
		tpLocEffect.transform.localScale = new Vector3(2f, 2f, 4f);
		Object.Destroy((Object)(object)tpLocEffect.GetComponent<DestroyOnParticleEnd>());
		Object.Destroy((Object)(object)tpLocEffect.GetComponent<VFXAttributes>());
		Object.Destroy((Object)(object)tpLocEffect.GetComponent<EffectComponent>());
		ultLineIndicator = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/BasicThrowableVisualizer.prefab").WaitForCompletion(), "XerathUltLineIndicator", false);
		LineRenderer component = ultLineIndicator.GetComponent<LineRenderer>();
		component.widthMultiplier = 3f;
		component.textureMode = (LineTextureMode)0;
		component.numPositions = 128;
		BezierCurveLine val3 = ultLineIndicator.AddComponent<BezierCurveLine>();
		val3.v0 = new Vector3(0f, 400f, 100f);
		GameObject val4 = new GameObject("EndTransform");
		val4.transform.SetParent(ultLineIndicator.transform);
		val3.endTransform = val4.transform;
		ultCameraParams = ScriptableObject.CreateInstance<CharacterCameraParams>();
		ultCameraParams.data = new CharacterCameraParamsData
		{
			minPitch = BlendableFloat.op_Implicit(-170f),
			maxPitch = BlendableFloat.op_Implicit(170f),
			pivotVerticalOffset = BlendableFloat.op_Implicit(111f),
			idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, -8.18f)),
			fov = BlendableFloat.op_Implicit(60f)
		};
		blastImpactEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Lightning/LightningStrikeImpact.prefab").WaitForCompletion(), "XerathBlastImpactEffect", false);
		blastImpactEffect.GetComponent<EffectComponent>().soundName = "Play_Xerath_W_Hit";
		blastImpactEffect.transform.localScale = Vector3.one * 2.8f;
		ContentAddition.AddEffect(blastImpactEffect);
		tracerEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Golem/TracerGolem.prefab").WaitForCompletion(), "XerathTracerEffect", false);
		tracerEffect.AddComponent<VFXAttributes>();
		tracerEffect.GetComponent<EffectComponent>().soundName = "Play_Xerath_Q_Hit";
		tracerEffect.AddComponent<eeeee>();
		Material val5 = Object.Instantiate<Material>(Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolemMuzzleFlash.mat").WaitForCompletion());
		val5.DisableKeyword("VERTEXCOLOR");
		((Renderer)tracerEffect.GetComponentInChildren<ParticleSystemRenderer>()).material = val5;
		ContentAddition.AddEffect(tracerEffect);
		tracerEffectBig = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidRaidCrab/TracerVoidRaidCrabTripleBeam.prefab").WaitForCompletion(), "XerathTracerEffectBig", false);
		Utils.CopyComponent<ShakeEmitter>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Brother/BrotherDashEffect.prefab").WaitForCompletion().GetComponent<ShakeEmitter>(), tracerEffectBig);
		Object.Destroy((Object)(object)((Component)tracerEffectBig.GetComponentInChildren<Decal>()).gameObject);
		tracerEffectBig.AddComponent<VFXAttributes>();
		tracerEffectBig.GetComponentInChildren<Light>().color = Color.cyan;
		((Renderer)Array.Find(tracerEffectBig.GetComponentsInChildren<LineRenderer>(), (LineRenderer element) => ((Object)element).name == "Beam1")).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Junk/Mage/matMageLightningLaser.mat").WaitForCompletion();
		ParticleSystemRenderer[] componentsInChildren3 = tracerEffectBig.GetComponentsInChildren<ParticleSystemRenderer>();
		foreach (ParticleSystemRenderer val6 in componentsInChildren3)
		{
			string name2 = ((Object)val6).name;
			if (name2 == "BeamParticles, Rings")
			{
				((Renderer)val6).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matLightningArm.mat").WaitForCompletion();
			}
			if (name2 == "BeamParticles, Small")
			{
				((Renderer)val6).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarGolem/matLunarGolemMuzzleFlash.mat").WaitForCompletion();
			}
		}
		ContentAddition.AddEffect(tracerEffectBig);
		chargeEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/ChargeMageLightningBomb.prefab").WaitForCompletion(), "XerathChargeEffect", false);
		((Renderer)chargeEffect.GetComponentInChildren<MeshRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarWisp/matLunarWispMinigunTell.mat").WaitForCompletion();
		((Component)Array.Find(chargeEffect.GetComponentsInChildren<ParticleSystemRenderer>(), (ParticleSystemRenderer element) => ((Object)element).name == "Sparks, Trail (1)")).gameObject.SetActive(false);
		ultProjectileHitEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/EliteLightning/LightningStakeNova.prefab").WaitForCompletion(), "XerathUltProjectileHitEffect", false);
		ultProjectileHitEffect.GetComponent<EffectComponent>().soundName = "Play_Xerath_R_Hit";
		ContentAddition.AddEffect(ultProjectileHitEffect);
		tpPropjectileHitEffect = PrefabAPI.InstantiateClone(ultProjectileHitEffect, "XerathTPProjectileHitEffect", false);
		tpPropjectileHitEffect.GetComponent<EffectComponent>().soundName = "Play_Xerath_E_Hit";
		ContentAddition.AddEffect(tpPropjectileHitEffect);
		tpPropjectileGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageLightningboltGhost.prefab").WaitForCompletion(), "XerathTPProjectileGhost", false);
		Transform val7 = null;
		Transform val8 = null;
		Transform[] componentsInChildren4 = tpPropjectileGhost.GetComponentsInChildren<Transform>(true);
		foreach (Transform val9 in componentsInChildren4)
		{
			string name3 = ((Object)val9).name;
			if (name3 == "Trail,Short")
			{
				((Component)val9).gameObject.SetActive(true);
				val7 = val9;
				TrailRenderer component2 = ((Component)val9).GetComponent<TrailRenderer>();
				component2.time = 0.3f;
				((Renderer)component2).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matLightningArm.mat").WaitForCompletion();
			}
			if (name3 == "Spinner")
			{
				val8 = val9;
			}
			if (name3 == "Trail,Long")
			{
				((Component)val9).gameObject.SetActive(true);
			}
			if (name3 == "Sphere (1)")
			{
				((Renderer)((Component)val9).GetComponent<MeshRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Lightning/matLightningStrike.mat").WaitForCompletion();
			}
		}
		Transform child = val8.GetChild(0);
		val7.SetParent(child);
		val7.localPosition = Vector3.zero;
		Transform child2 = val8.GetChild(1);
		GameObject val10 = Object.Instantiate<GameObject>(((Component)val7).gameObject, child2);
		val10.transform.localPosition = Vector3.zero;
		tpPropjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MageLightningboltBasic.prefab").WaitForCompletion(), "XerathTPProjectile", true);
		tpPropjectile.AddComponent<XerathProjectileTeleport>();
		tpPropjectile.GetComponent<ProjectileImpactExplosion>().impactEffect = tpPropjectileHitEffect;
		ProjectileController component3 = tpPropjectile.GetComponent<ProjectileController>();
		component3.ghostPrefab = tpPropjectileGhost;
		component3.startSound = "Play_Xerath_E_Mis";
		ContentAddition.AddProjectile(tpPropjectile);
		ultProjectileGhost = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/HermitCrab/HermitCrabBombGhost.prefab").WaitForCompletion(), "XerathUltProjectileGhost", false);
		ParticleSystemRenderer[] componentsInChildren5 = ultProjectileGhost.GetComponentsInChildren<ParticleSystemRenderer>();
		((Renderer)componentsInChildren5[0]).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Common/VFX/matJellyfishLightningLarge.mat").WaitForCompletion();
		((Component)componentsInChildren5[0]).transform.localScale = Vector3.one;
		((Renderer)componentsInChildren5[1]).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/LunarWisp/matLunarWispMuzzleBurst.mat").WaitForCompletion();
		MeshRenderer componentInChildren = ultProjectileGhost.GetComponentInChildren<MeshRenderer>();
		((Component)componentInChildren).transform.localScale = Vector3.one * 0.7f;
		((Renderer)componentInChildren).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/EliteIce/matAffixWhiteSphereExplosion.mat").WaitForCompletion();
		TrailRenderer componentInChildren2 = ultProjectileGhost.GetComponentInChildren<TrailRenderer>();
		componentInChildren2.time = 0.4f;
		componentInChildren2.startWidth = 5f;
		componentInChildren2.endWidth = 1f;
		((Renderer)componentInChildren2).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/Lightning/matLightningStrike.mat").WaitForCompletion();
		componentInChildren2.textureMode = (LineTextureMode)2;
		ultProjectile = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ElectricWorm/ElectricWormSeekerProjectile.prefab").WaitForCompletion(), "XerathUltProjectile", true);
		Object.Destroy((Object)(object)ultProjectile.GetComponent<ProjectileDirectionalTargetFinder>());
		Object.Destroy((Object)(object)ultProjectile.GetComponent<ProjectileSteerTowardTarget>());
		Object.Destroy((Object)(object)ultProjectile.GetComponent<ProjectileTargetComponent>());
		ProjectileImpactExplosion component4 = ultProjectile.GetComponent<ProjectileImpactExplosion>();
		((ProjectileExplosion)component4).blastRadius = 20f;
		((ProjectileExplosion)component4).blastAttackerFiltering = (AttackerFiltering)2;
		component4.impactEffect = ultProjectileHitEffect;
		ProjectileController component5 = ultProjectile.GetComponent<ProjectileController>();
		component5.ghostPrefab = ultProjectileGhost;
		component5.shouldPlaySounds = true;
		component5.startSound = "Play_Xerath_R_Mis";
		LoopSoundDef val11 = ScriptableObject.CreateInstance<LoopSoundDef>();
		val11.startSoundName = "Play_Xerath_R_Mis";
		component5.flightSoundLoop = val11;
		ultProjectile.AddComponent<ProjectileLinePathing>();
		ContentAddition.AddProjectile(ultProjectile);
	}
}
internal class CharacterMain : GenericCharacterMain
{
	public override void OnEnter()
	{
		((GenericCharacterMain)this).OnEnter();
	}

	public override void FixedUpdate()
	{
		((GenericCharacterMain)this).FixedUpdate();
		if (buttonPressed())
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)new BaseEmote());
		}
	}

	private bool buttonPressed()
	{
		if (PauseScreenController.instancesList.Count == 0 && ((BaseState)this).isGrounded && ((EntityState)this).characterBody.hasEffectiveAuthority && Input.GetKey((KeyCode)306) && Input.GetKey((KeyCode)51))
		{
			return true;
		}
		return false;
	}
}
internal class BaseEmote : BaseState
{
	private float emoteDuration = 1f;

	private uint ID;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		((EntityState)this).PlayAnimation("FullBody, Override", "Dance");
		ID = AkSoundEngine.PostEvent(Sounds.Play_Xerath_Music, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		//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)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= emoteDuration && ((EntityState)this).isAuthority && ((EntityState)this).inputBank.moveVector != Vector3.zero)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
		AkSoundEngine.StopPlayingID(ID);
		((EntityState)this).GetModelAnimator().SetTrigger("DanceOver");
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)6;
	}
}
internal class Primary : BaseSkillState
{
	private GameObject chargeEffectInstance;

	private float duration;

	private uint ID;

	public override void OnEnter()
	{
		//IL_0055: 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)
		((BaseState)this).OnEnter();
		duration = 2f / ((BaseState)this).attackSpeedStat;
		((EntityState)this).GetModelAnimator().SetFloat("Primary", ((BaseState)this).attackSpeedStat);
		((EntityState)this).PlayAnimation("FullBody, Override", "Primary");
		Transform val = ((BaseState)this).FindModelChild("chargeMuzzle");
		chargeEffectInstance = Object.Instantiate<GameObject>(Prefabs.chargeEffect, val.position, val.rotation);
		chargeEffectInstance.transform.parent = val;
		ScaleParticleSystemDuration component = chargeEffectInstance.GetComponent<ScaleParticleSystemDuration>();
		ObjectScaleCurve component2 = chargeEffectInstance.GetComponent<ObjectScaleCurve>();
		if (Object.op_Implicit((Object)(object)component))
		{
			component.newDuration = duration;
		}
		if (Object.op_Implicit((Object)(object)component2))
		{
			component2.timeMax = duration;
		}
		AkSoundEngine.PostEvent(Sounds.Play_Xerath_Q_Cast, ((EntityState)this).gameObject);
		if (((EntityState)this).isAuthority)
		{
			ID = AkSoundEngine.PostEvent(Sounds.Play_Xerath_Q_Loop, ((EntityState)this).gameObject);
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		float charge = Mathf.Clamp01(((EntityState)this).fixedAge / duration);
		if ((((EntityState)this).fixedAge >= duration || !((EntityState)this).inputBank.skill1.down) && ((EntityState)this).isAuthority)
		{
			PrimaryCast primaryCast = new PrimaryCast();
			primaryCast.charge = charge;
			((EntityState)this).outer.SetNextState((EntityState)(object)primaryCast);
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
		AkSoundEngine.StopPlayingID(ID);
		EntityState.Destroy((Object)(object)chargeEffectInstance);
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)6;
	}
}
internal class PrimaryCast : BaseSkillState
{
	public float charge;

	private float duration;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = 0.65f / ((BaseState)this).attackSpeedStat;
		((EntityState)this).GetModelAnimator().SetTrigger("PrimaryEnd");
		Fire();
	}

	private void Fire()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0115: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0145: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		EffectManager.SimpleMuzzleFlash(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageLightningLarge.prefab").WaitForCompletion(), ((EntityState)this).gameObject, "handR", false);
		if (((EntityState)this).isAuthority)
		{
			BulletAttack val = new BulletAttack
			{
				owner = ((EntityState)this).gameObject,
				weapon = ((EntityState)this).gameObject
			};
			Ray aimRay = ((BaseState)this).GetAimRay();
			val.origin = ((Ray)(ref aimRay)).origin;
			val.falloffModel = (FalloffModel)0;
			val.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask;
			aimRay = ((BaseState)this).GetAimRay();
			val.aimVector = ((Ray)(ref aimRay)).direction;
			val.procCoefficient = 1f;
			val.minSpread = 0f;
			val.maxSpread = 0f;
			val.bulletCount = 1u;
			val.smartCollision = true;
			val.damage = ((EntityState)this).characterBody.damage * Util.Remap(charge, 0f, 1f, 2f, 5.4f);
			val.force = Util.Remap(charge, 0f, 1f, 500f, 1200f);
			val.tracerEffectPrefab = ((charge == 1f) ? Prefabs.tracerEffectBig : Prefabs.tracerEffect);
			val.muzzleName = "gunMuzzle";
			val.hitEffectPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/HitsparkCommandoShotgun.prefab").WaitForCompletion();
			val.isCrit = ((BaseState)this).RollCrit();
			val.radius = 1.6f;
			val.maxDistance = Util.Remap(charge, 0f, 1f, 50f, 120f);
			val.Fire();
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)6;
	}
}
internal class Secondary : BaseSkillState
{
	private GameObject areaIndicator;

	private SecondaryCast state = new SecondaryCast();

	public override void OnEnter()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		areaIndicator = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab);
		areaIndicator.transform.localScale = Vector3.one * 12f;
	}

	public override void Update()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: 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_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			float num = 1000f;
			float num2 = 0f;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(CameraRigController.ModifyAimRayIfApplicable(((BaseState)this).GetAimRay(), ((EntityState)this).gameObject, ref num2), ref val, num + num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
			{
				areaIndicator.transform.position = ((RaycastHit)(ref val)).point;
				areaIndicator.transform.up = ((RaycastHit)(ref val)).normal;
			}
			if (state != null)
			{
				state.firePosition = areaIndicator.transform.position;
			}
		}
		if (!((EntityState)this).inputBank.skill2.down)
		{
			((EntityState)this).outer.SetNextState((EntityState)(object)state);
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
		if (Object.op_Implicit((Object)(object)areaIndicator))
		{
			EntityState.Destroy((Object)(object)areaIndicator);
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)6;
	}
}
internal class SecondaryCast : BaseSkillState
{
	private float duration;

	private bool hasFired;

	public Vector3 firePosition;

	public override void OnEnter()
	{
		//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_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_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0057: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		duration = 0.75f / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("FullBody, Override", "Secondary", "Secondary", duration);
		if (firePosition == Vector3.zero)
		{
			firePosition = ((EntityState)this).characterBody.footPosition;
		}
		EffectManager.SimpleMuzzleFlash(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageLightningLargeWithTrail.prefab").WaitForCompletion(), ((EntityState)this).gameObject, "handR", false);
		EffectManager.SimpleMuzzleFlash(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageLightningLargeWithTrail.prefab").WaitForCompletion(), ((EntityState)this).gameObject, "handL", false);
		AkSoundEngine.PostEvent(Sounds.Play_Xerath_W_Cast, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration * 0.25f && !hasFired)
		{
			hasFired = true;
			Fire();
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void Fire()
	{
		//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_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)
		//IL_001f: Expected O, but got Unknown
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0082: Unknown result type (might be due to invalid IL or missing references)
		//IL_0084: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		EffectData val = new EffectData
		{
			origin = firePosition,
			scale = 12f
		};
		EffectManager.SpawnEffect(Prefabs.blastImpactEffect, val, false);
		Ray aimRay = ((BaseState)this).GetAimRay();
		if (((EntityState)this).isAuthority)
		{
			new BlastAttack
			{
				attacker = ((EntityState)this).gameObject,
				baseDamage = ((BaseState)this).damageStat * 5f,
				baseForce = 0f,
				crit = ((BaseState)this).RollCrit(),
				damageType = (DamageType)8,
				falloffModel = (FalloffModel)2,
				procCoefficient = 1f,
				radius = 12f,
				position = firePosition,
				attackerFiltering = (AttackerFiltering)2,
				impactEffect = EffectCatalog.FindEffectIndexFromPrefab(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/OmniImpactVFXLightningMage.prefab").WaitForCompletion()),
				teamIndex = ((EntityState)this).teamComponent.teamIndex,
				damageColorIndex = (DamageColorIndex)10
			}.Fire();
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)6;
	}
}
internal class Special : BaseSkillState
{
	private float duration = 10f;

	private CharacterCameraParams defaultCameraParams = Addressables.LoadAssetAsync<CharacterCameraParams>((object)"RoR2/Base/Common/ccpStandard.asset").WaitForCompletion();

	private CharacterCameraParams cameraParams = Prefabs.ultCameraParams;

	public static SkillDef primaryOverride;

	private CameraParamsOverrideHandle handle;

	public Vector3 pos;

	private GameObject areaIndicator;

	public GameObject lineIndicator;

	private Transform lineEndTransform;

	private bool soundPlayed;

	private GameObject camera;

	public override void OnEnter()
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		((BaseState)this).OnEnter();
		((EntityState)this).PlayAnimation("FullBody, Override", "Ult");
		((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, primaryOverride, (SkillOverridePriority)4);
		handle = ((EntityState)this).cameraTargetParams.AddParamsOverride(new CameraParamsOverrideRequest
		{
			cameraParamsData = cameraParams.data,
			priority = 0.1f
		}, 0.5f);
		areaIndicator = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab);
		areaIndicator.transform.localScale = Vector3.one * 12f;
		lineIndicator = Object.Instantiate<GameObject>(Prefabs.ultLineIndicator, ((EntityState)this).characterBody.corePosition, Quaternion.identity, (Transform)null);
		lineEndTransform = lineIndicator.transform.GetChild(0);
		CameraRigController[] array = Object.FindObjectsOfType<CameraRigController>();
		foreach (CameraRigController val in array)
		{
			if ((Object)(object)val.targetBody == (Object)(object)((EntityState)this).characterBody)
			{
				camera = ((Component)val).gameObject;
			}
		}
		if (Object.op_Implicit((Object)(object)camera))
		{
			AkSoundEngine.PostEvent(Sounds.Play_Xerath_R_Cast, ((EntityState)this).gameObject);
		}
	}

	public override void Update()
	{
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: 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_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).Update();
		if (((EntityState)this).fixedAge >= 0.5f && !soundPlayed)
		{
			soundPlayed = true;
			if (Object.op_Implicit((Object)(object)camera))
			{
				AkSoundEngine.PostEvent(Sounds.Play_Xerath_R_Cast2, ((EntityState)this).gameObject);
			}
		}
		if (!Object.op_Implicit((Object)(object)areaIndicator))
		{
			return;
		}
		float num = 1000f;
		float num2 = 0f;
		RaycastHit val = default(RaycastHit);
		if (Physics.Raycast(CameraRigController.ModifyAimRayIfApplicable(((BaseState)this).GetAimRay(), ((EntityState)this).gameObject, ref num2), ref val, num + num2, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
		{
			pos = ((RaycastHit)(ref val)).point;
			areaIndicator.transform.position = ((RaycastHit)(ref val)).point;
			areaIndicator.transform.up = ((RaycastHit)(ref val)).normal;
			if (Object.op_Implicit((Object)(object)lineEndTransform))
			{
				lineEndTransform.position = ((RaycastHit)(ref val)).point;
			}
		}
	}

	public override void FixedUpdate()
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((BaseCharacterController)((EntityState)this).characterMotor).Motor))
		{
			((EntityState)this).characterMotor.velocity = Vector3.zero;
		}
		HandlePrimaryInput(((EntityState)this).skillLocator.primary, ref ((EntityState)this).inputBank.skill1);
		if (((EntityState)this).skillLocator.primary.stock == 0 && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void HandlePrimaryInput(GenericSkill skillSlot, ref ButtonState buttonState)
	{
		if (buttonState.down && Object.op_Implicit((Object)(object)skillSlot) && (!skillSlot.mustKeyPress || !buttonState.hasPressBeenClaimed) && skillSlot.ExecuteIfReady())
		{
			buttonState.hasPressBeenClaimed = true;
		}
	}

	public override void OnExit()
	{
		//IL_0027: 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)
		((EntityState)this).OnExit();
		EntityState.Destroy((Object)(object)areaIndicator);
		EntityState.Destroy((Object)(object)lineIndicator);
		((EntityState)this).cameraTargetParams.RemoveParamsOverride(handle, 0.5f);
		((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, primaryOverride, (SkillOverridePriority)4);
		((EntityState)this).GetModelAnimator().SetTrigger("SpecialEnd");
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Teleport : BaseSkillState
{
	private XerathTPHandler tpHandler;

	private float duration = 0.5f;

	private bool playedVFX;

	public override void OnEnter()
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		tpHandler = ((EntityState)this).GetComponent<XerathTPHandler>();
		((BaseState)this).SmallHop(((EntityState)this).characterMotor, 0f);
		if (((EntityState)this).isAuthority)
		{
			TeleportHelper.TeleportBody(((EntityState)this).characterBody, tpHandler.pos);
			Transform modelTransform = ((EntityState)this).GetModelTransform();
			TemporaryOverlay val = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
			val.duration = 0.3f;
			val.animateShaderAlpha = true;
			val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
			val.destroyComponentOnEnd = true;
			val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashBright");
			val.AddToCharacerModel(((Component)modelTransform).GetComponent<CharacterModel>());
			TemporaryOverlay val2 = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>();
			val2.duration = 0.4f;
			val2.animateShaderAlpha = true;
			val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f);
			val2.destroyComponentOnEnd = true;
			val2.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matHuntressFlashExpanded");
			val2.AddToCharacerModel(((Component)modelTransform).GetComponent<CharacterModel>());
		}
		AkSoundEngine.PostEvent(Sounds.Play_Xerath_R_Cast2, ((EntityState)this).gameObject);
		if (Object.op_Implicit((Object)(object)tpHandler))
		{
			tpHandler.UnSet();
		}
		((EntityState)this).PlayAnimation("FullBody, Override", "Secondary", "Secondary", duration);
	}

	public override void FixedUpdate()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Expected O, but got Unknown
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Unknown result type (might be due to invalid IL or missing references)
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= 0.2f && !playedVFX)
		{
			playedVFX = true;
			EffectData val = new EffectData();
			val.rotation = Util.QuaternionSafeLookRotation(Vector3.up);
			val.origin = ((EntityState)this).characterBody.corePosition;
			EffectManager.SpawnEffect(Prefabs.tpEffect, val, false);
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}
}
internal class UltPrimary : BaseSkillState
{
	private float duration;

	private float baseDuration = 0.6f;

	private GameObject projectilePrefab = Prefabs.ultProjectile;

	public override void OnEnter()
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0090: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		((BaseState)this).OnEnter();
		duration = baseDuration / ((BaseState)this).attackSpeedStat;
		Special special = ((EntityState)this).GetComponent<EntityStateMachine>().state as Special;
		Vector3 val = Vector3.zero;
		if (special != null && special.pos != val)
		{
			val = special.pos;
			ProjectileLinePathing component = projectilePrefab.GetComponent<ProjectileLinePathing>();
			component.positions = special.lineIndicator.GetComponent<BezierCurveLine>().vertexList;
			component.speed = Vector3.Distance(((EntityState)this).characterBody.corePosition, val) * 2400f;
		}
		if (val == Vector3.zero && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
		AkSoundEngine.PostEvent(Sounds.Play_Xerath_R_Mis_Cast, ((EntityState)this).gameObject);
		Fire();
	}

	private void Fire()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		EffectManager.SimpleMuzzleFlash(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageLightning.prefab").WaitForCompletion(), ((EntityState)this).gameObject, "handR", false);
		if (((EntityState)this).isAuthority)
		{
			FireProjectileInfo val = default(FireProjectileInfo);
			val.crit = ((BaseState)this).RollCrit();
			val.damage = ((EntityState)this).characterBody.damage * 8f;
			val.damageTypeOverride = (DamageType)32;
			val.damageColorIndex = (DamageColorIndex)0;
			val.force = 500f;
			val.owner = ((EntityState)this).gameObject;
			Ray aimRay = ((BaseState)this).GetAimRay();
			val.position = ((Ray)(ref aimRay)).origin;
			val.procChainMask = default(ProcChainMask);
			val.projectilePrefab = projectilePrefab;
			val.rotation = Quaternion.LookRotation(Vector3.up);
			val.useFuseOverride = false;
			val.useSpeedOverride = false;
			val.target = null;
			FireProjectileInfo val2 = val;
			ProjectileManager.instance.FireProjectile(val2);
		}
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)1;
	}
}
internal class Utility : BaseSkillState
{
	private float duration;

	private bool hasFired;

	private HurtBox target;

	public override void OnEnter()
	{
		((BaseState)this).OnEnter();
		duration = 0.3f / ((BaseState)this).attackSpeedStat;
		((EntityState)this).PlayAnimation("FullBody, Override", "Utility", "Utility", duration);
		AkSoundEngine.PostEvent(Sounds.Play_Xerath_E_Cast, ((EntityState)this).gameObject);
	}

	public override void FixedUpdate()
	{
		((EntityState)this).FixedUpdate();
		if (((EntityState)this).fixedAge >= duration * 0.25f && !hasFired)
		{
			hasFired = true;
			Fire();
		}
		if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
		{
			((EntityState)this).outer.SetNextStateToMain();
		}
	}

	private void Fire()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		EffectManager.SimpleMuzzleFlash(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Mage/MuzzleflashMageLightning.prefab").WaitForCompletion(), ((EntityState)this).gameObject, "handR", false);
		if (((EntityState)this).isAuthority)
		{
			FireProjectileInfo val = default(FireProjectileInfo);
			val.crit = ((BaseState)this).RollCrit();
			val.damage = ((EntityState)this).characterBody.damage * 4f;
			val.damageTypeOverride = (DamageType)32;
			val.damageColorIndex = (DamageColorIndex)0;
			val.force = 500f;
			val.owner = ((EntityState)this).gameObject;
			Ray aimRay = ((BaseState)this).GetAimRay();
			val.position = ((Ray)(ref aimRay)).origin;
			val.procChainMask = default(ProcChainMask);
			val.projectilePrefab = Prefabs.tpPropjectile;
			aimRay = ((BaseState)this).GetAimRay();
			val.rotation = Quaternion.LookRotation(((Ray)(ref aimRay)).direction);
			val.useFuseOverride = false;
			val.useSpeedOverride = false;
			val.target = null;
			FireProjectileInfo val2 = val;
			ProjectileManager.instance.FireProjectile(val2);
		}
	}

	public override void OnExit()
	{
		((EntityState)this).OnExit();
	}

	public override InterruptPriority GetMinimumInterruptPriority()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		return (InterruptPriority)2;
	}
}
internal class Sounds
{
	public static readonly uint Play_Xerath_Music = 543877628u;

	public static readonly uint Play_Xerath_W_Cast = 1283839468u;

	public static readonly uint Play_Xerath_R_Mis = 1702730707u;

	public static readonly uint Play_Xerath_R_Cast2 = 1728800823u;

	public static readonly uint Play_Xerath_R_Hit = 1770282437u;

	public static readonly uint Play_Xerath_W_Hit = 2052577924u;

	public static readonly uint Play_Xerath_E_Cast = 2108314866u;

	public static readonly uint Play_Xerath_E_Mis = 2283413592u;

	public static readonly uint Play_Xerath_Q_Loop = 2458222157u;

	public static readonly uint Play_Xerath_E_Hit = 3022467350u;

	public static readonly uint Play_Xerath_Q_Hit = 3095307402u;

	public static readonly uint Play_Xerath_Q_Cast = 3486245502u;

	public static readonly uint Play_Xerath_R_Cast = 3616886535u;

	public static readonly uint Play_Xerath_R_Mis_Cast = 3878380363u;
}
internal class Utils
{
	public static GameObject NewDisplayModel(GameObject model, string name)
	{
		//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)
		GameObject val = PrefabAPI.InstantiateClone(model, name, false);
		((Behaviour)val.GetComponentInChildren<CharacterModel>()).enabled = false;
		SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>();
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			((Renderer)componentsInChildren[i]).material.shader = Addressables.LoadAssetAsync<Shader>((object)"RoR2/Base/Shaders/HGStandard.shader").WaitForCompletion();
			((Renderer)componentsInChildren[i]).material.shaderKeywords = null;
		}
		return val;
	}

	internal static Sprite CreateSprite(Texture2D tex)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f), 128f);
	}

	internal static SkinDefInfo CreateNewSkinDefInfo(RendererInfo[] childList, GameObject rootObject, string skinName, string objectToEnable, RendererInfo[] rendererInfos)
	{
		//IL_0003: 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_0050: 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_006b: 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_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		SkinDefInfo result = default(SkinDefInfo);
		result.BaseSkins = Array.Empty<SkinDef>();
		result.MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0];
		result.ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0];
		List<GameObjectActivation> list = new List<GameObjectActivation>();
		foreach (RendererInfo val in childList)
		{
			GameObjectActivation val2 = default(GameObjectActivation);
			val2.gameObject = ((Component)val.renderer).gameObject;
			val2.shouldActivate = true;
			GameObjectActivation item = val2;
			list.Add(item);
		}
		result.GameObjectActivations = list.ToArray();
		result.Icon = Assets.MainAssetBundle.LoadAsset<Sprite>("portraitSkin");
		result.MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0];
		result.Name = skinName;
		result.NameToken = skinName;
		result.RendererInfos = rendererInfos;
		result.RootObject = rootObject;
		result.UnlockableDef = null;
		return result;
	}

	internal static T CopyComponent<T>(T original, GameObject destination) where T : Component
	{
		Type type = ((object)original).GetType();
		Component val = destination.AddComponent(type);
		FieldInfo[] fields = type.GetFields();
		FieldInfo[] array = fields;
		foreach (FieldInfo fieldInfo in array)
		{
			fieldInfo.SetValue(val, fieldInfo.GetValue(original));
		}
		return (T)(object)((val is T) ? val : null);
	}

	public static Sprite CreateSpriteFromTexture(Texture2D texture)
	{
		//IL_0025: 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)
		if (Object.op_Implicit((Object)(object)texture))
		{
			return Sprite.Create(texture, new Rect(0f, 0f, (float)((Texture)texture).width, (float)((Texture)texture).height), new Vector2(0.5f, 0.5f));
		}
		return null;
	}

	public static GameObject FindInActiveObjectByName(string name)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: Invalid comparison between Unknown and I4
		Transform[] array = Resources.FindObjectsOfTypeAll<Transform>();
		for (int i = 0; i < array.Length; i++)
		{
			if ((int)((Object)array[i]).hideFlags == 0 && ((Object)array[i]).name == name)
			{
				return ((Component)array[i]).gameObject;
			}
		}
		return null;
	}

	public static GameObject CreateHitbox(string name, Transform parent, Vector3 scale)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Expected O, but got Unknown
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject(name);
		val.transform.SetParent(parent);
		val.transform.localPosition = Vector3.zero;
		val.transform.localRotation = Quaternion.identity;
		val.transform.localScale = scale;
		HitBoxGroup val2 = ((Component)parent).gameObject.AddComponent<HitBoxGroup>();
		HitBox val3 = val.AddComponent<HitBox>();
		val.layer = LayerIndex.projectile.intVal;
		val2.hitBoxes