Decompiled source of CrusadersEquipment v3.2.1

plugins/BaseDamageModifiers.dll

Decompiled 2 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace BaseDamageModifiers;

[BepInPlugin("com.ehaugw.basedamagemodifiers", "BaseDamageModifiers", "1.0.0")]
public class BaseDamageModifiers : BaseUnityPlugin
{
	public delegate void WeaponDamageModifier(Weapon weapon, DamageList original, ref DamageList result);

	public delegate void WeaponImpactModifier(Weapon weapon, float original, ref float result);

	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class Weapon_BaseImpact
	{
		[HarmonyPostfix]
		public static void Postfix(Weapon __instance, ref float __result)
		{
			float original = __result;
			WeaponImpactModifiers(__instance, original, ref __result);
		}
	}

	[HarmonyPatch(typeof(WeaponStats), "GetAttackImpact")]
	public class WeaponStats_GetAttackImpact
	{
		[HarmonyPostfix]
		public static void Postfix(WeaponStats __instance, int _attackID, ref float __result, Item ___m_item)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			Weapon val = (Weapon)___m_item;
			WeaponType val2 = val.Type;
			object obj;
			if (val == null)
			{
				obj = null;
			}
			else
			{
				Character ownerCharacter = ((EffectSynchronizer)val).OwnerCharacter;
				obj = ((ownerCharacter != null) ? ownerCharacter.Animator : null);
			}
			Animator val3 = (Animator)obj;
			if (val3 != null && UnityEngineExtensions.HasParameter(val3, "WeaponType"))
			{
				val2 = (WeaponType)val3.GetInteger("WeaponType");
			}
			float num = 1f;
			if (WeaponStatData.WeaponBaseDataDict.Keys.Contains(val2))
			{
				float[] impactMult = WeaponStatData.WeaponBaseDataDict[val2].ImpactMult;
				if (_attackID < 0 || _attackID >= impactMult.Length)
				{
					_attackID = 0;
				}
				num = impactMult[_attackID];
			}
			__result = val.Impact * num;
		}
	}

	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class Weapon_Damage
	{
		[HarmonyPostfix]
		public static void Postfix(Weapon __instance, ref DamageList __result)
		{
			DamageList original = __result.Clone();
			__result = __result.Clone();
			WeaponDamageModifiers(__instance, original, ref __result);
		}
	}

	[HarmonyPatch(typeof(WeaponStats), "GetAttackDamage")]
	public class WeaponStats_GetAttackDamage
	{
		[HarmonyPostfix]
		public static void Postfix(WeaponStats __instance, int _attackID, ref IList<float> __result, Item ___m_item)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			Weapon val = (Weapon)___m_item;
			WeaponType val2 = val.Type;
			object obj;
			if (val == null)
			{
				obj = null;
			}
			else
			{
				Character ownerCharacter = ((EffectSynchronizer)val).OwnerCharacter;
				obj = ((ownerCharacter != null) ? ownerCharacter.Animator : null);
			}
			Animator val3 = (Animator)obj;
			if (val3 != null && UnityEngineExtensions.HasParameter(val3, "WeaponType"))
			{
				val2 = (WeaponType)val3.GetInteger("WeaponType");
			}
			float[] array = new float[5] { 1f, 1f, 1f, 1f, 1f };
			if (WeaponStatData.WeaponBaseDataDict.Keys.Contains(val2))
			{
				array = WeaponStatData.WeaponBaseDataDict[val2].DamageMult;
			}
			if (_attackID < 0 || _attackID >= array.Length)
			{
				_attackID = 0;
			}
			DamageList damage = val.Damage;
			for (int i = 0; i < damage.Count && i < __result.Count; i++)
			{
				__result[i] = damage[i].Damage * array[_attackID];
			}
		}
	}

	public const string GUID = "com.ehaugw.basedamagemodifiers";

	public const string VERSION = "1.0.0";

	public const string NAME = "BaseDamageModifiers";

	public static WeaponDamageModifier WeaponDamageModifiers = delegate
	{
	};

	public static WeaponImpactModifier WeaponImpactModifiers = delegate
	{
	};

	internal void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.ehaugw.basedamagemodifiers");
		val.PatchAll();
	}
}
public class WeaponStatData
{
	public static Dictionary<WeaponType, WeaponStatData> WeaponBaseDataDict = new Dictionary<WeaponType, WeaponStatData>
	{
		{
			(WeaponType)0,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.495f, 1.265f, 1.265f },
				ImpactMult = new float[5] { 1f, 1f, 1.3f, 1.1f, 1.1f },
				StamMult = new float[5] { 1f, 1f, 1.2f, 1.1f, 1.1f }
			}
		},
		{
			(WeaponType)51,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.5f, 1.265f, 1.265f },
				ImpactMult = new float[5] { 1f, 1f, 1.5f, 1.1f, 1.1f },
				StamMult = new float[5] { 1f, 1f, 1.3f, 1.1f, 1.1f }
			}
		},
		{
			(WeaponType)1,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f },
				ImpactMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f },
				StamMult = new float[5] { 1f, 1f, 1.2f, 1.2f, 1.2f }
			}
		},
		{
			(WeaponType)52,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f },
				ImpactMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f },
				StamMult = new float[5] { 1f, 1f, 1.375f, 1.375f, 1.35f }
			}
		},
		{
			(WeaponType)2,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f },
				ImpactMult = new float[5] { 1f, 1f, 2.5f, 1.3f, 1.3f },
				StamMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f }
			}
		},
		{
			(WeaponType)53,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 0.75f, 1.4f, 1.4f },
				ImpactMult = new float[5] { 1f, 1f, 2f, 1.4f, 1.4f },
				StamMult = new float[5] { 1f, 1f, 1.2f, 1.2f, 1.2f }
			}
		},
		{
			(WeaponType)50,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.7f },
				ImpactMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.7f },
				StamMult = new float[5] { 1f, 1f, 1.25f, 1.25f, 1.75f }
			}
		},
		{
			(WeaponType)54,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.4f, 1.3f, 1.2f },
				ImpactMult = new float[5] { 1f, 1f, 1.2f, 1.2f, 1.1f },
				StamMult = new float[5] { 1f, 1f, 1.25f, 1.25f, 1.25f }
			}
		},
		{
			(WeaponType)55,
			new WeaponStatData
			{
				DamageMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f },
				ImpactMult = new float[5] { 1f, 1f, 1.3f, 1.3f, 1.3f },
				StamMult = new float[5] { 1f, 1f, 1.3f, 1.2f, 1.2f }
			}
		}
	};

	public float[] DamageMult;

	public float[] ImpactMult;

	public float[] StamMult;
}

