fix(items): reuse shared 3rd Wing Options + level tables for Poison wings (avoid Guid collision)

This commit is contained in:
Acentech Dev
2026-07-19 18:36:38 +03:00
parent 3e8cd8fdae
commit 1cadaa08ab
2 changed files with 13 additions and 12 deletions

View File

@@ -20,7 +20,7 @@ using MUnique.OpenMU.PlugIns;
public class AddPoisonWingsUpdateSeason6 : UpdatePlugInBase
{
internal const string PlugInName = "Add Poison Wing & Poison Cape (12/240, 12/241)";
internal const string PlugInDescription = "Adds Poison Wing (12/240, Dark Knight) and Poison Cape (12/241, Dark Lord + Rage Fighter) as basic wings.";
internal const string PlugInDescription = "Adds Poison Wing (12/240, Dark Knight) and Poison Cape (12/241, Dark Lord + Rage Fighter) as high-tier wings (defense, 3rd Wing Options, damage increase, fast flight).";
/// <inheritdoc />
public override UpdateVersion Version => UpdateVersion.AddPoisonWingsSeason6;

View File

@@ -112,19 +112,20 @@ public class Wings : WingsInitializerBase
/// </summary>
public void CreatePoisonWings()
{
// Ensure the level-bonus tables exist (Initialize() sets them for the fresh-seed
// path; the update-plugin path calls this method standalone).
this._defenseBonusByLevelTable ??= this.CreateBonusDefensePerLevel();
this._damageIncreaseByLevelTable ??= this.CreateDamageIncreaseBonusPerLevelFirstAndThirdWings();
var poisonWingOptions = this.CreateThirdClassWingOptions();
// High-tier imported wings. Reuse the EXISTING shared "3rd Wing Options" option set and
// level-bonus tables (they already exist in the database) by fetching them from the
// configuration instead of re-creating them - re-creating uses fixed Guids and would
// collide when this runs as an update on an existing database.
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)");
// High-tier imported wings: strong base defense + defense-per-level, wing options
// (HP recover / physical damage / defense increase), damage increase and fast flight.
// Poison Wing (12/240, Dark Knight).
this.CreateWing(240, 5, 3, "Poison Wing", 150, 65, 220, 100, 0, 1, 0, 0, 0, 0, 0, this.BuildOptions((0b00, OptionType.HealthRecover), (0b11, OptionType.PhysDamage), (0b10, OptionType.Defense)), 42, 42, this._damageIncreaseByLevelTable, poisonWingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed);
// Poison Wing (12/240, Dark Knight): defense 65 + defense-per-level, 3rd Wing Options,
// damage increase, HP-recover / phys-damage / defense wing options, fast flight.
this.CreateWing(240, 5, 3, "Poison Wing", 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);
// Poison Cape (12/241, Dark Lord + Rage Fighter).
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, this._damageIncreaseByLevelTable, poisonWingOptions, movementSpeed: MovementSpeedConstants.FastWingMovementSpeed);
// Poison Cape (12/241, Dark Lord + Rage Fighter): defense 60, same rich options.
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);
}
private void CreateFeather()