Skip to content

Commit

Permalink
Fix Duel Arena safezone map
Browse files Browse the repository at this point in the history
  • Loading branch information
sven-n committed Oct 28, 2024
1 parent 6da48a2 commit 37fa688
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// <copyright file="FixDuelArenaSafezoneMapUpdate.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>

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;

/// <summary>
/// This Sets the safezone of duel arena to lorencia.
/// </summary>
[PlugIn(PlugInName, PlugInDescription)]
[Guid("27714BB3-43F9-4D90-920F-98EF0EC20232")]
public class FixDuelArenaSafezoneMapUpdate : UpdatePlugInBase
{
/// <summary>
/// The plug in name.
/// </summary>
internal const string PlugInName = "Fix Duel Arena Safezone Map";

/// <summary>
/// The plug in description.
/// </summary>
internal const string PlugInDescription = "Sets the safezone of duel arena to lorencia.";

/// <inheritdoc />
public override UpdateVersion Version => UpdateVersion.FixDuelArenaSafezoneMap;

/// <inheritdoc />
public override string DataInitializationKey => VersionSeasonSix.DataInitialization.Id;

/// <inheritdoc />
public override string Name => PlugInName;

/// <inheritdoc />
public override string Description => PlugInDescription;

/// <inheritdoc />
public override bool IsMandatory => false;

/// <inheritdoc />
public override DateTime CreatedAt => new(2024, 10, 28, 18, 0, 0, DateTimeKind.Utc);

/// <inheritdoc />
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);
}
}
5 changes: 5 additions & 0 deletions src/Persistence/Initialization/Updates/UpdateVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,9 @@ public enum UpdateVersion
/// The version of the <see cref="AddHarmonyOptionWeightsUpdateSeason6"/>.
/// </summary>
AddHarmonyOptionWeightsSeason6 = 35,

/// <summary>
/// The version of the <see cref="FixDuelArenaSafezoneMapUpdate"/>.
/// </summary>
FixDuelArenaSafezoneMap = 36,
}

0 comments on commit 37fa688

Please sign in to comment.