plugins/CrusadersEquipment.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BaseDamageModifiers;
using BepInEx;
using EffectSourceConditions;
using HarmonyLib;
using HolyDamageManager;
using ImpendingDoom;
using NodeCanvas.BehaviourTrees;
using NodeCanvas.DialogueTrees;
using NodeCanvas.Framework;
using NodeCanvas.Tasks.Actions;
using Proficiencies;
using RelicCondition;
using RelicKeeper;
using SideLoader;
using SideLoader.Model;
using SynchronizedWorldObjects;
using TinyHelper;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace RelicKeeper
{
	public static class AddDivineFlameMainHand
	{
		public static void Apply(Skill skill, int requiredItem)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			Types damageType = HolyDamageManager.GetDamageType();
			string text = "Temporarly adds Fire and " + ((object)(Types)(ref damageType)).ToString() + " Damage to your weapon, and inflicts Burning on enemies.";
			SpellCastType? val = (SpellCastType)36;
			float? num = 0f;
			RelicConditionBuilder val2 = RelicConditionBuilder.Apply(skill, requiredItem, text, 14f, 60f, 0f, 0f, 10f, val, (SpellCastModifier?)(SpellCastModifier)0, num, (int?)2, (bool?)null, 2501068, 2);
			ImbueWeapon val3 = ((Component)val2.EffectsContainer).gameObject.AddComponent<ImbueWeapon>();
			ref ImbueEffectPreset imbuedEffect = ref ((ImbueObject)val3).ImbuedEffect;
			EffectPreset effectPreset = ResourcesPrefabManager.Instance.GetEffectPreset(273);
			imbuedEffect = (ImbueEffectPreset)(object)((effectPreset is ImbueEffectPreset) ? effectPreset : null);
			val3.AffectSlot = (WeaponSlot)0;
			((ImbueObject)val3).SetLifespanImbue(60f);
		}
	}
	public static class StaffExplosion
	{
		public static void Apply(Skill skill, int requiredItem)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_011c: Expected O, but got Unknown
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Expected O, but got Unknown
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Expected O, but got Unknown
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Expected O, but got Unknown
			//IL_01c7: Expected O, but got Unknown
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Expected O, but got Unknown
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Expected O, but got Unknown
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			SpellCastType? val = (SpellCastType)38;
			float? num = 0f;
			RelicConditionBuilder val2 = RelicConditionBuilder.Apply(skill, requiredItem, "Creates an explosion that damages and inflicts Scorched on enemies.", 14f, 100f, 0f, 0f, 30f, val, (SpellCastModifier?)(SpellCastModifier)0, num, (int?)null, (bool?)null, 2501068, 2);
			SL_ShootBlast val3 = new SL_ShootBlast();
			((SL_Shooter)val3).CastPosition = (CastPositionType)0;
			((SL_Shooter)val3).LocalPositionAdd = new Vector3(-0.15f, 2.1f, 1.4f);
			val3.BaseBlast = (BlastPrefabs)139;
			((SL_Shooter)val3).TargetType = (TargetTypes)0;
			val3.Radius = 3.5f;
			val3.BlastLifespan = 1f;
			val3.RefreshTime = -1f;
			val3.InstantiatedAmount = 5;
			val3.Interruptible = true;
			val3.HitOnShoot = true;
			val3.IgnoreShooter = true;
			val3.ParentToShootTransform = false;
			val3.ImpactSoundMaterial = (EquipmentSoundMaterials)12;
			val3.DontPlayHitSound = false;
			val3.EffectBehaviour = (EditBehaviours)2;
			((SL_Effect)val3).Delay = 0f;
			SL_ShootBlast obj = val3;
			SL_EffectTransform[] array = new SL_EffectTransform[1];
			SL_EffectTransform val4 = new SL_EffectTransform();
			val4.TransformName = "Effects";
			val4.Effects = (SL_Effect[])(object)new SL_Effect[3]
			{
				(SL_Effect)new SL_AddStatusEffect
				{
					StatusEffect = "Burn"
				},
				(SL_Effect)new SL_AutoKnock(),
				(SL_Effect)new SL_PunctualDamage
				{
					Knockback = 70f,
					Damage = new List<SL_Damage>
					{
						new SL_Damage
						{
							Damage = 30f,
							Type = (Types)5
						},
						new SL_Damage
						{
							Damage = 10f,
							Type = HolyDamageManager.GetDamageType()
						},
						new SL_Damage
						{
							Damage = 10f,
							Type = (Types)0
						}
					}
				}
			};
			array[0] = val4;
			obj.BlastEffects = (SL_EffectTransform[])(object)array;
			Effect obj2 = ((SL_Effect)val3).ApplyToTransform(val2.EffectsContainer);
			ShootBlast val5 = (ShootBlast)(object)((obj2 is ShootBlast) ? obj2 : null);
			val3 = new SL_ShootBlast();
			((SL_Shooter)val3).CastPosition = (CastPositionType)0;
			((SL_Shooter)val3).LocalPositionAdd = new Vector3(-0.15f, 0f, 1.4f);
			((SL_Shooter)val3).TargetType = (TargetTypes)2;
			val3.BaseBlast = (BlastPrefabs)67;
			val3.Radius = 7f;
			val3.BlastLifespan = 5f;
			val3.RefreshTime = 0.5f;
			val3.InstantiatedAmount = 5;
			val3.Interruptible = false;
			val3.HitOnShoot = true;
			val3.IgnoreShooter = false;
			val3.ParentToShootTransform = false;
			val3.ImpactSoundMaterial = (EquipmentSoundMaterials)12;
			val3.DontPlayHitSound = true;
			val3.EffectBehaviour = (EditBehaviours)2;
			((SL_Effect)val3).Delay = 0f;
			SL_ShootBlast obj3 = val3;
			SL_EffectTransform[] array2 = new SL_EffectTransform[1];
			val4 = new SL_EffectTransform();
			val4.TransformName = "Effects";
			val4.Effects = (SL_Effect[])(object)new SL_Effect[0];
			array2[0] = val4;
			obj3.BlastEffects = (SL_EffectTransform[])(object)array2;
			Effect obj4 = ((SL_Effect)val3).ApplyToTransform(val2.EffectsContainer);
			ShootBlast val6 = (ShootBlast)(object)((obj4 is ShootBlast) ? obj4 : null);
			MainModule? obj5;
			if (val6 == null)
			{
				obj5 = null;
			}
			else
			{
				Blast baseBlast = val6.BaseBlast;
				if (baseBlast == null)
				{
					obj5 = null;
				}
				else
				{
					Transform transform = ((Component)baseBlast).transform;
					if (transform == null)
					{
						obj5 = null;
					}
					else
					{
						Transform obj6 = transform.Find("ExplosionFX/smokeSharp");
						if (obj6 == null)
						{
							obj5 = null;
						}
						else
						{
							ParticleSystem component = ((Component)obj6).GetComponent<ParticleSystem>();
							obj5 = ((component != null) ? new MainModule?(component.main) : null);
						}
					}
				}
			}
			MainModule? val7 = obj5;
			if (val7.HasValue)
			{
				MainModule valueOrDefault = val7.GetValueOrDefault();
				if (true)
				{
					((MainModule)(ref valueOrDefault)).startColor = new MinMaxGradient(new Color(0.5f, 0.5f, 0.5f, 0.7f), new Color(0.2f, 0.2f, 0.2f, 0.7f));
				}
			}
		}
	}
}
namespace CrusadersEquipment
{
	internal class EffectInitializer
	{
		public static ImbueEffectPreset MakeDivineFlameImbue()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Expected O, but got Unknown
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			float flatDamage = 7f;
			float scalingDamage = 0.25f;
			Types secondaryDamageType = HolyDamageManager.GetDamageType();
			ImbueEffectPreset val = TinyEffectManager.MakeImbuePreset(273, "Divine Flame Imbue", "Weapon deals some Fire Damage, some " + ((object)(Types)(ref secondaryDamageType)).ToString() + " Damage based on your Fire Damage Bonus, and inflicts Burning on enemies.", (string)null, (int?)203, (List<Skill>)null, (string)null, (int?)null, (int?)null, (float?)null, (float?)null, (float?)null, (Types?)null);
			Transform transform = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)val).transform).transform;
			TinyEffectManager.MakeWeaponDamage(transform, flatDamage, scalingDamage, (Types)5, 0f);
			TinyEffectManager.MakeWeaponDamage(transform, 0f, 0f, secondaryDamageType, 0f);
			TinyEffectManager.MakeStatusEffectBuildup(transform, "Burning", 49f);
			transform = TinyGameObjectManager.MakeFreshObject("HitEffects", true, true, ((Component)val).transform).transform;
			Transform imbueFX = val.ImbueFX;
			imbueFX = Object.Instantiate<Transform>(imbueFX);
			((Component)imbueFX).gameObject.SetActive(false);
			Object.DontDestroyOnLoad((Object)(object)imbueFX);
			val.ImbueFX = imbueFX;
			MainModule main = ((Component)imbueFX.Find("FireParticlesLargeCore")).GetComponent<ParticleSystem>().main;
			((MainModule)(ref main)).startColor = new MinMaxGradient(new Color(1f, 1f, 1f, 0.7f), new Color(0.8f, 0.8f, 1f, 0.7f));
			BaseDamageModifiers.WeaponDamageModifiers = (WeaponDamageModifier)Delegate.Combine((Delegate?)(object)BaseDamageModifiers.WeaponDamageModifiers, (Delegate?)(WeaponDamageModifier)delegate(Weapon weapon, DamageList original, ref DamageList result)
			{
				//IL_002e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0034: Expected O, but got Unknown
				//IL_006a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Expected O, but got Unknown
				if (weapon != null && weapon.HasImbuePreset(273))
				{
					float num = original.TotalDamage * scalingDamage + flatDamage;
					DamageList val2 = new DamageList((Types)5, num);
					if (weapon != null)
					{
						Character ownerCharacter = ((EffectSynchronizer)weapon).OwnerCharacter;
						if (ownerCharacter != null)
						{
							CharacterStats stats = ownerCharacter.Stats;
							if (stats != null)
							{
								stats.GetAmplifiedDamage((IList<Tag>)(object)new Tag[0], ref val2);
							}
						}
					}
					float num2 = val2.TotalDamage - num;
					result.Add(new DamageList(secondaryDamageType, num2));
				}
			});
			return val;
		}
	}
	public class AegisRing
	{
		public const string ItemName = "Aegis";

		public const int EnchantID = 2501066;

		public static void MakeEnchant()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			SL_EnchantmentRecipe val = new SL_EnchantmentRecipe();
			val.Name = "Aegis";
			val.Description = "";
			val.EnchantmentID = 2501066;
			val.IncenseItemID = 6000200;
			val.PillarDatas = (PillarData[])(object)new PillarData[4]
			{
				new PillarData
				{
					Direction = (Directions)3,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)3,
					IsFar = true
				},
				new PillarData
				{
					Direction = (Directions)2,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)2,
					IsFar = true
				}
			};
			val.CompatibleEquipment = new EquipmentData
			{
				RequiredTag = "Ring",
				Equipments = (IngredientData[])(object)new IngredientData[1]
				{
					new IngredientData
					{
						SelectorType = (IngredientTypes)0,
						SelectorValue = TinyTagManager.GetOrMakeTag("Ring").TagName
					}
				}
			};
			val.TimeOfDay = (Vector2[])(object)new Vector2[0];
			val.Areas = (AreaEnum[])(object)new AreaEnum[0];
			val.Temperature = (TemperatureSteps[])(object)new TemperatureSteps[0];
			val.WindAltarActivated = false;
			val.IsEnchantingGuildRecipe = false;
			val.EnchantTime = 5f;
			val.Effects = (SL_EffectTransform[])(object)new SL_EffectTransform[0];
			val.AddedDamages = (AdditionalDamage[])(object)new AdditionalDamage[0];
			val.StatModifications = (StatModification[])(object)new StatModification[1]
			{
				new StatModification
				{
					Stat = (Stat)11,
					Value = 2f,
					Type = (BonusType)1
				}
			};
			val.FlatDamageAdded = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageModifierBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageResistanceBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.HealthAbsorbRatio = 0f;
			val.ManaAbsorbRatio = 0f;
			val.StaminaAbsorbRatio = 0f;
			val.Indestructible = false;
			val.TrackDamageRatio = -1f;
			val.GlobalStatusResistance = 0f;
			SL_EnchantmentRecipe val2 = val;
			((ContentTemplate)val2).ApplyTemplate();
		}
	}
	public class FlameOfAnor
	{
		public const string ItemName = "Flame of Anor";

		public const int EnchantID = 2501068;

		public static void MakeEnchant()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Expected O, but got Unknown
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Expected O, but got Unknown
			SL_EnchantmentRecipe val = new SL_EnchantmentRecipe();
			val.Name = "Flame of Anor";
			val.Description = "";
			val.EnchantmentID = 2501068;
			val.IncenseItemID = 6000390;
			val.PillarDatas = (PillarData[])(object)new PillarData[1]
			{
				new PillarData
				{
					Direction = (Directions)0,
					IsFar = false
				}
			};
			val.CompatibleEquipment = new EquipmentData
			{
				RequiredTag = "StaffOffHand",
				Equipments = (IngredientData[])(object)new IngredientData[1]
				{
					new IngredientData
					{
						SelectorType = (IngredientTypes)0,
						SelectorValue = TinyTagManager.GetOrMakeTag("FlameOfAnorCompatibleTag").TagName
					}
				}
			};
			val.TimeOfDay = (Vector2[])(object)new Vector2[0];
			val.Areas = (AreaEnum[])(object)new AreaEnum[1] { (AreaEnum)601 };
			val.Temperature = (TemperatureSteps[])(object)new TemperatureSteps[0];
			val.WindAltarActivated = false;
			val.IsEnchantingGuildRecipe = true;
			val.EnchantTime = 5f;
			SL_EffectTransform[] array = new SL_EffectTransform[1];
			SL_EffectTransform val2 = new SL_EffectTransform();
			val2.TransformName = "HitEffects";
			val2.Effects = (SL_Effect[])(object)new SL_Effect[1] { (SL_Effect)new SL_AddStatusEffectBuildUp
			{
				StatusEffect = "Blaze",
				Buildup = 49f
			} };
			array[0] = val2;
			val.Effects = (SL_EffectTransform[])(object)array;
			val.AddedDamages = (AdditionalDamage[])(object)new AdditionalDamage[0];
			val.StatModifications = (StatModification[])(object)new StatModification[1]
			{
				new StatModification
				{
					Stat = (Stat)7,
					Value = 20f,
					Type = (BonusType)1
				}
			};
			val.FlatDamageAdded = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageModifierBonus = (SL_Damage[])(object)new SL_Damage[1]
			{
				new SL_Damage
				{
					Type = (Types)5,
					Damage = 15f
				}
			};
			val.DamageResistanceBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.HealthAbsorbRatio = 0f;
			val.ManaAbsorbRatio = 0f;
			val.StaminaAbsorbRatio = 0f;
			val.Indestructible = false;
			val.TrackDamageRatio = -1f;
			val.GlobalStatusResistance = 0f;
			SL_EnchantmentRecipe val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
		}
	}
	public class SoulWithin
	{
		public const string ItemName = "Soul Within";

		public const int EnchantID = 2501061;

		public static void MakeEnchant()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Expected O, but got Unknown
			//IL_01e8: 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_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Expected O, but got Unknown
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Expected O, but got Unknown
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Expected O, but got Unknown
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Expected O, but got Unknown
			SL_EnchantmentRecipe val = new SL_EnchantmentRecipe();
			val.Name = "Soul Within";
			val.Description = "Souls within protect against elemental damage.";
			val.EnchantmentID = 2501061;
			val.IncenseItemID = 2501062;
			val.PillarDatas = (PillarData[])(object)new PillarData[4]
			{
				new PillarData
				{
					Direction = (Directions)0,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)1,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)3,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)2,
					IsFar = false
				}
			};
			val.CompatibleEquipment = new EquipmentData
			{
				RequiredTag = "Equipment",
				Equipments = (IngredientData[])(object)new IngredientData[1]
				{
					new IngredientData
					{
						SelectorType = (IngredientTypes)0,
						SelectorValue = TinyTagManager.GetOrMakeTag("SoulWithinCompatibleTag").TagName
					}
				}
			};
			val.TimeOfDay = (Vector2[])(object)new Vector2[0];
			val.Areas = (AreaEnum[])(object)new AreaEnum[1] { (AreaEnum)605 };
			val.Temperature = (TemperatureSteps[])(object)new TemperatureSteps[0];
			val.WindAltarActivated = false;
			val.IsEnchantingGuildRecipe = false;
			val.EnchantTime = 5f;
			val.Effects = (SL_EffectTransform[])(object)new SL_EffectTransform[0];
			val.AddedDamages = (AdditionalDamage[])(object)new AdditionalDamage[0];
			val.StatModifications = (StatModification[])(object)new StatModification[1]
			{
				new StatModification
				{
					Stat = (Stat)12,
					Type = (BonusType)1,
					Value = -20f
				}
			};
			val.FlatDamageAdded = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageModifierBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageResistanceBonus = (SL_Damage[])(object)new SL_Damage[5]
			{
				new SL_Damage
				{
					Type = (Types)1,
					Damage = 20f
				},
				new SL_Damage
				{
					Type = (Types)3,
					Damage = 10f
				},
				new SL_Damage
				{
					Type = (Types)2,
					Damage = 10f
				},
				new SL_Damage
				{
					Type = (Types)5,
					Damage = 10f
				},
				new SL_Damage
				{
					Type = (Types)4,
					Damage = 10f
				}
			};
			val.HealthAbsorbRatio = 0f;
			val.ManaAbsorbRatio = 0f;
			val.StaminaAbsorbRatio = 0f;
			val.Indestructible = false;
			val.TrackDamageRatio = -1f;
			val.GlobalStatusResistance = 0f;
			SL_EnchantmentRecipe val2 = val;
			((ContentTemplate)val2).ApplyTemplate();
		}
	}
	public class Footwork
	{
		public const string ItemName = "Footwork";

		public const int EnchantID = 2501057;

		public static void MakeEnchant()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			SL_EnchantmentRecipe val = new SL_EnchantmentRecipe();
			val.Name = "Footwork";
			val.Description = "Increases the scaling of miscellaneous skills and effects.";
			val.EnchantmentID = 2501057;
			val.IncenseItemID = 6000200;
			val.PillarDatas = (PillarData[])(object)new PillarData[2]
			{
				new PillarData
				{
					Direction = (Directions)0,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)1,
					IsFar = true
				}
			};
			val.CompatibleEquipment = new EquipmentData
			{
				RequiredTag = "Equipment",
				Equipments = (IngredientData[])(object)new IngredientData[1]
				{
					new IngredientData
					{
						SelectorType = (IngredientTypes)0,
						SelectorValue = TinyTagManager.GetOrMakeTag("FootworkCompatibleTag").TagName
					}
				}
			};
			val.TimeOfDay = (Vector2[])(object)new Vector2[0];
			val.Areas = (AreaEnum[])(object)new AreaEnum[0];
			val.Temperature = (TemperatureSteps[])(object)new TemperatureSteps[0];
			val.WindAltarActivated = false;
			val.IsEnchantingGuildRecipe = false;
			val.EnchantTime = 5f;
			val.Effects = (SL_EffectTransform[])(object)new SL_EffectTransform[0];
			val.AddedDamages = (AdditionalDamage[])(object)new AdditionalDamage[0];
			val.StatModifications = (StatModification[])(object)new StatModification[0];
			val.FlatDamageAdded = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageModifierBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageResistanceBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.HealthAbsorbRatio = 0f;
			val.ManaAbsorbRatio = 0f;
			val.StaminaAbsorbRatio = 0f;
			val.Indestructible = false;
			val.TrackDamageRatio = -1f;
			val.GlobalStatusResistance = 0f;
			SL_EnchantmentRecipe val2 = val;
			((ContentTemplate)val2).ApplyTemplate();
		}
	}
	public class Expertise
	{
		public const string ItemName = "Expertise";

		public const int EnchantID = 2501056;

		public static void MakeEnchant()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			SL_EnchantmentRecipe val = new SL_EnchantmentRecipe();
			val.Name = "Expertise";
			val.Description = "Increases attack speed by 0.1 and increases the scaling of miscellaneous skills and effects.";
			val.EnchantmentID = 2501056;
			val.IncenseItemID = 6000180;
			val.PillarDatas = (PillarData[])(object)new PillarData[4]
			{
				new PillarData
				{
					Direction = (Directions)0,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)1,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)2,
					IsFar = true
				},
				new PillarData
				{
					Direction = (Directions)3,
					IsFar = true
				}
			};
			val.CompatibleEquipment = new EquipmentData
			{
				RequiredTag = "Weapon",
				Equipments = (IngredientData[])(object)new IngredientData[1]
				{
					new IngredientData
					{
						SelectorType = (IngredientTypes)0,
						SelectorValue = TinyTagManager.GetOrMakeTag("ExpertiseCompatibleTag").TagName
					}
				}
			};
			val.TimeOfDay = (Vector2[])(object)new Vector2[0];
			val.Areas = (AreaEnum[])(object)new AreaEnum[0];
			val.Temperature = (TemperatureSteps[])(object)new TemperatureSteps[0];
			val.WindAltarActivated = false;
			val.IsEnchantingGuildRecipe = false;
			val.EnchantTime = 5f;
			val.Effects = (SL_EffectTransform[])(object)new SL_EffectTransform[0];
			val.AddedDamages = (AdditionalDamage[])(object)new AdditionalDamage[0];
			val.StatModifications = (StatModification[])(object)new StatModification[1]
			{
				new StatModification
				{
					Stat = (Stat)6,
					Value = 0.1f,
					Type = (BonusType)1
				}
			};
			val.FlatDamageAdded = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageModifierBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageResistanceBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.HealthAbsorbRatio = 0f;
			val.ManaAbsorbRatio = 0f;
			val.StaminaAbsorbRatio = 0f;
			val.Indestructible = false;
			val.TrackDamageRatio = -1f;
			val.GlobalStatusResistance = 0f;
			SL_EnchantmentRecipe val2 = val;
			((ContentTemplate)val2).ApplyTemplate();
		}
	}
	public class Lingering
	{
		public const string ItemName = "Lingering";

		public const int EnchantID = 2502517;

		public static void MakeEnchant()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			SL_EnchantmentRecipe val = new SL_EnchantmentRecipe();
			val.Name = "Lingering";
			val.Description = "Increases the duration of weapon infusions by 10 seconds.";
			val.EnchantmentID = 2502517;
			val.IncenseItemID = 6000250;
			val.PillarDatas = (PillarData[])(object)new PillarData[2]
			{
				new PillarData
				{
					Direction = (Directions)2,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)3,
					IsFar = true
				}
			};
			val.CompatibleEquipment = new EquipmentData
			{
				RequiredTag = "Weapon",
				Equipments = (IngredientData[])(object)new IngredientData[1]
				{
					new IngredientData
					{
						SelectorType = (IngredientTypes)0,
						SelectorValue = TinyTagManager.GetOrMakeTag("LingeringEligible").TagName
					}
				}
			};
			val.TimeOfDay = (Vector2[])(object)new Vector2[0];
			val.Areas = (AreaEnum[])(object)new AreaEnum[1] { (AreaEnum)506 };
			val.Temperature = (TemperatureSteps[])(object)new TemperatureSteps[0];
			val.WindAltarActivated = false;
			val.IsEnchantingGuildRecipe = false;
			val.EnchantTime = 5f;
			val.Effects = (SL_EffectTransform[])(object)new SL_EffectTransform[0];
			val.AddedDamages = (AdditionalDamage[])(object)new AdditionalDamage[0];
			val.StatModifications = (StatModification[])(object)new StatModification[0];
			val.FlatDamageAdded = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageModifierBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageResistanceBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.HealthAbsorbRatio = 0f;
			val.ManaAbsorbRatio = 0f;
			val.StaminaAbsorbRatio = 0f;
			val.Indestructible = false;
			val.TrackDamageRatio = -1f;
			val.GlobalStatusResistance = 0f;
			SL_EnchantmentRecipe val2 = val;
			((ContentTemplate)val2).ApplyTemplate();
		}
	}
	public class Doomsayer
	{
		public const string ItemName = "Doomsayer";

		public const int EnchantID = 2502515;

		public static void MakeEnchant()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			SL_EnchantmentRecipe val = new SL_EnchantmentRecipe();
			val.Name = "Doomsayer";
			val.Description = "Has a small chance to inflict and spread Impending Doom among your foes.";
			val.EnchantmentID = 2502515;
			val.IncenseItemID = 6000230;
			val.PillarDatas = (PillarData[])(object)new PillarData[2]
			{
				new PillarData
				{
					Direction = (Directions)0,
					IsFar = false
				},
				new PillarData
				{
					Direction = (Directions)1,
					IsFar = false
				}
			};
			val.CompatibleEquipment = new EquipmentData
			{
				RequiredTag = "Weapon",
				Equipments = (IngredientData[])(object)new IngredientData[1]
				{
					new IngredientData
					{
						SelectorType = (IngredientTypes)0,
						SelectorValue = TinyTagManager.GetOrMakeTag("Holy").TagName
					}
				}
			};
			val.TimeOfDay = (Vector2[])(object)new Vector2[0];
			val.Areas = (AreaEnum[])(object)new AreaEnum[1] { (AreaEnum)207 };
			val.Temperature = (TemperatureSteps[])(object)new TemperatureSteps[0];
			val.WindAltarActivated = false;
			val.IsEnchantingGuildRecipe = false;
			val.EnchantTime = 5f;
			val.Effects = (SL_EffectTransform[])(object)new SL_EffectTransform[0];
			val.AddedDamages = (AdditionalDamage[])(object)new AdditionalDamage[0];
			val.StatModifications = (StatModification[])(object)new StatModification[0];
			val.FlatDamageAdded = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageModifierBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.DamageResistanceBonus = (SL_Damage[])(object)new SL_Damage[0];
			val.HealthAbsorbRatio = 0f;
			val.ManaAbsorbRatio = 0f;
			val.StaminaAbsorbRatio = 0f;
			val.Indestructible = false;
			val.TrackDamageRatio = -1f;
			val.GlobalStatusResistance = 0f;
			SL_EnchantmentRecipe val2 = val;
			((ContentTemplate)val2).ApplyTemplate();
		}

		public static void MakeEnchantEffect()
		{
			Enchantment enchantmentPrefab = ResourcesPrefabManager.Instance.GetEnchantmentPrefab(2502515);
			StatusEffect statusEffectPrefab = ResourcesPrefabManager.Instance.GetStatusEffectPrefab("ImpendingDoom");
			if (statusEffectPrefab != null)
			{
				AddThenSpreadStatus val = ((Component)TinyGameObjectManager.GetOrMake(((Component)enchantmentPrefab).transform, "HitEffects", true, true)).gameObject.AddComponent<AddThenSpreadStatus>();
				((AddStatusEffect)val).Status = statusEffectPrefab;
				val.Range = 3f;
				((AddStatusEffect)val).BaseChancesToContract = 20;
			}
			Console.WriteLine("created doomsayer enchant");
		}
	}
	public class OldDesertTunic
	{
		public const string SubfolderName = "OldDesertTunic";

		public const string ItemName = "Old Desert Tunic";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: 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_0041: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Name = "Old Desert Tunic";
			((SL_Item)val).Target_ItemID = 3000200;
			((SL_Item)val).New_ItemID = 2501069;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)1;
			((SL_Item)val).Description = "The color of this tunic is lost to time.";
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 550;
			((SL_ItemStats)val2).RawWeight = 4f;
			((SL_ItemStats)val2).MaxDurability = 420;
			val2.Damage_Resistance = new float[9] { 7f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
			val2.Impact_Resistance = 10f;
			val2.Damage_Protection = 0f;
			val2.Stamina_Use_Penalty = -10f;
			val2.Mana_Use_Modifier = -10f;
			val2.Movement_Penalty = -5f;
			val2.Pouch_Bonus = 0f;
			val2.Cold_Protection = 0f;
			val2.Heat_Protection = 20f;
			val2.Corruption_Protection = 0f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			val.VisualDetectabilityAdd = -6f;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "OldDesertTunic";
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
			TinyItemManager.SetLegacyResult(3000200, ((SL_Item)val3).New_ItemID);
			return itemPrefab;
		}
	}
	public class GnarledStaff
	{
		public const string SubfolderName = "GnarledStaff";

		public const string ItemName = "Gnarled Staff";

		public static Item MakeItem()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Expected O, but got Unknown
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Expected O, but got Unknown
			float[] array = new float[4] { 5.5f, 40f, 1f, 5f };
			SL_Weapon val = new SL_Weapon();
			((SL_Item)val).Name = "Gnarled Staff";
			((SL_Item)val).Target_ItemID = 5110000;
			((SL_Item)val).New_ItemID = 2501067;
			((SL_Item)val).Description = "";
			((SL_Item)val).Tags = TinyTagManager.GetOrMakeTags(new string[4] { "Weapon", "Item", "StaffOffHand", "FlameOfAnorCompatibleTag" });
			((SL_Item)val).StatsHolder = (SL_ItemStats)new SL_WeaponStats
			{
				BaseValue = 10,
				RawWeight = 3f,
				MaxDurability = 350,
				AttackSpeed = array[2],
				BaseDamage = new List<SL_Damage>
				{
					new SL_Damage
					{
						Damage = array[3],
						Type = (Types)0
					}
				},
				Impact = array[1],
				AutoGenerateAttackData = true,
				StamCost = array[0]
			};
			SL_EffectTransform[] array2 = new SL_EffectTransform[1];
			SL_EffectTransform val2 = new SL_EffectTransform();
			val2.TransformName = "HitEffects";
			val2.Effects = (SL_Effect[])(object)new SL_Effect[0];
			array2[0] = val2;
			((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array2;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "GnarledStaff";
			((SL_Item)val).ItemVisuals = new SL_ItemVisual
			{
				Prefab_Name = "gnarled_staff_Prefab",
				Prefab_AssetBundle = "gnarled_staff",
				Prefab_SLPack = CrusadersEquipment.ModFolderName,
				PositionOffset = new Vector3(0f, 0f, 0f)
			};
			SL_Weapon val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
		}
	}
	public class GoldRing
	{
		public const string SubfolderName = "GoldRing";

		public const string ItemName = "Gold Ring";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: 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_0041: Expected O, but got Unknown
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Expected O, but got Unknown
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Name = "Gold Ring";
			((SL_Item)val).Target_ItemID = 5100500;
			((SL_Item)val).New_ItemID = 2501059;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)2;
			((SL_Item)val).Description = "";
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 250;
			((SL_ItemStats)val2).RawWeight = 0.1f;
			((SL_ItemStats)val2).MaxDurability = -1;
			val2.Damage_Resistance = new float[9];
			val2.Corruption_Protection = 0f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			((SL_Item)val).BehaviorOnNoDurability = (BehaviorOnNoDurabilityType)2;
			((SL_Item)val).RepairedInRest = false;
			((SL_Item)val).Tags = TinyTagManager.GetOrMakeTags(new string[5] { "HandsFreeTag", "Item", "Equipment", "Ring", "SoulWithinCompatibleTag" });
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "GoldRing";
			((SL_Item)val).ItemVisuals = new SL_ItemVisual
			{
				Prefab_Name = "gold_ring_Prefab",
				Prefab_AssetBundle = "gold_ring",
				Prefab_SLPack = CrusadersEquipment.ModFolderName,
				Rotation = new Vector3(0f, 0f, 90f),
				PositionOffset = new Vector3(-0.065f, 0.03f, -0.06f)
			};
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
			Equipment val4 = (Equipment)(object)((itemPrefab is Equipment) ? itemPrefab : null);
			val4.IKType = (IKMode)0;
			return (Item)(object)val4;
		}

		public static Item MakeRecipe()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			string text = UID.op_Implicit(TinyUIDManager.MakeUID("Gold Ring", "com.ehaugw.crusadersequipment", "Recipe"));
			((ContentTemplate)new SL_Recipe
			{
				StationType = (CraftingType)0,
				Results = new List<ItemQty>
				{
					new ItemQty
					{
						Quantity = 1,
						ItemID = 2501059
					}
				},
				Ingredients = new List<Ingredient>
				{
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 6300030
					}
				},
				UID = text
			}).ApplyTemplate();
			SL_RecipeItem val = new SL_RecipeItem
			{
				Name = "Crafting: Gold Ring",
				Target_ItemID = 5700024,
				New_ItemID = 2501060,
				EffectBehaviour = (EditBehaviours)1,
				RecipeUID = text
			};
			((ContentTemplate)val).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID);
		}
	}
	public class NobleMask
	{
		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Target_ItemID = 3100431;
			((SL_Item)val).New_ItemID = -1;
			((SL_Item)val).Description = "Fully prevents Plague";
			SL_EffectTransform[] array = new SL_EffectTransform[1];
			SL_EffectTransform val2 = new SL_EffectTransform();
			val2.TransformName = "Effect";
			val2.Effects = (SL_Effect[])(object)new SL_Effect[1] { (SL_Effect)new SL_AffectStatusEffectBuildUpResistance
			{
				Duration = -1f,
				Value = 9999f,
				StatusEffectIdentifier = "Plague"
			} };
			array[0] = val2;
			((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array;
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).Target_ItemID);
		}
	}
	public class PathfinderMask
	{
		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Target_ItemID = 3000225;
			((SL_Item)val).New_ItemID = -1;
			((SL_Item)val).Description = "Fully prevents Plague";
			SL_EffectTransform[] array = new SL_EffectTransform[1];
			SL_EffectTransform val2 = new SL_EffectTransform();
			val2.TransformName = "Effect";
			val2.Effects = (SL_Effect[])(object)new SL_Effect[1] { (SL_Effect)new SL_AffectStatusEffectBuildUpResistance
			{
				Duration = -1f,
				Value = 9999f,
				StatusEffectIdentifier = "Plague"
			} };
			array[0] = val2;
			((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array;
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).Target_ItemID);
		}
	}
	public class AshFilterMask
	{
		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Target_ItemID = 3000221;
			((SL_Item)val).New_ItemID = -1;
			((SL_Item)val).Description = "Fully prevents Plague";
			SL_EffectTransform[] array = new SL_EffectTransform[1];
			SL_EffectTransform val2 = new SL_EffectTransform();
			val2.TransformName = "Effect";
			val2.Effects = (SL_Effect[])(object)new SL_Effect[1] { (SL_Effect)new SL_AffectStatusEffectBuildUpResistance
			{
				Duration = -1f,
				Value = 9999f,
				StatusEffectIdentifier = "Plague"
			} };
			array[0] = val2;
			((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array;
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).Target_ItemID);
		}
	}
	public class RangerBoots
	{
		public const string SubfolderName = "RangerBoots";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: 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_0041: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Name = "Ranger's Boots";
			((SL_Item)val).Target_ItemID = 3000232;
			((SL_Item)val).New_ItemID = 2501050;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)1;
			((SL_Item)val).Description = "";
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 250;
			((SL_ItemStats)val2).RawWeight = 1f;
			((SL_ItemStats)val2).MaxDurability = 200;
			val2.Damage_Resistance = new float[9] { 7f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
			val2.Impact_Resistance = 6f;
			val2.Damage_Protection = 1f;
			val2.Stamina_Use_Penalty = 0f;
			val2.Mana_Use_Modifier = 0f;
			val2.Movement_Penalty = -15f;
			val2.Pouch_Bonus = 2f;
			val2.Heat_Protection = 5f;
			val2.Cold_Protection = 5f;
			val2.Corruption_Protection = 5f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			val.VisualDetectabilityAdd = -3f;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "RangerBoots";
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
			CustomItems.SetItemTags(itemPrefab, TinyTagManager.GetSafeTags(new string[2] { "WeaponProficiencyTag1", "FootworkCompatibleTag" }), false);
			return itemPrefab;
		}

		public static Item MakeRecipes()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e3: Expected O, but got Unknown
			string text = "com.ehaugw.crusadersequipment." + "RangerBoots".ToLower() + "recipe";
			((ContentTemplate)new SL_Recipe
			{
				StationType = (CraftingType)2,
				Results = new List<ItemQty>
				{
					new ItemQty
					{
						Quantity = 1,
						ItemID = 2501050
					}
				},
				Ingredients = new List<Ingredient>
				{
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 3000232
					},
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 6600070
					}
				},
				UID = text
			}).ApplyTemplate();
			SL_RecipeItem val = new SL_RecipeItem
			{
				Name = "Crafting: Ranger's Boots",
				Target_ItemID = 5700024,
				New_ItemID = 2501051,
				EffectBehaviour = (EditBehaviours)1,
				RecipeUID = text
			};
			((ContentTemplate)val).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID);
		}
	}
	public class CharredHood
	{
		public const string SubfolderName = "CharredHood";

		public const string ItemName = "Charred Hood";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: 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_0041: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Name = "Charred Hood";
			((SL_Item)val).Target_ItemID = 3000133;
			((SL_Item)val).New_ItemID = 2501064;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)1;
			((SL_Item)val).Description = "";
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 250;
			((SL_ItemStats)val2).RawWeight = 1f;
			((SL_ItemStats)val2).MaxDurability = 300;
			val2.Damage_Resistance = new float[9] { 8f, 0f, 15f, 15f, 15f, 0f, 0f, 0f, 0f };
			val2.Impact_Resistance = 3f;
			val2.Damage_Protection = 1f;
			val2.Stamina_Use_Penalty = 0f;
			val2.Mana_Use_Modifier = 15f;
			val2.Movement_Penalty = 0f;
			val2.Pouch_Bonus = 0f;
			val2.Cold_Protection = 0f;
			val2.Heat_Protection = 0f;
			val2.Corruption_Protection = 0f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			val.VisualDetectabilityAdd = -6f;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "CharredHood";
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
			CustomItems.SetItemTags(itemPrefab, TinyTagManager.GetSafeTags(new string[1] { "WeaponProficiencyTag1" }), false);
			return itemPrefab;
		}

		public static Item MakeRecipes()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e3: Expected O, but got Unknown
			string text = "com.ehaugw.crusadersequipment." + "CharredHood".ToLower() + "recipe";
			((ContentTemplate)new SL_Recipe
			{
				StationType = (CraftingType)2,
				Results = new List<ItemQty>
				{
					new ItemQty
					{
						Quantity = 1,
						ItemID = 2501064
					}
				},
				Ingredients = new List<Ingredient>
				{
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 3000063
					},
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 6600200
					}
				},
				UID = text
			}).ApplyTemplate();
			SL_RecipeItem val = new SL_RecipeItem
			{
				Name = "Crafting: Charred Hood",
				Target_ItemID = 5700024,
				New_ItemID = 2501065,
				EffectBehaviour = (EditBehaviours)1,
				RecipeUID = text
			};
			((ContentTemplate)val).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID);
		}
	}
	public class SoulIncense
	{
		public const string SubfolderName = "SoulIncense";

		public const string ItemName = "Soul Incense";

		public static Item MakeItem()
		{
			//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_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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: Expected O, but got Unknown
			SL_Item val = new SL_Item
			{
				Name = "Soul Incense",
				Target_ItemID = 6000200,
				New_ItemID = 2501062,
				EffectBehaviour = (EditBehaviours)1,
				Description = "A special incense made by extracting souls from a curious relic.",
				SLPackName = CrusadersEquipment.ModFolderName,
				SubfolderName = "SoulIncense"
			};
			((ContentTemplate)val).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(val.New_ItemID);
		}

		public static Item MakeRecipes()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Expected O, but got Unknown
			string text = "com.ehaugw.crusadersequipment." + "SoulIncense".ToLower() + "recipe";
			((ContentTemplate)new SL_Recipe
			{
				StationType = (CraftingType)0,
				Results = new List<ItemQty>
				{
					new ItemQty
					{
						Quantity = 4,
						ItemID = 2501062
					}
				},
				Ingredients = new List<Ingredient>
				{
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 5100080
					},
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 4000360
					},
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 4000360
					}
				},
				UID = text
			}).ApplyTemplate();
			SL_RecipeItem val = new SL_RecipeItem
			{
				Name = "Alchemy: Soul Incense",
				Target_ItemID = 5700076,
				New_ItemID = 2501063,
				EffectBehaviour = (EditBehaviours)1,
				RecipeUID = text
			};
			((ContentTemplate)val).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID);
		}
	}
	public class WolfRangerArmor
	{
		public const string SubfolderName = "WolfRangerArmor";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: 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_0041: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Name = "Wolf Ranger's Armor";
			((SL_Item)val).Target_ItemID = 3100220;
			((SL_Item)val).New_ItemID = 2501048;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)1;
			((SL_Item)val).Description = "";
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 500;
			((SL_ItemStats)val2).RawWeight = 12f;
			((SL_ItemStats)val2).MaxDurability = 250;
			val2.Damage_Resistance = new float[9] { 20f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
			val2.Impact_Resistance = 14f;
			val2.Damage_Protection = 3f;
			val2.Stamina_Use_Penalty = 0f;
			val2.Mana_Use_Modifier = 10f;
			val2.Movement_Penalty = 0f;
			val2.Pouch_Bonus = 6f;
			val2.Cold_Protection = 8f;
			val2.Corruption_Protection = 15f;
			val2.Health_Regen = 0.1f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			val.VisualDetectabilityAdd = -6f;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "WolfRangerArmor";
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
			CustomItems.SetItemTags(itemPrefab, TinyTagManager.GetSafeTags(new string[1] { "WeaponProficiencyTag2" }), false);
			TinyItemManager.AddEnchantingOption(((SL_Item)val3).New_ItemID, 65);
			return itemPrefab;
		}

		public static Item MakeRecipes()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e3: Expected O, but got Unknown
			string text = "com.ehaugw.crusadersequipment." + "WolfRangerArmor".ToLower() + "recipe";
			((ContentTemplate)new SL_Recipe
			{
				StationType = (CraftingType)2,
				Results = new List<ItemQty>
				{
					new ItemQty
					{
						Quantity = 1,
						ItemID = 2501048
					}
				},
				Ingredients = new List<Ingredient>
				{
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 3100220
					},
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 6600070
					}
				},
				UID = text
			}).ApplyTemplate();
			SL_RecipeItem val = new SL_RecipeItem
			{
				Name = "Crafting: Wolf Ranger Armor",
				Target_ItemID = 5700024,
				New_ItemID = 2501049,
				EffectBehaviour = (EditBehaviours)1,
				RecipeUID = text
			};
			((ContentTemplate)val).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID);
		}
	}
	public class RangersHood
	{
		public const string SubfolderName = "RangersHood";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: 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_0041: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Name = "Ranger's Hood";
			((SL_Item)val).Target_ItemID = 3000133;
			((SL_Item)val).New_ItemID = 2501046;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)1;
			((SL_Item)val).Description = "";
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 250;
			((SL_ItemStats)val2).RawWeight = 1f;
			((SL_ItemStats)val2).MaxDurability = 300;
			val2.Damage_Resistance = new float[9] { 8f, 0f, 20f, 0f, 20f, 20f, 0f, 0f, 0f };
			val2.Impact_Resistance = 3f;
			val2.Damage_Protection = 1f;
			val2.Stamina_Use_Penalty = 0f;
			val2.Mana_Use_Modifier = 10f;
			val2.Movement_Penalty = 0f;
			val2.Pouch_Bonus = 0f;
			val2.Cold_Protection = 5f;
			val2.Heat_Protection = 0f;
			val2.Corruption_Protection = 15f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			val.VisualDetectabilityAdd = -6f;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "RangersHood";
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
			CustomItems.SetItemTags(itemPrefab, TinyTagManager.GetSafeTags(new string[1] { "WeaponProficiencyTag1" }), false);
			return itemPrefab;
		}

		public static Item MakeRecipes()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e3: Expected O, but got Unknown
			string text = "com.ehaugw.crusadersequipment." + "RangersHood".ToLower() + "recipe";
			((ContentTemplate)new SL_Recipe
			{
				StationType = (CraftingType)2,
				Results = new List<ItemQty>
				{
					new ItemQty
					{
						Quantity = 1,
						ItemID = 2501046
					}
				},
				Ingredients = new List<Ingredient>
				{
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 3000063
					},
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 6600070
					}
				},
				UID = text
			}).ApplyTemplate();
			SL_RecipeItem val = new SL_RecipeItem
			{
				Name = "Crafting: Ranger's Hood",
				Target_ItemID = 5700024,
				New_ItemID = 2501047,
				EffectBehaviour = (EditBehaviours)1,
				RecipeUID = text
			};
			((ContentTemplate)val).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID);
		}
	}
	public class FaraamHelmet
	{
		public const string SubfolderName = "FaraamHelmet";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: 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_0041: Expected O, but got Unknown
			SL_Armor val = new SL_Armor();
			((SL_Item)val).Name = "Faraam Helmet";
			((SL_Item)val).Target_ItemID = 3000133;
			((SL_Item)val).New_ItemID = 2501045;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)1;
			((SL_Item)val).Description = "";
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 1000;
			((SL_ItemStats)val2).RawWeight = 8f;
			((SL_ItemStats)val2).MaxDurability = 300;
			val2.Damage_Resistance = new float[9] { 15f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
			val2.Impact_Resistance = 10f;
			val2.Damage_Protection = 3f;
			val2.BarrierProtection = 3f;
			val2.Stamina_Use_Penalty = 4f;
			val2.Mana_Use_Modifier = 15f;
			val2.Movement_Penalty = 9f;
			val2.Pouch_Bonus = 0f;
			val2.Heat_Protection = 0f;
			val2.Cold_Protection = 0f;
			val2.Corruption_Protection = 5f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "FaraamHelmet";
			val.Class = (ArmorClass)3;
			SL_Armor val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
		}
	}
	public class FaraamLongsword
	{
		public const string SubfolderName = "FaraamLongsword";

		public const string ItemName = "Faraam Longsword";

		public static Item MakeItem()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Expected O, but got Unknown
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Expected O, but got Unknown
			float[] array = new float[4] { 5.5f, 35f, 0.8f, 57f };
			SL_Weapon val = new SL_Weapon();
			((SL_Item)val).Name = "Faraam Longsword";
			((SL_Item)val).Target_ItemID = 2000010;
			((SL_Item)val).New_ItemID = 2501044;
			((SL_Item)val).Description = "";
			((SL_Item)val).Tags = TinyTagManager.GetOrMakeTags(new string[6] { "MaulShoveTag", "Bastard", "Blade", "Weapon", "Item", "ExpertiseCompatibleTag" });
			((SL_Item)val).StatsHolder = (SL_ItemStats)new SL_WeaponStats
			{
				BaseValue = 2000,
				RawWeight = 8f,
				MaxDurability = 750,
				AttackSpeed = array[2],
				BaseDamage = new List<SL_Damage>
				{
					new SL_Damage
					{
						Damage = array[3],
						Type = (Types)0
					}
				},
				Impact = array[1],
				AutoGenerateAttackData = true,
				StamCost = array[0]
			};
			SL_EffectTransform[] array2 = new SL_EffectTransform[1];
			SL_EffectTransform val2 = new SL_EffectTransform();
			val2.TransformName = "HitEffects";
			val2.Effects = (SL_Effect[])(object)new SL_Effect[0];
			array2[0] = val2;
			((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array2;
			val.SwingSound = (SwingSoundWeapon)3;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "FaraamLongsword";
			((SL_Item)val).ItemVisuals = new SL_ItemVisual
			{
				Prefab_Name = "faraam_longsword_Prefab",
				Prefab_AssetBundle = "faraam_longsword",
				Prefab_SLPack = CrusadersEquipment.ModFolderName,
				PositionOffset = new Vector3(-0.03f, 0f, 0f)
			};
			SL_Weapon val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
		}
	}
	public class HeavyPlateArmor
	{
		public const string SubfolderName = "HeavyPlateArmor";

		public static Item MakeItem()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			SL_Equipment val = new SL_Equipment();
			((SL_Item)val).Name = "Heavy Plate Armor";
			((SL_Item)val).Target_ItemID = 3100003;
			((SL_Item)val).New_ItemID = 2502514;
			((SL_Item)val).EffectBehaviour = (EditBehaviours)1;
			((SL_Item)val).Description = "Heavy armor that adds weight to your weapon swings, passed down by your ancestors.";
			((SL_Item)val).Tags = TinyTagManager.GetOrMakeTags(new string[1] { "Armor" });
			SL_EquipmentStats val2 = new SL_EquipmentStats();
			((SL_ItemStats)val2).BaseValue = 700;
			((SL_ItemStats)val2).RawWeight = 18f;
			((SL_ItemStats)val2).MaxDurability = 530;
			val2.Damage_Resistance = new float[9] { 28f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
			val2.Damage_Bonus = new float[9] { 5f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
			val2.Impact_Resistance = 26f;
			val2.Impact_Bonus = 5f;
			val2.Damage_Protection = 5f;
			val2.Stamina_Use_Penalty = 6f;
			val2.Mana_Use_Modifier = 0f;
			val2.Movement_Penalty = 10f;
			val2.Pouch_Bonus = 0f;
			val2.Heat_Protection = 0f;
			val2.Cold_Protection = -5f;
			val2.Corruption_Protection = 0f;
			((SL_Item)val).StatsHolder = (SL_ItemStats)(object)val2;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "HeavyPlateArmor";
			SL_Equipment val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			TinyItemManager.SetLegacyResult(3100003, 2502514);
			TinyItemManager.AddEnchantingOption(2502514, 56);
			return ResourcesPrefabManager.Instance.GetItemPrefab(2502514);
		}
	}
	public class CorruptedLongsword
	{
		public const string SubfolderName = "CorruptedLongsword";

		public const string ItemName = "Corrupted Longsword";

		public static Item MakeItem()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Expected O, but got Unknown
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Expected O, but got Unknown
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Expected O, but got Unknown
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			float[] array = new float[4] { 6f, 35f, 0.8f, 57f };
			SL_Weapon val = new SL_Weapon();
			((SL_Item)val).Name = "Corrupted Longsword";
			((SL_Item)val).Target_ItemID = 2000010;
			((SL_Item)val).New_ItemID = 2501026;
			((SL_Item)val).Description = "";
			((SL_Item)val).Tags = TinyTagManager.GetOrMakeTags(new string[6] { "Bastard", "Blade", "Weapon", "Item", "LingeringEligible", "MaulShoveTag" });
			((SL_Item)val).StatsHolder = (SL_ItemStats)new SL_WeaponStats
			{
				BaseValue = 2000,
				RawWeight = 9f,
				MaxDurability = 750,
				AttackSpeed = array[2],
				BaseDamage = new List<SL_Damage>
				{
					new SL_Damage
					{
						Damage = array[3],
						Type = (Types)0
					}
				},
				Impact = array[1],
				AutoGenerateAttackData = true,
				StamCost = array[0]
			};
			val.HealthLeechRatio = 0.02f;
			val.HealthBurnLeechRatio = 0.02f;
			SL_EffectTransform[] array2 = new SL_EffectTransform[1];
			SL_EffectTransform val2 = new SL_EffectTransform();
			val2.TransformName = "HitEffects";
			val2.Effects = (SL_Effect[])(object)new SL_Effect[0];
			array2[0] = val2;
			((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array2;
			val.SwingSound = (SwingSoundWeapon)3;
			((SL_Item)val).SLPackName = CrusadersEquipment.ModFolderName;
			((SL_Item)val).SubfolderName = "CorruptedLongsword";
			((SL_Item)val).ItemVisuals = new SL_ItemVisual
			{
				Prefab_Name = "corrupted_longsword_Prefab",
				Prefab_AssetBundle = "corrupted_longsword",
				Prefab_SLPack = CrusadersEquipment.ModFolderName,
				PositionOffset = new Vector3(-0.025f, 0f, 0f)
			};
			SL_Weapon val3 = val;
			((ContentTemplate)val3).ApplyTemplate();
			return ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID);
		}

		public static Item MakeRecipes()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Expected O, but got Unknown
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Expected O, but got Unknown
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Expected O, but got Unknown
			string text = "com.ehaugw.crusadersequipment." + "CorruptedLongsword".ToLower() + "recipe";
			((ContentTemplate)new SL_Recipe
			{
				StationType = (CraftingType)2,
				Results = new List<ItemQty>
				{
					new ItemQty
					{
						Quantity = 1,
						ItemID = 2501026
					}
				},
				Ingredients = new List<Ingredient>
				{
					new Ingredient
					{
						Type = (ActionTypes)1,
						Ingredient_ItemID = 2501038
					},
					new I

plugins/EffectSourceConditions.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using TinyHelper;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace EffectSourceConditions;

public class DynamicSkillStat : MonoBehaviour
{
	public delegate void ManaCostModifier(Skill skill, float original, ref float result);

	public float ManaCost = 0f;

	public float StaminaCost = 0f;

	public float HealthCost = 0f;

	public float Cooldown = 2f;

	public float DurabilityCost = 0f;

	public SpellCastType CastType = (SpellCastType)(-1);

	public SpellCastModifier CastModifier = (SpellCastModifier)(-1);

	public float MobileCastMovementMult = -1f;

	public int CastSheatheRequired = 0;

	public bool CastLocomotionEnabled = false;

	public static ManaCostModifier ManaCostModifiers = delegate
	{
	};

	public void SetSkillStats(Skill skill)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: 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)
		float result = ManaCost;
		ManaCostModifiers(skill, ManaCost, ref result);
		skill.ManaCost = Mathf.Round(result);
		skill.StaminaCost = StaminaCost;
		skill.HealthCost = HealthCost;
		skill.DurabilityCost = DurabilityCost;
		((Item)skill).CastSheathRequired = CastSheatheRequired;
		((Item)skill).MobileCastMovementMult = MobileCastMovementMult;
		((Item)skill).CastModifier = CastModifier;
		((Item)skill).CastLocomotionEnabled = CastLocomotionEnabled;
		if (((Item)skill).ActivateEffectAnimType != CastType)
		{
			At.SetValue<SpellCastType>(CastType, typeof(Item), (object)skill, "m_activateEffectAnimType");
		}
		if (!skill.InCooldown())
		{
			skill.Cooldown = Cooldown;
		}
	}

	public static void UnsetSkillStats(Skill skill)
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0054: Invalid comparison between Unknown and I4
		skill.ManaCost = 0f;
		skill.StaminaCost = 0f;
		skill.HealthCost = 0f;
		skill.DurabilityCost = 0f;
		((Item)skill).CastSheathRequired = 0;
		((Item)skill).MobileCastMovementMult = -1f;
		((Item)skill).CastModifier = (SpellCastModifier)0;
		((Item)skill).CastLocomotionEnabled = false;
		if ((int)((Item)skill).ActivateEffectAnimType != -1)
		{
			At.SetValue<SpellCastType>((SpellCastType)(-1), typeof(Item), (object)skill, "m_activateEffectAnimType");
		}
		if (!skill.InCooldown())
		{
			skill.Cooldown = 0f;
		}
	}

	public static void TryUpdateSkillStats(Skill skill)
	{
		DynamicSkillStat[] componentsInChildren = ((Component)skill).gameObject.GetComponentsInChildren<DynamicSkillStat>();
		if (componentsInChildren == null || componentsInChildren.Length == 0)
		{
			return;
		}
		bool flag = false;
		DynamicSkillStat[] array = componentsInChildren;
		foreach (DynamicSkillStat dynamicSkillStat in array)
		{
			Character ownerCharacter = ((EffectSynchronizer)skill).OwnerCharacter;
			if (ownerCharacter == null)
			{
				continue;
			}
			SourceCondition[] components = ((Component)dynamicSkillStat).gameObject.GetComponents<SourceCondition>();
			if (components == null)
			{
				continue;
			}
			bool flag2 = true;
			SourceCondition[] array2 = components;
			foreach (SourceCondition sourceCondition in array2)
			{
				if (!sourceCondition.CharacterHasRequirement(ownerCharacter))
				{
					flag2 = false;
				}
			}
			if (flag2 && components.Length != 0)
			{
				dynamicSkillStat.SetSkillStats(skill);
				flag = true;
			}
		}
		if (!flag)
		{
			UnsetSkillStats(skill);
		}
	}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public class Item_Description
{
	[HarmonyPrefix]
	public static void Prefix(Item __instance)
	{
		Skill val = (Skill)(object)((__instance is Skill) ? __instance : null);
		if (val != null)
		{
			DynamicSkillStat.TryUpdateSkillStats(val);
		}
	}
}
[HarmonyPatch(typeof(Skill), "HasBaseRequirements")]
public class Skill_HasBaseRequirements
{
	[HarmonyPrefix]
	public static void Prefix(Skill __instance)
	{
		DynamicSkillStat.TryUpdateSkillStats(__instance);
	}
}
[BepInPlugin("com.ehaugw.effectsourceconditions", "Effect Source Conditions", "2.8.0")]
public class EffectSourceConditions : BaseUnityPlugin
{
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class WeaponDamage_BuildDamage
	{
		[HarmonyPrefix]
		public static bool Prefix(Effect __instance, Character _targetCharacter, ref DamageList _list, ref float _knockback)
		{
			return HasSourceConditions(__instance);
		}
	}

	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class PunctualDamage_BuildDamage
	{
		[HarmonyPrefix]
		public static bool Prefix(Effect __instance, Character _targetCharacter, ref DamageList _list, ref float _knockback)
		{
			return HasSourceConditions(__instance);
		}
	}

	[HarmonyPatch(typeof(Effect), "TryTriggerConditions", new Type[]
	{
		typeof(Character),
		typeof(bool)
	})]
	public class Effect_TryTriggerConditions
	{
		[HarmonyPrefix]
		public static bool Prefix(Effect __instance, Character _affectedCharacter, bool _skipPriority)
		{
			return HasSourceConditions(__instance);
		}
	}

	public const string GUID = "com.ehaugw.effectsourceconditions";

	public const string VERSION = "2.8.0";

	public const string NAME = "Effect Source Conditions";

	public const string EFFECTS_CONTAINER_ACTIVATION = "ActivationEffects";

	public const string EFFECTS_CONTAINER = "Effects";

	public const string SOURCE_CONDITION_CONTAINER = "SourceConditions";

	public const string EFFECTS_MANUAL_CONTAINER = "ManualContainer";

	internal void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.ehaugw.effectsourceconditions");
		val.PatchAll();
	}

	public static bool HasSourceConditions(Effect __instance)
	{
		object obj;
		if (__instance == null)
		{
			obj = null;
		}
		else
		{
			Transform transform = ((Component)__instance).transform;
			if (transform == null)
			{
				obj = null;
			}
			else
			{
				Transform obj2 = transform.Find("SourceConditions");
				if (obj2 == null)
				{
					obj = null;
				}
				else
				{
					GameObject gameObject = ((Component)obj2).gameObject;
					obj = ((gameObject != null) ? gameObject.GetComponents<SourceCondition>() : null);
				}
			}
		}
		if (obj == null)
		{
			obj = new SourceCondition[0];
		}
		SourceCondition[] array = (SourceCondition[])obj;
		foreach (SourceCondition sourceCondition in array)
		{
			if (!sourceCondition.CharacterHasRequirement(__instance.SourceCharacter))
			{
				return false;
			}
		}
		return true;
	}
}
public class EffectSourceConditionChecker : EffectCondition
{
	protected override bool CheckIsValid(Character _affectedCharacter)
	{
		Transform transform = ((Component)this).transform;
		object obj;
		if (transform == null)
		{
			obj = null;
		}
		else
		{
			Transform parent = transform.parent;
			if (parent == null)
			{
				obj = null;
			}
			else
			{
				Transform parent2 = parent.parent;
				obj = ((parent2 != null) ? UnityEngineExtensions.FindAllInAllChildren(parent2, "ActivationEffects") : null);
			}
		}
		Transform[] array = (Transform[])obj;
		if (array != null)
		{
			Transform[] array2 = array;
			foreach (Transform val in array2)
			{
				bool flag = true;
				SourceCondition[] componentsInChildren = ((Component)val).GetComponentsInChildren<SourceCondition>();
				SourceCondition[] array3 = componentsInChildren;
				foreach (SourceCondition sourceCondition in array3)
				{
					if (!sourceCondition.CharacterHasRequirement(_affectedCharacter))
					{
						flag = false;
					}
				}
				if (flag && componentsInChildren.Count() > 0)
				{
					return !base.Invert;
				}
			}
		}
		return base.Invert;
	}

	public static ActivationCondition AddToSkill(Skill skill)
	{
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Expected O, but got Unknown
		Transform orMake = TinyGameObjectManager.GetOrMake(((Component)skill).transform, "AdditionalActivationConditions", true, true);
		GameObject gameObject = ((Component)TinyGameObjectManager.GetOrMake(orMake, "EffectSourceConditionChecker", true, true)).gameObject;
		ActivationCondition val = new ActivationCondition();
		EffectSourceConditionChecker condition = gameObject.AddComponent<EffectSourceConditionChecker>();
		val.Condition = (EffectCondition)(object)condition;
		At.SetValue<string>("This would have no effect.", typeof(ActivationCondition), (object)val, "m_defaultMessage");
		List<ActivationCondition> list = (At.GetValue(typeof(Skill), (object)skill, "m_additionalConditions") as ActivationCondition[])?.ToList() ?? new List<ActivationCondition>();
		list.Add(val);
		At.SetValue<ActivationCondition[]>(list.ToArray(), typeof(Skill), (object)skill, "m_additionalConditions");
		return val;
	}
}
public abstract class SourceCondition : MonoBehaviour
{
	public abstract bool CharacterHasRequirement(Character character);
}
public class SourceConditionItemInInventory : SourceCondition
{
	public int RequiredItemID;

	public int Amount = 1;

	public bool Inverted = false;

	public override bool CharacterHasRequirement(Character character)
	{
		int result;
		if (RequiredItemID != 0)
		{
			int? obj;
			if (character == null)
			{
				obj = null;
			}
			else
			{
				CharacterInventory inventory = character.Inventory;
				obj = ((inventory != null) ? new int?(inventory.ItemCount(RequiredItemID)) : null);
			}
			int? num = obj;
			result = (((num.GetValueOrDefault() > 0) ^ Inverted) ? 1 : 0);
		}
		else
		{
			result = 1;
		}
		return (byte)result != 0;
	}
}
public class SourceConditionEquipment : SourceCondition
{
	public int RequiredItemID;

	public int RequiredEnchantID;

	public bool Inverted = false;

	public override bool CharacterHasRequirement(Character character)
	{
		object obj;
		if (character == null)
		{
			obj = null;
		}
		else
		{
			CharacterInventory inventory = character.Inventory;
			obj = ((inventory != null) ? inventory.Equipment : null);
		}
		CharacterEquipment val = (CharacterEquipment)obj;
		if (val != null)
		{
			foreach (EquipmentSlot item in val.EquipmentSlots.Where((EquipmentSlot s) => (Object)(object)s != (Object)null && (Object)(object)s.EquippedItem != (Object)null))
			{
				bool flag = RequiredItemID == 0 || ((Item)item.EquippedItem).ItemID == RequiredItemID;
				bool flag2 = RequiredEnchantID == 0 || item.EquippedItem.ActiveEnchantmentIDs.Contains(RequiredEnchantID);
				if (flag && flag2)
				{
					return !Inverted;
				}
			}
		}
		return Inverted;
	}
}
public class SourceConditionCorruption : SourceCondition
{
	public float Corruption = 0f;

	public bool Inverted = false;

	public override bool CharacterHasRequirement(Character character)
	{
		float? obj;
		if (character == null)
		{
			obj = null;
		}
		else
		{
			PlayerCharacterStats playerStats = character.PlayerStats;
			obj = ((playerStats != null) ? new float?(playerStats.Corruption) : null);
		}
		float? num = obj;
		return (num.GetValueOrDefault() >= Corruption) ^ Inverted;
	}
}
public class SourceConditionMana : SourceCondition
{
	public float ManaCost = 0f;

	public bool Inverted = false;

	public override bool CharacterHasRequirement(Character character)
	{
		return (ManaCost <= 0f || character.Mana >= character.Stats.GetFinalManaConsumption((Tag[])null, ManaCost)) ^ Inverted;
	}
}
public class SourceConditionQuestLocal : SourceCondition
{
	public int[] Quests;

	public bool Inverted = false;

	public LogicType Logic = (LogicType)0;

	public override bool CharacterHasRequirement(Character character)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		return QuestRequirements.HasQuestKnowledgeLocal(character, Quests, Logic, Inverted, false);
	}
}
public class SourceConditionQuest : SourceCondition
{
	public int[] Quests;

	public bool Inverted = false;

	public LogicType Logic = (LogicType)0;

	public override bool CharacterHasRequirement(Character character)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		return QuestRequirements.HasQuestKnowledge(character, Quests, Logic, Inverted, false);
	}
}
public class SourceConditionStatusEffect : SourceCondition
{
	public string statusEffectName;

	public bool Inverted = false;

	public StatusEffect RequiredStatusEffect
	{
		get
		{
			return ResourcesPrefabManager.Instance.GetStatusEffectPrefab(statusEffectName);
		}
		set
		{
			statusEffectName = value.IdentifierName;
		}
	}

	public override bool CharacterHasRequirement(Character character)
	{
		int num;
		if (statusEffectName != null)
		{
			bool? obj;
			if (character == null)
			{
				obj = null;
			}
			else
			{
				StatusEffectManager statusEffectMngr = character.StatusEffectMngr;
				obj = ((statusEffectMngr != null) ? new bool?(statusEffectMngr.HasStatusEffect(statusEffectName)) : null);
			}
			bool? flag = obj;
			num = (flag.GetValueOrDefault() ? 1 : 0);
		}
		else
		{
			num = 0;
		}
		return (byte)((uint)num ^ (Inverted ? 1u : 0u)) != 0;
	}
}
public class SourceConditionSkill : SourceCondition
{
	public int RequiredSkillID;

	public bool Inverted = false;

	public Item RequiredSkill
	{
		get
		{
			return ResourcesPrefabManager.Instance.GetItemPrefab(RequiredSkillID);
		}
		set
		{
			RequiredSkillID = value.ItemID;
		}
	}

	public override bool CharacterHasRequirement(Character character)
	{
		int result;
		if (RequiredSkillID != 0)
		{
			bool? obj;
			if (character == null)
			{
				obj = null;
			}
			else
			{
				CharacterInventory inventory = character.Inventory;
				if (inventory == null)
				{
					obj = null;
				}
				else
				{
					CharacterSkillKnowledge skillKnowledge = inventory.SkillKnowledge;
					obj = ((skillKnowledge != null) ? new bool?(((CharacterKnowledge)skillKnowledge).IsItemLearned(RequiredSkillID)) : null);
				}
			}
			bool? flag = obj;
			result = ((flag.GetValueOrDefault() ^ Inverted) ? 1 : 0);
		}
		else
		{
			result = 1;
		}
		return (byte)result != 0;
	}
}

plugins/HolyDamageManager.dll

Decompiled 2 months ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace HolyDamageManager;

[BepInPlugin("com.ehaugw.holydamagemanager", "Holy Damage Manager", "1.0.0")]
public class HolyDamageManager : BaseUnityPlugin
{
	public const string GUID = "com.ehaugw.holydamagemanager";

	public const string VERSION = "1.0.0";

	public const string NAME = "Holy Damage Manager";

	private static Types m_holyDamageType;

	private static Tag m_holyDamageTag;

	internal void Awake()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		SetHolyType((Types)3);
		SetHolyTag(Tag.None);
	}

	public static void SetHolyType(Types type)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		m_holyDamageType = type;
	}

	public static void SetHolyTag(Tag tag)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		m_holyDamageTag = tag;
	}

	public static float BuffHolyDamageOrHealing(Character character, float value)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Expected O, but got Unknown
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		DamageList val = new DamageList(GetDamageType(), value);
		character.Stats.GetAmplifiedDamage((IList<Tag>)(object)new Tag[1] { GetDamageTag() }, ref val);
		return val.TotalDamage;
	}

	public static Tag GetDamageTag()
	{
		//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_0009: Unknown result type (might be due to invalid IL or missing references)
		return m_holyDamageTag;
	}

	public static Types GetDamageType()
	{
		//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_0009: Unknown result type (might be due to invalid IL or missing references)
		return m_holyDamageType;
	}

	public static int GetHolyIndex()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected I4, but got Unknown
		return (int)GetDamageType();
	}

	public static float[] GetHolyDamageBonusArray(float damageBonus)
	{
		float[] array = new float[9];
		array[GetHolyIndex()] = damageBonus;
		return array;
	}
}

