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

Better support for spells (was Failed Import) #23

Closed Zamrod closed 4 months ago

Zamrod commented 2 years ago

The following stat block from an Adventurer's League adventure fails to import in a couple of ways:

  1. Telepathy 1,000 ft. is imported as "Telepathy 1;000 ft."
  2. The second ability, Cryogenic Regeneration isn't imported as its own ability, it gets added to Alien Mind as more text
  3. The spells aren't imported with 1/day or at-will
  4. The spellcasting ability is set to Intelligence instead of Charisma
  5. The spell psychic scream didn't import at all.
  6. Flung into the Far Realm isn't imported as a legendary action and is instead added to the text of the ability above it.

There's also issues with Mythic Actions but since I don't think those are currently supported in the system, I'll just need to make due.

FATHER LLYMIC
Gargantuan Aberration (Elder Evil), Chaotic Evil 
Armor Class 21 (natural armor) 
Hit Points 312 (16d20 + 144) 
Speed 50 ft., fly 30 ft. 
 STR DEX CON INT WIS CHA 
 24 (+7) 18 (+4) 28 (+9) 25 (+7) 18 (+4) 22 (+6)
Saving Throws Con +16, Wis +11, Cha +13 
Skills Arcana +14, Deception +13, Insight +11, Intimidation +13, 
Perception +18, Persuasion +13, Stealth +11 
Damage Vulnerabilities radiant 
Damage Resistances acid, fire, lightning; bludgeoning, piercing, 
and slashing from nonmagical attacks 
Damage Immunities cold, necrotic, psychic 
Condition Immunities charmed, deafened, frightened, stunned 
Senses truesight 120 ft., passive perception 28 
Languages all, telepathy 1,000 ft. 
Challenge 23 (50,000 XP) Proficiency Bonus +7 
Alien Mind. If a creature tries to read Father Llymic’s thoughts or 
deals psychic damage to him, that creature must succeed on a DC 
22 Intelligence saving throw or be stunned for 1 minute. The 
stunned creature can repeat the saving throw at the end of each 
of its turns, ending the effect on itself on a success. 
Cryogenic Regeneration (Mythic Trait; Recharges after a Short or 
Long Rest). If Father Llymic is reduced to 0 hit points, he doesn’t 
die or fall unconscious. Instead, he is encased in an impenetrable 
shell of ice. Father Llymic regains 200 hit points and any expended 
uses of his Legendary Resistance and spells. The shell then 
explodes and each creature within 20 feet of Father Llymic must 
make a DC 21 Dexterity saving throw, taking 31 (7d8) bludgeoning 
damage and 14 (4d6) cold damage on a failed save, or half as 
much damage on a successful one. 
Ice Walk. Father Llymic can move across and climb icy surfaces 
without needing to make an ability check. Additionally, difficult 
terrain composed of ice or snow doesn’t cost him extra 
movement. 
Legendary Resistance (3/Day). If Father Llymic fails a saving 
throw, he can choose to succeed instead. 
Light Torpor. When Father Llymic is in an area of natural light or 
magical light of 3rd level or higher, he suffers the effects of the 
slow spell, and can’t fly or teleport. Father Llymic has 
disadvantage on saving throws against spells that deal light-based 
damage, such as moonbeam, sunbeam, or sunburst. 
Magic Resistance. Father Llymic has advantage on saving throws 
against spells and other magical effects. 
ACTIONS
Multiattack. Father Llymic makes one Bite attack and two Claws 
attacks. Father Llymic can replace one Bite attack with a Pull 
Psychic Strings attack. 
Bite. Melee Weapon Attack: +14 to hit, reach 10 ft., one target. 
Hit: 20 (2d12 + 7) piercing damage plus 22 (4d10) cold damage. If 
the target is a creature, it also gains 1 level of soul chill. 
Claws. Melee Weapon Attack: +14 to hit, reach 15 ft., one target. 
Hit: 17 (3d6 + 7) force damage, unless Father Llymic rolled an 18 
or higher on the d20 for the attack, in which case the attack is a 
critical hit that deals 38 (9d6 + 7) force damage instead. If the 
target is a creature, it also gains 1 level of soul chill. If the target is 
a Huge or smaller creature, it is grappled (escape DC 17). Until this 
grapple ends, the target is restrained, and Father Llymic can’t use 
this claw on another target. Father Llymic has two claws. 
Pull Psychic Strings (3/Day). Melee Spell Attack: +13 to hit, reach 
15 ft., one creature. Hit: 28 (8d6) psychic damage and the target 
must succeed on a DC 21 Charisma saving throw or immediately 
use its reaction, if available, to move up to as far as its speed 
allows in the direction and distance of Father Llymic’s choice. 
Spellcasting. Father Llymic casts one of the following spells, 
requiring no material components and using Charisma as the 
spellcasting ability (spell save DC 21): 
At will: cone of cold, darkness, detect magic, dimension door, 
dispel magic, insect plague, wall of ice 
1/day each: psychic scream, reverse gravity 
BONUS ACTIONS
Blade Rift (1/Day). Father Llymic creates a 3-foot-long, bladeshaped planar rift in an unoccupied space he can see within 60 
feet and makes up to two Rift Slice attacks with it. The blade lasts 
for 1 minute. 
 As a bonus action, Father Llymic can move the blade up to 30 
