import NPC from 'dnd-npc';
const obj = {
raceType: "warforged",
subRace: "juggernaut",
classType: "fighter"
}
const npc = new NPC(obj)
// Generates a Warforged-Juggernaut Fighter
const character = await npc.generate();
import NPC from 'dnd-npc';
const npc = new NPC()
.setRace("warforged", "juggernaut")
.setClass("fighter");
// Generates a Warforged-Juggernaut Fighter
const character = await npc.generate();
You can overwrite settings that you have already input.
import NPC from 'dnd-npc';
const obj = {
raceType: "warforged",
subRace: "juggernaut",
classType: "fighter"
}
const npc = new NPC(obj)
.setRace("human")
.setClass("bard");
// Generates a Human Bard (why u make Bard tho?)
const character = await npc.generate();
Passing a sub-race as the raceType and it will generate with the correct race and sub-race.
import NPC from 'dnd-npc';
const npc = new NPC({ classType: "juggernaut" });
// Generates a Warforged-Juggernaut with a random class.
const character = await npc.generate();
Leaving the raceType or classType blank, or passing an invalid type to it, will result in that thing being randomly generated.
import NPC from 'dnd-npc';
const npc = new NPC({ raceType: "warforged" });
// Generates a Warforged with a random sub-race and class.
const character = await npc.generate();
import NPC from 'dnd-npc';
const npc = new NPC({ classType: "fighter" });
// Generates a fighter with a random race
const character = await npc.generate();
import NPC from 'dnd-npc';
const npc = new NPC();
// Generates a completely random character.
const character = await npc.generate();