plugins/ImpendingDoom.dll

Decompiled 2 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 BepInEx;
using HarmonyLib;
using HolyDamageManager;
using SideLoader;
using TinyHelper;
using TinyHelper.Effects;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace ImpendingDoom;

public class WillDieFromImpendingDoom : EffectCondition
{
	protected override bool CheckIsValid(Character _affectedCharacter)
	{
		StatusEffect statusEffectOfName = _affectedCharacter.StatusEffectMngr.GetStatusEffectOfName(ImpendingDoomMod.Instance.impendingDoomInstance.IdentifierName);
		if (statusEffectOfName != null)
		{
			float num = ImpendingDoom.RemainingDamage(_affectedCharacter, statusEffectOfName);
			if (num >= _affectedCharacter.Health && num >= 40f)
			{
				return true;
			}
		}
		return false;
	}
}
public class EffectInitializer
{
	public static StatusEffect MakeImpendingDoomPrefab()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		string impendingDoomEffectName = ModTheme.ImpendingDoomEffectName;
		string[] obj = new string[5] { "Take 1 ", null, null, null, null };
		Types damageType = HolyDamageManager.GetDamageType();
		obj[1] = ((object)(Types)(ref damageType)).ToString();
		obj[2] = " over time and be smitten by thunder if you build up too much ";
		obj[3] = ModTheme.ImpendingDoomEffectName;
		obj[4] = ".";
		string text = string.Concat(obj);
		string text2 = Directory.GetParent(typeof(ImpendingDoomMod).Assembly.Location).ToString();
		StatusEffect val = TinyEffectManager.MakeStatusEffectPrefab("ImpendingDoom", "ImpendingDoom", text, 15f, 1f, (StackBehaviors)1, "HolyBlaze", true, (string)null, (UID?)null, "com.ehaugw.impendingdoom", "\\SideLoader\\Texture2D\\impendingDoomIcon.png", impendingDoomEffectName, text2);
		EffectSignature statusEffectSignature = val.StatusEffectSignature;
		Transform transform = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)statusEffectSignature).transform).transform;
		ImpendingDoom impendingDoom = ((Component)transform).gameObject.AddComponent<ImpendingDoom>();
		((Effect)impendingDoom).UseOnce = false;
		transform = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)statusEffectSignature).transform).transform;
		WillDieFromImpendingDoom willDieFromImpendingDoom = ((Component)transform).gameObject.AddComponent<WillDieFromImpendingDoom>();
		ShootBlastFromEffect val2 = ((Component)transform).gameObject.AddComponent<ShootBlastFromEffect>();
		((Effect)val2).UseOnce = true;
		((Behaviour)val2).enabled = true;
		((Component)val2).transform.parent = transform;
		((ShootBlast)val2).BaseBlast = SL_ShootBlast.GetBlastPrefab((BlastPrefabs)99).GetComponent<Blast>();
		((ShootBlast)val2).InstanstiatedAmount = 5;
		((Shooter)val2).CastPosition = (CastPositionType)0;
		((Shooter)val2).TargetType = (TargetTypes)0;
		((Shooter)val2).TransformName = "ShooterTransform";
		((ShootBlast)val2).UseTargetCharacterPositionType = false;
		((Effect)val2).SyncType = (SyncTypes)0;
		((Effect)val2).OverrideEffectCategory = (EffectCategories)0;
		((Effect)val2).BasePotencyValue = 1f;
		((Effect)val2).Delay = 0.25f;
		((Shooter)val2).LocalCastPositionAdd = new Vector3(0f, -1f, 0f);
		((ShootBlast)val2).BaseBlast.Radius = 4f;
		statusEffectSignature.Effects = new List<Effect>
		{
			(Effect)(object)impendingDoom,
			(Effect)(object)val2
		};
		Transform val3 = ((Component)((ShootBlast)val2).BaseBlast).transform.Find("Effects");
		PunctualDamage component = ((Component)val3).GetComponent<PunctualDamage>();
		Object.Destroy((Object)(object)component);
		component = (PunctualDamage)(object)((Component)val3).gameObject.AddComponent<ImpendingDoomDamage>();
		((Effect)component).Delay = 0.25f;
		component.Knockback = 40f;
		return val;
	}
}
public class ImpendingDoom : Effect
{
	public const float RANGE = 4f;

