Decompiled source of Vagabond v0.0.13
plugins/IronCoin.dll
Decompiled 3 months agousing System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using SideLoader; using SideLoader.Model; [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 IronCoin; [BepInPlugin("com.ehaugw.ironcoin", "Iron Coin", "1.0.0")] public class IronCoin : BaseUnityPlugin { public const string GUID = "com.ehaugw.ironcoin"; public const string VERSION = "1.0.0"; public const string NAME = "Iron Coin"; public static IronCoin Instance; public StatusEffect impendingDoomInstance; internal void Awake() { Instance = this; SL.OnPacksLoaded += OnPackLoaded; } private void OnPackLoaded() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) SL_Item val = new SL_Item(); val.Name = "Iron Coin"; val.EffectBehaviour = (EditBehaviours)2; val.Target_ItemID = 6000070; val.New_ItemID = 2502524; val.SLPackName = Directory.GetParent(typeof(IronCoin).Assembly.Location).Name.ToString(); val.SubfolderName = "IronCoin"; val.Description = "An iron coin, minted with a faceless portrait"; SL_Item val2 = val; ((ContentTemplate)val2).ApplyTemplate(); } }
plugins/Proficiencies.dll
Decompiled 3 months agousing 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/SynchronizedWorldObjects.dll
Decompiled 3 months agousing 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.5.0")] 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 3 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 HarmonyLib; using Localizer; using NodeCanvas.DialogueTrees; using NodeCanvas.Framework; using NodeCanvas.Tasks.Actions; using NodeCanvas.Tasks.Conditions; using Photon; 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 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 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 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.5.0")] 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.5.0"; 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); } } }
plugins/TinyQuests.dll
Decompiled 3 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using HarmonyLib; using SideLoader; using SideLoader.Model; 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 TinyQuests; public class QuestLoader { public string QuestName; public int QuestId; public string ScenarioUID; public string QuestEventFamilyName; public Dictionary<string, string> QuestLogSignatures; public QuestLoader(string QuestName, int QuestId, string ScenarioUID, string QuestEventFamilyName, Dictionary<string, string> QuestLogSignatures) { this.QuestName = QuestName; this.QuestId = QuestId; this.ScenarioUID = ScenarioUID; this.QuestEventFamilyName = QuestEventFamilyName; this.QuestLogSignatures = QuestLogSignatures; } } [BepInPlugin("com.ehaugw.tinyquests", "Tiny Quests", "0.0.2")] public class TinyQuests : BaseUnityPlugin { public const string GUID = "com.ehaugw.tinyquests"; public const string VERSION = "0.0.2"; public const string NAME = "Tiny Quests"; 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.tinyquests"); val.PatchAll(); } public static Quest GetOrGiveQuestToHost(int questID) { Character worldHostCharacter = CharacterManager.Instance.GetWorldHostCharacter(); if (((CharacterKnowledge)worldHostCharacter.Inventory.QuestKnowledge).IsItemLearned(questID)) { Item itemFromItemID = ((CharacterKnowledge)worldHostCharacter.Inventory.QuestKnowledge).GetItemFromItemID(questID); return (Quest)(object)((itemFromItemID is Quest) ? itemFromItemID : null); } Item obj = ItemManager.Instance.GenerateItemNetwork(questID); Quest val = (Quest)(object)((obj is Quest) ? obj : null); ((Component)val).transform.SetParent(((Component)worldHostCharacter.Inventory.QuestKnowledge).transform); ((CharacterKnowledge)worldHostCharacter.Inventory.QuestKnowledge).AddItem((Item)(object)val); QuestProgress component = ((Component)val).GetComponent<QuestProgress>(); At.SetValue<ProgressState>((ProgressState)1, typeof(ProgressState), (object)component, "m_progressState"); return val; } public static void PrepareSLQuest(SL_Quest questTemplate, Dictionary<string, string> questLogSignatures, Action<Quest> questProgressUpdater) { //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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown List<SL_QuestLogEntrySignature> list = new List<SL_QuestLogEntrySignature>(); foreach (KeyValuePair<string, string> questLogSignature in questLogSignatures) { list.Add(new SL_QuestLogEntrySignature { UID = questLogSignature.Key, Text = questLogSignature.Value, Type = (QuestLogEntrySignatureType)0 }); } SL_ItemExtension obj = ((SL_Item)questTemplate).ItemExtensions[0]; SL_QuestProgress val = (SL_QuestProgress)(object)((obj is SL_QuestProgress) ? obj : null); val.LogSignatures = list.ToArray(); ((ContentTemplate)questTemplate).ApplyTemplate(); questTemplate.OnQuestLoaded += questProgressUpdater; } }
plugins/Vagabond.dll
Decompiled 3 months agousing 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 BepInEx; using HarmonyLib; using NodeCanvas.DialogueTrees; using NodeCanvas.Framework; using NodeCanvas.Tasks.Actions; using Photon; using Proficiencies; using SideLoader; using SideLoader.Managers; using SideLoader.Model; using SynchronizedWorldObjects; using TinyHelper; using TinyQuests; 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 Vagabond; internal class EffectInitializer { public static StatusEffect MakeTamedStatusEffectPrefab() { string text = Vagabond.ModFolderName + "\\SideLoader\\Texture2D\\tamingStatusEffect.png"; StatusEffect val = TinyEffectManager.MakeStatusEffectPrefab("Tamed", "Tamed", "Tamed", -1f, 0.2f, (StackBehaviors)1, "Bandage", false, (string)null, (UID?)null, "com.ehaugw.vagabond", text, "Tamed", (string)null); EffectSignature statusEffectSignature = val.StatusEffectSignature; TamedEffect tamedEffect = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)statusEffectSignature).transform).AddComponent<TamedEffect>(); ((Effect)tamedEffect).UseOnce = false; statusEffectSignature.Effects = new List<Effect> { (Effect)(object)tamedEffect }; val.IsHidden = false; val.DisplayInHud = true; return val; } public static StatusEffect MakeAnimalCompanionStatusEffectPrefab() { string text = Vagabond.ModFolderName + "\\SideLoader\\Texture2D\\animalCompanionStatusEffect.png"; StatusEffect val = TinyEffectManager.MakeStatusEffectPrefab("AnimalCompanionStatusEffect", "AnimalCompanionStatusEffect", "You are an animal companion", 240f, 0.2f, (StackBehaviors)1, "Bandage", false, (string)null, (UID?)null, "com.ehaugw.vagabond", text, "Animal companion", (string)null); EffectSignature statusEffectSignature = val.StatusEffectSignature; AnimalCompanionEffect animalCompanionEffect = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)statusEffectSignature).transform).AddComponent<AnimalCompanionEffect>(); ((Effect)animalCompanionEffect).UseOnce = false; statusEffectSignature.Effects = new List<Effect> { (Effect)(object)animalCompanionEffect }; val.IsHidden = false; val.DisplayInHud = true; return val; } public static void MakeTamingStatusEffectPrefab() { string text = Vagabond.ModFolderName + "\\SideLoader\\Texture2D\\tamingStatusEffect.png"; StatusEffect val = TinyEffectManager.MakeStatusEffectPrefab("TamingEffect", "TamingEffect", "Nearby beasts may eat the food you left behind and become friendly towards you.", -1f, 0.2f, (StackBehaviors)1, "Bandage", false, (string)null, (UID?)null, "com.ehaugw.vagabond", text, "Taming Beasts", (string)null); EffectSignature statusEffectSignature = val.StatusEffectSignature; TamingEffect tamingEffect = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)statusEffectSignature).transform).AddComponent<TamingEffect>(); ((Effect)tamingEffect).UseOnce = false; statusEffectSignature.Effects = new List<Effect> { (Effect)(object)tamingEffect }; val.IsHidden = false; val.DisplayInHud = true; } public static ImbueEffectPreset MakeHonedBladeInfusion() { ImbueEffectPreset val = TinyEffectManager.MakeImbuePreset(122312273, "Honed Blade", "Weapon deals some Physical damage.", (string)null, (int?)209, (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, 0f, 0.2f, (Types)0, 0f); Transform imbueFX = val.ImbueFX; imbueFX = Object.Instantiate<Transform>(imbueFX); ((Component)imbueFX).gameObject.SetActive(false); Object.DontDestroyOnLoad((Object)(object)imbueFX); val.ImbueFX = imbueFX; Object.Destroy((Object)(object)((Component)imbueFX.Find("BlessParticlesSparkles")).gameObject); return val; } } internal class CommandBeastEffect : Effect { public const float COMMAND_RANGE = 10000f; public static void StaticActivate(Character character, object[] _infos, Effect instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) List<Character> list = new List<Character>(); CharacterManager.Instance.FindCharactersInRange(((Component)character).transform.position, 10000f, ref list); foreach (Character item in list) { bool? obj; if (item == null) { obj = null; } else { StatusEffectManager statusEffectMngr = item.StatusEffectMngr; obj = ((statusEffectMngr != null) ? new bool?(statusEffectMngr.HasStatusEffect("Tamed")) : null); } bool? flag = obj; if (!flag.GetValueOrDefault()) { continue; } object obj2; if (item == null) { obj2 = null; } else { StatusEffectManager statusEffectMngr2 = item.StatusEffectMngr; if (statusEffectMngr2 == null) { obj2 = null; } else { StatusEffect statusEffectOfName = statusEffectMngr2.GetStatusEffectOfName("Tamed"); obj2 = ((statusEffectOfName != null) ? ((EffectSynchronizer)statusEffectOfName).SourceCharacter : null); } } if (!((Object)obj2 == (Object)(object)character)) { continue; } TargetingSystem targetingSystem = character.TargetingSystem; object obj3; if (targetingSystem == null) { obj3 = null; } else { Character lockedCharacter = targetingSystem.LockedCharacter; obj3 = ((lockedCharacter != null) ? lockedCharacter.LockingPoint : null); } LockingPoint val = (LockingPoint)obj3; if (val == null) { continue; } item.StatusEffectMngr.AddStatusEffect("Unerring Read"); CharacterAI componentInChildren = ((Component)item).gameObject.GetComponentInChildren<CharacterAI>(); AIState[] aiStates = componentInChildren.AiStates; foreach (AIState val2 in aiStates) { if (val2 is AISCombat) { componentInChildren.SwitchAiState(val2.StateID); break; } } componentInChildren.TargetingSystem.SetLockingPoint(val); } } protected override void ActivateLocally(Character character, object[] _infos) { StaticActivate(character, _infos, (Effect)(object)this); } } internal class TamingEffect : Effect { public const string EFFECT_NAME = "TamingEffect"; public const string DISPLAY_NAME = "Taming Beasts"; public const string DESCRIPTION = "Nearby beasts may eat the food you left behind and become friendly towards you."; public const string IMAGE_PATH = "\\SideLoader\\Texture2D\\animalCompanionStatusEffect.png"; public const float TICK_RATE = 0.2f; protected override void ActivateLocally(Character _affectedCharacter, object[] _infos) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Invalid comparison between Unknown and I4 //IL_00d0: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) if ((int)_affectedCharacter.CurrentSpellCast != 41 && base.m_parentStatusEffect.Age > 1f) { _affectedCharacter.StatusEffectMngr.CleanseStatusEffect("TamingEffect"); return; } List<Item> source = (from x in Object.FindObjectsOfType<Item>() where x.ItemID == 4000050 || x.ItemID == 4000060 select x).ToList(); foreach (Item item in source.Where((Item x) => (Object)(object)((Component)x).transform.parent == (Object)null && Vector3.Distance(((Component)_affectedCharacter).transform.position, ((Component)x).transform.position) <= 50f)) { List<Character> source2 = new List<Character>(); CharacterManager.Instance.FindCharactersInRange(((Component)item).transform.position, 1.5f, ref source2); source2 = source2.Where((Character x) => (int)x.Faction == 6).ToList(); if (source2.Count > 0) { Character val = source2[0]; val.StatusEffectMngr.AddStatusEffect(Vagabond.Instance.TamedStatusEffectPrefab, _affectedCharacter); EatFood(val, _affectedCharacter, item); } else { if (!((CharacterKnowledge)_affectedCharacter.Inventory.SkillKnowledge).IsItemLearned(2502049)) { continue; } List<Character> source3 = new List<Character>(); CharacterManager.Instance.FindCharactersInRange(((Component)item).transform.position, 1.5f, ref source3); source3 = source3.Where(delegate(Character x) { StatusEffectManager statusEffectMngr2 = x.StatusEffectMngr; return statusEffectMngr2 != null && statusEffectMngr2.HasStatusEffect("Tamed") && !statusEffectMngr2.HasStatusEffect("AnimalCompanionStatusEffect"); }).ToList(); if (source3.Count > 0) { Character character = source3[0]; EatFood(character, _affectedCharacter, item); continue; } List<Character> source4 = new List<Character>(); CharacterManager.Instance.FindCharactersInRange(((Component)item).transform.position, 100f, ref source4); source4 = source4.Where(delegate(Character x) { StatusEffectManager statusEffectMngr = x.StatusEffectMngr; return statusEffectMngr != null && !statusEffectMngr.HasStatusEffect("AnimalCompanionStatusEffect") && !x.InCombat; }).ToList(); foreach (Character item2 in source4) { if (Random.Range(0f, 1f) < 0.02f) { CharacterAI componentInChildren = ((Component)item2).gameObject.GetComponentInChildren<CharacterAI>(); componentInChildren.SetDestination(((Component)item).transform.position, false); } } } } } private static void EatFood(Character character, Character sourceCharacter, Item food) { StatusEffectManager statusEffectMngr = character.StatusEffectMngr; if (statusEffectMngr != null) { statusEffectMngr.AddStatusEffect(Vagabond.Instance.AnimalCompanionStatusEffectPrefab, sourceCharacter); } switch (food.ItemID) { case 4000050: { StatusEffectManager statusEffectMngr4 = character.StatusEffectMngr; if (statusEffectMngr4 != null) { statusEffectMngr4.AddStatusEffect("Health Recovery 2"); } break; } case 4000060: { StatusEffectManager statusEffectMngr2 = character.StatusEffectMngr; if (statusEffectMngr2 != null) { statusEffectMngr2.AddStatusEffect("Health Recovery 3"); } StatusEffectManager statusEffectMngr3 = character.StatusEffectMngr; if (statusEffectMngr3 != null) { statusEffectMngr3.AddStatusEffect("Rage"); } break; } } Object.Destroy((Object)(object)((Component)food).gameObject); CasualStagger.Stagger(character); } } internal class TamedEffect : Effect { public const string EFFECT_NAME = "Tamed"; public const string DISPLAY_NAME = "Tamed"; public const string DESCRIPTION = "Tamed"; public const string IMAGE_PATH = "\\SideLoader\\Texture2D\\tamingStatusEffect.png"; public const float TICK_RATE = 0.2f; public Factions OriginalFaction; protected override void StopAffectLocally(Character _affectedCharacter) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) _affectedCharacter.ChangeFaction(OriginalFaction, true); } protected override void ActivateLocally(Character _affectedCharacter, object[] _infos) { //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_0028: Unknown result type (might be due to invalid IL or missing references) if (!_affectedCharacter.IsAlly(((Effect)this).SourceCharacter)) { OriginalFaction = _affectedCharacter.Faction; _affectedCharacter.ChangeFaction(((Effect)this).SourceCharacter.Faction, true); } } } internal class AnimalCompanionEffect : Effect { public const string EFFECT_NAME = "AnimalCompanionStatusEffect"; public const string DISPLAY_NAME = "Animal companion"; public const string DESCRIPTION = "You are an animal companion"; public const string IMAGE_PATH = "\\SideLoader\\Texture2D\\animalCompanionStatusEffect.png"; public const float TICK_RATE = 0.2f; public const float LIFESPAN = 240f; protected override void ActivateLocally(Character _affectedCharacter, object[] _infos) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)((Effect)this).SourceCharacter != (Object)null) || !_affectedCharacter.IsAI || _affectedCharacter.InCombat || !(Vector3.Distance(((Component)_affectedCharacter).transform.position, ((Component)((Effect)this).SourceCharacter).transform.position) > 15f) || _affectedCharacter.InCombat) { return; } CharacterAI componentInChildren = ((Component)_affectedCharacter).gameObject.GetComponentInChildren<CharacterAI>(); AIState[] aiStates = componentInChildren.AiStates; foreach (AIState val in aiStates) { if (val is AISWander) { componentInChildren.SwitchAiState(val.StateID); ((AISWander)val).SpeedModif = 1f; break; } } componentInChildren.SetDestination(((Component)((Effect)this).SourceCharacter).transform.position, false); } } public class AnimalCompanionSkill { public const string NAME = "Animal Companion"; public const float ATTRACTION_RANGE = 100f; public static Skill Init() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //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_004f: 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_0067: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown SL_Skill val = new SL_Skill { Name = "Animal Companion", EffectBehaviour = (EditBehaviours)2, Target_ItemID = 8205030, New_ItemID = 2502049, SLPackName = Vagabond.ModFolderName, SubfolderName = "AnimalCompanion", Description = "You can give food to tamed beasts to reproduce the initial taming effects, such as making them follow you. Also makes taming a lot easier.", IsUsable = false, CastType = (SpellCastType)(-1), CastModifier = (SpellCastModifier)0, CastLocomotionEnabled = false, MobileCastMovementMult = -1f }; ((ContentTemplate)val).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID); return (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); } } public class SwiftStrikeSkill { public static Skill Init() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Expected O, but got Unknown //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: 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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) SL_AttackSkill val = new SL_AttackSkill(); ((SL_Item)val).Name = "Swift Strike"; ((SL_Item)val).EffectBehaviour = (EditBehaviours)2; ((SL_Item)val).Target_ItemID = 8100350; ((SL_Item)val).New_ItemID = 2502048; ((SL_Item)val).SLPackName = Vagabond.ModFolderName; ((SL_Item)val).SubfolderName = "SwiftStrike"; ((SL_Item)val).Description = "Dash forward and strike. Applies Bleeding and causes Drawback."; ((SL_Item)val).CastType = (SpellCastType)503; ((SL_Item)val).CastModifier = (SpellCastModifier)2; ((SL_Item)val).CastLocomotionEnabled = false; ((SL_Item)val).MobileCastMovementMult = -1f; ((SL_Item)val).CastSheatheRequired = 2; WeaponType[] array = new WeaponType[11]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); val.RequiredWeaponTypes = (WeaponType[])(object)array; ((SL_Skill)val).Cooldown = 15f; ((SL_Skill)val).StaminaCost = 7f; ((SL_Skill)val).ManaCost = 0f; ((SL_Skill)val).HealthCost = 0f; ((SL_Skill)val).DurabilityCost = 3f; SL_EffectTransform[] array2 = new SL_EffectTransform[3]; SL_EffectTransform val2 = new SL_EffectTransform(); val2.TransformName = "Effects"; val2.Effects = (SL_Effect[])(object)new SL_Effect[0]; array2[0] = val2; val2 = new SL_EffectTransform(); val2.TransformName = "ActivationEffects"; val2.Effects = (SL_Effect[])(object)new SL_Effect[0]; array2[1] = val2; val2 = new SL_EffectTransform(); val2.TransformName = "HitEffects"; val2.Effects = (SL_Effect[])(object)new SL_Effect[0]; array2[2] = val2; ((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array2; SL_AttackSkill val3 = val; ((ContentTemplate)val3).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID); Skill val4 = (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); Transform orMake = TinyGameObjectManager.GetOrMake(((Component)val4).transform, "ActivationEffects", true, true); AddStatusEffect val5 = ((Component)orMake).gameObject.AddComponent<AddStatusEffect>(); val5.SetChanceToContract(100); val5.Status = ResourcesPrefabManager.Instance.GetStatusEffectPrefab("Drawback"); ((SL_Effect)new SL_PlaySoundEffect { Follow = true, OverrideCategory = (EffectCategories)0, Delay = 0f, MinPitch = 1f, MaxPitch = 1f, SyncType = (SyncTypes)0, Sounds = new List<Sounds> { (Sounds)13220 } }).ApplyToTransform(orMake); Transform transform = ((Component)TinyGameObjectManager.GetOrMake(((Component)val4).transform, "HitEffects", true, true)).transform; WeaponDamage damage = ((Component)transform).gameObject.AddComponent<WeaponDamage>(); setDamage(damage); AddStatusEffect val6 = ((Component)transform).gameObject.AddComponent<AddStatusEffect>(); val6.SetChanceToContract(100); val6.Status = ResourcesPrefabManager.Instance.GetStatusEffectPrefab("Bleeding"); return val4; } private static void setDamage(WeaponDamage damage) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) float weaponDamageMult = 3f; damage.WeaponDamageMult = weaponDamageMult; damage.WeaponDamageMultKDown = -1f; damage.WeaponKnockbackMult = 1.5f; damage.WeaponDurabilityLossPercent = 0f; damage.WeaponDurabilityLoss = 5f; damage.OverrideDType = (Types)9; ((PunctualDamage)damage).Damages = (DamageType[])(object)new DamageType[0]; } } public class TameBeastSkill { public const float PLAYER_RANGE = 50f; public const float FOOD_RANGE = 1.5f; public static Skill Init() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown SL_Skill val = new SL_Skill(); ((SL_Item)val).Name = "Tame Beast"; ((SL_Item)val).EffectBehaviour = (EditBehaviours)2; ((SL_Item)val).Target_ItemID = 8100120; ((SL_Item)val).New_ItemID = 2502046; ((SL_Item)val).SLPackName = Vagabond.ModFolderName; ((SL_Item)val).SubfolderName = "TameBeast"; ((SL_Item)val).Description = "Sit down and wait for nearby predator to eat raw meat on the ground, and hope that they become friendly towards you."; ((SL_Item)val).CastType = (SpellCastType)41; ((SL_Item)val).CastModifier = (SpellCastModifier)(-1); ((SL_Item)val).CastLocomotionEnabled = false; ((SL_Item)val).MobileCastMovementMult = 1f; ((SL_Item)val).CastSheatheRequired = 2; SL_EffectTransform[] array = new SL_EffectTransform[1]; SL_EffectTransform val2 = new SL_EffectTransform(); val2.TransformName = "Effects"; val2.Effects = (SL_Effect[])(object)new SL_Effect[1] { (SL_Effect)new SL_AddStatusEffect { StatusEffect = "TamingEffect", ChanceToContract = 100, Delay = 1.5f } }; array[0] = val2; ((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array; val.Cooldown = 2f; val.StaminaCost = 5f; val.ManaCost = 0f; SL_Skill val3 = val; ((ContentTemplate)val3).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID); return (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); } } public class CommandBeastSkill { public static Skill Init() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //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_004f: 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_0067: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: 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_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) SL_AttackSkill val = new SL_AttackSkill { Name = "Command Beast", EffectBehaviour = (EditBehaviours)2, Target_ItemID = 8200040, New_ItemID = 2502047, SLPackName = Vagabond.ModFolderName, SubfolderName = "CommandBeast", Description = "Commands animal companions to attack the targeted creature.", CastType = (SpellCastType)1, CastModifier = (SpellCastModifier)1, CastLocomotionEnabled = true, MobileCastMovementMult = 0.7f, CastSheatheRequired = 0, Cooldown = 20f, StaminaCost = 2f, HealthCost = 0f, ManaCost = 0f }; ((ContentTemplate)val).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID); Skill val2 = (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); ((SL_Effect)new SL_PlaySoundEffect { Follow = true, OverrideCategory = (EffectCategories)0, Delay = 0f, MinPitch = 1f, MaxPitch = 1f, SyncType = (SyncTypes)0, Sounds = new List<Sounds> { (Sounds)50428, (Sounds)50429 } }).ApplyToTransform(TinyGameObjectManager.GetOrMake(((Component)val2).transform, "ActivationEffects", true, true)); Transform orMake = TinyGameObjectManager.GetOrMake(((Component)val2).transform, "Effects", true, true); ((Component)orMake).gameObject.AddComponent<CommandBeastEffect>(); return val2; } } [BepInPlugin("com.ehaugw.vagabond", "Vagabond", "0.0.13")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency("com.ehaugw.synchronizedworldobjects", "1.0.3")] public class Vagabond : BaseUnityPlugin { public const string GUID = "com.ehaugw.vagabond"; public const string VERSION = "0.0.13"; public const string NAME = "Vagabond"; public static string ModFolderName = Directory.GetParent(typeof(Vagabond).Assembly.Location).Name.ToString(); public SkillSchool martialArtistTreeInstance; public Tag ForagerTag; public static Vagabond Instance; public StatusEffect AnimalCompanionStatusEffectPrefab; public StatusEffect TamedStatusEffectPrefab; internal void Awake() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown Instance = this; WhiteFangNPC.Init(); WhiteFangOutsideTracker.Init(); SL.OnPacksLoaded += OnPackLoaded; SL.OnSceneLoaded += OnSceneLoaded; SL.BeforePacksLoaded += BeforePacksLoaded; Harmony val = new Harmony("com.ehaugw.vagabond"); val.PatchAll(); } private void BeforePacksLoaded() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) ForagerTag = TinyTagManager.GetOrMakeTag("Forager"); } private void OnSceneLoaded() { } private void OnPackLoaded() { EffectInitializer.MakeHonedBladeInfusion(); EffectInitializer.MakeTamingStatusEffectPrefab(); AnimalCompanionStatusEffectPrefab = EffectInitializer.MakeAnimalCompanionStatusEffectPrefab(); TamedStatusEffectPrefab = EffectInitializer.MakeTamedStatusEffectPrefab(); PrecisionStrikeSkill.Init(); ApplyHonedBlade.Init(); CarefulMaintenanceSkill.Init(); ThrowSandSKill.Init(); ForagerSkill.Init(); TameBeastSkill.Init(); SwiftStrikeSkill.Init(); CommandBeastSkill.Init(); AnimalCompanionSkill.Init(); VagabondSkillTree.SetupSkillTree(ref martialArtistTreeInstance); Tuple<int, string[]>[] array = new Tuple<int, string[]>[13] { new Tuple<int, string[]>(4000010, new string[1] { "Forager" }), new Tuple<int, string[]>(4000280, new string[1] { "Forager" }), new Tuple<int, string[]>(4000200, new string[1] { "Forager" }), new Tuple<int, string[]>(4000190, new string[1] { "Forager" }), new Tuple<int, string[]>(4000030, new string[1] { "Forager" }), new Tuple<int, string[]>(4000360, new string[1] { "Forager" }), new Tuple<int, string[]>(4000190, new string[1] { "Forager" }), new Tuple<int, string[]>(4000290, new string[1] { "Forager" }), new Tuple<int, string[]>(4000300, new string[1] { "Forager" }), new Tuple<int, string[]>(4000410, new string[1] { "Forager" }), new Tuple<int, string[]>(4000390, new string[1] { "Forager" }), new Tuple<int, string[]>(4000440, new string[1] { "Forager" }), new Tuple<int, string[]>(4000400, new string[1] { "Forager" }) }; foreach (Tuple<int, string[]> tuple in array) { Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(tuple.Item1); if (itemPrefab != null) { CustomItems.SetItemTags(itemPrefab, TinyTagManager.GetSafeTags(tuple.Item2), false); } } } } public class MoveToEmercarListener : IQuestEventAddedListener { public void OnQuestEventAdded(QuestEventData _eventData) { Character worldHostCharacter = CharacterManager.Instance.GetWorldHostCharacter(); Item itemFromItemID = ((CharacterKnowledge)worldHostCharacter.Inventory.QuestKnowledge).GetItemFromItemID(WhiteFangOutsideTracker.QuestID); Quest quest = (Quest)(object)((itemFromItemID is Quest) ? itemFromItemID : null); WhiteFangOutsideTracker.UpdateQuestProgress(quest); } } public class TalkInEmercarListener : IQuestEventAddedListener { public void OnQuestEventAdded(QuestEventData _eventData) { Character worldHostCharacter = CharacterManager.Instance.GetWorldHostCharacter(); Item itemFromItemID = ((CharacterKnowledge)worldHostCharacter.Inventory.QuestKnowledge).GetItemFromItemID(WhiteFangOutsideTracker.QuestID); Quest val = (Quest)(object)((itemFromItemID is Quest) ? itemFromItemID : null); QuestProgress component = ((Component)val).GetComponent<QuestProgress>(); val.SetIsCompleted(); component.SetIsCompleted(true); WhiteFangOutsideTracker.UpdateQuestProgress(val); } } public static class WhiteFangOutsideTracker { private const string QuestName = "Saving White Fang"; public static int QuestID = 2502038; public const string QE_Scenario_UID = "ehaugw.questie.saving_white_fang"; public const string QUEST_EVENT_FAMILY_NAME = "Ehaugw_Questie_Saving_White_Fang"; public static QuestEventSignature QE_NotFound; public static QuestEventSignature QE_InitialTalk; public static QuestEventSignature QE_GivenSword; public static QuestEventSignature QE_GivenSwordKazite; public static QuestEventSignature QE_MoveOrderToEmercar; public static QuestEventSignature QE_FoundInEmercar; private static void PrepareTinyQuest() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown SL_Quest val = new SL_Quest(); ((SL_Item)val).Target_ItemID = 7011620; ((SL_Item)val).New_ItemID = QuestID; ((SL_Item)val).Name = "Saving White Fang"; val.IsSideQuest = false; ((SL_Item)val).ItemExtensions = (SL_ItemExtension[])(object)new SL_ItemExtension[1] { (SL_ItemExtension)new SL_QuestProgress() }; SL_Quest val2 = val; Dictionary<string, string> dictionary = new Dictionary<string, string> { { GetLogSignature("find"), "Find White Fang in the bandit camp." }, { GetLogSignature("provide"), "Provide White Fang with an Iron Sword." }, { GetLogSignature("send"), "Send White Fang to the Docks in Emercar." }, { GetLogSignature("freed"), "Meet White Fang at the Docks in Emercar." }, { GetLogSignature("rewarded"), "You saved White Fang." } }; TinyQuests.PrepareSLQuest(val2, dictionary, (Action<Quest>)UpdateQuestProgress); QuestEventManager.Instance.RegisterOnQEAddedListener(QE_NotFound.EventUID, (IQuestEventAddedListener)(object)new MoveToEmercarListener()); QuestEventManager.Instance.RegisterOnQEAddedListener(QE_InitialTalk.EventUID, (IQuestEventAddedListener)(object)new MoveToEmercarListener()); QuestEventManager.Instance.RegisterOnQEAddedListener(QE_GivenSword.EventUID, (IQuestEventAddedListener)(object)new MoveToEmercarListener()); QuestEventManager.Instance.RegisterOnQEAddedListener(QE_MoveOrderToEmercar.EventUID, (IQuestEventAddedListener)(object)new MoveToEmercarListener()); QuestEventManager.Instance.RegisterOnQEAddedListener(QE_FoundInEmercar.EventUID, (IQuestEventAddedListener)(object)new TalkInEmercarListener()); } public static string GetLogSignature(string letter) { return "ehaugw.questie.saving_white_fang.log_signature." + letter; } public static void Init() { QE_NotFound = CustomQuests.CreateQuestEvent("ehaugw.questie.saving_white_fang.not_found", false, true, true, "Ehaugw_Questie_Saving_White_Fang", "CustomEvent", "A custom event created with SideLoader"); QE_InitialTalk = CustomQuests.CreateQuestEvent("ehaugw.questie.saving_white_fang.initial_talk", false, true, true, "Ehaugw_Questie_Saving_White_Fang", "CustomEvent", "A custom event created with SideLoader"); QE_GivenSword = CustomQuests.CreateQuestEvent("ehaugw.questie.saving_white_fang.given_sword", false, true, true, "Ehaugw_Questie_Saving_White_Fang", "CustomEvent", "A custom event created with SideLoader"); QE_GivenSwordKazite = CustomQuests.CreateQuestEvent("ehaugw.questie.saving_white_fang.given_sword_kazite", false, true, true, "Ehaugw_Questie_Saving_White_Fang", "CustomEvent", "A custom event created with SideLoader"); QE_MoveOrderToEmercar = CustomQuests.CreateQuestEvent("ehaugw.questie.saving_white_fang.move_order_to_emercar", false, true, true, "Ehaugw_Questie_Saving_White_Fang", "CustomEvent", "A custom event created with SideLoader"); QE_FoundInEmercar = CustomQuests.CreateQuestEvent("ehaugw.questie.saving_white_fang.found_in_emercar", false, true, true, "Ehaugw_Questie_Saving_White_Fang", "CustomEvent", "A custom event created with SideLoader"); SL.OnPacksLoaded += PrepareTinyQuest; SL.OnSceneLoaded += OnSceneLoaded; SL.OnGameplayResumedAfterLoading += OnGamePlayResumed; } private static void OnSceneLoaded() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.isNonMasterClientInRoom) { return; } Character worldHostCharacter = CharacterManager.Instance.GetWorldHostCharacter(); if (SceneManagerHelper.ActiveSceneName == "ChersoneseDungeonsSmall") { Vector3 val = ((Component)worldHostCharacter).transform.position - new Vector3(300f, 0f, 1f); if (((Vector3)(ref val)).magnitude < 3f) { Quest orGiveQuestToHost = TinyQuests.GetOrGiveQuestToHost(QuestID); UpdateQuestProgress(orGiveQuestToHost); } } } private static void OnGamePlayResumed() { if (!PhotonNetwork.isNonMasterClientInRoom) { Character worldHostCharacter = CharacterManager.Instance.GetWorldHostCharacter(); Item itemFromItemID = ((CharacterKnowledge)worldHostCharacter.Inventory.QuestKnowledge).GetItemFromItemID(QuestID); Quest val = (Quest)(object)((itemFromItemID is Quest) ? itemFromItemID : null); if (val != null) { UpdateQuestProgress(val); } } } public static void UpdateQuestProgress(Quest quest) { //IL_009f: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_018d: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.isNonMasterClientInRoom) { QuestProgress component = ((Component)quest).GetComponent<QuestProgress>(); int num = QuestEventManager.Instance.GetEventCurrentStack(QE_InitialTalk.EventUID); int num2 = QuestEventManager.Instance.GetEventCurrentStack(QE_GivenSword.EventUID); int num3 = QuestEventManager.Instance.GetEventCurrentStack(QE_MoveOrderToEmercar.EventUID); int num4 = QuestEventManager.Instance.GetEventCurrentStack(QE_FoundInEmercar.EventUID); if (quest.IsCompleted) { num = 1; num3 = 1; num4 = 1; num2 = 1; } if (num4 == 1) { component.SetIsCompleted(true); } component.UpdateLogEntry(UID.op_Implicit("ehaugw.questie.saving_white_fang"), false, component.GetLogSignature(UID.op_Implicit(GetLogSignature("find"))), num >= 1); if (num >= 1) { component.UpdateLogEntry(UID.op_Implicit("ehaugw.questie.saving_white_fang"), false, component.GetLogSignature(UID.op_Implicit(GetLogSignature("provide"))), num2 >= 1); } if (num2 >= 1) { component.UpdateLogEntry(UID.op_Implicit("ehaugw.questie.saving_white_fang"), false, component.GetLogSignature(UID.op_Implicit(GetLogSignature("send"))), num3 >= 1); } if (num3 >= 1) { component.UpdateLogEntry(UID.op_Implicit("ehaugw.questie.saving_white_fang"), false, component.GetLogSignature(UID.op_Implicit(GetLogSignature("freed"))), num4 >= 1); } if (num4 >= 1) { component.UpdateLogEntry(UID.op_Implicit("ehaugw.questie.saving_white_fang"), false, component.GetLogSignature(UID.op_Implicit(GetLogSignature("rewarded"))), num4 >= 1); } } } } public class ForagerSkill { public const string NAME = "Forager"; public static Skill Init() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //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_004f: 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_0067: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown SL_Skill val = new SL_Skill { Name = "Forager", EffectBehaviour = (EditBehaviours)2, Target_ItemID = 8205030, New_ItemID = 2502045, SLPackName = Vagabond.ModFolderName, SubfolderName = "Forager", Description = "Eating fresh fruits and berries restores some burnt stamina and health.", IsUsable = false, CastType = (SpellCastType)(-1), CastModifier = (SpellCastModifier)0, CastLocomotionEnabled = false, MobileCastMovementMult = -1f }; ((ContentTemplate)val).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID); return (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); } } [HarmonyPatch(typeof(Item), "Use")] public class Item_Use { [HarmonyPostfix] public static void HarmonyPostfix(Item __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (__instance.DurabilityRatio > 0.99f && __instance.HasTag(Vagabond.Instance.ForagerTag) && SkillRequirements.SafeHasSkillKnowledge(((EffectSynchronizer)__instance).OwnerCharacter, 2502045)) { ((EffectSynchronizer)__instance).OwnerCharacter.Stats.RestoreBurntHealth(5f, false); ((EffectSynchronizer)__instance).OwnerCharacter.Stats.RestoreBurntStamina(5f, false); } } } public class CarefulMaintenanceSkill { public const string NAME = "Careful Maintenance"; public const int DURATION = 2400; public static Skill Init() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //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_004f: 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_0067: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown SL_Skill val = new SL_Skill { Name = "Careful Maintenance", EffectBehaviour = (EditBehaviours)2, Target_ItemID = 8205030, New_ItemID = 2502043, SLPackName = Vagabond.ModFolderName, SubfolderName = "CarefulMaintenance", Description = "Applies Honed Edge to sharp weapons when you repair them.", IsUsable = false, CastType = (SpellCastType)(-1), CastModifier = (SpellCastModifier)0, CastLocomotionEnabled = false, MobileCastMovementMult = -1f }; ((ContentTemplate)val).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID); return (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); } } [HarmonyPatch(typeof(Item), "SetDurabilityRatio")] public class Item_SetDurabilityRatio { [HarmonyPrefix] public static void HarmonyPrefix(Item __instance, float _maxDurabilityRatio, float ___m_currentDurability) { if (_maxDurabilityRatio >= ___m_currentDurability / (float)__instance.MaxDurability && SkillRequirements.SafeHasSkillKnowledge(((EffectSynchronizer)__instance).OwnerCharacter, 2502043)) { Weapon val = (Weapon)(object)((__instance is Weapon) ? __instance : null); if (val != null) { ((MonoBehaviour)TinyHelperRPCManager.Instance).photonView.RPC("ApplyAddImbueEffectRPC", (PhotonTargets)0, new object[3] { ((Item)val).UID, 122312273, 2400f }); } } } } [HarmonyPatch(typeof(Item), "ReduceDurability")] public class Item_ReduceDurability { [HarmonyPrefix] public static void HarmonyPrefix(Item __instance) { Weapon val = (Weapon)(object)((__instance is Weapon) ? __instance : null); if (val != null && val.HasImbuePreset(122312273)) { ImbueStack firstImbue = val.FirstImbue; firstImbue.RemainingLifespan -= 20f; } } } public class ApplyHonedBlade { public static Skill Init() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00cb: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) SL_AttackSkill val = new SL_AttackSkill(); ((SL_Item)val).Name = "Hone Blade"; ((SL_Item)val).EffectBehaviour = (EditBehaviours)1; ((SL_Item)val).Target_ItemID = 8200100; ((SL_Item)val).New_ItemID = 2502042; ((SL_Item)val).SLPackName = Vagabond.ModFolderName; ((SL_Item)val).SubfolderName = "HoneBlade"; ((SL_Item)val).Description = "Hone your blade, making it sharper."; ((SL_Item)val).IsUsable = true; ((SL_Item)val).CastType = (SpellCastType)36; ((SL_Item)val).CastModifier = (SpellCastModifier)0; ((SL_Item)val).CastLocomotionEnabled = false; ((SL_Item)val).MobileCastMovementMult = -1f; WeaponType[] array = new WeaponType[6]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); val.RequiredWeaponTypes = (WeaponType[])(object)array; SL_EffectTransform[] array2 = new SL_EffectTransform[1]; SL_EffectTransform val2 = new SL_EffectTransform(); val2.TransformName = "Effects"; val2.Effects = (SL_Effect[])(object)new SL_Effect[1] { (SL_Effect)new SL_ImbueWeapon { Lifespan = 2400f, ImbueEffect_Preset_ID = 122312273, Imbue_Slot = (WeaponSlot)0 } }; array2[0] = val2; ((SL_Item)val).EffectTransforms = (SL_EffectTransform[])(object)array2; ((SL_Skill)val).Cooldown = 100f; ((SL_Skill)val).StaminaCost = 0f; ((SL_Skill)val).HealthCost = 0f; ((SL_Skill)val).ManaCost = 0f; SL_AttackSkill val3 = val; ((ContentTemplate)val3).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val3).New_ItemID); Skill val4 = (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); Object.Destroy((Object)(object)((Component)val4).gameObject.GetComponentInChildren<HasStatusEffectEffectCondition>()); PlaySoundEffect[] componentsInChildren = ((Component)val4).gameObject.GetComponentsInChildren<PlaySoundEffect>(); foreach (PlaySoundEffect val5 in componentsInChildren) { Object.Destroy((Object)(object)val5); } ((SL_Effect)new SL_PlaySoundEffect { Follow = true, OverrideCategory = (EffectCategories)0, Delay = 0f, MinPitch = 1f, MaxPitch = 1f, SyncType = (SyncTypes)0, Sounds = new List<Sounds> { (Sounds)13221 } }).ApplyToTransform(((Component)val4).transform.Find("ActivationEffects")); return val4; } } public class PrecisionStrikeSkill { public const string NAME = "Precision Strike"; public static Skill Init() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //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_004f: 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_0067: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown SL_Skill val = new SL_Skill { Name = "Precision Strike", EffectBehaviour = (EditBehaviours)2, Target_ItemID = 8205030, New_ItemID = 2502041, SLPackName = Vagabond.ModFolderName, SubfolderName = "PrecisionStrike", Description = "Weapon attacks against prone targets or from behind deal some bonus damage, ignore half of the targets' resistances and cause extreme bleeding for a brief moment.", IsUsable = false, CastType = (SpellCastType)(-1), CastModifier = (SpellCastModifier)0, CastLocomotionEnabled = false, MobileCastMovementMult = -1f }; ((ContentTemplate)val).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val).New_ItemID); return (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); } } [HarmonyPatch(typeof(Character), "ReceiveHit", new Type[] { typeof(Object), typeof(DamageList), typeof(Vector3), typeof(Vector3), typeof(float), typeof(float), typeof(Character), typeof(float), typeof(bool) })] public class Character_ReceiveHit { [HarmonyPrefix] public static void HarmonyPrefix(Character __instance, Object _damageSource, DamageList _damage, Vector3 _hitDir, float _angle) { //IL_001a: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Invalid comparison between Unknown and I4 Weapon val = (Weapon)(object)((_damageSource is Weapon) ? _damageSource : null); if (val == null) { return; } bool flag = Vector3.Angle(((Component)__instance).transform.forward, ((Component)((EffectSynchronizer)val).OwnerCharacter).transform.forward) < 60f; if (!SkillRequirements.SafeHasSkillKnowledge((val != null) ? ((EffectSynchronizer)val).OwnerCharacter : null, 2502041) || (!flag && (int)__instance.CharHurtType != 2)) { return; } int lastAttackID = val.LastAttackID; if (lastAttackID == 0 || lastAttackID == 1 || lastAttackID == 5) { float? obj; if (val == null) { obj = null; } else { Character ownerCharacter = ((EffectSynchronizer)val).OwnerCharacter; obj = ((ownerCharacter != null) ? new float?(ProficiencyExtensions.GetTotalWeaponProficiency(ownerCharacter)) : null); } float? num = obj; float valueOrDefault = num.GetValueOrDefault(); double num2 = 1.0 - 2.0 / (Math.Pow(Math.E, (double)(valueOrDefault / 4f) + Math.Log(1.5)) + 1.0); _damage.IgnoreHalfResistances = true; _damage.Add(_damage * (float)num2); TinyEffectManager.AddStatusEffectForDuration(__instance, "Bleeding +", 10f + valueOrDefault, ((EffectSynchronizer)val).OwnerCharacter, 1f); } } } public class ThrowSandSKill { public static Skill Init() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Expected O, but got Unknown //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Expected O, but got Unknown SL_AttackSkill val = new SL_AttackSkill(); ((SL_Item)val).Name = "Throw Salt"; ((SL_Item)val).EffectBehaviour = (EditBehaviours)2; ((SL_Item)val).Target_ItemID = 8200040; ((SL_Item)val).New_ItemID = 2502044; ((SL_Item)val).SLPackName = Vagabond.ModFolderName; ((SL_Item)val).SubfolderName = "ThrowSand"; ((SL_Item)val).Description = "Causes Rage and Confusion"; ((SL_Item)val).CastType = (SpellCastType)18; ((SL_Item)val).CastModifier = (SpellCastModifier)1; ((SL_Item)val).CastLocomotionEnabled = true; ((SL_Item)val).MobileCastMovementMult = 0.3f; ((SL_Item)val).CastSheatheRequired = 0; ((SL_Skill)val).RequiredItems = (SkillItemReq[])(object)new SkillItemReq[1] { new SkillItemReq { Consume = true, ItemID = 6000070, Quantity = 1 } }; ((SL_Skill)val).Cooldown = 15f; ((SL_Skill)val).StaminaCost = 7f; ((SL_Skill)val).HealthCost = 0f; ((SL_Skill)val).ManaCost = 0f; SL_AttackSkill val2 = val; ((ContentTemplate)val2).ApplyTemplate(); Item itemPrefab = ResourcesPrefabManager.Instance.GetItemPrefab(((SL_Item)val2).New_ItemID); Skill val3 = (Skill)(object)((itemPrefab is Skill) ? itemPrefab : null); ((SL_Effect)new SL_PlaySoundEffect { Follow = true, OverrideCategory = (EffectCategories)0, Delay = 0.05f, MinPitch = 1f, MaxPitch = 1f, SyncType = (SyncTypes)0, Sounds = new List<Sounds> { (Sounds)20064 } }).ApplyToTransform(TinyGameObjectManager.GetOrMake(((Component)val3).transform, "ActivationEffects", true, true)); Transform transform = TinyGameObjectManager.MakeFreshObject("Effects", true, true, ((Component)val3).transform).transform; SL_ShootBlast val4 = new SL_ShootBlast(); ((SL_Shooter)val4).CastPosition = (CastPositionType)0; ((SL_Shooter)val4).LocalPositionAdd = new Vector3(0f, 1.25f, 0.7f); ((SL_Shooter)val4).TargetType = (TargetTypes)0; val4.BaseBlast = (BlastPrefabs)98; val4.Radius = 1.2f; val4.BlastLifespan = 1f; val4.RefreshTime = -1f; val4.InstantiatedAmount = 5; val4.Interruptible = false; val4.HitOnShoot = true; val4.IgnoreShooter = true; val4.ParentToShootTransform = false; val4.ImpactSoundMaterial = (EquipmentSoundMaterials)7; val4.DontPlayHitSound = false; val4.EffectBehaviour = (EditBehaviours)2; ((SL_Effect)val4).Delay = 0f; SL_EffectTransform[] array = new SL_EffectTransform[1]; SL_EffectTransform val5 = new SL_EffectTransform(); val5.TransformName = "Effects"; val5.Effects = (SL_Effect[])(object)new SL_Effect[3] { (SL_Effect)new SL_AddStatusEffect { StatusEffect = "Rage", ChanceToContract = 100 }, (SL_Effect)new SL_AddStatusEffect { StatusEffect = "Confusion", ChanceToContract = 100 }, (SL_Effect)new SL_PunctualDamage { Knockback = 50f } }; array[0] = val5; val4.BlastEffects = (SL_EffectTransform[])(object)array; Effect obj = ((SL_Effect)val4).ApplyToTransform(transform); ShootBlast val6 = (ShootBlast)(object)((obj is ShootBlast) ? obj : null); return val3; } } public class WhiteFangNPC : SynchronizedNPC { public const string Name = "White Fang"; public static void Init() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_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_0032: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00e0: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown int[] defaultEquipment = new int[2] { 3100243, 3100245 }; VisualData visualData = new VisualData { Gender = (Gender)0, SkinIndex = 2, HeadVariationIndex = 1, HairStyleIndex = 5, HairColorIndex = 2 }; WhiteFangNPC whiteFangNPC = new WhiteFangNPC("White Fang", 23, defaultEquipment, null, null, null, visualData); ((SynchronizedNPC)whiteFangNPC).AddToScene(new SynchronizedNPCScene("ChersoneseDungeonsSmall", new Vector3(298.7f, 0.1f, 32f), new Vector3(0f, 144f, 0f), (Factions?)null, true, (SpellCastType)(-1), "prison", (int[])null, (int[])null, (Func<bool>)(() => !ShouldSpawnOutside()))); ((SynchronizedNPC)whiteFangNPC).AddToScene(new SynchronizedNPCScene("Emercar", new Vector3(1075.278f, -28.6992f, 1191.85f), new Vector3(0f, 175f, 0f), (Factions?)null, true, (SpellCastType)(-1), "emercar", (int[])null, (int[])null, (Func<bool>)(() => ShouldSpawnOutside()))); } public static bool ShouldSpawnOutside() { return QuestRequirements.HasQuestKnowledge(CharacterManager.Instance.GetWorldHostCharacter(), new int[1] { 2502038 }, (LogicType)1, false, true) || QuestRequirements.HasQuestEvent(WhiteFangOutsideTracker.QE_MoveOrderToEmercar.EventUID); } public WhiteFangNPC(string identifierName, int rpcListenerID, int[] defaultEquipment = null, int[] moddedEquipment = null, Vector3? scale = null, Factions? faction = null, VisualData visualData = null) : base(identifierName, rpcListenerID, defaultEquipment, moddedEquipment, scale, faction, visualData) { } public override object SetupClientSide(int rpcListenerID, string instanceUID, int sceneViewID, int recursionCount, string rpcMeta) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) object obj = ((SynchronizedNPC)this).SetupClientSide(rpcListenerID, instanceUID, sceneViewID, recursionCount, rpcMeta); Character val = (Character)((obj is Character) ? obj : null); if ((Object)(object)val == (Object)null) { return null; } GameObject gameObject = ((Component)val).gameObject; GameObject val2 = TinyDialogueManager.AssignTrainerTemplate(gameObject.transform); DialogueActor val3 = TinyDialogueManager.SetDialogueActorName(val2, ((SynchronizedWorldObject)this).IdentifierName); Trainer val4 = TinyDialogueManager.SetTrainerSkillTree(val2, Vagabond.Instance.martialArtistTreeInstance.UID); Graph dialogueGraph = TinyDialogueManager.GetDialogueGraph(val2); TinyDialogueManager.SetActorReference(dialogueGraph, val3); dialogueGraph.allNodes.Clear(); ActionNode val5 = TinyDialogueManager.MakeTrainDialogueAction(dialogueGraph, val4); ActionNode val6 = TinyDialogueManager.MakeQuestEvent(dialogueGraph, WhiteFangOutsideTracker.QE_InitialTalk.EventUID); ActionNode val7 = TinyDialogueManager.MakeQuestEvent(dialogueGraph, WhiteFangOutsideTracker.QE_GivenSword.EventUID); ActionNode val8 = TinyDialogueManager.MakeQuestEvent(dialogueGraph, WhiteFangOutsideTracker.QE_GivenSwordKazite.EventUID); ActionNode val9 = TinyDialogueManager.MakeQuestEvent(dialogueGraph, WhiteFangOutsideTracker.QE_MoveOrderToEmercar.EventUID); ActionNode val10 = TinyDialogueManager.MakeGiveItemReward(dialogueGraph, 2502524, (Receiver)0, 1); ActionNode val11 = TinyDialogueManager.MakeQuestEvent(dialogueGraph, WhiteFangOutsideTracker.QE_FoundInEmercar.EventUID); ActionNode val12 = TinyDialogueManager.MakeResignItem(dialogueGraph, 2000010, (Receiver)1, 1, 0); ActionNode val13 = TinyDialogueManager.MakeResignItem(dialogueGraph, 2000210, (Receiver)1, 1, 0); StatementNodeExt val14 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "You there, you took down that occursed thing? Most impressive."); StatementNodeExt val15 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "Thank you for freeing me from this cage. I could use a weapon though, the plains outside are quite dangerous still, no? An Iron Sword will suffice."); StatementNodeExt val16 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "You have quite the eye, you could have given me a stick and it would have proven enough, but I am grateful that you did not, that handicap would surely end poorly."); StatementNodeExt val17 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "This blade is nothing so simple. You've handed me a kazite weapon from my homelands, I can only hope to repay you one day."); StatementNodeExt val18 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "I am a fighter, gladiator, monk, ranger; in short, I am a master of the martial arts, a student of diaspora disciplines, and teacher of my own school of thought."); StatementNodeExt val19 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "After your effort to see me freed, I made short work of the bandits and hyenas in my way to the canyon passage. It was the forest that I saw the most trouble, those giants, the exiled ones, are quite the tough training companions, but not enough to sway my resolve."); StatementNodeExt val20 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "Strong beasts roam those docks, and reliably attempt to claim it as their territory, it is a proving ground for any who truly wish to test their worth. A worthy domain for a warrior's rest in the making. I like the way you think my pupil."); StatementNodeExt val21 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "As would I from you."); StatementNodeExt val22 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "Stay safe comrade. I look forward to training with you again."); StatementNodeExt val23 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "You have done well, you continue to impress. I must admit, your drive is inspiring, even to a master like myself."); StatementNodeExt val24 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "I sought power, but never cared for the sorceries of the conflux leylines and the hexes of Sorobor. I find the balance of a blade more reliable than a sleep deprived wizard any day. Not that magic is not worthwhile, I appreciate healers and alchemists, but they are at so much more risk than a swordmaster."); StatementNodeExt val25 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "The immaculate? Yes, there was one, they were... strange, they had no drive to kill like the others, and they spoke with a wisdom I could never have expected. I asked them then for a spar, and was handedly defeated. But it was an experience I will not take for granted. Should I see them again I would like to test my mettle once more."); StatementNodeExt val26 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "I've sparred with the monk in Monsoon, The hunter of Berg, The rogues of Levant, and even the spellblade that takes up residence in Cierzo. Eto put up the most fight, striking me with a shieldburst of fire caught me ablaze, and off-guard."); StatementNodeExt val27 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "Welcome back my pupil. I look forward to how you have improved."); StatementNodeExt val28 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "I will be in Emercar shortly."); StatementNodeExt val29 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "Thank you! I will remember this."); StatementNodeExt val30 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "Ahh... My saviour!"); StatementNodeExt val31 = TinyDialogueManager.MakeStatementNode(dialogueGraph, ((SynchronizedWorldObject)this).IdentifierName, "That kazite blade of yours truly saved me in a nasty encounter. I have nothing of value to repay you with, but I came across this curious coin... Please accept it as a token of my appreciation."); string text = "Who are you exactly?"; string text2 = "How was your journey eastward?"; string text3 = "I have a proposition, let us meet again in the abandonned river docks of Enmerkar forest."; string text4 = "Elatt protect you."; string text5 = "What led you down this path?"; string text6 = "Have you ever faced an Immacuate?"; string text7 = "If you are willing, I would like to learn from you."; string text8 = "Have you ever challenged the masters of each trade around Aurai?"; string text9 = "Here, a simple weapon, but you seem most capable."; string text10 = "Here, a kazite blade, it seems to go well with your equipment."; string text11 = "I do not have an Iron Sword, but I will try to find one for you."; string text12 = "About the sword you requested..."; ConditionNode val32 = TinyDialogueManager.MakeEventOccuredCondition(dialogueGraph, WhiteFangOutsideTracker.QE_InitialTalk.EventUID, 1); ConditionNode val33 = TinyDialogueManager.MakeEventOccuredCondition(dialogueGraph, WhiteFangOutsideTracker.QE_GivenSword.EventUID, 1); ConditionNode val34 = TinyDialogueManager.MakeEventOccuredCondition(dialogueGraph, WhiteFangOutsideTracker.QE_GivenSwordKazite.EventUID, 1); ConditionNode val35 = TinyDialogueManager.MakeEventOccuredCondition(dialogueGraph, WhiteFangOutsideTracker.QE_FoundInEmercar.EventUID, 1); ConditionNode val36 = TinyDialogueManager.MakeEventOccuredCondition(dialogueGraph, WhiteFangOutsideTracker.QE_MoveOrderToEmercar.EventUID, 1); ConditionNode val37 = TinyDialogueManager.MakeHasItemCondition(dialogueGraph, 2000010, 1); ConditionNode val38 = TinyDialogueManager.MakeHasItemConditionSimple(dialogueGraph, 2000210, 1, 0); ConditionNode val39 = TinyDialogueManager.MakeHasItemConditionSimple(dialogueGraph, 2000210, 1, 0); MultipleChoiceNodeExt val40 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[3] { text12, text, text7 }); MultipleChoiceNodeExt val41 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[3] { text11, text, text7 }); MultipleChoiceNodeExt val42 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[2] { text, text7 }); MultipleChoiceNodeExt val43 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[3] { text3, text, text7 }); MultipleChoiceNodeExt val44 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[6] { text7, text2, text5, text6, text8, text4 }); MultipleChoiceNodeExt val45 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[3] { text9, text10, text11 }); MultipleChoiceNodeExt val46 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[2] { text10, text11 }); MultipleChoiceNodeExt val47 = TinyDialogueManager.MakeMultipleChoiceNode(dialogueGraph, new string[2] { text9, text11 }); if (rpcMeta == "prison") { dialogueGraph.primeNode = (Node)(object)val36; TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val36, (Node[])(object)new Node[2] { (Node)val28, (Node)val32 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val28, (Node)val42 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val42, (Node[])(object)new Node[2] { (Node)val18, (Node)val21 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val32, (Node[])(object)new Node[2] { (Node)val33, (Node)val14 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[3] { (Node)val14, (Node)val6, (Node)val33 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val33, (Node[])(object)new Node[2] { (Node)val30, (Node)val15 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val15, (Node)val40 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val40, (Node[])(object)new Node[3] { (Node)val37, (Node)val18, (Node)val21 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val37, (Node[])(object)new Node[2] { (Node)val38, (Node)val39 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val38, (Node[])(object)new Node[2] { (Node)val45, (Node)val47 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val39, (Node[])(object)new Node[2] { (Node)val46, (Node)val29 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val45, (Node[])(object)new Node[3] { (Node)val16, (Node)val17, (Node)val29 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val47, (Node[])(object)new Node[2] { (Node)val16, (Node)val29 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val46, (Node[])(object)new Node[2] { (Node)val17, (Node)val29 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[3] { (Node)val16, (Node)val12, (Node)val7 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[4] { (Node)val17, (Node)val13, (Node)val8, (Node)val7 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val7, (Node)val36 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val41, (Node[])(object)new Node[3] { (Node)val29, (Node)val18, (Node)val21 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val30, (Node)val43 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val43, (Node[])(object)new Node[3] { (Node)val20, (Node)val18, (Node)val21 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[3] { (Node)val20, (Node)val9, (Node)val28 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val21, (Node)val5 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val18, (Node)val36 }); } else if (rpcMeta == "emercar") { dialogueGraph.primeNode = (Node)(object)val35; TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val35, (Node[])(object)new Node[2] { (Node)val27, (Node)val34 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val34, (Node[])(object)new Node[2] { (Node)val10, (Node)val11 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[3] { (Node)val10, (Node)val31, (Node)val11 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[3] { (Node)val11, (Node)val23, (Node)val44 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val27, (Node)val44 }); TinyDialogueManager.ConnectMultipleChoices(dialogueGraph, (Node)(object)val44, (Node[])(object)new Node[6] { (Node)val21, (Node)val19, (Node)val24, (Node)val25, (Node)val26, (Node)val22 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val19, (Node)val44 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val24, (Node)val44 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val25, (Node)val44 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val26, (Node)val44 }); TinyDialogueManager.ChainNodes(dialogueGraph, (Node[])(object)new Node[2] { (Node)val21, (Node)val5 }); } GameObject gameObject2 = ((Component)gameObject.transform.parent).gameObject; gameObject2.SetActive(true); return val; } } public class VagabondSkillTree { public static void SetupSkillTree(ref SkillSchool skillTreeInstance) { SL_SkillTree skillTree = GetSkillTree(); skillTreeInstance = skillTree.CreateBaseSchool(); skillTree.ApplyRows(); } public static SL_SkillTree GetSkillTree() { //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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_006c: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00e3: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_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_015d: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0175: 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_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_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Expected O, but got Unknown //IL_01a6: Expected O, but got Unknown //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Expected O, but got Unknown //IL_01f6: Expected O, but got Unknown //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Expected O, but got Unknown //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0276: 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_0288: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Expected O, but got Unknown //IL_02b9: Expected O, but got Unknown //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Expected O, but got Unknown //IL_0309: Expected O, but got Unknown //IL_0310: Expected O, but got Unknown return new SL_SkillTree { Name = "Vagabond", SkillRows = new List<SL_SkillRow> { new SL_SkillRow { RowIndex = 1, Slots = new List<SL_BaseSkillSlot> { (SL_BaseSkillSlot)new SL_SkillSlot { ColumnIndex = 3, SilverCost = 50, SkillID = 2502046, Breakthrough = false, RequiredSkillSlot = Vector2.zero } } }, new SL_SkillRow { RowIndex = 2, Slots = new List<SL_BaseSkillSlot>() }, new SL_SkillRow { RowIndex = 3, Slots = new List<SL_BaseSkillSlot> { (SL_BaseSkillSlot)new SL_SkillSlot { ColumnIndex = 2, SilverCost = 500, SkillID = 2502045, Breakthrough = true, RequiredSkillSlot = Vector2.zero } } }, new SL_SkillRow { RowIndex = 4, Slots = new List<SL_BaseSkillSlot> { (SL_BaseSkillSlot)new SL_SkillSlotFork { ColumnIndex = 3, RequiredSkillSlot = new Vector2(1f, 3f), Choice1 = new SL_SkillSlot { ColumnIndex = 3, SilverCost = 600, SkillID = 2502048, Breakthrough = false, RequiredSkillSlot = new Vector2(1f, 3f) }, Choice2 = new SL_SkillSlot { ColumnIndex = 3, SilverCost = 600, SkillID = 2502049, Breakthrough = false, RequiredSkillSlot = new Vector2(1f, 3f) } }, (SL_BaseSkillSlot)new SL_SkillSlot { ColumnIndex = 1, SilverCost = 600, SkillID = 2502041, Breakthrough = false, RequiredSkillSlot = new Vector2(3f, 2f) } } }, new SL_SkillRow { RowIndex = 5, Slots = new List<SL_BaseSkillSlot> { (SL_BaseSkillSlot)new SL_SkillSlotFork { ColumnIndex = 3, RequiredSkillSlot = new Vector2(4f, 3f), Choice1 = new SL_SkillSlot { ColumnIndex = 3, SilverCost = 600, SkillID = 2502044, Breakthrough = false, RequiredSkillSlot = new Vector2(4f, 3f) }, Choice2 = new SL_SkillSlot { ColumnIndex = 2, SilverCost = 600, SkillID = 2502047, Breakthrough = false, RequiredSkillSlot = new Vector2(4f, 3f) } }, (SL_BaseSkillSlot)new SL_SkillSlot { ColumnIndex = 1, SilverCost = 600, SkillID = 2502043, Breakthrough = false, RequiredSkillSlot = new Vector2(3f, 2f) } } } } }; } }