Skip to content

Commit

Permalink
Add UpdatePlugin for Drain Life fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bernatvadell committed Aug 29, 2024
1 parent 165fd67 commit 7640e9f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/Persistence/Initialization/Updates/FixDrainLifeSkillUpdate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// <copyright file="FixDrainLifeSkillUpdate.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.DataModel.Configuration.Items;
using MUnique.OpenMU.GameLogic;
using MUnique.OpenMU.Persistence.Initialization.Skills;
using MUnique.OpenMU.PlugIns;

/// <summary>
/// This adds the items required to enter the kalima map.
/// </summary>
[PlugIn(PlugInName, PlugInDescription)]
[Guid("A8827A3C-7F52-47CF-9EA5-562A9C06B986")]
public class FixDrainLifeSkillUpdate : UpdatePlugInBase
{
/// <summary>
/// The plug in name.
/// </summary>
internal const string PlugInName = "Fix Drain Life Skill";

/// <summary>
/// The plug in description.
/// </summary>
internal const string PlugInDescription = "Updates the attributes of the summoner's Drain Life skill to make it work properly.";

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

/// <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, 08, 29, 18, 0, 0, DateTimeKind.Utc);

/// <inheritdoc />
protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration)
{
var drainLife = gameConfiguration.Skills.First(x => x.Number == (short)SkillNumber.DrainLife);
drainLife.SkillType = SkillType.AreaSkillExplicitTarget;
}
}
5 changes: 5 additions & 0 deletions src/Persistence/Initialization/Updates/UpdateVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,9 @@ public enum UpdateVersion
/// The version of the <see cref="FixAncientDiscriminatorsUpdatePlugIn"/>.
/// </summary>
FixAncientDiscriminators = 26,

/// <summary>
/// The version of the <see cref="FixDrainLifeSkillUpdate"/>.
/// </summary>
FixDrainLifeSkill = 27,
}

0 comments on commit 7640e9f

Please sign in to comment.