	public const float LIFE_SPAN = 15f;

	public const float DAMAGE = 15f;

	public const float REFRESH_RATE = 1f;

	public const float BOOM_THRESHOLD = 40f;

	protected override void ActivateLocally(Character character, object[] _infos)
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Expected O, but got Unknown
		object field = At.GetField<Effect>((Effect)(object)this, "m_parentStatusEffect");
		StatusEffect val = (StatusEffect)((field is StatusEffect) ? field : null);
		if (val != null && (Object)(object)((EffectSynchronizer)val).SourceCharacter != (Object)null && !character.Invincible)
		{
			float num = HolyDamageManager.BuffHolyDamageOrHealing(((EffectSynchronizer)val).SourceCharacter, 1f);
			DamageList val2 = new DamageList(HolyDamageManager.GetDamageType(), num);
			character.Stats.GetMitigatedDamage((Tag[])null, ref val2, true);
			character.Stats.ReceiveDamage(val2.TotalDamage);
		}
	}

	public static DamageList RemainingDamageList(Character character, StatusEffect parentStatusEffect, bool mitigated = true)
	{
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Expected O, but got Unknown
		float num = HolyDamageManager.BuffHolyDamageOrHealing(character, 15f * parentStatusEffect.RemainingLifespan / 15f);
		DamageList result = new DamageList(HolyDamageManager.GetDamageType(), num);
		if (mitigated)
		{
			character.Stats.GetMitigatedDamage((Tag[])null, ref result, true);
		}
		return result;
	}

	public static float RemainingDamage(Character character, StatusEffect parentStatusEffect, bool mitigated = true)
	{
		return RemainingDamageList(character, parentStatusEffect, mitigated).TotalDamage;
	}
}
[HarmonyPatch(typeof(StatusEffectManager), "OverrideStatusEffect", new Type[]
{
	typeof(StatusEffect),
	typeof(StatusEffect)
})]
public class StatusEffectManager_OverrideStatusEffect_ImpendingDoom
{
	[HarmonyPrefix]
	public static void Prefix(StatusEffectManager __instance, StatusEffect _existingEffect, StatusEffect _newEffect, out StatusData __state)
	{
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Expected O, but got Unknown
		__state = null;
		if (_newEffect.IdentifierName == _existingEffect.IdentifierName && _newEffect.IdentifierName == ImpendingDoomMod.Instance.impendingDoomInstance.IdentifierName)
		{
			__state = _newEffect.StatusData;
			_newEffect.StatusData = new StatusData(__state);
			_newEffect.StatusData.LifeSpan = ((_newEffect.RemainingLifespan != 0f) ? _newEffect.RemainingLifespan : _newEffect.StartLifespan) + _existingEffect.RemainingLifespan;
		}
	}

	[HarmonyPostfix]
	public static void Postfix(StatusEffectManager __instance, StatusEffect _existingEffect, StatusEffect _newEffect, StatusData __state)
	{
		if (__state != null)
		{
			_newEffect.StatusData = __state;
		}
	}
}
internal class ImpendingDoomDamage : PunctualDamage
{
	protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
	{
		EffectSynchronizer sourceSynchronizer = ((Effect)this).SourceSynchronizer;
		StatusEffect parentStatusEffect = (StatusEffect)(object)((sourceSynchronizer is StatusEffect) ? sourceSynchronizer : null);
		DamageList val = ImpendingDoom.RemainingDamageList(_affectedCharacter, parentStatusEffect);
		base.Damages = val.List.ToArray();
		base.DamageAmplifiedByOwner = false;
		((PunctualDamage)this).ActivateLocally(_affectedCharacter, _infos);
	}
}
[BepInPlugin("com.ehaugw.impendingdoom", "Impending Doom", "1.0.0")]
public class ImpendingDoomMod : BaseUnityPlugin
{
	public const string GUID = "com.ehaugw.impendingdoom";

	public const string VERSION = "1.0.0";

	public const string NAME = "Impending Doom";

	public static ImpendingDoomMod Instance;

	public StatusEffect impendingDoomInstance;

	internal void Awake()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Expected O, but got Unknown
		Instance = this;
		Harmony val = new Harmony("com.ehaugw.impendingdoom");
		val.PatchAll();
		SL.OnPacksLoaded += OnPackLoaded;
	}

	private void OnPackLoaded()
	{
		impendingDoomInstance = EffectInitializer.MakeImpendingDoomPrefab();
	}
}
public class ModTheme
{
	public enum Theme
	{
		Elatt,
		DawnWeaver,
		Atheist,
		Crusader
	}

	public static Theme? modTheme;

	public const string ImpendingDoomEffectIdentifierName = "ImpendingDoom";

	public static Theme GetTheme => modTheme ?? Theme.Crusader;

	public static string ImpendingDoomEffectName => "Impending Doom";

	public static string Themifization()
	{
		return null;
	}
}

plugins/Proficiencies.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Proficiencies;

public interface IWeaponProficiencyFromItem
{
	float Apply(Item item);
}
public interface IWeaponProficiencyOnCharacter
{
	void Apply(Character character, float original, ref float result);
}
[BepInPlugin("com.ehaugw.proficiencies", "Proficiencies", "1.0.1")]
public class Proficiencies : BaseUnityPlugin
{
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class Item_Description
	{
		[HarmonyPostfix]
		public static void Postfix(Item __instance, ref string __result)
		{
			float weaponProficiency = __instance.GetWeaponProficiency();
			if (weaponProficiency != 0f)
			{
				__result = "Weapon Proficiency: " + weaponProficiency + "\n" + __result;
			}
		}
	}

	public const string GUID = "com.ehaugw.proficiencies";

	public const string VERSION = "1.0.1";

	public const string NAME = "Proficiencies";

	public static List<IWeaponProficiencyOnCharacter> IWeaponProficiencyOnCharacterSources = new List<IWeaponProficiencyOnCharacter>();

	public static List<IWeaponProficiencyFromItem> IWeaponProfiencyFromItemSources = new List<IWeaponProficiencyFromItem>();

	internal void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.ehaugw.proficiencies");
		val.PatchAll();
	}
}
public static class ProficiencyExtensions
{
	public static float GetWeaponProficiency(this Item item)
	{
		return Proficiencies.IWeaponProfiencyFromItemSources.Select((IWeaponProficiencyFromItem modifier) => modifier.Apply(item)).Sum();
	}

	public static float GetTotalWeaponProficiency(this Character character)
	{
		EquipmentSlotIDs[] array = new EquipmentSlotIDs[6];
		RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
		float num = ((IEnumerable<EquipmentSlotIDs>)(object)array).Select(delegate(EquipmentSlotIDs slot)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			Character obj = character;
			float? obj2;
			if (obj == null)
			{
				obj2 = null;
			}
			else
			{
				CharacterInventory inventory = obj.Inventory;
				obj2 = ((inventory == null) ? null : inventory.GetEquippedItem(slot)?.GetWeaponProficiency());
			}
			float? num2 = obj2;
			return num2.GetValueOrDefault();
		}).Sum();
		float result = num;
		foreach (IWeaponProficiencyOnCharacter iWeaponProficiencyOnCharacterSource in Proficiencies.IWeaponProficiencyOnCharacterSources)
		{
			iWeaponProficiencyOnCharacterSource.Apply(character, num, ref result);
		}
		return result;
	}
}

plugins/RelicCondition.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using CharacterExtensions;
using EffectSourceConditions;
using TinyHelper;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace RelicCondition;

[BepInPlugin("com.ehaugw.reliccondition", "RelicCondition", "1.1.1")]
public class RelicCondition : BaseUnityPlugin
{
	public const string GUID = "com.ehaugw.reliccondition";

	public const string VERSION = "1.1.1";

	public const string NAME = "RelicCondition";

	public const string RelicLoreLevel1Name = "Relic Lore";

	public const string RelicLoreLevel2Name = "Mythic Lore";

	internal void Awake()
	{
	}

	public static Equipment HasRelicEquippedOrOnBackpack(Character character, int RequiredItemID = 0, int RequiredEnchantID = 0)
	{
		object obj;
		if (character == null)
		{
			obj = null;
		}
		else
		{
			CharacterInventory inventory = character.Inventory;
			obj = ((inventory != null) ? inventory.Equipment : null);
		}
		CharacterEquipment val = (CharacterEquipment)obj;
		if (val != null)
		{
			List<Equipment> second = (from s in val.EquipmentSlots
				where (Object)(object)s != (Object)null && (Object)(object)s.EquippedItem != (Object)null
				select s.EquippedItem).ToList();
			foreach (Item item in CharacterExtensions.EquippedOnBag(character).Union((IEnumerable<Item>)second))
			{
				bool flag = RequiredItemID == 0 || item.ItemID == RequiredItemID;
				int num;
				if (RequiredEnchantID != 0)
				{
					Equipment val2 = (Equipment)(object)((item is Equipment) ? item : null);
					num = ((val2 != null && val2.ActiveEnchantmentIDs.Contains(RequiredEnchantID)) ? 1 : 0);
				}
				else
				{
					num = 1;
				}
				bool flag2 = (byte)num != 0;
				if (flag && flag2)
				{
					return (Equipment)(object)((item is Equipment) ? item : null);
				}
			}
		}
		return null;
	}

