jbhaywood / 5e-statblock-importer

A module for FoundryVTT that creates a new actor from any 5e monster or NPC statblock.
MIT License
18 stars 14 forks source link

Inconsistencies with x/day spells #61

Closed Christian-Brungart closed 10 months ago

Christian-Brungart commented 11 months ago

Howdy, first want to thank you for the stat importer. It's really saved me hours and hours of time in my game prep. However, I've found that I've run into a lot of issues specifically with importing spells. Especially if said spells are x/day styled. Even taking the example import of Glabrezu yields this: image

Instead of this: image

I'm not sure if I'm missing something in the coding or text, but I've found when trying to import stat blocks of spellcasters that it will typically throw everything into the At-Will section unless the spells are specifically assigned a level. As an example, importing this:

Spellcasting. The archmage is an 18th-level spellcaster. Its spellcasting ability is Intelligence (spell save DC 17, +9 to hit with spell attacks). The archmage can cast disguise self and invisibility at will and has the following wizard spells prepared: Cantrips (at will): fire bolt, light, mage hand, prestidigitation, shocking grasp 1st level (4 slots): detect magic, identify, mage armor, magic missile 2nd level (3 slots): detect thoughts, mirror image, misty step 3rd level (3 slots): counterspell,fly, lightning bolt 4th level (3 slots): banishment, fire shield, stoneskin 5th level (3 slots): cone of cold, scrying, wall of force 6th level (1 slot): globe of invulnerability 7th level (1 slot): teleport 8th level (1 slot): mind blank 9th level (1 slot): time stop

Yields this: image

Whereas this: Spellcasting. The warlock is a 9th-level spellcaster. Its spellcasting ability is Charisma (spell save DC 15, +7 to hit with spell attacks). It regains its expended spells when it finishes a short or long rest. All spells cast in this way are cast at the 5th level. It knows the following warlock spells: Cantrips (at-will): booming blade, eldritch blast, mage armor, prestidigitation 2/day: darkness, dispel magic, hex, hold person, mirror image, sickening radiance,

Yields this: image

Adding another example in case Warlocks are a weird case, this one being a bard: Spellcasting. The bard is a 9th-level spellcaster. Its spellcasting ability is Charisma (spell save DC 15, +7 to hit with spell attacks). It has the following bard spells prepared: Cantrips (at will): mage hand, minor illusion, vicious mockery 1/day each: greater invisibility, hold person, hypnotic pattern, legend lore, major image, polymorph 3/day each: charm person, detect magic, faerie fire, healing word (2nd level)

image

Sorry for the long winded text but I honestly don't know if it's something on my end or if I'm not doing the x/day input correctly.

jbhaywood commented 10 months ago

The parser is following the text of the statblock. If a spell is "at will" then it means that the creature can cast it as much as they want without consuming spell slots. If it were to create them as leveled spells, then they would have to be constrained to a number of spell slots. "Innate spellcasting" is inherently different than "spellcasting". Take a look here.

Taking the Glabrezu as an example, it matches the character sheet of the one that comes as part of the 5e system in Foundry. image

About the archmage and others you mentioned. where are those spellcasting blocks coming from? Here's the one for archmage in the SRD...

Spellcasting. The archmage is an 18th-­‐level spellcaster.
Its spellcasting ability is Intelligence (spell save DC 17,
+9 to hit with spell attacks). The archmage can cast
disguise self and invisibility at will and has the following
wizard spells prepared:
Cantrips (at will): fire bolt, light, mage hand,
prestidigitation, shocking grasp
1st level (4 slots): detect magic, identify, mage armor,*
magic missile
2nd level (3 slots): detect thoughts, mirror image, misty
step
3rd level (3 slots): counterspell, fly, lightning bolt
4th level (3 slots): banishment, fire shield, stoneskin*
5th level (3 slots): cone of cold, scrying, wall of force
6th level (1 slot): globe of invulnerability
7th level (1 slot): teleport
8th level (1 slot): mind blank*
9th level (1 slot): time stop

You can see that it lists out each level separately, which would result in what you would expect. If a book is formatting that block differently I'll have to add special support for it.