Skip to content

Engraved rings

A jeweler engraves a ring or a wedding band for a player: a text of up to 60 characters inside it, for a wedding, a friendship or a keepsake. The ring is made on the spot for gold, and the text shows in its tooltip.

  1. Walk up to a jeweler. Pick Engraving: in its context menu (the client’s own text for it), or say its name and the word engrave, such as “Gilbert, engrave a ring for me”, from 4 tiles.
  2. A gump opens with a field for the text. Type it, then press the button of the ring (500 gold) or of the wedding band (1000 gold). Cancel closes the gump.
  3. The jeweler says the price and remembers the order. Drop exactly that gold on it, from 2 tiles or closer.
  4. The ring is in your backpack. Anyone sees what is engraved in its tooltip, and a double click tells you the text.

The jeweler takes only the exact amount: any other gold goes on as for any vendor (it pays a lesson the jeweler quoted, or comes back to you) and the price is said again. An order lives in the memory of the server for ten minutes, one for each jeweler and player: a new one replaces the last, Cancel or an empty text forgets it, and after a restart you order again. A ghost pays nothing.

Control characters are removed, the spaces at both ends are trimmed and the text is cut at 60 characters. <, > and a leading # are removed too: the text is shown in a tooltip, where they would be read as markup or as a reference to a text of the client. The ring is blessed, so a dead wearer keeps it, and it never decays on the ground. The ring is made before the gold is taken, so a backpack with no room loses nothing: the jeweler says so and the order stays.

The vendors whose mobile template is jeweler, m_jeweler or f_jeweler. The list and the prices are the constants JEWELERS and KINDS of scripts/common/engraving.lua: change them there.

The entry of the menu uses the client’s text Engraving: because an entry names a client text by its number, and the client has no text for “Engrave a ring”.

File What it is
templates/items/misc/engraved-rings.toml the templates engraved_ring and engraved_wedding_band: the graphic of a ring (0x108A), layer ring, not stackable, never decaying, blessed, script_id = "engraved_ring"
scripts/common/engraving.lua the menu entry, the word, the order, the price and the payment
scripts/mobiles/shopkeeper.lua, scripts/common/shop.lua the vendors that call it: the entry, the word and the gold dropped
scripts/items/engraved_ring.lua on_use tells the text, on_tooltip adds the line Engraved: …
templates/gumps/ring_engrave.xml and scripts/gumps/ring_engrave.lua the gump; the script builds the field and the buttons and takes the order

The text lives in the prop ring.text, saved with the item. The gump does not trust the answer of the client: the order asks again that the vendor is a jeweler, that the player is alive and within 8 tiles of it, and it cleans the text. The gold is the template gold_coin.

The ordinary ring and weddingband templates that the jewelers sell and the loot gives are unchanged: they carry no text.

Made with ❤️ by Tom

Buy me a coffee