In Ranvier all NPCs for an area are defined in a single file within the area folder:
- id: rat keywords: ['rat'] name: 'Rat' level: 2 description: "The rat's beady red eyes dart frantically, its mouth foaming as it scampers about." script: '1-rat' items: ['limbo:sliceofcheese'] quests: ['limbo:onecheeseplease'] attributes: health: 100 speed: 2.5 damage: 1-7 - id: wiseoldman keywords: ["wise", "old", "man"] name: "Wise Old Man" description: "A wise looking old man sits on the ground with legs crossed." - id: 3 keywords: ["dummy", "target", "practice"] level: 2 name: "Training Dummy" behaviors: lootable: table: pools: - "limbo:junk" - "limbo:sliceofcheese": 25
Here we have two NPCs. The rat can enter combat, has a custom script, a default inventory, hands out a quest and has some extra attributes. The old man is the most basic NPC you can have.
- required NPC id, unique among the NPCs of the current area
- required String displayed when the player sees the NPC in the room
- required Keywords that the player can use to target this NPC, keywords do not need to be unique
- required String displayed when the player looks directly at the NPC
- Name of custom script to attach to this NPC (See Scripting)
- List of behaviors to attach to this NPC. The key is the behavior name, the value is the configuration object for that behavior. (See Scripting for creating behaviors)
- A place to put other data you want to access inside scripts/behaviors/commands/etc. that doesn't fit into one of the existing properties. See
Character.setMeta. Note: changes to metadata while the server is running will be lost when the server is shut down.
- Arbitrary list of attributes to attach to this NPC. Unlike items, these attributes will be turned into an AttributesMap (see
src/Character, so these are not arbitrary.
- List of Entity References representing the NPC's default inventory
- List of Entity References representing the quests that this character gives out (See Quests)