Skip to content

Lord's Mix of the castle senior (crafting 18) - #1571

Merged
sven-n merged 3 commits into
MUnique:masterfrom
pllanosclaria:feat/lords-mix
Nov 21, 2026
Merged

sven-n merged 3 commits into
MUnique:masterfrom
pllanosclaria:feat/lords-mix

Conversation

@pllanosclaria

@pllanosclaria pllanosclaria commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1570

The Senior of Valley of Loren offers the Lord's Mix in the Season 6 client (mix 18), but OpenMU has no crafting for it.
This adds it: only the guild master of the guild which owns the castle can use it, a limited number of times per day
or per siege cycle, and its result is an excellent weapon or armor with two to four excellent options, or a normal one.

Changes

  • Data model: SimpleCraftingSettings.ResultItemExcellentOptionCountTable and ResultItemSocketCountTable
    (weighted value tables of feat(items): weighted value tables for the socket count of dropped items #1567, nullable), ItemCraftingResultItem.ExcellentOptionChance (nullable),
    CastleSiegeConfiguration.LordsMixLimit (0 = no limit) and LordsMixLimitPeriod (Day, SiegeCycle),
    CastleSiegeData.LordsMixCount and LordsMixCountDate. Migration AddLordsMix, the compiled model and the generated
    persistence and loader code. Existing databases read "no table", "no limit" and "the chance of the crafting".
  • Crafting: BaseItemCraftingHandler.CheckPreconditionsAsync, awaited before the items are checked and the price is
    paid (default: no error). SimpleItemCraftingHandler honours the two tables, and only when they are set: with the
    excellent option count table, a result item which gets excellent options (by ResultItemExcellentOptionChance, once)
    gets as many as selected, up to the options its definition offers; with the socket count table, a socket result item
    gets its sockets from it and, like a dropped socket item, no excellent options. Without the tables, result items are
    created as before. A result item with its own ExcellentOptionChance uses it instead of the crafting's chance (through
    a new AddRandomExcellentOptions overload; without it, the existing method is called as before, which
    ThirdWingsCrafting overrides).
  • Lord's Mix: LordsMixCrafting refuses, with a message, everybody except the guild master of the castle owner
    guild (CastleSiegeTaxProvider.GetPersistentGuildMasterIdAsync), and refuses when the limit of the period is reached.
    A successful mix is counted and saved under the execution lock of the castle siege context. The count and its date
    are read from the database before the check and before counting, and saved on their own, so the limit also holds
    with several game servers, each with its own copy of the castle siege data. Per day, a count of an
    earlier day (server local time) doesn't count. Per siege cycle, CastleSiegePlugIn resets the count when a running
    siege enters End, also when the castle keeps its owner; a server start in End keeps it.
  • Season 6 data: crafting 18 on the Senior with the ingredients of the client's recipe (30 × Jewel of Guardian, a
    Packed Jewel of Bless and a Packed Jewel of Soul of level 2, 1,000,000,000 zen, 100%). Result: one random entry of
    the list of a fan guide which matches mixes of Global MU Online in videos (thanks @ze-dom): 18 excellent weapons and
    shields and all pieces of 10 excellent armor sets (two to four excellent options, equally likely, with skill), and 10
    normal weapons and armors (skill 50% like a drop); luck 20%. One mix per day.
  • Update: the optional update "Lord's Mix" adds the crafting and its tables to existing Season 6 databases and sets
    the limit to one per day, if there's no limit yet. Optional, because it adds a source of items with more than two
    excellent options.
  • Resources: messages in English, German, Portuguese and Chinese; captions of the new properties; names of the
    crafting, the update and the table in English, German and Chinese.
  • Docs: castle siege and game configuration pages of the docs website.

Notes

  • The result list comes from a fan guide written in 2010 (Season 4/5) and GMO videos of 2013–2019, not from a Season 6
    source; it has no Rage Fighter or Summoner items. The guide's price (100 million) differs from the Season 6 client
    (1,000,000,000), so the client's is used. The list, the chances, the limit and its period are data and can be changed
    in the admin panel.
  • The refusal is CraftingResult.Failed with a blue message, as the original server answers it.