	public static bool HasArcaneInfluence(Character character)
	{
		bool? obj;
		if (character == null)
		{
			obj = null;
		}
		else
		{
			CharacterInventory inventory = character.Inventory;
			if (inventory == null)
			{
				obj = null;
			}
			else
			{
				CharacterSkillKnowledge skillKnowledge = inventory.SkillKnowledge;
				obj = ((skillKnowledge != null) ? new bool?(((CharacterKnowledge)skillKnowledge).IsItemLearned(2502529)) : null);
			}
		}
		bool? flag = obj;
		return flag.GetValueOrDefault();
	}
}
public class RelicConditionBuilder
{
	public Transform EffectsContainer;

	public Transform ActivationEffectsContainer;

	public RelicConditionBuilder(Skill skill)
	{
		EffectsContainer = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)skill).transform).transform;
		ActivationEffectsContainer = TinyGameObjectManager.MakeFreshObject("ActivationEffects", true, true, ((Component)skill).transform).transform;
	}

	public unsafe static RelicConditionBuilder Apply(Skill skill, int requiredItem, string description, float manaCost = 0f, float cooldown = 2f, float staminaCost = 0f, float healthCost = 0f, float durabilityCost = 0f, SpellCastType? castType = null, SpellCastModifier? castModifier = null, float? mobileCastMovementMult = null, int? castSheatheRequired = null, bool? castLocomotionEnabled = null, int requiredEnchant = 0, int relicLevel = 0)
	{
		//IL_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Expected O, but got Unknown
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Expected O, but got Unknown
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_016f: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01df: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_027d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0->IL01f0: Incompatible stack types: O vs I4
		//IL_01e9->IL01f0: Incompatible stack types: I4 vs O
		//IL_01e9->IL01f0: Incompatible stack types: O vs I4
		if (((Item)skill).ItemID != 2502525)
		{
			TinyHelper.OnDescriptionModified = (DescriptionModifier)Delegate.Combine((Delegate?)(object)TinyHelper.OnDescriptionModified, (Delegate?)(DescriptionModifier)delegate(Item item, ref string existingDescription)
			{
				if (SkillRequirements.SafeHasSkillKnowledge((item != null) ? ((EffectSynchronizer)item).OwnerCharacter : null, 2502532) && (requiredItem == 0 || requiredItem == item.ItemID))
				{
					if (requiredEnchant != 0)
					{
						Equipment val5 = (Equipment)(object)((item is Equipment) ? item : null);
						if (val5 == null || !val5.ActiveEnchantmentIDs.Contains(requiredEnchant))
						{
							return;
						}
					}
					if ((existingDescription ?? "") != "")
					{
						existingDescription += "\n\n";
					}
					string text = "";
					switch (relicLevel)
					{
					case 1:
						text = " (Relic Lore)";
						break;
					case 2:
						text = " (Mythic Lore)";
						break;
					}
					existingDescription = existingDescription + ((Item)skill).Name + text + ": " + description;
				}
			});
		}
		RelicConditionBuilder relicConditionBuilder = new RelicConditionBuilder(skill);
		Transform orMake = TinyGameObjectManager.GetOrMake(((Component)relicConditionBuilder.EffectsContainer).transform, "SourceConditions", true, true);
		SourceConditionEquipment val = ((Component)orMake).gameObject.AddComponent<SourceConditionEquipment>();
		val.RequiredItemID = requiredItem;
		val.RequiredEnchantID = requiredEnchant;
		SourceConditionRelicLevel sourceConditionRelicLevel = ((Component)orMake).gameObject.AddComponent<SourceConditionRelicLevel>();
		sourceConditionRelicLevel.relicLevel = relicLevel;
		orMake = TinyGameObjectManager.GetOrMake(((Component)relicConditionBuilder.ActivationEffectsContainer).transform, "SourceConditions", true, true);
		val = ((Component)orMake).gameObject.AddComponent<SourceConditionEquipment>();
		val.RequiredItemID = requiredItem;
		val.RequiredEnchantID = requiredEnchant;
		sourceConditionRelicLevel = ((Component)orMake).gameObject.AddComponent<SourceConditionRelicLevel>();
		sourceConditionRelicLevel.relicLevel = relicLevel;
		DynamicSkillStat val2 = ((Component)orMake).gameObject.AddComponent<DynamicSkillStat>();
		val2.ManaCost = manaCost;
		val2.HealthCost = healthCost;
		val2.StaminaCost = staminaCost;
		val2.Cooldown = cooldown;
		val2.DurabilityCost = durabilityCost;
		val2.CastType = (SpellCastType)(((??)castType) ?? ((Item)skill).ActivateEffectAnimType);
		val2.MobileCastMovementMult = mobileCastMovementMult ?? ((Item)skill).MobileCastMovementMult;
		object obj = val2;
		SpellCastModifier? val3 = castModifier;
		int num;
		if (val3.HasValue)
		{
			obj = val3.GetValueOrDefault();
			num = (int)obj;
		}
		else
		{
			num = ((mobileCastMovementMult > 0f) ? 1 : ((int)((Item)skill).CastModifier));
			obj = num;
			num = (int)obj;
		}
		System.Runtime.CompilerServices.Unsafe.Write(&((DynamicSkillStat)num).CastModifier, (SpellCastModifier)obj);
		val2.CastSheatheRequired = castSheatheRequired ?? ((Item)skill).CastSheathRequired;
		val2.CastLocomotionEnabled = castLocomotionEnabled ?? (mobileCastMovementMult > 0f || ((Item)skill).CastLocomotionEnabled);
		ReduceDurability val4 = ((Component)relicConditionBuilder.ActivationEffectsContainer).gameObject.AddComponent<ReduceDurability>();
		val4.EquipmentSlot = (EquipmentSlotIDs)6;
		val4.Durability = durabilityCost;
		return relicConditionBuilder;
	}
}
public class SourceConditionRelicLevel : SourceCondition
{
	public int relicLevel;

	public bool Inverted;

	public override bool CharacterHasRequirement(Character character)
	{
		int num = 0;
		if (SkillRequirements.SafeHasSkillKnowledge(character, 2502526))
		{
			num = 1;
		}
		if (SkillRequirements.SafeHasSkillKnowledge(character, 2502527))
		{
			num = 2;
		}
		return (num >= relicLevel) ^ Inverted;
	}
}

plugins/SynchronizedWorldObjects.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using BepInEx;
using HarmonyLib;
using MapMagic;
using Photon;
using SideLoader;
using TinyHelper;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace SynchronizedWorldObjects;

[BepInPlugin("com.ehaugw.synchronizedworldobjects", "Synchronized World Objects", "1.0.3")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency("com.ehaugw.tinyhelper", "4.8.2")]
public class SynchronizedWorldObjects : BaseUnityPlugin
{
	public const string GUID = "com.ehaugw.synchronizedworldobjects";

	public const string VERSION = "1.0.3";

	public const string NAME = "Synchronized World Objects";

	internal void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: Expected O, but got Unknown
		GameObject val = new GameObject("SynchronizedWorldObjectsRPC");
		Object.DontDestroyOnLoad((Object)(object)val);
		val.AddComponent<SynchronizedWorldObjectManager>();
		SynchronizedWorldObjectManager.SyncedWorldObjects = new List<SynchronizedWorldObject>();
		SL.OnPacksLoaded += OnPackLoaded;
		SL.OnSceneLoaded += OnSceneLoaded;
		Harmony val2 = new Harmony("com.ehaugw.synchronizedworldobjects");
		val2.PatchAll();
	}

	private void OnPackLoaded()
	{
	}

	private void OnSceneLoaded()
	{
		SynchronizedWorldObjectManager.OnSceneLoaded();
	}
}
public abstract class SynchronizedWorldObject
{
	public string IdentifierName;

	public string SceneIdentifierName;

	public int RPCListenerID;

	public string Uid;

	public SynchronizedWorldObject(string identifierName, int rpcListenerID)
	{
		IdentifierName = identifierName;
		RPCListenerID = rpcListenerID;
		SynchronizedWorldObjectManager.SyncedWorldObjects.Add(this);
	}

	public virtual bool ShouldBeSpawned()
	{
		return SceneManagerHelper.ActiveSceneName == SceneIdentifierName;
	}

	public abstract bool OnSceneLoaded();

	public abstract bool OnGuestJoined(string guestUID);

	public abstract object SetupClientSide(int rpcListenerID, string instanceUID, int sceneViewID, int recursionCount, string rpcMeta);
}
internal class SynchronizedWorldObjectManager : MonoBehaviour
{
	public static SynchronizedWorldObjectManager Instance;

	public static List<SynchronizedWorldObject> SyncedWorldObjects;

	public static void OnSceneLoaded()
	{
		foreach (SynchronizedWorldObject syncedWorldObject in SyncedWorldObjects)
		{
			syncedWorldObject.OnSceneLoaded();
		}
	}

	internal void Start()
	{
		Instance = this;
		PhotonView val = ((Component)this).gameObject.AddComponent<PhotonView>();
		val.viewID = 951;
		Debug.Log((object)("Registered SynchronizedWorldObjectManager with ViewID " + ((MonoBehaviour)this).photonView.viewID));
	}

	[PunRPC]
	public void SetupClientSide(int rpcListenerID, string instanceUID, int sceneViewID, int recursionCount, string rpcMeta)
	{
		foreach (SynchronizedWorldObject syncedWorldObject in SyncedWorldObjects)
		{
			syncedWorldObject.SetupClientSide(rpcListenerID, instanceUID, sceneViewID, recursionCount, rpcMeta);
		}
	}
}
public class SynchronizedDeployable : SynchronizedEquipment
{
	public SynchronizedDeployable(int itemID)
		: base(itemID)
	{
	}

	public override object SetupClientSide(int rpcListenerID, string instanceUID, int sceneViewID, int recursionCount, string rpcMeta)
	{
		return null;
	}

	public override Item SetupServerSide()
	{
		Item val = base.SetupServerSide();
		val.IsPickable = false;
		val.HasPhysicsWhenWorld = false;
		Deployable component = ((Component)val).GetComponent<Deployable>();
		component.StartDeployAnimation();
		Dropable component2 = ((Component)val).GetComponent<Dropable>();
		if (Object.op_Implicit((Object)(object)component2))
		{
			component2.GenerateContents();
		}
		FueledContainer component3 = ((Component)val).GetComponent<FueledContainer>();
		if (Object.op_Implicit((Object)(object)component3))
		{
			component3.TryKindle = true;
		}
		return val;
	}
}
public class SynchronizedEquipment : SynchronizedWorldObject
{
	public Vector3 Position;

	public Vector3 Rotation;

	public Vector3 Scale;

	public int ItemID;

	public bool IsPickable = false;

	public SynchronizedEquipment(int itemID)
		: base("-1", -1)
	{
		ItemID = itemID;
	}

	public void AddToScene(string scene, Vector3 position, Vector3 rotation, Vector3 scale)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		SceneIdentifierName = scene;
		Position = position;
		Rotation = rotation;
		Scale = scale;
	}

	public override bool OnGuestJoined(string guestUID)
	{
		return false;
	}

	public override bool OnSceneLoaded()
	{
		if (ShouldBeSpawned())
		{
			if (!PhotonNetwork.isNonMasterClientInRoom)
			{
				SetupServerSide();
			}
			return true;
		}
		return false;
	}

	public override object SetupClientSide(int rpcListenerID, string instanceUID, int sceneViewID, int recursionCount, string rpcMeta)
	{
		return null;
	}

	public virtual Item SetupServerSide()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		Item val = ItemManager.Instance.GenerateItemNetwork(ItemID);
		val.ChangeParent((Transform)null, Position, Extensions.EulerToQuat(Rotation));
		val.SetForceSyncPos();
		val.SaveType = (SaveTypes)2;
		val.IsPickable = false;
		val.HasPhysicsWhenWorld = true;
		return val;
	}
}
public class SynchronizedNPCScene
{
	public string Scene;

	public Vector3 Position;

	public Vector3 Rotation;

	public Factions? Faction;

	public bool Sheathed;

	public SpellCastType Pose;

	public string RPCMeta;

	public int[] DefaultEquipment;

	public int[] ModdedEquipment;

	public Func<bool> ShouldSpawnInScene;

	public SynchronizedNPCScene(string scene, Vector3 position, Vector3 rotation, Factions? faction = null, bool sheathed = true, SpellCastType pose = -1, string rpcMeta = null, int[] defaultEquipment = null, int[] moddedEquipment = null, Func<bool> shouldSpawnInScene = null)
	{
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		Scene = scene;
		Position = position;
		Rotation = rotation;
		Faction = faction;
		Sheathed = sheathed;
		Pose = pose;
		RPCMeta = rpcMeta;
		DefaultEquipment = defaultEquipment;
		ModdedEquipment = moddedEquipment;
		ShouldSpawnInScene = shouldSpawnInScene ?? ((Func<bool>)(() => true));
	}
}
public class SynchronizedNPC : SynchronizedWorldObject
{
	public enum HairColors
	{
		BrownMedium,
		BrownBright,
		BrownDark,
		Black,
		Blonde,
		White,
		Red,
		Blue,
		Green,
		Orange,
		Purple
	}

	public enum HairStyles
	{
		Bald,
		Basic,
		PonyTail,
		Wild,
		CombedBack,
		PonyTailBraids,
		BraidsBack,
		Bun,
		MaleShort,
		MaleMedium,
		MaleLong,
		CornrowsMedium,
		CornrowsLong,
		CornrowsShort,
		Ball
	}

	public int[] DefaultEquipment = new int[0];

	public int[] ModdedEquipment = new int[0];

	public Vector3 Scale;

	public string RPCMeta;

	public Factions Faction;

	private Character localCharacter;

	private AIRoot aiRoot;

	public VisualData VisualData;

	public List<SynchronizedNPCScene> Scenes = new List<SynchronizedNPCScene>();

	public SynchronizedNPCScene ActiveScene;

	public SynchronizedNPC(string identifierName, int rpcListenerID, int[] defaultEquipment = null, int[] moddedEquipment = null, Vector3? scale = null, Factions? faction = null, VisualData visualData = null)
		: base(identifierName, rpcListenerID)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Unknown result type (might be due to invalid IL or missing references)
		DefaultEquipment = defaultEquipment ?? new int[0];
		ModdedEquipment = moddedEquipment ?? new int[0];
		Scale = (Vector3)(((??)scale) ?? Vector3.one);
		Faction = faction.GetValueOrDefault();
		VisualData = visualData;
	}

	public void AddToScene(SynchronizedNPCScene scene)
	{
		Scenes.Add(scene);
	}

	public void AssignAI(AIRoot aiRoot)
	{
		this.aiRoot = aiRoot;
	}

	public GameObject GetGameObject()
	{
		return GameObject.Find("UNPC_" + IdentifierName);
	}

	public object GetSynchronizedObject(string instanceUID)
	{
		return CharacterManager.Instance.GetCharacter(instanceUID);
	}

	public override bool ShouldBeSpawned()
	{
		foreach (SynchronizedNPCScene scene in Scenes)
		{
			if (scene.ShouldSpawnInScene() && scene.Scene == SceneManagerHelper.ActiveSceneName)
			{
				ActiveScene = scene;
				return true;
			}
		}
		return false;
	}

	public override bool OnSceneLoaded()
	{
		if (ShouldBeSpawned())
		{
			if (!PhotonNetwork.isNonMasterClientInRoom)
			{
				int num = PhotonNetwork.AllocateSceneViewID();
				GameObject gameObject = GetGameObject();
				if ((Object)(object)gameObject == (Object)null)
				{
					SetupServerSide();
					((MonoBehaviour)SynchronizedWorldObjectManager.Instance).photonView.RPC("SetupClientSide", (PhotonTargets)0, new object[5] { RPCListenerID, Uid, num, 0, ActiveScene.RPCMeta });
					return true;
				}
			}
		}
		else
		{
			GameObject gameObject2 = GetGameObject();
			if (gameObject2 != null)
			{
				Object.DestroyImmediate((Object)(object)gameObject2);
			}
		}
		return false;
	}

	public override bool OnGuestJoined(string guestUID)
	{
		if (ShouldBeSpawned())
		{
			if (!PhotonNetwork.isNonMasterClientInRoom)
			{
				int num = PhotonNetwork.AllocateSceneViewID();
				GameObject gameObject = GetGameObject();
				if ((Object)(object)gameObject == (Object)null)
				{
					((MonoBehaviour)SynchronizedWorldObjectManager.Instance).photonView.RPC("SetupClientSide", (PhotonTargets)0, new object[5] { RPCListenerID, Uid, num, 0, ActiveScene.RPCMeta });
					return true;
				}
			}
		}
		else
		{
			GameObject gameObject2 = GetGameObject();
			if (gameObject2 != null)
			{
				Object.DestroyImmediate((Object)(object)gameObject2);
			}
		}
		return false;
	}

	public override object SetupClientSide(int rpcListenerID, string instanceUID, int sceneViewID, int recursionCount, string rpcMeta)
	{
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010b: Expected O, but got Unknown
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_012e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01be: Unknown result type (might be due to invalid IL or missing references)
		if (RPCListenerID != rpcListenerID)
		{
			return null;
		}
		ActiveScene = Scenes.FirstOrDefault((SynchronizedNPCScene x) => x.RPCMeta == rpcMeta);
		int num = 200;
		object synchronizedObject = GetSynchronizedObject(instanceUID);
		Character val = (Character)((synchronizedObject is Character) ? synchronizedObject : null);
		if ((Object)(object)val == (Object)null)
		{
			if (recursionCount * num < 20000)
			{
				DelayedTask.GetTask(num).ContinueWith((Task _) => SetupClientSide(rpcListenerID, instanceUID, sceneViewID, recursionCount + 1, rpcMeta));
				Console.Read();
				return null;
			}
			Debug.Log((object)("SynchronizedNPC with UID " + instanceUID + " could not fetched from server"));
			return null;
		}
		GameObject val2 = new GameObject("UNPC_" + IdentifierName);
		val2.transform.position = ActiveScene.Position;
		val2.transform.rotation = Quaternion.Euler(ActiveScene.Rotation);
		GameObject gameObject = ((Component)val).gameObject;
		if (VisualData != null)
		{
			((MonoBehaviour)TinyHelper.Instance).StartCoroutine(SL_Character.SetVisuals(val, ((object)VisualData).ToString()));
		}
		gameObject.transform.parent = val2.transform;
		gameObject.transform.position = val2.transform.position;
		gameObject.transform.rotation = val2.transform.rotation;
		gameObject.transform.localScale = Scale;
		Object.DestroyImmediate((Object)(object)gameObject.GetComponent<StartingEquipment>());
		((Behaviour)val.Stats).enabled = false;
		Weapon currentWeapon = val.CurrentWeapon;
		if (currentWeapon != null && ((Equipment)currentWeapon).TwoHanded)
		{
			val.LeftHandEquipment = (Equipment)(object)val.CurrentWeapon;
			val.LeftHandChanged();
		}
		if ((Object)(object)val.CurrentWeapon != (Object)null)
		{
			val.Sheathed = ActiveScene.Sheathed;
		}
		localCharacter = val;
		return val;
	}

	public void AITick()
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Expected I4, but got Unknown
		DelayedTask.GetTask(1000).ContinueWith(delegate
		{
			AITick();
		});
		Console.Read();
		if ((Object)(object)localCharacter != (Object)null)
		{
			SpellCastType[] array = (SpellCastType[])(object)new SpellCastType[2]
			{
				(SpellCastType)55,
				(SpellCastType)41
			};
			if (UnityEngineExtensions.Contains<SpellCastType>(array, ActiveScene.Pose) && localCharacter.InLocomotion)
			{
				localCharacter.Animator.SetInteger("SpellType", (int)ActiveScene.Pose);
				localCharacter.Animator.SetTrigger("Spell");
			}
		}
	}

	public object SetupServerSide()
	{
		//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_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_01f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
		UID val = UID.Generate();
		string text = ((object)(UID)(ref val)).ToString();
		GameObject gameObject = ((Component)TinyCharacterManager.SpawnCharacter(text, ActiveScene.Position, ActiveScene.Rotation)).gameObject;
		gameObject.transform.rotation = Quaternion.Euler(ActiveScene.Rotation);
		Character component = gameObject.GetComponent<Character>();
		At.SetField<Character>(component, "m_instantiationType", (object)(CharacterInstantiationTypes)2);
		int[] array = ActiveScene.DefaultEquipment ?? DefaultEquipment;
		foreach (int num in array)
		{
			? val2 = component.Inventory.Equipment;
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(num);
			((CharacterEquipment)val2).EquipInstantiate((Equipment)(object)((itemPrefab is Equipment) ? itemPrefab : null));
		}
		int[] array2 = ActiveScene.ModdedEquipment ?? ModdedEquipment;
		for (int j = 0; j < array2.Length; j++)
		{
			int num2 = array2[j];
			if (ResourcesPrefabManager.Instance.ContainsItemPrefab(num2.ToString()))
			{
				Item obj = ItemManager.Instance.GenerateItemNetwork(num2);
				Equipment val3 = (Equipment)(object)((obj is Equipment) ? obj : null);
				component.Inventory.TakeItem(((Item)val3).UID);
				At.Invoke<CharacterEquipment>(component.Inventory.Equipment, "EquipWithoutAssociating", new Type[2]
				{
					typeof(Equipment),
					typeof(bool)
				}, new object[2] { val3, false });
			}
		}
		Weapon currentWeapon = component.CurrentWeapon;
		if (currentWeapon != null && ((Equipment)currentWeapon).TwoHanded)
		{
			component.LeftHandEquipment = (Equipment)(object)component.CurrentWeapon;
			component.LeftHandChanged();
		}
		if ((Object)(object)component.CurrentWeapon != (Object)null)
		{
			component.Sheathed = ActiveScene.Sheathed;
		}
		component.ChangeFaction((Factions)(((??)ActiveScene.Faction) ?? Faction), true);
		gameObject.SetActive(true);
		DelayedTask.GetTask(1000).ContinueWith(delegate
		{
			AITick();
		});
		Console.Read();
		Uid = text;
		return text;
	}
}

plugins/TinyHelper.dll