feet to an unoccupied space he can see and then make up to two 
Rift Slice attacks with it. The blade can harmlessly pass through 
any barrier, including a wall of force. 
Rift Slice (Only While Blade Rift Is Active). Melee Spell Attack: +13 
to hit, reach 5 ft., one target. Hit: 26 (4d12) force damage, unless 
Father Llymic rolled an 18 or higher on the d20 for the attack, in 
which case the attack is a critical hit that deals 78 (12d12) force 
damage instead. 
LEGENDARY ACTIONS
Father Llymic can take 3 legendary actions, choosing from the 
options below. Only one legendary action option can be used at a 
time and only at the end of another creature’s turn. Father Llymic 
regains spent legendary actions at the start of his turn. 
Armor of Ice. Black ice temporarily surrounds Father Llymic, and 
he gains 20 temporary hit points until the start of his next turn. 
Claws. Father Llymic makes one Claws attack. 
Cast a Spell (Costs 2 Actions). Father Llymic uses Spellcasting. 
MYTHIC ACTIONS
If Father Llymic’s mythic trait is active, he can use the options 
below as legendary actions for 1 hour after using Cryogenic 
Regeneration. 
Cast a Spell. Father Llymic uses Spellcasting. 
Vicious Attack. Father Llymic makes one Bite attack and one Claws 
attack. 
Flung into the Far Realm (Costs 3 Actions). Father Llymic targets a 
creature he is grappling. The creature must succeed on a DC 21 
Charisma saving throw or be banished to a brood spawning pit 
in the Far Realm and gain 1d4 levels of soul chill. At the start of 
Father Llymic’s next turn, the creature reappears in an 
unoccupied space within 10 feet of Father Llymic. 
jbhaywood commented 2 years ago

Wow. You found a doozy there. I have fixes for 1, 2, and 6 locally and I'm working on the others.

About the Mythic Actions, it looks like someone requested that support for them be added to the 5e system here. Hopefully it won't take too much longer to get in a release.

jbhaywood commented 2 years ago

About #5, it can only import spells that exist in a compendium. And since Psychic Scream is a Xanathar's Guide to Everything spell, you need to have a custom compedium with that spell in it. Only spells in the SRD are included with the 5e system by default.

Zamrod commented 2 years ago

Would it be possible to create a dummy entry with just the name so I know the creature has it?

On Wed, Apr 27, 2022 at 12:01 AM James Haywood @.***> wrote:

About #5 https://github.com/jbhaywood/5e-statblock-importer/issues/5, it can only import spells that exist in a compendium. And since Psychic Scream is a Xanathar's Guide to Everything spell, you need to have a custom compedium with that spell in it. Only spells in the SRD are included with the 5e system by default.

— Reply to this email directly, view it on GitHub https://github.com/jbhaywood/5e-statblock-importer/issues/23#issuecomment-1110542549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC75BGIYGUFN76JACE7XCMDVHDCZJANCNFSM5T5NZOOA . You are receiving this because you authored the thread.Message ID: @.***>

-- Chris Wachal

jbhaywood commented 2 years ago

I could, but I'll have to think about it. My main concern is that I'd go from getting bugs that a spell isn't importing to getting bugs that a spell isn't working.

Zamrod commented 2 years ago

Maybe a setting to let each person decide how they wanted it to work? Even better if it would just import a spell from a compendium if it exists. Especially for those of us who have customized automated versions of all the spells (srd included) saved in a compendium.

On Wed, Apr 27, 2022 at 8:53 PM James Haywood @.***> wrote:

I could, but I'll have to think about it. My main concern is that I'd go from getting bugs that a spell isn't importing to getting bugs that a spell isn't working.

— Reply to this email directly, view it on GitHub https://github.com/jbhaywood/5e-statblock-importer/issues/23#issuecomment-1111653745, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC75BGM2WGHSIKQXF67D6Q3VHHVQJANCNFSM5T5NZOOA . You are receiving this because you authored the thread.Message ID: @.***>

-- Chris Wachal

