Optional gameplay roles with stat modifiers, starter kits, and restrictions.
Character Classes
Classes are optional. A world with no classes plays exactly as it does today — every character can use everything. Author one or more and you get roles that shape what a character is good at and what they're allowed to touch.
Classes live in Database → Classes.
What a Class Defines#
| Field | Effect |
|---|---|
| Name / description / icon | What players see when choosing |
| Selectable at creation | Whether new characters can pick it (leave off for classes granted later) |
| Additive stats | Flat bonuses (e.g. +5 attack, +20 max HP) |
| Multiplier stats | Percentage modifiers (e.g. ×1.1 move speed) |
| Starter items | The kit a new character of this class begins with |
| Starter abilities | Abilities granted on creation |
| Innate element | An element applied to this class's attacks |
| Element / status rates | Innate resistances and vulnerabilities (id → multiplier, 1 = normal) |
| Sort order | Where it appears in the list |
Restrictions#
Restrictions are the enforcement half, and every one of them is checked on the server at equip, use, and cast time — not just hidden in the UI:
| Restriction | Blocks |
|---|---|
| Forbidden equip slots | Equipping anything into a slot (e.g. a monk who can't use an off-hand) |
| Forbidden weapon types | Wielding those authored weapon types |
| Forbidden armor types | Wearing those authored armor types |
| Forbidden item tags | Using or equipping anything carrying the tag |
| Forbidden item ids | Specific items |
| Forbidden ability ids / tags | Learning or casting those abilities |
A character with no class has no restrictions, so classes are purely additive to an existing world — you can introduce them without invalidating anyone's gear.
How a New Character Is Built#
Three authored layers combine, in this order:
- World defaults — the base stat line every character starts from, plus Characters → Starting Inventory and the world's starter abilities.
- The template — its stats replace the world's for any stat it sets, and its starter items, abilities and starting currency are added on top. A stat the template leaves blank keeps the world value.
- The class — additive stats apply first, then multiplier stats, so a class with +30 max HP and ×0.75 max HP reads as "thirty more, then three-quarters of the result" no matter which box you filled in first. Its starter items and abilities are added last.
Starter items from all three layers merge: the same item granted twice becomes one stack, capped at what a single stack can hold, so a world sword plus a class sword is one sword rather than two entries.
Starter gear starts worn. On a new character's first login, each starter weapon, shield, piece of armour, accessory or tool goes straight into its empty equipment slot, the way RPG Maker's initial equipment does. A Warrior class with a sword and shield logs in holding them, with the sword's abilities already on the action bar. Consumables, pets and mounts stay in the bag, and so does anything the character isn't allowed to wear (a class restriction or an item requirement it doesn't meet). When two starter items want the same slot, one is worn and the other waits in the bag; a two-handed weapon takes the main hand and leaves a starter shield in the bag.
A character's stats are captured once, at first login, and saved to that character. Retuning a class afterwards changes new characters of that class — it does not silently rewrite anyone who has been levelling.
Gotchas#
- Don't grant what you forbid. A class that lists an ability in Starter abilities and in Forbidden ability ids hands the player a spell that then refuses to cast, with the hotbar slot looking perfectly normal. Same for starting gear whose weapon or armour type the class forbids — it lands in the bag and can never be worn.
pnpm --filter @ed5-mmo-studio/db verify:seedfails on both. - Starter items only arrive if the character has no saved inventory — that is, on their very first login. Adding an item to a class later does not retroactively hand it to existing characters.
- Want a tutorial step where the player equips their first weapon themselves? Don't make it a starter item — starter gear is already worn. Hand the weapon over from a quest reward or an NPC instead.
- A template's starting currency replaces the world default rather than adding to it. Leave it at zero and the character gets the world's starting silver.
- Innate element and rates come from the class, not the template — a class's element is the affinity the effectiveness matrix tests against when something hits that character.