Decompiled 2 months ago
#define DEBUG
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using CharacterQuestKnowledgeExtensions;
using HarmonyLib;
using Localizer;
using NodeCanvas.DialogueTrees;
using NodeCanvas.Framework;
using NodeCanvas.Tasks.Actions;
using NodeCanvas.Tasks.Conditions;
using Photon;
using TinyHelper;
using TinyHelper.Effects;
using TinyHelper.Interfaces;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
public static class TinyHelpers
{
	public static void Shuffle<T>(this IList<T> list)
	{
		Random random = new Random();
		int count = list.Count;
		for (int num = list.Count - 1; num > 1; num--)
		{
			int index = random.Next(num + 1);
			T value = list[index];
			list[index] = list[num];
			list[num] = value;
		}
	}
}
namespace CharacterQuestKnowledgeExtensions
{
	public static class CharacterQuestKnowledgeExtensions
	{
		public static bool IsItemLearnedLocal(this CharacterQuestKnowledge questKnowledge, int _itemID)
		{
			return (from q in ((CharacterKnowledge)questKnowledge).GetLearnedItems()
				where q.ItemID == _itemID && Object.op_Implicit((Object)(object)((EffectSynchronizer)q).OwnerCharacter)
				select q).Count() > 0;
		}

		public static bool IsQuestCompletedLocal(this CharacterQuestKnowledge questKnowledge, int _itemID)
		{
			return ((CharacterKnowledge)questKnowledge).GetLearnedItems().Where(delegate(Item q)
			{
				int result;
				if (q.ItemID == _itemID && Object.op_Implicit((Object)(object)((EffectSynchronizer)q).OwnerCharacter))
				{
					Quest val = (Quest)(object)((q is Quest) ? q : null);
					if (val != null)
					{
						result = (val.IsCompleted ? 1 : 0);
						goto IL_002e;
					}
				}
				result = 0;
				goto IL_002e;
				IL_002e:
				return (byte)result != 0;
			}).Count() > 0;
		}
	}
}
namespace CharacterExtensions
{
	public static class CharacterExtensions
	{
		public static List<Item> EquippedOnBag(this Character character)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			object result;
			if (character == null)
			{
				result = null;
			}
			else
			{
				CharacterInventory inventory = character.Inventory;
				result = ((inventory == null) ? null : inventory.GetOwnedItems(TinyTagManager.GetOrMakeTag("Item"))?.Where((Item x) => x.DisplayedOnBag)?.ToList());
			}
			return (List<Item>)result;
		}
	}
}
namespace TinyHelper
{
	public static class At
	{
		public static BindingFlags flags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

		public static object Call(object obj, string method, params object[] args)
		{
			MethodInfo method2 = obj.GetType().GetMethod(method, flags);
			if (method2 != null)
			{
				return method2.Invoke(obj, args);
			}
			return null;
		}

		public static void SetValue<T>(T value, Type type, object obj, string field)
		{
			FieldInfo field2 = type.GetField(field, flags);
			if (field2 != null)
			{
				field2.SetValue(obj, value);
			}
		}

		public static object GetValue(Type type, object obj, string value)
		{
			FieldInfo field = type.GetField(value, flags);
			if (field != null)
			{
				return field.GetValue(obj);
			}
			return null;
		}

		public static void InheritBaseValues(object _derived, object _base)
		{
			FieldInfo[] fields = _base.GetType().GetFields(flags);
			foreach (FieldInfo fieldInfo in fields)
			{
				try
				{
					_derived.GetType().GetField(fieldInfo.Name).SetValue(_derived, fieldInfo.GetValue(_base));
				}
				catch
				{
				}
			}
		}
	}
	public class QuestKnowledgeCondition : EffectCondition
	{
		public int[] Quests;

		public LogicType Logic = LogicType.Any;

		protected override bool CheckIsValid(Character _affectedCharacter)
		{
			return QuestRequirements.HasQuestKnowledge(_affectedCharacter, Quests, Logic);
		}
	}
	public class StatusEffectsCondition : EffectCondition
	{
		public enum LogicType
		{
			Any,
			All
		}

		public string[] StatusEffectNames;

		public LogicType Logic = LogicType.Any;

