Decompiled source of CustomAbilities v1.0.2
BepInEx\plugins\CustomAbilities.dll
Decompiled an hour ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.Json; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using CustomAbilities.Commands; using CustomAbilities.Models; using CustomAbilities.Resources; using CustomAbilities.Services; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Microsoft.CodeAnalysis; using ProjectM; using ProjectM.Network; using ProjectM.Physics; using ProjectM.Scripting; using ProjectM.Shared; using Stunlock.Core; using Stunlock.Network; using Unity.Collections; using Unity.Entities; using Unity.Mathematics; using UnityEngine; using VampireCommandFramework; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("CustomAbilities")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("CustomAbilities")] [assembly: AssemblyTitle("CustomAbilities")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CustomAbilities { public static class AbilityAPI { private static readonly List<Func<Entity, PrefabGUID, int[], int[]>> _specialCaseHandlers = new List<Func<Entity, PrefabGUID, int[], int[]>>(); private static readonly List<Func<Entity, PrefabGUID, int[]>> _formAbilityOverrideHandlers = new List<Func<Entity, PrefabGUID, int[]>>(); public static void RegisterSpecialCaseHandler(Func<Entity, PrefabGUID, int[], int[]> handler) { _specialCaseHandlers.Add(handler); } internal static int[] RunSpecialCaseHandlers(Entity playerEntity, PrefabGUID weaponEquipBuff, int[] abilitySlotPrefabGUIDs) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) foreach (Func<Entity, PrefabGUID, int[], int[]> specialCaseHandler in _specialCaseHandlers) { abilitySlotPrefabGUIDs = specialCaseHandler(playerEntity, weaponEquipBuff, abilitySlotPrefabGUIDs); } return abilitySlotPrefabGUIDs; } public static void RegisterFormAbilityOverride(Func<Entity, PrefabGUID, int[]> handler) { _formAbilityOverrideHandlers.Add(handler); } internal static int[] RunFormAbilityOverrides(Entity playerEntity, PrefabGUID formBuffPrefabGUID) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) foreach (Func<Entity, PrefabGUID, int[]> formAbilityOverrideHandler in _formAbilityOverrideHandlers) { int[] array = formAbilityOverrideHandler(playerEntity, formBuffPrefabGUID); if (array != null) { return array; } } return null; } public static void SetAbility(Entity playerEntity, AbilityTypeEnum slot, PrefabGUID ability, string weaponCategory, out string warningMessage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) AbilityService.setAbility(playerEntity, slot, ability, weaponCategory, out warningMessage); } public static void SetAbilityForAllCategories(Entity playerEntity, AbilityTypeEnum slot, PrefabGUID ability, out string warningMessage) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) AbilityService.SetAbilityForAllCategories(playerEntity, slot, ability, out warningMessage); } public static void ClearAbilitySlot(Entity playerEntity, AbilityTypeEnum slot, string weaponCategory) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) AbilityService.ClearAbilitySlot(playerEntity, slot, weaponCategory); } public static void ClearAbilitySlotForAllCategories(Entity playerEntity, AbilityTypeEnum slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) AbilityService.ClearAbilitySlotForAllCategories(playerEntity, slot); } public static void ClearAllAbilitySlots(Entity playerEntity, string weaponCategory) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) AbilityService.ClearAllAbilitySlots(playerEntity, weaponCategory); } public static void ClearAllAbilitySlotsForAllCategories(Entity playerEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) AbilityService.ClearAllAbilitySlotsForAllCategories(playerEntity); } public static bool SetItemAbility(Entity itemEntity, AbilityTypeEnum slot, PrefabGUID ability, out string reason) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return AbilityService.SetItemAbility(itemEntity, slot, ability, out reason); } public static void ClearItemAbility(Entity itemEntity, AbilityTypeEnum slot) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) AbilityService.ClearItemAbility(itemEntity, slot); } public static void ClearAllItemAbilities(Entity itemEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) AbilityService.ClearAllItemAbilities(itemEntity); } public static void ApplyAbilities(Entity playerEntity, Entity buffEntity, int[] abilitySlotPrefabGUIDs, int priority = 1) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) AbilityService.ApplyAbilities(playerEntity, buffEntity, abilitySlotPrefabGUIDs, priority); } public static void ApplyAbilityBuff(Entity buffEntity, AbilityTypeEnum abilityType, PrefabGUID abilityGUID, int priority = 0) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) AbilityService.ApplyAbilityBuff(buffEntity, abilityType, abilityGUID, priority); } public static void RefreshEquipBuff(Entity playerEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) Core.StartCoroutine(AbilityService.RefreshEquipBuff(playerEntity)); } public static bool TryGetStandardizedWeaponCategory(string input, out string standardizedCategory) { return AbilityService.TryGetStandardizedWeaponCategory(input, out standardizedCategory); } public static string GetEquippedWeaponCategory(Entity playerEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return PlayerService.GetEquippedWeaponCategory(playerEntity); } } internal static class Core { public static bool _initialized = false; private static DebugEventsSystem _debugEventsSystem; private static ServerScriptMapper _serverScriptMapper; private static MonoBehaviour _monoBehaviour; public static ManualLogSource Log => Plugin.LogInstance; public static World World { get; } = GetServerWorld() ?? throw new Exception("Server world not found. Ensure this plugin is running on a dedicated server."); public static EntityManager EntityManager => World.EntityManager; public static DebugEventsSystem DebugEventsSystem => _debugEventsSystem ?? (_debugEventsSystem = World.GetExistingSystemManaged<DebugEventsSystem>()); public static ServerScriptMapper ServerScriptMapper => _serverScriptMapper ?? (_serverScriptMapper = World.GetExistingSystemManaged<ServerScriptMapper>()); public static ServerGameManager ServerGameManager => ServerScriptMapper.GetServerGameManager(); public static PlayerService PlayerService { get; private set; } public static void Initialize() { PlayerDataService.Initialize(); ItemDataService.Initialize(); PlayerService = new PlayerService(); _initialized = true; } private static World GetServerWorld() { return ((IEnumerable<World>)World.s_AllWorlds.ToArray()).FirstOrDefault((Func<World, bool>)((World world) => world.Name == "Server")); } public static void StartCoroutine(IEnumerator routine) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_monoBehaviour == (Object)null) { _monoBehaviour = (MonoBehaviour)(object)new GameObject("CustomAbilities").AddComponent<IgnorePhysicsDebugSystem>(); Object.DontDestroyOnLoad((Object)(object)((Component)_monoBehaviour).gameObject); } _monoBehaviour.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine)); } } public static class VExtensions { private static EntityManager EntityManager => Core.EntityManager; public static bool TryGetComponent<T>(this Entity entity, out T componentData) where T : struct { //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) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002b: Unknown result type (might be due to invalid IL or missing references) componentData = default(T); EntityManager entityManager = EntityManager; if (((EntityManager)(ref entityManager)).HasComponent(entity, new ComponentType(Il2CppType.Of<T>(), (AccessMode)0))) { entityManager = EntityManager; componentData = ((EntityManager)(ref entityManager)).GetComponentData<T>(entity); return true; } return false; } public static T Read<T>(this Entity entity) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).GetComponentData<T>(entity); } public static User GetUser(this Entity entity) { //IL_0000: 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) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (entity.TryGetComponent<User>(out User componentData)) { return componentData; } if (entity.TryGetComponent<PlayerCharacter>(out PlayerCharacter componentData2)) { return componentData2.UserEntity.Read<User>(); } return User.Empty; } } [BepInPlugin("io.vrising.CustomAbilities", "CustomAbilities", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class Plugin : BasePlugin { private Harmony _harmony; private static ConfigEntry<bool> _disableBatForm; private static ConfigEntry<bool> _blockJewelableAbilitiesOnItems; private static ConfigEntry<bool> _devMode; internal static Plugin Instance { get; private set; } public static Harmony Harmony => Instance._harmony; public static bool IsServer { get; private set; } public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log; public static bool Initialized { get; internal set; } public static bool DisableBatForm => _disableBatForm.Value; public static bool BlockJewelableAbilitiesOnItems => _blockJewelableAbilitiesOnItems.Value; public static bool DevMode => _devMode.Value; public override void Load() { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown Instance = this; IsServer = Application.productName == "VRisingServer"; if (!IsServer) { Core.Log.LogWarning((object)"This plugin is intended to run on the server only. It will not function correctly on the client."); return; } _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); InitConfig(); CommandRegistry.RegisterAll(); ManualLogSource log = ((BasePlugin)this).Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(23, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("CustomAbilities"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.0.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" loaded successfully!"); } log.LogInfo(val); } private void InitConfig() { _disableBatForm = ((BasePlugin)this).Config.Bind<bool>("General", "DisableBatForm", true, "Disable Bat Vampire unlock for players, useful for servers that don't want to allow it."); _blockJewelableAbilitiesOnItems = ((BasePlugin)this).Config.Bind<bool>("General", "BlockJewelableAbilitiesOnItems", true, "Prevent jewelable abilities (spell school abilities) from being set on items/weapons."); _devMode = ((BasePlugin)this).Config.Bind<bool>("General", "DevMode", false, "Enable development mode with additional logging/debugging features"); } public override bool Unload() { _harmony.UnpatchSelf(); if (IsServer) { PlayerDataService.FlushSaveToDisk(); ItemDataService.FlushSaveToDisk(); } return true; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "io.vrising.CustomAbilities"; public const string PLUGIN_NAME = "CustomAbilities"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace CustomAbilities.Services { public static class AbilityService { public static PrefabGUID DEFAULT_AXE_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Axe_Base; public static PrefabGUID DEFAULT_CLAWS_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Claws_Base; public static PrefabGUID DEFAULT_CROSSBOW_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Crossbow_Base; public static PrefabGUID DEFAULT_DAGGERS_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Daggers_Base; public static PrefabGUID DEFAULT_FISHING_POLE_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_FishingPole_Base; public static PrefabGUID DEFAULT_GREATSWORD_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_GreatSword_Base; public static PrefabGUID DEFAULT_LONGBOW_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Longbow_Base; public static PrefabGUID DEFAULT_MACE_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Mace_Base; public static PrefabGUID DEFAULT_PISTOLS_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Pistols_Base; public static PrefabGUID DEFAULT_REAPER_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Reaper_Base; public static PrefabGUID DEFAULT_SLASHERS_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Slashers_Base; public static PrefabGUID DEFAULT_SPEAR_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Spear_Base; public static PrefabGUID DEFAULT_SWORD_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Sword_Base; public static PrefabGUID DEFAULT_TWINBLADES_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_TwinBlades_Base; public static PrefabGUID DEFAULT_WHIP_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Whip_Base; public static PrefabGUID DEFAULT_UNARMED_EQUIPBUFF = PrefabGUIDs.EquipBuff_Weapon_Unarmed_Start01; public const string CATEGORY_AXE = "Axe"; public const string CATEGORY_CLAWS = "Claws"; public const string CATEGORY_CROSSBOW = "Crossbow"; public const string CATEGORY_DAGGERS = "Daggers"; public const string CATEGORY_FISHING_POLE = "FishingPole"; public const string CATEGORY_GREATSWORD = "GreatSword"; public const string CATEGORY_LONGBOW = "Longbow"; public const string CATEGORY_MACE = "Mace"; public const string CATEGORY_PISTOLS = "Pistols"; public const string CATEGORY_REAPER = "Reaper"; public const string CATEGORY_SLASHERS = "Slashers"; public const string CATEGORY_SPEAR = "Spear"; public const string CATEGORY_SWORD = "Sword"; public const string CATEGORY_TWINBLADES = "TwinBlades"; public const string CATEGORY_WHIP = "Whip"; public const string CATEGORY_UNARMED = "Unarmed"; public static List<string> weaponCategories = new List<string> { "Unarmed", "Axe", "Claws", "Crossbow", "Daggers", "FishingPole", "GreatSword", "Longbow", "Mace", "Pistols", "Reaper", "Slashers", "Spear", "Sword", "TwinBlades", "Whip" }; public static readonly Dictionary<string, PrefabGUID> WeaponCategoryToDefaultEquipBuff = new Dictionary<string, PrefabGUID> { { "Axe", DEFAULT_AXE_EQUIPBUFF }, { "Claws", DEFAULT_CLAWS_EQUIPBUFF }, { "Crossbow", DEFAULT_CROSSBOW_EQUIPBUFF }, { "Daggers", DEFAULT_DAGGERS_EQUIPBUFF }, { "FishingPole", DEFAULT_FISHING_POLE_EQUIPBUFF }, { "GreatSword", DEFAULT_GREATSWORD_EQUIPBUFF }, { "Longbow", DEFAULT_LONGBOW_EQUIPBUFF }, { "Mace", DEFAULT_MACE_EQUIPBUFF }, { "Pistols", DEFAULT_PISTOLS_EQUIPBUFF }, { "Reaper", DEFAULT_REAPER_EQUIPBUFF }, { "Slashers", DEFAULT_SLASHERS_EQUIPBUFF }, { "Spear", DEFAULT_SPEAR_EQUIPBUFF }, { "Sword", DEFAULT_SWORD_EQUIPBUFF }, { "TwinBlades", DEFAULT_TWINBLADES_EQUIPBUFF }, { "Whip", DEFAULT_WHIP_EQUIPBUFF }, { "Unarmed", DEFAULT_UNARMED_EQUIPBUFF } }; public static readonly Dictionary<int, AbilityTypeEnum> PlacementIdToAbilityType = new Dictionary<int, AbilityTypeEnum> { { 0, (AbilityTypeEnum)0 }, { 1, (AbilityTypeEnum)1 }, { 2, (AbilityTypeEnum)4 }, { 3, (AbilityTypeEnum)2 }, { 4, (AbilityTypeEnum)5 }, { 5, (AbilityTypeEnum)6 }, { 6, (AbilityTypeEnum)7 } }; public static readonly PrefabGUID[] jewelableAbilityPrefabs = (PrefabGUID[])(object)new PrefabGUID[42] { PrefabGUIDs.AB_Blood_BloodFountain_AbilityGroup, PrefabGUIDs.AB_Blood_BloodRage_AbilityGroup, PrefabGUIDs.AB_Blood_BloodRite_AbilityGroup, PrefabGUIDs.AB_Blood_CarrionSwarm_AbilityGroup, PrefabGUIDs.AB_Blood_SanguineCoil_AbilityGroup, PrefabGUIDs.AB_Blood_Shadowbolt_AbilityGroup, PrefabGUIDs.AB_Vampire_VeilOfBlood_Group, PrefabGUIDs.AB_Unholy_ChainsOfDeath_AbilityGroup, PrefabGUIDs.AB_Unholy_CorpseExplosion_AbilityGroup, PrefabGUIDs.AB_Unholy_CorruptedSkull_AbilityGroup, PrefabGUIDs.AB_Unholy_DeathKnight_AbilityGroup, PrefabGUIDs.AB_Unholy_Soulburn_AbilityGroup, PrefabGUIDs.AB_Unholy_WardOfTheDamned_AbilityGroup, PrefabGUIDs.AB_Vampire_VeilOfBones_AbilityGroup, PrefabGUIDs.AB_Storm_BallLightning_AbilityGroup, PrefabGUIDs.AB_Storm_Cyclone_AbilityGroup, PrefabGUIDs.AB_Storm_Discharge_AbilityGroup, PrefabGUIDs.AB_Storm_LightningTendrils_AbilityGroup, PrefabGUIDs.AB_Storm_LightningWall_AbilityGroup, PrefabGUIDs.AB_Storm_PolarityShift_AbilityGroup, PrefabGUIDs.AB_Vampire_VeilOfStorm_Group, PrefabGUIDs.AB_Chaos_Aftershock_Group, PrefabGUIDs.AB_Chaos_Barrier_AbilityGroup, PrefabGUIDs.AB_Chaos_Volley_AbilityGroup, PrefabGUIDs.AB_Chaos_PowerSurge_AbilityGroup, PrefabGUIDs.AB_Chaos_RainOfChaos_AbilityGroup, PrefabGUIDs.AB_Chaos_Void_AbilityGroup, PrefabGUIDs.AB_Vampire_VeilOfChaos_Group, PrefabGUIDs.AB_Illusion_Curse_Group, PrefabGUIDs.AB_Illusion_MistTrance_AbilityGroup, PrefabGUIDs.AB_Illusion_Mosquito_AbilityGroup, PrefabGUIDs.AB_Illusion_PhantomAegis_AbilityGroup, PrefabGUIDs.AB_Illusion_SpectralWolf_AbilityGroup, PrefabGUIDs.AB_Illusion_WraithSpear_AbilityGroup, PrefabGUIDs.AB_Vampire_VeilOfIllusion_AbilityGroup, PrefabGUIDs.AB_Frost_ColdSnap_AbilityGroup, PrefabGUIDs.AB_Frost_CrystalLance_AbilityGroup, PrefabGUIDs.AB_Frost_FrostBat_AbilityGroup, PrefabGUIDs.AB_Frost_IceNova_AbilityGroup, PrefabGUIDs.AB_FrostBarrier_AbilityGroup, PrefabGUIDs.AB_FrostCone_AbilityGroup, PrefabGUIDs.AB_Vampire_VeilOfFrost_Group }; public static readonly PrefabGUID[] recastableAbilities = (PrefabGUID[])(object)new PrefabGUID[15] { PrefabGUIDs.AB_Blood_BloodFountain_AbilityGroup, PrefabGUIDs.AB_Blood_CarrionSwarm_AbilityGroup, PrefabGUIDs.AB_Chaos_Barrier_AbilityGroup, PrefabGUIDs.AB_Chaos_PowerSurge_AbilityGroup, PrefabGUIDs.AB_Frost_IceNova_AbilityGroup, PrefabGUIDs.AB_FrostBarrier_AbilityGroup, PrefabGUIDs.AB_Illusion_PhantomAegis_AbilityGroup, PrefabGUIDs.AB_Illusion_WispDance_AbilityGroup, PrefabGUIDs.AB_Storm_BallLightning_AbilityGroup, PrefabGUIDs.AB_Storm_Discharge_AbilityGroup, PrefabGUIDs.AB_Storm_EyeOfTheStorm_AbilityGroup, PrefabGUIDs.AB_Unholy_UnstableArachnid_AbilityGroup, PrefabGUIDs.AB_Unholy_WardOfTheDamned_AbilityGroup, PrefabGUIDs.AB_Vampire_VeilOfChaos_Group, PrefabGUIDs.AB_Vampire_VeilOfIllusion_AbilityGroup }; private static EntityManager EntityManager => Core.EntityManager; public static bool TryGetStandardizedWeaponCategory(string input, out string standardizedCategory) { if (string.IsNullOrEmpty(input)) { standardizedCategory = null; return false; } string text = input.ToLower(); if (text == "all") { standardizedCategory = "All"; return true; } foreach (string weaponCategory in weaponCategories) { if (weaponCategory.ToLower() == text) { standardizedCategory = weaponCategory; return true; } } standardizedCategory = null; return false; } public static string GetValidWeaponCategories() { return "All, " + string.Join(", ", weaponCategories); } public static void setAbility(Entity playerEntity, AbilityTypeEnum targetSlot, PrefabGUID abilityPrefab, string currentWeaponCategory, out string warningMessage) { //IL_0004: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) warningMessage = null; PlayerData playerData = PlayerDataService.GetPlayerData(playerEntity); WeaponCategoryToDefaultEquipBuff.TryGetValue(currentWeaponCategory, out var value); int value2 = value._Value; Dictionary<int, int[]> abilitySlotDefinitions = playerData.AbilitySlotDefinitions; if (!abilitySlotDefinitions.ContainsKey(value2)) { abilitySlotDefinitions[value2] = new int[8]; } if (((PrefabGUID)(ref abilityPrefab)).HasValue() && recastableAbilities.Contains(abilityPrefab)) { warningMessage = $"Using a recastable ability ({abilityPrefab}) on a non-normal slot may cause you to lose your jewel. You have been warned."; } playerData.AbilitySlotDefinitions[value2][targetSlot] = ((PrefabGUID)(ref abilityPrefab)).GuidHash; PlayerDataService.SaveData(); } public static void ClearAbilitySlot(Entity playerEntity, AbilityTypeEnum targetSlot, string currentWeaponCategory) { //IL_0000: 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_0043: Unknown result type (might be due to invalid IL or missing references) PlayerData playerData = PlayerDataService.GetPlayerData(playerEntity); WeaponCategoryToDefaultEquipBuff.TryGetValue(currentWeaponCategory, out var value); int value2 = value._Value; Dictionary<int, int[]> abilitySlotDefinitions = playerData.AbilitySlotDefinitions; if (!abilitySlotDefinitions.ContainsKey(value2)) { abilitySlotDefinitions[value2] = new int[8]; } playerData.AbilitySlotDefinitions[value2][targetSlot] = 0; PlayerDataService.SaveData(); } public static void ClearAllAbilitySlots(Entity playerEntity, string currentWeaponCategory) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) PlayerData playerData = PlayerDataService.GetPlayerData(playerEntity); WeaponCategoryToDefaultEquipBuff.TryGetValue(currentWeaponCategory, out var value); int value2 = value._Value; Dictionary<int, int[]> abilitySlotDefinitions = playerData.AbilitySlotDefinitions; if (!abilitySlotDefinitions.ContainsKey(value2)) { abilitySlotDefinitions[value2] = new int[8]; } for (int i = 0; i < 8; i++) { playerData.AbilitySlotDefinitions[value2][i] = 0; } PlayerDataService.SaveData(); } public static void SetAbilityForAllCategories(Entity playerEntity, AbilityTypeEnum targetSlot, PrefabGUID abilityPrefab, out string warningMessage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) foreach (string weaponCategory in weaponCategories) { setAbility(playerEntity, targetSlot, abilityPrefab, weaponCategory, out var warningMessage2); if (warningMessage2 != null) { warningMessage = warningMessage2; return; } } warningMessage = null; } public static void ClearAbilitySlotForAllCategories(Entity playerEntity, AbilityTypeEnum targetSlot) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) foreach (string weaponCategory in weaponCategories) { ClearAbilitySlot(playerEntity, targetSlot, weaponCategory); } } public static void ClearAllAbilitySlotsForAllCategories(Entity playerEntity) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) foreach (string weaponCategory in weaponCategories) { ClearAllAbilitySlots(playerEntity, weaponCategory); } } public static bool SetItemAbility(Entity itemEntity, AbilityTypeEnum targetSlot, PrefabGUID abilityPrefab, out string reason) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_002d: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) if (((PrefabGUID)(ref abilityPrefab)).HasValue() && jewelableAbilityPrefabs.Contains(abilityPrefab) && Plugin.BlockJewelableAbilitiesOnItems) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(99, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[AbilityService] - Attempted to set jewelable ability "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(abilityPrefab); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" on item "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(itemEntity); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", but this is not allowed by config."); } log.LogInfo(val); reason = "Setting jewelable abilities on items is not allowed."; return false; } ItemDataService.GetItemData(itemEntity).AbilityGUIDs[targetSlot] = ((PrefabGUID)(ref abilityPrefab)).GuidHash; ItemDataService.MarkDirty(); reason = null; return true; } public static void ClearItemAbility(Entity itemEntity, AbilityTypeEnum targetSlot) { //IL_0000: 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) ItemDataService.GetItemData(itemEntity).AbilityGUIDs[targetSlot] = 0; ItemDataService.MarkDirty(); } public static void ClearAllItemAbilities(Entity itemEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) ItemData itemData = ItemDataService.GetItemData(itemEntity); for (int i = 0; i < 8; i++) { itemData.AbilityGUIDs[i] = 0; } ItemDataService.MarkDirty(); } public static void ApplyAbilities(Entity playerEntity, Entity buffEntity, int[] abilitySlotPrefabGUIDs, int groupPriority = 1) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) if (abilitySlotPrefabGUIDs == null) { return; } EntityManager entityManager = EntityManager; DynamicBuffer<ReplaceAbilityOnSlotBuff> buffer = ((EntityManager)(ref entityManager)).GetBuffer<ReplaceAbilityOnSlotBuff>(buffEntity, false); for (int i = 0; i < buffer.Length; i++) { ReplaceAbilityOnSlotBuff val = buffer[i]; if (val.Priority == 99) { val.Priority = 8; buffer[i] = val; } } PrefabGUID zero = default(PrefabGUID); for (int j = 0; j < abilitySlotPrefabGUIDs.Length; j++) { if (abilitySlotPrefabGUIDs[j] != 0) { ((PrefabGUID)(ref zero))..ctor(abilitySlotPrefabGUIDs[j]); if (abilitySlotPrefabGUIDs[j] == -1) { zero = PrefabGUIDs.Zero; } if (((PrefabGUID)(ref zero)).HasValue()) { ApplyAbilityBuff(buffEntity, (AbilityTypeEnum)j, zero, groupPriority); } } } } public static void ApplyAbilityBuff(Entity buffEntity, AbilityTypeEnum abilityType, PrefabGUID abilityGUID, int priority = 0) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected I4, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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: Expected I4, but got Unknown //IL_003f: 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_006f: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; DynamicBuffer<ReplaceAbilityOnSlotBuff> buffer = ((EntityManager)(ref entityManager)).GetBuffer<ReplaceAbilityOnSlotBuff>(buffEntity, false); ReplaceAbilityOnSlotBuff val2; if (((PrefabGUID)(ref abilityGUID)).Equals(PrefabGUIDs.Zero)) { ReplaceAbilityOnSlotBuff val = default(ReplaceAbilityOnSlotBuff); val.Slot = (int)abilityType; val.CopyCooldown = false; val.Priority = 99; val2 = val; } else { ReplaceAbilityOnSlotBuff val = default(ReplaceAbilityOnSlotBuff); val.Slot = (int)abilityType; val.NewGroupId = abilityGUID; val.CopyCooldown = true; val.Priority = priority; val2 = val; } buffer.Add(val2); } public static PrefabGUID getEquippedAbilityPrefabGuid(Entity playerEntity, AbilityTypeEnum targetSlot) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_0077: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Enumerator<Entity> enumerator = EntityService.GetEntitiesByComponentTypes<Buff, PrefabGUID>().GetEnumerator(); VBloodAbilityReplaceBuff val = default(VBloodAbilityReplaceBuff); while (enumerator.MoveNext()) { Entity current = enumerator.Current; if (!(current.Read<EntityOwner>().Owner == playerEntity)) { continue; } EntityManager entityManager = EntityManager; if (((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(current) == PrefabGUIDs.Buff_VBlood_Ability_Replace) { entityManager = EntityManager; if (((EntityManager)(ref entityManager)).TryGetComponentData<VBloodAbilityReplaceBuff>(current, ref val) && val.AbilityType == targetSlot) { return val.AbilityGUID; } } } return PrefabGUID.Empty; } public static IEnumerator RefreshEquipBuff(Entity playerEntity) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) PrefabGUID currentEquipBuff = PlayerService.GetEquipBuffPrefabGUID(playerEntity); ManualLogSource log = Core.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(53, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[AbilityService] - Refreshing equip buff "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<PrefabGUID>(currentEquipBuff); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" for player "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Entity>(playerEntity); } log.LogInfo(val); if (BuffService.HasBuff(playerEntity, currentEquipBuff)) { BuffService.RemoveBuff(playerEntity, currentEquipBuff); } yield return (object)new WaitForSeconds(0.3f); BuffService.ApplyBuff(playerEntity, currentEquipBuff); yield return null; } public static void CastAbility(Entity casterEntity, PrefabGUID abilityGroupPrefab) { //IL_0009: 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_001d: 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_002d: 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_0035: 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_003e: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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) DebugEventsSystem debugEventsSystem = Core.DebugEventsSystem; int num = -1; NetworkId who = default(NetworkId); if (casterEntity.TryGetComponent<NetworkId>(out NetworkId componentData)) { who = componentData; } Nullable_Unboxed<float3> aimPosition = default(Nullable_Unboxed<float3>); FromCharacter val = new FromCharacter { Character = casterEntity }; EntityManager entityManager = EntityManager; ? user; if (!((EntityManager)(ref entityManager)).HasComponent<PlayerCharacter>(casterEntity)) { entityManager = EntityManager; user = (((EntityManager)(ref entityManager)).HasComponent<User>(casterEntity) ? casterEntity : casterEntity); } else { entityManager = EntityManager; user = ((EntityManager)(ref entityManager)).GetComponentData<PlayerCharacter>(casterEntity).UserEntity; } val.User = (Entity)user; FromCharacter val2 = val; CastAbilityServerDebugEvent val3 = new CastAbilityServerDebugEvent { Who = who, AimPosition = aimPosition, AbilityGroup = abilityGroupPrefab }; debugEventsSystem.CastAbilityServerDebugEvent(num, ref val3, ref val2); } public static int[] HandleSpecialCases(Entity playerEntity, PrefabGUID weaponEquipBuff, int[] abilitySlotPrefabGUIDs) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) return AbilityAPI.RunSpecialCaseHandlers(playerEntity, weaponEquipBuff, abilitySlotPrefabGUIDs); } public static CommandResult SetAbilityCommand(int placementId, int prefabGuid, string playerName = null, string weaponCategory = null) { //IL_00b5: 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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: 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_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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_0223: Unknown result type (might be due to invalid IL or missing references) PrefabGUID abilityPrefab = default(PrefabGUID); ((PrefabGUID)(ref abilityPrefab))..ctor(prefabGuid); CommandResult result; if (!PlacementIdToAbilityType.TryGetValue(placementId, out var value)) { result = default(CommandResult); result.Success = false; result.Message = "Invalid slot (<color=white>0</color> for Attack, <color=white>1</color> for Q, <color=white>2</color> for E, <color=white>3</color> for Dash, <color=white>4</color> for Spell 1, <color=white>5</color> for Spell 2, <color=white>6</color> for Ultimate)"; return result; } if (!TryGetStandardizedWeaponCategory(weaponCategory, out var standardizedCategory)) { result = default(CommandResult); result.Success = false; result.Message = "'" + weaponCategory + "' is not a valid weapon category.\nAvailable categories: " + GetValidWeaponCategories(); return result; } if (!EntityService.TryFindPlayer(playerName, out var playerEntity, out var _)) { result = default(CommandResult); result.Success = false; result.Message = "Player '" + playerName + "' not found."; return result; } if (standardizedCategory == "All") { SetAbilityForAllCategories(playerEntity, value, abilityPrefab, out var warningMessage); result = default(CommandResult); result.Success = true; result.Message = ((warningMessage != null) ? $"{warningMessage} Set ability slot {value} to prefab GUID {prefabGuid} for player '{playerEntity.GetUser().CharacterName}' for ALL weapon categories." : $"Set ability slot {value} to prefab GUID {prefabGuid} for player '{playerEntity.GetUser().CharacterName}' for ALL weapon categories."); return result; } string text = standardizedCategory ?? PlayerService.GetEquippedWeaponCategory(playerEntity); setAbility(playerEntity, value, abilityPrefab, text, out var warningMessage2); result = default(CommandResult); result.Success = true; result.Message = ((warningMessage2 != null) ? $"{warningMessage2} Set ability slot {value} to prefab GUID {prefabGuid} for player '{playerEntity.GetUser().CharacterName}' for {text} category." : $"Set ability slot {value} to prefab GUID {prefabGuid} for player '{playerEntity.GetUser().CharacterName}' for {text} category."); return result; } public static CommandResult ClearAbilitySlotCommand(int placementId, string playerName = null, string weaponCategory = null) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) CommandResult result; if (!PlacementIdToAbilityType.TryGetValue(placementId, out var value)) { result = default(CommandResult); result.Success = false; result.Message = "Invalid slot (<color=white>0</color> for Attack, <color=white>1</color> for Q, <color=white>2</color> for E, <color=white>3</color> for Dash, <color=white>4</color> for Spell 1, <color=white>5</color> for Spell 2, <color=white>6</color> for Ultimate)"; return result; } if (!TryGetStandardizedWeaponCategory(weaponCategory, out var standardizedCategory)) { result = default(CommandResult); result.Success = false; result.Message = "'" + weaponCategory + "' is not a valid weapon category.\nAvailable categories: " + GetValidWeaponCategories(); return result; } if (!EntityService.TryFindPlayer(playerName, out var playerEntity, out var _)) { result = default(CommandResult); result.Success = false; result.Message = "Player '" + playerName + "' not found."; return result; } if (standardizedCategory == "All") { ClearAbilitySlotForAllCategories(playerEntity, value); result = default(CommandResult); result.Success = true; result.Message = $"Cleared ability slot {value} for player '{playerEntity.GetUser().CharacterName}' for ALL weapon categories."; return result; } string text = standardizedCategory ?? PlayerService.GetEquippedWeaponCategory(playerEntity); ClearAbilitySlot(playerEntity, value, text); result = default(CommandResult); result.Success = true; result.Message = $"Cleared ability slot {value} for player '{playerEntity.GetUser().CharacterName}' for {text} category."; return result; } public static CommandResult ClearAllAbilitySlotsCommand(string playerName = null, string weaponCategory = null) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_00d9: Unknown result type (might be due to invalid IL or missing references) CommandResult result; if (!TryGetStandardizedWeaponCategory(weaponCategory, out var standardizedCategory)) { result = default(CommandResult); result.Success = false; result.Message = "'" + weaponCategory + "' is not a valid weapon category.\nAvailable categories: " + GetValidWeaponCategories(); return result; } if (!EntityService.TryFindPlayer(playerName, out var playerEntity, out var _)) { result = default(CommandResult); result.Success = false; result.Message = "Player '" + playerName + "' not found."; return result; } if (standardizedCategory == "All") { ClearAllAbilitySlotsForAllCategories(playerEntity); result = default(CommandResult); result.Success = true; result.Message = $"Cleared ALL ability slots for player '{playerEntity.GetUser().CharacterName}' for ALL weapon categories."; return result; } string text = standardizedCategory ?? PlayerService.GetEquippedWeaponCategory(playerEntity); ClearAllAbilitySlots(playerEntity, text); result = default(CommandResult); result.Success = true; result.Message = $"Cleared ALL ability slots for player '{playerEntity.GetUser().CharacterName}' for {text} category."; return result; } } internal static class BuffService { private static DebugEventsSystem DebugEventsSystem => Core.DebugEventsSystem; private static ServerGameManager ServerGameManager => Core.ServerGameManager; private static EntityManager EntityManager => Core.EntityManager; public static void ApplyBuff(Entity entity, PrefabGUID buffPrefabGuid) { //IL_0002: 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_000b: 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_0014: 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_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_0029: 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_004c: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0046: Unknown result type (might be due to invalid IL or missing references) ApplyBuffDebugEvent val = default(ApplyBuffDebugEvent); val.BuffPrefabGUID = buffPrefabGuid; ApplyBuffDebugEvent val2 = val; FromCharacter val3 = default(FromCharacter); val3.Character = entity; EntityManager entityManager = EntityManager; ? user; if (!((EntityManager)(ref entityManager)).HasComponent<PlayerCharacter>(entity)) { entityManager = EntityManager; user = (((EntityManager)(ref entityManager)).HasComponent<User>(entity) ? entity : entity); } else { entityManager = EntityManager; user = ((EntityManager)(ref entityManager)).GetComponentData<PlayerCharacter>(entity).UserEntity; } val3.User = (Entity)user; FromCharacter val4 = val3; DebugEventsSystem.ApplyBuff(val4, val2); } public static bool TryGetBuff(Entity entity, PrefabGUID buffPrefabGUID, out Entity buffEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) ServerGameManager serverGameManager = ServerGameManager; if (((ServerGameManager)(ref serverGameManager)).TryGetBuff(entity, ((PrefabGUID)(ref buffPrefabGUID)).ToIdentifier(), ref buffEntity)) { return true; } return false; } public static void TryRemoveBuff(Entity entity, PrefabGUID buffPrefabGuid) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) if (TryGetBuff(entity, buffPrefabGuid, out var buffEntity)) { DestroyBuff(buffEntity); } } public static void DestroyBuff(Entity buffEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (buffEntity != Entity.Null) { EntityManager entityManager = EntityManager; if (((EntityManager)(ref entityManager)).Exists(buffEntity)) { DestroyUtility.Destroy(EntityManager, buffEntity, (DestroyDebugReason)13, (string)null, 0); } } } public static bool RemoveBuff(Entity entity, PrefabGUID buffPrefabGuid) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) TryRemoveBuff(entity, buffPrefabGuid); return true; } public static bool HasBuff(Entity entity, PrefabGUID buffPrefabGuid) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) ServerGameManager serverGameManager = ServerGameManager; return ((ServerGameManager)(ref serverGameManager)).HasBuff(entity, ((PrefabGUID)(ref buffPrefabGuid)).ToIdentifier()); } } public static class EntityService { private static EntityManager EntityManager => Core.EntityManager; public static bool TryFindPlayer(string playerName, out Entity playerEntity, out Entity userEntity) { //IL_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0014: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(playerName)) { playerEntity = Entity.Null; userEntity = Entity.Null; return false; } playerEntity = Entity.Null; userEntity = Entity.Null; EntityManager entityManager = EntityManager; EntityQuery val = ((EntityManager)(ref entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[1] { ComponentType.ReadOnly<User>() }); Enumerator<Entity> enumerator = ((EntityQuery)(ref val)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)).GetEnumerator(); while (enumerator.MoveNext()) { Entity current = enumerator.Current; entityManager = EntityManager; User componentData = ((EntityManager)(ref entityManager)).GetComponentData<User>(current); if (((object)(FixedString64Bytes)(ref componentData.CharacterName)).ToString().Equals(playerName, StringComparison.OrdinalIgnoreCase)) { userEntity = current; playerEntity = componentData.LocalCharacter._Entity; return true; } } return false; } public static NativeArray<Entity> GetEntitiesByComponentTypes<T1, T2>(bool includeAll = false, bool includeDisabled = false, bool includeSpawn = false, bool includePrefab = false, bool includeDestroyed = false) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_002e: Unknown result type (might be due to invalid IL or missing references) EntityQueryOptions val = (EntityQueryOptions)0; if (includeAll) { val = (EntityQueryOptions)(val | 0xC3); } if (includeDisabled) { val = (EntityQueryOptions)(val | 2); } if (includeSpawn) { val = (EntityQueryOptions)(val | 0x40); } if (includePrefab) { val = (EntityQueryOptions)(val | 1); } if (includeDestroyed) { val = (EntityQueryOptions)(val | 0x80); } EntityQueryBuilder val2 = new EntityQueryBuilder(AllocatorHandle.op_Implicit((Allocator)2)); val2 = ((EntityQueryBuilder)(ref val2)).AddAll(new ComponentType(Il2CppType.Of<T1>(), (AccessMode)0)); val2 = ((EntityQueryBuilder)(ref val2)).AddAll(new ComponentType(Il2CppType.Of<T2>(), (AccessMode)0)); EntityQueryBuilder val3 = ((EntityQueryBuilder)(ref val2)).WithOptions(val); EntityManager entityManager = Core.EntityManager; EntityQuery val4 = ((EntityManager)(ref entityManager)).CreateEntityQuery(ref val3); return ((EntityQuery)(ref val4)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); } } public struct ItemData { public string PrefabGUIDName { get; set; } public int PrefabGUID { get; set; } public int SequenceGuidHash { get; set; } public int[] AbilityGUIDs { get; set; } public ItemData(string prefabGUIDName = "", int itemPrefabGUID = 0, int sequenceGuidHash = 0, int[] abilityGUIDs = null) { PrefabGUIDName = prefabGUIDName; PrefabGUID = itemPrefabGUID; SequenceGuidHash = sequenceGuidHash; AbilityGUIDs = abilityGUIDs; } } public static class ItemDataService { private static readonly string SaveDirectory = Path.Combine(Directory.GetCurrentDirectory(), "BepInEx", "config", "CustomAbilities"); private static readonly string SavePath = Path.Combine(SaveDirectory, "customabilities_item_data.json"); private static List<ItemData> _itemDataList = new List<ItemData>(); private static Dictionary<int, ItemData> _itemDataCache = new Dictionary<int, ItemData>(); private static bool _dataDirty = false; private static bool _periodicSaveCoroutineRunning = false; private const float PERIODIC_SAVE_INTERVAL = 30f; public static void Initialize() { Directory.CreateDirectory(SaveDirectory); LoadData(); } public static bool HasItemData(Entity itemEntity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) int num = 0; EntityManager entityManager = Core.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<SequenceGUID>(itemEntity)) { entityManager = Core.EntityManager; num = ((EntityManager)(ref entityManager)).GetComponentData<SequenceGUID>(itemEntity).GuidHash; } if (num != 0) { return _itemDataCache.ContainsKey(num); } return false; } public static ItemData GetItemData(Entity itemEntity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) int num = 0; EntityManager entityManager = Core.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<SequenceGUID>(itemEntity)) { entityManager = Core.EntityManager; num = ((EntityManager)(ref entityManager)).GetComponentData<SequenceGUID>(itemEntity).GuidHash; } if (num != 0) { ItemData result = (_itemDataCache.ContainsKey(num) ? _itemDataCache[num] : default(ItemData)); if (result.PrefabGUIDName != "" && result.SequenceGuidHash != 0) { return result; } } entityManager = Core.EntityManager; PrefabGUID componentData = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(itemEntity); string prefabGUIDName = PrefabGUIDsExtensions.GetPrefabGUIDName(componentData); num = ItemService.GetItemUniqueId(itemEntity); ItemData itemData = default(ItemData); itemData.PrefabGUIDName = prefabGUIDName; itemData.PrefabGUID = componentData._Value; itemData.SequenceGuidHash = num; itemData.AbilityGUIDs = new int[8]; ItemData itemData2 = itemData; _itemDataList.Add(itemData2); _itemDataCache[num] = itemData2; SaveData(); return itemData2; } public static void SaveData() { MarkDirty(); } public static void MarkDirty() { _dataDirty = true; if (!_periodicSaveCoroutineRunning) { Core.StartCoroutine(PeriodicSaveCoroutine()); _periodicSaveCoroutineRunning = true; } } private static IEnumerator PeriodicSaveCoroutine() { while (true) { yield return (object)new WaitForSeconds(30f); if (_dataDirty) { FlushSaveToDisk(); _dataDirty = false; } } } public static void FlushSaveToDisk() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown try { string contents = JsonSerializer.Serialize(_itemDataList); File.WriteAllText(SavePath, contents); } catch (Exception ex) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to save item data: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } log.LogError(val); } } private static void LoadData() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown if (!File.Exists(SavePath)) { return; } try { _itemDataList = JsonSerializer.Deserialize<List<ItemData>>(File.ReadAllText(SavePath)) ?? new List<ItemData>(); _itemDataCache = new Dictionary<int, ItemData>(); foreach (ItemData itemData in _itemDataList) { _itemDataCache[itemData.SequenceGuidHash] = itemData; } } catch (Exception ex) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to load item data: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } log.LogError(val); _itemDataList = new List<ItemData>(); } } } internal static class ItemService { private static EntityManager EntityManager => Core.EntityManager; public static Entity GetHeldWeaponEntity(Entity playerEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0012: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; Equipment val = default(Equipment); if (((EntityManager)(ref entityManager)).TryGetComponentData<Equipment>(playerEntity, ref val)) { Entity entity = val.WeaponSlot.SlotEntity._Entity; entityManager = EntityManager; if (((EntityManager)(ref entityManager)).Exists(entity)) { return entity; } } return Entity.Null; } public static int GetItemUniqueId(Entity itemEntity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_0014: Unknown result type (might be due to invalid IL or missing references) int num = 0; EntityManager entityManager = EntityManager; SequenceGUID val = default(SequenceGUID); if (((EntityManager)(ref entityManager)).TryGetComponentData<SequenceGUID>(itemEntity, ref val)) { return val.GuidHash; } num = Guid.NewGuid().GetHashCode(); ((SequenceGUID)(ref val))..ctor(num); entityManager = EntityManager; ((EntityManager)(ref entityManager)).AddComponentData<SequenceGUID>(itemEntity, val); return num; } } public static class PlayerDataService { private static readonly string SaveDirectory = Path.Combine(Directory.GetCurrentDirectory(), "BepInEx", "config", "CustomAbilities"); private static readonly string SavePath = Path.Combine(SaveDirectory, "customabilities_player_data.json"); private static List<PlayerData> _playerDataList = new List<PlayerData>(); private static Dictionary<int, PlayerData> _playerDataCache = new Dictionary<int, PlayerData>(); private static bool _dataDirty = false; private static bool _periodicSaveCoroutineRunning = false; private const float PERIODIC_SAVE_INTERVAL = 30f; public static void Initialize() { Directory.CreateDirectory(SaveDirectory); LoadData(); } public static PlayerData GetPlayerData(Entity characterEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_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) Entity val = characterEntity; EntityManager entityManager = Core.EntityManager; PrefabGUID val2 = default(PrefabGUID); if (((EntityManager)(ref entityManager)).TryGetComponentData<PrefabGUID>(characterEntity, ref val2) && !((PrefabGUID)(ref val2)).Equals(PrefabGUIDs.CHAR_VampireMale)) { entityManager = Core.EntityManager; ControlledBy val3 = default(ControlledBy); if (((EntityManager)(ref entityManager)).TryGetComponentData<ControlledBy>(characterEntity, ref val3)) { val = val3.Controller.GetUser().LocalCharacter._Entity; } } User user = val.GetUser(); string text = ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString(); if (string.IsNullOrEmpty(text)) { text = "Unknown DAFUQ HAPPENED"; } int guidHash = GetGuidHash(val); if (guidHash != 0 && _playerDataCache.TryGetValue(guidHash, out var value)) { return value; } return GetOrCreatePlayerData(guidHash, text, val); } private static PlayerData GetOrCreatePlayerData(int guidHash, string characterName, Entity characterEntity) { //IL_0010: 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_001a: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) ulong steamId = 0uL; PlayerCharacter componentData2; if (characterEntity.TryGetComponent<User>(out User componentData)) { steamId = componentData.PlatformId; } else if (characterEntity.TryGetComponent<PlayerCharacter>(out componentData2)) { steamId = componentData2.UserEntity.Read<User>().PlatformId; } if (guidHash != 0) { PlayerData playerData = _playerDataList.Find((PlayerData pd) => pd.GuidHash == guidHash); if (playerData != null) { playerData.CharacterName = characterName; _playerDataCache[guidHash] = playerData; return playerData; } } PlayerData obj = new PlayerData { SteamId = steamId, CharacterName = characterName, GuidHash = ((guidHash != 0) ? guidHash : Guid.NewGuid().GetHashCode()) }; PrefabGUID prefabGUID = PrefabGUIDsExtensions.GetPrefabGUID(characterEntity); obj.PrefabGuidHash = ((PrefabGUID)(ref prefabGUID)).GuidHash; PlayerData playerData2 = obj; if (guidHash == 0) { SequenceGUID val = default(SequenceGUID); ((SequenceGUID)(ref val))..ctor(playerData2.GuidHash); EntityManager entityManager = Core.EntityManager; ((EntityManager)(ref entityManager)).AddComponentData<SequenceGUID>(characterEntity, val); guidHash = playerData2.GuidHash; } _playerDataList.Add(playerData2); _playerDataCache[guidHash] = playerData2; SaveData(); return playerData2; } public static void SaveData() { MarkDirty(); } public static void MarkDirty() { _dataDirty = true; if (!_periodicSaveCoroutineRunning) { Core.StartCoroutine(PeriodicSaveCoroutine()); _periodicSaveCoroutineRunning = true; } } private static IEnumerator PeriodicSaveCoroutine() { while (true) { yield return (object)new WaitForSeconds(30f); if (_dataDirty) { FlushSaveToDisk(); _dataDirty = false; } } } public static void FlushSaveToDisk() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown try { string contents = JsonSerializer.Serialize(_playerDataList); File.WriteAllText(SavePath, contents); } catch (Exception ex) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to save player data: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } log.LogError(val); } } private static void LoadData() { //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown if (!File.Exists(SavePath)) { return; } try { _playerDataList = JsonSerializer.Deserialize<List<PlayerData>>(File.ReadAllText(SavePath)) ?? new List<PlayerData>(); _playerDataCache.Clear(); foreach (PlayerData playerData in _playerDataList) { if (playerData.GuidHash != 0) { _playerDataCache[playerData.GuidHash] = playerData; } } } catch (Exception ex) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failed to load player data: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } log.LogError(val); _playerDataList = new List<PlayerData>(); _playerDataCache.Clear(); } } private static int GetGuidHash(Entity characterEntity) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) int result = 0; EntityManager entityManager = Core.EntityManager; if (((EntityManager)(ref entityManager)).HasComponent<SequenceGUID>(characterEntity)) { entityManager = Core.EntityManager; result = ((EntityManager)(ref entityManager)).GetComponentData<SequenceGUID>(characterEntity).GuidHash; } return result; } } public struct PlayerCacheData { public FixedString64Bytes CharacterName { get; set; } public ulong SteamID { get; set; } public bool IsOnline { get; set; } public Entity UserEntity { get; set; } public Entity CharEntity { get; set; } public PlayerCacheData(FixedString64Bytes characterName = default(FixedString64Bytes), ulong steamID = 0uL, bool isOnline = false, Entity userEntity = default(Entity), Entity charEntity = default(Entity)) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_001e: 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) CharacterName = characterName; SteamID = steamID; IsOnline = isOnline; UserEntity = userEntity; CharEntity = charEntity; } } internal class PlayerService { internal PlayerService() { } public static PrefabGUID GetEquipBuffPrefabGUID(Entity playerEntity) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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_007a: Unknown result type (might be due to invalid IL or missing references) Enumerator<Entity> enumerator = EntityService.GetEntitiesByComponentTypes<Buff, PrefabGUID>().GetEnumerator(); while (enumerator.MoveNext()) { Entity current = enumerator.Current; PrefabGUID result = default(PrefabGUID); if (current.Read<EntityOwner>().Owner == playerEntity) { EntityManager entityManager = Core.EntityManager; PrefabGUID componentData = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(current); string prefabGUIDName = PrefabGUIDsExtensions.GetPrefabGUIDName(componentData); foreach (string weaponCategory in AbilityService.weaponCategories) { if (StringExtensions.Contains(prefabGUIDName, weaponCategory, (StringComparison)5)) { result = componentData; break; } } } if (!((PrefabGUID)(ref result)).IsEmpty()) { return result; } } return default(PrefabGUID); } public static string GetEquippedWeaponCategory(Entity playerEntity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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) PrefabGUID equipBuffPrefabGUID = GetEquipBuffPrefabGUID(playerEntity); if (!((PrefabGUID)(ref equipBuffPrefabGUID)).IsEmpty()) { string prefabGUIDName = PrefabGUIDsExtensions.GetPrefabGUIDName(equipBuffPrefabGUID); foreach (string weaponCategory in AbilityService.weaponCategories) { if (StringExtensions.Contains(prefabGUIDName, weaponCategory, (StringComparison)5)) { return weaponCategory; } } } return "Unknown"; } } } namespace CustomAbilities.Resources { internal static class PrefabGUIDs { public static readonly PrefabGUID VM_VBlood_TEMPLATE = new PrefabGUID(2075390218); public static readonly PrefabGUID _10x6RectangularTablesModularBuildMenuGroup = new PrefabGUID(-375280343); public static readonly PrefabGUID _3x3RoundTablesModularBuildMenuGroup = new PrefabGUID(-1226637162); public static readonly PrefabGUID _3x6RectangularTablesBuildMenuGroup = new PrefabGUID(-1058166909); public static readonly PrefabGUID _6x6RoundTablesModularBuildMenuGroup = new PrefabGUID(-1428481029); public static readonly PrefabGUID AB_AmbientLightning_Light = new PrefabGUID(589474506); public static readonly PrefabGUID AB_AmbientLightning_Light_GameplayStrike = new PrefabGUID(-2094079027); public static readonly PrefabGUID AB_ApplyWeaponCoating_AbilityGroup = new PrefabGUID(1327173823); public static readonly PrefabGUID AB_ApplyWeaponCoating_Activate = new PrefabGUID(-578949147); public static readonly PrefabGUID AB_ApplyWeaponCoating_Blood_AbilityGroup = new PrefabGUID(-1007451621); public static readonly PrefabGUID AB_ApplyWeaponCoating_Blood_Activate = new PrefabGUID(1186329047); public static readonly PrefabGUID AB_ApplyWeaponCoating_Blood_Cast = new PrefabGUID(765001445); public static readonly PrefabGUID AB_ApplyWeaponCoating_Cast = new PrefabGUID(1271061994); public static readonly PrefabGUID AB_ApplyWeaponCoating_Chaos_AbilityGroup = new PrefabGUID(-1706926836); public static readonly PrefabGUID AB_ApplyWeaponCoating_Chaos_Activate = new PrefabGUID(-1012725577); public static readonly PrefabGUID AB_ApplyWeaponCoating_Chaos_Cast = new PrefabGUID(1273123129); public static readonly PrefabGUID AB_ApplyWeaponCoating_Frost_AbilityGroup = new PrefabGUID(2110406288); public static readonly PrefabGUID AB_ApplyWeaponCoating_Frost_Activate = new PrefabGUID(-1250180678); public static readonly PrefabGUID AB_ApplyWeaponCoating_Frost_Cast = new PrefabGUID(-346833706); public static readonly PrefabGUID AB_ApplyWeaponCoating_Illusion_AbilityGroup = new PrefabGUID(-1063090297); public static readonly PrefabGUID AB_ApplyWeaponCoating_Illusion_Activate = new PrefabGUID(1197567253); public static readonly PrefabGUID AB_ApplyWeaponCoating_Illusion_Cast = new PrefabGUID(-237809887); public static readonly PrefabGUID AB_ApplyWeaponCoating_Storm_AbilityGroup = new PrefabGUID(419215380); public static readonly PrefabGUID AB_ApplyWeaponCoating_Storm_Activate = new PrefabGUID(655641197); public static readonly PrefabGUID AB_ApplyWeaponCoating_Storm_Cast = new PrefabGUID(1215462047); public static readonly PrefabGUID AB_ApplyWeaponCoating_Unholy_AbilityGroup = new PrefabGUID(1293762372); public static readonly PrefabGUID AB_ApplyWeaponCoating_Unholy_Activate = new PrefabGUID(1932625569); public static readonly PrefabGUID AB_ApplyWeaponCoating_Unholy_Cast = new PrefabGUID(-2088804628); public static readonly PrefabGUID AB_Archer_Projectile_Cast = new PrefabGUID(1106195644); public static readonly PrefabGUID AB_Archer_Projectile_Group = new PrefabGUID(-751119210); public static readonly PrefabGUID AB_Archer_Projectile01 = new PrefabGUID(-1423243724); public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_AbilityGroup = new PrefabGUID(91941562); public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_Cast = new PrefabGUID(1965996833); public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_ImprisonBuff = new PrefabGUID(2007858431); public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_MoveBehaviourBuff = new PrefabGUID(1099681289); public static readonly PrefabGUID AB_ArchMage_ArcaneImprisonment_RingArea = new PrefabGUID(-1952370580); public static readonly PrefabGUID AB_ArchMage_CrystalLance_AbilityGroup = new PrefabGUID(1520734123); public static readonly PrefabGUID AB_ArchMage_CrystalLance_AggroBuff = new PrefabGUID(-967628321); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Cast_01 = new PrefabGUID(-88630604); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Cast_02 = new PrefabGUID(1895752824); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Cast_03 = new PrefabGUID(-518248879); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_AbilityGroup = new PrefabGUID(1187623532); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_Cast = new PrefabGUID(-1536831420); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_HitBuff = new PrefabGUID(1237316881); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_Projectile = new PrefabGUID(-1385969356); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Charged_SplinterProjectile = new PrefabGUID(-485680280); public static readonly PrefabGUID AB_ArchMage_CrystalLance_Projectile = new PrefabGUID(826214455); public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_AbilityGroup = new PrefabGUID(-139137314); public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_Buff = new PrefabGUID(-1161618215); public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_Buff_ALREADY_EXISTS_2 = new PrefabGUID(-1748472670); public static readonly PrefabGUID AB_ArchMage_Emote_Aggro_Cast = new PrefabGUID(-2059383344); public static readonly PrefabGUID AB_ArchMage_FireSpinner_AbilityGroup = new PrefabGUID(1217615468); public static readonly PrefabGUID AB_ArchMage_FireSpinner_Cast = new PrefabGUID(-1997201513); public static readonly PrefabGUID AB_ArchMage_FireSpinner_Projectile = new PrefabGUID(612861780); public static readonly PrefabGUID AB_ArchMage_FireSpinner_Spinner = new PrefabGUID(-1672727739); public static readonly PrefabGUID AB_ArchMage_FlameSphere_AggroBuff = new PrefabGUID(-240922728); public static readonly PrefabGUID AB_ArchMage_FlameSphere_AreaDamageBuff = new PrefabGUID(-1640482518); public static readonly PrefabGUID AB_ArchMage_FlameSphere_AreaEffectBuff = new PrefabGUID(-139562596); public static readonly PrefabGUID AB_ArchMage_FlameSphere_AreaInitBuff = new PrefabGUID(451676082); public static readonly PrefabGUID AB_ArchMage_FlameSphere_Dash_AbilityGroup = new PrefabGUID(-1754787506); public static readonly PrefabGUID AB_ArchMage_FlameSphere_Dash_Cast = new PrefabGUID(2138663579); public static readonly PrefabGUID AB_ArchMage_FlameSphere_Dash_Trigger = new PrefabGUID(1679920133); public static readonly PrefabGUID AB_ArchMage_FlameSphere_Projectile = new PrefabGUID(269193311); public static readonly PrefabGUID AB_ArchMage_FlameSphere_ShouldDestroyBuff = new PrefabGUID(299001257); public static readonly PrefabGUID AB_ArchMage_FlamingIce_AbilityGroup = new PrefabGUID(-2025881745); public static readonly PrefabGUID AB_ArchMage_FlamingIce_Area = new PrefabGUID(379217467); public static readonly PrefabGUID AB_ArchMage_FlamingIce_Cast = new PrefabGUID(1890249378); public static readonly PrefabGUID AB_ArchMage_FlamingIce_Channel = new PrefabGUID(-920928426); public static readonly PrefabGUID AB_ArchMage_FlamingIce_FreezeBuff = new PrefabGUID(821255111); public static readonly PrefabGUID AB_ArchMage_FlamingIce_Trigger = new PrefabGUID(-1488767962); public static readonly PrefabGUID AB_ArchMage_LightningArc_AbilityGroup = new PrefabGUID(-1232816408); public static readonly PrefabGUID AB_ArchMage_LightningArc_Cast = new PrefabGUID(-1524769526); public static readonly PrefabGUID AB_ArchMage_LightningArc_Projectile = new PrefabGUID(1211897000); public static readonly PrefabGUID AB_ArchMage_LightningCurse_AbilityGroup = new PrefabGUID(1365358996); public static readonly PrefabGUID AB_ArchMage_LightningCurse_Cast = new PrefabGUID(1142315183); public static readonly PrefabGUID AB_ArchMage_LightningCurse_Projectile = new PrefabGUID(-1317668918); public static readonly PrefabGUID AB_ArchMage_LightningCurse_ProjectileSpawnerBuff = new PrefabGUID(2089605812); public static readonly PrefabGUID AB_ArchMage_LightningCurse_ProjectileTrigger = new PrefabGUID(390853496); public static readonly PrefabGUID AB_ArchMage_LightningCurse_Trigger = new PrefabGUID(-988990419); public static readonly PrefabGUID AB_ArchMage_MirrorImage_AbilityGroup = new PrefabGUID(-1897317770); public static readonly PrefabGUID AB_ArchMage_MirrorImage_Cast = new PrefabGUID(-1714013936); public static readonly PrefabGUID AB_ArchMage_MirrorImage_EndPhase = new PrefabGUID(262354515); public static readonly PrefabGUID AB_ArchMage_MirrorImage_MoveBehaviourBuff = new PrefabGUID(-1099792891); public static readonly PrefabGUID AB_ArchMage_MirrorImage_Phase = new PrefabGUID(30325069); public static readonly PrefabGUID AB_ArchMage_MirrorImage_Trigger = new PrefabGUID(292114817); public static readonly PrefabGUID AB_ArchMage_Teleport_AbilityGroup = new PrefabGUID(886063983); public static readonly PrefabGUID AB_ArchMage_Teleport_Cast = new PrefabGUID(484270946); public static readonly PrefabGUID AB_ArchMage_Teleport_EndPhase = new PrefabGUID(56049482); public static readonly PrefabGUID AB_ArchMage_Teleport_Phase = new PrefabGUID(-723899936); public static readonly PrefabGUID AB_Bandit_Ambush_Buff = new PrefabGUID(614276301); public static