Tests

  • MUnique.OpenMU.Tests: CraftingResultTablesTest (excellent option count 2/3/4 from the table, also above the
    maximum per item; limited without a table; socket count 4/5 from the table; with the socket table no excellent
    options on socket results; without it, socket results as before: no sockets, excellent options by the chance; the
    chance of a result item instead of the crafting's), LordsMixCraftingTest (guild master of the owner passes; assistant master, another guild,
    unoccupied castle and reached limit are refused; limit 0 is unlimited; per day: reached today refused, an earlier
    day not counted, a new day starts again at one; a success is counted and saved; a mix counted by another game server is refused,
    and an owner save of a game server with an old copy keeps the count), the reset in
    CastleSiegeStateMachineTests (per cycle reset at End, kept on a start in End; per day kept at End), and the whole project green (3423).
  • MUnique.OpenMU.Persistence.Initialization.Tests: LordsMixInitializationTest (fresh database, update on an existing
    one, applied twice, an existing limit is kept), the localized update name, and the project green (988).
  • Local server (PostgreSQL, existing database) and the open source client, with the first version of this PR (limit per
    siege cycle, the earlier list): migration and update applied; as the guild
    master of the castle owner, the mix gave an excellent item and a second one was refused with the message; another
    character was refused; zen and items stay when refused.

@codacy-production

codacy-production Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 109 complexity

Metric Results
Complexity 109

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sven-n sven-n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, a well-described addition. The guild-master check, the per-cycle count saved under the castle siege execution lock, and the optional update look sensible. Two things before I run the tests:

  1. Conflict: it conflicts with master in src/Persistence/Initialization/Properties/PlugInResources.Designer.cs. Please rebase, keep both sides' entries in the .resx, and regenerate the designer. Also check the regenerated designers: GameLogic/Properties/PlayerMessage.Designer.cs (~1900 changed lines) and CraftingNames.Designer.cs (~450) look fully rewritten, probably by another generator version or formatting. If they don't need to change that much, please keep the diff to the new entries.

  2. Behaviour change for existing craftings: the SimpleItemCraftingHandler changes aren't limited to the Lord's Mix:

    • "a socket result item gets its sockets from the socket count table, or uniformly between 1 and its maximum without one (it got none before)"
    • "socket result items never get excellent options"

    Both apply to every SimpleItemCraftingHandler crafting which can produce a socket item, in fresh and existing configurations, without an update and without a table. Please either limit the new behaviour to craftings which have the new tables (no table → behaviour as before), or list the existing Season 6 craftings which are affected and explain why the new behaviour is correct for them (observed behaviour, not decompiled code, see rule 9). Then it can be judged as a fix rather than a side effect.


Generated by Claude Code

@ze-dom

ze-dom commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

@pllanosclaria

Copy link
Copy Markdown
Contributor Author

