= 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.** * **item //ref// name //new name//** — rename it * **item //ref// desc //text//** — set the examine text players read **Data fields.** Everything else about an item lives in its **data**: * **item //ref// data //field// //value//** — set a field * **item //ref// data** — list the item's data fields 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: * **data keywords //word word…//** — extra words to refer to it (e.g. **data keywords penny copper**) * **data fixed true** — can't be picked up (signs, gravestones, statues) * **data wear-wield true** — a weapon that can be **wield**ed in the main hand * **data wear-offhand true** — a weapon light enough for the **off hand**: a weapon can only be **offhand**ed if it has this. (Give a one-handed weapon both **wear-wield** and **wear-offhand** so it works in either hand.) * **data wear-hold true** — can be **hold**-held (talisman, orb, trinket) * **data wear-light true** — a light source (players **light** it, or **hold** it when it does nothing else) * **data wear-shield true** — a shield (players **wear** it; it takes the off-hand zone) * **data wear-//slot// true** — can be worn on that body slot * **data wear-default //slot//** — for an item wearable several places, its default **Combat & equipment bonuses.** A weapon's damage and any stat bonuses a worn/wielded item grants live in its data: * **data damage //dice//** — a weapon's damage as a dice expression (e.g. **1d6**, **2d4+1**). A wielded weapon's damage replaces your bare-handed **1**. * **data onwear-//stat// //n//** — a bonus applied //while the item is worn or wielded//, and removed the instant you take it off (nothing is stored on you — your gear is summed live, so it never drifts). Examples: **data onwear-ar 10** (armour: harder to hit), **data onwear-hitroll 1** (hit more often), **data onwear-damroll 1** (hit harder), **data onwear-maxhp 10** (+10 to your HP cap while worn), **data onwear-maxmana 10** (+10 mana pool), **data onwear-str 1**. Negative values are penalties (a cursed ring: **data onwear-ar -5**). //+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.// * **data droprate //pct//** — for an item a mobile carries: the chance (**10** or **10%**) it drops into the corpse when the creature dies. Left off, it always drops. See **[[All about Mobiles#Giving a mobile gear|rare drops]]**. 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. * **data container true** -- makes it a container * **data coindrop //spec//** -- give it a coin **purse**, rolled fresh every time it spawns. One spec is **//type// //min-max// //chance%//** (**copper 7-35 100%**); join several with **;** for a mixed handful. 100% always pays; a lower chance makes it a gamble. **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. * **zone setitem //item// [//room#//]** — register an item (carried or on the ground here) to respawn; the room defaults to where you stand * **zone setitem //item// //spawn#//** — //replace// that spawn: give an existing spawn number instead of a room and the old entry (with its items) is swapped for the thing here * **zone items** — list this zone's item spawns (each shows a //#//) * **zone items //#//** — spawn a copy now * **zone remitem //#//** — stop it from spawning 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#Resetting flags on a zone reset|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: * **data stack //key//** -- the //fungibility key//. Any two items sharing the same key are treated as identical and **merge** wherever they meet -- picked up, **get all**'d, looted from a corpse, dropped, given, or bought. Give every wool the key **wool**. * **data q //n//** -- how many units this stack holds (default 1). 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#Stackable loot|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). * **itemf add //item//** — snapshot a carried or in-room item into the factory, under its name. Won't overwrite an existing blueprint of that name. * **itemf force //item//** — the same, but overwrite a blueprint that already exists. * **itemf create //item//** (or **itemf get //item//**) — stamp a fresh copy into your inventory (name match is exact first, then by prefix) * **itemf list //[keyword]//** — list every blueprint, or just those whose name matches * **itemf remove //item//** (or **itemf rem**) — delete a blueprint {{{ 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: * **item //ref// data rarity //tier//** — //common// (the default), //uncommon//, //rare//, and so on * **item //ref// data cursed true** / **blessed true** / **enchanted true** — a magical condition * **item //ref// data engraved //text//** — an inscription (//item ring data engraved Property of the King//) * **item //ref// data named //name//** — a proper name (//item sword data named Foe-Cleaver//) These, along with worth, damage, armour and worn-bonuses, stay **hidden** until something **identifies** the item. Two ways to do that: * **id //item//** (or **identify //item//**) — the Woodsman **identify** skill. Train it at a trainer; it rolls against your proficiency, and a miss reads //"You can't quite figure it out... yet!"// Using the skill takes a few seconds of concentration — //"You study the camping knife."// — and typing //any// other command breaks that concentration (//"You stop studying the knife."//), so it rewards a little patience. * **recite //scroll// //item//** (or **rec //scroll// //item//**) — read a scroll of identify on the item. Always succeeds and is **instant**, and the scroll crumbles to dust. 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]]**.