From 37fa688fa94a0e3add6ee6899edfd6e7a7d8df02 Mon Sep 17 00:00:00 2001 From: sven-n Date: Mon, 28 Oct 2024 20:20:30 +0100 Subject: [PATCH] Fix Duel Arena safezone map --- .../Updates/FixDuelArenaSafezoneMapUpdate.cs | 53 +++++++++++++++++++ .../Initialization/Updates/UpdateVersion.cs | 5 ++ 2 files changed, 58 insertions(+) create mode 100644 src/Persistence/Initialization/Updates/FixDuelArenaSafezoneMapUpdate.cs diff --git a/src/Persistence/Initialization/Updates/FixDuelArenaSafezoneMapUpdate.cs b/src/Persistence/Initialization/Updates/FixDuelArenaSafezoneMapUpdate.cs new file mode 100644 index 000000000..d1f6f3065 --- /dev/null +++ b/src/Persistence/Initialization/Updates/FixDuelArenaSafezoneMapUpdate.cs @@ -0,0 +1,53 @@ +// +// Licensed under the MIT License. See LICENSE file in the project root for full license information. +// + +namespace MUnique.OpenMU.Persistence.Initialization.Updates; + +using System.Runtime.InteropServices; +using MUnique.OpenMU.DataModel.Configuration; +using MUnique.OpenMU.Persistence.Initialization.VersionSeasonSix.Maps; +using MUnique.OpenMU.PlugIns; + +/// +/// This Sets the safezone of duel arena to lorencia. +/// +[PlugIn(PlugInName, PlugInDescription)] +[Guid("27714BB3-43F9-4D90-920F-98EF0EC20232")] +public class FixDuelArenaSafezoneMapUpdate : UpdatePlugInBase +{ + /// + /// The plug in name. + /// + internal const string PlugInName = "Fix Duel Arena Safezone Map"; + + /// + /// The plug in description. + /// + internal const string PlugInDescription = "Sets the safezone of duel arena to lorencia."; + + /// + public override UpdateVersion Version => UpdateVersion.FixDuelArenaSafezoneMap; + + /// + public override string DataInitializationKey => VersionSeasonSix.DataInitialization.Id; + + /// + public override string Name => PlugInName; + + /// + public override string Description => PlugInDescription; + + /// + public override bool IsMandatory => false; + + /// + public override DateTime CreatedAt => new(2024, 10, 28, 18, 0, 0, DateTimeKind.Utc); + + /// + protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration) + { + var duelArena = gameConfiguration.Maps.First(x => x.Number == DuelArena.Number); + duelArena.SafezoneMap = gameConfiguration.Maps.First(m => m.Number == Lorencia.Number); + } +} \ No newline at end of file diff --git a/src/Persistence/Initialization/Updates/UpdateVersion.cs b/src/Persistence/Initialization/Updates/UpdateVersion.cs index b8b01eee3..d6e46e038 100644 --- a/src/Persistence/Initialization/Updates/UpdateVersion.cs +++ b/src/Persistence/Initialization/Updates/UpdateVersion.cs @@ -184,4 +184,9 @@ public enum UpdateVersion /// The version of the . /// AddHarmonyOptionWeightsSeason6 = 35, + + /// + /// The version of the . + /// + FixDuelArenaSafezoneMap = 36, } \ No newline at end of file