Skip to content

Items & Equipment

TalesMUD’s item system uses a template/instance pattern. Templates are blueprints; instances are the actual items players carry. Every item has a type, quality, and optional equipment slot.

TypeDescription
weaponEquippable to a hand slot; has damage attribute
armorEquippable to a body slot; has defense attribute
consumableUsed up when consumed; typically triggers a Lua script
currencyStackable money (Copper Bits, Silver Marks)
questQuest-specific items; often CopyOnPickup
collectibleCollectible items, stackable loot
crafting_materialComponents for crafting (future system)
SubTypeDescription
swordOne-handed sword
twohandswordTwo-handed sword (occupies both hand slots)
axeAxe
spearSpear
shieldShield (off-hand)

Items have visual quality indicators shown in the game client:

QualityColorDescription
normalWhiteCommon drops
magicBlueBetter-than-average
rareYellowNotable items
legendaryOrangePowerful, notable lore
mythicPurpleUnique world items
SlotDescription
headHead slot
chestChest/armor slot
legsLeg armor
bootsFootwear
handsGloves
neckAmulet/necklace
ring1Left ring
ring2Right ring
main_handPrimary weapon
off_handSecondary weapon or shield

Templates are blueprints stored in the database with isTemplate: true. Instances are created from templates when:

  • A player picks up a room item
  • A loot table drops an item
  • A quest reward is granted
  • A script calls tales.game.giveItem()

Instances have a templateId pointing to their source and a unique instanceSuffix.

Via the Creator UI: Items → New

Or via the REST API:

Terminal window
# Create a weapon template
curl -X POST http://localhost:8010/api/items \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Iron Shortsword",
"description": "A serviceable iron shortsword. Nothing special, but reliable.",
"isTemplate": true,
"type": "weapon",
"subType": "sword",
"slot": "main_hand",
"quality": "normal",
"level": 1,
"attributes": {
"damage": 5
},
"basePrice": 25
}'
Terminal window
# Create a consumable template
curl -X POST http://localhost:8010/api/items \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Weak Health Potion",
"description": "A small vial of red liquid. Tastes like iron filings.",
"isTemplate": true,
"type": "consumable",
"quality": "normal",
"stackable": true,
"maxStack": 10,
"consumable": true,
"basePrice": 5,
"onUseScriptId": "SCR_HEAL_WEAK"
}'

Items use a flexible attributes map for stats:

{
"attributes": {
"damage": 5, // Weapon damage (for weapons)
"defense": 2, // Armor value (for armor)
"armor": 1 // Alternative armor field
}
}
PropertyDescription
stackableCan hold multiple in one inventory slot
maxStackMaximum stack size
consumableConsumed (removed/decremented) on use
noPickupCannot be picked up by players
copyOnPickupCreates a personal copy when picked up
boundToCharacterIdBound to a specific character — cannot be traded

Quest items that should only be picked up once use copyOnPickup: true. When a player picks up a copyOnPickup item:

  1. A new instance is created specifically for that character
  2. The original stays in the room for other players
  3. A collected_item:<templateID> flag is set on the character
  4. The character cannot pick up another copy

Add items to rooms via the Creator UI (Room → Items) or API:

Terminal window
# Create an item instance in a room
curl -X PUT http://localhost:8010/api/rooms/ROOM_ID \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"items": [
{ "templateId": "ITM0001", ... }
]
}'
CommandDescription
pickup [item]Pick up an item from the room
drop [item]Drop an item
equip [item]Equip an item
unequip [slot]Unequip an item
equipment / gearShow equipped items
inventoryShow inventory
use [item]Use/consume an item
examine [item]Detailed item description
destroy [item]Delete an item permanently