diff --git a/project/Aki.Custom/CustomAI/PmcFoundInRaidEquipment.cs b/project/Aki.Custom/CustomAI/PmcFoundInRaidEquipment.cs index 65b6f10..e166794 100644 --- a/project/Aki.Custom/CustomAI/PmcFoundInRaidEquipment.cs +++ b/project/Aki.Custom/CustomAI/PmcFoundInRaidEquipment.cs @@ -43,13 +43,13 @@ namespace Aki.Custom.CustomAI MakeEquipmentNotFiR(___botOwner_0); // Get inventory items that hold other items (backpack/rig/pockets) - List containerGear = ___botOwner_0.Profile.Inventory.Equipment.GetContainerSlots(); + IReadOnlyList containerGear = ___botOwner_0.Profile.Inventory.Equipment.ContainerSlots; foreach (var container in containerGear) { foreach (var item in container.ContainedItem.GetAllItems()) { // Skip items that match container (array has itself as an item) - if (item.Id == container.Items.FirstOrDefault().Id) + if (item.Id == container.Items.FirstOrDefault()?.Id) { //this.logger.LogError($"Skipping item {item.Id} {item.Name} as its same as container {container.FullId}"); continue; @@ -82,8 +82,8 @@ namespace Aki.Custom.CustomAI } // Set dogtag as FiR - var dogtag = ___botOwner_0.Profile.Inventory.GetItemsInSlots(new EquipmentSlot[] { EquipmentSlot.Dogtag }); - dogtag.FirstOrDefault().SpawnedInSession = true; + var dogtag = ___botOwner_0.Profile.Inventory.GetItemsInSlots(new EquipmentSlot[] { EquipmentSlot.Dogtag }).FirstOrDefault(); + if (dogtag != null) dogtag.SpawnedInSession = true; } diff --git a/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs b/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs index bd7ba2f..dcfa6a9 100644 --- a/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs +++ b/project/Aki.Custom/Patches/ExitWhileLootingPatch.cs @@ -33,7 +33,7 @@ namespace Aki.Custom.Patches var player = Singleton.Instance.MainPlayer; if (profileId == player?.Profile.Id) { - GClass2949.Instance.CloseAllScreensForced(); + GClass3104.Instance.CloseAllScreensForced(); } return true; diff --git a/project/Aki.Custom/Patches/RagfairFeePatch.cs b/project/Aki.Custom/Patches/RagfairFeePatch.cs index bb47a5a..2d727d0 100644 --- a/project/Aki.Custom/Patches/RagfairFeePatch.cs +++ b/project/Aki.Custom/Patches/RagfairFeePatch.cs @@ -17,8 +17,8 @@ namespace Aki.Custom.Patches public RagfairFeePatch() { // Remember to update prefix parameter if below lines are broken - _ = nameof(GClass2911.IsAllSelectedItemSame); - _ = nameof(GClass2911.AutoSelectSimilar); + _ = nameof(GClass3066.IsAllSelectedItemSame); + _ = nameof(GClass3066.AutoSelectSimilar); } protected override MethodBase GetTargetMethod() @@ -30,18 +30,18 @@ namespace Aki.Custom.Patches /// Calculate tax to charge player and send to server before the offer is sent /// /// Item sold - /// OfferItemCount + /// OfferItemCount /// RequirementsPrice /// SellInOnePiece [PatchPrefix] - private static void PatchPrefix(ref Item ___item_0, ref GClass2911 ___gclass2911_0, ref double ___double_0, ref bool ___bool_0) + private static void PatchPrefix(ref Item ___item_0, ref GClass3066 ___gclass3066_0, ref double ___double_0, ref bool ___bool_0) { RequestHandler.PutJson("/client/ragfair/offerfees", new { id = ___item_0.Id, tpl = ___item_0.TemplateId, - count = ___gclass2911_0.OfferItemCount, - fee = Mathf.CeilToInt((float)GClass1991.CalculateTaxPrice(___item_0, ___gclass2911_0.OfferItemCount, ___double_0, ___bool_0)) + count = ___gclass3066_0.OfferItemCount, + fee = Mathf.CeilToInt((float)GClass2083.CalculateTaxPrice(___item_0, ___gclass3066_0.OfferItemCount, ___double_0, ___bool_0)) } .ToJson()); } diff --git a/project/Aki.Debugging/Patches/EndRaidDebug.cs b/project/Aki.Debugging/Patches/EndRaidDebug.cs index 6c57be1..2afc2d1 100644 --- a/project/Aki.Debugging/Patches/EndRaidDebug.cs +++ b/project/Aki.Debugging/Patches/EndRaidDebug.cs @@ -17,7 +17,7 @@ namespace Aki.Debugging.Patches [PatchPrefix] private static bool PatchPreFix(ref LocalizedText ____nickName, ref TMP_Text ____standing, - ref RankPanel ____rankPanel, ref Profile.GClass1675 ___gclass1675_0) + ref RankPanel ____rankPanel, ref Profile.TraderInfo ___traderInfo_0) { if (____nickName.LocalizationKey == null) { @@ -37,16 +37,16 @@ namespace Aki.Debugging.Patches return false; // skip original } - if (___gclass1675_0?.LoyaltyLevel == null) + if (___traderInfo_0?.LoyaltyLevel == null) { ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord"); - Logger.Log(LogLevel.Error, "[AKI] _gclass1618_0 or _gclass1618_0.LoyaltyLevel was null"); + Logger.Log(LogLevel.Error, "[AKI] ___traderInfo_0 or ___traderInfo_0.LoyaltyLevel was null"); } - if (___gclass1675_0?.MaxLoyaltyLevel == null) + if (___traderInfo_0?.MaxLoyaltyLevel == null) { ConsoleScreen.LogError("This Shouldn't happen!! Please report this in discord"); - Logger.Log(LogLevel.Error, "[AKI] _gclass1618_0 or _gclass1618_0.MaxLoyaltyLevel was null"); + Logger.Log(LogLevel.Error, "[AKI] ___traderInfo_0 or ___traderInfo_0.MaxLoyaltyLevel was null"); } return true; diff --git a/project/Aki.SinglePlayer/Patches/Progression/MidRaidQuestChangePatch.cs b/project/Aki.SinglePlayer/Patches/Progression/MidRaidQuestChangePatch.cs index 603832a..feec21e 100644 --- a/project/Aki.SinglePlayer/Patches/Progression/MidRaidQuestChangePatch.cs +++ b/project/Aki.SinglePlayer/Patches/Progression/MidRaidQuestChangePatch.cs @@ -26,7 +26,7 @@ namespace Aki.SinglePlayer.Patches.Progression { var player = gameWorld.MainPlayer; - var questController = Traverse.Create(player).Field("_questController").Value; + var questController = Traverse.Create(player).Field("_questController").Value; if (questController != null) { foreach (var quest in questController.Quests.ToList()) diff --git a/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs b/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs index aac56f2..453bce1 100644 --- a/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs +++ b/project/Aki.SinglePlayer/Patches/RaidFix/GetNewBotTemplatesPatch.cs @@ -58,7 +58,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix /// BotsPresets.GetNewProfile() /// [PatchPrefix] - private static bool PatchPrefix(ref Task __result, BotsPresets __instance, List ___list_0, GClass560 data, ref bool withDelete) + private static bool PatchPrefix(ref Task __result, BotsPresets __instance, List ___list_0, GClass588 data, ref bool withDelete) { /* When client wants new bot and GetNewProfile() return null (if not more available templates or they don't satisfy by Role and Difficulty condition) diff --git a/project/Aki.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs b/project/Aki.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs index f005aa9..81a00ab 100644 --- a/project/Aki.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs +++ b/project/Aki.SinglePlayer/Patches/RaidFix/LabsKeycardRemovalPatch.cs @@ -43,7 +43,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix } var inventoryController = Traverse.Create(player).Field("_inventoryController").Value; - GClass2636.Remove(accessCardItem, inventoryController, false, true); + GClass2767.Remove(accessCardItem, inventoryController, false, true); } } } \ No newline at end of file diff --git a/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs b/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs index fb25c5f..99f774f 100644 --- a/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs +++ b/project/Aki.SinglePlayer/Patches/RaidFix/PostRaidHealingPricePatch.cs @@ -2,7 +2,7 @@ using HarmonyLib; using System; using System.Reflection; -using TraderInfo = EFT.Profile.GClass1675; +using EFT; namespace Aki.SinglePlayer.Patches.RaidFix { @@ -10,7 +10,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix { protected override MethodBase GetTargetMethod() { - var desiredType = typeof(TraderInfo); + var desiredType = typeof(Profile.TraderInfo); var desiredMethod = desiredType.GetMethod("UpdateLevel", BindingFlags.NonPublic | BindingFlags.Instance); Logger.LogDebug($"{this.GetType().Name} Type: {desiredType?.Name}"); @@ -20,7 +20,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix } [PatchPrefix] - protected static void PatchPrefix(TraderInfo __instance) + protected static void PatchPrefix(Profile.TraderInfo __instance) { if (__instance.Settings == null) { @@ -35,8 +35,7 @@ namespace Aki.SinglePlayer.Patches.RaidFix throw new IndexOutOfRangeException($"Loyalty level {loyaltyLevel} not found."); } - // Backing field of the "CurrentLoyalty" property - Traverse.Create(__instance).Field("traderLoyaltyLevel_0").SetValue(loyaltyLevelSettings.Value); + Traverse.Create(__instance).Property("CurrentLoyalty").SetValue(loyaltyLevelSettings.Value); } } } \ No newline at end of file diff --git a/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs b/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs index 17fd7c8..92082a7 100644 --- a/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs +++ b/project/Aki.SinglePlayer/Patches/ScavMode/LoadOfflineRaidScreenPatch.cs @@ -29,7 +29,7 @@ namespace Aki.SinglePlayer.Patches.ScavMode _ = nameof(TimeAndWeatherSettings.IsRandomWeather); _ = nameof(BotControllerSettings.IsScavWars); _ = nameof(WavesSettings.IsBosses); - _ = GClass3004.MAX_SCAV_COUNT; // UPDATE REFS TO THIS CLASS BELOW !!! + _ = GClass3163.MAX_SCAV_COUNT; // UPDATE REFS TO THIS CLASS BELOW !!! var menuControllerType = typeof(MainMenuController); @@ -118,9 +118,9 @@ namespace Aki.SinglePlayer.Patches.ScavMode // Get fields from MainMenuController.cs var raidSettings = Traverse.Create(menuController).Field("raidSettings_0").GetValue(); - var matchmakerPlayersController = Traverse.Create(menuController).Field($"{nameof(GClass3004).ToLowerInvariant()}_0").GetValue(); + var matchmakerPlayersController = Traverse.Create(menuController).Field($"{nameof(GClass3163).ToLowerInvariant()}_0").GetValue(); - var gclass = new MatchmakerOfflineRaidScreen.GClass2993(profile?.Info, ref raidSettings, matchmakerPlayersController); + var gclass = new MatchmakerOfflineRaidScreen.GClass3152(profile?.Info, ref raidSettings, matchmakerPlayersController); gclass.OnShowNextScreen += LoadOfflineRaidNextScreen;