		protected override bool CheckIsValid(Character _affectedCharacter)
		{
			StatusEffectManager statusEffectManager = ((_affectedCharacter != null) ? _affectedCharacter.StatusEffectMngr : null);
			if (statusEffectManager != null)
			{
				IEnumerable<bool> source = StatusEffectNames.Select((string x) => (Object)(object)statusEffectManager.GetStatusEffectOfName(x) != (Object)null);
				return (Logic == LogicType.Any) ? source.Any((bool x) => x) : source.All((bool x) => x);
			}
			return false;
		}
	}
	public class AddNewStatusEffectRandom : AddStatusEffectRandom
	{
		protected override bool TryTriggerConditions()
		{
			List<StatusEffect> list = base.Statuses.ToList();
			list.Shuffle();
			base.ForceID = -1;
			for (int i = 0; i < list.Count; i++)
			{
				StatusEffect val = list[i];
				if (!((Object)(object)val == (Object)null) && !((Object)(object)((Effect)this).m_affectedCharacter == (Object)null) && !((Effect)this).m_affectedCharacter.StatusEffectMngr.HasStatusEffect(val.EffectFamily))
				{
					base.ForceID = UnityEngineExtensions.IndexOf<StatusEffect>(base.Statuses, val);
					break;
				}
			}
			return ((AddStatusEffectRandom)this).TryTriggerConditions();
		}
	}
	public class EnableHitDetection : Effect
	{
		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			Item parentItem = ((Effect)this).ParentItem;
			MeleeSkill val = (MeleeSkill)(object)((parentItem is MeleeSkill) ? parentItem : null);
			if (val != null && (Object)(object)val.MeleeHitDetector != (Object)null)
			{
				MeleeHitDetector val2 = ((_affectedCharacter != null) ? _affectedCharacter.SkillMeleeDetector : null);
				if (val2 != null)
				{
					val2.HitStarted(-1);
					return;
				}
			}
			Weapon obj = ((_affectedCharacter != null) ? _affectedCharacter.CurrentWeapon : null);
			MeleeWeapon val3 = (MeleeWeapon)(object)((obj is MeleeWeapon) ? obj : null);
			if (val3 != null)
			{
				((Weapon)val3).HitStarted(-1);
			}
		}
	}
	public class RemoveItemFromInventory : Effect
	{
		public int ItemID;

		public int Amount = 1;

		public bool AffectOwner = false;

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			if (AffectOwner)
			{
				_affectedCharacter = ((Effect)this).OwnerCharacter;
			}
			CharacterInventory inventory = _affectedCharacter.Inventory;
			if (inventory != null)
			{
				inventory.RemoveItem(ItemID, Amount);
			}
		}
	}
	public class CooldownChangeEffect : Effect
	{
		public float HitKnockbackCooldown = -1f;

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			Item parentItem = ((Effect)this).ParentItem;
			Skill val = (Skill)(object)((parentItem is Skill) ? parentItem : null);
			if (val != null && HitKnockbackCooldown != -1f && _affectedCharacter.IsInKnockback)
			{
				At.SetValue(HitKnockbackCooldown, typeof(Skill), val, "m_remainingCooldownTime");
			}
		}
	}
	public class EquipSkillDurabilityCondition : EquipDurabilityCondition
	{
		protected override bool CheckIsValid(Character _affectedCharacter)
		{
			Skill component = ((Component)((Component)this).transform.parent.parent).gameObject.GetComponent<Skill>();
			if (component != null)
			{
				base.DurabilityRequired = component.DurabilityCost;
			}
			return ((EquipDurabilityCondition)this).CheckIsValid(_affectedCharacter);
		}

		public static ActivationCondition AddToSkill(Skill skill, EquipmentSlotIDs slot)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0035: 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)
			Transform orMake = TinyGameObjectManager.GetOrMake(((Component)skill).transform, "AdditionalActivationConditions", setActive: true, dontDestroyOnLoad: true);
			GameObject gameObject = ((Component)TinyGameObjectManager.GetOrMake(orMake, "EquipSkillDurabilityCondition", setActive: true, dontDestroyOnLoad: true)).gameObject;
			ActivationCondition val = new ActivationCondition();
			EquipSkillDurabilityCondition equipSkillDurabilityCondition = gameObject.AddComponent<EquipSkillDurabilityCondition>();
			((EquipDurabilityCondition)equipSkillDurabilityCondition).EquipmentSlot = slot;
			val.Condition = (EffectCondition)(object)equipSkillDurabilityCondition;
			At.SetValue("A required piece of equipment is missing or too damaged to be used this way.", typeof(ActivationCondition), val, "m_defaultMessage");
			List<ActivationCondition> list = (At.GetValue(typeof(Skill), skill, "m_additionalConditions") as ActivationCondition[])?.ToList() ?? new List<ActivationCondition>();
			list.Add(val);
			At.SetValue(list.ToArray(), typeof(Skill), skill, "m_additionalConditions");
			return val;
		}

		public static ActivationCondition AddToSkillNotBroken(Skill skill, EquipmentSlotIDs slot)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_0035: 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)
			Transform orMake = TinyGameObjectManager.GetOrMake(((Component)skill).transform, "AdditionalActivationConditions", setActive: true, dontDestroyOnLoad: true);
			GameObject gameObject = ((Component)TinyGameObjectManager.GetOrMake(orMake, "EquipDurabilityCondition", setActive: true, dontDestroyOnLoad: true)).gameObject;
			ActivationCondition val = new ActivationCondition();
			EquipDurabilityCondition val2 = gameObject.AddComponent<EquipDurabilityCondition>();
			val2.EquipmentSlot = slot;
			val2.DurabilityRequired = 0f;
			val.Condition = (EffectCondition)(object)val2;
			At.SetValue("A required piece of equipment is missing or broken.", typeof(ActivationCondition), val, "m_defaultMessage");
			List<ActivationCondition> list = (At.GetValue(typeof(Skill), skill, "m_additionalConditions") as ActivationCondition[])?.ToList() ?? new List<ActivationCondition>();
			list.Add(val);
			At.SetValue(list.ToArray(), typeof(Skill), skill, "m_additionalConditions");
			return val;
		}
	}
	public class AffectCorruption : Effect
	{
		public float AffectQuantity = 0f;

		public bool AffectOwner = false;

		public bool IsRaw = false;

		protected override KeyValuePair<string, Type>[] GenerateSignature()
		{
			return new KeyValuePair<string, Type>[1]
			{
				new KeyValuePair<string, Type>("Value", typeof(float))
			};
		}

		public override void SetValue(string[] _data)
		{
			if (_data == null || _data.Length >= 1)
			{
				float.TryParse(_data[0], out AffectQuantity);
			}
		}

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			if (AffectOwner)
			{
				_affectedCharacter = ((Effect)this).OwnerCharacter;
			}
			if ((Object)(object)_affectedCharacter != (Object)null && _affectedCharacter.Alive && Object.op_Implicit((Object)(object)_affectedCharacter.PlayerStats))
			{
				_affectedCharacter.PlayerStats.AffectCorruptionLevel(AffectQuantity, !IsRaw);
			}
		}
	}
	public class UseMana : Effect
	{
		public float UsedMana = 0f;

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			_affectedCharacter.Stats.UseMana((Tag[])null, UsedMana);
		}
	}
	public class SpecificImbueCondition : EffectCondition
	{
		public ImbueEffectPreset imbueEffectPreset;

		private bool inverse = false;

		protected override bool CheckIsValid(Character _affectedCharacter)
		{
			Weapon val = ((_affectedCharacter != null) ? _affectedCharacter.CurrentWeapon : null);
			return val != null && val.HasImbuePreset(imbueEffectPreset);
		}

		public static ActivationCondition AddToSkill(Skill skill, ImbueEffectPreset imbueEffectPreset, bool inverse = false)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			GameObject val = new GameObject("SpecificImbueCondition");
			ActivationCondition val2 = new ActivationCondition();
			SpecificImbueCondition specificImbueCondition = val.AddComponent<SpecificImbueCondition>();
			Object.DontDestroyOnLoad((Object)(object)specificImbueCondition);
			val.SetActive(false);
			val2.Condition = (EffectCondition)(object)specificImbueCondition;
			specificImbueCondition.inverse = inverse;
			specificImbueCondition.imbueEffectPreset = imbueEffectPreset;
			At.SetValue("You do not have the required imbue effect.", typeof(ActivationCondition), val2, "m_defaultMessage");
			List<ActivationCondition> list = (At.GetValue(typeof(Skill), skill, "m_additionalConditions") as ActivationCondition[])?.ToList() ?? new List<ActivationCondition>();
			list.Add(val2);
			At.SetValue(list.ToArray(), typeof(Skill), skill, "m_additionalConditions");
			return val2;
		}
	}
	public class ExtendedAddStatusEffect : AddStatusEffect
	{
		public bool ExtendDuration = false;

		protected override void ActivateLocally(Character _targetCharacter, object[] _infos)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			StatusEffect status = base.Status;
			if (ExtendDuration)
			{
				bool? obj;
				if (_targetCharacter == null)
				{
					obj = null;
				}
				else
				{
					StatusEffectManager statusEffectMngr = _targetCharacter.StatusEffectMngr;
					obj = ((statusEffectMngr != null) ? new bool?(statusEffectMngr.HasStatusEffect(status.IdentifierName)) : null);
				}
				bool? flag = obj;
				if (flag.GetValueOrDefault())
				{
					StatusData statusData = status.StatusData;
					status.StatusData = new StatusData(statusData);
					StatusEffect statusEffectOfName = _targetCharacter.StatusEffectMngr.GetStatusEffectOfName(status.IdentifierName);
					float num = ((statusEffectOfName != null) ? statusEffectOfName.RemainingLifespan : 0f);
					float num2 = ((status.RemainingLifespan > 0f) ? status.RemainingLifespan : status.StartLifespan);
					status.StatusData.LifeSpan = num2 + num;
					((AddStatusEffect)this).ActivateLocally(_targetCharacter, _infos);
					status.StatusData = statusData;
					return;
				}
			}
			((AddStatusEffect)this).ActivateLocally(_targetCharacter, _infos);
		}
	}
	public static class AnimatorExtension
	{
		public static bool HasParameter(this Animator animator, string paramName)
		{
			AnimatorControllerParameter[] parameters = animator.parameters;
			foreach (AnimatorControllerParameter val in parameters)
			{
				if (val.name == paramName)
				{
					return true;
				}
			}
			return false;
		}
	}
	public class TinyCharacterManager
	{
		public static Character SpawnCharacter(string uid, Vector3 position, Vector3 rotation)
		{
			//IL_0047: 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_0049: 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)
			Character character = CharacterManager.Instance.GetCharacter(uid);
			if ((Object)(object)character != (Object)null)
			{
				return character;
			}
			object[] array = new object[4]
			{
				4,
				"NewPlayerPrefab",
				uid,
				string.Empty
			};
			GameObject val = PhotonNetwork.InstantiateSceneObject("_characters/NewPlayerPrefab", position, Quaternion.Euler(rotation), (byte)0, array);
			val.SetActive(false);
			Character component = val.GetComponent<Character>();
			component.SetUID(UID.op_Implicit(uid));
			At.SetValue<Character>(component, typeof(int), 1, "m_isAI");
			return component;
		}
	}
	public class TinyDialogueManager
	{
		public static GameObject AssignMerchantTemplate(Transform parentTransform)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(Resources.Load<GameObject>("editor/templates/MerchantTemplate"));
			val.transform.parent = parentTransform;
			val.transform.position = parentTransform.position;
			val.transform.rotation = parentTransform.rotation;
			return val;
		}

		public static GameObject AssignTrainerTemplate(Transform parentTransform)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(Resources.Load<GameObject>("editor/templates/TrainerTemplate"));
			val.transform.parent = parentTransform;
			val.transform.position = parentTransform.position;
			val.transform.rotation = parentTransform.rotation;
			return val;
		}

		public static DialogueActor SetDialogueActorName(GameObject dialogueGameObject, string name)
		{
			DialogueActor componentInChildren = dialogueGameObject.GetComponentInChildren<DialogueActor>();
			componentInChildren.SetName(name);
			return componentInChildren;
		}

		public static Merchant SetMerchant(GameObject merchantTemplate, UID merchantUID)
		{
			return merchantTemplate.GetComponentInChildren<Merchant>();
		}

		public static Trainer SetTrainerSkillTree(GameObject trainerTemplate, UID skillTreeUID)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			Trainer componentInChildren = trainerTemplate.GetComponentInChildren<Trainer>();
			At.SetValue<UID>(skillTreeUID, typeof(Trainer), componentInChildren, "m_skillTreeUID");
			return componentInChildren;
		}

		public static Graph GetDialogueGraph(GameObject trainerTemplate)
		{
			DialogueTreeController componentInChildren = trainerTemplate.GetComponentInChildren<DialogueTreeController>();
			return ((GraphOwner)componentInChildren).graph;
		}

		public static void SetActorReference(Graph graph, DialogueActor actor)
		{
			List<ActorParameter> list = At.GetValue(typeof(DialogueTree), (graph is DialogueTree) ? graph : null, "_actorParameters") as List<ActorParameter>;
			list[0].actor = (IDialogueActor)(object)actor;
			list[0].name = actor.name;
		}

		public static ActionNode MakeMerchantDialogueAction(Graph graph, Merchant merchant)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			ActionNode val = graph.AddNode<ActionNode>();
			ShopDialogueAction val2 = new ShopDialogueAction
			{
				Merchant = new BBParameter<Merchant>(merchant)
			};
			BBParameter<Character> obj = new BBParameter<Character>();
			((BBParameter)obj).name = "gInstigator";
			val2.PlayerCharacter = obj;
			ShopDialogueAction action = val2;
			val.action = (ActionTask)(object)action;
			return val;
		}

		public static ActionNode MakeTrainDialogueAction(Graph graph, Trainer trainer)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			ActionNode val = graph.AddNode<ActionNode>();
			TrainDialogueAction val2 = new TrainDialogueAction
			{
				Trainer = new BBParameter<Trainer>(trainer)
			};
			BBParameter<Character> obj = new BBParameter<Character>();
			((BBParameter)obj).name = "gInstigator";
			val2.PlayerCharacter = obj;
			TrainDialogueAction action = val2;
			val.action = (ActionTask)(object)action;
			return val;
		}

		public static ActionNode MakeStartQuest(Graph graph, int questID)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			ActionNode val = graph.AddNode<ActionNode>();
			GiveQuest val3 = (GiveQuest)(object)(val.action = (ActionTask)new GiveQuest());
			ref BBParameter<Quest> quest = ref val3.quest;
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(questID);
			quest = new BBParameter<Quest>((Quest)(object)((itemPrefab is Quest) ? itemPrefab : null));
			return val;
		}

		public static ActionNode MakeQuestEvent(Graph graph, string EventUID)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			ActionNode val = graph.AddNode<ActionNode>();
			SendQuestEvent val3 = (SendQuestEvent)(object)(val.action = (ActionTask)new SendQuestEvent());
			val3.QuestEventRef = new QuestEventReference
			{
				EventUID = EventUID
			};
			return val;
		}

		public static ConditionNode MakeEventOccuredCondition(Graph graph, string EventUID, int MinStack)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Expected O, but got Unknown
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			ConditionNode val = graph.AddNode<ConditionNode>();
			val.condition = (ConditionTask)new Condition_QuestEventOccured
			{
				QuestEventRef = new QuestEventReference
				{
					EventUID = EventUID
				},
				MinStack = MinStack
			};
			return val;
		}

		public static ConditionNode MakeHasItemCondition(Graph graph, int itemID, int MinStack)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Expected O, but got Unknown
			ConditionNode val = graph.AddNode<ConditionNode>();
			Condition_OwnsItem val2 = new Condition_OwnsItem();
			BBParameter<Character> obj = new BBParameter<Character>();
			((BBParameter)obj).name = "gInstigator";
			val2.character = obj;
			val2.item = new BBParameter<ItemReference>(new ItemReference
			{
				ItemID = itemID
			});
			val2.minAmount = new BBParameter<int>(MinStack);
			val2.itemMustBeEquiped = new BBParameter<bool>(false);
			val2.SaveMatchingContainerVariable = null;
			val.condition = (ConditionTask)val2;
			return val;
		}

		public static ConditionNode MakeHasItemConditionSimple(Graph graph, int itemID, int MinStack, int enchantment = 0)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			ConditionNode val = graph.AddNode<ConditionNode>();
			Condition_SimpleOwnsItem val2 = new Condition_SimpleOwnsItem();
			BBParameter<Character> obj = new BBParameter<Character>();
			((BBParameter)obj).name = "gInstigator";
			val2.character = obj;
			val2.item = new BBParameter<Item>(ResourcesPrefabManager.Instance.GetItemPrefab(itemID));
			val2.minAmount = new BBParameter<int>(MinStack);
			val.condition = (ConditionTask)val2;
			return val;
		}

		public static ActionNode MakeGiveItemReward(Graph graph, int itemID, Receiver receiver, int quantity = 1)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Expected O, but got Unknown
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			ActionNode val = graph.AddNode<ActionNode>();
			GiveReward val3 = (GiveReward)(object)(val.action = (ActionTask)new GiveReward());
			val3.RewardReceiver = receiver;
			ItemQuantity val4 = new ItemQuantity();
			ItemReference val5 = new ItemReference();
			val5.ItemID = itemID;
			val4.Item = new BBParameter<ItemReference>(val5);
			val4.Quantity = BBParameter<int>.op_Implicit(quantity);
			val3.ItemReward = new List<ItemQuantity> { val4 };
			return val;
		}

		public static ActionNode MakeResignItem(Graph graph, int itemID, Receiver provider, int quantity = 1, int enchantment = 0)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Expected O, but got Unknown
			ActionNode val = graph.AddNode<ActionNode>();
			RemoveItem val2 = new RemoveItem();
			BBParameter<Character> obj = new BBParameter<Character>();
			((BBParameter)obj).name = "gInstigator";
			val2.fromCharacter = obj;
			val2.Items = new List<BBParameter<ItemReference>>
			{
				new BBParameter<ItemReference>(new ItemReference
				{
					ItemID = itemID
				})
			};
			val2.Amount = new List<BBParameter<int>>
			{
				new BBParameter<int>(quantity)
			};
			val.action = (ActionTask)val2;
			return val;
		}

		public static StatementNodeExt MakeStatementNode(Graph graph, string name, string statementText)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			StatementNodeExt val = graph.AddNode<StatementNodeExt>();
			val.statement = new Statement(statementText);
			val.SetActorName(name);
			return val;
		}

		public static MultipleChoiceNodeExt MakeMultipleChoiceNode(Graph graph, string[] statementTexts)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Expected O, but got Unknown
			//IL_0037: Expected O, but got Unknown
			MultipleChoiceNodeExt val = graph.AddNode<MultipleChoiceNodeExt>();
			foreach (string text in statementTexts)
			{
				val.availableChoices.Add(new Choice
				{
					statement = new Statement
					{
						text = text
					}
				});
			}
			return val;
		}

		public static void ChainNodes(Graph graph, Node[] nodes)
		{
			Node val = null;
			foreach (Node val2 in nodes)
			{
				if (val != null)
				{
					graph.ConnectNodes(val, val2, -1, -1);
				}
				val = val2;
			}
		}

		public static void ConnectMultipleChoices(Graph graph, Node baseNode, Node[] nodes)
		{
			for (int i = 0; i < nodes.Length; i++)
			{
				graph.ConnectNodes(baseNode, nodes[i], i, -1);
			}
		}
	}
	public class TinyGameObjectManager
	{
		public static Transform GetOrMake(Transform parent, string child, bool setActive, bool dontDestroyOnLoad)
		{
			return parent.Find(child) ?? MakeFreshObject(child, setActive, dontDestroyOnLoad, parent).transform;
		}

		public static GameObject InstantiateClone(GameObject sourceGameObject, bool setActive, bool dontDestroyOnLoad)
		{
			return InstantiateClone(sourceGameObject, ((Object)sourceGameObject).name + "(Clone)", setActive, dontDestroyOnLoad);
		}

		public static GameObject InstantiateClone(GameObject sourceGameObject, string newGameObjectName, bool setActive, bool dontDestroyOnLoad)
		{
			GameObject val = Object.Instantiate<GameObject>(sourceGameObject);
			val.SetActive(setActive);
			((Object)val).name = newGameObjectName;
			if (dontDestroyOnLoad)
			{
				Object.DontDestroyOnLoad((Object)(object)val);
			}
			return val;
		}

		public static Transform MakeFreshTransform(Transform parent, string child, bool setActive, bool dontDestroyOnLoad)
		{
			return MakeFreshObject(child, setActive, dontDestroyOnLoad, parent).transform;
		}

		public static GameObject MakeFreshObject(string newGameObjectName, bool setActive, bool dontDestroyOnLoad, Transform parent = null)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			GameObject val = new GameObject(newGameObjectName);
			val.SetActive(setActive);
			if ((Object)(object)parent != (Object)null)
			{
				val.transform.SetParent(parent);
			}
			if (dontDestroyOnLoad)
			{
				RecursiveDontDestroyOnLoad(val.transform);
			}
			return val;
		}

		public static void RecursiveDontDestroyOnLoad(Transform transform)
		{
			Transform val = transform;
			while ((Object)(object)val.parent != (Object)null)
			{
				val = val.parent;
			}
			Object.DontDestroyOnLoad((Object)(object)((Component)val).gameObject);
		}
	}
	public enum Behaviour
	{
		Add,
		Purge,
		Replace
	}
	public class TinyItemManager
	{
		private static Dictionary<int, ItemLocalization> m_ItemLocalizationDictionary;

		private static Dictionary<string, Item> m_ItemPrefabDictionary;

		private static Dictionary<int, ItemLocalization> ItemLocalizationDictionary
		{
			get
			{
				if (m_ItemLocalizationDictionary == null)
				{
					m_ItemLocalizationDictionary = At.GetValue(typeof(LocalizationManager), LocalizationManager.Instance, "m_itemLocalization") as Dictionary<int, ItemLocalization>;
				}
				return m_ItemLocalizationDictionary;
			}
		}

		private static Dictionary<string, Item> ItemPrefabDictionary
		{
			get
			{
				if (m_ItemPrefabDictionary == null)
				{
					m_ItemPrefabDictionary = At.GetValue(typeof(ResourcesPrefabManager), null, "ITEM_PREFABS") as Dictionary<string, Item>;
				}
				return m_ItemPrefabDictionary;
			}
		}

		public static bool SetLegacyResult(int itemID, int legacyOutcomeID)
		{
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(itemID);
			if ((Object)(object)itemPrefab != (Object)null)
			{
				itemPrefab.LegacyItemID = legacyOutcomeID;
				return true;
			}
			return false;
		}

		public static bool AddEnchantingOption(int itemID, int enchantingRecipeID)
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(itemID);
			EnchantmentRecipe enchantmentRecipeForID = RecipeManager.Instance.GetEnchantmentRecipeForID(enchantingRecipeID);
			if ((Object)(object)enchantmentRecipeForID != (Object)null && (Object)(object)itemPrefab != (Object)null)
			{
				List<IngredientData> list = enchantmentRecipeForID.CompatibleEquipments.CompatibleEquipments.ToList();
				list.Add(new IngredientData
				{
					Type = (IngredientType)1,
					SpecificIngredient = itemPrefab
				});
				enchantmentRecipeForID.CompatibleEquipments = new EquipmentData
				{
					EquipmentTag = enchantmentRecipeForID.CompatibleEquipments.EquipmentTag,
					CompatibleEquipments = list.ToArray()
				};
				return true;
			}
			return false;
		}

		public static Item MakeItem(int newID, int targetID, string name = null, string description = null, string identifierName = null)
		{
			Item val = TryCloneTargetItem(newID, targetID, newID + "_" + identifierName);
			ApplyNameAndDescription(val, name, description);
			return val;
		}

		public static Skill MakeSkill(int newID, int targetID, string name = null, string description = null, string identifierName = null, int? manaCost = 0, int? staminaCost = 0, int? healthCost = 0, bool? ignoreLearnNotification = null, bool? hideInUI = null)
		{
			Item obj = MakeItem(newID, targetID, name, description, identifierName);
			Skill val = (Skill)(object)((obj is Skill) ? obj : null);
			if (manaCost.HasValue)
			{
				val.ManaCost = manaCost.GetValueOrDefault();
			}
			if (healthCost.HasValue)
			{
				val.HealthCost = healthCost.GetValueOrDefault();
			}
			if (staminaCost.HasValue)
			{
				val.StaminaCost = staminaCost.GetValueOrDefault();
			}
			val.IgnoreLearnNotification = ignoreLearnNotification.GetValueOrDefault();
			return val;
		}

		public static Item TryCloneTargetItem(int newID, int targetID, string identifierName = null)
		{
			Dictionary<string, Item> itemPrefabDictionary = ItemPrefabDictionary;
			Item item = GetItem(targetID.ToString());
			if ((Object)(object)item == (Object)null)
			{
				TinyHelper.TinyHelperPrint("Could not find target item with ID " + targetID + ".");
				return null;
			}
			if ((Object)(object)((Component)item).gameObject.GetComponent<Item>() == (Object)null)
			{
				TinyHelper.TinyHelperPrint(((Object)item).name + " is does not have an Item component.");
				return null;
			}
			GameObject val = Object.Instantiate<GameObject>(((Component)item).gameObject);
			val.SetActive(false);
			Object.DontDestroyOnLoad((Object)(object)val);
			Item component = val.GetComponent<Item>();
			component.ItemID = newID;
			((Object)component).name = identifierName ?? (newID + "_" + component.Name.Replace(" ", ""));
			ItemPrefabDictionary.Add(component.ItemID.ToString(), component);
			return component;
		}

		public static void ApplyNameAndDescription(Item item, string name, string description)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			ItemLocalization value = new ItemLocalization(name, description);
			At.SetValue(name, typeof(Item), item, "m_name");
			if (ItemLocalizationDictionary.ContainsKey(item.ItemID))
			{
				ItemLocalizationDictionary[item.ItemID] = value;
			}
			else
			{
				ItemLocalizationDictionary.Add(item.ItemID, value);
			}
		}

		private static Item GetItem(int itemID)
		{
			return GetItem(itemID.ToString());
		}

		private static Item GetItem(string itemID)
		{
			return ItemPrefabDictionary[itemID];
		}
	}
	public class TinyHelperRPCManager : MonoBehaviour
	{
		public static TinyHelperRPCManager Instance;

		internal void Start()
		{
			Instance = this;
			PhotonView val = ((Component)this).gameObject.AddComponent<PhotonView>();
			val.viewID = 954;
			Debug.Log((object)("Registered TinyHelpertRPC with ViewID " + ((MonoBehaviour)this).photonView.viewID));
		}

		[PunRPC]
		public void ApplyAddImbueEffectRPC(string weaponGUID, int infusionID, float duration)
		{
			Item item = ItemManager.Instance.GetItem(weaponGUID);
			Weapon val = (Weapon)(object)((item is Weapon) ? item : null);
			? val2 = val;
			EffectPreset effectPreset = ResourcesPrefabManager.Instance.GetEffectPreset(infusionID);
			((Weapon)val2).AddImbueEffect((ImbueEffectPreset)(object)((effectPreset is ImbueEffectPreset) ? effectPreset : null), duration, (ImbueStack)null);
		}

		[PunRPC]
		public void CharacterForceCancelRPC(string characterGUID, bool bool1, bool bool2)
		{
			Character character = CharacterManager.Instance.GetCharacter(characterGUID);
			character.ForceCancel(bool1, bool2);
		}
	}
	public class QuestRequirements
	{
		public static bool HasQuestEvent(string questEventUID)
		{
			return QuestEventManager.Instance.GetEventCurrentStack(questEventUID) > 0;
		}

		public static bool HasQuestKnowledge(Character character, int[] questIDs, LogicType logicType, bool inverted = false, bool requireCompleted = false)
		{
			bool flag = false;
			object obj;
			if (character == null)
			{
				obj = null;
			}
			else
			{
				CharacterInventory inventory = character.Inventory;
				obj = ((inventory != null) ? inventory.QuestKnowledge : null);
			}
			CharacterQuestKnowledge q = (CharacterQuestKnowledge)obj;
			if (q != null)
			{
				IEnumerable<bool> source = questIDs.Select((int x) => ((CharacterKnowledge)q).IsItemLearned(x) && (q.IsQuestCompleted(x) || !requireCompleted));
				flag = flag || ((logicType == LogicType.Any) ? source.Any((bool x) => x) : source.All((bool x) => x));
			}
			return flag ^ inverted;
		}

		public static bool HasQuestKnowledgeLocal(Character character, int[] questIDs, LogicType logicType, bool inverted = false, bool requireCompleted = false)
		{
			bool flag = false;
			object obj;
			if (character == null)
			{
				obj = null;
			}
			else
			{
				CharacterInventory inventory = character.Inventory;
				obj = ((inventory != null) ? inventory.QuestKnowledge : null);
			}
			CharacterQuestKnowledge q = (CharacterQuestKnowledge)obj;
			if (q != null)
			{
				IEnumerable<bool> source = questIDs.Select((int x) => q.IsItemLearnedLocal(x) && (q.IsQuestCompletedLocal(x) || !requireCompleted));
				flag = flag || ((logicType == LogicType.Any) ? source.Any((bool x) => x) : source.All((bool x) => x));
			}
			return flag ^ inverted;
		}
	}
	public enum LogicType
	{
		Any,
		All
	}
	public class SkillRequirements
	{
		public static bool SafeHasSkillKnowledge(Character character, int skillID)
		{
			bool? obj;
			if (character == null)
			{
				obj = null;
			}
			else
			{
				CharacterInventory inventory = character.Inventory;
				if (inventory == null)
				{
					obj = null;
				}
				else
				{
					CharacterSkillKnowledge skillKnowledge = inventory.SkillKnowledge;
					obj = ((skillKnowledge != null) ? new bool?(((CharacterKnowledge)skillKnowledge).IsItemLearned(skillID)) : null);
				}
			}
			bool? flag = obj;
			return flag.GetValueOrDefault();
		}
	}
	public class CustomTexture
	{
		public enum SpriteBorderTypes
		{
			None,
			Item,
			TrainerSkill
		}

		public enum IconName
		{
			m_itemIcon,
			SkillTreeIcon
		}

		private static Dictionary<string, byte[]> m_loadedTextures;

		private static Dictionary<string, byte[]> LoadedTextures
		{
			get
			{
				if (m_loadedTextures == null)
				{
					m_loadedTextures = new Dictionary<string, byte[]>();
				}
				return m_loadedTextures;
			}
		}

		public static Texture2D LoadTexture(string filePath, int mipCount, bool linear, FilterMode filterMode, float? mipMapBias = null, string rootPath = null)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			filePath = (rootPath ?? TinyHelper.PLUGIN_ROOT_PATH) + filePath;
			if (!LoadedTextures.ContainsKey(filePath))
			{
				LoadedTextures[filePath] = File.ReadAllBytes(filePath);
			}
			Texture2D val = new Texture2D(4, 4, (TextureFormat)12, mipCount > 0, linear);
			((Texture)val).filterMode = filterMode;
			((Texture)val).mipMapBias = mipMapBias ?? ((Texture)val).mipMapBias;
			ImageConversion.LoadImage(val, LoadedTextures[filePath]);
			((Texture)val).filterMode = (FilterMode)1;
			return val;
		}

		public static Sprite MakeSprite(Texture2D texture, SpriteBorderTypes spriteBorderType)
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			float num;
			float num2;
			float num3;
			float num4;
			switch (spriteBorderType)
			{
			case SpriteBorderTypes.Item:
				num = 1f;
				num2 = 2f;
				num3 = 2f;
				num4 = 3f;
				break;
			case SpriteBorderTypes.TrainerSkill:
				num = 1f;
				num2 = 1f;
				num3 = 1f;
				num4 = 2f;
				break;
			default:
				num = 0f;
				num2 = 0f;
				num3 = 0f;
				num4 = 0f;
				break;
			}
			return Sprite.Create(texture, new Rect(num, num3, (float)((Texture)texture).width - num2, (float)((Texture)texture).height - num4), new Vector2(0f, 0f), 100f, 0u);
		}
	}
	public class CooldownChangeWeaponDamageTargetHealth : WeaponDamageTargetHealth
	{
		public float ExecuteSetCooldown = -1f;

		public float HitKnockbackCooldown = -1f;

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			Item parentItem = ((Effect)this).ParentItem;
			Skill val = (Skill)(object)((parentItem is Skill) ? parentItem : null);
			if (val != null)
			{
				if (HitKnockbackCooldown != -1f && _affectedCharacter.IsInKnockback)
				{
					At.SetValue(HitKnockbackCooldown, typeof(Skill), val, "m_remainingCooldownTime");
				}
				bool isDead = _affectedCharacter.IsDead;
				((WeaponDamage)this).ActivateLocally(_affectedCharacter, _infos);
				if (!isDead && _affectedCharacter.IsDead && ExecuteSetCooldown != -1f)
				{
					At.SetValue(ExecuteSetCooldown, typeof(Skill), val, "m_remainingCooldownTime");
				}
			}
		}
	}
	public class ToggleEffect : Effect
	{
		public StatusEffect StatusEffectInstance;

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			if (_affectedCharacter.StatusEffectMngr.HasStatusEffect(StatusEffectInstance.IdentifierName))
			{
				_affectedCharacter.StatusEffectMngr.CleanseStatusEffect(((Object)StatusEffectInstance).name);
			}
			else
			{
				_affectedCharacter.StatusEffectMngr.AddStatusEffect(StatusEffectInstance, ((Effect)this).SourceCharacter);
			}
		}
	}
	public class AddThenSpreadStatus : AddStatusEffect
	{
		public float Range;

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if (base.AffectController)
			{
				_affectedCharacter = ((Effect)this).OwnerCharacter;
			}
			if ((Object)(object)((_affectedCharacter != null) ? _affectedCharacter.StatusEffectMngr : null) == (Object)null || (Object)(object)base.Status == (Object)null)
			{
				return;
			}
			if (_affectedCharacter.StatusEffectMngr.HasStatusEffect(base.Status.IdentifierName))
			{
				List<Character> source = new List<Character>();
				CharacterManager.Instance.FindCharactersInRange(_affectedCharacter.CenterPosition, Range, ref source);
				foreach (Character item in source.Where((Character c) => !c.IsAlly(((Effect)this).SourceCharacter)))
				{
					((AddStatusEffect)this).ActivateLocally(item, _infos);
				}
			}
			((AddStatusEffect)this).ActivateLocally(_affectedCharacter, _infos);
		}
	}
	public class EmptyOffHandCondition : EffectCondition
	{
		public bool AllowDrawnTwoHandedInRight = false;

		public bool AllowSheathedTwoHandedInLeft = false;

		protected override bool CheckIsValid(Character _affectedCharacter)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_affectedCharacter == (Object)null)
			{
				goto IL_00dc;
			}
			bool? obj;
			if (_affectedCharacter == null)
			{
				obj = null;
			}
			else
			{
				Equipment leftHandEquipment = _affectedCharacter.LeftHandEquipment;
				obj = ((leftHandEquipment != null) ? new bool?(((Item)leftHandEquipment).HasTag(TinyTagManager.GetOrMakeTag("HandsFreeTag"))) : null);
			}
			if (obj ?? true)
			{
				bool? obj2;
				if (_affectedCharacter == null)
				{
					obj2 = null;
				}
				else
				{
					Weapon currentWeapon = _affectedCharacter.CurrentWeapon;
					obj2 = ((currentWeapon != null) ? new bool?(((Equipment)currentWeapon).TwoHanded) : null);
				}
				bool? flag = obj2;
				if (!flag.GetValueOrDefault())
				{
					goto IL_00dc;
				}
			}
			if (!_affectedCharacter.Sheathed && AllowDrawnTwoHandedInRight)
			{
				Weapon currentWeapon2 = _affectedCharacter.CurrentWeapon;
				if (currentWeapon2 == null || ((Equipment)currentWeapon2).TwoHandedRight)
				{
					goto IL_00dc;
				}
			}
			int result;
			if (_affectedCharacter.Sheathed && AllowSheathedTwoHandedInLeft)
			{
				Weapon currentWeapon3 = _affectedCharacter.CurrentWeapon;
				result = ((currentWeapon3 == null || ((Equipment)currentWeapon3).TwoHandedRight) ? 1 : 0);
			}
			else
			{
				result = 0;
			}
			goto IL_00dd;
			IL_00dc:
			result = 1;
			goto IL_00dd;
			IL_00dd:
			return (byte)result != 0;
		}

		public static ActivationCondition AddToSkill(Skill skill, bool allowDrawnTwoHandedInRight = false, bool allowSheathedTwoHandedInLeft = false)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			GameObject val = new GameObject("EmptyOffhandCondition");
			ActivationCondition val2 = new ActivationCondition();
			EmptyOffHandCondition emptyOffHandCondition = val.AddComponent<EmptyOffHandCondition>();
			Object.DontDestroyOnLoad((Object)(object)emptyOffHandCondition);
			val.SetActive(false);
			val2.Condition = (EffectCondition)(object)emptyOffHandCondition;
			emptyOffHandCondition.AllowDrawnTwoHandedInRight = allowDrawnTwoHandedInRight;
			emptyOffHandCondition.AllowSheathedTwoHandedInLeft = allowSheathedTwoHandedInLeft;
			At.SetValue("Requires an empty left hand.", typeof(ActivationCondition), val2, "m_defaultMessage");
			List<ActivationCondition> list = (At.GetValue(typeof(Skill), skill, "m_additionalConditions") as ActivationCondition[])?.ToList() ?? new List<ActivationCondition>();
			list.Add(val2);
			At.SetValue(list.ToArray(), typeof(Skill), skill, "m_additionalConditions");
			return val2;
		}
	}
	internal class InputEnablerEffect : Effect
	{
		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			StatusEffect parentStatusEffect = base.m_parentStatusEffect;
			if (parentStatusEffect != null && (double)((_affectedCharacter != null) ? _affectedCharacter.AnimMoveSqMagnitude : 0f) > 0.1 && (double)parentStatusEffect.Age > 0.5)
			{
				StatusEffectManager statusEffectMngr = _affectedCharacter.StatusEffectMngr;
				if (statusEffectMngr != null)
				{
					statusEffectMngr.CleanseStatusEffect(parentStatusEffect.IdentifierName);
				}
				_affectedCharacter.ForceCancel(true, true);
			}
		}
	}
	internal class TinyUnofficialPatches
	{
	}
	[HarmonyPatch(typeof(Skill), "HasEnoughMana")]
	public class Skill_HasEnoughMana
	{
		[HarmonyPostfix]
		public static void Postfix(Skill __instance, ref bool _tryingToActivate, ref bool __result)
		{
			if (__instance.ManaCost <= 0f)
			{
				__result = true;
			}
		}
	}
	[HarmonyPatch(typeof(Skill), "HasEnoughStamina")]
	public class Skill_HasEnoughStamina
	{
		[HarmonyPostfix]
		public static void Postfix(Skill __instance, ref bool _tryingToActivate, ref bool __result)
		{
			if (__instance.StaminaCost <= 0f)
			{
				__result = true;
			}
		}
	}
	[HarmonyPatch(typeof(Skill), "HasEnoughHealth")]
	public class Skill_HasEnoughHealth
	{
		[HarmonyPostfix]
		public static void Postfix(Skill __instance, ref bool _tryingToActivate, ref bool __result)
		{
			if (__instance.HealthCost <= 0f)
			{
				__result = true;
			}
		}
	}
	public class WeaponManager
	{
		public static Dictionary<WeaponType, float> Speeds = new Dictionary<WeaponType, float>
		{
			{
				(WeaponType)0,
				1.251f
			},
			{
				(WeaponType)1,
				1.399f
			},
			{
				(WeaponType)2,
				1.629f
			},
			{
				(WeaponType)51,
				1.71f
			},
			{
				(WeaponType)52,
				1.667f
			},
			{
				(WeaponType)53,
				2.036f
			},
			{
				(WeaponType)54,
				1.499f
			},
			{
				(WeaponType)50,
				1.612f
			}
		};

		public static Dictionary<WeaponType, float> HeavyImpactModifiers = new Dictionary<WeaponType, float>
		{
			{
				(WeaponType)0,
				1.3f
			},
			{
				(WeaponType)1,
				1.3f
			},
			{
				(WeaponType)2,
				2.5f
			},
			{
				(WeaponType)51,
				1.5f
			},
			{
				(WeaponType)52,
				1.3f
			},
			{
				(WeaponType)53,
				2f
			},
			{
				(WeaponType)54,
				1.2f
			},
			{
				(WeaponType)50,
				1.3f
			}
		};
	}
	public class TinyTagManager
	{
		public static Tag GetOrMakeTag(string name)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			Tag val = ((IEnumerable<Tag>)TagSourceManager.Instance.DbTags).FirstOrDefault((Func<Tag, bool>)((Tag x) => x.TagName == name));
			if (val == Tag.None)
			{
				((Tag)(ref val))..ctor(TagSourceManager.TagRoot, name);
				((Tag)(ref val)).SetTagType((TagTypes)0);
				TagSourceManager.Instance.DbTags.Add(val);
				TagSourceManager.Instance.RefreshTags(true);
				return val;
			}
			return val;
		}

		public static string[] GetOrMakeTags(string[] names)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			foreach (string name in names)
			{
				GetOrMakeTag(name);
			}
			return names;
		}

		public static string[] GetSafeTags(string[] tags)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			List<string> list = new List<string>();
			foreach (string tag in tags)
			{
				((IEnumerable<Tag>)TagSourceManager.Instance.DbTags).FirstOrDefault((Func<Tag, bool>)((Tag x) => x.TagName == tag || ((Tag)(ref x)).UID == UID.op_Implicit(tag)));
				if (true)
				{
					list.Add(tag);
				}
			}
			return list.ToArray();
		}
	}
	public class TinyUIDManager
	{
		public static UID MakeUID(string name, string modGUID, string category)
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: 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)
			if (modGUID == null || name == null || category == null)
			{
				Debug.LogError((object)$"TinyUIDManager.MakeUID({name}, {modGUID}, {category} returned a random UID. This will cause trouble in multiplayer!");
				return default(UID);
			}
			return new UID((modGUID + "." + category + "." + name).Replace(" ", "").ToLower());
		}
	}
	[BepInPlugin("com.ehaugw.tinyhelper", "Tiny Helper", "4.8.2")]
	public class TinyHelper : BaseUnityPlugin
	{
		public delegate void DescriptionModifier(Item item, ref string description);

		[HarmonyPatch(typeof(ResourcesPrefabManager), "Load")]
		public class ResourcesPrefabManager_Load
		{
			[HarmonyPostfix]
			public static void Postfix()
			{
				ResourcesPrefabManager instance = ResourcesPrefabManager.Instance;
				if (instance != null && instance.Loaded)
				{
					TinyHelper.OnPrefabLoaded();
				}
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		public class Item_Description
		{
			[HarmonyPostfix]
			public static void Postfix(Item __instance, ref string __result)
			{
				OnDescriptionModified(__instance, ref __result);
			}
		}

		public const string GUID = "com.ehaugw.tinyhelper";

		public const string VERSION = "4.8.2";

		public const string NAME = "Tiny Helper";

		public static DescriptionModifier OnDescriptionModified;

		public static TinyHelper Instance;

		private static int tinyHelperPrintedMessages;

		public static string PLUGIN_ROOT_PATH => typeof(TinyHelper).Assembly.Location + "\\..\\..\\";

		public static event Action OnPrefabLoaded;

		internal void Awake()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			Instance = this;
			GameObject val = new GameObject("TinyHelperRPC");
			Object.DontDestroyOnLoad((Object)(object)val);
			val.AddComponent<TinyHelperRPCManager>();
			Harmony val2 = new Harmony("com.ehaugw.tinyhelper");
			val2.PatchAll();
		}

		public static void TinyHelperPrint(string str)
		{
			Debug.Log((object)("TinyHelper #" + tinyHelperPrintedMessages++ + ": " + str));
		}

		static TinyHelper()
		{
			TinyHelper.OnPrefabLoaded = delegate
			{
			};
			OnDescriptionModified = delegate
			{
			};
			tinyHelperPrintedMessages = 0;
		}
	}
	public class DelayedTask
	{
		public static Task GetTask(int milliseconds)
		{
			TaskCompletionSource<object> tcs = new TaskCompletionSource<object>();
			new Timer(delegate
			{
				tcs.SetResult(null);
			}).Change(milliseconds, -1);
			return tcs.Task;
		}
	}
	public class TinyEffectManager
	{
		public static StatusEffect MakeStatusEffectPrefab(string effectName, string familyName, string description, float lifespan, float refreshRate, StackBehaviors stackBehavior, string targetStatusName, bool isMalusEffect, string tagID = null, UID? uid = null, string modGUID = null, string iconFileName = null, string displayName = null, string rootPath = null)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Expected O, but got Unknown
			//IL_0194: Expected O, but got Unknown
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Expected O, but got Unknown
			Dictionary<string, StatusEffect> dictionary = At.GetValue(typeof(ResourcesPrefabManager), null, "STATUSEFFECT_PREFABS") as Dictionary<string, StatusEffect>;
			StatusEffectFamily val = MakeStatusEffectFamiliy(familyName, stackBehavior, -1, (LengthTypes)0);
			GameObject val2 = TinyGameObjectManager.InstantiateClone(((Component)dictionary[targetStatusName]).gameObject, effectName, setActive: false, dontDestroyOnLoad: true);
			StatusEffect obj = val2.GetComponent<StatusEffect>() ?? val2.AddComponent<StatusEffect>();
			StatusEffect val3 = obj;
			dictionary[effectName] = obj;
			StatusEffect val4 = val3;
			At.SetValue(effectName, typeof(StatusEffect), val4, "m_identifierName");
			At.SetValue<StatusEffectFamily>(val, typeof(StatusEffect), val4, "m_bindFamily");
			At.SetValue(displayName ?? effectName, typeof(StatusEffect), val4, "m_nameLocKey");
			At.SetValue(description, typeof(StatusEffect), val4, "m_descriptionLocKey");
			val4.RefreshRate = refreshRate;
			val4.IsMalusEffect = isMalusEffect;
			At.SetValue<EffectSignatureModes>((EffectSignatureModes)1, typeof(StatusEffect), val4, "m_effectSignatureMode");
			At.SetValue<FamilyModes>((FamilyModes)0, typeof(StatusEffect), val4, "m_familyMode");
			val4.RequiredStatus = null;
			val4.RemoveRequiredStatus = false;
			if (iconFileName != null)
			{
				val4.OverrideIcon = CustomTexture.MakeSprite(CustomTexture.LoadTexture(iconFileName, 0, linear: false, (FilterMode)0, null, rootPath), CustomTexture.SpriteBorderTypes.None);
			}
			TagSourceSelector value = ((tagID != null) ? new TagSourceSelector(TagSourceManager.Instance.GetTag(UID.op_Implicit(tagID))) : new TagSourceSelector());
			At.SetValue<TagSourceSelector>(value, typeof(StatusEffect), val4, "m_effectType");
			StatusData val5 = new StatusData(val4.StatusData);
			StatusData val6 = val5;
			val4.StatusData = val5;
			StatusData val7 = val6;
			val7.LifeSpan = lifespan;
			List<StatusData> list = At.GetValue(typeof(StatusEffect), val4, "m_statusStack") as List<StatusData>;
			list[0] = val7;
			Object.Destroy((Object)(object)((Component)val2.GetComponentInChildren<EffectSignature>()).gameObject);
			EffectSignature val8 = TinyGameObjectManager.MakeFreshObject("Signature", setActive: true, dontDestroyOnLoad: true).AddComponent<EffectSignature>();
			((Object)val8).name = "Signature";
			val8.SignatureUID = (UID)(((??)uid) ?? TinyUIDManager.MakeUID(effectName, modGUID, "Status Effect"));
			EffectSignature effectSignature = (val7.EffectSignature = val8);
			val.EffectSignature = effectSignature;
			StatusEffectFamilySelector val10 = new StatusEffectFamilySelector();
			((UidSelector<StatusEffectFamily>)(object)val10).Set(val);
			At.SetValue<StatusEffectFamilySelector>(val10, typeof(StatusEffect), val4, "m_stackingFamily");
			return val4;
		}

		public static StatusEffectFamily MakeStatusEffectFamiliy(string familyName, StackBehaviors stackBehavior, int maxStackCount, LengthTypes lengthType, UID? uid = null, string modGUID = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			StatusEffectFamily val = new StatusEffectFamily();
			uid = (UID)(((??)uid) ?? ((modGUID != null) ? TinyUIDManager.MakeUID(familyName, modGUID, "Status Effect Family") : UID.Generate()));
			At.SetValue<UID>(uid.Value, typeof(StatusEffectFamily), val, "m_uid");
			val.Name = familyName;
			val.StackBehavior = stackBehavior;
			val.MaxStackCount = maxStackCount;
			val.LengthType = lengthType;
			return val;
		}

		public static void SetNameAndDesc(EffectPreset imbueEffect, string name, string desc)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			ItemLocalization value = new ItemLocalization(name, desc);
			if (At.GetValue(typeof(LocalizationManager), LocalizationManager.Instance, "m_itemLocalization") is Dictionary<int, ItemLocalization> dictionary)
			{
				if (dictionary.ContainsKey(imbueEffect.PresetID))
				{
					dictionary[imbueEffect.PresetID] = value;
				}
				else
				{
					dictionary.Add(imbueEffect.PresetID, value);
				}
			}
		}

		public static AddStatusEffectBuildUp MakeStatusEffectBuildup(Transform effectTransform, string statusEffectName, float buildup)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			AddStatusEffectBuildUp val = ((Component)effectTransform).gameObject.AddComponent<AddStatusEffectBuildUp>();
			val.BuildUpValue = buildup;
			val.Status = ResourcesPrefabManager.Instance.GetStatusEffectPrefab(statusEffectName);
			((Effect)val).OverrideEffectCategory = (EffectCategories)4;
			return val;
		}

		public static AddStatusEffect MakeStatusEffectChance(Transform effectTransform, string statusEffectName, int chance)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			AddStatusEffect val = ((Component)effectTransform).gameObject.AddComponent<AddStatusEffect>();
			val.SetChanceToContract(chance);
			val.Status = ResourcesPrefabManager.Instance.GetStatusEffectPrefab(statusEffectName);
			((Effect)val).OverrideEffectCategory = (EffectCategories)4;
			return val;
		}

		public static WeaponDamage MakeWeaponDamage(Transform effectTransform, float baseDamage, float damageScaling, Types damageType, float knockback)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			WeaponDamage val = ((Component)effectTransform).gameObject.AddComponent<WeaponDamage>();
			val.WeaponDamageMult = 1f + damageScaling;
			val.OverrideDType = damageType;
			((PunctualDamage)val).Damages = (DamageType[])(object)new DamageType[1]
			{
				new DamageType(damageType, baseDamage)
			};
			((Effect)val).OverrideEffectCategory = (EffectCategories)4;
			((PunctualDamage)val).Knockback = knockback;
			return val;
		}

		public static WeaponDamage MakeDynamicWeaponDamage(Transform effectTransform, IDamageScaler damageScaler)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			DynamicWeaponDamage dynamicWeaponDamage = ((Component)effectTransform).gameObject.AddComponent<DynamicWeaponDamage>();
			((Effect)dynamicWeaponDamage).OverrideEffectCategory = (EffectCategories)4;
			dynamicWeaponDamage.DamageScaler = damageScaler;
			return (WeaponDamage)(object)dynamicWeaponDamage;
		}

		public static void MakeAbsorbHealth(Transform effectTransform, float absorbRatio)
		{
			AddAbsorbHealth obj = ((Component)effectTransform).gameObject.AddComponent<AddAbsorbHealth>();
			At.SetValue(absorbRatio, typeof(AddAbsorbHealth), obj, "m_healthRatio");
		}

		public static ImbueEffectPreset MakeImbuePreset(int imbueID, string name, string description, string iconFileName = null, int? visualEffectID = null, List<Skill> replaceOnSkills = null, string statusEffectName = null, int? chanceToContract = null, int? buildUp = null, float? scalingDamage = null, float? flatDamage = null, float? knockback = null, Types? damageType = null)
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Expected O, but got Unknown
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Expected O, but got I4
			//IL_023b->IL023b: Incompatible stack types: O vs I4
			//IL_0234->IL023b: Incompatible stack types: I4 vs O
			//IL_0234->IL023b: Incompatible stack types: O vs I4
			Dictionary<int, EffectPreset> dictionary = (Dictionary<int, EffectPreset>)At.GetValue(typeof(ResourcesPrefabManager), null, "EFFECTPRESET_PREFABS");
			if (!dictionary.ContainsKey(imbueID))
			{
				GameObject val = new GameObject(imbueID + "_" + name.Replace(" ", ""));
				val.SetActive(true);
				Object.DontDestroyOnLoad((Object)(object)val);
				ImbueEffectPreset val2 = val.AddComponent<ImbueEffectPreset>();
				((Object)val2).name = imbueID + "_" + name.Replace(" ", "");
				At.SetValue(imbueID, typeof(EffectPreset), val2, "m_StatusEffectID");
				At.SetValue(name, typeof(ImbueEffectPreset), val2, "m_imbueNameKey");
				At.SetValue(description, typeof(ImbueEffectPreset), val2, "m_imbueDescKey");
				if (visualEffectID.HasValue)
				{
					val2.ImbueStatusIcon = ((ImbueEffectPreset)dictionary[visualEffectID.Value]).ImbueStatusIcon;
					val2.ImbueFX = ((ImbueEffectPreset)dictionary[visualEffectID.Value]).ImbueFX;
				}
				if (iconFileName != null)
				{
					val2.ImbueStatusIcon = CustomTexture.MakeSprite(CustomTexture.LoadTexture(iconFileName, 0, linear: false, (FilterMode)0), CustomTexture.SpriteBorderTypes.None);
				}
				SetNameAndDesc((EffectPreset)(object)val2, name, description);
				dictionary.Add(imbueID, (EffectPreset)(object)val2);
				if (statusEffectName != null && chanceToContract.GetValueOrDefault() > 0)
				{
					MakeStatusEffectChance(TinyGameObjectManager.GetOrMake(((Component)val2).transform, "Effects", setActive: true, dontDestroyOnLoad: true), statusEffectName, chanceToContract.GetValueOrDefault());
				}
				if (statusEffectName != null && buildUp.GetValueOrDefault() > 0)
				{
					MakeStatusEffectBuildup(TinyGameObjectManager.GetOrMake(((Component)val2).transform, "Effects", setActive: true, dontDestroyOnLoad: true), statusEffectName, buildUp.GetValueOrDefault());
				}
				if (scalingDamage.GetValueOrDefault() > 0f || flatDamage.GetValueOrDefault() > 0f || knockback.GetValueOrDefault() > 0f)
				{
					object obj = TinyGameObjectManager.GetOrMake(((Component)val2).transform, "Effects", setActive: true, dontDestroyOnLoad: true);
					float valueOrDefault = flatDamage.GetValueOrDefault();
					valueOrDefault = scalingDamage.GetValueOrDefault();
					Types? val3 = damageType;
					int num;
					if (val3.HasValue)
					{
						obj = val3.GetValueOrDefault();
						num = (int)obj;
					}
					else
					{
						num = 9;
						obj = num;
						num = (int)obj;
					}
					MakeWeaponDamage((Transform)(object)num, valueOrDefault, valueOrDefault, (Types)obj, knockback.GetValueOrDefault());
				}
				foreach (Skill item in replaceOnSkills ?? new List<Skill>())
				{
					if ((Object)(object)item != (Object)null)
					{
						((ImbueObject)((Component)item).GetComponentInChildren<ImbueWeapon>()).ImbuedEffect = val2;
					}
				}
				return val2;
			}
			return null;
		}

		public static EffectPreset GetEffectPreset(int effectID)
		{
			Dictionary<int, EffectPreset> dictionary = (Dictionary<int, EffectPreset>)At.GetValue(typeof(ResourcesPrefabManager), null, "EFFECTPRESET_PREFABS");
			if (dictionary.ContainsKey(effectID))
			{
				EffectPreset val = dictionary[effectID];
				if (val != null)
				{
					return val;
				}
			}
			return null;
		}

		public static void AddStatusEffectForDuration(Character character, string _statusIdentifier, float duration, Character source = null, float chance = 1f)
		{
			StatusEffect statusEffectPrefab = ResourcesPrefabManager.Instance.GetStatusEffectPrefab(_statusIdentifier);
			AddStatusEffectForDuration(character, statusEffectPrefab, duration, source, chance);
		}

		public static void AddStatusEffectForDuration(Character character, StatusEffect statusEffect, float duration, Character source = null, float chance = 1f)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			StatusEffectManager statusEffectMngr = character.StatusEffectMngr;
			if (statusEffectMngr != null)
			{
				StatusData statusData = statusEffect.StatusData;
				statusEffect.StatusData = new StatusData(statusData);
				statusEffect.StatusData.LifeSpan = duration;
				statusEffectMngr.AddStatusEffect(statusEffect, source);
				statusEffect.StatusData = statusData;
			}
		}

		public static void ChangeEffectPresetDamageTypeData(EffectPreset effect, Types originalType, Types newType)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_006a: 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)
			PunctualDamage[] componentsInChildren = ((Component)effect).gameObject.GetComponentsInChildren<PunctualDamage>();
			foreach (PunctualDamage val in componentsInChildren)
			{
				WeaponDamage val2 = (WeaponDamage)(object)((val is WeaponDamage) ? val : null);
				if (val2 != null && val2.OverrideDType == originalType)
				{
					val2.OverrideDType = newType;
				}
				DamageType[] damages = val.Damages;
				foreach (DamageType val3 in damages)
				{
					if (val3.Type == originalType)
					{
						val3.Type = newType;
					}
				}
			}
		}
	}
	public class CasualStagger : Effect
	{
		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			Stagger(_affectedCharacter);
		}

		public static void Stagger(Character character)
		{
			At.SetValue<HurtType>((HurtType)1, typeof(Character), character, "m_hurtType");
			character.Animator.SetTrigger("Knockback");
			character.ForceCancel(false, true);
			((MonoBehaviour)character).Invoke("DelayedForceCancel", 0.3f);
			if (Object.op_Implicit((Object)(object)character.CharacterUI))
			{
				character.CharacterUI.OnPlayerKnocked();
			}
		}
	}
	public class CooldownChangeWeaponDamage : WeaponDamage
	{
		public float ExecutionSetCooldown = -1f;

		public float HitKnockbackCooldown = -1f;

		protected override void ActivateLocally(Character _affectedCharacter, object[] _infos)
		{
			Item parentItem = ((Effect)this).ParentItem;
			Skill val = (Skill)(object)((parentItem is Skill) ? parentItem : null);
			if (val != null)
			{
				if (HitKnockbackCooldown != -1f && _affectedCharacter.IsInKnockback)
				{
					At.SetValue(HitKnockbackCooldown, typeof(Skill), val, "m_remainingCooldownTime");
				}
				bool isDead = _affectedCharacter.IsDead;
				((WeaponDamage)this).ActivateLocally(_affectedCharacter, _infos);
				if (!isDead && _affectedCharacter.IsDead && ExecutionSetCooldown != -1f)
				{
					At.SetValue(ExecutionSetCooldown, typeof(Skill), val, "m_remainingCooldownTime");
				}
			}
		}
	}
}
namespace TinyHelper.Interfaces
{
	public interface IDamageScaler
	{
		float GetWeaponDamageMult(WeaponDamage weaponDamage);

