From 6e0d1d4d2f7afd4501eb1ec1998319fb7d5bf425 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 14 Nov 2024 02:53:36 -0800 Subject: expire stored extra levels automatically when a new PVP season starts --- Malmstone/Plugin.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Malmstone/Plugin.cs b/Malmstone/Plugin.cs index f17807d..9ff8ba8 100644 --- a/Malmstone/Plugin.cs +++ b/Malmstone/Plugin.cs @@ -265,6 +265,19 @@ private void OnCommand(string command, string args) { if(ClientState.LocalPlayer != null) { + ulong contentId = ClientState.LocalContentId; + int CurrentSeriesLevel = PvPService.GetPvPSeriesInfo()?.CurrentSeriesRank ?? 0; + if (Configuration.ExtraLevelsMap.TryGetValue(contentId, out var extraLevels)) + { + if(extraLevels >= 1 && CurrentSeriesLevel < 30) + { + Logger.Debug("Extra Levels has expired likely due to a new Series Malmstone. Resetting to 0"); + Configuration.ExtraLevelsMap[contentId] = 0; + Configuration.Save(); + } + } + + if (Configuration.TrackFrontlineBonus) { Logger.Debug("Player has loaded in. Attempting to get Frontline PVP Profile Data"); -- cgit v1.2.3