; Basic DnD Character Gen.ipt
; created 1/27/2020 1:33:29 AM
;
; Class selection is done by building a string of likely classes
; based on stats (like FMT), concatinating them together weighing the
; string from higher stats more. Then randomly selecting one.
Table: Character
set: str=[@StatRoll]
set: int=[@StatRoll]
set: wis=[@StatRoll]
set: con=[@StatRoll]
set: dex=[@StatRoll]
set: cha=[@StatRoll]
set: classopts1=[@pickclass with 14]
set: classopts2=[@pickclass with 11]
set: classopts3=[@pickclass with 8]
set: classoptsall={classopts1}{classopts1}{classopts1}{classopts1}{classopts1}{classopts1}{classopts1}{classopts1}{classopts2}{classopts2}{classopts3}
set: classlen={length(classoptsall)}
set: classrnd={1d{classlen}}
set: classpick={substr( classoptsall, classrnd, 1)}
set: classname=[#{classpick} classes]
set: strmod=[#{str} strmod]
set: intmod=[#{int} intmod]
set: wismod=[#{wis} wismod]
set: dexmod=[#{dex} dexmod]
set: conmod=[#{con} conmod]
set: chamod=[#{cha} chamod]
set: hits={max( hits + hpmod, 1)}
set: ac=10
set: gp={3d6 * 10}
set: origgp={gp}
set: equip=[@equip]
set: finalac={min(10,(ac+acmod))}
set: weapons={if( length(weapons) > 0, weapons, "None")}
set: getlangs=[#{classpick} languages]
[@out]
table: StatRoll
set: a={1d6}
set: b={1d6}
set: c={1d6}
set: d={1d6}
set: m={min( a, b, c, d)}
set: t={a+b+c+d-m}
{t}
Table: pickclass
{if( str > {$1}, "F", "")}{if( int > {$1}, "M", "")}{if( wis > {$1}, "C", "")}{if( dex > {$1}, "T", "")}{if( (str > {$1}) and (con > {$1}), "D", "")}{if( (str > {$1}) and (dex > {$1}), "H", "")}{if( (str > {$1}) and (int > {$1}), "E", "")}
EndTable:
Table: classes
type: dictionary
default: Hopeless!{hits=4}
F:Fighter{hits==8}{pr=="STR"}
M:Magic User{hits==4}{pr=="INT"}
C:Cleric{hits==6}{pr=="WIS"}
T:Thief{hits==4}{pr=="DEX"}
D:Dwarf{hits==8}{pr=="STR"}
E:Elf{hits==6}{pr=="INT"}
H:Halfling{hits==6}{pr=="STR"}
Table: strmod
3:(-3 to hit, damage, and open doors)
4-5:(-2 to hit, damage, and open doors)
6-8:(-1 to hit, damage, and open doors)
9-12:
13-15:(+1 to hit, damage, and open doors)
16-17:(+2 to hit, damage, and open doors)
18:(+3 to hit, damage, and open doors)
Table: intmod
3-12:{lancnt==0}
13-15:{lancnt==1}
16-17:{lancnt==2}
18:{lancnt==3}
Table: wismod
3:(-3 on magic based saving throws){magicsave==-3}
4-5:(-2 on magic based saving throws){magicsave==-2}
6-8:(-1 on magic based saving throws){magicsave==-1}
9-12:{magicsave==0}
13-15:(+1 on magic based saving throws){magicsave==1}
16-17:(+2 on magic based saving throws){magicsave==2}
18:(+3 on magic based saving throws){magicsave==3}
Table: dexmod
3:(-3 to hit with missiles, -2 initiative){acmod==3}
4-5:(-2 to hit with missiles -1 initiative){acmod==2}
6-8:(-1 to hit with missiles -1 initiative){acmod==1}
9-12:{acmod==0}
13-15:(+1 to hit with missiles, +1 initiative){acmod==-1}
16-17:(+2 to hit with missiles, +1 initiative){acmod==-2}
18:(+3 to hit with missiles, +2 initiative){acmod==-3}
Table: conmod
3:{hpmod=-3}
4-5:{hpmod=-2}
6-8:{hpmod=-1}
9-12:{hpmod==0}
13-15:{hpmod=+1}
16-17:{hpmod=+2}
18:{hpmod=+3}
Table: chamod
3:(-2 reaction adjustment)
4-5:(-1 reaction adjustment)
6-8:(-1 reaction adjustment)
9-12:
13-15:(+1 reaction adjustment)
16-17:(+1 reaction adjustment)
18:(+2 reaction adjustment)
Table: thiefabil
type: dictionary
T:Open Locks - 15%, Find/Remove Traps = 10%, Pick Pockets - 20%, Move Silently - 20%, Climb - 87%, Hide in Shadows - 10%, Hear Noise - 1-2
Table: equip
[#{classpick} armor][#{classpick} weapons][#{classpick} gear]
Table: armor
type: dictionary
default: [@armorall][@armorshield]
M:{armor=="None"}
T:[@armorthief]
Table: armorthief
1-5:{armor=="None"}
6-10:[when]{gp} > 20 [do]{gp==gp-20}{armor=="Leather Armor"}{ac==7}[else]{armor=="None"}[end]
Table: armorall
1-2:{armor=="None"}
3-8:[when]{gp} > 30 [do]{gp==gp-20}{armor=="Leather Armor"}{ac==7}[else]{armor=="None"}[end]
9-15:[when]{gp} > 50 [do]{gp==gp-40}{armor=="Chain Mail Armor"}{ac==5}[else]{armor=="None"}[end]
16-20:[when]{gp} > 70 [do]{gp==gp-60}{armor=="Plate Mail Armor"}{ac==3}[else]{armor=="None"}[end]
Table: armorshield
1-3:
4-6:[when]{gp} > 20 [do]{gp==gp-10}{armor=="{armor} plus Shield"}{ac=={ac-1}}[end]
Table: weapons
type: dictionary
default: [@weaponsfighter][@missilefighter]
M:[@weaponsmagicuser]
C:[@weaponscleric][@missilecleric]
Table: weaponsmagicuser
set: numdags={max( 1d4-2, 1)}
1-3:{weapons=="None"}
4-10:[when]{gp} > {(3*numdags) + 10}[do]{gp==gp-(numdags*3)}{weapons=="Daggers ({numdags})"}[else]{weapons=="None"}[end]
Table: weaponscleric
1:
2-6:[when]{gp} > 5[do]{gp==gp-5}{weapons=="Mace"}[end]
7-8:[when]{gp} > 3[do]{gp==gp-3}{weapons=="Club"}[end]
9-10:[when]{gp} > 5[do]{gp==gp-5}{weapons=="War Hammer"}[end]
Table: missilecleric
1:
2:[when]{gp} > 2[do]{gp==gp-2}[@wc]{weapons=="{weapons}Sling (30 stones)"}[end]
Table: weaponsfighter
2:[when]{gp} > 7[do]{gp==gp-7}[@wc]{weapons=="{weapons}Battle Axe"}[end]
2:[when]{gp} > 7[do]{gp==gp-7}[@wc]{weapons=="{weapons}Short Sword"}[end]
5:[when]{gp} > 10[do]{gp==gp-10}[@wc]{weapons=="{weapons}Long Sword"}[end]
2:[#{classpick} weapontwohandedsword]
[when]{gp} > 5[do]{gp==gp-5}[@wc]{weapons=="{weapons}Mace"}[end]
[when]{gp} > 3[do]{gp==gp-3}[@wc]{weapons=="{weapons}Club"}[end]
[when]{gp} > 7[do]{gp==gp-7}[@wc]{weapons=="{weapons}Pole Arm"}[end]
[when]{gp} > 3[do]{gp==gp-3}[@wc]{weapons=="{weapons}Spear"}[end]
[when]{gp} > 5[do]{gp==gp-5}[@wc]{weapons=="{weapons}War Hammer"}[end]
; Dwarfs and Halfings can't use 2 handed swords
Table: weapontwohandedsword
type: dictionary
default:[when]{gp} > 15[do]{gp==gp-15}[@wc]{weapons=="{weapons}Two Handed Sword"}[end]
H:[when]{gp} > 7[do]{gp==gp-7}[@wc]{weapons=="{weapons}Short Sword"}[end]
D:[when]{gp} > 10[do]{gp==gp-10}[@wc]{weapons=="{weapons}Long Sword"}[end]
Table: missilefighter
5:
[when]{gp} > 40[do]{gp==gp-40}[@wc]{weapons=="{weapons}Crossbow (10 bolts)"}[end]
[#{classpick} weaponlongbow]
2:[when]{gp} > 30[do]{gp==gp-30}[@wc]{weapons=="{weapons}Short Bow (20 arrows)"}[end]
2:[when]{gp} > 4[do]{gp==gp-4}[@wc]{weapons=="{weapons}Hand Axe"}[end]
2:[when]{gp} > 3[do]{gp==gp-3}[@wc]{weapons=="{weapons}Dagger"}[end]
; Dwarfs and Halfings can't use long bows
Table: weaponlongbow
type: dictionary
default:[when]{gp} > 45[do]{gp==gp-45}[@wc]{weapons=="{weapons}Long Bow (20 arrows)"}[end]
H:[when]{gp} > 30[do]{gp==gp-30}[@wc]{weapons=="{weapons}Short Bow (20 arrows)"}[end]
D:[when]{gp} > 30[do]{gp==gp-30}[@wc]{weapons=="{weapons}Short Bow (20 arrows)"}[end]
Table: gear
type: dictionary
Set: gear=
default: [@gearcontainer][!{2d4} gearmisc]
T:[@gearthief][@gearcontainer][!{2d4} gearmisc]
C:[@gearcleric][@gearcontainer][!{2d4} gearmisc]
M:[@gearmagicuser][@gearcontainer][!{2d4} gearmisc]
E:[@gearmagicuser][@gearcontainer][!{2d4} gearmisc]
Table: gearcleric
1:[when]{gp} > 25 [do]{gp==gp-25}[@gc]{gear=="{gear}Holy Symbol"}[end]
Table: gearthief
1-2:[when]{gp} > 25 [do]{gp==gp-25}[@gc]{gear=="{gear}Thieves Tools"}[end]
3:
Table: gearmagicuser
{gear=="Spell Book"}
Table: gearcontainer
set: nn={1d3}
1-3:[when]{gp} > 5 [do]{gp==gp-5}[@gc]{gear=="{gear}Backpack"}[end]
4:[when]{gp} > 2 [do]{gp==gp-2}[@gc]{gear=="{gear}Large Sack"}[end]
5:[when]{gp} > {nn * 1} [do]{gp==gp-(nn*1)}[@gc]{gear=="{gear}Small Sack {nn}"}[end]
Table: gearmisc
set: nflasks={1d3}
[when]{gp} > {nflasks * 2) [do]{gp==gp-(nflasks *2)}[@gc]{gear=="{gear}Flask of Oil ({nflasks})Backpack"}[end]
[when]{gp} > 2[ do]{gp==gp-2}[@gc]{gear=="{gear}Hammer (small)"}[end]
[when]{gp} > 25 [do]{gp==gp-25}[@gc]{gear=="{gear}Holy Water (vial)"}[end]
[when]{gp} > 1 [do]{gp==gp-1}[@gc]{gear=="{gear}Iron Spikes (12)"}[end]
[when]{gp} > 10 [do]{gp==gp-10}[@gc]{gear=="{gear}Lantern"}[end]
[when]{gp} > 5 [do]{gp==gp-5}[@gc]{gear=="{gear}Steel Hand Mirror"}[end]
[when]{gp} > 15 [do]{gp==gp-15}[@gc]{gear=="{gear}Iron Rations (1 week)"}[end]
[when]{gp} > 5 [do]{gp==gp-5}[@gc]{gear=="{gear}Standard Rations (1 week)"}[end]
[when]{gp} > 1 [do]{gp==gp-1}[@gc]{gear=="{gear}Rope (50ft)"}[end]
[when]{gp} > 3 [do]{gp==gp-3}[@gc]{gear=="{gear}Tinder Box"}[end]
[when]{gp} > 1 [do]{gp==gp-1}[@gc]{gear=="{gear}Torches (6)"}[end]
[when]{gp} > 1 [do]{gp==gp-1}[@gc]{gear=="{gear}Wine Skin"}[end]
[when]{gp} > 1 [do]{gp==gp-1}[@gc]{gear=="{gear}Wine (1 qt)"}[end]
[when]{gp} > 10 [do]{gp==gp-10}[@gc]{gear=="{gear}Wolfsbane (1 bunch)"}[end]
[when]{gp} > 1 [do]{gp==gp-1}[@gc]{gear=="{gear}Wooden Pole (10ft)"}[end]
[when]{gp} > 30 [do]{gp==gp-30}[@gc]{gear=="{gear}Silver Dagger"}[end]
# gear - class tools, containers, other gear
Table: spellsmagicuser
3:Charm Person
Protection from Evil
Detect Magic
Read Languages
Floating Disc
Read Magic
Hold Portal
Shield
3:Light
5:Sleep
5:Maqic Missile
Ventriloquism
Table: spellsout
type: dictionary
default:
M:Spells - [@spellsmagicuser]
E:Spells - [@spellsmagicuser]
Table: savingthrows
type: dictionary
default:
F:Death: 12, Wands: 13, Paralysis: 14, Dragon: 15, Spells: 16
C:Death: 11, Wands: 12, Paralysis: 14, Dragon: 16, Spells: 15
M:Death: 13, Wands: 14, Paralysis: 13, Dragon: 16, Spells: 15
T:Death: 13, Wands: 14, Paralysis: 13, Dragon: 16, Spells: 15
E:Death: 12, Wands: 13, Paralysis: 13, Dragon: 15, Spells: 15
D:Death: 10, Wands: 11, Paralysis: 12, Dragon: 13, Spells: 14
H:Death: 10, Wands: 11, Paralysis: 12, Dragon: 13, Spells: 14
Table: languages
type: dictionary
default:[#{classpick} languagesbase][when]{lancnt} >0[do][!{lancnt} languageextra][end]
E:[#{classpick} languagesbase][when]{lancnt} >0[do][!{lancnt} languageextraelf][end]
D:[#{classpick} languagesbase][when]{lancnt} >0[do][!{lancnt} languageextradwarf][end]
H:[#{classpick} languagesbase][when]{lancnt} >0[do][!{lancnt} languageextrahalfling][end]
Table: languagesbase
type: dictionary
default:{langs=="Common, Alignment"}
E:{langs=="Elvish, Common, Alignment, Orcish, Hobgoblin, Gnoll"}
D:{langs=="Dwarvish, Common, Alignment, Gnomish, Kobold, Goblin"}
H:{langs=="Halfling, Common, Alignment"}
Table: languageextra
[@lc]{langs=langs+"Bugbear"}
[@lc]{langs=langs+"Doppleganger"}
[@lc]{langs=langs+"Dragon"}
20:[@lc]{langs=langs+"Dwarvish"}
20:[@lc]{langs=langs+"Elvish"}
[@lc]{langs=langs+"Gargoyle"}
5:[@lc]{langs=langs+"Gnoll"}
5:[@lc]{langs=langs+"Gnome"}
5:[@lc]{langs=langs+"Goblin"}
20:[@lc]{langs=langs+"Halfling"}
[@lc]{langs=langs+"Harpy"}
5:[@lc]{langs=langs+"Hobgoblin"}
10:[@lc]{langs=langs+"Human Dialect"}
5:[@lc]{langs=langs+"Kobold"}
[@lc]{langs=langs+"Lizard Man"}
[@lc]{langs=langs+"Medusa"}
[@lc]{langs=langs+"Minotaur"}
5:[@lc]{langs=langs+"Ogre"}
10:[@lc]{langs=langs+"Orcish"}
[@lc]{langs=langs+"Pixie"}
Table: languageextraelf
[@lc]{langs=langs+"Bugbear"}
[@lc]{langs=langs+"Doppleganger"}
[@lc]{langs=langs+"Dragon"}
10:[@lc]{langs=langs+"Dwarvish"}
[@lc]{langs=langs+"Gargoyle"}
5:[@lc]{langs=langs+"Gnome"}
5:[@lc]{langs=langs+"Goblin"}
10:[@lc]{langs=langs+"Halfling"}
[@lc]{langs=langs+"Harpy"}
[@lc]{langs=langs+"Human Dialect"}
5:[@lc]{langs=langs+"Kobold"}
[@lc]{langs=langs+"Lizard Man"}
[@lc]{langs=langs+"Medusa"}
[@lc]{langs=langs+"Minotaur"}
5:[@lc]{langs=langs+"Ogre"}
[@lc]{langs=langs+"Pixie"}
Table: languageextradwarf
[@lc]{langs=langs+"Bugbear"}
[@lc]{langs=langs+"Doppleganger"}
[@lc]{langs=langs+"Dragon"}
15:[@lc]{langs=langs+"Elvish"}
[@lc]{langs=langs+"Gargoyle"}
10:[@lc]{langs=langs+"Halfling"}
[@lc]{langs=langs+"Harpy"}
[@lc]{langs=langs+"Human Dialect"}
[@lc]{langs=langs+"Lizard Man"}
[@lc]{langs=langs+"Medusa"}
[@lc]{langs=langs+"Minotaur"}
5:[@lc]{langs=langs+"Ogre"}
[@lc]{langs=langs+"Pixie"}
Table: languageextrahalfling
[@lc]{langs=langs+"Bugbear"}
[@lc]{langs=langs+"Doppleganger"}
[@lc]{langs=langs+"Dragon"}
20:[@lc]{langs=langs+"Dwarvish"}
20:[@lc]{langs=langs+"Elvish"}
[@lc]{langs=langs+"Gargoyle"}
5:[@lc]{langs=langs+"Gnoll"}
5:[@lc]{langs=langs+"Gnome"}
5:[@lc]{langs=langs+"Goblin"}
[@lc]{langs=langs+"Harpy"}
5:[@lc]{langs=langs+"Hobgoblin"}
[@lc]{langs=langs+"Human Dialect"}
5:[@lc]{langs=langs+"Kobold"}
[@lc]{langs=langs+"Lizard Man"}
[@lc]{langs=langs+"Medusa"}
[@lc]{langs=langs+"Minotaur"}
5:[@lc]{langs=langs+"Ogre"}
10:[@lc]{langs=langs+"Orcish"}
[@lc]{langs=langs+"Pixie"}
#{classopts1} , {classopts2}, {classopts3}, {classlen}, {classrnd}, {classpick}
Table: out
[{classname} >> Bold]
Str [{str} >> Bold] {strmod}
&
Int [{int} >> Bold]
&
Wis [{wis} >> Bold] {wismod}
&
Con [{con} >> Bold]
&
Dex [{dex} >> Bold] {dexmod}
&
Cha [{cha} >> Bold] {chamod}
&
&
Hit Points - [{hits} >> Bold]
&
Armor Class - [{finalac} >> Bold]
&
Saving Throws - [#{classpick} savingthrows]
&
Languages - {langs}
&
[#{classpick} thiefabil]&
Gold Pieces - [{gp} >> Bold] (started with {origgp})
&
Armor - {armor}
&
Weapons - {weapons}
&
Gear - {gear}
&
[#{classpick} spellsout]
Table: wc
{weapons==weapons + if( length(weapons) > 0, ", ", "")}
Table: gc
{gear==gear + if( length(gear) > 0, ", ", "")}
Table: lc
{langs==langs + if( length(langs) > 0, ", ", "")}