kuthulu
August 12th, 2016, 19:48
I'm working on a python application to extract NPC data from a spreadsheet and output it into a txt file that is compatable with Trenloe's Pathfinder Creature Parser V2 (https://www.fantasygrounds.com/forums/showthread.php?20522-Pathfinder-Creature-Parser-V2-Beta-Version). I have all the data setup and formatted but I'm stuck on the spells. The spells are all listed in one long STRING so in order to get it to work with the parser I need to get each spell on it's own line. I wanted to see if anyone had an existing RegEx to do something like that. Or really anything close that I could start working with.
If there is a better area to post this in please let me know. Here is an example:
STAT BLOCK
Arael CR 2
XP 600
half-elf cleric of Iomedae 3
LG Medium humanoid
Init 1; Senses low-light vision; Perception +4
DEFENSE
AC 17, touch 11, flat-footed 16 (+6 armor, +1 Dex)
hp 20 (3d8+3)
Fort +4, Ref +2, Will +5
OFFENSE
Speed 20 ft.
Melee mwk longsword +3 (1d8/19-20)
Ranged light crossbow +3 (1d8/19-20)
Space 5 ft.; Reach 5 ft.
Special Attacks channel positive energy 5/day (2d6, DC 13)
Domain Spell-Like Abilities (CL 3rd) 5/day-battle rage, touch of good
Cleric Spells Prepared (CL 3rd) 2nd-hold person (DC 14), sound burst (already cast), spiritual weaponD 1st-bless (2), protection from evilD, shield of faith (already cast) 0-guidance, light, stabilize, virtue
D Domain Spell; Domains (Good, War)
TACTICS
Before Combat Arael casts guidance and virtue on any unskilled rebels present and protection from evil and shield of faith on anyone he believes is especially vulnerable.
During Combat Arael casts bless if he has allies, uses sound burst in the hopes of stunning multiple opponents, and hold person to disable a dangerous adversary.
Morale Arael surrenders when he reaches 5 hp if he believes his foe will accept a surrender. He is willing to hold off an enemy even at great risk to himself if it gives his allies more time to succeed at a task or escape, but prefers to make a tactical retreat rather than dying needlessly.
STATISTICS
Str 10, Dex 12, Con 13, Int 10, Wis 15, Cha 14
Base Atk +2; CMB +2; CMD +13
Feats Alignment Channel, Pick Alignment, Brew Potion, Skill Focus (Knowledge [local])
Skills Diplomacy +8, Heal +6, Knowledge (history) +4, Knowledge (local) +4, Knowledge (planes) +4, Knowledge (religion) +4, Sense Motive +6
Languages Common, Elven
SQ elf blood, elven immunities
Combat Gear potion of cure light wounds, potion of bull's strength; Other Gear breastplate, masterwork longsword, dagger, light crossbow, 20 bolts, 60 gp
So I need to get the spell levels on individual lines, something like:
Cleric Spells Prepared (CL 3rd)
2nd-hold person (DC 14), sound burst (already cast), spiritual weaponD
1st-bless (2), protection from evilD, shield of faith (already cast)
0-guidance, light, stabilize, virtue
FORMAT:
class Spells Prepared (CL ; concentration +)
2nd--
1st--
0--
I still have to do this part as well, but I'm working on it now:
Invalid Spell Like Abilities entries
In some older Paizo statblocks certain class abilities are listed as "Domain Spell Like Abilities", "Bloodline Spell Like Abilities" or similar entries. These are not actually spell like abilities, as they are not spells, and so will create issues with parsing of the statblock (usually in the form of an XML error when you try to open the module in FG). Remove these entries and move the relevant data to Special Attacks or SQ.
If there is a better area to post this in please let me know. Here is an example:
STAT BLOCK
Arael CR 2
XP 600
half-elf cleric of Iomedae 3
LG Medium humanoid
Init 1; Senses low-light vision; Perception +4
DEFENSE
AC 17, touch 11, flat-footed 16 (+6 armor, +1 Dex)
hp 20 (3d8+3)
Fort +4, Ref +2, Will +5
OFFENSE
Speed 20 ft.
Melee mwk longsword +3 (1d8/19-20)
Ranged light crossbow +3 (1d8/19-20)
Space 5 ft.; Reach 5 ft.
Special Attacks channel positive energy 5/day (2d6, DC 13)
Domain Spell-Like Abilities (CL 3rd) 5/day-battle rage, touch of good
Cleric Spells Prepared (CL 3rd) 2nd-hold person (DC 14), sound burst (already cast), spiritual weaponD 1st-bless (2), protection from evilD, shield of faith (already cast) 0-guidance, light, stabilize, virtue
D Domain Spell; Domains (Good, War)
TACTICS
Before Combat Arael casts guidance and virtue on any unskilled rebels present and protection from evil and shield of faith on anyone he believes is especially vulnerable.
During Combat Arael casts bless if he has allies, uses sound burst in the hopes of stunning multiple opponents, and hold person to disable a dangerous adversary.
Morale Arael surrenders when he reaches 5 hp if he believes his foe will accept a surrender. He is willing to hold off an enemy even at great risk to himself if it gives his allies more time to succeed at a task or escape, but prefers to make a tactical retreat rather than dying needlessly.
STATISTICS
Str 10, Dex 12, Con 13, Int 10, Wis 15, Cha 14
Base Atk +2; CMB +2; CMD +13
Feats Alignment Channel, Pick Alignment, Brew Potion, Skill Focus (Knowledge [local])
Skills Diplomacy +8, Heal +6, Knowledge (history) +4, Knowledge (local) +4, Knowledge (planes) +4, Knowledge (religion) +4, Sense Motive +6
Languages Common, Elven
SQ elf blood, elven immunities
Combat Gear potion of cure light wounds, potion of bull's strength; Other Gear breastplate, masterwork longsword, dagger, light crossbow, 20 bolts, 60 gp
So I need to get the spell levels on individual lines, something like:
Cleric Spells Prepared (CL 3rd)
2nd-hold person (DC 14), sound burst (already cast), spiritual weaponD
1st-bless (2), protection from evilD, shield of faith (already cast)
0-guidance, light, stabilize, virtue
FORMAT:
class Spells Prepared (CL ; concentration +)
2nd--
1st--
0--
I still have to do this part as well, but I'm working on it now:
Invalid Spell Like Abilities entries
In some older Paizo statblocks certain class abilities are listed as "Domain Spell Like Abilities", "Bloodline Spell Like Abilities" or similar entries. These are not actually spell like abilities, as they are not spells, and so will create issues with parsing of the statblock (usually in the form of an XML error when you try to open the module in FG). Remove these entries and move the relevant data to Special Attacks or SQ.