feat(items): add Imperial Sword (0/50) and Imperial Staff (5/50)
Two new weapons placed at free item slots so they never collide with standard Season 6 items. The client name DB (Item_eng.bmd) is the source of tooltip name/stats, so only free slots are usable for custom items. Both seed paths are covered: - Fresh DB: Weapons.Initialize() calls the new CreateImperialWeapons050(). - Existing DB: AddImperialWeapons050UpdateSeason6 (UpdateVersion 95), applied from the AdminPanel Updates page, with an idempotency guard. Imperial Sword is a Magic Gladiator weapon (copy of 0/28), Imperial Staff is a Wizard weapon (copy of 5/31). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
// <copyright file="AddImperialWeapons050UpdateSeason6.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.Items;
|
||||
using MUnique.OpenMU.PlugIns;
|
||||
|
||||
/// <summary>
|
||||
/// Adds two new weapons at item number 50: Imperial Sword (group 0, Magic Gladiator) and
|
||||
/// Imperial Staff (group 5, Wizard), as full working weapons (damage, attack speed, requirements,
|
||||
/// options, equip flags). Placed at free slots so they never collide with standard items.
|
||||
/// </summary>
|
||||
[PlugIn]
|
||||
[Display(Name = PlugInName, Description = PlugInDescription)]
|
||||
[Guid("BE9DD7D1-F352-4C56-A646-D78C36978982")]
|
||||
public class AddImperialWeapons050UpdateSeason6 : UpdatePlugInBase
|
||||
{
|
||||
internal const string PlugInName = "Add Imperial Weapons (0/50, 5/50)";
|
||||
internal const string PlugInDescription = "Adds Imperial Sword (0/50) and Imperial Staff (5/50) as fully working weapons.";
|
||||
|
||||
/// <inheritdoc />
|
||||
public override UpdateVersion Version => UpdateVersion.AddImperialWeapons050Season6;
|
||||
|
||||
/// <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 => true;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override DateTime CreatedAt => new(2026, 07, 16, 12, 0, 0, DateTimeKind.Utc);
|
||||
|
||||
/// <inheritdoc />
|
||||
#pragma warning disable CS1998
|
||||
protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration)
|
||||
#pragma warning restore CS1998
|
||||
{
|
||||
// Idempotency guard: skip if the Imperial Sword 0/50 already exists.
|
||||
if (gameConfiguration.Items.Any(i => i.Group == 0 && i.Number == 50))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
new Weapons(context, gameConfiguration).CreateImperialWeapons050();
|
||||
}
|
||||
}
|
||||
@@ -479,4 +479,9 @@ public enum UpdateVersion
|
||||
/// The version of the <see cref="AddIsQuestItemFlagPlugIn"/>.
|
||||
/// </summary>
|
||||
AddIsQuestItemFlag = 94,
|
||||
|
||||
/// <summary>
|
||||
/// The version of the <see cref="AddImperialWeapons050UpdateSeason6"/>.
|
||||
/// </summary>
|
||||
AddImperialWeapons050Season6 = 95,
|
||||
}
|
||||
Reference in New Issue
Block a user