diff --git a/howto-build-map.md b/howto-build-map.md index 4728553..0df6ee8 100644 --- a/howto-build-map.md +++ b/howto-build-map.md @@ -29,4 +29,139 @@ Now, the tile layers: * hiddenTiles: Exactly like hiddenWalls, except for tiles. * walls: A wall tile is any tile that causes the player to collide. It doesn't have to be a wall or even a tree. It could be a regular ground tile too. Just remember that placing a tile in this layer would cause the player to not be able to walk there. * doodads: This layer does not cause collisions and is rendered brighter than the tile layer. -* tiles: Regular tiles that don't collide and are rendered fairly dim. Use this for all ground tiles like carpets, grass, dirt and water. \ No newline at end of file +* tiles: Regular tiles that don't collide and are rendered fairly dim. Use this for all ground tiles like carpets, grass, dirt and water. + +[I'll write the rest of this section later] + +##### The Zone File + +An empty zone file looks like this: + +``` +module.exports = { + resources: { + + }, + objects: { + + }, + mobs: { + + } +}; +``` + +The different sections are: +* resources: Used for herbs that should spawn in the zone. +* mobs: Used for enemy mobs and NPCs. +* objects: This is used for everything else. For instance: portals (to other zones), doors, light sources, dialogue triggers, or anything that emits particles. + +###### Resources + +The resources section is fairly straight-forward. Here's an example: + +``` +resources: { + Moonbell: { + type: 'herb', + max: 5 + } +} +``` + +The key (Moonbell) tells the game which type of herb should spawn. Options are: +* Moonbell +* Skyblossom +* Emberleaf + +The `max` variable defines how many nodes can be active at the same time. + +###### Mobs + +Besides definitions for specific mobs, any of these values can be defined for mobs in a `default` key: + +``` +mobs: { + default: { + level: 1, + faction: 'gaekatla', + walkDistance: 1, + + spells: [{ + type: 'melee', + statMult: 0.1356 + }], + + regular: { + hpMult: 1, + dmgMult: 1, + + drops: { + chance: 35, + rolls: 1 + } + }, + + rare: { + count: 1, + chance: 1, + + hpMult: 1, + dmgMult: 1, + + drops: { + chance: 100, + rolls: 1, + magicFind: 75 + } + }, + + champion: { + hpMult: 1, + dmgMult: 1, + + drops: { + chance: 100, + rolls: 2, + magicFind: 115 + } + } + } +} +``` + +Over and above that, you can also define a section that's specific to your mob. As an example, let's say you've got a mob named `Brutus`. His section could look like this: + +``` +mobs: { + brutus: { + level: 5, + walkDistance: 0 + } +} +``` + +Note that the name has to be lower case here. If his name was `Brutus the Defender` you would use `'brutus the defender'` as his key. From here you can customize Brutus further by allowing him to be a rare mob 20% of the time and giving him 3 chances to drop an item with each roll being a 50/50: + +``` +mobs: { + brutus: { + level: 5, + walkDistance: 0, + + regular: { + drops: { + rolls: 3, + chance: 50 + } + }, + + rare: { + count: 1, + chance: 20 + } + } +} +``` + +Remember, drops are defined for regular, rare and champion. Just because we gave Brutus 3 drops, doesn't mean he'll drop 3 items if he's rare, we need to define that separately. Alternatively, we can set it globally for the map too. \ No newline at end of file