Repository navigation
feat(items): add the worn horseshoe - #1534
icheat2win wants to merge 23 commits into
Conversation
Adds the Hawk and Goat Figurines and the (Golden) Oak and Maple Charms (13/128-133) of issue MUnique#1339. A right click inside the inventory (BF 20) puts them in use, which is stored in the durability like in the original game (254 in use, 255 not in use). While in use, their power-ups apply. Only one item of the same kind can be in use, and the use ends when the item leaves the inventory. The Worn Horseshoe (13/134) is left out, because there's no attribute for the item drop rate yet. Rebased onto master: this is the change of the earlier commits in one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc76CH3CGWUp5r4XmXWK
The Worn Horseshoe (13/134) is used inside the inventory like the figurines and charms. While it's in use, it adds 0.2 to the Bonus Item Drop Rate, which the client shows as "item drop rate increase 20 %". The update adds the item to existing databases and links its cash shop products; the packages stay not for sale because they're time-limited. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc7AE8XpAUWL9Zc3G1Bv
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 131 |
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.
The Season 6 Episode 3 client shows +100 maximum health and +500 maximum SD for the Golden Oak Charm (13/132), and its ItemAddOption.bmd has the same values. 150 and 50 were the values of older clients. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc7AE8XpAUWL9Zc3G1Bv
# Conflicts: # docs-website/docs/server-features/inventory-charms.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68cfa4bce7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Address the review of the inventory charms: - The durability values which tell whether an item is in use (254, 255) are now part of the InventoryItemUseConfiguration, as the coding rules ask for configurable values. The power-up factory gets the in-use state from its caller instead of checking the durability itself. - Requesting the use of an item which is already in use keeps its power-ups. Recreating them lowered the current health, mana or shield. - An item which leaves the inventory loses its power-ups, even when it was removed from the configuration in the meantime. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
The new optional parameter of IItemPowerUpFactory.GetPowerUps keeps the method group from converting to a Func with two parameters. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
…mmit Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
… chance The Hawk and Goat Figurines raise the chance of a critical or excellent hit by 10%, not the damage of such a hit. The chance attributes are fractions, so the bonus is 0.1. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
…ntory Only one of the Hawk and Goat Figurines, of the Oak and Golden Oak Charms and of the Maple and Golden Maple Charms can be in use at the same time. Each configured item has an exclusive group now (figurines 1, oak charms 2, maple charms 3 by default), which the use action and the inventory check besides the same definition. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e399ac5c72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| this.CreateItem(14, 169, LocalizedString.FromResource(() => ItemNames.RageFighterCharacterCard)); | ||
| this.CreateResetFruits(); | ||
| this.CreateFigurinesAndCharms(); | ||
| this.CreateWornHorseshoe(); |
There was a problem hiding this comment.
Declare the prerequisite on the older cash-shop update
When applying AddCashShopUpdatePlugIn to a database without BonusItemDropRate, its call to CashShopItems.Initialize() now reaches horseshoe creation without declaring the required seal-update dependency. That older update is dated October 7, so a batch can run it before the November 9 seal update; StatsExtensions.GetPersistent then throws on the missing attribute and aborts the batch. The dependency on AddWornHorseshoeUpdatePlugIn does not protect this separate entry point. Declare the prerequisite on the older caller or keep horseshoe creation out of that path, as required by rule 4 of docs/CODING_RULES.md.
AGENTS.md reference: AGENTS.md:L16-L17
Useful? React with 👍 / 👎.
| } | ||
| else | ||
| { | ||
| this.OnItemAddedToInventory(convertedItem ?? item); |
There was a problem hiding this comment.
Synchronize temporary pickup durability with the inventory copy
When picking up a newly generated charm or horseshoe, such as one created by the GM item command, MakePersistent creates a separate inventory item and this hook normalizes only that copy from durability 1 to 255. DroppedItem.TryPickUpAsync copies back only ItemSlot, while PickupItemAction passes the original droppedItem.Item to IItemAppearPlugIn. Consequently, the pickup packet advertises durability 1 instead of the actual inactive state of 255, leaving the client and server with different use-state data. Synchronize the temporary item's durability or serialize the inserted inventory item.
Useful? React with 👍 / 👎.
…arms # Conflicts: # src/GameLogic/ItemPowerUpFactory.cs # src/Persistence/Initialization/Properties/PlugInResources.Designer.cs # src/Persistence/Initialization/Properties/PlugInResources.de.resx # src/Persistence/Initialization/Properties/PlugInResources.resx # src/Persistence/Initialization/Properties/PlugInResources.zh-CN.resx
…n panel The items list was an IList, which the admin panel can't edit, so it couldn't be changed there. It's now an ICollection, which is edited inline. The settings and the fields of the items got localized captions and descriptions. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
# Conflicts: # src/GameLogic/Properties/PlugInResources.resx # tests/MUnique.OpenMU.Tests/UseInventoryItemActionTest.cs
The older cash shop update creates the worn horseshoe, too. On a database without the item drop rate attribute, which the update of the seals adds otherwise, its power-up had no attribute to target. CreateWornHorseshoe now adds the attribute when it's missing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
When a new charm or horseshoe was picked up, only the persistent copy in the inventory got the durability of an item which isn't in use. The pickup packet used the temporary item with the old durability, so the client showed another use state. The temporary item now gets the durability of the added item. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
When a new charm or horseshoe was picked up, only the persistent copy in the inventory got the durability of an item which isn't in use. The pickup packet used the temporary item with the old durability, so the client showed another use state. The temporary item now gets the durability of the added item. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
The update returned English constants as its name and description, so the updates page showed English in other languages. It now returns the resource entries, like the other updates. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0de5d8538c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var success = await base.AddItemAsync(item).ConfigureAwait(false); | ||
| if (success && !this.IsWearingSlot(item.ItemSlot)) | ||
| { | ||
| this.OnItemAddedToInventory(item); |
There was a problem hiding this comment.
Normalize NPC purchases before serializing their item data
If a server offers one of the new inventory-use items through an NPC merchant, BuyNpcItemAction calls NpcItemBoughtAsync(newItem) before Inventory.AddItemAsync(newItem). A merchant template with the new definitions' durability of 1 is therefore serialized into ItemBought, and only this later hook changes the server item to 255; no subsequent durability update is sent. This leaves the client with different use-state data until another update or inventory refresh. Insert and normalize the item before sending the purchase result, or send the corrected durability afterward.
Useful? React with 👍 / 👎.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011xNc75fJTee8EPxDxQxuGi
What it does
Adds the Worn Horseshoe (13/134). Like the figurines and charms of #1470, it's used inside the inventory with a right click. While it's in use, it adds 0.2 to Stats.BonusItemDropRate (added by #1459 for the seals), so monsters roll their item drops with a rate of 1.2.
The value comes from the client: MuMain shows "Item drop rate increase +20%" for ITEM_HELPER + 134 in its item tooltip (ZzzInventory.cpp), and the client already lists 13/134 as an item used inside the inventory (IsInvenItem). The default configuration of the Items used inside the inventory feature plugin already contains 13/134, so no game logic changes are needed.
Changes
CashShopItems.CreateWornHorseshoe() creates the item (1x1, durability 1, power-up BonusItemDropRate +0.2 as internal const).
New mandatory update Add the worn horseshoe: adds the item to existing Season 6 databases and links the cash shop products 463 (packages 356/357). The packages stay not for sale, because their products are time-limited. It depends on AddSealItemDropRateUpdatePlugIn (the attribute) and AddFigurinesAndCharmsUpdatePlugIn.
Name and update texts in en/de/zh-CN.
Docs: server-features/inventory-charms.md lists the horseshoe and drops the "not added yet" note.
Tests
WornHorseshoeDataTest: fresh database, update on an existing database (applied twice), cash shop product linking.
UseInventoryItemActionTest.WornHorseshoeIncreasesItemDropRateWhileInUseAsync.
ItemStatProfilesDataTest: "default: 253".
Ran locally: dotnet test on MUnique.OpenMU.Persistence.Initialization.Tests (WornHorseshoe, FigurinesAndCharms, ItemStatProfilesDataTest, CashShopUpdateTest: 35 passed) and MUnique.OpenMU.Tests (UseInventoryItemActionTest: 9 passed).