Thanks for the review, both points are addressed:

  1. Conflict and designers: rebased onto the current master (including feat(login): log in with single-use tickets issued through the API #1559; the AddLordsMix migration is regenerated on top of it, same Up/Down). The regeneration commits are gone; each designer now only gets the blocks of the new entries, so the diff is PlayerMessage.Designer.cs +18, CraftingNames.Designer.cs +9, PlugInResources.Designer.cs +18 and WeightedValueTableNames.Designer.cs +36 lines, nothing removed. The large diffs came from regenerating the whole files: the generator sorts the entries, and the designers on master have entries in a different order.

  2. Behaviour of existing craftings: limited to craftings which have the tables (eb1853d). Without ResultItemSocketCountTable, result items are created as before: no sockets, and excellent options by ResultItemExcellentOptionChance. With it, a socket result item gets its sockets from the table and no excellent options. The excellent option count table already only applied when it's set. Tests: SocketResultItemWithoutTableIsUnchangedAsync and SocketResultItemWithTableGetsNoExcellentOptionsAsync; both test projects are green (3323 and 979).

@pllanosclaria

Copy link
Copy Markdown
Contributor Author

Thanks a lot, this is very useful. I changed the PR accordingly (273fde8):

  • Result list: the Season 6 data now follows the guide: the 18 excellent weapons and shields, all pieces of the 10 excellent armor sets, and the normal items (Knight Blade, Dark Reign Blade, Great Lord Scepter, Arrow Viper Bow and the armors of Great Dragon, Dark Soul, Hurricane, Red Spirit and Dark Master). For the normal ones, a result item can now have its own excellent option chance (ItemCraftingResultItem.ExcellentOptionChance), so the same crafting gives some results as excellent and others as normal items. The socket items are gone from the Season 6 data.
  • Limit: the period is configurable now (LordsMixLimitPeriod: per day or per siege cycle); the Season 6 data uses one mix per day, reset at midnight, server local time. The videos fit that too: the mixes of one player are numbered about one per day.

A few things in the guide don't seem to be Season 6, so I didn't take them over:

  • The date: the page was written in September 2010 and last updated in 2013, so it describes Season 4/5 rather than Season 6. The videos (2013 to 2019) are later seasons. That both agree suggests the list didn't change in between, but it's not a Season 6 source.
  • The zen: the guide says 100 million; the Season 6 client's mix.bmd (recipe 18 of the castle senior) asks for 1,000,000,000, so the PR keeps the client's price.
  • Missing classes: the list has no Rage Fighter items (Season 6 Episode 3) and none for the Summoner, so either the list wasn't updated or those classes weren't in the pool; I left them out as the guide does.

The ingredients agree: 30 loose Jewels of Guardian and packs worth 30 Jewels of Bless and 30 of Soul, as in the client recipe.

The list, the excellent option chance of each result item, the limit and its period are data, so a server can change them in the admin panel (the crafting settings of the Senior and the castle siege configuration), e.g. to add Rage Fighter items or to keep a limit per siege cycle. So if the exact Season 6 list turns out to differ, I'd suggest we don't hold the PR back for it: the list can be corrected later, in the data or in the admin panel, while the mechanics stay the same.

@sven-n sven-n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, both points of my review are addressed. The designer diffs now only contain the new entries, and GetsSockets limits the new socket and excellent-option behaviour to craftings which have a ResultItemSocketCountTable, so existing craftings behave as before. The result list following @ze-dom's sources (guide plus GMO videos) and the per-day limit look good, too.

In the meantime, #1547, #1470 and #1569 were merged, so it conflicts again:

  • GameLogic/Properties/PlayerMessage.resx, .de, .pt
  • Persistence/Initialization/Properties/PlugInResources.resx, .de, .zh-CN
  • CompiledModels/EntityDataContext/EntityDataContextModelBuilder.cs: #1547 added WarpInfo.Requirements with its own migration

Please rebase, keep both sides' entries, regenerate the designers and the compiled model, and check that AddLordsMix comes after #1547's migration and that the snapshot contains both. Then I'll run the tests, including the initialization tests.


Generated by Claude Code

(0, 21), // Dark Reign Blade
(2, 12), // Great Lord Scepter
(4, 20), // Arrow Viper Bow
(8, 21), // Great Dragon Armor

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add the Staff of Kundun here, since one of the videos shows that and there is no staff group item here - it seems like a slip up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the Staff of Kundun as a normal result item (7322979).

@pllanosclaria

Copy link
Copy Markdown
Contributor Author

Thanks! Rebased onto the current master (#1547, #1470, #1569):

  • The .resx keep both sides' entries; the designers only get the new entries again.
  • AddLordsMix is regenerated (20261120120100_AddLordsMix), after feat(warps): attribute requirements for warps, sent to the open source client #1547's 20261120120000_AddWarpInfoRequirements; the snapshot and the compiled model contain both. The loader is regenerated too.
  • To keep rebases over the generated files reliable, the branch is now one commit for the feature (cfa93ec) on top of master, plus one for the comment below (7322979). The content is the same as before; the earlier commits are only squashed.

@ze-dom: good catch, I added the Staff of Kundun as a normal result item (7322979).

Both test projects are green locally (3361 and 982).

@sven-n sven-n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the rebase and for adding the Staff of Kundun (ze-dom's thread). This currently merges cleanly with master, but #1578 (Spanish player messages) was merged in the meantime. TranslationCoverageTests.PlayerMessagesAreCompleteAndMatchNeutralPlaceholders("es") now requires every PlayerMessage key in PlayerMessage.es.resx, so your two new messages would make it fail:

  • LordsMixLimitReached
  • LordsMixOnlyForCastleOwner

Please merge master and add both to src/GameLogic/Properties/PlayerMessage.es.resx (with the same placeholders as the neutral texts).

A heads-up: #1548 also touches PlayerMessage.zh-CN.resx, the EF compiled model and PlugInResources.Designer.cs, so whichever of the two is merged second will need a short rebase.


Generated by Claude Code

@pllanosclaria

Copy link
Copy Markdown
Contributor Author

Rebased onto the current master again (#1574, #1577–#1580, #1582):

  • AddLordsMix is regenerated (20261120224437_AddLordsMix), after feat(guild): inactive guild masters lose the position #1574's 20261120130000_AddAccountLastSeenDate; the snapshot, the compiled models and the loader too. The designers still only get the new entries.
  • feat(localization): add Spanish player messages #1578 checks that the Spanish player messages are complete, so I added the Spanish texts of the two Lord's Mix messages. While at it, the "limit reached" message no longer says "in this siege cycle", as the limit can be per day now; it says the mix can be used again in the next period (all five languages).
  • Fix found in our multi-server tests (ad353c1): our local server runs several game servers, and each has its own CastleSiegeContext with an in-memory copy of the castle siege data. The guild master could mix on one game server and then again on another one, whose copy still had the old count; and an owner save of that other server (SaveOwnerAsync, e.g. after a tax change) wrote its old count back. Now the count and its date are read from the database under the execution lock before the check and before counting, and saved on their own (SaveLordsMixCountAsync); CopyScalarState doesn't copy them any more, so the owner saves of other game servers can't overwrite them. Two tests cover it (they fail without the fix): a mix counted by another game server is refused, and an owner save of a game server with an old copy keeps the count.

Now three commits on top of master (301d768, 8b430f4, ad353c1). Both test projects are green locally (3374 and 982).

sven-n commented Nov 21, 2026

Copy link
Copy Markdown
Member

Heads-up: #1548 (item expiration) was merged, so this needs one more rebase (PlayerMessage.zh-CN.resx, EntityDataContextModelBuilder.cs, PlugInResources.Designer.cs). Please also add the two Lord's Mix messages to PlayerMessage.es.resx (see my previous review). Once that's in, I'll run the tests and merge it. #1548 was waiting longer, which is why it went first.


Generated by Claude Code

…ster of the castle owner, limited per day

Crafting 18 of the castle senior, which the Season 6 client offers: only
the guild master of the guild which owns the castle may use it, limited
per day (reset at the server's local midnight) or per siege cycle (reset
when a siege ends). The Season 6 data has the client's ingredients and
price, one mix per day, and the result list of a fan guide which matches
mixes of Global MU Online in videos: excellent weapons and armor with two
to four excellent options, and some normal items.

For that, BaseItemCraftingHandler gets an async precondition hook, before
the price is paid, and SimpleCraftingSettings two optional weighted value
tables for result items (the number of excellent options and of sockets;
without them, result items are created as before). A result item can have
its own excellent option chance. An optional update adds the Lord's Mix
to existing Season 6 databases.
A video of a Global MU Online Lord's Mix shows a normal Staff of Kundun, and
the guide's list has no normal staff.
Each game server has its own castle siege context with a copy of the castle
siege data. The guild master could mix on one game server and again on
another one, whose copy still had the old count, and an owner save of that
server wrote the old count back.

The count and its date are now read from the database under the execution
lock before the check and before counting, and saved on their own; the
owner data save doesn't copy them any more.
@pllanosclaria

Copy link
Copy Markdown
Contributor Author

Rebased onto the current master with #1548: the conflicting .resx keep both sides' entries, AddLordsMix is regenerated after the other migrations (20261121004919_AddLordsMix), with the snapshot, the compiled models, the loader and the designers (only the new entries).

The two Lord's Mix messages are in PlayerMessage.es.resx (they came with the previous round and are kept in this rebase). I also made the Chinese name of the Lord's Mix consistent: some messages and captions said 城主合成, the crafting is called 领主合成.

Three commits on top of master (f613f48, 84225e2, 9f9a3f5). Locally green: the translation coverage tests (11), MUnique.OpenMU.Tests (3423) and MUnique.OpenMU.Persistence.Initialization.Tests (988).

@sven-n sven-n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the rebases. Everything is in now:

  • The new socket and excellent-option behaviour only applies with the new tables.
  • The result list follows ze-dom's sources, including the Staff of Kundun.
  • There's a per-day limit, which also holds with several game servers (9f9a3f56).
  • The Spanish messages are in, and the designers only contain the new entries.

I built it on current master and ran the tests, including Persistence.Initialization.Tests (988 passed). The only failure was LoginTicketServiceTest.ConcurrentIssuersStayWithinTheLimitAsync, a known race in PlayerInMemoryContext on master, which is unrelated.


Generated by Claude Code

@sven-n
sven-n merged commit 0997676 into MUnique:master Nov 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lord's Mix of the castle senior (crafting 18)

3 participants