Decompiled source of Bloodcraft v1.4.2
Bloodcraft.dll
Decompiled a month 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.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP.Utils.Collections; using Bloodcraft.Commands; using Bloodcraft.Patches; using Bloodcraft.Services; using Bloodcraft.Systems.Expertise; using Bloodcraft.Systems.Familiars; using Bloodcraft.Systems.Legacies; using Bloodcraft.Systems.Leveling; using Bloodcraft.Systems.Professions; using Bloodcraft.Systems.Quests; using Bloodcraft.Utilities; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using ProjectM; using ProjectM.Behaviours; using ProjectM.Gameplay.Scripting; using ProjectM.Gameplay.Systems; using ProjectM.Network; using ProjectM.Physics; using ProjectM.Scripting; using ProjectM.Sequencer; using ProjectM.Shared; using ProjectM.Shared.Systems; using Stunlock.Core; using Stunlock.Localization; using Stunlock.Network; using Unity.Collections; using Unity.Entities; using Unity.Jobs; using Unity.Mathematics; using Unity.Scenes; using Unity.Transforms; 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("Bloodcraft")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.4.2.0")] [assembly: AssemblyInformationalVersion("1.4.2")] [assembly: AssemblyProduct("Bloodcraft")] [assembly: AssemblyTitle("Bloodcraft")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.4.2.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.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Bloodcraft { internal static class Core { private static MonoBehaviour MonoBehaviour; public static bool hasInitialized = false; private static World Server { get; } = GetServerWorld() ?? throw new Exception("There is no Server world (yet)..."); public static EntityManager EntityManager => Server.EntityManager; public static ServerGameManager ServerGameManager => SystemService.ServerScriptMapper.GetServerGameManager(); public static SystemService SystemService { get; } = new SystemService(Server); public static double ServerTime => ServerGameManager.ServerTime; public static ManualLogSource Log => Plugin.LogInstance; public static void Initialize() { if (!hasInitialized) { hasInitialized = true; new PlayerService(); new LocalizationService(); if (ConfigService.ClientCompanion) { new EclipseService(); } if (ConfigService.ExtraRecipes) { RecipeUtilities.ExtraRecipes(); } if (ConfigService.StarterKit) { ConfigUtilities.StarterKit(); } if (ConfigService.PrestigeSystem) { BuffUtilities.PrestigeBuffs(); } if (ConfigService.SoftSynergies || ConfigService.HardSynergies) { ConfigUtilities.ClassBuffMap(); ClassUtilities.GenerateAbilityJewelMap(); } if (ConfigService.LevelingSystem) { DeathEventListenerSystemPatch.OnDeathEvent += LevelingSystem.OnUpdate; } if (ConfigService.ExpertiseSystem) { DeathEventListenerSystemPatch.OnDeathEvent += WeaponSystem.OnUpdate; } if (ConfigService.QuestSystem) { new QuestService(); DeathEventListenerSystemPatch.OnDeathEvent += QuestSystem.OnUpdate; } if (ConfigService.FamiliarSystem) { ConfigUtilities.FamiliarBans(); DeathEventListenerSystemPatch.OnDeathEvent += FamiliarLevelingSystem.OnUpdate; DeathEventListenerSystemPatch.OnDeathEvent += FamiliarUnlockSystem.OnUpdate; } hasInitialized = 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("Bloodcraft").AddComponent<IgnorePhysicsDebugSystem>(); Object.DontDestroyOnLoad((Object)(object)((Component)MonoBehaviour).gameObject); } MonoBehaviour.StartCoroutine(CollectionExtensions.WrapToIl2Cpp(routine)); } } internal static class Extensions { public delegate void ActionRef<T>(ref T item); private static EntityManager EntityManager => Core.EntityManager; private static ServerGameManager ServerGameManager => Core.ServerGameManager; private static SystemService SystemService => Core.SystemService; private static PrefabCollectionSystem PrefabCollectionSystem => SystemService.PrefabCollectionSystem; public static void With<T>(this Entity entity, ActionRef<T> action) where T : struct { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) T item = entity.ReadRW<T>(); action(ref item); EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentData<T>(entity, item); } public unsafe static void Write<T>(this Entity entity, T componentData) where T : struct { //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); byte[] array = StructureToByteArray(componentData); int num = Marshal.SizeOf<T>(); fixed (byte* ptr = array) { EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).SetComponentDataRaw(entity, val.TypeIndex, (void*)ptr, num); } } public static byte[] StructureToByteArray<T>(T structure) where T : struct { int num = Marshal.SizeOf(structure); byte[] array = new byte[num]; IntPtr intPtr = Marshal.AllocHGlobal(num); Marshal.StructureToPtr(structure, intPtr, fDeleteOld: true); Marshal.Copy(intPtr, array, 0, num); Marshal.FreeHGlobal(intPtr); return array; } public unsafe static T ReadRW<T>(this Entity entity) where T : struct { //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_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) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = EntityManager; return Marshal.PtrToStructure<T>(new IntPtr(((EntityManager)(ref entityManager)).GetComponentDataRawRW(entity, val.TypeIndex))); } public unsafe static T Read<T>(this Entity entity) where T : struct { //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_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) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = EntityManager; return Marshal.PtrToStructure<T>(new IntPtr(((EntityManager)(ref entityManager)).GetComponentDataRawRO(entity, val.TypeIndex))); } public static DynamicBuffer<T> ReadBuffer<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) //IL_000a: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).GetBuffer<T>(entity, false); } 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_0010: Unknown result type (might be due to invalid IL or missing references) componentData = default(T); if (entity.Has<T>()) { componentData = entity.Read<T>(); return true; } return false; } public static bool Has<T>(this Entity entity) { //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_0016: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = EntityManager; return ((EntityManager)(ref entityManager)).HasComponent(entity, val); } public static string LookupName(this PrefabGUID prefabGUID) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) object obj; if (!PrefabCollectionSystem.PrefabGuidToNameDictionary.ContainsKey(prefabGUID)) { obj = "Guid Not Found"; } else { string text = PrefabCollectionSystem.PrefabGuidToNameDictionary[prefabGUID]; PrefabGUID val = prefabGUID; obj = text + " " + ((object)(PrefabGUID)(ref val)).ToString(); } return obj.ToString(); } public static string GetPrefabName(this PrefabGUID itemPrefabGUID) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return LocalizationService.GetPrefabName(itemPrefabGUID); } public static void LogComponentTypes(this Entity entity) { //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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = EntityManager; Enumerator<ComponentType> enumerator = ((EntityManager)(ref entityManager)).GetComponentTypes(entity, (Allocator)2).GetEnumerator(); Core.Log.LogInfo((object)"==="); bool flag = default(bool); while (enumerator.MoveNext()) { ComponentType current = enumerator.Current; ManualLogSource log = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(0, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<ComponentType>(current); } log.LogInfo(val); } Core.Log.LogInfo((object)"==="); } public static void Add<T>(this Entity entity) { //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_0016: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).AddComponent(entity, val); } public static void Remove<T>(this Entity entity) { //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_0016: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of<T>(), (AccessMode)0); EntityManager entityManager = EntityManager; ((EntityManager)(ref entityManager)).RemoveComponent(entity, val); } public static Entity GetOwner(this Entity entity) { //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_0009: Unknown result type (might be due to invalid IL or missing references) ServerGameManager serverGameManager = ServerGameManager; return ((ServerGameManager)(ref serverGameManager)).GetOwner(entity); } public static bool TryGetFollowedPlayer(this Entity entity, out Entity player) { //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_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_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_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_0024: 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) player = Entity.Null; if (entity.Has<Follower>()) { Entity value = entity.Read<Follower>().Followed._Value; if (value.IsPlayer()) { player = value; return true; } } return false; } public static bool TryGetPlayer(this Entity entity, out Entity player) { //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_000b: 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_0015: Unknown result type (might be due to invalid IL or missing references) player = Entity.Null; if (entity.Has<PlayerCharacter>()) { player = entity; return true; } return false; } public static bool IsPlayer(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (entity.Has<VampireTag>()) { return true; } return false; } public static bool IsFollowingPlayer(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (entity.Has<Follower>() && entity.Read<Follower>().Followed._Value.IsPlayer()) { return true; } return false; } public static Entity GetBuffTarget(this Entity entity) { //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_0006: Unknown result type (might be due to invalid IL or missing references) return CreateGameplayEventServerUtility.GetBuffTarget(EntityManager, entity); } public static Entity GetPrefabEntity(this Entity entity) { //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_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) ServerGameManager serverGameManager = ServerGameManager; return ((ServerGameManager)(ref serverGameManager)).GetPrefabEntity(entity.Read<PrefabGUID>()); } public static Entity GetSpellTarget(this Entity entity) { //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_0006: Unknown result type (might be due to invalid IL or missing references) return CreateGameplayEventServerUtility.GetSpellTarget(EntityManager, entity); } public static Entity GetTeamEntity(this Entity entity) { //IL_0000: 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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) if (entity.Has<TeamReference>()) { return entity.Read<TeamReference>().Value._Value; } return Entity.Null; } public static bool Exists(this Entity entity) { //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)).Exists(entity); } public static bool Disabled(this Entity entity) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return entity.Has<Disabled>(); } public static ulong GetSteamId(this Entity entity) { //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_000b: Unknown result type (might be due to invalid IL or missing references) return entity.Read<PlayerCharacter>().UserEntity.Read<User>().PlatformId; } public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) { foreach (T item in source) { action(item); } } public static bool TryGetPlayerInfo(this ulong steamId, out PlayerService.PlayerInfo playerInfo) { if (PlayerService.PlayerCache.TryGetValue(steamId.ToString(), out playerInfo)) { return true; } return false; } public static bool TryGetPlayerInfo(this string playerName, out PlayerService.PlayerInfo playerInfo) { if (PlayerService.PlayerCache.TryGetValue(playerName, out playerInfo)) { return true; } return false; } } internal static class GenerateREADME { private static readonly Regex CommandGroupRegex = new Regex("\\[CommandGroup\\((?:name:\\s*\"(?<name>[^\"]+)\"\\s*,\\s*)?\"(?<group>[^\"]+)\"(?:\\s*,\\s*\"(?<short>[^\"]+)\")?\\)\\]"); private static readonly Regex CommandAttributeRegex = new Regex("\\[Command\\((?:name:\\s*\"(?<name>[^\"]+)\")?(?:,\\s*shortHand:\\s*\"(?<shortHand>[^\"]+)\")?(?:,\\s*adminOnly:\\s*(?<adminOnly>\\w+))?(?:,\\s*usage:\\s*\"(?<usage>[^\"]+)\")?(?:,\\s*description:\\s*\"(?<description>[^\"]+)\")?\\)\\]"); private static readonly Regex CommandSectionPattern = new Regex("^(?!.*using\\s+static).*?\\b[A-Z][a-zA-Z]*Commands\\b"); private static string CommandsPath { get; set; } private static string ReadMePath { get; set; } public static void Main(string[] args) { if (args.Length < 2) { Console.WriteLine("Usage: GenerateREADME <CommandsPath> <ReadMePath>"); return; } CommandsPath = args[0]; ReadMePath = args[1]; Generate(); } private static void Generate() { try { GenerateCommandsSection(); Console.WriteLine("README generated successfully."); } catch (Exception ex) { Console.WriteLine("Error generating README: " + ex.Message); } } private static void GenerateCommandsSection() { string[] files = Directory.GetFiles(CommandsPath, "*.cs"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("## Commands"); string[] array = files; for (int i = 0; i < array.Length; i++) { string[] array2 = File.ReadAllLines(array[i]); string text = Regex.Replace(array2.First((string line) => CommandSectionPattern.IsMatch(line)), "(?<!^)([A-Z])", " $1"); text = text.Replace("internal static class ", ""); string value = ""; string text2 = array2.FirstOrDefault((string line) => CommandGroupRegex.IsMatch(line)); if (text2 != null) { Match match = CommandGroupRegex.Match(text2); value = (match.Groups[1].Success ? match.Groups[1].Value : match.Groups[3].Value); if (match.Groups[2].Success) { _ = match.Groups[2].Value; } } StringBuilder stringBuilder2 = stringBuilder; StringBuilder stringBuilder3 = stringBuilder2; StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(5, 1, stringBuilder2); handler.AppendLiteral("\n### "); handler.AppendFormatted(text); stringBuilder3.AppendLine(ref handler); string[] array3 = array2; foreach (string input in array3) { Match match2 = CommandAttributeRegex.Match(input); if (match2.Success) { _ = match2.Groups["name"].Value; if (match2.Groups["shortHand"].Success) { _ = match2.Groups["shortHand"].Value; } string value2 = match2.Groups["adminOnly"].Value; string value3 = match2.Groups["usage"].Value; string value4 = match2.Groups["description"].Value; string value5 = $"- `.{value} {value3}`"; stringBuilder.AppendLine(value5); stringBuilder2 = stringBuilder; StringBuilder stringBuilder4 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(4, 1, stringBuilder2); handler.AppendLiteral(" - "); handler.AppendFormatted(value4); stringBuilder4.AppendLine(ref handler); if (bool.Parse(value2)) { stringBuilder.AppendLine(" - Admin-only"); } } } } UpdateReadme(stringBuilder.ToString()); } private static void UpdateReadme(string commandsSection) { string[] array = File.ReadAllLines(ReadMePath); int num = Array.FindIndex(array, (string line) => line.StartsWith("## Commands")); int count = Array.FindIndex(array, num + 1, (string line) => line.StartsWith("## ")); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(string.Join(Environment.NewLine, array.Take(num))); stringBuilder.AppendLine(commandsSection); stringBuilder.Append(string.Join(Environment.NewLine, array.Skip(count))); File.WriteAllText(ReadMePath, stringBuilder.ToString()); } } [BepInPlugin("io.zfolmt.Bloodcraft", "Bloodcraft", "1.4.2")] internal class Plugin : BasePlugin { private Harmony _harmony; internal static Plugin Instance { get; private set; } public static Harmony Harmony => Instance._harmony; public static ManualLogSource LogInstance => ((BasePlugin)Instance).Log; public override void Load() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown Instance = this; _harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null); ConfigService.ConfigInitialization.InitializeConfig(); CommandRegistry.RegisterAll(); DataService.PlayerDataInitialization.LoadPlayerData(); ManualLogSource log = Core.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(10, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("Bloodcraft"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("["); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.4.2"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("] loaded!"); } log.LogInfo(val); } public override bool Unload() { ((BasePlugin)this).Config.Clear(); _harmony.UnpatchSelf(); return true; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "io.zfolmt.Bloodcraft"; public const string PLUGIN_NAME = "Bloodcraft"; public const string PLUGIN_VERSION = "1.4.2"; } } namespace Bloodcraft.Utilities { internal static class BuffUtilities { private static ServerGameManager ServerGameManager => Core.ServerGameManager; private static SystemService SystemService => Core.SystemService; private static DebugEventsSystem DebugEventsSystem => SystemService.DebugEventsSystem; public static void ApplyBuff(PrefabGUID buffPrefab, Entity target) { //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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_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_0049: 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) ApplyBuffDebugEvent val = default(ApplyBuffDebugEvent); val.BuffPrefabGUID = buffPrefab; ApplyBuffDebugEvent val2 = val; FromCharacter val3 = default(FromCharacter); val3.Character = target; val3.User = target; FromCharacter val4 = val3; ServerGameManager serverGameManager = ServerGameManager; if (!((ServerGameManager)(ref serverGameManager)).HasBuff(target, ((PrefabGUID)(ref buffPrefab)).ToIdentifier())) { DebugEventsSystem.ApplyBuff(val4, val2); } } public static void HandleBloodBuff(Entity buff) { //IL_0000: 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_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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_00a6: 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_007f: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00b4: 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_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05a4: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_0613: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_060b: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0679: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0671: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_06a3: Unknown result type (might be due to invalid IL or missing references) //IL_06a4: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06b4: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06ba: Unknown result type (might be due to invalid IL or missing references) //IL_06ca: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_0704: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0729: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0731: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) if (buff.Has<BloodBuff_HealReceivedProc_DataShared>()) { BloodBuff_HealReceivedProc_DataShared componentData = buff.Read<BloodBuff_HealReceivedProc_DataShared>(); componentData.RequiredBloodPercentage = 0f; buff.Write<BloodBuff_HealReceivedProc_DataShared>(componentData); } else if (buff.Has<BloodBuffScript_Brute_HealthRegenBonus>()) { BloodBuffScript_Brute_HealthRegenBonus val = buff.Read<BloodBuffScript_Brute_HealthRegenBonus>(); val.RequiredBloodPercentage = 0f; val.MinHealthRegenIncrease = val.MaxHealthRegenIncrease; buff.Write<BloodBuffScript_Brute_HealthRegenBonus>(val); } else if (buff.Has<BloodBuffScript_Brute_NulifyAndEmpower>()) { BloodBuffScript_Brute_NulifyAndEmpower componentData2 = buff.Read<BloodBuffScript_Brute_NulifyAndEmpower>(); componentData2.RequiredBloodPercentage = 0f; buff.Write<BloodBuffScript_Brute_NulifyAndEmpower>(componentData2); } else if (buff.Has<BloodBuff_Brute_PhysLifeLeech_DataShared>()) { BloodBuff_Brute_PhysLifeLeech_DataShared val2 = buff.Read<BloodBuff_Brute_PhysLifeLeech_DataShared>(); val2.RequiredBloodPercentage = 0f; val2.MinIncreasedPhysicalLifeLeech = val2.MaxIncreasedPhysicalLifeLeech; buff.Write<BloodBuff_Brute_PhysLifeLeech_DataShared>(val2); } else if (buff.Has<BloodBuff_Brute_RecoverOnKill_DataShared>()) { BloodBuff_Brute_RecoverOnKill_DataShared val3 = buff.Read<BloodBuff_Brute_RecoverOnKill_DataShared>(); val3.RequiredBloodPercentage = 0f; val3.MinHealingReceivedValue = val3.MaxHealingReceivedValue; buff.Write<BloodBuff_Brute_RecoverOnKill_DataShared>(val3); } else if (buff.Has<BloodBuff_Creature_SpeedBonus_DataShared>()) { BloodBuff_Creature_SpeedBonus_DataShared val4 = buff.Read<BloodBuff_Creature_SpeedBonus_DataShared>(); val4.RequiredBloodPercentage = 0f; val4.MinMovementSpeedIncrease = val4.MaxMovementSpeedIncrease; buff.Write<BloodBuff_Creature_SpeedBonus_DataShared>(val4); } else if (buff.Has<BloodBuff_SunResistance_DataShared>()) { BloodBuff_SunResistance_DataShared val5 = buff.Read<BloodBuff_SunResistance_DataShared>(); val5.RequiredBloodPercentage = 0f; val5.MinBonus = val5.MaxBonus; buff.Write<BloodBuff_SunResistance_DataShared>(val5); } else if (buff.Has<BloodBuffScript_Draculin_BloodMendBonus>()) { BloodBuffScript_Draculin_BloodMendBonus val6 = buff.Read<BloodBuffScript_Draculin_BloodMendBonus>(); val6.RequiredBloodPercentage = 0f; val6.MinBonusHealing = val6.MaxBonusHealing; buff.Write<BloodBuffScript_Draculin_BloodMendBonus>(val6); } else if (buff.Has<Script_BloodBuff_CCReduction_DataShared>()) { Script_BloodBuff_CCReduction_DataShared val7 = buff.Read<Script_BloodBuff_CCReduction_DataShared>(); val7.RequiredBloodPercentage = 0f; val7.MinBonus = val7.MaxBonus; buff.Write<Script_BloodBuff_CCReduction_DataShared>(val7); } else if (buff.Has<Script_BloodBuff_Draculin_ImprovedBite_DataShared>()) { Script_BloodBuff_Draculin_ImprovedBite_DataShared componentData3 = buff.Read<Script_BloodBuff_Draculin_ImprovedBite_DataShared>(); componentData3.RequiredBloodPercentage = 0f; buff.Write<Script_BloodBuff_Draculin_ImprovedBite_DataShared>(componentData3); } else if (buff.Has<BloodBuffScript_LastStrike>()) { BloodBuffScript_LastStrike val8 = buff.Read<BloodBuffScript_LastStrike>(); val8.RequiredBloodQuality = 0f; val8.LastStrikeBonus_Min = val8.LastStrikeBonus_Max; buff.Write<BloodBuffScript_LastStrike>(val8); } else if (buff.Has<BloodBuff_Draculin_SpeedBonus_DataShared>()) { BloodBuff_Draculin_SpeedBonus_DataShared val9 = buff.Read<BloodBuff_Draculin_SpeedBonus_DataShared>(); val9.RequiredBloodPercentage = 0f; val9.MinMovementSpeedIncrease = val9.MaxMovementSpeedIncrease; buff.Write<BloodBuff_Draculin_SpeedBonus_DataShared>(val9); } else if (buff.Has<BloodBuff_AllResistance_DataShared>()) { BloodBuff_AllResistance_DataShared val10 = buff.Read<BloodBuff_AllResistance_DataShared>(); val10.RequiredBloodPercentage = 0f; val10.MinBonus = val10.MaxBonus; buff.Write<BloodBuff_AllResistance_DataShared>(val10); } else if (buff.Has<BloodBuff_BiteToMutant_DataShared>()) { BloodBuff_BiteToMutant_DataShared componentData4 = buff.Read<BloodBuff_BiteToMutant_DataShared>(); componentData4.RequiredBloodPercentage = 0f; componentData4.MutantFaction = new PrefabGUID(877850148); buff.Write<BloodBuff_BiteToMutant_DataShared>(componentData4); } else if (buff.Has<BloodBuff_BloodConsumption_DataShared>()) { BloodBuff_BloodConsumption_DataShared val11 = buff.Read<BloodBuff_BloodConsumption_DataShared>(); val11.RequiredBloodPercentage = 0f; val11.MinBonus = val11.MaxBonus; buff.Write<BloodBuff_BloodConsumption_DataShared>(val11); } else if (buff.Has<BloodBuff_HealthRegeneration_DataShared>()) { BloodBuff_HealthRegeneration_DataShared val12 = buff.Read<BloodBuff_HealthRegeneration_DataShared>(); val12.RequiredBloodPercentage = 0f; val12.MinBonus = val12.MaxBonus; buff.Write<BloodBuff_HealthRegeneration_DataShared>(val12); } else if (buff.Has<BloodBuff_ApplyMovementSpeedOnShapeshift_DataShared>()) { BloodBuff_ApplyMovementSpeedOnShapeshift_DataShared val13 = buff.Read<BloodBuff_ApplyMovementSpeedOnShapeshift_DataShared>(); val13.RequiredBloodPercentage = 0f; val13.MinBonus = val13.MaxBonus; buff.Write<BloodBuff_ApplyMovementSpeedOnShapeshift_DataShared>(val13); } else if (buff.Has<BloodBuff_PrimaryAttackLifeLeech_DataShared>()) { BloodBuff_PrimaryAttackLifeLeech_DataShared val14 = buff.Read<BloodBuff_PrimaryAttackLifeLeech_DataShared>(); val14.RequiredBloodPercentage = 0f; val14.MinBonus = val14.MaxBonus; buff.Write<BloodBuff_PrimaryAttackLifeLeech_DataShared>(val14); } else if (buff.Has<BloodBuff_PrimaryProc_FreeCast_DataShared>()) { BloodBuff_PrimaryProc_FreeCast_DataShared val15 = buff.Read<BloodBuff_PrimaryProc_FreeCast_DataShared>(); val15.RequiredBloodPercentage = 0f; val15.MinBonus = val15.MaxBonus; buff.Write<BloodBuff_PrimaryProc_FreeCast_DataShared>(val15); } else if (buff.Has<BloodBuff_Rogue_AttackSpeedBonus_DataShared>()) { BloodBuff_Rogue_AttackSpeedBonus_DataShared componentData5 = buff.Read<BloodBuff_Rogue_AttackSpeedBonus_DataShared>(); componentData5.RequiredBloodPercentage = 0f; buff.Write<BloodBuff_Rogue_AttackSpeedBonus_DataShared>(componentData5); if (buff.Has<BloodBuff_Rogue_SpeedBonus_DataShared>()) { BloodBuff_Rogue_SpeedBonus_DataShared componentData6 = buff.Read<BloodBuff_Rogue_SpeedBonus_DataShared>(); componentData6.RequiredBloodPercentage = 0f; buff.Write<BloodBuff_Rogue_SpeedBonus_DataShared>(componentData6); } } else if (buff.Has<BloodBuff_CritAmplifyProc_DataShared>()) { BloodBuff_CritAmplifyProc_DataShared val16 = buff.Read<BloodBuff_CritAmplifyProc_DataShared>(); val16.RequiredBloodPercentage = 0f; val16.MinBonus = val16.MaxBonus; buff.Write<BloodBuff_CritAmplifyProc_DataShared>(val16); } else if (buff.Has<BloodBuff_PhysCritChanceBonus_DataShared>()) { BloodBuff_PhysCritChanceBonus_DataShared val17 = buff.Read<BloodBuff_PhysCritChanceBonus_DataShared>(); val17.RequiredBloodPercentage = 0f; val17.MinPhysicalCriticalStrikeChance = val17.MaxPhysicalCriticalStrikeChance; buff.Write<BloodBuff_PhysCritChanceBonus_DataShared>(val17); } else if (buff.Has<BloodBuff_Rogue_SpeedBonus_DataShared>()) { BloodBuff_Rogue_SpeedBonus_DataShared val18 = buff.Read<BloodBuff_Rogue_SpeedBonus_DataShared>(); val18.RequiredBloodPercentage = 0f; val18.MinMovementSpeedIncrease = val18.MaxMovementSpeedIncrease; buff.Write<BloodBuff_Rogue_SpeedBonus_DataShared>(val18); } else if (buff.Has<BloodBuff_ReducedTravelCooldown_DataShared>()) { BloodBuff_ReducedTravelCooldown_DataShared val19 = buff.Read<BloodBuff_ReducedTravelCooldown_DataShared>(); val19.RequiredBloodPercentage = 0f; val19.MinBonus = val19.MaxBonus; buff.Write<BloodBuff_ReducedTravelCooldown_DataShared>(val19); } else if (buff.Has<BloodBuff_Scholar_SpellCooldown_DataShared>()) { BloodBuff_Scholar_SpellCooldown_DataShared val20 = buff.Read<BloodBuff_Scholar_SpellCooldown_DataShared>(); val20.RequiredBloodPercentage = 0f; val20.MinCooldownReduction = val20.MaxCooldownReduction; buff.Write<BloodBuff_Scholar_SpellCooldown_DataShared>(val20); } else if (buff.Has<BloodBuff_Scholar_SpellCritChanceBonus_DataShared>()) { BloodBuff_Scholar_SpellCritChanceBonus_DataShared val21 = buff.Read<BloodBuff_Scholar_SpellCritChanceBonus_DataShared>(); val21.RequiredBloodPercentage = 0f; val21.MinSpellCriticalStrikeChance = val21.MaxSpellCriticalStrikeChance; buff.Write<BloodBuff_Scholar_SpellCritChanceBonus_DataShared>(val21); } else if (buff.Has<BloodBuff_Scholar_SpellPowerBonus_DataShared>()) { BloodBuff_Scholar_SpellPowerBonus_DataShared val22 = buff.Read<BloodBuff_Scholar_SpellPowerBonus_DataShared>(); val22.RequiredBloodPercentage = 0f; val22.MinSpellPowerIncrease = val22.MaxSpellPowerIncrease; buff.Write<BloodBuff_Scholar_SpellPowerBonus_DataShared>(val22); if (buff.Has<BloodBuff_Warrior_PhysDamageBonus_DataShared>()) { BloodBuff_Warrior_PhysDamageBonus_DataShared val23 = buff.Read<BloodBuff_Warrior_PhysDamageBonus_DataShared>(); val23.RequiredBloodPercentage = 0f; val23.MinPhysDamageIncrease = val23.MaxPhysDamageIncrease; buff.Write<BloodBuff_Warrior_PhysDamageBonus_DataShared>(val23); } } else if (buff.Has<BloodBuff_SpellLifeLeech_DataShared>()) { BloodBuff_SpellLifeLeech_DataShared val24 = buff.Read<BloodBuff_SpellLifeLeech_DataShared>(); val24.RequiredBloodPercentage = 0f; val24.MinBonus = val24.MaxBonus; buff.Write<BloodBuff_SpellLifeLeech_DataShared>(val24); } else if (buff.Has<BloodBuff_Warrior_DamageReduction_DataShared>()) { BloodBuff_Warrior_DamageReduction_DataShared val25 = buff.Read<BloodBuff_Warrior_DamageReduction_DataShared>(); val25.RequiredBloodPercentage = 0f; val25.MinDamageReduction = val25.MaxDamageReduction; buff.Write<BloodBuff_Warrior_DamageReduction_DataShared>(val25); } else if (buff.Has<BloodBuff_Warrior_PhysCritDamageBonus_DataShared>()) { BloodBuff_Warrior_PhysCritDamageBonus_DataShared val26 = buff.Read<BloodBuff_Warrior_PhysCritDamageBonus_DataShared>(); val26.RequiredBloodPercentage = 0f; val26.MinWeaponCriticalStrikeDamageIncrease = val26.MaxWeaponCriticalStrikeDamageIncrease; buff.Write<BloodBuff_Warrior_PhysCritDamageBonus_DataShared>(val26); } else if (buff.Has<BloodBuff_Warrior_PhysDamageBonus_DataShared>()) { BloodBuff_Warrior_PhysDamageBonus_DataShared val27 = buff.Read<BloodBuff_Warrior_PhysDamageBonus_DataShared>(); val27.RequiredBloodPercentage = 0f; val27.MinPhysDamageIncrease = val27.MaxPhysDamageIncrease; buff.Write<BloodBuff_Warrior_PhysDamageBonus_DataShared>(val27); } else if (buff.Has<BloodBuff_Warrior_PhysicalBonus_DataShared>()) { BloodBuff_Warrior_PhysicalBonus_DataShared val28 = buff.Read<BloodBuff_Warrior_PhysicalBonus_DataShared>(); val28.RequiredBloodPercentage = 0f; val28.MinWeaponPowerIncrease = val28.MaxWeaponPowerIncrease; buff.Write<BloodBuff_Warrior_PhysicalBonus_DataShared>(val28); } else if (buff.Has<BloodBuff_Warrior_WeaponCooldown_DataShared>()) { BloodBuff_Warrior_WeaponCooldown_DataShared val29 = buff.Read<BloodBuff_Warrior_WeaponCooldown_DataShared>(); val29.RequiredBloodPercentage = 0f; val29.MinCooldownReduction = val29.MaxCooldownReduction; buff.Write<BloodBuff_Warrior_WeaponCooldown_DataShared>(val29); } else if (buff.Has<BloodBuff_Brute_100_DataShared>()) { BloodBuff_Brute_100_DataShared val30 = buff.Read<BloodBuff_Brute_100_DataShared>(); val30.RequiredBloodPercentage = 0f; val30.MinHealthRegainPercentage = val30.MaxHealthRegainPercentage; buff.Write<BloodBuff_Brute_100_DataShared>(val30); } else if (buff.Has<BloodBuff_Rogue_100_DataShared>()) { BloodBuff_Rogue_100_DataShared componentData7 = buff.Read<BloodBuff_Rogue_100_DataShared>(); componentData7.RequiredBloodPercentage = 0f; buff.Write<BloodBuff_Rogue_100_DataShared>(componentData7); } else if (buff.Has<BloodBuff_Warrior_100_DataShared>()) { BloodBuff_Warrior_100_DataShared componentData8 = buff.Read<BloodBuff_Warrior_100_DataShared>(); componentData8.RequiredBloodPercentage = 0f; buff.Write<BloodBuff_Warrior_100_DataShared>(componentData8); } else if (buff.Has<BloodBuffScript_Scholar_MovementSpeedOnCast>()) { BloodBuffScript_Scholar_MovementSpeedOnCast val31 = buff.Read<BloodBuffScript_Scholar_MovementSpeedOnCast>(); val31.RequiredBloodPercentage = 0f; val31.ChanceToGainMovementOnCast_Min = val31.ChanceToGainMovementOnCast_Max; buff.Write<BloodBuffScript_Scholar_MovementSpeedOnCast>(val31); } else if (buff.Has<BloodBuff_Brute_ArmorLevelBonus_DataShared>()) { BloodBuff_Brute_ArmorLevelBonus_DataShared val32 = buff.Read<BloodBuff_Brute_ArmorLevelBonus_DataShared>(); val32.MinValue = val32.MaxValue; val32.RequiredBloodPercentage = 0f; val32.GearLevel = 0f; buff.Write<BloodBuff_Brute_ArmorLevelBonus_DataShared>(val32); } } public static void HandlePermaBuff(Entity player, PrefabGUID buffPrefab) { //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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) ApplyBuffDebugEvent val = default(ApplyBuffDebugEvent); val.BuffPrefabGUID = buffPrefab; ApplyBuffDebugEvent val2 = val; FromCharacter val3 = default(FromCharacter); val3.Character = player; val3.User = player.Read<PlayerCharacter>().UserEntity; FromCharacter val4 = val3; ServerGameManager serverGameManager = ServerGameManager; if (((ServerGameManager)(ref serverGameManager)).HasBuff(player, ((PrefabGUID)(ref buffPrefab)).ToIdentifier())) { return; } DebugEventsSystem.ApplyBuff(val4, val2); serverGameManager = ServerGameManager; Entity val5 = default(Entity); if (((ServerGameManager)(ref serverGameManager)).TryGetBuff(player, ((PrefabGUID)(ref buffPrefab)).ToIdentifier(), ref val5)) { if (val5.Has<BloodBuff>()) { HandleBloodBuff(val5); } if (val5.Has<RemoveBuffOnGameplayEvent>()) { val5.Remove<RemoveBuffOnGameplayEvent>(); } if (val5.Has<RemoveBuffOnGameplayEventEntry>()) { val5.Remove<RemoveBuffOnGameplayEventEntry>(); } if (val5.Has<CreateGameplayEventsOnSpawn>()) { val5.Remove<CreateGameplayEventsOnSpawn>(); } if (val5.Has<GameplayEventListeners>()) { val5.Remove<GameplayEventListeners>(); } if (!val5.Has<Buff_Persists_Through_Death>()) { val5.Add<Buff_Persists_Through_Death>(); } if (val5.Has<DestroyOnGameplayEvent>()) { val5.Remove<DestroyOnGameplayEvent>(); } if (val5.Has<LifeTime>()) { LifeTime componentData = val5.Read<LifeTime>(); componentData.Duration = -1f; componentData.EndAction = (LifeTimeEndAction)0; val5.Write<LifeTime>(componentData); } } } public static void ApplyClassBuffs(Entity character, ulong steamId) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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) if (!ClassUtilities.HasClass(steamId) || !UpdateBuffsBufferDestroyPatch.ClassBuffs.TryGetValue(ClassUtilities.GetPlayerClass(steamId), out var value) || value.Count == 0) { return; } int num = ConfigService.MaxLevel / value.Count; int num2 = 0; if (ConfigService.LevelingSystem) { num2 = LevelingSystem.GetLevel(steamId); } else { Equipment val = character.Read<Equipment>(); num2 = (int)((Equipment)(ref val)).GetFullLevel(); } FromCharacter val2 = default(FromCharacter); val2.Character = character; val2.User = character.Read<PlayerCharacter>().UserEntity; FromCharacter val3 = val2; if (ConfigService.PrestigeSystem && steamId.TryGetPlayerPrestiges(out var prestiges) && prestiges[PrestigeType.Experience] > 0) { num2 = ConfigService.MaxLevel; } int num3 = num2 / num; if (num3 <= 0 || num3 > value.Count) { return; } for (int i = 0; i < num3; i++) { ApplyBuffDebugEvent val4 = default(ApplyBuffDebugEvent); val4.BuffPrefabGUID = value[i]; ApplyBuffDebugEvent val5 = val4; ServerGameManager serverGameManager = ServerGameManager; if (!((ServerGameManager)(ref serverGameManager)).HasBuff(character, ((PrefabGUID)(ref val5.BuffPrefabGUID)).ToIdentifier())) { DebugEventsSystem.ApplyBuff(val3, val5); } } } public static void HandleVisual(Entity entity, PrefabGUID visual) { //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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0042: 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_005b: 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_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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) ApplyBuffDebugEvent val = default(ApplyBuffDebugEvent); val.BuffPrefabGUID = visual; ApplyBuffDebugEvent val2 = val; FromCharacter val3 = default(FromCharacter); val3.Character = entity; val3.User = entity; FromCharacter val4 = val3; DebugEventsSystem.ApplyBuff(val4, val2); ServerGameManager serverGameManager = ServerGameManager; Entity entity2 = default(Entity); if (((ServerGameManager)(ref serverGameManager)).TryGetBuff(entity, ((PrefabGUID)(ref val2.BuffPrefabGUID)).ToIdentifier(), ref entity2)) { if (entity2.Has<Buff>()) { BuffCategory componentData = entity2.Read<BuffCategory>(); componentData.Groups = (BuffCategoryFlag)0; entity2.Write<BuffCategory>(componentData); } if (entity2.Has<CreateGameplayEventsOnSpawn>()) { entity2.Remove<CreateGameplayEventsOnSpawn>(); } if (entity2.Has<GameplayEventListeners>()) { entity2.Remove<GameplayEventListeners>(); } if (entity2.Has<LifeTime>()) { LifeTime componentData2 = entity2.Read<LifeTime>(); componentData2.Duration = -1f; componentData2.EndAction = (LifeTimeEndAction)0; entity2.Write<LifeTime>(componentData2); } if (entity2.Has<RemoveBuffOnGameplayEvent>()) { entity2.Remove<RemoveBuffOnGameplayEvent>(); } if (entity2.Has<RemoveBuffOnGameplayEventEntry>()) { entity2.Remove<RemoveBuffOnGameplayEventEntry>(); } if (entity2.Has<DealDamageOnGameplayEvent>()) { entity2.Remove<DealDamageOnGameplayEvent>(); } if (entity2.Has<HealOnGameplayEvent>()) { entity2.Remove<HealOnGameplayEvent>(); } if (entity2.Has<BloodBuffScript_ChanceToResetCooldown>()) { entity2.Remove<BloodBuffScript_ChanceToResetCooldown>(); } if (entity2.Has<ModifyMovementSpeedBuff>()) { entity2.Remove<ModifyMovementSpeedBuff>(); } if (entity2.Has<ApplyBuffOnGameplayEvent>()) { entity2.Remove<ApplyBuffOnGameplayEvent>(); } if (entity2.Has<DestroyOnGameplayEvent>()) { entity2.Remove<DestroyOnGameplayEvent>(); } if (entity2.Has<WeakenBuff>()) { entity2.Remove<WeakenBuff>(); } if (entity2.Has<ReplaceAbilityOnSlotBuff>()) { entity2.Remove<ReplaceAbilityOnSlotBuff>(); } if (entity2.Has<AmplifyBuff>()) { entity2.Remove<AmplifyBuff>(); } } } public static void PrestigeBuffs() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) foreach (int item in ConfigUtilities.ParseConfigString(ConfigService.PrestigeBuffs)) { UpdateBuffsBufferDestroyPatch.PrestigeBuffs.Add(new PrefabGUID(item)); } } public static void SanitizePrestigeBuffs(Entity character) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_001d: 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_002e: 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) Entity entity = default(Entity); foreach (PrefabGUID prestigeBuff in UpdateBuffsBufferDestroyPatch.PrestigeBuffs) { PrefabGUID current = prestigeBuff; ServerGameManager serverGameManager = ServerGameManager; if (((ServerGameManager)(ref serverGameManager)).TryGetBuff(character, ((PrefabGUID)(ref current)).ToIdentifier(), ref entity) && entity.Has<LifeTime>()) { entity.Remove<LifeTime>(); } } } } internal static class ClassUtilities { private static EntityManager EntityManagerRef = Core.EntityManager; private static readonly PrefabGUID VBloodAbilityBuff = new PrefabGUID(1171608023); private static NativeParallelHashMap<PrefabGUID, ItemData> itemLookup = SystemService.GameDataSystem.ItemHashLookupMap; private static PrefabLookupMap PrefabLookupMap = PrefabCollectionSystem._PrefabLookupMap; private static readonly ComponentType[] JewelComponents = (ComponentType[])(object)new ComponentType[2] { ComponentType.ReadOnly(Il2CppType.Of<JewelInstance>()), ComponentType.ReadOnly(Il2CppType.Of<JewelLevelSource>()) }; private static EntityQuery JewelQuery; private static readonly Dictionary<PrefabGUID, List<Entity>> AbilityJewelMap = new Dictionary<PrefabGUID, List<Entity>>(); private static EntityManager EntityManager => Core.EntityManager; private static ServerGameManager ServerGameManager => Core.ServerGameManager; private static SystemService SystemService => Core.SystemService; private static PrefabCollectionSystem PrefabCollectionSystem => SystemService.PrefabCollectionSystem; private static ActivateVBloodAbilitySystem ActivateVBloodAbilitySystem => SystemService.ActivateVBloodAbilitySystem; private static ReplaceAbilityOnSlotSystem ReplaceAbilityOnSlotSystem => SystemService.ReplaceAbilityOnSlotSystem; private static Update_ReplaceAbilityOnSlotSystem UpdateReplaceAbilityOnSlotSystem => SystemService.Update_ReplaceAbilityOnSlotSystem; public static List<int> GetClassBuffs(ulong steamId) { if (steamId.TryGetPlayerClasses(out var classes) && classes.Keys.Count > 0) { LevelingSystem.PlayerClasses key = classes.Keys.FirstOrDefault(); return ConfigUtilities.ParseConfigString(LevelingSystem.ClassBuffMap[key]); } return new List<int>(); } public static LevelingSystem.PlayerClasses GetPlayerClass(ulong steamId) { if (steamId.TryGetPlayerClasses(out var classes)) { return classes.First().Key; } throw new Exception("Player does not have a class."); } public static bool HandleClassChangeItem(ChatCommandContext ctx, ulong steamId) { //IL_0012: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) PrefabGUID val = default(PrefabGUID); ((PrefabGUID)(ref val))..ctor(ConfigService.ChangeClassItem); int changeClassQuantity = ConfigService.ChangeClassQuantity; Entity val2 = default(Entity); if (InventoryUtilities.TryGetInventoryEntity(EntityManager, ctx.User.LocalCharacter._Entity, ref val2, 0)) { ServerGameManager serverGameManager = ServerGameManager; if (((ServerGameManager)(ref serverGameManager)).GetInventoryItemCount(val2, val) >= changeClassQuantity) { serverGameManager = ServerGameManager; if (!((ServerGameManager)(ref serverGameManager)).TryRemoveInventoryItem(val2, val, changeClassQuantity)) { LocalizationService.HandleReply(ctx, $"Failed to remove the required item ({val.GetPrefabName()}x{changeClassQuantity})"); return false; } RemoveClassBuffs(ctx, steamId); return true; } } LocalizationService.HandleReply(ctx, $"You do not have the required item to change classes ({val.GetPrefabName()}x{changeClassQuantity})"); return false; } public static bool HasClass(ulong steamId) { if (steamId.TryGetPlayerClasses(out var classes)) { return classes.Keys.Count > 0; } return false; } public static void RemoveClassBuffs(ChatCommandContext ctx, ulong steamId) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) List<int> classBuffs = GetClassBuffs(steamId); if (classBuffs.Count == 0) { return; } PrefabGUID val = default(PrefabGUID); Entity val2 = default(Entity); for (int i = 0; i < classBuffs.Count; i++) { if (classBuffs[i] != 0) { ((PrefabGUID)(ref val))..ctor(classBuffs[i]); ServerGameManager serverGameManager = ServerGameManager; if (((ServerGameManager)(ref serverGameManager)).TryGetBuff(ctx.Event.SenderCharacterEntity, ((PrefabGUID)(ref val)).ToIdentifier(), ref val2)) { DestroyUtility.Destroy(EntityManager, val2, (DestroyDebugReason)13, (string)null, 0); } } } } public static void ReplyClassBuffs(ChatCommandContext ctx, LevelingSystem.PlayerClasses playerClass) { List<int> list = ConfigUtilities.ParseConfigString(LevelingSystem.ClassBuffMap[playerClass]); if (list.Count == 0) { LocalizationService.HandleReply(ctx, $"{playerClass} buffs not found."); return; } int step = ConfigService.MaxLevel / list.Count; List<string> list2 = list.Select(delegate(int perk, int index) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) int value2 = (index + 1) * step; string text = Extensions.LookupName(new PrefabGUID(perk)); int num = text.IndexOf("Prefab"); if (num != -1) { text = text.Substring(0, num).TrimEnd(); } return $"<color=white>{text}</color> at level <color=yellow>{value2}</color>"; }).ToList(); for (int i = 0; i < list2.Count; i += 6) { IEnumerable<string> values = list2.Skip(i).Take(6); string value = string.Join(", ", values); LocalizationService.HandleReply(ctx, $"{playerClass} buffs: {value}"); } } public static void ReplyClassSpells(ChatCommandContext ctx, LevelingSystem.PlayerClasses playerClass) { List<int> list = ConfigUtilities.ParseConfigString(LevelingSystem.ClassSpellsMap[playerClass]); if (list.Count == 0) { LocalizationService.HandleReply(ctx, $"{playerClass} spells not found."); return; } List<string> list2 = list.Select(delegate(int perk) { //IL_0001: 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) string text = Extensions.GetPrefabName(new PrefabGUID(perk)); int num = text.IndexOf("Prefab"); if (num != -1) { text = text.Substring(0, num).TrimEnd(); } if (text.Contains("Name")) { text = Extensions.LookupName(new PrefabGUID(perk)); } return "<color=white>" + text + "</color>"; }).ToList(); for (int i = 0; i < list2.Count; i += 6) { IEnumerable<string> values = list2.Skip(i).Take(6); string value = string.Join(", ", values); LocalizationService.HandleReply(ctx, $"{playerClass} spells: {value}"); } } public static bool TryParseClass(string classType, out LevelingSystem.PlayerClasses parsedClassType) { if (Enum.TryParse<LevelingSystem.PlayerClasses>(classType, ignoreCase: true, out parsedClassType)) { return true; } parsedClassType = Enum.GetValues(typeof(LevelingSystem.PlayerClasses)).Cast<LevelingSystem.PlayerClasses>().FirstOrDefault((LevelingSystem.PlayerClasses pc) => pc.ToString().Contains(classType, StringComparison.OrdinalIgnoreCase)); if (!parsedClassType.Equals(LevelingSystem.PlayerClasses.BloodKnight)) { return true; } parsedClassType = LevelingSystem.PlayerClasses.BloodKnight; return false; } public static void UpdateClassData(Entity character, LevelingSystem.PlayerClasses parsedClassType, Dictionary<LevelingSystem.PlayerClasses, (List<int>, List<int>)> classes, ulong steamId) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) string item = LevelingSystem.ClassWeaponBloodMap[parsedClassType].Item1; string item2 = LevelingSystem.ClassWeaponBloodMap[parsedClassType].Item2; List<int> item3 = ConfigUtilities.ParseConfigString(item); List<int> item4 = ConfigUtilities.ParseConfigString(item2); classes[parsedClassType] = (item3, item4); steamId.SetPlayerClasses(classes); BuffUtilities.ApplyClassBuffs(character, steamId); } public static void RemoveShift(Entity character) { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_003d: 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_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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0163: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) ServerGameManager serverGameManager = ServerGameManager; Entity abilityGroup = ((ServerGameManager)(ref serverGameManager)).GetAbilityGroup(character, 3); if (abilityGroup.Exists() && abilityGroup.Has<VBloodAbilityData>()) { Entity val = Entity.Null; bool flag = false; Entity @null = Entity.Null; serverGameManager = ServerGameManager; DynamicBuffer<VBloodAbilityBuffEntry> val2 = default(DynamicBuffer<VBloodAbilityBuffEntry>); if (((ServerGameManager)(ref serverGameManager)).TryGetBuffer<VBloodAbilityBuffEntry>(character, ref val2)) { PrefabGUID key = abilityGroup.Read<PrefabGUID>(); int num = -1; for (int i = 0; i < val2.Length; i++) { VBloodAbilityBuffEntry val3 = val2[i]; if (val3.SlotId == 3) { val = val3.ActiveBuff; num = i; break; } } Entity val4 = default(Entity); if (InventoryUtilities.TryGetInventoryEntity(EntityManager, character, ref val4, 0) && AbilityJewelMap.TryGetValue(key, out var value)) { foreach (Entity item in value) { if (JewelEquipUtilitiesServer.TryGetEquippedJewel(EntityManager, character, item, ref @null) && @null.Exists()) { break; } } if (JewelEquipUtilitiesServer.TryUnequipJewel(EntityManager, ref itemLookup, val4, abilityGroup)) { flag = true; } } if (InventoryExtensions.IsIndexWithinRange<VBloodAbilityBuffEntry>(ref val2, num) && val.Exists()) { val2.RemoveAt(num); DestroyUtility.Destroy(EntityManager, val, (DestroyDebugReason)13, (string)null, 0); } } ((SystemBase)ReplaceAbilityOnSlotSystem).OnUpdate(); int num2 = default(int); if (flag && InventoryUtilities.TryGetItemSlot(EntityManager, character, @null, ref num2)) { JewelEquipUtilitiesServer.TryEquipJewel(ref EntityManagerRef, ref PrefabLookupMap, character, num2); } RemoveNPCSpell(character); } else { RemoveNPCSpell(character); } } public static void UpdateShift(ChatCommandContext ctx, Entity character, PrefabGUID spellPrefabGUID) { //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_0013: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or