FG Spreadshirt Swag
  1. #1

    Easy Do It Yourself – All free 5E Monsters for PAR5E (from WoTC website)

    To get all monsters from the free DM's Rules posted on the Wizards of the Coast website, you can use the powershell commands below to get an "npcs.txt" file for PAR5E for creating a module. (That will also give you a bunch of examples that work for creating your own monsters.)

    Note: since this will access the WoTC website, when running this you may get one or two popups asking about cookies. You can select yes or no.

    1) Open a command prompt (In Windows 10, right click the start button and select "Command Prompt")
    2) In the command prompt, type or copy/paste the following:
    Code:
    powershell
    $HTML = Invoke-WebRequest -Uri "https://dnd.wizards.com/products/tabletop/dm-basic-rules"
    $monsters = ($HTML.ParsedHtml.body.getElementsByTagName('dl') | Where {$_.getAttributeNode('class').Value -eq 'monster-list'}).innerHTML
    $monsters = $monsters -replace "(</TH>|</TD>|</THEAD>)`r`n", " " # For abilities (STR, DEX, etc.)
    $monsters = $monsters -replace "<H5>Actions</H5>", "ACTIONS"
    $monsters = $monsters -replace "<H5>Reactions</H5>", "REACTIONS"
    $monsters = $monsters -replace "<H5>Legendary Actions</H5>", "LEGENDARY ACTIONS"
    $monsters = $monsters -replace "<H5>|<H6>", "<h>" # For headers in lore
    $monsters = $monsters -replace "</H5>|</H6>", "</h>" # For headers in lore
    $monsters = $monsters -replace "<BR>", " "
    $monsters = $monsters -replace "<LI>(Cantrip.|1st|2nd|3rd|.th)", '\r$1' # For spell lists
    $monsters = $monsters -replace "<LI>", "" # In lore or actions (e.g., spectator & adult red dragon)
    $monsters = $monsters -replace "<P class=lore>", "##;`r`n"
    $monsters = $monsters -replace "</*(UL|LI|DD|OL|HR|THEAD|TR|TBODY|P|STRONG|EM|TH|TD|DIV|DD|TABLE|(P|DT|DIV|UL)([^>]*))>", ""
    $monsters = $monsters -replace "`r`n(`r`n)+", "`r`n" # remove blank lines
    $monsters = $monsters -replace " CHA `r`n", " CHA " # remove line between ability description & values
    $monsters = $monsters -replace "<SPAN>([^>]+)</SPAN>", "`r`n`$1" # Make sure blank line before monster name
    $monsters | Out-File -encoding UTF8 "npcs.txt"
    You now have an "npcs.txt" file that you can copy into your PAR5E input directory.

  2. #2
    This is some cool use of power shell!

  3. #3

  4. #4
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,259
    Blog Entries
    9
    Are these monsters that are not included in the SRD or MM? Or are they duplicated if I already have those? Cuz I though FG already included everything from the basic rules... (but, I'm fairly ignorant as to the details)

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,684
    Blog Entries
    1
    I believe it is a bit of POC for Valeros. But it also creates raw input files useful as a reference for those people who are wanting to add their own content.
    These are the same as what Valeros excellent Basic Rules Parser created - just made with such a beautifully tight script.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in