		Types GetOverrideDType(WeaponDamage weaponDamage);

		DamageType[] GetDamages(WeaponDamage weaponDamage);

		float GetKnockback(WeaponDamage weaponDamage);
	}
}
namespace TinyHelper.Effects
{
	public class DynamicWeaponDamage : WeaponDamage
	{
		public IDamageScaler DamageScaler = null;

		private void Recalculate()
		{
			//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)
			Console.WriteLine("recalculated");
			Debug.WriteLine("recalculated");
			base.WeaponDamageMult = DamageScaler.GetWeaponDamageMult((WeaponDamage)(object)this);
			base.OverrideDType = DamageScaler.GetOverrideDType((WeaponDamage)(object)this);
			((PunctualDamage)this).Damages = DamageScaler.GetDamages((WeaponDamage)(object)this);
			((PunctualDamage)this).Knockback = DamageScaler.GetKnockback((WeaponDamage)(object)this);
		}

		protected override void StartInit()
		{
			Recalculate();
			((WeaponDamage)this).StartInit();
		}

		public override Weapon BuildDamage(Character _targetCharacter, ref DamageList _list, ref float _knockback)
		{
			Recalculate();
			return ((WeaponDamage)this).BuildDamage(_targetCharacter, ref _list, ref _knockback);
		}

		protected override void BuildDamage(Weapon _weapon, Character _targetCharacter, bool _isSkillOrShield, ref DamageList _list, ref float _knockback)
		{
			Recalculate();
			((WeaponDamage)this).BuildDamage(_weapon, _targetCharacter, _isSkillOrShield, ref _list, ref _knockback);
		}

		protected override void ActivateLocally(Character _targetCharacter, object[] _infos)
		{
			Recalculate();
			((WeaponDamage)this).ActivateLocally(_targetCharacter, _infos);
		}

		protected override DamageList DealHit(Character _targetCharacter)
		{
			Recalculate();
			return ((WeaponDamage)this).DealHit(_targetCharacter);
		}

		public override float DamageMult(Character _targetCharacter, bool _isSkill)
		{
			Recalculate();
			return ((WeaponDamage)this).DamageMult(_targetCharacter, _isSkill);
		}

		public override float KnockbackMult(Character _targetCharacter, bool _isSkill)
		{
			Recalculate();
			return ((WeaponDamage)this).KnockbackMult(_targetCharacter, _isSkill);
		}
	}
	public class ShootBlastFromEffect : ShootBlast
	{
		public override void Setup(TargetingSystem _targetSystem, Transform _parent)
		{
			Character sourceCharacter = ((Effect)this).SourceCharacter;
			((Shooter)this).Setup(((sourceCharacter != null) ? sourceCharacter.TargetingSystem : null) ?? _targetSystem, _parent);
		}
	}
}