jbhaywood commented 2 years ago

just import a spell from a compendium if it exists

This is the direction I'm leaning. It's pretty easy to add and I'm trying to stay from adding settings to keep it really simple.

jbhaywood commented 2 years ago

Alright, these should be fixed in release 1.4.0 (except for the Mythic items).

I changed it so that it searches all compendiums. So let me know if it finds "Psychic Scream" for you now.

Zamrod commented 1 year ago

You go this route, you’d need a setting anyways to select the compendium to import from. I already have a compendium with spells in it and it would suck to have to rename it to a specific name just to import from your module.

On Wed, Apr 27, 2022 at 9:37 PM James Haywood @.***> wrote:

just import a spell from a compendium if it exists

This is the direction I'm leaning. It's pretty easy to add and I'm trying to stay from adding settings to keep it really simple.

— Reply to this email directly, view it on GitHub https://github.com/jbhaywood/5e-statblock-importer/issues/23#issuecomment-1111677834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC75BGJHJSJQ3LHK6AEL3HLVHH2WDANCNFSM5T5NZOOA . You are receiving this because you authored the thread.Message ID: @.***>

-- Chris Wachal

jbhaywood commented 1 year ago

You go this route, you’d need a setting anyways to select the compendium to import from. I already have a compendium with spells in it and it would suck to have to rename it to a specific name just to import from your module. -- Chris Wachal

I'm not sure what you mean. It searches all compendiums and finds spells based on name. If there's a spell named "Psychic Scream" in the spell list, and you've got a spell named "Psychic Scream" in a compendium it'll find it. No renaming required.

Zamrod commented 1 year ago

What happens if you have the same spell listed multiple times in multiple compendiums?

On Tue., Oct. 11, 2022, 10:24 p.m. James Haywood, @.***> wrote:

You go this route, you’d need a setting anyways to select the compendium to import from. I already have a compendium with spells in it and it would suck to have to rename it to a specific name just to import from your module. -- Chris Wachal

I'm not sure what you mean. It searches all compendiums and finds spells based on name. If there's a spell named "Psychic Scream" in the spell list, and you've got a spell named "Psychic Scream" in a compendium it'll find it. No renaming required.

— Reply to this email directly, view it on GitHub https://github.com/jbhaywood/5e-statblock-importer/issues/23#issuecomment-1275532269, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC75BGM5WLZNMNNSG65R5LDWCYVPVANCNFSM5T5NZOOA . You are receiving this because you authored the thread.Message ID: @.***>

jbhaywood commented 1 year ago

Yeah, in that case it'll pick the first one. I'll go ahead and reopen this. It sounds like there are two issues here...

  1. How to handle spells that don't exist in any compendium (which I've run into myself).
  2. How to handle the same spell in multiple compendiums.

I'll think about it and see what I can come up with.

pixel7777 commented 10 months ago

I think my issue may be related, although all the spells I'm looking at are SRD spells. I'm trying to import MCDM's Flee, Mortals monsters and often the spells get missed even though they are 5e spells because they do things like put the spells in a separate "utility spells" section. Even when I move that section up, it doesn't parse correctly. I love this book, and I'm willing to massage the data to get the import working, but I can't figure out how to do it without changing the intent of the stat block. I've attached an image of an example and the text for convenience. BTW, I did remove the superscript and that didn't help.

image

Green Hag Medium Fey, Typically Neutral Evil Armor Class 16 (natural armor) Hit Points 75 (10d8 + 30) Speed 30 ft., fly 30 ft. STR DEX CON INT WIS CHA 12 (+1) 16 (+3) 16 (+3) 14 (+2) 15 (+2) 18 (+4) Skills Arcana +4, Deception +6, Perception +4, Stealth +5 Damage Resistances poison Condition Immunities poisoned Senses darkvision 60 ft., passive Perception 14 Languages Common, Primordial, Sylvan Proficiency Bonus +2 Envenom. Each ally within 30 feet of the hag deals an extra 3 (1d6) poison damage with weapon attacks, provided the hag isn’t incapacitated. ACTIONS Multiattack. The hag makes one Poison Claw attack and uses Granny Says. Poison Claw. Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d10 + 3) slashing damage plus 3 (1d6) poison damage. Granny Says. The hag affects one other willing creature they can see within 30 feet of them with one of the follow￾ing effects: • The target magically switches places with the hag. • The target uses their reaction, if available, to make an attack. Naughty Mousey (3/Day; 5th-Level Spell; Concentration). The hag chooses a creature they can see within 60 feet of them and attempts to transform them into a Beast of the hag’s choice with a challenge rating of 2 or lower. The target must succeed on a DC 14 Wisdom saving throw or be transformed for 1 minute (save ends at end of turn). While transformed, the target’s game statistics are replaced by the statistics of the chosen Beast, though they retain their alignment, personality, and Intelligence, Wisdom, and Charisma scores. The target’s gear melds into the new form. They can’t activate, use, wield, or otherwise benefit from any of their equipment. They can’t speak or cast spells but can take any action the Beast can take. If the target drops to 0 hit points while in this form, they revert back to their original form with half the number of hit points they had before they transformed. REACTIONS Get Gone. When an ally within 30 feet of the hag is targeted with an attack, the hag can turn the target invisible until the start of the target’s next turn, potentially imposing disadvantage on the triggering attack roll and causing it to miss. To use this reaction, the hag must be able to see the ally and the attacker. UTILITY SPELLS In addition to any other spells in this stat block, the hag can cast the following spells, using Charisma as the spellcasting ability (spell save DC 14): At will: alter self A, dancing lights A, minor illusion A 3/day each: animal messenger A, legend lore + , speak with animals A 1/day: scrying+ CR 3 Support 700 XP

