using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using HookDOTS.API;
using HookDOTS.API.Attributes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using Microsoft.CodeAnalysis;
using ProfuselyViolentProgression.Core.Utilities;
using ProjectM;
using ProjectM.Gameplay.Systems;
using ProjectM.Shared;
using Stunlock.Core;
using Unity.Collections;
using Unity.Entities;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("Nicholas Toby")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyCopyright("Copyright (c) Nicholas Toby 2025")]
[assembly: AssemblyDescription("Patches exploitable dash jewel bugs. Example: triggering 'consume chill and inflict freeze' on non-chilled targets.")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0+81b16717f0cc9a8cb49343603f163c763c9cc93f")]
[assembly: AssemblyProduct("FrostDashFreezeFix")]
[assembly: AssemblyTitle("FrostDashFreezeFix")]
[assembly: AssemblyMetadata("Reloadable", "True")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace ProfuselyViolentProgression.Core.Utilities
{
public static class DebugUtil
{
public static void LogComponentTypes(Entity entity)
{
//IL_0011: 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_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
LogUtil.LogMessage("-------------------------------------------");
EntityManager entityManager = WorldUtil.Game.EntityManager;
Enumerator<ComponentType> enumerator = ((EntityManager)(ref entityManager)).GetComponentTypes(entity, (Allocator)2).GetEnumerator();
while (enumerator.MoveNext())
{
ComponentType current = enumerator.Current;
LogUtil.LogMessage(((object)(ComponentType)(ref current)).ToString());
}
LogUtil.LogMessage("-------------------------------------------");
}
public static void LogPrefabGuid(Entity entity)
{
//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_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = WorldUtil.Game.EntityManager;
if (((EntityManager)(ref entityManager)).HasComponent<PrefabGUID>(entity))
{
PrefabGUID componentData = ((EntityManager)(ref entityManager)).GetComponentData<PrefabGUID>(entity);
LogUtil.LogInfo(" PrefabGUID: " + LookupPrefabName(componentData));
}
}
public static void LogBuffs(Entity entity)
{
//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_000e: 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_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = WorldUtil.Game.EntityManager;
if (((EntityManager)(ref entityManager)).HasBuffer<BuffBuffer>(entity))
{
LogUtil.LogInfo(" buffs:");
Enumerator<BuffBuffer> enumerator = ((EntityManager)(ref entityManager)).GetBuffer<BuffBuffer>(entity, false).GetEnumerator();
while (enumerator.MoveNext())
{
BuffBuffer current = enumerator.Current;
LogUtil.LogInfo(" " + LookupPrefabName(current.PrefabGuid));
}
}
}
public static void LogSpellModSet(Entity entity)
{
//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_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: 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_00b4: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: 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_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: 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_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = WorldUtil.Game.EntityManager;
if (((EntityManager)(ref entityManager)).HasComponent<SpellModSetComponent>(entity))
{
LogUtil.LogInfo(" spell mods:");
SpellModSetComponent componentData = ((EntityManager)(ref entityManager)).GetComponentData<SpellModSetComponent>(entity);
SpellModSet spellMods = componentData.SpellMods;
LogUtil.LogInfo($" count:{spellMods.Count}");
LogUtil.LogInfo(" 0:" + LookupPrefabName(spellMods.Mod0.Id));
LogUtil.LogInfo(" 1:" + LookupPrefabName(spellMods.Mod1.Id));
LogUtil.LogInfo(" 2:" + LookupPrefabName(spellMods.Mod2.Id));
LogUtil.LogInfo(" 3:" + LookupPrefabName(spellMods.Mod3.Id));
LogUtil.LogInfo(" 4:" + LookupPrefabName(spellMods.Mod4.Id));
LogUtil.LogInfo(" 5:" + LookupPrefabName(spellMods.Mod5.Id));
LogUtil.LogInfo(" 6:" + LookupPrefabName(spellMods.Mod6.Id));
LogUtil.LogInfo(" 7:" + LookupPrefabName(spellMods.Mod7.Id));
LogUtil.LogInfo(" ----");
}
}
public static void LogApplyBuffOnGameplayEvent(Entity entity)
{
//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_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//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_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: 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_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: 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_010c: Unknown result type (might be due to invalid IL or missing references)
EntityManager entityManager = WorldUtil.Game.EntityManager;
if (((EntityManager)(ref entityManager)).HasBuffer<ApplyBuffOnGameplayEvent>(entity))
{
LogUtil.LogInfo(" Buffs to apply on gameplay events:");
Enumerator<ApplyBuffOnGameplayEvent> enumerator = ((EntityManager)(ref entityManager)).GetBuffer<ApplyBuffOnGameplayEvent>(entity, false).GetEnumerator();
while (enumerator.MoveNext())
{
ApplyBuffOnGameplayEvent current = enumerator.Current;
LogUtil.LogInfo($" stacks:{current.Stacks}");
LogUtil.LogInfo(" 0:" + LookupPrefabName(current.Buff0));
LogUtil.LogInfo(" 1:" + LookupPrefabName(current.Buff1));
LogUtil.LogInfo(" 2:" + LookupPrefabName(current.Buff2));
LogUtil.LogInfo(" 3:" + LookupPrefabName(current.Buff3));
LogUtil.LogInfo($" spellModSource:{current.CustomAbilitySpellModsSource}");
LogUtil.LogInfo(" ----");
}
}
}
public static string LookupPrefabName(PrefabGUID prefabGuid)
{
//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_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_001c: 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_0035: Unknown result type (might be due to invalid IL or missing references)
PrefabCollectionSystem existingSystemManaged = WorldUtil.Game.GetExistingSystemManaged<PrefabCollectionSystem>();
PrefabLookupMap prefabLookupMap = existingSystemManaged._PrefabLookupMap;
NativeParallelHashMap<PrefabGUID, Entity> guidToEntityMap = prefabLookupMap.GuidToEntityMap;
if (!guidToEntityMap.ContainsKey(prefabGuid))
{
return $"GUID Not Found {prefabGuid._Value}";
}
return $"{((PrefabLookupMap)(ref prefabLookupMap)).GetName(prefabGuid)} PrefabGUID({((PrefabGUID)(ref prefabGuid)).GuidHash})";
}
}
public static class LogUtil
{
public static ManualLogSource Logger;
public static void Init(ManualLogSource logger)
{
Logger = logger;
}
public static void LogMessage(object data)
{
Logger.LogMessage(data);
}
public static void LogInfo(object data)
{
Logger.LogInfo(data);
}
public static void LogError(object data)
{
Logger.LogError(data);
}
public static void LogWarning(object data)
{
Logger.LogWarning(data);
}
}
public static class WorldUtil
{
private static World _clientWorld;
private static World _serverWorld;
public static World Server
{
get
{
if (_serverWorld != null && _serverWorld.IsCreated)
{
return _serverWorld;
}
_serverWorld = GetWorld("Server") ?? throw new Exception("There is no Server world (yet). Did you install a server mod on the client?");
return _serverWorld;
}
}
public static World Client
{
get
{
if (_clientWorld != null && _clientWorld.IsCreated)
{
return _clientWorld;
}
_clientWorld = GetWorld("Client_0") ?? throw new Exception("There is no Client world (yet). Did you install a client mod on the server?");
return _clientWorld;
}
}
public static World Default => World.DefaultGameObjectInjectionWorld;
public static World Game => IsClient ? Client : Server;
public static bool IsServer => Application.productName == "VRisingServer";
public static bool IsClient => Application.productName == "VRising";
public static bool IsGameWorldCreated()
{
if (_clientWorld != null)
{
return _clientWorld.IsCreated;
}
if (_serverWorld != null)
{
return _serverWorld.IsCreated;
}
if (IsClient)
{
return GetWorld("Client_0") != null;
}
if (IsServer)
{
return GetWorld("Server") != null;
}
return false;
}
private static World GetWorld(string name)
{
Enumerator<World> enumerator = World.s_AllWorlds.GetEnumerator();
while (enumerator.MoveNext())
{
World current = enumerator.Current;
if (current.Name == name)
{
_serverWorld = current;
return current;
}
}
return null;
}
}
}
namespace ProfuselyViolentProgression.FrostDashFreezeFix
{
[BepInPlugin("FrostDashFreezeFix", "FrostDashFreezeFix", "1.1.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BasePlugin
{
private Harmony _harmony;
private HookDOTS _hookDOTS;
public override void Load()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Expected O, but got Unknown
LogUtil.Init(((BasePlugin)this).Log);
ManualLogSource log = ((BasePlugin)this).Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("FrostDashFreezeFix");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.1.0");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!");
}
log.LogInfo(val);
_harmony = new Harmony("FrostDashFreezeFix");
_harmony.PatchAll(Assembly.GetExecutingAssembly());
_hookDOTS = new HookDOTS("FrostDashFreezeFix", ((BasePlugin)this).Log);
_hookDOTS.RegisterAnnotatedHooks();
}
public override bool Unload()
{
_hookDOTS.Dispose();
Harmony harmony = _harmony;
if (harmony != null)
{
harmony.UnpatchSelf();
}
return true;
}
}
public static class FixDashAttackTriggersUtil
{
public static int TickCount = 0;
public static int RecursiveGroupPassesThisTick = 0;
private static Dictionary<Entity, InflictionFlagsState> InflictionsWhenFirstHitThisTick = new Dictionary<Entity, InflictionFlagsState>();
private static EntityManager EntityManager = WorldUtil.Game.EntityManager;
public static string RecursiveGroupTickStamp => $"{TickCount}-{RecursiveGroupPassesThisTick}";
public static void NewTickStarted()
{
TickCount++;
RecursiveGroupPassesThisTick = 0;
InflictionsWhenFirstHitThisTick.Clear();
}
public static void RecursiveGroupUpdateStarting()
{
RecursiveGroupPassesThisTick++;
}
public static void EntityGotHitWithSomethingDamaging(Entity entity)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
if (!InflictionsWhenFirstHitThisTick.ContainsKey(entity))
{
InflictionsWhenFirstHitThisTick.Add(entity, CheckInflictions(entity));
}
}
public static void BuffWillBeSpawned(Entity entity, Entity entityToBuff)
{
//IL_0006: 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_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0117: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
if (InflictionsWhenFirstHitThisTick.TryGetValue(entityToBuff, out var value) && ((EntityManager)(ref EntityManager)).HasComponent<PrefabGUID>(entity))
{
PrefabGUID componentData = ((EntityManager)(ref EntityManager)).GetComponentData<PrefabGUID>(entity);
if (!value.Leech && ((PrefabGUID)(ref componentData)).Equals(PrefabGUIDs.AB_Vampire_VeilOfBlood_TriggerBonusEffects))
{
RemoveSpellMods_RequiringTargetWithLeech(entity);
}
else if (!value.Ignite && ((PrefabGUID)(ref componentData)).Equals(PrefabGUIDs.AB_Vampire_VeilOfChaos_TriggerBonusEffects))
{
RemoveSpellMods_RequiringTargetWithIgnite(entity);
}
else if (!value.Condemn && ((PrefabGUID)(ref componentData)).Equals(PrefabGUIDs.AB_Vampire_VeilOfBones_TriggerBonusEffects))
{
RemoveSpellMods_RequiringTargetWithCondemn(entity);
}
else if (!value.Weaken && ((PrefabGUID)(ref componentData)).Equals(PrefabGUIDs.AB_Vampire_VeilOfIllusion_TriggerBonusEffects))
{
RemoveSpellMods_RequiringTargetWithWeaken(entity);
}
else if (!value.Chill && ((PrefabGUID)(ref componentData)).Equals(PrefabGUIDs.AB_Vampire_VeilOfFrost_TriggerBonusEffects))
{
RemoveSpellMods_RequiringTargetWithChill(entity);
}
else if (!value.Static && ((PrefabGUID)(ref componentData)).Equals(PrefabGUIDs.AB_Vampire_VeilOfStorm_TriggerBonusEffects))
{
RemoveSpellMods_RequiringTargetWithStatic(entity);
}
}
}
public static InflictionFlagsState CheckInflictions(Entity entity)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: 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_0054: 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_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: 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_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_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: 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_00fa: 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_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
InflictionFlagsState inflictionFlagsState = new InflictionFlagsState(InflictionFlags.None);
if (!((EntityManager)(ref EntityManager)).HasBuffer<BuffBuffer>(entity))
{
return inflictionFlagsState;
}
Enumerator<BuffBuffer> enumerator = ((EntityManager)(ref EntityManager)).GetBuffer<BuffBuffer>(entity, false).GetEnumerator();
while (enumerator.MoveNext())
{
BuffBuffer current = enumerator.Current;
PrefabGUID prefabGuid = current.PrefabGuid;
if (((PrefabGUID)(ref prefabGuid)).Equals(PrefabGUIDs.Blood_Vampire_Buff_Leech))
{
inflictionFlagsState.Set(InflictionFlags.Leech);
continue;
}
prefabGuid = current.PrefabGuid;
if (((PrefabGUID)(ref prefabGuid)).Equals(PrefabGUIDs.Chaos_Vampire_Buff_Ignite))
{
inflictionFlagsState.Set(InflictionFlags.Ignite);
continue;
}
prefabGuid = current.PrefabGuid;
if (((PrefabGUID)(ref prefabGuid)).Equals(PrefabGUIDs.Unholy_Vampire_Buff_Condemn))
{
inflictionFlagsState.Set(InflictionFlags.Condemn);
continue;
}
prefabGuid = current.PrefabGuid;
if (((PrefabGUID)(ref prefabGuid)).Equals(PrefabGUIDs.Illusion_Vampire_Buff_Weaken))
{
inflictionFlagsState.Set(InflictionFlags.Weaken);
continue;
}
prefabGuid = current.PrefabGuid;
if (((PrefabGUID)(ref prefabGuid)).Equals(PrefabGUIDs.Frost_Vampire_Buff_Chill))
{
inflictionFlagsState.Set(InflictionFlags.Chill);
continue;
}
prefabGuid = current.PrefabGuid;
if (((PrefabGUID)(ref prefabGuid)).Equals(PrefabGUIDs.Storm_Vampire_Buff_Static))
{
inflictionFlagsState.Set(InflictionFlags.Static);
}
}
return inflictionFlagsState;
}
public static void RemoveSpellMods_RequiringTargetWithChill(Entity entity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
RemoveSpellMods(entity, PrefabGUIDs.SpellMod_Shared_Frost_ConsumeChillIntoFreeze_OnAttack);
}
public static void RemoveSpellMods_RequiringTargetWithLeech(Entity entity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
RemoveSpellMods(entity, PrefabGUIDs.SpellMod_VeilOfBlood_Empower);
}
public static void RemoveSpellMods_RequiringTargetWithWeaken(Entity entity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
RemoveSpellMods(entity, PrefabGUIDs.SpellMod_Shared_Illusion_WeakenShield_OnAttack);
}
public static void RemoveSpellMods_RequiringTargetWithStatic(Entity entity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
RemoveSpellMods(entity, PrefabGUIDs.SpellMod_Shared_Storm_ConsumeStaticIntoStun);
}
public static void RemoveSpellMods_RequiringTargetWithIgnite(Entity entity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
RemoveSpellMods(entity, PrefabGUIDs.SpellMod_Shared_Chaos_ConsumeIgniteAgonizingFlames_OnAttack);
}
public static void RemoveSpellMods_RequiringTargetWithCondemn(Entity entity)
{
}
public static void RemoveSpellMods(Entity entity, PrefabGUID prefabGUID)
{
//IL_0006: 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_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: 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_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: 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_00a5: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: 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_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_018f: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
if (((EntityManager)(ref EntityManager)).HasBuffer<SpellModSetComponent>(entity))
{
SpellModSetComponent componentData = ((EntityManager)(ref EntityManager)).GetComponentData<SpellModSetComponent>(entity);
SpellModSet spellMods = componentData.SpellMods;
if (((PrefabGUID)(ref spellMods.Mod0.Id)).Equals(prefabGUID))
{
spellMods.Mod0.Id = PrefabGUIDs.NullPrefabGUID;
}
if (((PrefabGUID)(ref spellMods.Mod1.Id)).Equals(prefabGUID))
{
spellMods.Mod1.Id = PrefabGUIDs.NullPrefabGUID;
}
if (((PrefabGUID)(ref spellMods.Mod2.Id)).Equals(prefabGUID))
{
spellMods.Mod2.Id = PrefabGUIDs.NullPrefabGUID;
}
if (((PrefabGUID)(ref spellMods.Mod3.Id)).Equals(prefabGUID))
{
spellMods.Mod3.Id = PrefabGUIDs.NullPrefabGUID;
}
if (((PrefabGUID)(ref spellMods.Mod4.Id)).Equals(prefabGUID))
{
spellMods.Mod4.Id = PrefabGUIDs.NullPrefabGUID;
}
if (((PrefabGUID)(ref spellMods.Mod5.Id)).Equals(prefabGUID))
{
spellMods.Mod5.Id = PrefabGUIDs.NullPrefabGUID;
}
if (((PrefabGUID)(ref spellMods.Mod6.Id)).Equals(prefabGUID))
{
spellMods.Mod6.Id = PrefabGUIDs.NullPrefabGUID;
}
if (((PrefabGUID)(ref spellMods.Mod7.Id)).Equals(prefabGUID))
{
spellMods.Mod7.Id = PrefabGUIDs.NullPrefabGUID;
}
componentData.SpellMods = spellMods;
((EntityManager)(ref EntityManager)).SetComponentData<SpellModSetComponent>(entity, componentData);
}
}
}
[Flags]
public enum InflictionFlags : ulong
{
None = 0uL,
Leech = 1uL,
Ignite = 2uL,
Condemn = 4uL,
Weaken = 8uL,
Chill = 0x10uL,
Static = 0x20uL
}
public class InflictionFlagsState
{
public InflictionFlags Value;
public bool Leech => IsSet(InflictionFlags.Leech);
public bool Ignite => IsSet(InflictionFlags.Ignite);
public bool Condemn => IsSet(InflictionFlags.Condemn);
public bool Weaken => IsSet(InflictionFlags.Weaken);
public bool Chill => IsSet(InflictionFlags.Chill);
public bool Static => IsSet(InflictionFlags.Static);
public InflictionFlagsState(InflictionFlags flags = InflictionFlags.None)
{
Value = flags;
}
public void Set(InflictionFlags flags)
{
Value |= flags;
}
public bool IsSet(InflictionFlags flags)
{
return (Value & flags) != 0;
}
public override string ToString()
{
return Value.ToString();
}
}
[HarmonyPatch]
public class Patches
{
private static EntityManager EntityManager = WorldUtil.Game.EntityManager;
private static EntityQuery Query_DealDamageEvent;
[EcsSystemUpdatePrefix(typeof(RecursiveGroup), false)]
public static void TickStartPrefix()
{
FixDashAttackTriggersUtil.NewTickStarted();
}
[HarmonyPatch(typeof(RecursiveGroup), "DoRecursiveUpdate")]
[HarmonyPrefix]
public static void TrackRecursiveUpdates()
{
FixDashAttackTriggersUtil.RecursiveGroupUpdateStarting();
}
[EcsSystemUpdatePostfix(typeof(HandleGameplayEventsRecursiveSystem), true)]
public static void CheckDealDamageEvents()
{
//IL_0001: 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_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Expected O, but got Unknown
//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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
if (Query_DealDamageEvent == default(EntityQuery))
{
EntityQueryDesc[] array = new EntityQueryDesc[1];
EntityQueryDesc val = new EntityQueryDesc();
val.All = Il2CppStructArray<ComponentType>.op_Implicit((ComponentType[])(object)new ComponentType[1] { ComponentType.ReadOnly<DealDamageEvent>() });
array[0] = val;
Query_DealDamageEvent = ((EntityManager)(ref EntityManager)).CreateEntityQuery((EntityQueryDesc[])(object)array);
}
Enumerator<DealDamageEvent> enumerator = ((EntityQuery)(ref Query_DealDamageEvent)).ToComponentDataArray<DealDamageEvent>(AllocatorHandle.op_Implicit((Allocator)2)).GetEnumerator();
while (enumerator.MoveNext())
{
DealDamageEvent current = enumerator.Current;
FixDashAttackTriggersUtil.EntityGotHitWithSomethingDamaging(current.Target);
}
}
[HarmonyPatch(typeof(BuffSystem_Spawn_Server), "OnUpdate")]
[HarmonyPrefix]
public static void BuffSpawnPrefix(BuffSystem_Spawn_Server __instance)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: 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_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
EntityQuery query = __instance._Query;
NativeArray<Entity> val = ((EntityQuery)(ref query)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2));
query = __instance._Query;
NativeArray<Buff> val2 = ((EntityQuery)(ref query)).ToComponentDataArray<Buff>(AllocatorHandle.op_Implicit((Allocator)2));
for (int i = 0; i < val.Length; i++)
{
FixDashAttackTriggersUtil.BuffWillBeSpawned(val[i], val2[i].Target);
}
}
}
public static class PrefabGUIDs
{
public static readonly PrefabGUID NullPrefabGUID = new PrefabGUID(0);
public static readonly PrefabGUID Frost_Vampire_Buff_Chill = new PrefabGUID(27300215);
public static readonly PrefabGUID AB_Vampire_VeilOfFrost_TriggerBonusEffects = new PrefabGUID(-1688602321);
public static readonly PrefabGUID SpellMod_Shared_Frost_ConsumeChillIntoFreeze_OnAttack = new PrefabGUID(-292495274);
public static readonly PrefabGUID Blood_Vampire_Buff_Leech = new PrefabGUID(-1246704569);
public static readonly PrefabGUID AB_Vampire_VeilOfBlood_TriggerBonusEffects = new PrefabGUID(2135363194);
public static readonly PrefabGUID SpellMod_VeilOfBlood_Empower = new PrefabGUID(156877668);
public static readonly PrefabGUID Illusion_Vampire_Buff_Weaken = new PrefabGUID(1723455773);
public static readonly PrefabGUID AB_Vampire_VeilOfIllusion_TriggerBonusEffects = new PrefabGUID(-733228440);
public static readonly PrefabGUID SpellMod_Shared_Illusion_WeakenShield_OnAttack = new PrefabGUID(-450361030);
public static readonly PrefabGUID Storm_Vampire_Buff_Static = new PrefabGUID(-1576512627);
public static readonly PrefabGUID AB_Vampire_VeilOfStorm_TriggerBonusEffects = new PrefabGUID(-1726441616);
public static readonly PrefabGUID SpellMod_Shared_Storm_ConsumeStaticIntoStun = new PrefabGUID(1215957974);
public static readonly PrefabGUID Chaos_Vampire_Buff_Ignite = new PrefabGUID(348724578);
public static readonly PrefabGUID AB_Vampire_VeilOfChaos_TriggerBonusEffects = new PrefabGUID(506605802);
public static readonly PrefabGUID SpellMod_Shared_Chaos_ConsumeIgniteAgonizingFlames_OnAttack = new PrefabGUID(1702103303);
public static readonly PrefabGUID Unholy_Vampire_Buff_Condemn = new PrefabGUID(-325758519);
public static readonly PrefabGUID AB_Vampire_VeilOfBones_TriggerBonusEffects = new PrefabGUID(208290788);
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "FrostDashFreezeFix";
public const string PLUGIN_NAME = "FrostDashFreezeFix";
public const string PLUGIN_VERSION = "1.1.0";
}
}