Script used to generate randomized spellbooks for TTRPGs
Run the Generate Spellbook Action and refresh the page. The spellbook should be printed out at the end of the Generate Spellbook step. It will look like:
2024-06-06 15:49:11,991 - SpellbookRandomizer - INFO - Found cleric 2 spellbook contains:
2024-06-06 15:49:11,992 - SpellbookRandomizer - INFO - Level 1 Detect Magic
To install all dependencies for the project you must have:
- Python 3.8 or higher
- pdm
then run the command pdm install from the root folder.
spellbook_randomizer.py [-h] --spells_folder SPELLS_FOLDER --system SYSTEM --caster_class CASTER_CLASS
[--caster_level CASTER_LEVEL] [--custom_allocation [CUSTOM_ALLOCATION ...]]
options:
-h, --help show this help message and exit
--spells_folder SPELLS_FOLDER
Path or URL to the spells files
--system SYSTEM Which game system are we generating a spellbook for? System JSON file must exist in spells folder.
--caster_class CASTER_CLASS
What is the owning caster's class? Must be a class found in System JSON file.
--caster_level CASTER_LEVEL
What is the level of the owning caster? Default 3
--custom_allocation [CUSTOM_ALLOCATION ...]
An array of spells to be found in spellbook per level. Ex: 2 0 1 would give 2 first level and 1 third level spells.
This will give an elf spell book with 2 first level and 1 third level spells:
spellbook_randomizer.py --spells_folder "./spells" --system ose --caster_class elf --caster_level 1 --custom_allocation 2 0 1