Skip to content

Secure trade

Two players trade items and gold in a window with a box each: both see both boxes, each ticks “accept”, and only when both have ticked, and nothing changed since, what each box holds goes to the other’s backpack. It is ModernUO’s secure trade.

Drop an item on another player, from 2 tiles away or less. The trade window opens on both screens, with the item in your box. The other player drops its items into its own box the same way.

A trade is refused, with the client’s text, when:

Cause Text
The other player is dragging something “You cannot trade with someone who is dragging something.” (1062727)
You are already trading with someone else “You are already trading with someone else!” (1062781)
The other player is trading with someone else “That person is already involved in a trade” (1062779)
The item would not fit in the other’s backpack by weight or number “The recipient of this trade would not be able to carry this.” (1004039)
You would not be able to hold it back if the trade failed “You would not be able to hold this if the trade failed.” (1004040)
The other is farther than 2 tiles the client’s “That is too far away.”

Nothing is said when the other player is a ghost, not a player, or you drop on yourself.

  • You drop items and gold into your box, the one at the bottom of the window. Dropping into the other’s box is refused, and so is lifting an item out of a box, dropping onto a bag inside a box, or using what lies in one: to get your items back, cancel.
  • Each player has a checkbox. Ticking it tells the other. An item added to either box clears both checkboxes at once. Any other change, such as a stack that grows or shrinks, voids a tick given before it: the swap does not happen until both tick again.
  • With both ticked the server checks again that each backpack can carry what it is given by weight, then the items change hands. An item that finds no free place in the backpack lies on the ground at the feet of its new owner.
  • The two players stay within 2 tiles of each other on the same map. A step or a teleport that breaks it cancels the trade, as in ModernUO.
  • A player whose inventory is being changed by something that spans a save, such as a book attachment being claimed, starts and completes no trade until that is done.
Cause What happens
A player closes the window, or the two get farther than 2 tiles or onto another map every item goes back to its owner’s backpack, both windows close
A player dies, leaves the game or is disconnected the same, before anything else is done to that player
The server stops or crashes in the middle of a trade the box is a worn item that is saved with its owner: the next time that player enters the world, its box is emptied into its backpack and removed, and nothing is shown

A crash right after a trade completed can give the items back to their old owner, never to both: the new owner’s items are saved with it, as it is for a theft.

A box is an item of the template secure_trade_container (graphic 0x1E5E) worn at the layer Trade. It is left out of the paperdoll, of what a mobile carries (world.carries); item.owner still names the player who wears it. There is no event or hook for a trade yet.

Platinum and the ledger of the newer clients (ModernUO’s account gold), the “refuse trades” setting, and the transfer of a pet with a trade window, which has its own slice. The trade of a vendor of a player is not built either.

Made with ❤️ by Tom

Buy me a coffee