Table of Contents

All about Items

This is the builder reference for items — how to create and shape the things that fill the world. Playing with items — picking them up, dropping, wearing, wielding, examining — is covered in How to Play. This page is for builders (the worldbuilder, implementor, or admin role).

Make one.

item create lamp

It lands in your inventory; carry it where you want and drop it. ref below is an item's keyword or its number (id); you can edit items you're carrying or that are in the room with you.

Name and describe.

Data fields. Everything else about an item lives in its data:

Values are typed: true/false become flags, numbers become numbers, anything else is text. An empty value (or false) clears a field — data stores only what differs from the default.

Useful fields:

Combat & equipment bonuses. A weapon's damage and any stat bonuses a worn/wielded item grants live in its data:

+AR is good: armour lowers your to-hit rating (base 100), so onwear-ar 10 makes you ~5% harder to hit. onwear-hitroll and onwear-damroll feed straight into combat — hitroll improves your to-hit, damroll adds to every hit's damage (a hit always lands at least 1). onwear-maxhp and onwear-maxmana raise your maximum HP / mana while the item is worn – the cap only, so equipping never heals you to fill it and taking it off trims the cap back down. Other ability bonuses (str, agi, con…) are recorded and shown on stat, but don't change anything mechanically yet.

Body wear slots: head neck shoulders body arms hands wrists rings pants feet cloak waist (neck, wrists and rings have two each). Apart from those, main (wield) and light are each their own slot, and the off-hand zone holds exactly one of an offhand weapon, a held item, or a shield.

A sign (fixed and readable):

item create sign
item sign desc Welcome to Mossworld. Mind the moss.
item sign data fixed true
drop sign

A lantern (a light source):

item create lantern
item lantern desc A brass lantern, its flame steady behind sooty glass.
item lantern data wear-light true

Now players can light lantern (or just hold it), and examine lantern to read it.

A container (holds other things). Flag an item data container true and players can loot from it and stash into it – a chest, a sack, a corpse. They look it to see the contents, then get item container, get all container, or put item container (see How to Play). Pair it with fixed for a chest or corpse that can't be carried off.

A refreshing corpse. Also flag it corpse true and register it as a zone spawn: each zone reset sweeps the corpse away and respawns it, its coindrop purse rolled anew. Looted once, it sits empty until the next reset, so it can't be farmed dry.

item create corpse
item corpse desc A silk-wound bundle, long dead, something glinting within.
item corpse data container true
item corpse data fixed true
item corpse data corpse true
item corpse data coindrop silver 1-2 100%; copper 7-35 100%
drop corpse
zone setitem corpse

Remove an item. destroy ref — puffs it out of existence.

Spawning and zone resets. An item you create is a single object; once it is taken or destroyed it is gone. To make it repopulate, register it as a zone spawn — zones reset about once an hour and re-create any registered item whose copy is missing.

The item you register stays as the first copy; take or destroy it and the next reset brings another. A picked-up item still counts as “out there”, so it will not double-stack until that instance is gone.

A reset replaces missing copies but does not tear down survivors – an item still lying there keeps whatever changed about it. If you want some flag to snap back to a base state each reset (a searched-out prop to re-hide, a flipped switch to reset), give it an onreset_field directive – see Advanced Building. Without one, a flag simply persists, which is often what you want.

Stackable items

Some things are commodities – interchangeable units with no individual identity: wool, arrows, reagents, cloth. Rather than clutter a pack with fifty separate rows, mark them stackable and identical units collapse into one entry that shows a count, wool (5). Two data fields do it:

A stackable must be a pure commodity: no per-instance state, never worn or wielded, never uniquely named or inscribed – folding many into one has to lose nothing. Buying and selling run per unit (buy 5 wool, sell 3 wool), splitting or merging the stack as needed.

item create wool
item wool desc A tuft of soft, raw wool.
item wool data stack wool
item wool data q 1
item wool data value 2 copper

Now wool gathers into tidy stacks, and a shop sells or buys it by the handful. To make a creature drop a random amount on death, see data dropq in All about Mobiles.

Item blueprints (the item factory)

Once you've shaped an item just right, you can save it as a reusable blueprint and stamp out fresh copies whenever you like — handy for kitting out a zone, and the foundation shops draw on. This is the item factory (itemf), open to worldbuilders, implementors and admins, and to zonebuilders.

A blueprint is keyed by the item's name and remembers its description and data (its capabilities — keywords, wear/wield flags, damage, onwear bonuses, value), but not one-off instance state (whether a particular copy was worn, donated, and so on).

item create torch
item torch desc A stout pine torch, its head wrapped in oiled rag.
item torch data wear-light true
itemf add torch
itemf create torch

Now itemf create torch mints another identical torch any time — which is exactly what a shop wants when it sells from endless stock (see Shops). Copies are independent: editing the blueprint later doesn't touch ones you've already stamped, and re-saving an edited item with itemf force updates the blueprint for future copies.

Rarity, enchantment, and identifying

Items can carry hidden properties that a plain look won't show. Builders set them as data:

These, along with worth, damage, armour and worn-bonuses, stay hidden until something identifies the item. Two ways to do that:

Identifying reveals a fixed set and nothing else: rarity, where it's worn, worth, damage, armour, stat modifiers, what it casts, and the cursed / blessed / enchanted / engraved / named flags.

Scrolls (and magic items)

A scroll is an item marked data scroll true with a data skill naming what it does. recite invokes that skill at full effect and consumes the scroll:

item create scroll
item scroll name scroll of identify
item scroll desc A yellowed scroll, its script crawling with sigils.
item scroll data scroll true
item scroll data skill identify
item scroll data value 1 silver

The data skill field is the bridge between items and abilities: the same skill can be a class power (a Woodsman trains identify and uses id directly) or be lent by an item once.

Potions use the same machinery with a different verb: mark one data potion true and drink it with quaff (short q). A potion of healing is data potion true + data skill healingpotion (heals 8-12, consumed). The trainable healing spell (a Wizard skill, cast healing) is a separate ability and costs mana.

Teleport scrolls carry data skill teleport plus a data goto list of destination rooms – IDs and/or names, comma-separated. Reciting one picks a destination at random:

item create scroll
item scroll name scroll of teleport
item scroll desc Spidery runes promise passage to somewhere far away.
item scroll data scroll true
item scroll data skill teleport
item scroll data goto 10,40,castle,graveyard,28

If the room it picks can't be found (a bad id or name), it fizzles – POOF… nothing happens! – and the scroll is not consumed, so you can try again. (Wands and staves arrive later.)

Puzzles and interactive props

Items can become interactive props — things you disturb, locks you open with the right key, secret ways that appear. That toolkit — invisible items, verb hooks, locks and keys, openables, and object exits — has its own page: Advanced Building.

See also: Advanced Building, All about Mobiles, How to Play, How to Build.