using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net.Http; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using DailyQuest.Models; using DailyQuest.Services; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppSystem.Collections.Generic; using Microsoft.CodeAnalysis; using ProjectM; using ProjectM.Network; using ProjectM.Scripting; using ProjectM.Shared; using Stunlock.Core; using Unity.Collections; using Unity.Entities; using Unity.Scenes; using UnityEngine; using VampireCommandFramework; [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("DailyQuest")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyDescription("A daily quest system for V Rising featuring three rotating quest tiers, customizable quest rewards, optional gear repair, reward buffs, and Discord webhook notifications")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("DailyQuest")] [assembly: AssemblyTitle("DailyQuest")] [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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DailyQuest { public static class Buffs { public static bool AddBuff(Entity User, Entity Character, PrefabGUID buffPrefab, int duration = 0, bool immortal = true) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0037: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00c4: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) DebugEventsSystem existingSystemManaged = Core.Server.GetExistingSystemManaged(); ApplyBuffDebugEvent val = default(ApplyBuffDebugEvent); val.BuffPrefabGUID = buffPrefab; ApplyBuffDebugEvent val2 = val; FromCharacter val3 = default(FromCharacter); val3.User = User; val3.Character = Character; FromCharacter val4 = val3; Entity entity = default(Entity); if (!BuffUtility.TryGetBuff(Core.Server.EntityManager, Character, PrefabIdentifier.op_Implicit(buffPrefab), ref entity)) { existingSystemManaged.ApplyBuff(val4, val2); if (BuffUtility.TryGetBuff(Core.Server.EntityManager, Character, PrefabIdentifier.op_Implicit(buffPrefab), ref entity)) { if (entity.Has()) { entity.Remove(); } if (entity.Has()) { entity.Remove(); } if (immortal) { entity.Add(); if (entity.Has()) { entity.Remove(); } if (entity.Has()) { entity.Remove(); } } if (duration > -1 && duration != 0) { if (!entity.Has()) { entity.Add(); entity.Write(new LifeTime { EndAction = (LifeTimeEndAction)2 }); } LifeTime componentData = entity.Read(); componentData.Duration = duration; entity.Write(componentData); } else if (duration == -1) { if (entity.Has()) { LifeTime componentData2 = entity.Read(); componentData2.EndAction = (LifeTimeEndAction)0; entity.Write(componentData2); } if (entity.Has()) { entity.Remove(); } if (entity.Has()) { entity.Remove(); } } return true; } return false; } return false; } public static void RemoveBuff(Entity Character, PrefabGUID buffPrefab) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //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) Entity val = default(Entity); if (BuffUtility.TryGetBuff(Core.EntityManager, Character, PrefabIdentifier.op_Implicit(buffPrefab), ref val)) { DestroyUtility.Destroy(Core.EntityManager, val, (DestroyDebugReason)13, (string)null, 0); } } } internal static class Core { private static World _server; private static bool _hasInitialized; public const int MAX_REPLY_LENGTH = 509; public static World Server { get { if (_server == null) { _server = GetWorld("Server"); } return _server; } } public static EntityManager EntityManager => Server.EntityManager; public static GameDataSystem GameDataSystem => Server.GetExistingSystemManaged(); public static PrefabCollectionSystem PrefabCollectionSystem { get; internal set; } public static PrefabCollectionSystem PrefabCollection => Server.GetExistingSystemManaged(); public static ServerScriptMapper ServerScriptMapper { get; internal set; } public static ServerGameManager ServerGameManager => ServerScriptMapper.GetServerGameManager(); public static ManualLogSource Log => Plugin.PluginLog; public static void LogException(Exception e, [CallerMemberName] string caller = null) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ManualLogSource log = Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(52, 5, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Failure in "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(caller); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\nMessage: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(e.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" Inner: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(e.InnerException?.Message); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\n\nStack: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(e.StackTrace); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("\nInner Stack: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(e.InnerException?.StackTrace); } log.LogError(val); } internal static bool IsServerReady() { if (_server == null) { _server = GetWorld("Server"); } if (_server == null) { return false; } PrefabCollectionSystem existingSystemManaged = _server.GetExistingSystemManaged(); return existingSystemManaged != null; } internal static void InitializeAfterLoaded() { if (!_hasInitialized) { if (!IsServerReady()) { Log.LogWarning((object)"Server world is not ready yet."); return; } PrefabCollectionSystem = Server.GetExistingSystemManaged(); ServerScriptMapper = Server.GetExistingSystemManaged(); QuestService.Initialize(); _hasInitialized = true; } } private static World GetWorld(string name) { Enumerator enumerator = World.s_AllWorlds.GetEnumerator(); while (enumerator.MoveNext()) { World current = enumerator.Current; if (current.Name == name) { return current; } } return null; } } public static class ECSExtensions { public delegate void ActionRef(ref T item); public unsafe static void Write(this Entity entity, T componentData) where T : struct { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of(), (AccessMode)0); byte[] array = StructureToByteArray(componentData); int num = Marshal.SizeOf(); fixed (byte* ptr = array) { EntityManager entityManager = Core.EntityManager; ((EntityManager)(ref entityManager)).SetComponentDataRaw(entity, val.TypeIndex, (void*)ptr, num); } } public static void With(this Entity entity, ActionRef action) where T : struct { //IL_0001: 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_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) T item = entity.ReadRW(); action(ref item); EntityManager entityManager = Core.EntityManager; ((EntityManager)(ref entityManager)).SetComponentData(entity, item); } public unsafe static T ReadRW(this Entity entity) where T : struct { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of(), (AccessMode)0); EntityManager entityManager = Core.EntityManager; void* componentDataRawRW = ((EntityManager)(ref entityManager)).GetComponentDataRawRW(entity, val.TypeIndex); return Marshal.PtrToStructure(new IntPtr(componentDataRawRW)); } public static byte[] StructureToByteArray(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 Read(this Entity entity) where T : struct { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) ComponentType val = default(ComponentType); ((ComponentType)(ref val))..ctor(Il2CppType.Of(), (AccessMode)0); EntityManager entityManager = Core.EntityManager; void* componentDataRawRO = ((EntityManager)(ref entityManager)).GetComponentDataRawRO(entity, val.TypeIndex); return Marshal.PtrToStructure(new IntPtr(componentDataRawRO)); } public static DynamicBuffer ReadBuffer(this Entity entity) where T : struct { //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_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_0018: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = Core.Server.EntityManager; return ((EntityManager)(ref entityManager)).GetBuffer(entity, false); } public static bool Has(this Entity entity) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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(), (AccessMode)0); EntityManager entityManager = Core.EntityManager; return ((EntityManager)(ref entityManager)).HasComponent(entity, val); } public static string LookupName(this 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0032: Unknown result type (might be due to invalid IL or missing references) PrefabCollectionSystem existingSystemManaged = Core.Server.GetExistingSystemManaged(); NativeParallelHashMap guidToEntityMap = existingSystemManaged._PrefabLookupMap.GuidToEntityMap; object result; if (!guidToEntityMap.ContainsKey(prefabGuid)) { result = "GUID Not Found"; } else { PrefabLookupMap prefabLookupMap = existingSystemManaged._PrefabLookupMap; result = ((PrefabLookupMap)(ref prefabLookupMap)).GetName(prefabGuid) + " PrefabGuid(" + ((PrefabGUID)(ref prefabGuid)).GuidHash + ")"; } return (string)result; } public static string PrefabName(this PrefabGUID prefabGuid) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return prefabGuid.LookupName(); } public static string EntityName(this Entity entity) { //IL_0007: 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_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_0033: 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_0041: Unknown result type (might be due to invalid IL or missing references) string text = string.Empty; if (entity.Has()) { NameableInteractable val = entity.Read(); text = ((object)(FixedString64Bytes)(ref val.Name)).ToString(); } if (string.IsNullOrEmpty(text) && entity.Has()) { text = entity.Read().PrefabName(); } if (string.IsNullOrEmpty(text)) { text = ((object)(Entity)(ref entity)).ToString(); } return text; } public static void Add(this Entity entity) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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(), (AccessMode)0); EntityManager entityManager = Core.EntityManager; ((EntityManager)(ref entityManager)).AddComponent(entity, val); } public static void Remove(this Entity entity) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_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(), (AccessMode)0); EntityManager entityManager = Core.EntityManager; ((EntityManager)(ref entityManager)).RemoveComponent(entity, val); } } internal static class Helper { private static readonly HashSet SoulShards = new HashSet { 666638454, -1581189572, -1260254082, -21943750, 1286615355 }; public static PrefabGUID GetPrefabGUID(Entity entity) { //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_0016: 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_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_001e: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = Core.EntityManager; try { return ((EntityManager)(ref entityManager)).GetComponentData(entity); } catch { return new PrefabGUID(0); } } public static NativeArray GetEntitiesByComponentType() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0037: 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_003b: Unknown result type (might be due to invalid IL or missing references) EntityManager entityManager = Core.EntityManager; EntityQuery val = ((EntityManager)(ref entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[1] { ComponentType.ReadOnly() }); NativeArray result = ((EntityQuery)(ref val)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); ((EntityQuery)(ref val)).Dispose(); return result; } public static NativeArray GetEntitiesByComponentTypes() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0027: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) EntityManager entityManager = Core.EntityManager; EntityQuery val = ((EntityManager)(ref entityManager)).CreateEntityQuery((ComponentType[])(object)new ComponentType[2] { ComponentType.ReadOnly(), ComponentType.ReadOnly() }); NativeArray result = ((EntityQuery)(ref val)).ToEntityArray(AllocatorHandle.op_Implicit((Allocator)2)); ((EntityQuery)(ref val)).Dispose(); return result; } public static Entity AddItemToInventory(Entity recipient, PrefabGUID guid, int amount) { //IL_000c: 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_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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) try { ServerGameManager serverGameManager = Core.Server.GetExistingSystemManaged()._ServerGameManager; AddItemResponse val = ((ServerGameManager)(ref serverGameManager)).TryAddInventoryItem(recipient, guid, amount); return val.NewEntity; } catch (Exception e) { Core.LogException(e, "AddItemToInventory"); } return default(Entity); } private static void HandleEquipment(Entity itemEntity, bool repair) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_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_0033: 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_003f: Unknown result type (might be due to invalid IL or missing references) if (!(itemEntity == Entity.Null) && itemEntity.Has()) { Durability val = itemEntity.Read(); val.Value = (repair ? val.MaxDurability : 0f); itemEntity.Write(val); } } public static void RepairArmor(Entity character, bool repair = true) { //IL_0002: 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_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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) try { if (character.Has()) { Equipment val = character.Read(); HandleEquipment(((NetworkedEntity)(ref val.ArmorChestSlot.SlotEntity)).GetEntityOnServer(), repair); HandleEquipment(((NetworkedEntity)(ref val.ArmorGlovesSlot.SlotEntity)).GetEntityOnServer(), repair); HandleEquipment(((NetworkedEntity)(ref val.ArmorLegsSlot.SlotEntity)).GetEntityOnServer(), repair); HandleEquipment(((NetworkedEntity)(ref val.ArmorFootgearSlot.SlotEntity)).GetEntityOnServer(), repair); } } catch (Exception e) { Core.LogException(e, "RepairArmor"); } } public static void RepairAmulet(Entity character, bool repair = true) { //IL_0002: 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_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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0051: 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) try { if (!character.Has()) { return; } Equipment val = character.Read(); Entity entityOnServer = ((NetworkedEntity)(ref val.GrimoireSlot.SlotEntity)).GetEntityOnServer(); if (!(entityOnServer == Entity.Null) && entityOnServer.Has()) { PrefabGUID val2 = entityOnServer.Read(); if (!SoulShards.Contains(((PrefabGUID)(ref val2)).GuidHash)) { HandleEquipment(entityOnServer, repair); } } } catch (Exception e) { Core.LogException(e, "RepairAmulet"); } } public static void RepairWeapon(Entity character, bool repair = true) { //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_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_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_008d: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c2: Invalid comparison between Unknown and I4 //IL_00cf: Unknown result type (might be due to invalid IL or missing references) try { Entity val = default(Entity); if (!InventoryUtilities.TryGetInventoryEntity(Core.EntityManager, character, ref val, 0)) { return; } ServerScriptMapper existingSystemManaged = Core.Server.GetExistingSystemManaged(); if (existingSystemManaged == null) { return; } ServerGameManager serverGameManager = existingSystemManaged._ServerGameManager; DynamicBuffer val2 = default(DynamicBuffer); if (!((ServerGameManager)(ref serverGameManager)).TryGetBuffer(val, ref val2)) { return; } for (int i = 0; i < 8 && i < val2.Length; i++) { InventoryBuffer val3 = val2[i]; Entity entityOnServer = ((NetworkedEntity)(ref val3.ItemEntity)).GetEntityOnServer(); if (!(entityOnServer == Entity.Null) && entityOnServer.Has() && entityOnServer.Has()) { EquippableData val4 = entityOnServer.Read(); if ((int)val4.EquipmentType == 2) { HandleEquipment(entityOnServer, repair); } } } } catch (Exception e) { Core.LogException(e, "RepairWeapon"); } } public static void TrySendBroadcastMessage(string playerName, List claimedNames) { //IL_0067: Unknown result type (might be due to invalid IL or missing references) if (Plugin.BroadcastMessageEnabled != null && !Plugin.BroadcastMessageEnabled.Value) { return; } try { string newValue = string.Join(", ", claimedNames); string text = Plugin.BroadcastMessage?.Value ?? ""; string text2 = text.Replace("#player#", playerName).Replace("#quest#", newValue); FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(text2); ServerChatUtils.SendSystemMessageToAllClients(Core.EntityManager, ref val); } catch (Exception e) { Core.LogException(e, "TrySendBroadcastMessage"); } } public static void TrySendWebhookMessage(string playerName, List claimedNames) { if (Plugin.WebhookEnabled != null && !Plugin.WebhookEnabled.Value) { return; } try { string newValue = string.Join(", ", claimedNames); string text = Plugin.WebhookMessage?.Value ?? ""; string message = text.Replace("#player#", playerName).Replace("#quest#", newValue); TrySendWebhookAsync(message); } catch (Exception e) { Core.LogException(e, "TrySendWebhookMessage"); } } public static async Task TrySendWebhookAsync(string message) { try { var (ok, error) = await WebhookService.SendAsync(message).ConfigureAwait(continueOnCapturedContext: false); if (!ok && !string.IsNullOrWhiteSpace(error) && !string.Equals(error, "Webhook is disabled.", StringComparison.Ordinal) && !string.Equals(error, "Webhook URL is empty.", StringComparison.Ordinal)) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(10, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[Webhook] "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(error); } log.LogWarning(val); } } catch (Exception ex) { Exception e = ex; Core.LogException(e, "TrySendWebhookAsync"); } } public static void TryAddDailyQuestBuff(Entity userEntity, Entity characterEntity, PlayerQuestState st) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (Plugin.ClaimedBuffEnabled == null || !Plugin.ClaimedBuffEnabled.Value) { return; } int num = Plugin.ClaimedBuffPrefab?.Value ?? 0; if (num == 0) { return; } try { if (st.ClaimedBuffPrefab != 0 && st.ClaimedBuffPrefab != num) { Buffs.RemoveBuff(characterEntity, new PrefabGUID(st.ClaimedBuffPrefab)); } Buffs.AddBuff(userEntity, characterEntity, new PrefabGUID(num), -1); st.ClaimedBuffPrefab = num; } catch (Exception e) { Core.LogException(e, "TryAddDailyQuestBuff"); } } public static bool TryRemoveDailyQuestBuff(Entity characterEntity, PlayerQuestState st) { //IL_0003: 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_000c: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) bool result = false; if (characterEntity == default(Entity) || characterEntity == Entity.Null) { return false; } try { if (st.ClaimedBuffPrefab != 0) { Buffs.RemoveBuff(characterEntity, new PrefabGUID(st.ClaimedBuffPrefab)); st.ClaimedBuffPrefab = 0; result = true; } int num = Plugin.ClaimedBuffPrefab?.Value ?? 0; if (num != 0) { Buffs.RemoveBuff(characterEntity, new PrefabGUID(num)); } } catch (Exception e) { Core.LogException(e, "TryRemoveDailyQuestBuff"); } return result; } } [BepInPlugin("DailyQuest", "DailyQuest", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BasePlugin { internal static Harmony Harmony; internal static ManualLogSource PluginLog; public static ConfigFile PluginConfig; public static ConfigEntry GearRepairOnClaimEnabled; public static ConfigEntry BroadcastMessageEnabled; public static ConfigEntry BroadcastMessage; public static ConfigEntry WebhookEnabled; public static ConfigEntry WebhookUrl; public static ConfigEntry WebhookMessage; public static ConfigEntry ClaimedBuffEnabled; public static ConfigEntry ClaimedBuffPrefab; public static ManualLogSource LogInstance { get; private set; } public override void Load() { //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Expected O, but got Unknown if (Application.productName != "VRisingServer") { return; } PluginLog = ((BasePlugin)this).Log; LogInstance = ((BasePlugin)this).Log; PluginConfig = ((BasePlugin)this).Config; 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("DailyQuest"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" version "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted("1.1.0"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" is loaded!"); } log.LogInfo(val); GearRepairOnClaimEnabled = ((BasePlugin)this).Config.Bind("Repair", "GearRepairOnClaim", false, "Enable gear repair when rewards are claimed."); BroadcastMessageEnabled = ((BasePlugin)this).Config.Bind("Broadcast", "BroadcastEnabled", true, "Enable in-game broadcast message when rewards are claimed."); BroadcastMessage = ((BasePlugin)this).Config.Bind("Broadcast", "BroadcastMessage", "#player# completed and claimed rewards for: #quest#. Use .quest daily to check your quests.", "Format of the in-game broadcast message."); WebhookEnabled = ((BasePlugin)this).Config.Bind("Webhook", "WebhookEnabled", false, "Enable Discord webhook message when rewards are claimed."); WebhookUrl = ((BasePlugin)this).Config.Bind("Webhook", "WebhookUrl", "", "Webhook URL. Example: https://discord.com/api/webhooks/123456789012345678/aBc1234d5Efg6H78ij9k0-L1m2nO3pq4RstU5v6w78Xyz9"); WebhookMessage = ((BasePlugin)this).Config.Bind("Webhook", "WebhookMessage", "**[Daily quest]** - **#player#** has completed and claimed the rewards for: #quest#", "Format of the Discord webhook message."); ClaimedBuffEnabled = ((BasePlugin)this).Config.Bind("Buff", "ClaimedBuffEnabled", false, "Enable giving a buff when rewards are claimed."); ClaimedBuffPrefab = ((BasePlugin)this).Config.Bind("Buff", "ClaimedBuffPrefab", -463147620, "PrefabGUID of the buff to apply."); try { QuestService.EnsureFilesExist(); MigrationService.RunAllMigrations(); ((BasePlugin)this).Log.LogInfo((object)"DailyQuest config files ensured."); } catch (Exception ex) { ManualLogSource log2 = ((BasePlugin)this).Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(35, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Failed to create DailyQuest files: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex); } log2.LogError(val2); } Harmony = new Harmony("dailyquest"); Harmony.PatchAll(Assembly.GetExecutingAssembly()); CommandRegistry.RegisterAll(); } public override bool Unload() { CommandRegistry.UnregisterAssembly(); Harmony harmony = Harmony; if (harmony != null) { harmony.UnpatchSelf(); } SaveThrottle.Stop(); return true; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "DailyQuest"; public const string PLUGIN_NAME = "DailyQuest"; public const string PLUGIN_VERSION = "1.1.0"; } } namespace DailyQuest.Services { internal static class MigrationService { private sealed class LegacyWebhookConfig { public bool Enabled { get; set; } public string WebhookUrl { get; set; } } private static readonly string CONFIG_DIR = Path.Combine(Paths.ConfigPath, "DailyQuest"); private static readonly string QUEST_CONFIG_FILE = Path.Combine(CONFIG_DIR, "quest_config.json"); private static readonly string WEBHOOK_CONFIG_FILE = Path.Combine(CONFIG_DIR, "webhook_config.json"); private static readonly string DATE_TIME = DateTime.Now.ToString("yyyyMMdd_HHmmss"); private static readonly string BACKUP_DIR = Path.Combine(CONFIG_DIR, "OldVersionBackup"); private static readonly string QUEST_CONFIG_BACKUP_FILE = Path.Combine(BACKUP_DIR, "quest_config_backup_" + DATE_TIME + ".json"); private static readonly string WEBHOOK_CONFIG_BACKUP_FILE = Path.Combine(BACKUP_DIR, "webhook_config_backup_" + DATE_TIME + ".json"); private static readonly string README_FILE = Path.Combine(BACKUP_DIR, "readme.txt"); private static readonly JsonSerializerOptions JsonOpts = new JsonSerializerOptions { WriteIndented = true, AllowTrailingCommas = true, ReadCommentHandling = JsonCommentHandling.Skip, PropertyNameCaseInsensitive = true }; public static void RunAllMigrations() { bool flag = MigrateQuestConfig(); bool flag2 = MigrateWebhookConfig(); if (flag || flag2) { CreateMigrationInfoFile(); } } private static bool MigrateQuestConfig() { //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown if (!File.Exists(QUEST_CONFIG_FILE)) { return false; } bool flag = default(bool); try { string text = File.ReadAllText(QUEST_CONFIG_FILE); if (text.Contains("\"GearRepairOnClaim\":") || text.Contains("\"Quests\":")) { Core.Log.LogWarning((object)"[MigrationService] LEGACY QUEST FORMAT DETECTED! STARTING MIGRATION..."); Directory.CreateDirectory(BACKUP_DIR); File.Copy(QUEST_CONFIG_FILE, QUEST_CONFIG_BACKUP_FILE, overwrite: true); ManualLogSource log = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(52, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[MigrationService] Step 1. Quest Backup created at: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(QUEST_CONFIG_BACKUP_FILE); } log.LogInfo(val); QuestConfig questConfig = JsonSerializer.Deserialize(text, JsonOpts) ?? new QuestConfig(); if (Plugin.GearRepairOnClaimEnabled != null) { Plugin.GearRepairOnClaimEnabled.Value = questConfig.RepairOnClaim; Plugin.PluginConfig.Save(); Core.Log.LogInfo((object)"[MigrationService] Step 2. GearRepairOnClaim config moved to DailyQuest.cfg"); } byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(questConfig.Quests ?? new List(), JsonOpts); File.WriteAllBytes(QUEST_CONFIG_FILE, bytes); Core.Log.LogInfo((object)"[MigrationService] Step 3. Quest file rewritten to NEW format successfully!"); return true; } } catch (Exception ex) { ManualLogSource log2 = Core.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(42, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[MigrationService] Quest Migration Error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } return false; } private static bool MigrateWebhookConfig() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown if (!File.Exists(WEBHOOK_CONFIG_FILE)) { return false; } bool flag = default(bool); try { Core.Log.LogWarning((object)"[MigrationService] LEGACY WEBHOOK FORMAT DETECTED! STARTING MIGRATION..."); Directory.CreateDirectory(BACKUP_DIR); File.Copy(WEBHOOK_CONFIG_FILE, WEBHOOK_CONFIG_BACKUP_FILE, overwrite: true); ManualLogSource log = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(54, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[MigrationService] Step 1. Webhook Backup created at: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(WEBHOOK_CONFIG_BACKUP_FILE); } log.LogInfo(val); string json = File.ReadAllText(WEBHOOK_CONFIG_FILE); LegacyWebhookConfig legacyWebhookConfig = JsonSerializer.Deserialize(json, JsonOpts); if (legacyWebhookConfig != null) { Plugin.WebhookEnabled.Value = legacyWebhookConfig.Enabled; Plugin.WebhookUrl.Value = legacyWebhookConfig.WebhookUrl ?? ""; Plugin.PluginConfig.Save(); Core.Log.LogInfo((object)"[MigrationService] Step 2. Webhook settings moved to DailyQuest.cfg"); } File.Delete(WEBHOOK_CONFIG_FILE); Core.Log.LogInfo((object)"[MigrationService] Step 3. Old webhook config file deleted successfully!"); return true; } catch (Exception ex) { ManualLogSource log2 = Core.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(44, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[MigrationService] Webhook Migration Error: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogError(val2); } return false; } private static void CreateMigrationInfoFile() { //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown bool flag = default(bool); try { Directory.CreateDirectory(BACKUP_DIR); string contents = $"DailyQuest Migration Info Created at {DateTime.Now:yyyy-MM-dd HH:mm:ss}\r\n- 'quest_config_backup_xxxxxxxx_xxxxxx.json' and 'webhook_config_xxxxxxxx_xxxxxx.json' in {BACKUP_DIR} were created to safely back up your configurations from version 1.0.4 or older.\r\n- As of version 1.1.0, the 'GearRepairOnClaim' setting and all webhook configurations have been consolidated into 'BepInEx/config/DailyQuest.cfg' for easier management.\r\n- We have restructured 'quest_config.json' to contain only the quest list. All your existing quest setups will continue to function normally.\r\n- You can open the 'BepInEx/config/DailyQuest.cfg' to review the new configuration format.\r\n- If any settings in 'DailyQuest.cfg' are missing or incorrect, you can manually restore your original configurations from the backup files mentioned above.\r\n"; File.WriteAllText(README_FILE, contents); ManualLogSource log = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(51, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[MigrationService] Migration info file created at: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(README_FILE); } log.LogInfo(val); } catch (Exception ex) { ManualLogSource log2 = Core.Log; BepInExWarningLogInterpolatedStringHandler val2 = new BepInExWarningLogInterpolatedStringHandler(47, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("[MigrationService] Could not create info file: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted(ex.Message); } log2.LogWarning(val2); } } } internal static class QuestService { private static readonly string CONFIG_DIR = Path.Combine(Paths.ConfigPath, "DailyQuest"); private static readonly string CONFIG_FILE = Path.Combine(CONFIG_DIR, "quest_config.json"); private static readonly string PLAYER_FILE = Path.Combine(CONFIG_DIR, "quest_player.json"); private static readonly object _lock = new object(); private static QuestConfig _config = new QuestConfig(); private static Dictionary _questsById = new Dictionary(StringComparer.Ordinal); private static List _allQuests = new List(); private static List _easyQuests = new List(); private static List _mediumQuests = new List(); private static List _hardQuests = new List(); private static Dictionary _players = new Dictionary(); private static HashSet _allActiveTargetPrefabs = new HashSet(); private static string _cachedTodayString = DateTime.Now.ToString("yyyy-MM-dd"); private static DateTime _lastDate = DateTime.MinValue.Date; private static bool _initialized; private static readonly JsonSerializerOptions JsonOpts = new JsonSerializerOptions { WriteIndented = true, AllowTrailingCommas = true, ReadCommentHandling = JsonCommentHandling.Skip, PropertyNameCaseInsensitive = true }; public static string BuildStatusText(ulong sid, string playerName, Entity characterEntity = default(Entity)) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) EnsureAssignedForToday(sid, playerName, characterEntity); lock (_lock) { string key = sid.ToString(); if (!_players.TryGetValue(key, out var value) || value == null) { return "No data."; } QuestDef questById_NoLock = GetQuestById_NoLock(value.EasyQuestId); QuestDef questById_NoLock2 = GetQuestById_NoLock(value.MediumQuestId); QuestDef questById_NoLock3 = GetQuestById_NoLock(value.HardQuestId); string text = BuildQuestBlock_NoLock("1", questById_NoLock, value.EasyProgress, value.EasyClaimed); string text2 = BuildQuestBlock_NoLock("2", questById_NoLock2, value.MediumProgress, value.MediumClaimed); string text3 = BuildQuestBlock_NoLock("3", questById_NoLock3, value.HardProgress, value.HardClaimed); return "Daily Quests (Reset in " + GetNextResetText() + ")\n" + text + "\n" + text2 + "\n" + text3; } } private static string BuildQuestBlock_NoLock(string label, QuestDef quest, int progress, bool claimed) { if (quest != null) { int num = Math.Max(0, quest.RequiredKills); int num2 = Math.Max(0, progress); if (num2 > num) { num2 = num; } string rewardDisplay_NoLock = GetRewardDisplay_NoLock(quest); string value = ((num <= 0 || num2 < num) ? $"Progress {num2}/{num}" : (claimed ? "Reward claimed" : "Completed! Claim with .quest reward")); return $"Quest {label}: {quest.Name} x{num}\nReward: {rewardDisplay_NoLock}\nStatus: {value}"; } return $"Quest {label}: No quest {label.ToLowerInvariant()} configured."; } public static string BuildPlayerStatusTextByName(string playerName) { if (string.IsNullOrWhiteSpace(playerName)) { return "Invalid player name."; } lock (_lock) { EnsureInitialized_NoLock(); PlayerQuestState playerQuestState = _players.Values.FirstOrDefault((PlayerQuestState x) => x != null && !string.IsNullOrWhiteSpace(x.Name) && string.Equals(x.Name, playerName, StringComparison.OrdinalIgnoreCase)); if (playerQuestState == null) { return "Player not found in quest data."; } QuestDef questById_NoLock = GetQuestById_NoLock(playerQuestState.EasyQuestId); QuestDef questById_NoLock2 = GetQuestById_NoLock(playerQuestState.MediumQuestId); QuestDef questById_NoLock3 = GetQuestById_NoLock(playerQuestState.HardQuestId); string text = BuildAdminQuestLine_NoLock("1", questById_NoLock, playerQuestState.EasyProgress, playerQuestState.EasyClaimed); string text2 = BuildAdminQuestLine_NoLock("2", questById_NoLock2, playerQuestState.MediumProgress, playerQuestState.MediumClaimed); string text3 = BuildAdminQuestLine_NoLock("3", questById_NoLock3, playerQuestState.HardProgress, playerQuestState.HardClaimed); string b = DateTime.Now.ToString("yyyy-MM-dd"); bool flag = string.Equals(playerQuestState.Date, b, StringComparison.Ordinal); string text4 = "Daily Quests: " + playerQuestState.Name + ""; string text5 = (flag ? ("Quest Date: " + playerQuestState.Date) : ("Quest Date: " + playerQuestState.Date + " (Outdated)")); return text4 + "\n" + text + "\n" + text2 + "\n" + text3 + "\n" + text5; } } private static string BuildAdminQuestLine_NoLock(string label, QuestDef quest, int progress, bool claimed) { if (quest == null) { return "Quest " + label + ": No quest configured."; } int num = Math.Max(0, quest.RequiredKills); int num2 = Math.Max(0, progress); if (num2 > num) { num2 = num; } string value = (claimed ? "(Reward claimed)" : ((num2 >= num) ? "(Completed)" : $"({num2}/{num})")); string value2 = (string.IsNullOrWhiteSpace(quest.Name) ? ("Quest " + label) : quest.Name); return $"Quest {label}: {value2} {value}"; } private static bool TryClaimOne_NoLock(Entity userEntity, Entity characterEntity, string label, string questId, int progress, bool alreadyClaimed, out string replyText, out PrefabGUID rewardPrefabOut, out int rewardAmountOut) { //IL_000c: 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_014c: 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) replyText = ""; rewardPrefabOut = new PrefabGUID(0); rewardAmountOut = 0; if (string.IsNullOrWhiteSpace(questId)) { replyText = "Quest " + label + ": not assigned today."; return false; } QuestDef questById_NoLock = GetQuestById_NoLock(questId); if (questById_NoLock == null) { replyText = "Quest " + label + ": not found in config."; return false; } int num = Math.Max(0, questById_NoLock.RequiredKills); if (num <= 0) { replyText = "Quest " + label + ": has invalid requiredKills."; return false; } if (progress < num) { replyText = "Quest " + label + ": not completed yet. Use .quest daily to check."; return false; } if (alreadyClaimed) { replyText = "Quest " + label + ": reward already claimed today."; return false; } if (!TryResolveRewardPrefab_NoLock(questById_NoLock, out var rewardPrefab, out var rewardName)) { replyText = "Reward prefab not configured correctly."; return false; } int num2 = Math.Max(0, questById_NoLock.Reward?.Amount ?? 0); if (num2 <= 0) { replyText = "Reward amount invalid."; return false; } rewardPrefabOut = rewardPrefab; rewardAmountOut = num2; replyText = $"Quest {label}: reward claimed {num2}x {rewardName}"; return true; } private static void SendQuestToast(User user, string label, string questName, int prog, int need, bool done) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: 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_0013: 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_0150: Unknown result type (might be due to invalid IL or missing references) if (!(user == default(User)) && user.IsConnected) { if (need < 0) { need = 0; } if (prog < 0) { prog = 0; } if (prog > need) { prog = need; } string value = (done ? $"{prog}/{need}, Claim: .quest reward" : $"{prog}/{need}, Details: .quest daily"); string text = $"Quest {label}: {questName} {value}"; FixedString512Bytes val = default(FixedString512Bytes); ((FixedString512Bytes)(ref val))..ctor(text); ServerChatUtils.SendSystemMessageToClient(Core.EntityManager, user, ref val); } } private static string GetRewardDisplay_NoLock(QuestDef quest) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (quest?.Reward == null) { return "None"; } string value = quest.Reward.Name ?? ""; int amount = quest.Reward.Amount; if (string.IsNullOrWhiteSpace(value)) { int prefab = quest.Reward.Prefab; if (prefab != 0) { try { value = ECSExtensions.LookupName(new PrefabGUID(prefab)); } catch { value = prefab.ToString(); } } else { value = "Unknown"; } } return $"{Math.Max(0, amount)}x {value}"; } private static string TodayString() { return _cachedTodayString; } public static bool IsQuestTarget(int prefabHash) { return _allActiveTargetPrefabs.Contains(prefabHash); } public static void Initialize() { lock (_lock) { EnsureInitialized_NoLock(); } } private static void EnsureInitialized_NoLock() { if (!_initialized) { EnsureFilesExist(); LoadConfig_NoLock(); LoadPlayers_NoLock(); SaveThrottle.Init(delegate { SavePlayers_NoLock(); }, TimeSpan.FromSeconds(10.0)); _lastDate = DateTime.Now.Date; _initialized = true; } } public static void Reload() { lock (_lock) { if (Plugin.PluginConfig != null) { Plugin.PluginConfig.Reload(); } EnsureFilesExist(); LoadConfig_NoLock(); _initialized = true; } Core.Log.LogInfo((object)"[Quest] DailyQuest.cfg and quest_config.json reloaded successfully"); } public static void EnsureAssignedForToday(ulong sid, string playerName, Entity characterEntity = default(Entity)) { //IL_01a8: Unknown result type (might be due to invalid IL or missing references) if (sid == 0) { return; } lock (_lock) { EnsureInitialized_NoLock(); RollDateIfNeeded_NoLock(); string text = TodayString(); string key = sid.ToString(); bool flag = false; if (!_players.TryGetValue(key, out var value) || value == null) { value = new PlayerQuestState { SteamId = sid, Name = (playerName ?? ""), Date = text, EasyQuestId = "", EasyProgress = 0, EasyClaimed = false, MediumQuestId = "", MediumProgress = 0, MediumClaimed = false, HardQuestId = "", HardProgress = 0, HardClaimed = false }; flag = true; } else { string text2 = playerName ?? value.Name ?? ""; if (!string.Equals(value.Name, text2, StringComparison.Ordinal)) { value.Name = text2; flag = true; } } if (!string.Equals(value.Date, text, StringComparison.Ordinal)) { value.Date = text; value.EasyQuestId = ""; value.EasyProgress = 0; value.EasyClaimed = false; value.MediumQuestId = ""; value.MediumProgress = 0; value.MediumClaimed = false; value.HardQuestId = ""; value.HardProgress = 0; value.HardClaimed = false; flag = true; if (Helper.TryRemoveDailyQuestBuff(characterEntity, value)) { flag = true; } } if (string.IsNullOrWhiteSpace(value.EasyQuestId)) { value.EasyQuestId = PickQuestId_NoLock(sid, text, "easy", _easyQuests); value.EasyProgress = 0; value.EasyClaimed = false; flag = true; } if (string.IsNullOrWhiteSpace(value.MediumQuestId)) { value.MediumQuestId = PickQuestId_NoLock(sid, text, "medium", _mediumQuests); value.MediumProgress = 0; value.MediumClaimed = false; flag = true; } if (string.IsNullOrWhiteSpace(value.HardQuestId)) { value.HardQuestId = PickQuestId_NoLock(sid, text, "hard", _hardQuests); value.HardProgress = 0; value.HardClaimed = false; flag = true; } if (flag) { _players[key] = value; SaveThrottle.MarkDirty(); } } } public static bool TryClaim(ChatCommandContext ctx, ulong sid, string playerName, Entity characterEntity) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_007d: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0394: 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_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) EnsureAssignedForToday(sid, playerName); lock (_lock) { string key = sid.ToString(); if (!_players.TryGetValue(key, out var value) || value == null) { ctx.Reply("No quest data."); return false; } Entity senderUserEntity = ctx.Event.SenderUserEntity; bool flag = false; List list = new List(3); List<(PrefabGUID, int)> list2 = new List<(PrefabGUID, int)>(); if (TryClaimOne_NoLock(senderUserEntity, characterEntity, "1", value.EasyQuestId, value.EasyProgress, value.EasyClaimed, out var replyText, out var rewardPrefabOut, out var rewardAmountOut)) { value.EasyClaimed = true; flag = true; list2.Add((rewardPrefabOut, rewardAmountOut)); if (Plugin.GearRepairOnClaimEnabled != null && Plugin.GearRepairOnClaimEnabled.Value) { Helper.RepairAmulet(characterEntity); } QuestDef questById_NoLock = GetQuestById_NoLock(value.EasyQuestId); int value2 = Math.Max(0, questById_NoLock?.RequiredKills ?? 0); list.Add((questById_NoLock != null) ? $"{questById_NoLock.Name} x{value2}" : "Quest 1"); } if (TryClaimOne_NoLock(senderUserEntity, characterEntity, "2", value.MediumQuestId, value.MediumProgress, value.MediumClaimed, out var replyText2, out var rewardPrefabOut2, out var rewardAmountOut2)) { value.MediumClaimed = true; flag = true; list2.Add((rewardPrefabOut2, rewardAmountOut2)); if (Plugin.GearRepairOnClaimEnabled != null && Plugin.GearRepairOnClaimEnabled.Value) { Helper.RepairArmor(characterEntity); } QuestDef questById_NoLock2 = GetQuestById_NoLock(value.MediumQuestId); int value3 = Math.Max(0, questById_NoLock2?.RequiredKills ?? 0); list.Add((questById_NoLock2 != null) ? $"{questById_NoLock2.Name} x{value3}" : "Quest 2"); } if (TryClaimOne_NoLock(senderUserEntity, characterEntity, "3", value.HardQuestId, value.HardProgress, value.HardClaimed, out var replyText3, out var rewardPrefabOut3, out var rewardAmountOut3)) { value.HardClaimed = true; flag = true; list2.Add((rewardPrefabOut3, rewardAmountOut3)); if (Plugin.GearRepairOnClaimEnabled != null && Plugin.GearRepairOnClaimEnabled.Value) { Helper.RepairWeapon(characterEntity); } QuestDef questById_NoLock3 = GetQuestById_NoLock(value.HardQuestId); int value4 = Math.Max(0, questById_NoLock3?.RequiredKills ?? 0); list.Add((questById_NoLock3 != null) ? $"{questById_NoLock3.Name} x{value4}" : "Quest 3"); } string text = "Daily Quests (Reset in " + GetNextResetText() + ")\n" + replyText + "\n" + replyText2 + "\n" + replyText3; if (!flag) { ctx.Reply(text); return false; } foreach (var item in list2) { Helper.AddItemToInventory(characterEntity, item.Item1, item.Item2); } Helper.TrySendBroadcastMessage(playerName, list); Helper.TrySendWebhookMessage(playerName, list); Helper.TryAddDailyQuestBuff(senderUserEntity, characterEntity, value); _players[key] = value; SaveThrottle.ForceSave(); ctx.Reply(text); return true; } } public static void OnKilledPrefab(ulong sid, int diedPrefabGuidHash, User user, string playerNameForEnsure = "", Entity characterEntity = default(Entity)) { //IL_0016: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) if (sid == 0L || diedPrefabGuidHash == 0) { return; } EnsureAssignedForToday(sid, playerNameForEnsure, characterEntity); lock (_lock) { string key = sid.ToString(); if (!_players.TryGetValue(key, out var value) || value == null) { return; } bool flag = false; QuestDef questById_NoLock = GetQuestById_NoLock(value.EasyQuestId); if (questById_NoLock != null && questById_NoLock.TargetPrefabs != null && questById_NoLock.TargetPrefabs.Length != 0 && questById_NoLock.TargetPrefabs.Contains(diedPrefabGuidHash)) { int num = Math.Max(0, questById_NoLock.RequiredKills); if (num > 0 && value.EasyProgress < num) { value.EasyProgress++; if (value.EasyProgress > num) { value.EasyProgress = num; } flag = true; SendQuestToast(user, "1", questById_NoLock.Name, value.EasyProgress, num, value.EasyProgress >= num); } } QuestDef questById_NoLock2 = GetQuestById_NoLock(value.MediumQuestId); if (questById_NoLock2 != null && questById_NoLock2.TargetPrefabs != null && questById_NoLock2.TargetPrefabs.Length != 0 && questById_NoLock2.TargetPrefabs.Contains(diedPrefabGuidHash)) { int num2 = Math.Max(0, questById_NoLock2.RequiredKills); if (num2 > 0 && value.MediumProgress < num2) { value.MediumProgress++; if (value.MediumProgress > num2) { value.MediumProgress = num2; } flag = true; SendQuestToast(user, "2", questById_NoLock2.Name, value.MediumProgress, num2, value.MediumProgress >= num2); } } QuestDef questById_NoLock3 = GetQuestById_NoLock(value.HardQuestId); if (questById_NoLock3 != null && questById_NoLock3.TargetPrefabs != null && questById_NoLock3.TargetPrefabs.Length != 0 && questById_NoLock3.TargetPrefabs.Contains(diedPrefabGuidHash)) { int num3 = Math.Max(0, questById_NoLock3.RequiredKills); if (num3 > 0 && value.HardProgress < num3) { value.HardProgress++; if (value.HardProgress > num3) { value.HardProgress = num3; } flag = true; SendQuestToast(user, "3", questById_NoLock3.Name, value.HardProgress, num3, value.HardProgress >= num3); } } if (flag) { _players[key] = value; SaveThrottle.MarkDirty(); } } } private static void RollDateIfNeeded_NoLock() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown DateTime date = DateTime.Now.Date; if (!(date == _lastDate)) { _lastDate = date; _cachedTodayString = _lastDate.ToString("yyyy-MM-dd"); ManualLogSource log = Core.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[Quest] New day detected: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(_lastDate, "yyyy-MM-dd"); } log.LogInfo(val); } } private static string GetNextResetText() { DateTime now = DateTime.Now; DateTime dateTime = now.Date.AddDays(1.0); TimeSpan timeSpan = dateTime - now; if (timeSpan < TimeSpan.Zero) { timeSpan = TimeSpan.Zero; } int value = (int)timeSpan.TotalHours; return $"{value:00}:{timeSpan.Minutes:00}:{timeSpan.Seconds:00}"; } private static QuestDef GetQuestById_NoLock(string id) { if (string.IsNullOrWhiteSpace(id)) { return null; } if (_questsById.TryGetValue(id, out var value)) { return value; } return _config?.Quests?.FirstOrDefault((QuestDef x) => x != null && string.Equals(x.Id, id, StringComparison.Ordinal)); } private static string PickQuestId_NoLock(ulong sid, string date, string difficulty, List pool) { if (pool == null || pool.Count == 0) { return ""; } int seed = HashCode.Combine(sid, date, difficulty); Random random = new Random(seed); return pool[random.Next(pool.Count)]?.Id ?? ""; } private static bool TryResolveRewardPrefab_NoLock(QuestDef quest, out PrefabGUID rewardPrefab, out string rewardName) { //IL_0003: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) rewardPrefab = new PrefabGUID(0); rewardName = "Reward"; if (quest?.Reward == null) { return false; } int prefab = quest.Reward.Prefab; if (prefab == 0) { return false; } rewardPrefab = new PrefabGUID(prefab); rewardName = quest.Reward.Name; if (string.IsNullOrWhiteSpace(rewardName)) { try { rewardName = rewardPrefab.LookupName(); } catch { rewardName = prefab.ToString(); } } return true; } public static void AdminRemoveBuff(ChatCommandContext ctx, string targetPlayerName) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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_00be: 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_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) lock (_lock) { EnsureInitialized_NoLock(); PlayerQuestState playerQuestState = _players.Values.FirstOrDefault((PlayerQuestState x) => x != null && string.Equals(x.Name, targetPlayerName, StringComparison.OrdinalIgnoreCase)); if (playerQuestState == null) { ctx.Reply("Player " + targetPlayerName + " not found in quest data."); return; } Entity val = Entity.Null; NativeArray entitiesByComponentType = Helper.GetEntitiesByComponentType(); try { Enumerator enumerator = entitiesByComponentType.GetEnumerator(); while (enumerator.MoveNext()) { Entity current = enumerator.Current; User val2 = current.Read(); if (val2.PlatformId == playerQuestState.SteamId) { val = val2.LocalCharacter._Entity; break; } } } finally { if (entitiesByComponentType.IsCreated) { entitiesByComponentType.Dispose(); } } if (val == Entity.Null) { ctx.Reply("Could not find physical character for " + playerQuestState.Name + "."); } else if (playerQuestState.ClaimedBuffPrefab == 0) { int num = Plugin.ClaimedBuffPrefab?.Value ?? 0; if (num != 0) { Buffs.RemoveBuff(val, new PrefabGUID(num)); ctx.Reply("Force removed config buff from " + playerQuestState.Name + "."); } else { ctx.Reply("Player " + playerQuestState.Name + " has no active buff history."); } } else if (Helper.TryRemoveDailyQuestBuff(val, playerQuestState)) { string key = playerQuestState.SteamId.ToString(); _players[key] = playerQuestState; SaveThrottle.ForceSave(); ctx.Reply("Successfully removed daily quest buff from " + playerQuestState.Name + "."); } else { ctx.Reply("Failed to remove buff from " + playerQuestState.Name + "."); } } } public static void EnsureFilesExist() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown try { Directory.CreateDirectory(CONFIG_DIR); bool flag = default(bool); if (!File.Exists(CONFIG_FILE)) { File.WriteAllText(CONFIG_FILE, "[\n {\n \"ID\": \"1_1\",\n \"Name\": \"kill Wolves\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1418430647,\n -1554428547,\n -578677530,\n 134039094,\n -218175217,\n 572729167,\n 616274140\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_2\",\n \"Name\": \"kill Deer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1897056612,\n -575831311,\n 1780171587\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_3\",\n \"Name\": \"kill Moose\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -831097925,\n 2097040330,\n -779632831,\n 1570140219\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_4\",\n \"Name\": \"kill Crows\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -221278041,\n 1239832946,\n -2002658567,\n 1029047051\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_5\",\n \"Name\": \"kill Sheep\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 947731555,\n 1635167941,\n 1012307512\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_6\",\n \"Name\": \"kill Cow\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 721166952\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_7\",\n \"Name\": \"kill Flying Skull\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -236166535\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_8\",\n \"Name\": \"kill Undead Assassin\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1365627158\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_9\",\n \"Name\": \"kill Horses\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1149585723,\n -1502865710\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_10\",\n \"Name\": \"kill Bears\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1043643344,\n -1391546313,\n 2041915372,\n -559819989,\n 1938756250,\n -1697944553\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_11\",\n \"Name\": \"kill Pigs\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1356006948,\n 1420480270\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_12\",\n \"Name\": \"kill Treant\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1089337069\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_13\",\n \"Name\": \"kill Stone Golems / Elementals\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -779411607,\n 20817667\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_14\",\n \"Name\": \"kill Iron Golem\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 763796308\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_15\",\n \"Name\": \"kill Scarecrow\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1750347680\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_16\",\n \"Name\": \"kill Mutant Spitter\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1092792896\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_17\",\n \"Name\": \"kill Rathorror\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -375581934\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_18\",\n \"Name\": \"kill Abomination\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 823276204\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_19\",\n \"Name\": \"kill Spiders\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1078424589,\n -764515001,\n 2103131615,\n 2136899683,\n 342127250,\n -548489519\n ],\n \"RequiredKills\": 40,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_20\",\n \"Name\": \"kill Mosquito\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -744966291\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_21\",\n \"Name\": \"kill Night Lurker\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -2046268156\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_22\",\n \"Name\": \"kill Ghost Crossbowman\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -85729652\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_23\",\n \"Name\": \"kill Ghost Warrior\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1618703048\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_24\",\n \"Name\": \"kill Banshee\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1146194149\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_25\",\n \"Name\": \"kill Ghost Guardian\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -458883491\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_26\",\n \"Name\": \"kill Ghost Assassin\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 849891426\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_27\",\n \"Name\": \"kill Worm Terror\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 658578725\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_28\",\n \"Name\": \"kill Sister\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1772642154\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_29\",\n \"Name\": \"kill Dunley Villagers\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1887807944,\n 525027204\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_30\",\n \"Name\": \"kill Bell Ringer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1670130821\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_31\",\n \"Name\": \"kill Hound\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -249647316\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_32\",\n \"Name\": \"kill Nun\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -700632469\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_33\",\n \"Name\": \"kill Militia Archer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 203103783\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_34\",\n \"Name\": \"kill Militia Veteran\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 2005508157\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_35\",\n \"Name\": \"kill Pyro\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -322293503\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_36\",\n \"Name\": \"kill Technician\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 820492683\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_37\",\n \"Name\": \"kill Tractor Beamer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -293507834\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_38\",\n \"Name\": \"kill Railgunner\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1732477970\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_39\",\n \"Name\": \"kill Sentry Officer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1401026468\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"2_1\",\n \"Name\": \"kill Werewolf\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -951976780\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_2\",\n \"Name\": \"kill Witch\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -56441915\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_3\",\n \"Name\": \"kill Corrupted Mantraps\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1527640414,\n 1906792990,\n -1915060856,\n 358623979,\n 2107764370\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_4\",\n \"Name\": \"Cut down Corrupt Trees\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1378837905,\n 861604950,\n 735695679\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_5\",\n \"Name\": \"kill Corrupted Treants\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1496810447,\n 358623979,\n 2107764370\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_6\",\n \"Name\": \"kill Driller\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 709450349\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_7\",\n \"Name\": \"kill Lightning Protector\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1655577903\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_8\",\n \"Name\": \"kill Gattler\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -884401089\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_9\",\n \"Name\": \"kill Zapper\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -2018710724\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_10\",\n \"Name\": \"kill Gloomrot Villagers\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1216169364,\n -732208863\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_11\",\n \"Name\": \"kill Silverlight Villagers\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1224027101,\n -2025921616\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_12\",\n \"Name\": \"kill Devoted\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1660801216\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_13\",\n \"Name\": \"kill Slave Masters\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 891705701,\n -240536861\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_14\",\n \"Name\": \"kill Footman\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 2128996433\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_15\",\n \"Name\": \"kill Rifleman\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1148936156\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_16\",\n \"Name\": \"kill Cleric\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1464869978\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_17\",\n \"Name\": \"kill Knights\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -930333806,\n 794228023\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_18\",\n \"Name\": \"kill Paladin\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1728773109\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_19\",\n \"Name\": \"kill Lightweaver\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1185952775\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_20\",\n \"Name\": \"kill Priest\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1406393857\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_21\",\n \"Name\": \"kill Cardinal Aide\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1745498602\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_22\",\n \"Name\": \"kill Sanguinary Guards\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1144208724,\n -669027288\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_23\",\n \"Name\": \"kill Exsanguinator\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1076780215\n ],\n \"RequiredKills\": 28,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_24\",\n \"Name\": \"kill Nightmares\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -981051151,\n -1009917656\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_25\",\n \"Name\": \"kill Blood Prophets\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -2080231735,\n 1912966420\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_26\",\n \"Name\": \"kill Dreadhorns\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1140588645,\n 981369753\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_27\",\n \"Name\": \"kill Dark Temptresses\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 2111003460,\n -494298686\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_28\",\n \"Name\": \"kill Slaughterbeasts\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 2049379982,\n -653348998\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_29\",\n \"Name\": \"kill Gargoyles\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -65981941,\n -392776091,\n 280858720\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_30\",\n \"Name\": \"kill DartFlinger\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1209580976\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_31\",\n \"Name\": \"kill Lurker\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1733829912\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_32\",\n \"Name\": \"kill Alchemist\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 326501064\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_33\",\n \"Name\": \"kill Dreadcleaver\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1864177126\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_34\",\n \"Name\": \"kill Viper\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -436956599\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_35\",\n \"Name\": \"kill Sentinel\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1531777139\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_36\",\n \"Name\": \"kill Striker\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 761646020\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"3_1\",\n \"Name\": \"kill Dracula\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -327335305\n ],\n \"RequiredKills\": 3,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_2\",\n \"Name\": \"kill Megara\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 591725925\n ],\n \"RequiredKills\": 3,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_3\",\n \"Name\": \"kill Adam\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1233988687\n ],\n \"RequiredKills\": 3,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_4\",\n \"Name\": \"kill Solarus\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -740796338\n ],\n \"RequiredKills\": 4,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_5\",\n \"Name\": \"kill Talzur\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -393555055\n ],\n \"RequiredKills\": 4,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_6\",\n \"Name\": \"kill General Valencia\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 495971434\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_7\",\n \"Name\": \"kill Lord Styx\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1112948824\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_8\",\n \"Name\": \"kill Gorecrusher\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1936575244\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_9\",\n \"Name\": \"kill Dantos\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 173259239\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_10\",\n \"Name\": \"kill Simon Belmont\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 336560131\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_11\",\n \"Name\": \"kill Azariel\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 114912615\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_12\",\n \"Name\": \"kill Voltatia\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 2054432370\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_13\",\n \"Name\": \"kill Lucile\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1295855316\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_14\",\n \"Name\": \"kill Terrorclaw\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1347412392\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_15\",\n \"Name\": \"kill Matka\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -910296704\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_16\",\n \"Name\": \"kill Stavros\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1669199769\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_17\",\n \"Name\": \"kill Jakira\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1383529374\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_18\",\n \"Name\": \"kill Henry Blackbrew\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 814083983\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_19\",\n \"Name\": \"kill Mairwyn\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -2013903325\n ],\n \"RequiredKills\": 7,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_20\",\n \"Name\": \"kill Morian\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 685266977\n ],\n \"RequiredKills\": 7,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_21\",\n \"Name\": \"kill Baron du Bouchon\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 192051202\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_22\",\n \"Name\": \"kill Sir Magnus\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -26105228\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_23\",\n \"Name\": \"kill Cyril\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 326378955\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_24\",\n \"Name\": \"kill Willfred\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1505705712\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_25\",\n \"Name\": \"kill Albert\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -203043163\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_26\",\n \"Name\": \"kill Foulrot\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1208888966\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_27\",\n \"Name\": \"kill Ben\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 109969450\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_28\",\n \"Name\": \"kill Ungora\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -548489519\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_29\",\n \"Name\": \"kill Angram\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 106480588\n ],\n \"RequiredKills\": 9,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_30\",\n \"Name\": \"kill Domina\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1101874342\n ],\n \"RequiredKills\": 9,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_31\",\n \"Name\": \"kill Ziva\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 172235178\n ],\n \"RequiredKills\": 9,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_32\",\n \"Name\": \"kill Octavian\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1688478381\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_33\",\n \"Name\": \"kill General Cassius\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -496360395\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_34\",\n \"Name\": \"kill Raziel\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -680831417\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_35\",\n \"Name\": \"kill Jade\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1968372384\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_36\",\n \"Name\": \"kill Gaius\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -753453016\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_37\",\n \"Name\": \"kill General Elena\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 795262842\n ],\n \"RequiredKills\": 11,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_38\",\n \"Name\": \"kill Frostmaw\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 24378719\n ],\n \"RequiredKills\": 11,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_39\",\n \"Name\": \"kill Terah\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1065970933\n ],\n \"RequiredKills\": 11,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_40\",\n \"Name\": \"kill Primal Blood Souls\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -440174408,\n -427888732,\n 1990744594,\n -943858353,\n -1805216630,\n -982850914,\n -1189707552,\n 282791819,\n -1160778038,\n 468179469,\n 2079933370,\n 666177656\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_41\",\n \"Name\": \"kill Lesser Blood Souls\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1854211210,\n 17609984,\n -1420322422,\n 478580792,\n 1318855899,\n 1494126678,\n -1381375644,\n -1822337177,\n -989493184,\n 2009018555\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n }\n ]"); ManualLogSource log = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(24, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[Quest] Created config: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(CONFIG_FILE); } log.LogInfo(val); } if (!File.Exists(PLAYER_FILE)) { File.WriteAllText(PLAYER_FILE, "{}"); ManualLogSource log2 = Core.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[Quest] Created player data: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(PLAYER_FILE); } log2.LogInfo(val); } } catch (Exception e) { Core.LogException(e, "EnsureFilesExist"); } } private static void RebuildQuestIndex_NoLock() { _questsById = new Dictionary(StringComparer.Ordinal); _allQuests = new List(); _easyQuests = new List(); _mediumQuests = new List(); _hardQuests = new List(); _allActiveTargetPrefabs = new HashSet(); if (_config?.Quests == null) { return; } foreach (QuestDef quest in _config.Quests) { if (quest == null) { continue; } if (!string.IsNullOrWhiteSpace(quest.Id)) { _questsById[quest.Id] = quest; } _allQuests.Add(quest); if (quest.TargetPrefabs != null) { int[] targetPrefabs = quest.TargetPrefabs; foreach (int item in targetPrefabs) { _allActiveTargetPrefabs.Add(item); } } string text = (quest.Difficulty ?? "easy").Trim().ToLowerInvariant(); if (text == "hard") { _hardQuests.Add(quest); } else if (text == "medium") { _mediumQuests.Add(quest); } else { _easyQuests.Add(quest); } } } private static void LoadConfig_NoLock() { try { string json = File.ReadAllText(CONFIG_FILE); List list = JsonSerializer.Deserialize>(json, JsonOpts); _config = new QuestConfig { Quests = (list ?? new List()) }; RebuildQuestIndex_NoLock(); } catch (Exception e) { Core.LogException(e, "LoadConfig_NoLock"); _config = new QuestConfig(); RebuildQuestIndex_NoLock(); } } private static void LoadPlayers_NoLock() { try { if (!File.Exists(PLAYER_FILE)) { _players = new Dictionary(); return; } string text = File.ReadAllText(PLAYER_FILE); if (string.IsNullOrWhiteSpace(text)) { _players = new Dictionary(); } else { _players = JsonSerializer.Deserialize>(text, JsonOpts) ?? new Dictionary(); } } catch (Exception e) { Core.LogException(e, "LoadPlayers_NoLock"); _players = new Dictionary(); } } private static void SavePlayers_NoLock() { try { Directory.CreateDirectory(CONFIG_DIR); byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(_players, JsonOpts); File.WriteAllBytes(PLAYER_FILE, bytes); } catch (Exception e) { Core.LogException(e, "SavePlayers_NoLock"); } } } internal static class SaveThrottle { private static readonly object _lock = new object(); private static bool _dirty; private static DateTime _nextSaveUtc = DateTime.MinValue; private static TimeSpan _interval = TimeSpan.FromSeconds(10.0); private static Action _saveAction; private static bool _initialized; private static CancellationTokenSource _cts; public static void Init(Action saveAction, TimeSpan? interval = null) { if (saveAction == null) { throw new ArgumentNullException("saveAction"); } lock (_lock) { if (_initialized) { return; } _saveAction = saveAction; if (interval.HasValue) { _interval = interval.Value; } _initialized = true; _cts = new CancellationTokenSource(); } CancellationToken token = _cts.Token; Task.Run(async delegate { bool flag = default(bool); while (!token.IsCancellationRequested) { try { await Task.Delay(1000, token); Tick(); } catch (TaskCanceledException) { break; } catch (Exception e) { ManualLogSource log = Core.Log; BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[SaveThrottle] Driver Error: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(e.Message); } log.LogError(val); } } }, token); } public static void MarkDirty() { lock (_lock) { if (_initialized && _saveAction != null) { _dirty = true; if (_nextSaveUtc == DateTime.MinValue) { _nextSaveUtc = DateTime.UtcNow.Add(_interval); } } } } private static void Tick() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown Action action = null; lock (_lock) { if (!_initialized || _saveAction == null || !_dirty || _nextSaveUtc == DateTime.MinValue || DateTime.UtcNow < _nextSaveUtc) { return; } _dirty = false; _nextSaveUtc = DateTime.MinValue; action = _saveAction; } try { action(); } catch (Exception ex) { ManualLogSource log = Core.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(28, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[SaveThrottle] Save failed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted(ex.Message); } log.LogError(val); lock (_lock) { _dirty = true; if (_nextSaveUtc == DateTime.MinValue) { _nextSaveUtc = DateTime.UtcNow.AddSeconds(2.0); } } } } public static void ForceSave() { Action saveAction; lock (_lock) { if (!_initialized || _saveAction == null) { return; } _dirty = false; _nextSaveUtc = DateTime.MinValue; saveAction = _saveAction; } saveAction(); } public static void Stop() { lock (_lock) { if (_initialized) { ForceSave(); _cts?.Cancel(); _cts?.Dispose(); _initialized = false; } } } } internal static class WebhookService { private const int TimeoutSeconds = 10; private static readonly HttpClient _http = new HttpClient(); public static bool IsEnabled => Plugin.WebhookEnabled?.Value ?? false; public static bool IsConfigured() { return !string.IsNullOrWhiteSpace(Plugin.WebhookUrl?.Value); } public static async Task<(bool ok, string error)> SendAsync(string message, CancellationToken ct = default(CancellationToken)) { try { if (!IsEnabled) { return (false, "Webhook is disabled."); } string url = Plugin.WebhookUrl.Value; if (string.IsNullOrWhiteSpace(url)) { return (false, "Webhook URL is empty."); } message = (message ?? "").Trim(); if (message.Length == 0) { return (false, "Message is empty."); } if (message.Length > 1990) { message = message.Substring(0, 1990) + "..."; } var payload = new { content = message, allowed_mentions = new { parse = Array.Empty() } }; using CancellationTokenSource linkedCts = CancellationTokenSource.CreateLinkedTokenSource(ct); linkedCts.CancelAfter(TimeSpan.FromSeconds(10.0)); string body = JsonSerializer.Serialize(payload); using StringContent content = new StringContent(body, Encoding.UTF8, "application/json"); using HttpResponseMessage response = await _http.PostAsync(url, content, linkedCts.Token).ConfigureAwait(continueOnCapturedContext: false); if (!response.IsSuccessStatusCode) { string responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(continueOnCapturedContext: false); return (false, $"Discord returned {response.StatusCode} {response.ReasonPhrase}: {responseText}"); } return (true, null); } catch (Exception ex) { Exception e = ex; Core.LogException(e, "SendAsync"); return (false, e.Message); } } } } namespace DailyQuest.Patches { [HarmonyPatch(typeof(DeathEventListenerSystem), "OnUpdate")] internal static class QuestKillHookDeathEventListenerSystem { private static bool TryResolvePlayerFromKiller(Entity killer, EntityManager em, out Entity playerChar, out Entity userEnt, out ulong sid) { //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_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_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_002b: 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_0043: 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_004d: 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_0074: 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_0082: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_009e: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_010e: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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) playerChar = Entity.Null; userEnt = Entity.Null; sid = 0uL; if (killer == Entity.Null || !((EntityManager)(ref em)).Exists(killer)) { return false; } Entity val = killer; for (int i = 0; i < 12; i++) { if (val == Entity.Null || !((EntityManager)(ref em)).Exists(val)) { return false; } if (val.Has()) { playerChar = val; PlayerCharacter val2 = val.Read(); userEnt = val2.UserEntity; if (userEnt != Entity.Null && ((EntityManager)(ref em)).Exists(userEnt) && userEnt.Has()) { sid = userEnt.Read().PlatformId; return sid != 0; } return false; } if (val.Has()) { Entity owner = val.Read().Owner; if (owner == Entity.Null || owner == val) { return false; } val = owner; continue; } return false; } return false; } [HarmonyPrefix] private static void Prefix(DeathEventListenerSystem __instance) { //IL_0003: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0031: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0073: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00d5: 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_00dc: 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_00fb: Unknown result type (might be due to invalid IL or missing references) try { EntityManager entityManager = ((ComponentSystemBase)__instance).EntityManager; EntityQuery deathEventQuery = __instance._DeathEventQuery; NativeArray val = ((EntityQuery)(ref deathEventQuery)).ToComponentDataArray(AllocatorHandle.op_Implicit((Allocator)2)); try { for (int i = 0; i < val.Length; i++) { DeathEvent val2 = val[i]; Entity died = val2.Died; if (!(died == Entity.Null) && ((SystemBase)__instance).Exists(died) && !died.Has()) { PrefabGUID prefabGUID = Helper.GetPrefabGUID(died); if (((PrefabGUID)(ref prefabGUID)).GuidHash != 0 && QuestService.IsQuestTarget(((PrefabGUID)(ref prefabGUID)).GuidHash) && TryResolvePlayerFromKiller(val2.Killer, entityManager, out var playerChar, out var userEnt, out var sid) && userEnt.Has()) { User user = userEnt.Read(); QuestService.OnKilledPrefab(sid, ((PrefabGUID)(ref prefabGUID)).GuidHash, user, ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString(), playerChar); } } } } finally { if (val.IsCreated) { val.Dispose(); } } } catch (Exception e) { Core.LogException(e, "Prefix"); } } } [HarmonyPatch(typeof(SceneSectionStreamingSystem), "ShutdownAsynchrnonousStreamingSupport")] public static class ServerStartupHook { [HarmonyPostfix] public static void Postfix() { Core.InitializeAfterLoaded(); Core.Log.LogInfo((object)"[Quest] DailyQuest initialized."); Harmony harmony = Plugin.Harmony; if (harmony != null) { harmony.Unpatch((MethodBase)typeof(SceneSectionStreamingSystem).GetMethod("ShutdownAsynchrnonousStreamingSupport"), typeof(ServerStartupHook).GetMethod("Postfix")); } } } } namespace DailyQuest.Models { internal sealed class QuestConfig { [JsonPropertyName("GearRepairOnClaim")] public bool RepairOnClaim { get; set; } = false; [JsonPropertyName("Quests")] public List Quests { get; set; } = new List(); } internal sealed class QuestDef { [JsonPropertyName("ID")] public string Id { get; set; } [JsonPropertyName("Name")] public string Name { get; set; } [JsonPropertyName("Difficulty")] public string Difficulty { get; set; } = "easy"; [JsonPropertyName("TargetPrefabs")] public int[] TargetPrefabs { get; set; } = Array.Empty(); [JsonPropertyName("RequiredKills")] public int RequiredKills { get; set; } [JsonPropertyName("Reward")] public RewardDef Reward { get; set; } } internal sealed class RewardDef { [JsonPropertyName("Prefab")] public int Prefab { get; set; } [JsonPropertyName("Name")] public string Name { get; set; } [JsonPropertyName("Amount")] public int Amount { get; set; } } internal sealed class PlayerQuestState { [JsonPropertyName("SteamID")] public ulong SteamId { get; set; } [JsonPropertyName("Name")] public string Name { get; set; } [JsonPropertyName("Date")] public string Date { get; set; } [JsonPropertyName("EasyQuestId")] public string EasyQuestId { get; set; } [JsonPropertyName("EasyProgress")] public int EasyProgress { get; set; } [JsonPropertyName("EasyClaimed")] public bool EasyClaimed { get; set; } [JsonPropertyName("MediumQuestId")] public string MediumQuestId { get; set; } [JsonPropertyName("MediumProgress")] public int MediumProgress { get; set; } [JsonPropertyName("MediumClaimed")] public bool MediumClaimed { get; set; } [JsonPropertyName("HardQuestId")] public string HardQuestId { get; set; } [JsonPropertyName("HardProgress")] public int HardProgress { get; set; } [JsonPropertyName("HardClaimed")] public bool HardClaimed { get; set; } [JsonPropertyName("ClaimedBuffPrefab")] public int ClaimedBuffPrefab { get; set; } } } namespace DailyQuest.Config { internal static class DefaultQuestConfig { public const string QuestConfigJson = "[\n {\n \"ID\": \"1_1\",\n \"Name\": \"kill Wolves\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1418430647,\n -1554428547,\n -578677530,\n 134039094,\n -218175217,\n 572729167,\n 616274140\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_2\",\n \"Name\": \"kill Deer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1897056612,\n -575831311,\n 1780171587\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_3\",\n \"Name\": \"kill Moose\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -831097925,\n 2097040330,\n -779632831,\n 1570140219\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_4\",\n \"Name\": \"kill Crows\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -221278041,\n 1239832946,\n -2002658567,\n 1029047051\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_5\",\n \"Name\": \"kill Sheep\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 947731555,\n 1635167941,\n 1012307512\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_6\",\n \"Name\": \"kill Cow\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 721166952\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_7\",\n \"Name\": \"kill Flying Skull\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -236166535\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_8\",\n \"Name\": \"kill Undead Assassin\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1365627158\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_9\",\n \"Name\": \"kill Horses\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1149585723,\n -1502865710\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_10\",\n \"Name\": \"kill Bears\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1043643344,\n -1391546313,\n 2041915372,\n -559819989,\n 1938756250,\n -1697944553\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_11\",\n \"Name\": \"kill Pigs\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1356006948,\n 1420480270\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_12\",\n \"Name\": \"kill Treant\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1089337069\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_13\",\n \"Name\": \"kill Stone Golems / Elementals\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -779411607,\n 20817667\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_14\",\n \"Name\": \"kill Iron Golem\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 763796308\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_15\",\n \"Name\": \"kill Scarecrow\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1750347680\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_16\",\n \"Name\": \"kill Mutant Spitter\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1092792896\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_17\",\n \"Name\": \"kill Rathorror\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -375581934\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_18\",\n \"Name\": \"kill Abomination\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 823276204\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_19\",\n \"Name\": \"kill Spiders\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1078424589,\n -764515001,\n 2103131615,\n 2136899683,\n 342127250,\n -548489519\n ],\n \"RequiredKills\": 40,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_20\",\n \"Name\": \"kill Mosquito\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -744966291\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_21\",\n \"Name\": \"kill Night Lurker\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -2046268156\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_22\",\n \"Name\": \"kill Ghost Crossbowman\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -85729652\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_23\",\n \"Name\": \"kill Ghost Warrior\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1618703048\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_24\",\n \"Name\": \"kill Banshee\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1146194149\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_25\",\n \"Name\": \"kill Ghost Guardian\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -458883491\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_26\",\n \"Name\": \"kill Ghost Assassin\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 849891426\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_27\",\n \"Name\": \"kill Worm Terror\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 658578725\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_28\",\n \"Name\": \"kill Sister\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1772642154\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_29\",\n \"Name\": \"kill Dunley Villagers\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1887807944,\n 525027204\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_30\",\n \"Name\": \"kill Bell Ringer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -1670130821\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_31\",\n \"Name\": \"kill Hound\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -249647316\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_32\",\n \"Name\": \"kill Nun\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -700632469\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_33\",\n \"Name\": \"kill Militia Archer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 203103783\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_34\",\n \"Name\": \"kill Militia Veteran\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 2005508157\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_35\",\n \"Name\": \"kill Pyro\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -322293503\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_36\",\n \"Name\": \"kill Technician\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 820492683\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_37\",\n \"Name\": \"kill Tractor Beamer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n -293507834\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_38\",\n \"Name\": \"kill Railgunner\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1732477970\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"1_39\",\n \"Name\": \"kill Sentry Officer\",\n \"Difficulty\": \"easy\",\n \"TargetPrefabs\": [\n 1401026468\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 2103989354,\n \"Name\": \"Stygian Shards\",\n \"Amount\": 1200\n }\n },\n {\n \"ID\": \"2_1\",\n \"Name\": \"kill Werewolf\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -951976780\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_2\",\n \"Name\": \"kill Witch\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -56441915\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_3\",\n \"Name\": \"kill Corrupted Mantraps\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1527640414,\n 1906792990,\n -1915060856,\n 358623979,\n 2107764370\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_4\",\n \"Name\": \"Cut down Corrupt Trees\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1378837905,\n 861604950,\n 735695679\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_5\",\n \"Name\": \"kill Corrupted Treants\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1496810447,\n 358623979,\n 2107764370\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_6\",\n \"Name\": \"kill Driller\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 709450349\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_7\",\n \"Name\": \"kill Lightning Protector\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1655577903\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_8\",\n \"Name\": \"kill Gattler\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -884401089\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_9\",\n \"Name\": \"kill Zapper\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -2018710724\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_10\",\n \"Name\": \"kill Gloomrot Villagers\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1216169364,\n -732208863\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_11\",\n \"Name\": \"kill Silverlight Villagers\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1224027101,\n -2025921616\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_12\",\n \"Name\": \"kill Devoted\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1660801216\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_13\",\n \"Name\": \"kill Slave Masters\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 891705701,\n -240536861\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_14\",\n \"Name\": \"kill Footman\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 2128996433\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_15\",\n \"Name\": \"kill Rifleman\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1148936156\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_16\",\n \"Name\": \"kill Cleric\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1464869978\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_17\",\n \"Name\": \"kill Knights\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -930333806,\n 794228023\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_18\",\n \"Name\": \"kill Paladin\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1728773109\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_19\",\n \"Name\": \"kill Lightweaver\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1185952775\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_20\",\n \"Name\": \"kill Priest\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1406393857\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_21\",\n \"Name\": \"kill Cardinal Aide\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1745498602\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_22\",\n \"Name\": \"kill Sanguinary Guards\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1144208724,\n -669027288\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_23\",\n \"Name\": \"kill Exsanguinator\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1076780215\n ],\n \"RequiredKills\": 28,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_24\",\n \"Name\": \"kill Nightmares\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -981051151,\n -1009917656\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_25\",\n \"Name\": \"kill Blood Prophets\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -2080231735,\n 1912966420\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_26\",\n \"Name\": \"kill Dreadhorns\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1140588645,\n 981369753\n ],\n \"RequiredKills\": 25,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_27\",\n \"Name\": \"kill Dark Temptresses\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 2111003460,\n -494298686\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_28\",\n \"Name\": \"kill Slaughterbeasts\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 2049379982,\n -653348998\n ],\n \"RequiredKills\": 30,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_29\",\n \"Name\": \"kill Gargoyles\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -65981941,\n -392776091,\n 280858720\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_30\",\n \"Name\": \"kill DartFlinger\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1209580976\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_31\",\n \"Name\": \"kill Lurker\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -1733829912\n ],\n \"RequiredKills\": 20,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_32\",\n \"Name\": \"kill Alchemist\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 326501064\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_33\",\n \"Name\": \"kill Dreadcleaver\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1864177126\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_34\",\n \"Name\": \"kill Viper\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n -436956599\n ],\n \"RequiredKills\": 18,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_35\",\n \"Name\": \"kill Sentinel\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 1531777139\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"2_36\",\n \"Name\": \"kill Striker\",\n \"Difficulty\": \"medium\",\n \"TargetPrefabs\": [\n 761646020\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 576389135,\n \"Name\": \"Greater Stygian Shards\",\n \"Amount\": 800\n }\n },\n {\n \"ID\": \"3_1\",\n \"Name\": \"kill Dracula\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -327335305\n ],\n \"RequiredKills\": 3,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_2\",\n \"Name\": \"kill Megara\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 591725925\n ],\n \"RequiredKills\": 3,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_3\",\n \"Name\": \"kill Adam\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1233988687\n ],\n \"RequiredKills\": 3,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_4\",\n \"Name\": \"kill Solarus\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -740796338\n ],\n \"RequiredKills\": 4,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_5\",\n \"Name\": \"kill Talzur\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -393555055\n ],\n \"RequiredKills\": 4,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_6\",\n \"Name\": \"kill General Valencia\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 495971434\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_7\",\n \"Name\": \"kill Lord Styx\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1112948824\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_8\",\n \"Name\": \"kill Gorecrusher\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1936575244\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_9\",\n \"Name\": \"kill Dantos\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 173259239\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_10\",\n \"Name\": \"kill Simon Belmont\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 336560131\n ],\n \"RequiredKills\": 5,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_11\",\n \"Name\": \"kill Azariel\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 114912615\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_12\",\n \"Name\": \"kill Voltatia\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 2054432370\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_13\",\n \"Name\": \"kill Lucile\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1295855316\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_14\",\n \"Name\": \"kill Terrorclaw\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1347412392\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_15\",\n \"Name\": \"kill Matka\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -910296704\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_16\",\n \"Name\": \"kill Stavros\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1669199769\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_17\",\n \"Name\": \"kill Jakira\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1383529374\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_18\",\n \"Name\": \"kill Henry Blackbrew\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 814083983\n ],\n \"RequiredKills\": 6,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_19\",\n \"Name\": \"kill Mairwyn\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -2013903325\n ],\n \"RequiredKills\": 7,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_20\",\n \"Name\": \"kill Morian\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 685266977\n ],\n \"RequiredKills\": 7,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_21\",\n \"Name\": \"kill Baron du Bouchon\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 192051202\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_22\",\n \"Name\": \"kill Sir Magnus\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -26105228\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_23\",\n \"Name\": \"kill Cyril\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 326378955\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_24\",\n \"Name\": \"kill Willfred\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1505705712\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_25\",\n \"Name\": \"kill Albert\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -203043163\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_26\",\n \"Name\": \"kill Foulrot\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1208888966\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_27\",\n \"Name\": \"kill Ben\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 109969450\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_28\",\n \"Name\": \"kill Ungora\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -548489519\n ],\n \"RequiredKills\": 8,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_29\",\n \"Name\": \"kill Angram\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 106480588\n ],\n \"RequiredKills\": 9,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_30\",\n \"Name\": \"kill Domina\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1101874342\n ],\n \"RequiredKills\": 9,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_31\",\n \"Name\": \"kill Ziva\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 172235178\n ],\n \"RequiredKills\": 9,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_32\",\n \"Name\": \"kill Octavian\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1688478381\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_33\",\n \"Name\": \"kill General Cassius\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -496360395\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_34\",\n \"Name\": \"kill Raziel\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -680831417\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_35\",\n \"Name\": \"kill Jade\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1968372384\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_36\",\n \"Name\": \"kill Gaius\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -753453016\n ],\n \"RequiredKills\": 10,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_37\",\n \"Name\": \"kill General Elena\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 795262842\n ],\n \"RequiredKills\": 11,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_38\",\n \"Name\": \"kill Frostmaw\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 24378719\n ],\n \"RequiredKills\": 11,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_39\",\n \"Name\": \"kill Terah\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -1065970933\n ],\n \"RequiredKills\": 11,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_40\",\n \"Name\": \"kill Primal Blood Souls\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n -440174408,\n -427888732,\n 1990744594,\n -943858353,\n -1805216630,\n -982850914,\n -1189707552,\n 282791819,\n -1160778038,\n 468179469,\n 2079933370,\n 666177656\n ],\n \"RequiredKills\": 12,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n },\n {\n \"ID\": \"3_41\",\n \"Name\": \"kill Lesser Blood Souls\",\n \"Difficulty\": \"hard\",\n \"TargetPrefabs\": [\n 1854211210,\n 17609984,\n -1420322422,\n 478580792,\n 1318855899,\n 1494126678,\n -1381375644,\n -1822337177,\n -989493184,\n 2009018555\n ],\n \"RequiredKills\": 15,\n \"Reward\": {\n \"Prefab\": 28358550,\n \"Name\": \"Primal Stygian Shards\",\n \"Amount\": 400\n }\n }\n ]"; } } namespace DailyQuest.Commands { [CommandGroup("quest", null)] internal static class QuestCommands { [Command("daily", "d", null, "Show your daily quests and progress.", null, false)] public static void Show(ChatCommandContext ctx) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0035: Unknown result type (might be due to invalid IL or missing references) User user = ctx.Event.User; ulong platformId = user.PlatformId; string playerName = ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString(); Entity senderCharacterEntity = ctx.Event.SenderCharacterEntity; string text = QuestService.BuildStatusText(platformId, playerName, senderCharacterEntity); ctx.Reply(text); } [Command("reward", "rw", null, "Claim all completed daily quest rewards.", null, false)] public static void Claim(ChatCommandContext ctx) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) User user = ctx.Event.User; ulong platformId = user.PlatformId; string playerName = ((object)(FixedString64Bytes)(ref user.CharacterName)).ToString(); Entity senderCharacterEntity = ctx.Event.SenderCharacterEntity; QuestService.TryClaim(ctx, platformId, playerName, senderCharacterEntity); } [Command("reload", "rl", null, "Reload quest_config.json", null, true)] public static void Reload(ChatCommandContext ctx) { QuestService.Reload(); ctx.Reply("Reloaded quest_config.json"); } [Command("info", "i", null, "Show daily quest status for a specific player.", null, true)] public static void ShowPlayerQuest(ChatCommandContext ctx, string playerName) { string text = QuestService.BuildPlayerStatusTextByName(playerName); ctx.Reply(text); } [Command("debuff", "db", null, "Force remove the daily quest buff from a player.", null, true)] public static void DebuffCommand(ChatCommandContext ctx, string playerName) { QuestService.AdminRemoveBuff(ctx, playerName); } [Command("testwebhook", "tw", null, "Send a test message to Discord.", null, true)] public static void TestWebhook(ChatCommandContext ctx) { if (string.IsNullOrWhiteSpace(Plugin.WebhookUrl?.Value)) { ctx.Reply("Webhook URL is empty in config!"); return; } string message = "**[Daily quest]** - Webhook test message from DailyQuest v1.1.0 by Del"; ctx.Reply("Send a webhook test message."); Helper.TrySendWebhookAsync(message); } [Command("config", "cfg", null, "Display the DailyQuest configuration.", null, true)] public static void ShowConfig(ChatCommandContext ctx) { StringBuilder stringBuilder = new StringBuilder(); string value = FormatStatus(Plugin.BroadcastMessageEnabled?.Value); string value2 = FormatStatus(Plugin.WebhookEnabled?.Value); string value3 = FormatStatus(Plugin.ClaimedBuffEnabled?.Value); string value4 = FormatStatus(Plugin.GearRepairOnClaimEnabled?.Value); stringBuilder.AppendLine("DailyQuest Configurations"); StringBuilder stringBuilder2 = stringBuilder; StringBuilder stringBuilder3 = stringBuilder2; StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(20, 1, stringBuilder2); handler.AppendLiteral("- Broadcast Status: "); handler.AppendFormatted(value); stringBuilder3.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder4 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(18, 1, stringBuilder2); handler.AppendLiteral("- Webhook Status: "); handler.AppendFormatted(value2); stringBuilder4.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder5 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(15, 1, stringBuilder2); handler.AppendLiteral("- Gear Repair: "); handler.AppendFormatted(value4); stringBuilder5.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder6 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(16, 1, stringBuilder2); handler.AppendLiteral("- Claimed Buff: "); handler.AppendFormatted(value3); stringBuilder6.AppendLine(ref handler); ctx.Reply(stringBuilder.ToString().TrimEnd()); static string FormatStatus(bool? isEnabled) { return isEnabled.GetValueOrDefault() ? "enabled" : "disabled"; } } } }