jbhaywood commented 10 months ago

Hm, I thought I had utility spells working. I'll take a look.

jbhaywood commented 10 months ago

@pixel7777 Try again with the newest version, 1.81.4. Here's what I get using the text you posted.

image

pixel7777 commented 9 months ago

In your example, the Scrying spell was omitted. In my result, the Speak with Animals was omitted. I just ran it with a fresh 5e world and only this module running and updated this module. I tried "cleaning up" the text, removing extra line breaks and those little superscripts MCDM likes to use, but I could never get all the spells to appear.

image image

pixel7777 commented 9 months ago

I tried putting the text straight from the PDF into chat GPT and asking it to reformat the text. It didn't do a perfect job, but whatever it did make the import work. Below is the revised text and the outcome. I thank you for your work on this module; I can make this workflow work!

Green Hag Medium Fey, Neutral Evil

Armor Class 16 (natural armor) Hit Points 75 (10d8 + 30) Speed 30 ft., fly 30 ft.

STR DEX CON INT WIS CHA 12 (+1) 16 (+3) 16 (+3) 14 (+2) 15 (+2) 18 (+4) Skills Arcana +4, Deception +6, Perception +4, Stealth +5 Damage Resistances poison Condition Immunities poisoned Senses darkvision 60 ft., passive Perception 14 Languages Common, Primordial, Sylvan Proficiency Bonus +2

Envenom: Each ally within 30 feet of the hag deals an extra 3 (1d6) poison damage with weapon attacks, provided the hag isn’t incapacitated.

ACTIONS

Multiattack: The hag makes one Poison Claw attack and uses Granny Says. Poison Claw: Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 8 (1d10 + 3) slashing damage plus 3 (1d6) poison damage. Granny Says: The hag affects one other willing creature they can see within 30 feet of them with one of the following effects: The target magically switches places with the hag. The target uses their reaction, if available, to make an attack. Naughty Mousey (3/Day; 5th-Level Spell; Concentration): The hag chooses a creature they can see within 60 feet of them and attempts to transform them into a Beast of the hag’s choice with a challenge rating of 2 or lower. The target must succeed on a DC 14 Wisdom saving throw or be transformed for 1 minute (save ends at end of turn). While transformed, the target’s game statistics are replaced by the statistics of the chosen Beast, though they retain their alignment, personality, and Intelligence, Wisdom, and Charisma scores. The target’s gear melds into the new form. They can’t activate, use, wield, or otherwise benefit from any of their equipment. They can’t speak or cast spells but can take any action the Beast can take. If the target drops to 0 hit points while in this form, they revert back to their original form with half the number of hit points they had before they transformed.

REACTIONS

Get Gone: When an ally within 30 feet of the hag is targeted with an attack, the hag can turn the target invisible until the start of the target’s next turn, potentially imposing disadvantage on the triggering attack roll and causing it to miss. To use this reaction, the hag must be able to see the ally and the attacker. UTILITY SPELLS In addition to any other spells in this stat block, the hag can cast the following spells, using Charisma as the spellcasting ability (spell save DC 14):

At will: alter self (A), dancing lights (A), minor illusion (A) 3/day each: animal messenger (A), legend lore (+), speak with animals (A) 1/day: scrying (+) Challenge 3 (700 XP) image

jbhaywood commented 9 months ago

I see the problem with the missing "scrying" spell. It doesn't have a space before the + sign. I updated the module to account for that. Version 1.81.5 should fix that.

About the ChatGPT version, I'm surprised that the spells work because it put parenthesis around the superscripts, which the parser isn't expecting. But 🤷‍♀️.