Skip to content

feat(inventory): ask before dropping an expensive item - #1288

Open
openmubr wants to merge 1 commit into
Mutizens:mainfrom
openmubr:pr/confirm-expensive-drop
Open

openmubr wants to merge 1 commit into
Mutizens:mainfrom
openmubr:pr/confirm-expensive-drop

Conversation

@openmubr

@openmubr openmubr commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

What

Dropping a jewel, an excellent, ancient or +7 item (everything IsHighValueItem covers) on the ground is refused with "You are not allowed to drop this expensive item". The server accepts the drop, and players use it, for example to hand items over or to get rid of an excellent item.

This PR replaces the refusal with a confirm dialog, in the same shape as the one NPCShop shows before selling such an item: item preview, "An Expensive item!", "Drop ?", OK/Cancel.

  • OK sends the drop request (to the clicked tile, or the hero's tile for the right-click drop).
  • Cancel or Esc puts the item back in the inventory or equipment slot it came from.
  • Drop-banned items (IsDropBan) are still refused. The ban check now runs before the question.
  • Harmony-reinforced items are still refused. The right-click path relied on the high-value refusal for them, so it now checks for them itself.

If keeping the original refusal matters for the default client, I can put this behind an option instead.

Files

  • UI/Inventory/InventoryActionController.h/.cpp: ConfirmExpensiveItemDrop(tx, ty), used by both drop paths; its Cancel button uses the translated text.
  • UI/Inventory/MyInventory.cpp: the drag-to-ground path asks instead of refusing.
  • Localization/Game.{en,es,pt}.resx: new key DropItemQuestion (other locales fall back to English).

The text You are not allowed to drop this expensive item is no longer used by the code; I left it in the resx files.

Testing

In game, web build (Emscripten, Chrome) of the same code change on our fork, against a local OpenMU (-demo), Blade Knight, Portuguese:

  • Drag a Jewel of Soul to the ground: the dialog opens; Cancel puts it back; OK drops it (one encrypted request sent, the jewel is on the ground).
  • Right-click a Jewel of Bless: the dialog opens; Esc puts it back; OK drops it at the hero's feet.
  • Drag the worn armor (+13) to the ground: the dialog opens; Cancel puts it back in the equipment slot.

Not tested: the native Windows build, a build of this branch on its own, drop-banned and harmony-reinforced items.

🤖 Generated with Claude Code

Releasing a jewel, an excellent, ancient or +7 item on the ground (or right
clicking it) was refused. It now asks "Drop <item>?": OK sends the drop,
Cancel puts the item back. Drop-banned and harmony-reinforced items are still
refused.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant