Monday, August 4, 2008

Look familar?

I had some time to kill this weekend so I added the fluff data to my H2 module. Since I was going to be in the MM parser, I decided to take the first steps to making it like the PHB parser.

I've exposed all the variables users would need to set, added in the file checking, and put in support for a path file.

Now the MM parser requires a lot more file mark up than the PHB power module did. This is because the MM entries are much more free form.

The stat file:

Below you'll see the sample entries as they would look cut and paste out of the MM:

WOTC IP Lawyer Level 5 Soldier (Leader)
Medium natural humanoid (vaguely) XP 175
Initiative +2 Senses Perception +4
HP 52; Bloodied 26
AC 17; Fortitude 10, Reflex 12, Will 13
Speed 5
m Cease and Desist (standard; at-will) ? Necrotic
+15 vs. AC; 2d8 + 7 damage and the target is stunned until they file an appeal or they make a save.
C Empty their pockets!! (minor; recharge ?)
Close burst 2; Steal 50,000 gp from every enemy in the burst.
Alignment Evil Languages Common, Legalese
Skills Diplomacy -10, Intimidate +70
Str 18 (+6) Dex 13 (+3) Wis 12 (+3)
Con 14 (+4) Int 16 (+5) Cha 16 (+5)
Equipment briefcase, legal documents

WOTC IP Paralegal Level 1 Minion
Small natural humanoid XP 25
Initiative +2 Senses Perception +1
HP 1; a missed attack never damages a minion.
AC 12; Fortitude 9, Reflex 12, Will 14
Speed 6; see also WOTC tactics
m Serve paperwork (standard; at-will) ? Weapon
+3 vs. AC; 1d6 damage
WOTC Tactics (immediate reaction, when missed by a melee
attack; at-will)
The WOTC IP Paralegal shifts 1 square while screaming about filing motions.
Alignment Evil Languages Common, Legalese
Skills Diplomacy -5, Thievery +50, Intimidate +35
Str 14 (+2) Dex 17 (+3) Wis 12 (+1)
Con 13 (+1) Int 8 (–1) Cha 8 (–1)
Equipment briefcase, legal documents

A few things to note:
The icons in front of powers are translated to letters. m = Basic Melee, r = Basic Ranged, M = Melee, R = Ranged, C = Close Burst, A = Area
This typically happens automatically when you cut and paste, sometimes a space gets missed, and you have to add it in by hand.

The dice values on power recharges come across as unicode characters which then get turned into the ? character. The parser is smart enough to count these and compensate. i.e. ? ? becomes 5-6, ? ? ? ? becomes 3-6.

The special character between the power and it's keywords is also unicode and gets translated into ?. The parser handles that as well.



Now the MM entries require mark up. This is because the powers have no clean start and end marks. Every power needs to begin with an indicator (m,M,r,R,C,A or X) . X is a special indicator for powers that don't have an icon (see WOTC Tactics below). Also every power must end with ZZX. This goes after the keywords (if present) and before the statistical values of the powers. Finally, if a line within the power section starts with an "A" this will cause the parser to think it has encountered a new area power. The way around this is to wrap the line into the line above. The parser will then handle it without issue.
Below you'll see the data with markup (I've bolded the markup):

WOTC IP Lawyer Level 5 Soldier (Leader)
Medium natural humanoid (vaguely) XP 175
Initiative +2 Senses Perception +4
HP 52; Bloodied 26
AC 17; Fortitude 10, Reflex 12, Will 13
Speed 5
m Cease and Desist (standard; at-will) ? Necrotic ZZX
+15 vs. AC; 2d8 + 7 damage and the target is stunned until they file an appeal or they make a save.
C Empty their pockets!! (minor; recharge ?) ZZX
Close burst 2; Steal 50,000 gp from every enemy in the burst.
Alignment Evil Languages Common, Legalese
Skills Diplomacy -10, Intimidate +70
Str 18 (+6) Dex 13 (+3) Wis 12 (+3)
Con 14 (+4) Int 16 (+5) Cha 16 (+5)
Equipment briefcase, legal documents

