-
Notifications
You must be signed in to change notification settings - Fork 480
Remove drop level gap condition for jewels #697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sven-n
merged 8 commits into
MUnique:master
from
ze-dom:bugfix/remove_jewels_level_drop_gap
Mar 15, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
aeb3afb
First commit
ze-dom bb25d55
Removed List initialization as per Analyzer recommendation
ze-dom 3411943
Moved method to Initializerbase
ze-dom 34e92b3
Forgot these
ze-dom 6743719
Added constant for item-monster drop level max gap
ze-dom 59215b8
Merge branch 'master' into bugfix/remove_jewels_level_drop_gap
ze-dom 282d2d6
Added update plugins
ze-dom 8638219
Fixed data initialization keys for plugins
ze-dom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -195,4 +195,15 @@ protected IncreasableItemOption CreateItemOption(int number, AttributeDefinition | |
|
|
||
| return itemOption; | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Register the jewel (or jewel-like item) in the drop item group for jewels. | ||
| /// </summary> | ||
| /// <param name="item">The jewel you want to register.</param> | ||
| protected void AddItemToJewelItemDrop(ItemDefinition item) | ||
| { | ||
| var id = GuidHelper.CreateGuid<DropItemGroup>(4); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| var jewelsItemDrop = this.GameConfiguration.DropItemGroups.First(x => x.GetId() == id); | ||
| jewelsItemDrop.PossibleItems.Add(item); | ||
| } | ||
| } | ||
30 changes: 30 additions & 0 deletions
30
src/Persistence/Initialization/Updates/RemoveJewelDropLevelGapPlugIn075.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // <copyright file="RemoveJewelDropLevelGapPlugIn075.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.PlugIns; | ||
|
|
||
| /// <summary> | ||
| /// This update removes the existing drop level gap condition for jewels and similar items that should always drop. | ||
| /// </summary> | ||
| [PlugIn] | ||
| [Display(Name = PlugInName, Description = PlugInDescription)] | ||
| [Guid("CD958BC1-F17A-4C60-B66D-BD29D49B6ADA")] | ||
| public class RemoveJewelDropLevelGapPlugIn075 : RemoveJewelDropLevelGapPlugInBase | ||
| { | ||
| /// <inheritdoc /> | ||
| public override string DataInitializationKey => Version075.DataInitialization.Id; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override UpdateVersion Version => UpdateVersion.RemoveJewelDropLevelGap075; | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration) | ||
| { | ||
| await base.ApplyAsync(context, gameConfiguration).ConfigureAwait(false); | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
src/Persistence/Initialization/Updates/RemoveJewelDropLevelGapPlugIn095d.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| // <copyright file="RemoveJewelDropLevelGapPlugIn095d.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.PlugIns; | ||
|
|
||
| /// <summary> | ||
| /// This update removes the existing drop level gap condition for jewels and similar items that should always drop. | ||
| /// </summary> | ||
| [PlugIn] | ||
| [Display(Name = PlugInName, Description = PlugInDescription)] | ||
| [Guid("6614E91E-5749-478A-96A4-3240E7C1280E")] | ||
| public class RemoveJewelDropLevelGapPlugIn095D : RemoveJewelDropLevelGapPlugInBase | ||
| { | ||
| /// <inheritdoc /> | ||
| public override string DataInitializationKey => Version095d.DataInitialization.Id; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override UpdateVersion Version => UpdateVersion.RemoveJewelDropLevelGap095d; | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration) | ||
| { | ||
| await base.ApplyAsync(context, gameConfiguration).ConfigureAwait(false); | ||
| } | ||
| } |
58 changes: 58 additions & 0 deletions
58
src/Persistence/Initialization/Updates/RemoveJewelDropLevelGapPlugInBase.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // <copyright file="RemoveJewelDropLevelGapPlugInBase.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 MUnique.OpenMU.DataModel.Configuration; | ||
| using MUnique.OpenMU.Persistence.Initialization.Items; | ||
|
|
||
| /// <summary> | ||
| /// This update removes the existing drop level gap condition for jewels and similar items that should always drop. | ||
| /// </summary> | ||
| public abstract class RemoveJewelDropLevelGapPlugInBase : UpdatePlugInBase | ||
| { | ||
| /// <summary> | ||
| /// The plug in name. | ||
| /// </summary> | ||
| internal const string PlugInName = "Remove Jewel Drop Level Gap"; | ||
|
|
||
| /// <summary> | ||
| /// The plug in description. | ||
| /// </summary> | ||
| internal const string PlugInDescription = "This update removes the existing drop level gap condition for jewels and similar items that should always drop."; | ||
|
|
||
| /// <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, 3, 5, 16, 0, 0, DateTimeKind.Utc); | ||
sven-n marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// <inheritdoc /> | ||
| protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration) | ||
| { | ||
| var jewelsDropGroupId = new Guid("00000200-0004-0000-0000-000000000000"); | ||
sven-n marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| var jewelsDropGroup = gameConfiguration.DropItemGroups.First(x => x.GetId() == jewelsDropGroupId); | ||
| jewelsDropGroup.ItemType = SpecialItemType.Jewel; | ||
|
|
||
| Dictionary<ItemGroups, List<int>> itemGroupToItemNumbers = new() | ||
| { | ||
| { ItemGroups.Misc1, [0, 1, 2] }, // angel, imp, uniria | ||
| { ItemGroups.Misc2, [9, 10] }, // alcohol, town portal scroll | ||
sven-n marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
| foreach (var entry in itemGroupToItemNumbers) | ||
| { | ||
| var items = gameConfiguration.Items.Where(i => i.Group == (int)entry.Key && entry.Value.Contains(i.Number)); | ||
| foreach (var item in items) | ||
| { | ||
| jewelsDropGroup.PossibleItems.Add(item); | ||
| } | ||
| } | ||
| } | ||
| } | ||
36 changes: 36 additions & 0 deletions
36
src/Persistence/Initialization/Updates/RemoveJewelDropLevelGapPlugInSeason6.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // <copyright file="RemoveJewelDropLevelGapPlugInSeason6.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.PlugIns; | ||
|
|
||
| /// <summary> | ||
| /// This update removes the existing drop level gap condition for jewels and similar items that should always drop. | ||
| /// </summary> | ||
| [PlugIn] | ||
| [Display(Name = PlugInName, Description = PlugInDescription)] | ||
| [Guid("AB1C9F8B-5E3B-4F2A-BDCD-9C0F1E5A6B7C")] | ||
| public class RemoveJewelDropLevelGapPlugInSeason6 : RemoveJewelDropLevelGapPlugInBase | ||
| { | ||
| /// <inheritdoc /> | ||
| public override string DataInitializationKey => VersionSeasonSix.DataInitialization.Id; | ||
|
|
||
| /// <inheritdoc /> | ||
| public override UpdateVersion Version => UpdateVersion.RemoveJewelDropLevelGapSeason6; | ||
|
|
||
| /// <inheritdoc /> | ||
| protected override async ValueTask ApplyAsync(IContext context, GameConfiguration gameConfiguration) | ||
| { | ||
| await base.ApplyAsync(context, gameConfiguration).ConfigureAwait(false); | ||
|
|
||
| var jewelOfGuardianDropGroupId = new Guid("00000200-001f-0001-0000-000000000000"); | ||
sven-n marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if (gameConfiguration.DropItemGroups.FirstOrDefault(x => x.GetId() == jewelOfGuardianDropGroupId) is { } jewelOfGuardianDropGroup) | ||
| { | ||
| jewelOfGuardianDropGroup.ItemType = SpecialItemType.Jewel; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.