Mongrelman Generator Source Code

<html>

<head>
<title> Random Mongrelman </title>
</head>

<body>
<SCRIPT LANGUAGE="JAVASCRIPT">
// *Random Mongrelman Generator (BETA)*
// This script was originally written by Maugan22 (c) Feb 2010
// *Designation of Open Content*
// This script is entirely open content
// as defined by:
// "http://tuskmountain.wikidot.com/open-game-license-1-0a"
// *Section 15 Notice:*
// Mongrelman from the Tome of Horrors Revised,
// Copyright 2002, Necromancer Games, Inc.;
// Author Scott Greene, based on original material by Gary Gygax."
//
// You may use/copy/distribute/modify this script for:
// personal or commercial use
// in accordance with the open game license
// If you change anything
// A) Please do not change this comment block
// B) Please add your name to the list below

// Script has been modified by:
//
//
//
//
//

var AuraString = ""; // could be ""<B>Aura</B> Stench (30 ft. DC 11 + con modifier, 10 rounds)";
var SpecialAttacksString = "";
var SpecialAbilitiesString = "";
var SpecialAbilityDescription = "";
var Movement = 6; //Multiplied by 5 on output
var SpecialMovement = ""
var vision = " ";
var Strwithrightarm = 0;
var attackwithrightarm = "slam +";
var Damagewithrightarm = " (1d4+";
var Strwithleftarm =0;
var attackwithleftarm = "slam +";
var Damagewithleftarm = " (1d4+";
var SpecialAttacks = ""
var noClub = 0;
var FortSavesSpecial = "";
var WillSavesSpecial = "";
var StrongestArm =0; // the strength mod of the stronger arm
var weaknessString = ""; //stuff like light senstivitity light blindness;

// Lower torso: mongrelman can only move on land at 5 feet per round, but can swim at 50 feet per round and gains a +8 Swim check. —This should discount all rolls for legs and feet.;

var AquaticCount = 0; // ++ per side of head that is an aquatic creature, if it reaches two it can breath underwatter.;
var Minotaurhead = 0; // ++ per side of head that is minotaur, if 1 gore attack for 1d4+ Strength modifier, if 2 the gore damage increases to 1d8 + Strength modifier. (these are secondary attacks if the creature uses hand weapons);

// skills include ranks and class bonus but not atribute bonus or racial bonus which is added in later
var Perceptionskill = 7; // base can be modified by facial features
var Racialbonus = ""; // racial bonuses to skills
var ClimbSkill = 6;
var AcrobaticsSkill = 2;
var StealthSkill = 4; //This one counts only racial bonus
var SwimSkill = 2; //Can be affected by lizardman or by gaining a swim speed (merfolk)

// this array ise used to determine the parts of the creature
var partOrigin = new Array();
partOrigin[0] = "missing";
partOrigin[1] = "merfolk";
partOrigin[2] = "human";
partOrigin[3] = "that of a goblin";
partOrigin[4] = "that of a hobgoblin";
partOrigin[5] = "kobold";
partOrigin[6] = "gnoll";
partOrigin[7] = "locathah";
partOrigin[8] = "sahuagin";
partOrigin[9] = "dwarven";
partOrigin[10] = "elven";
partOrigin[11] = "gnomish";
partOrigin[12] = "halfling";
partOrigin[13] = "orcish"; //need to be specific so these are seperate entries;
partOrigin[14] = "ogrish"; //need to be specific so these are seperate entries;
partOrigin[15] = "troglodyte";
partOrigin[16] = "crabman";
partOrigin[17] = "that of a bugbear";
partOrigin[18] = "that of a minotaur";
partOrigin[19] = "flind";
partOrigin[20] = "reptilian";
partOrigin[21] = "dont show this"; //simply Not mentioned, must be the last value in list;

var LeftHead = Math.floor(1+(partOrigin.length-2)*Math.random());
var RightHead = Math.floor(1+(partOrigin.length-2)*Math.random());
var TorsoLower = Math.floor(1+(partOrigin.length-2)*Math.random());
// Torso, Arm and Hand handlers, note how merfolk limbs look human (1=2)
var TorsoUpper = Math.floor(1+(partOrigin.length-2)*Math.random());
if (TorsoUpper == 1) {TorsoUpper =2;}
var LeftArm = Math.floor((partOrigin.length-1)*Math.random());
if (LeftArm == 1) {LeftArm =2;}
var RightArm = Math.floor((partOrigin.length-1)*Math.random());
if (RightArm == 1) {RightArm =2;}
var LeftHand = Math.floor((partOrigin.length-1)*Math.random());
if (LeftHand == 1) {LeftHand =2;}
var RightHand = Math.floor((partOrigin.length-1)*Math.random());
if (RightHand == 1) {RightHand =2;}
var Jaw = Math.floor((partOrigin.length-1)*Math.random());
if (Jaw == 1) {Jaw =2;}
//
var LeftLeg = Math.floor((partOrigin.length-1)*Math.random());
var RightLeg = Math.floor((partOrigin.length-1)*Math.random());
var LeftFoot = Math.floor((partOrigin.length-1)*Math.random());
var RightFoot = Math.floor((partOrigin.length-1)*Math.random());

var dw;

// if arm is missing don't mention hand;
if (RightArm == 0) {RightHand = partOrigin.length;Strwithrightarm = -5}
if (LeftArm == 0) {LeftHand = partOrigin.length;Strwithleftarm = -5}
RightHand = 0;
LeftHand = 0;
if (RightHand == 0) {Strwithrightarm = -5}
if (LeftHand == 0) {Strwithleftarm = -5}
// if leg is missing don't mention foot and reduce movement by half;
if (LeftLeg < 2) {LeftFoot = partOrigin.length; Movement =Movement/2;}
if (RightLeg < 2) {RightFoot = partOrigin.length; Movement =Movement/2;}

If both legs are fins, treat as if it just had a merfolk lower torso
if (LeftLeg == 1 && RightLeg == 1) {TorsoLower = 1;}
if feet are missing reduce movement a bit
if (LeftFoot < 2) {Movement =Movement-1;}
if (RightFoot < 2) {Movement =Movement-1;}
// if it has the lower torso of a merfolk, don't mention legs or feet;
if (TorsoLower == 1) {RightLeg = partOrigin.length;RightFoot = partOrigin.length;LeftLeg = partOrigin.length;LeftFoot = partOrigin.length;}

//** part specific modifiers *

//Troglodyte dealt with first to front load darkvision 90 ft string.

if (RightHead == 15) {vision += "Darkvision 90 ft.; ";}
if (LeftHead == 15) {vision += "Darkvision 90 ft.; ";}
if (TorsoUpper == 15 || TorsoLower == 15) {AuraString = " Stench (30 ft. DC 11 + con modifier, 10 rounds)";}

//Gnoll
if (RightHead == 6) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}
if (LeftHead == 6) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}
if (LeftArm == 6) {Strwithleftarm = 2;}
if (RightArm == 6) {Strwithrightarm = 2;}

//Goblin
if (RightHead == 3) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}
if (LeftHead == 3) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}
if (LeftArm == 3) {Strwithleftarm = -1;}
if (RightArm == 3) {Strwithrightarm = -1;}

//Hobgoblin
if (RightHead == 4) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}
if (LeftHead == 4) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}

//Kobold
if (RightHead == 5) {if (Perceptionskill<9){Perceptionskill = 9;}; vision += "Darkvision 60 ft.; ";}
if (LeftHead == 5) {if (Perceptionskill<9){Perceptionskill = 9;}; vision += "Darkvision 60 ft.; ";}
if (LeftArm == 5) {Strwithleftarm = -2;}
if (RightArm == 5) {Strwithrightarm = -2;}

//locathah
if (RightHead == 7) {
Perceptionskill = 10;
vision += "Darkvision 60 ft.; ";
AquaticCount = AquaticCount+1;
}
if (LeftHead == 7) {
Perceptionskill = 10;
vision += "Darkvision 60 ft.; ";
AquaticCount = AquaticCount+1;
}

//Sahuagin
if (RightHead == 8) {
Perceptionskill = 10;
vision += "Darkvision 60 ft.; ";
AquaticCount = AquaticCount+1;
}
if (LeftHead == 8) {
Perceptionskill = 10;
vision += "Darkvision 60 ft.; ";
AquaticCount = AquaticCount+1;
}
if (LeftArm == 8) {Strwithleftarm = -2;}
if (RightArm == 8) {Strwithrightarm = -2;}

//Dwarf
if (RightHead == 9) {vision+="Darkvision 60 ft.; ";}
if (LeftHead == 9) {vision+="Darkvision 60 ft.; ";}
if (RightHead == 9 && LeftHead == 9) {
SpecialAbilitiesString +=", stonecunning";
SpecialAbilityDescription += "<br><b>Stonecunning:</b> This mongrelman gains stonecunning as a dwarf.";}
if (TorsoUpper == 9) {FortSavesSpecial = "; +2 vs. poison";}

//Elf
if (RightHead == 10) {vision+="low-light vision; ";if (Perceptionskill<9){Perceptionskill = 9;}}
if (LeftHead == 10) {vision+="low-light vision; ";if (Perceptionskill<9){Perceptionskill = 9;}}
if (RightHead == 10 && LeftHead == 10) {WillSavesSpecial = "; +2 vs. enchantment spells or effects";}

//Gnome
if (RightHead == 11) {vision+="low-light vision; ";if (Perceptionskill<9){Perceptionskill = 9;}}
if (LeftHead == 11) {vision+="low-light vision; ";if (Perceptionskill<9){Perceptionskill = 9;}}
if (RightHead == 11 && LeftHead == 11) {WillSavesSpecial = "; +2 vs. illusions";}

//Halfling
if (RightHead == 12) {Perceptionskill = 10;}
if (LeftHead == 12) {Perceptionskill = 10;}
if (TorsoLower == 12) {
ClimbSkill += 2;
AcrobaticsSkill += 2;
StealthSkill += 2;
Racialbonus += " +2 Acrobatics, +2 Climb,";
}
if (LeftArm == 12) {Strwithleftarm = -1;}
if (RightArm == 12) {Strwithrightarm = -1;}

if (LeftArm == 12) {Strwithleftarm = -1;}
if (RightArm == 12) {Strwithrightarm = -1;}
//13 orcish
if (RightHead == 13 || LeftHead == 13) { vision += "Darkvision 60 ft.; "; weaknessString ="<b>Weakness</b> <a href'http://www.d20pfsrd.com/bestiary/rules-for-monsters/universal-monster-rules#TOC-Light-Sensitivity-Ex->Light Sensitivity</a>'";}
if (LeftArm == 13) {Strwithleftarm = 2;}
if (RightArm == 13) {Strwithrightarm = 2;}

//14 ogrish
if (RightHead == 14 || LeftHead == 14) { vision += "Darkvision 60 ft.; "; }
if (LeftArm == 14) {Strwithleftarm = 5;}
if (RightArm == 14) {Strwithrightarm = 5;}

//16 crabman
if (RightHead == 16 || LeftHead == 16) { vision += "Darkvision 60 ft.; "; }
if (LeftArm == 16) {Strwithleftarm = 3;}
if (RightArm == 16) {Strwithrightarm = 3;}
if (LeftHand == 16) {attackwithleftarm = "claw +";}

//17 bugbear
if (RightHead == 17 || LeftHead == 17) { vision += "Darkvision 60 ft.; "; }
if (LeftArm == 17) {Strwithleftarm = 2;}
if (RightArm == 17) {Strwithrightarm = 2;}

18 minotaur
if (RightHead == 18) {
vision += "Darkvision 60 ft.; ";
Perceptionskill=11;
Minotaurhead+=1
}
if (LeftHead == 18) {
vision += "Darkvision 60 ft.; ";
Perceptionskill=11;
Minotaurhead+=1
}
if (LeftArm == 18) {Strwithleftarm = 4;}
if (RightArm == 18) {Strwithrightarm = 4;}
19 flind
if (RightHead == 19) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}
if (LeftHead == 19) {Perceptionskill = 10; vision += "Darkvision 60 ft.; ";}
if (LeftArm == 19) {Strwithleftarm = 2;}
if (RightArm == 19) {Strwithrightarm = 2;}
//20 reptilian
if (RightHead == 20) {Perceptionskill = 10;}
if (LeftHead == 20) {Perceptionskill = 10;}
if (TorsoLower == 20) {
AcrobaticsSkill += 4;
SwimSkill += 4;
Racialbonus += " +4 Acrobatics, +4 Swim,";
}
if (LeftArm == 20) {Strwithleftarm = +1}
if (RightArm == 20) {Strwithrightarm = +1}
if (LeftHand == 20) {attackwithleftarm = "claw +";}
if (RightHand == 20) {attackwithrightarm = "claw +"}

1 Merfolk
if (RightHead == 1 || LeftHead == 1) {
AquaticCount = AquaticCount+1;
Perceptionskill = 11;
vision += "Darkvision 60 ft.; ";}
if (TorsoLower == 1) {
Movement = 1
SpecialMovement = ", Swim 50 ft."
SwimSkill += 12; //includes moving skill points over from climb
Racialbonus += " +8 Swim,";
}
16 extra crabman modifiers
if (RightHand == 16) {
attackwithrightarm = "claw +"
Damagewithrightarm = " (1d6+";
SpecialAttacks = "<b>Special Attacks</b> Improved grab, constrict (1d6+"+(Strwithrightarm+2)+")"
}
if (LeftHand == 16) {
attackwithleftarm = "claw +"
Damagewithleftarm = " (1d6+";
SpecialAttacks = "<b>Special Attacks</b> Improved grab, constrict (1d6+"+(Strwithleftarm+2)+")"
}
determine strongest arm for club damage
if (LeftHand != 16 && RightHand != 16) {
if (Strwithleftarm > Strwithrightarm) {
StrongestArm = Strwithleftarm;
if (LeftHand == 16) {StrongestArm = Strwithrightarm;}
} else {
StrongestArm = Strwithrightarm;}
}
we look at left hand 16 as crab claws can't wield a club we test for one, if both club entry is removed entirely

// eliminate superflous vision
if (vision==" Darkvision 90 ft.; Darkvision 60 ft.; ") {vision=" Darkvision 90 ft.; "}
if (vision==" Darkvision 90 ft.; Darkvision 90 ft.; ") {vision=" Darkvision 90 ft.; "}
if (vision==" Darkvision 60 ft.; Darkvision 60 ft.; ") {vision=" Darkvision 60 ft.; "}
if (vision==" low-light vision; low-light vision; ") {vision=" low-light vision; "}
if (vision==" low-light vision; Darkvision 60 ft.; ") {vision=" Darkvision 60 ft.; low-light vision; "}
//determine if it can breath water
if (AquaticCount == 2) {
SpecialAbilitiesString = ", can breathe water and air equally";
}

//Generate statblock
dw = "<i>This savage humanoid is hideous, seemingly pieced together from myriad parts of other monsters, <br>";
dw = (dw + "The left side of its head is " + partOrigin[LeftHead] + "; ");
dw = (dw + "the right side of its head is " + partOrigin[RightHead] + ". ");
dw = (dw + "The creature's jaw is " + partOrigin[Jaw] + ".<br>");
dw = (dw + "Its left arm is " + partOrigin[LeftArm] + ", ");
if (LeftHand != partOrigin.length) {dw = (dw + "and its left hand is " + partOrigin[LeftHand] + ". ");}
dw = (dw + "The right arm is " + partOrigin[RightArm] + ", ");
if (RightHand != partOrigin.length) {dw = (dw + "and its right hand is " + partOrigin[RightHand] + ", ");}
dw = (dw + "<br>The top half of the torso is " + partOrigin[TorsoUpper] + ". ");
if (TorsoLower != 1) {
dw = (dw + "Its lower body is " + partOrigin[TorsoLower] + ".<br>");
}
else
{
dw = (dw + "Its lower body is that of a fish, like a merfolk");
}
if (LeftLeg != partOrigin.length && LeftLeg != 1) {dw = (dw + "Its left leg is " + partOrigin[LeftLeg] + ", ");}
if (LeftFoot != partOrigin.length && LeftFoot !=1) {dw = (dw + "and its left foot is " + partOrigin[LeftFoot] + ". ");}
if (RightLeg != partOrigin.length && RightLeg != 1) {dw = (dw + "Its right leg is " + partOrigin[RightLeg] + ", ");}
if (RightFoot != partOrigin.length && RightFoot !=1) {dw = (dw + "and its right foot is " + partOrigin[RightFoot] + ", ");}

if (LeftLeg == 1) {dw+="Its left leg is a fin.";}
if (LeftFoot == 1) {dw+="but its left foor is a fin";}
if (RightLeg == 1) {dw+="It's right leg is a fin.";}
if (RightFoot == 1) {dw+="but its right foot is a fin";}
dw = dw + "</i><br><div style='background-color: rgb(207, 226, 243); width: 100%; font-variant: small-caps; margin-top: 6px; margin-bottom: 6px;'>";
dw = dw + "<table width='100%'><tbody><tr>";
dw = dw + "<td style='width: 85%; font-variant: small-caps;' align='left'><b>Mongrelman</b></td>";
dw = dw + "<td style='font-variant: small-caps;' align='right'><b>CR 1</b></td>";
dw = dw + "</tr></tbody></table></div>";
dw = dw + "<div style='width: 100%; line-height: 100%;'>";
dw = dw + "<div><span><b>XP 400</b></span>";
dw = dw + "<p>LN Medium Monstrous Humanoid<br>";
dw = dw + "<b>Init</b>";
dw = dw + " +1 <b>Senses</b> ";
dw = dw + vision;
// <a href='http://www.d20pfsrd.com/skills/perception'>
dw = dw + "Perception +";
dw = dw + Perceptionskill;
if (AuraString != "") {dw+="<br><b>Aura</b> "+AuraString;}
dw = dw + "</p>";
dw = dw + "<div style='border-top: 1px solid rgb(0, 0, 0); border-bottom: 1px solid rgb(0, 0, 0); margin-top: 6px; margin-bottom: 6px; width: 100%;'>";
dw = dw + "<p><b>DEFENSE</b></p>";
dw = dw + "</div>";
dw = dw + "<b>AC</b> 15 touch 11, flat-footed 14 (+1 Dex, +4 natural)<br>";
dw = dw + "<b>hp</b>";
dw = dw + " 13hp (2d10+2 con)<br>";
dw = dw + "<b>Fort</b>";
dw = dw + " +1"+ FortSavesSpecial+", <b>Ref</b> +4, <b>Will</b>";
dw = dw + " +5" + WillSavesSpecial;;
dw = dw + "";
dw = dw + "<div style='border-top: 1px solid rgb(0, 0, 0); border-bottom: 1px solid rgb(0, 0, 0); margin-top: 6px; margin-bottom: 6px; width: 100%;'>";
dw = dw + "<p><b>OFFENSE</b></p>";
dw = dw + "</div>";
dw = dw + "<b>Speed</b> "+ (Math.floor(Movement)*5) +" ft."+SpecialMovement+"<br>";
if (StrongestArm > -4) {
dw = dw + "<b>Melee</b>";
// don't show club if it only has crab claws and/or missing hands/arms
if (LeftHand == 16 && RightHand == 16) {noClub = 1;}
if (LeftArm == 0 && RightHand == 16) {noClub = 1;}
if (LeftHand == 16 && RightArm == 0) {noClub = 1;}
if (LeftHand == 0 && RightHand == 16) {noClub = 1;}
if (LeftHand == 16 && RightHand == 0) {noClub = 1;}
if (noClub != 1)
{
dw = dw + " Club +"+ (4+StrongestArm) + " (1d6+" + (2+StrongestArm) +"), or ";

}
if ((RightHand != partOrigin.length) && (RightHand != 1)) {
dw = dw + " right "+ attackwithrightarm + (4+Strwithrightarm) + Damagewithrightarm + (2+Strwithrightarm) +")";
if (LeftHand != partOrigin.length && RightHand != partOrigin.length) {dw += ", or";}
}
if ((LeftHand != partOrigin.length) && (LeftHand != 1)) {
dw = dw + " left "+ attackwithleftarm + (4+Strwithleftarm) + Damagewithleftarm + (2+Strwithleftarm) +")";
}
if (Jaw == 20) {dw += " and -1 bite (1d4+2)";}
if (Minotaurhead == 2) {dw += " and -1 gore (1d8+2)";}
if (Minotaurhead == 1) {dw += " and -1 gore (1d4+2)";}
dw+="<br>"
}
else
{
if (Minotaurhead > 0 || Jaw == 20) {
dw += "<b>Melee</b> "
if (Jaw == 20) {dw += " -1 Bite (1d4+2)";}
if (Minotaurhead > 0 && Jaw == 20) {
if (Minotaurhead == 2) {dw += "and -1 gore (1d8+2)";}
if (Minotaurhead == 1) {dw += "and -1 gore (1d4+2)";}
}else{
if (Minotaurhead == 2) {dw += " -1 Gore (1d8+2)";}
if (Minotaurhead == 1) {dw += " -1 Gore (1d4+2)";}
}
dw+="<br>"
}
}
dw += SpecialAttacks //ussually blank unless the mongrelman has crab claws
dw = dw + "<div style='border-top: 1px solid rgb(0, 0, 0); border-bottom: 1px solid rgb(0, 0, 0); margin-top: 6px; margin-bottom: 6px; width: 100%;'>";
dw = dw + "<p><b>STATISTICS</b></p>";
dw = dw + "</div>";
dw = dw + "<b>Str</b> 14, <b>Dex</b> 13, <b>Con</b> ";
dw = dw + "12, <b>Int</b> 10, <b>Wis</b> 14, <b>Cha</b> 6<br>";
dw = dw + "<b>Base Atk</b>";
dw = dw + " +2 <b>CMB</b> +4 <b>CMD</b>";
dw = dw + " 15<br>";
dw = dw + "<b>Feats</b>";
dw = dw + " Ability Focus (sound imitation)<br>";
dw = dw + "<b>Skills</b>";
dw = dw + " "
if (AcrobaticsSkill > 2) {dw+= "+"+AcrobaticsSkill+" Jump, ";}
dw = dw + "+"+ClimbSkill+" Climb, ";
dw = dw + "+" + Perceptionskill+" Perception, +7 Sleight of Hand, +"+(StealthSkill+6);
dw = dw + " Stealth, +6 Survival";
if (SwimSkill > 2) {dw+= ", +"+SwimSkill+" Swim";}
dw = dw + " <b>Racial modifiers:</b>"+ Racialbonus+" +4 Sleight of ";
dw = dw + "Hand, +"+(StealthSkill)+" Stealth" ;
dw = dw + "<br>";
dw = dw + "<b>Languages</b>";
dw = dw + " Mongrelman<br>";
dw = dw + "<b>SQ</b>";
dw = dw + " Sound Imitation" + SpecialAbilitiesString + "<br>";
dw = dw + "<b>Combat Gear</b>";
dw = dw + " Club<b><br>";
dw = dw + "</b>";
dw = dw + "<div style='border-top: 1px solid rgb(0, 0, 0); border-bottom: 1px solid rgb(0, 0, 0); margin-top: 6px; margin-bottom: 6px; width: 100%;'>";
dw = dw + "<p><b>SPECIAL ABILITIES</b></p>";
dw = dw + "</div>";
dw = dw + "<p><b>Sound Imitation (Ex):</b> Mongrelmen can imitate sounds made by any creature they have previously encountered, including monsters with special vocal attacks. They cannot, however, mimic the special vocal attack powers or damage dealt by such attacks. A successful DC 14 Will save made by a listener detects the falsehood. The save DC is Constitution-based and includes a +2 racial bonus." + SpecialAbilityDescription + "</p>";
dw = dw + "</div>";
dw = dw + "</div>";

document.write(dw);
</script>
</body>

</html>
</SCRIPT>

The content of this page is licensed under: Creative Commons Attribution-NC-SA 3.0; Most game rules licensed under OGL 1.0a; All images copyrighted by their creators all rights reserved; See legal page for more details