WOTC IP Paralegal Level 1 Minion
Small natural humanoid XP 25
Initiative +2 Senses Perception +1
HP 1; a missed attack never damages a minion.
AC 12; Fortitude 9, Reflex 12, Will 14
Speed 6; see also WOTC tactics
m Serve paperwork (standard; at-will) ? Weapon ZZX
+3 vs. AC; 1d6 damage
X WOTC Tactics (immediate reaction, when missed by a melee
attack; at-will) ZZX
The WOTC IP Paralegal shifts 1 square while screaming about filing motions.
Alignment Evil Languages Common, Legalese
Skills Diplomacy -5, Thievery +50, Intimidate +35
Str 14 (+2) Dex 17 (+3) Wis 12 (+1)
Con 13 (+1) Int 8 (–1) Cha 8 (–1)
Equipment briefcase, legal documents

The Fluff file:

The fluff file is completely optional. However the NPCs are much more useful if you parse this data. I did the entire MM over 2 days. It's not really difficult just a lot of cut and paste.

The fluff data is just raw text from the MM. The parser just looks for certain markup tags to associate the data with the stat file. Below is the sample fluff file:

ZZXBEGIN
WOTC IP Lawyer
WOTC IP Paralegal
ZZXEND
ZGroup
Destroyers of 3PP

ZZXBEGIN
WOTC IP Lawyer
ZZXEND
ZFluff
Shiney shoes, and completely devoid of a soul, the WOTC IP Lawyer is a terrifying figure.
ZTactics
The WOTC IP Lawyer will open with Cease and Desist and then use Empty their pockets!! until all enemies are out of cash.
ZLore
A character knows the following information with a successful Religion check.
DC 2: IP Lawyers have no souls

ZZXBEGIN
WOTC IP Paralegal
ZZXEND
ZFluff
A flailing swarm of paperwork the WOTC IP Paralegal dreams of becoming an IP Lawyer.
ZTactics
The WOTC IP Paralegal will charge into melee range of the nearest target and then launch Serve paperwork. They will continue using this attack until they are attacked, at which point they will fade away using WOTC Tactics
ZLore
A character knows the following information with a successful Religion check.
DC 15: Paralegals become IP Lawyers through a complex ritual that removes their souls. It is rumored at least 1 3PP must be sacraficed to complete the ritual.

The fluff parser works as follows:
ZZXBEGIN ... ZZXEND
Between these 2 tags you place a list of monsters. All the remaining tags will apply to ALL of these monsters until the next ZZXBEGIN...ZZXEND pair.

ZGroup
This is a way of organizing similar monsters together. For example goblins, hobgoblins, bugbears can all be grouped by setting the ZGroup to be Goblin (that would match the MM btw). The parser produces an option to view the monsters sorted by group. For dungeon/dragon parses I usually put the group as the article title.

ZFluff
This is the flavor text for the monster. It will be bracketed by HTML paragraph marks when output. You can embed additional HTML formatting tags (simple ones at least) within it.

ZTactics
Same as Zfluff

ZLore
Similar to Ztactics and ZFluff howerever each "DC " is replaced with a paragraph end, paragraph start, followed by a bold start then the "DC " and each ":" is replaced with a ": " followed by a bold end. This automatically breaks and bolds the DC. There are some cases where the Lore text contains a : or a DC that you do not want this done to. I recommend removing these or changing the DC # to be DC# and then the parser will not have issue. I think the core MM parses clean, Dungeon/Dragon articles have this issue from time to time


If you look at the example you can see both sample NPCs are in the same group (hence the first ZZXBEGIN..ZZXEND ZGroup). Each has different flavor, tactics, and lore (hence the second and third ZZXBEGIN ZZXEND pairs and assoicated tags).

No comments: