Code: Select all
<!-- Young Template -->
[H: assert( isGM(), "<b>" + getMacroName() + "</b> is a GM only macro.", 0 )]
[H: cancel = input( "Warning|This will permanently alter the selected token, are you certain you wish to continue?||LABEL|SPAN=TRUE" )]
[H: abort( cancel ) ]
[H: output = "<html>
<b>Young Creature (CR -1)</b><br>
Creatures with the young template are immature specimens of the base creature. <br>
Rebuild Rules: <b>Size</b> decrease by one category; <b>AC</b> reduce <b>natural armor</b> by -2; <b>Attacks</b> decrease damage dice by 1 step; <b>Ability Scores</b> -4 to Strength, -4 to Constitution and +4 to Dexterity.<br>
<table>
<thead>
Young Creature Abilities
</thead>
<tbody>
<tr>
<th>Ability</th><th>Bonus</th>
</tr>
<tr>
<td>Strength</td><td>-4</td>
</tr>
<tr>
<td>Constitution</td><td>-4</td>
</tr>
<tr>
<td>Dexterity</td><td>+4</td>
</tr>
<tr>
<td>Intelligence</td><td>+0</td>
</tr>
<tr>
<td>Wisdom</td><td>+0</td>
</tr>
<tr>
<td>Charisma</td><td>+0</td>
</tr>
</tbody>
</table>"]
[H: Levels = getProperty("Levels")]
[H: tECL = getStrProp(Levels, "ECL") ]
[H: CRs = "1/8,1/6,1/4,1/3,1/2,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,49,49,50"]
[H: newCR = listGet(CRs,max(0,listFind(CRs,tECL) - 1))]
[H: Levels = setStrProp(Levels, "ECL", newCR) ]
[H, MACRO("LibEnlargeReduce@Lib:libDnD35Pathfinder"): "Shrink=1; modType=1;"]
[H: tNaturalMod = getStrProp(ArmorClass, "NaturalMod")]
[H: tNaturalMod = if( tNaturalMod == "", 0, tNaturalMod )]
[H: ArmorClass = setStrProp(ArmorClass, "NaturalMod", tNaturalMod - 2)]
[H: tStrength = getProperty("Strength")]
[H: tStrength = if( tStrength == "", 0, tStrength - 4 )]
[H: setProperty("Strength", tStrength)]
[H: tDexterity = getProperty("Dexterity")]
[H: tDexterity = if( tDexterity == "", 4, tDexterity + 4 )]
[H: setProperty("Dexterity", tDexterity)]
[H: tConstitution = getProperty("Constitution")]
[H: tConstitution = if( tConstitution == "", 0, tConstitution - 4 )]
[H: setProperty("Constitution", tConstitution)]
[H: label = getLabel() ]
[H: label = if(label=="", "(Young)", label + " (Young)") ]
[H: setLabel(label) ]
[H: HP = HPmax ]
[H: tToken = currentToken() ]
[H, MACRO( "subUpdateHPStatesBars@Lib:libDnD35Pathfinder" ): "Token=" + tToken]
[H, MACRO( "subRecalcAC@Lib:libDnD35Pathfinder" ): "Token=" + currentToken() ]
[H: output = output + "Str: "+Strength+", Dex: "+Dexterity+", Con: "+Constitution+", Int: "+Intelligence+", Wis: "+Wisdom+", Cha: "+Charisma+"<br>"]
[H: output = output + getName()]
[H: output = output + " Restored to Full Health.<br><b>Young Template applied!</b></html>"]
[G: output]