diff --git a/src/Persistence/Initialization/Updates/AddWarriorWingsUpdateSeason6.cs b/src/Persistence/Initialization/Updates/AddWarriorWingsUpdateSeason6.cs new file mode 100644 index 0000000..4d8e0af --- /dev/null +++ b/src/Persistence/Initialization/Updates/AddWarriorWingsUpdateSeason6.cs @@ -0,0 +1,57 @@ +// +// 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.Items; +using MUnique.OpenMU.PlugIns; + +/// +/// Adds six imported high-tier "Warrior" wings at free item slots (12/242-247), one per class line: +/// Wizard (Soul Master), Magic (Duel Master), Elf (High Elf), Summoner (Dimension Master), +/// Warrior Cape (Lord Emperor + Fist Master) and Knight (Blade Master). Each carries base defense, +/// class restriction, 3rd Wing Options, damage increase and fast flight. +/// +[PlugIn] +[Display(Name = PlugInName, Description = PlugInDescription)] +[Guid("8F5B3D74-AC2E-4F9B-B6D7-2E4F9A3C5B18")] +public class AddWarriorWingsUpdateSeason6 : UpdatePlugInBase +{ + internal const string PlugInName = "Add Warrior Wings & Cape (12/242-247)"; + internal const string PlugInDescription = "Adds six high-tier Warrior wings (12/242-247): Wizard, Magic, Elf, Summoner, Warrior Cape (DL+RF) and Knight, each with defense, 3rd Wing Options, damage increase and fast flight."; + + /// + public override UpdateVersion Version => UpdateVersion.AddWarriorWingsSeason6; + + /// + public override string DataInitializationKey => VersionSeasonSix.DataInitialization.Id; + + /// + public override string Name => PlugInName; + + /// + public override string Description => PlugInDescription; + + /// + public override bool IsMandatory => true; + + /// + public override DateTime CreatedAt => new(2026, 07, 19, 20, 0, 0, DateTimeKind.Utc); + + /// +#pragma warning disable CS1998 + protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration) +#pragma warning restore CS1998 + { + // Idempotency guard: skip if the first Warrior wing (12/242) already exists. + if (gameConfiguration.Items.Any(i => i.Group == 12 && i.Number == 242)) + { + return; + } + + new Wings(context, gameConfiguration).CreateWarriorWings(); + } +} diff --git a/src/Persistence/Initialization/Updates/UpdateVersion.cs b/src/Persistence/Initialization/Updates/UpdateVersion.cs index c44d31a..cc9332a 100644 --- a/src/Persistence/Initialization/Updates/UpdateVersion.cs +++ b/src/Persistence/Initialization/Updates/UpdateVersion.cs @@ -499,4 +499,9 @@ public enum UpdateVersion /// The version of the (Poison Wing 12/240, Poison Cape 12/241). /// AddPoisonWingsSeason6 = 98, + + /// + /// The version of the (Warrior Wings/Cape 12/242-247). + /// + AddWarriorWingsSeason6 = 99, } \ No newline at end of file diff --git a/src/Persistence/Initialization/VersionSeasonSix/Items/Wings.cs b/src/Persistence/Initialization/VersionSeasonSix/Items/Wings.cs index fa8c509..5cc7208 100644 --- a/src/Persistence/Initialization/VersionSeasonSix/Items/Wings.cs +++ b/src/Persistence/Initialization/VersionSeasonSix/Items/Wings.cs @@ -104,6 +104,7 @@ public class Wings : WingsInitializerBase this.CreateWing(50, 2, 3, "Cape of Overrule", 150, 45, 220, 400, 0, 0, 0, 0, 0, 0, 3, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.PhysDamage), (0b10, OptionType.Defense)), 39, 39, this._damageIncreaseByLevelTable, thirdWingOptions); this.CreatePoisonWings(); + this.CreateWarriorWings(); } /// @@ -128,6 +129,39 @@ public class Wings : WingsInitializerBase this.CreateWing(241, 5, 3, "Poison Cape", 150, 60, 220, 100, 0, 0, 0, 0, 1, 0, 1, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.PhysDamage), (0b10, OptionType.Defense)), 42, 42, damageTable, wingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed); } + /// + /// ADAMU-CUSTOM: six imported high-tier "Warrior" wings (base defense + 3rd Wing Options + damage + /// increase, fast flight). One per class line: + /// 242 Wizard (Soul Master), 243 Magic (Duel Master), 244 Elf (High Elf), 245 Summoner (Dimension + /// Master), 246 Warrior Cape (Lord Emperor + Fist Master), 247 Knight (Blade Master). + /// + public void CreateWarriorWings() + { + // Reuse the EXISTING shared "3rd Wing Options" set and level-bonus tables (fixed Guids already in + // the database) by fetching them, to avoid Guid collisions when this runs as an update. + var wingOptions = this.GameConfiguration.ItemOptions.First(o => o.Name == "3rd Wing Options"); + var damageTable = this.GameConfiguration.ItemLevelBonusTables.First(t => t.Name == "Damage Increase (1st and 3rd Wings)"); + this._defenseBonusByLevelTable ??= this.GameConfiguration.ItemLevelBonusTables.First(t => t.Name == "Defense Bonus (1st and 2nd Wings)"); + + // Warrior Wings Wizard (12/242, Soul Master / Dark Wizard): magic damage option. + this.CreateWing(242, 5, 3, "Warrior Wings Wizard", 150, 65, 220, 100, 1, 0, 0, 0, 0, 0, 0, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.WizDamage), (0b10, OptionType.Defense)), 42, 42, damageTable, wingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed); + + // Warrior Wings Magic (12/243, Duel Master / Magic Gladiator). + this.CreateWing(243, 5, 3, "Warrior Wings Magic", 150, 65, 220, 100, 0, 0, 0, 1, 0, 0, 0, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.PhysDamage), (0b10, OptionType.Defense)), 42, 42, damageTable, wingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed); + + // Warrior Wings Elf (12/244, High Elf). + this.CreateWing(244, 5, 3, "Warrior Wings Elf", 150, 65, 220, 100, 0, 0, 1, 0, 0, 0, 0, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.PhysDamage), (0b10, OptionType.Defense)), 42, 42, damageTable, wingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed); + + // Warrior Wings Summoner (12/245, Dimension Master / Summoner): magic + curse damage. + this.CreateWing(245, 5, 3, "Warrior Wings Summoner", 150, 65, 220, 100, 0, 0, 0, 0, 0, 1, 0, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.WizDamage), (0b10, OptionType.CurseDamage)), 42, 42, damageTable, wingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed); + + // Warrior Cape (12/246, Lord Emperor / Dark Lord + Fist Master / Rage Fighter): defense 60. + this.CreateWing(246, 5, 3, "Warrior Cape", 150, 60, 220, 100, 0, 0, 0, 0, 1, 0, 1, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.PhysDamage), (0b10, OptionType.Defense)), 42, 42, damageTable, wingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed); + + // Warrior Wings Knight (12/247, Blade Master / Dark Knight). + this.CreateWing(247, 5, 3, "Warrior Wings Knight", 150, 65, 220, 100, 0, 1, 0, 0, 0, 0, 0, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.PhysDamage), (0b10, OptionType.Defense)), 42, 42, damageTable, wingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed); + } + private void CreateFeather() { var feather = this.Context.CreateNew();