% pcsheet.tex
%
% Version 0.99
%
% printing of a player character flowchart for AD&D 2nd edition games
%
%
% author:    Peter Balsiger (pb)
%            Weissensteinstr. 20a
%            CH-3008 Bern
%            Switzerland
%
%            E-mail: balsiger@math-stat.unibe.ch
%            BBS:    Yellow Box (+41-31-383-33-44) [SYSOP]
%
%
% history:   31. 1.94       pb    started
%             1. 2.94       pb    continued
%             2. 2.94       pb    printing area enlarged to really whole page
%             3. 2.94       pb    modified and add some commands
%             4. 2.94       pb    saving throws
%             5. 2.94       pb    continued, abilities
%             7. 2.94       pb    abilities, proficiencies
%             9. 2.94       pb    some design changes
%
%
% This sheet is designed for din A4 sized paper. If you want to use other paper,
% you have to adjust some postions. I needed the space, sorry...
%
% Because of the complexity of the used pages, LaTeX needs a whole lot of memory.
%
% I implemented the rules of the DMG and PH I remembered, if there are things
% wrong or missing, please tell me.
%
% This piece of work is freeware, use it how you want, but don't sell it in any
% way. If you think this work usefull, why not sending me one of your own adventures
% or other things for AD&D 2nd edition games ? Thanks...  :-)
%
% I did not yet have enough time to test every combination and each command. I absolutely
% sure that there are still a lot of nasty errors. If you encounter one of them, please
% let me know.

% set the size to the maximum possible for din A4

\addtolength{\textwidth}{\oddsidemargin}
\addtolength{\textwidth}{\marginparsep}
\addtolength{\textwidth}{\marginparwidth}
\setlength{\evensidemargin}{-20mm}
\setlength{\oddsidemargin}{-20mm}
\setlength{\topmargin}{-20mm}
\setlength{\evensidemargin}{-24mm}
\setlength{\oddsidemargin}{-24mm}
\setlength{\topmargin}{-24mm}
\addtolength{\textwidth}{42mm}
\addtolength{\textheight}{34mm}

\setlength{\marginparwidth}{0pt}
\setlength{\marginparsep}{0pt}

\addtolength{\textheight}{\headheight}
\addtolength{\textheight}{\headsep}
\addtolength{\textheight}{\footskip}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\footheight}{0pt}
\setlength{\footskip}{0pt}

\setlength{\parindent}{0pt}
\pagestyle{empty}

% counters, variables

  % globals
  \newcommand{\Iname}{Unknown}
  \newcounter{cTemp}
  \newcounter{cTempII}
  \newcount\cTmp
  \newcount\loop
  \newtoks\temptok


  % class flags
  \newcounter{cClass}
  \newcounter{cWarFlag}
  \newcounter{cPriestFlag}
  \newcounter{cRogueFlag}
  \newcounter{cWizardFlag}
  \newcounter{cPickPockets}
  \newcounter{cOpenLocks}
  \newcounter{cFRTraps}
  \newcounter{cMoveSil}
  \newcounter{cHide}
  \newcounter{cDetNoise}
  \newcounter{cClimb}
  \newcounter{cRead}
  \newcounter{cBackstab}
  \newcommand{\PickPockets}{}
  \newcommand{\OpenLocks}{}
  \newcommand{\FRTraps}{}
  \newcommand{\MoveSil}{}
  \newcommand{\Hide}{}
  \newcommand{\DetNoise}{}
  \newcommand{\Climb}{}
  \newcommand{\Read}{}
  \newcommand{\Backstab}{}


  % movement rates
  \newcounter{cMvBase}
  \newcounter{cMvLghLow}
  \newcounter{cMvLghHigh}
  \newcounter{cMvLghRate}
  \newcounter{cMvModLow}
  \newcounter{cMvModHigh}
  \newcounter{cMvModRate}
  \newcounter{cMvHvyLow}
  \newcounter{cMvHvyHigh}
  \newcounter{cMvHvyRate}
  \newcounter{cMvSevLow}
  \newcounter{cMvSevHigh}
  \newcounter{cMvSevRate}
  \newcounter{cEncumbrance}


  % level
  \newcounter{cLevel}


  % abilities
  \newcounter{cSTR}
  \newcounter{cExSTR}
  \newcounter{cDEX}
  \newcounter{cCON}
  \newcounter{cINT}
  \newcounter{cWIS}
  \newcounter{cCHR}


  % modifiers
  \newcounter{cHitProb}
  \newcounter{cDmgAdj}
  \newcounter{cWgtAll}
  \newcounter{cMaxPress}
  \newcounter{cOpDrs}
  \newcounter{cOpMgDrs}
  \newcounter{cBBLG}
  \newcounter{cRctnAdj}
  \newcounter{cMissAttAdj}
  \newcounter{cDefAdj}
  \newcounter{cHPAdj}
  \newcounter{cSysShk}
  \newcounter{cResSur}
  \newcounter{cPoisSav}
  \newcounter{cNoLang}
  \newcounter{cSpellLvl}
  \newcounter{cLrnSp}
  \newcounter{cSppLvl}
  \newcounter{cSpImm}
  \newcounter{cMgDAdj}
  \newcounter{cBonSp}
  \newcounter{cSpFail}
  \newcounter{cSpImmWIS}
  \newcounter{cMaxHench}
  \newcounter{cLoyBase}
  \newcounter{cRctnAdjCHR}
  \newcommand{\tReg}{}


  % saving throws
  \newcounter{cSTBreath}
  \newcounter{cSTBreathMod}
  \newcounter{cSTParalyze}
  \newcounter{cSTParalyzeMod}
  \newcounter{cSTStaff}
  \newcounter{cSTStaffMod}
  \newcounter{cSTSpell}
  \newcounter{cSTSpellMod}
  \newcounter{cSTPetrify}
  \newcounter{cSTPetrifyMod}
  \newcounter{cSTother}
  \newcounter{cSTotherMod}
  \newcommand{\tSTother}{\put(0,-40){\line(1,0){90}}}


  % AC
  \newcounter{cAC}
  \newcounter{cSurprised}
  \newcounter{cShieldless}
  \newcounter{cRear}
  \newcommand{\Armor}{}
  \newcounter{cArmors}


  % HP
  \newcounter{cHP}
  \newcounter{cHPBase}
  \newcommand{\Wounds}{}


  % special abilities
  \newlength{\lAbil}
  \newsavebox{\tmpbox}
  \newcount\cAbil
  \newcounter{cAbil}


  % proficiencies
  \newcounter{cProfLang}
  \newcounter{cProfWeap}
  \newcounter{cProfNWeap}


  % weapons
  \newcommand{\WeaponI}{}
  \newcommand{\WeaponII}{}
  \newcommand{\WeaponIII}{}
  \newcommand{\WeaponIV}{}
  \newcommand{\WeaponV}{}
  \newcounter{cWeapons}
  \newcommand{\WNrAttI}{}
  \newcommand{\WNrAttII}{}
  \newcommand{\WNrAttIII}{}
  \newcommand{\WNrAttIV}{}
  \newcommand{\WNrAttV}{}
  \newcounter{cWAttAdjI}
  \newcounter{cWAttAdjII}
  \newcounter{cWAttAdjIII}
  \newcounter{cWAttAdjIV}
  \newcounter{cWAttAdjV}
  \newcounter{cWDmgAdjI}
  \newcounter{cWDmgAdjII}
  \newcounter{cWDmgAdjIII}
  \newcounter{cWDmgAdjIV}
  \newcounter{cWDmgAdjV}
  \newcounter{cWTHACO}
  \newcommand{\WDmgSMI}{}
  \newcommand{\WDmgSMII}{}
  \newcommand{\WDmgSMIII}{}
  \newcommand{\WDmgSMIV}{}
  \newcommand{\WDmgSMV}{}
  \newcommand{\WDmgLI}{}
  \newcommand{\WDmgLII}{}
  \newcommand{\WDmgLIII}{}
  \newcommand{\WDmgLIV}{}
  \newcommand{\WDmgLV}{}
  \newcounter{cWRgSI}
  \newcounter{cWRgSII}
  \newcounter{cWRgSIII}
  \newcounter{cWRgSIV}
  \newcounter{cWRgSV}
  \newcounter{cWRgMI}
  \newcounter{cWRgMII}
  \newcounter{cWRgMIII}
  \newcounter{cWRgMIV}
  \newcounter{cWRgMV}
  \newcounter{cWRgLI}
  \newcounter{cWRgLII}
  \newcounter{cWRgLIII}
  \newcounter{cWRgLIV}
  \newcounter{cWRgLV}
  \newcounter{cWWgtI}
  \newcounter{cWWgtII}
  \newcounter{cWWgtIII}
  \newcounter{cWWgtIV}
  \newcounter{cWWgtV}
  \newcommand{\WeapTypeI}{}
  \newcommand{\WeapTypeII}{}
  \newcommand{\WeapTypeIII}{}
  \newcommand{\WeapTypeIV}{}
  \newcommand{\WeapTypeV}{}
  \newcommand{\WeapSizeI}{}
  \newcommand{\WeapSizeII}{}
  \newcommand{\WeapSizeIII}{}
  \newcommand{\WeapSizeIV}{}
  \newcommand{\WeapSizeV}{}
  \newcounter{cWSpeedI}
  \newcounter{cWSpeedII}
  \newcounter{cWSpeedIII}
  \newcounter{cWSpeedIV}
  \newcounter{cWSpeedV}

  % special attacks, ammunition
  \newcommand{\SpecialAttackI}{}
  \newcommand{\SpecialAttackII}{}
  \newcommand{\SpecialAttackIII}{}
  \newcommand{\AmmunitionI}{}
  \newcommand{\AmmunitionII}{}
  \newcommand{\AmmunitionIII}{}


  % items
  \newcommand{\Items}{}
  \newcounter{cItems}


  % xp
  \newcounter{cXP}
  \newcounter{cXPBonus}


  % treasure
  \newcounter{cCP}
  \newcounter{cSP}
  \newcounter{cGP}
  \newcounter{cEP}
  \newcounter{cPP}
  \newcommand{\Gems}{}
  \newcommand{\TreasureI}{}
  \newcommand{\TreasureII}{}
  \newcommand{\TreasureIII}{}
  \newcommand{\TreasureIV}{}


  % misc
  \newcommand{\Misc}{}
  \newcounter{cMisc}


  % henchmen
  \newcommand{\Hench}{}
  \newcounter{cHench}
  \newcounter{cHenchBack}



% commands

 % first the top box, with race, names, class...
% character name
\newcommand{\Icharacter}{\put(10,-20){\line(1,0){890}}}
\newcommand{\character}[1]{\def\Icharacter{#1}}

% player name
\newcommand{\Iplayer}{\put(10,-20){\line(1,0){375}}}
\newcommand{\player}[1]{\renewcommand{\Iplayer}{#1}}

% races (note, ability adjustments for race are _NOT_ made, make them before entering the abilities
\newcommand{\Irace}{\put(0,-10){\line(1,0){440}}}
\newcommand{\race}[1]
{
  \def\arg{#1}

  \def\comp{Dwarf}
  \ifx\arg\comp
    \setcounter{cMvBase}{6}
    \setcounter{cMvLghRate}{4}
    \setcounter{cMvModRate}{2}
    \setcounter{cMvHvyRate}{1}
    \setcounter{cMvSevRate}{1}
    \ifnum\value{cCON}<1
      \typeout{WARNING: constitution not defined, cannot set saving throw modifiers for dwarf}
    \else
      \typeout{Setting constitution bonus for dwarves.}
    \fi
    \ifnum\value{cCON}>4
      \addtocounter{cSTParalyzeMod}{1}
      \addtocounter{cSTSpellMod}{1}
      \addtocounter{cSTStaffMod}{1}
      \ifnum\value{cCON}>7
        \addtocounter{cSTParalyzeMod}{1}
        \addtocounter{cSTSpellMod}{1}
        \addtocounter{cSTStaffMod}{1}
        \ifnum\value{cCON}>11
          \addtocounter{cSTParalyzeMod}{1}
          \addtocounter{cSTSpellMod}{1}
          \addtocounter{cSTStaffMod}{1}
          \ifnum\value{cCON}>14
            \addtocounter{cSTParalyzeMod}{1}
            \addtocounter{cSTSpellMod}{1}
            \addtocounter{cSTStaffMod}{1}
            \ifnum\value{cCON}>18
              \addtocounter{cSTParalyzeMod}{1}
              \addtocounter{cSTSpellMod}{1}
              \addtocounter{cSTStaffMod}{1}
              \ifnum\value{cCON}>21
                \addtocounter{cSTParalyzeMod}{1}
                \addtocounter{cSTSpellMod}{1}
                \addtocounter{cSTStaffMod}{1}
                \ifnum\value{cCON}>25
                  \addtocounter{cSTParalyzeMod}{1}
                  \addtocounter{cSTSpellMod}{1}
                  \addtocounter{cSTStaffMod}{1}
                \fi
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
    \addability
    {
      {\bf Dwarf:}\par
      $\;$ Infravision, 60 feet \par
      $\;$ Detect grade, 10 ft, 1-5 d6 \par
      $\;$ Detect new tunnel, 10 ft, 1-5 d6 \par
      $\;$ Detect sliding walls, 10ft, 1-4d6 \par
      $\;$ Detect traps, 10 ft, 1-3d6 \par
      $\;$ Determine depth ug., 1-3 d6 \par
      $\;$ +1 to hit orcs, half orcs, \par
      $\;\;$ goblins, hobgoblins \par
      $\;$ -4 from attacks of ogres, trolls,\par
      $\;\;$ ogre magi, giants, titans \par
      $\;$ 20\% magical items fail \par
    }
    \typeout{Race 'Dwarf' recogniced, setting movement rates and racial abilities.}
  \else
    \def\comp{Elf}
    \ifx\arg\comp
      \setcounter{cMvBase}{12}
      \setcounter{cMvLghRate}{9}
      \setcounter{cMvModRate}{6}
      \setcounter{cMvHvyRate}{3}
      \setcounter{cMvSevRate}{1}
      \addability
      {
        {\bf Elf:} \par
        $\;$ 90\% immune to sleep and \par
        $\;\;$ charm spells \par
        $\;$ +1 on attack with bow, short \par
        $\;\;$ or long sword \par
        $\;$ Surprise -4 (-2 opening screen) \par
        $\;$ Infravision, 60 ft \par
        $\;$ Secret doors (passiv), 10ft, 1d6 \par
        $\;$ Secret doors (act), 10 ft, 1-2 d6 \par
        $\;$ Concealed portal, 1-3 d6
      }
      \typeout{Race 'Elf' recogniced, setting movement rates and racial abilities.}
    \else
      \def\comp{Human}
      \ifx\arg\comp
        \setcounter{cMvBase}{12}
        \setcounter{cMvLghRate}{9}
        \setcounter{cMvModRate}{6}
        \setcounter{cMvHvyRate}{3}
        \setcounter{cMvSevRate}{1}
        \typeout{Race 'Human' recogniced, setting movement rates (no racial abilities).}
      \else
        \def\comp{Half-Elf}
        \ifx\arg\comp
          \setcounter{cMvBase}{12}
          \setcounter{cMvLghRate}{9}
          \setcounter{cMvModRate}{6}
          \setcounter{cMvHvyRate}{3}
          \setcounter{cMvSevRate}{1}
          \addability
          {
            {\bf Half-Elf:} \par
            $\;$ 30\% immune to sleep and charm spells \par
            $\;$ Infravision, 60 feet \par
            $\;$ Secret doors (passiv), 10ft, 1d6 \par
            $\;$ Secret doors (active), 10 ft, 1-2 d6 \par
            $\;$ Concealed portal, 1-3 d6 \par
          }
          \typeout{Race 'Half-Elf' recogniced, setting movement rates and racial abilities.}
        \else
          \def\comp{Gnome}
          \ifx\arg\comp
            \setcounter{cMvBase}{6}
            \setcounter{cMvLghRate}{4}
            \setcounter{cMvModRate}{2}
            \setcounter{cMvHvyRate}{1}
            \setcounter{cMvSevRate}{1}
            \addability
            {
              {\bf Gnome:} \par
              $\;$ Infravision, 60 feet\par
              $\;$ Gem polishing and cutting \par
              $\;$ Detect grade, 10ft, 1-5 d6\par
              $\;$ Detect unsafe walls, 10ft, 1-7 d10 \par
              $\;$ Determine depth ug., 10ft, 1-4 d6 \par
              $\;$ Determine direction ug., 10ft, 1-3 d6\par
              $\;$ +1 to hit kobolds or goblins \par
              $\;$ -4 on attacks of gnolls, bugbears, ogres, trolls, ogre magi, giants, titans
            }
            \typeout{Race 'Gnome' recogniced, setting movement rates and racial abilities.}
          \else
            \def\comp{Hafling}
            \ifx\arg\comp
               \setcounter{cMvBase}{6}
               \setcounter{cMvLghRate}{4}
               \setcounter{cMvModRate}{2}
               \setcounter{cMvHvyRate}{1}
               \setcounter{cMvSevRate}{1}
               \addability
               {
                 {\bf Hafling:} \par
                 $\;$ 15\% chance for infravision, 60 ft (Stout)\par
                 $\;$ Add. 25\% change for infravision, 30 ft (1/2 Stout)\par
                 $\;$ Detect grade, 1-3 d4 (Stout)\par
                 $\;$ Determine direction, 1-3 d6 (Stout)\par
                 $\;$ +1 attack with thrown weapons and slings\par
                 $\;$ -4 surprise, -2 with screen
               }
              \typeout{Race 'Hafling' recogniced, setting movement rates and racial abilities.}
            \else
              \typeout{Sorry, race '#1' not recogniced, please set movement rates by hand.}
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi
  \renewcommand{\Irace}{#1}
}


% classes
\newcommand{\Iclass}{\put(0,-10){\line(1,0){440}}}
\newcommand{\class}[1]
{
  \def\arg{#1}
  \def\comp{Fighter}
  \ifx\arg\comp
    \addtocounter{cWarFlag}{1}
    \addtocounter{cClass}{1}
    \renewcommand{\Iclass}{$\mbox{Fighter}^{\mbox{\tiny Warrior}}$}
    \ifnum\value{cSTR}>16
      \addtocounter{cXPBonus}{10}
    \fi
    \typeout{Class '#1' recogniced, setting overclass.}
  \else
    \def\comp{Paladin}
    \ifx\arg\comp
      \addtocounter{cWarFlag}{1}
      \addtocounter{cClass}{1}
      \renewcommand{\Iclass}{$\mbox{Paladin}^{\mbox{\tiny Warrior}}$}
      \ifnum\value{cSTR}>16
        \ifnum\value{cCHR}>16
          \addtocounter{cXPBonus}{10}
        \fi
      \fi
      \addability
      {
        {\bf Paladin:} \par
        $\;$ Detect evil, 60 ft\par
        $\;$ Immune to diseases\par
        $\;$ Heal (2 hp/level/day)\par
        $\;$ Cure disease (1/week/5 level) \par
        $\;$ Aura of protection \par
        $\;$ Circle of power with holy sword\par
        $\;$ Turn undead (3rd level)\par
        $\;$ Call for war horse (4th level)\par
        $\;$ Cast priest spells (9th level)
      }
      \addtocounter{cSTBreathMod}{+2}
      \addtocounter{cSTParalyzeMod}{+2}
      \addtocounter{cSTStaffMod}{+2}
      \addtocounter{cSTSpellMod}{+2}
      \addtocounter{cSTPetrifyMod}{+2}
      \typeout{Class '#1' recogniced, setting overclass, abilities, saving throw modifier.}
    \else
      \def\comp{Ranger}
      \ifx\arg\comp
        \addtocounter{cWarFlag}{1}
        \addtocounter{cClass}{1}
        \renewcommand{\Iclass}{$\mbox{Ranger}^{\mbox{\tiny Warrior}}$}
        \ifnum\value{cSTR}>16
          \ifnum\value{cDEX}>16
            \ifnum\value{cWIS}>16
              \addtocounter{cXPBonus}{10}
           \fi
          \fi
        \fi
        \addability
        {
          {\bf Ranger:} \par
          $\;$ Tracking proficiency (+1/3l) \par
          $\;$ Modify animal reactions (-1/3l) \par
          $\;$ Befriend nonhostile animals \par
          $\;$ Discern qualities of creatures \par
        }
        \typeout{Class '#1' recogniced, setting overclass and abilities.}
      \else
        \def\comp{Mage}
        \ifx\arg\comp
          \addtocounter{cWizardFlag}{1}
          \addtocounter{cClass}{1}
          \renewcommand{\Iclass}{$\mbox{Mage}^{\mbox{\tiny Wizard}}$}
          \typeout{Class '#1' recogniced, setting overclass}
          \ifnum\value{cINT}>16
            \addtocounter{cXPBonus}{10}
          \fi
        \else
          \def\comp{Illusionist}
          \ifx\arg\comp
            \addtocounter{cClass}{1}
            \addtocounter{cWizardFlag}{1}
            \renewcommand{\Iclass}{$\mbox{Illusionist}^{\mbox{\tiny Wizard}}$}
            \addability
            {
              {\bf Specialist:} \par
              $\;$ Additional spell per level \par
              $\;$ +1 for saving throws for spells in own shool \par
              $\;$ -1 for other spell saving throws \par
              $\;$ +15\% to learn spell (own) \par
              $\;$ -15\% to learn seppl (other) \par
              $\;$ Automatic spell for new level \par
              $\;$ Easier spell creation (own) \par
              $\;$ Cannot use opposite spells
            }
            \typeout{Class '#1' recogniced, setting overclass and abilities.}
          \else
            \def\comp{Cleric}
            \ifx\arg\comp
              \addtocounter{cClass}{1}
              \addtocounter{cPriestFlag}{1}
              \renewcommand{\Iclass}{$\mbox{Cleric}^{\mbox{\tiny Priest}}$}
              \ifnum\value{cWIS}>16
                \addtocounter{cXPBonus}{10}
              \fi
              \typeout{Class '#1' recogniced, setting overclass}
            \else
              \def\comp{Druid}
              \ifx\arg\comp
                \addtocounter{cPriestFlag}{1}
                \addtocounter{cClass}{1}
                \renewcommand{\Iclass}{$\mbox{Druid}^{\mbox{\tiny Priest}}$}
                \addability
                {
                  {\bf Druid:} \par
                  $\;$ +2 saving throws agains fire or electrical \par
                  $\;$ Secret language \par
                  $\;$ Identify plans, animal, pure water (3rd level)\par
                  $\;$ Walk normall thru overgrown (3rd level) \par
                  $\;$ Language of woodland creature (1/3 level, from 3rd)\par
                  $\;$ Immune to charm spells by woodland creatures (7th level)\par
                  $\;$ Shapechange into reptile, bird, mammal (3/day)\par
                  $\;$ Cannot turn undead \par
                  $\;$ 6 spells per level (15th level)\par
                  $\;$ 6 additional spells (15th level)\par
                  $\;$ Immune to natural poision (16th level)\par
                  $\;$ No adjustments for aging (16th level)\par
                  $\;$ Alter appereance at will (16th level)\par
                  $\;$ Hibernation (17th level)\par
                  $\;$ Enter elemental plane of Earth at will (17th level)\par
                  $\;$ Enter elemental plane of Fire (18th level)\par
                  $\;$ Enter elemental plane of Water (19th level)\par
                  $\;$ Enter elemental plane of Air (20th level)
                }
                \typeout{Class '#1' recogniced, setting overclass and abilities.}
              \else
                \def\comp{Thief}
                \ifx\arg\comp
                  \addtocounter{cRogueFlag}{1}
                  \addtocounter{cClass}{1}
                  \renewcommand{\Iclass}{$\mbox{Thief}^{\mbox{\tiny Rogue}}$}
                  \ifnum\value{cSTR}>16
                    \addtocounter{cXPBonus}{10}
                  \fi
                  \ifnum\value{cPickPockets}=0
                  \else
                    \renewcommand{\PickPockets}{$\;\;$\arabic{cPickPockets}}
                  \fi
                  \ifnum\value{cOpenLocks}=0
                  \else
                    \renewcommand{\OpenLocks}{$\;\;$\arabic{cOpenLocks}}
                  \fi
                  \ifnum\value{cFRTraps}=0
                  \else
                    \renewcommand{\FRTraps}{$\;\;$\arabic{cFRTraps}}
                  \fi
                  \ifnum\value{cMoveSil}=0
                  \else
                    \renewcommand{\MoveSil}{$\;\;$\arabic{cMoveSil}}
                  \fi
                  \ifnum\value{cHide}=0
                  \else
                    \renewcommand{\Hide}{$\;\;$\arabic{cHide}}
                  \fi
                  \ifnum\value{cDetNoise}=0
                  \else
                    \renewcommand{\DetNoise}{$\;\;$\arabic{cDetNoise}}
                  \fi
                  \ifnum\value{cClimb}=0
                  \else
                    \renewcommand{\Climb}{$\;\;$\arabic{cClimb}}
                  \fi
                  \ifnum\value{cRead}=0
                  \else
                    \renewcommand{\Read}{$\;\;$\arabic{cRead}}
                  \fi
                  \ifnum\value{cBackstab}=0
                  \else
                    \renewcommand{\Backstab}{\arabic{cBackstab}}
                  \fi
                  \addability
                  {
                    {\bf Thief:} \par
                    $\;$ Pick pockets \PickPockets\% \par
                    $\;$ Open locks \OpenLocks\% \par
                    $\;$ Find/Remove Traps \FRTraps\% \par
                    $\;$ Move silently \MoveSil\% \par
                    $\;$ Hide in shadwos \Hide\% \par
                    $\;$ Detect noise \DetNoise\% \par
                    $\;$ Climb walls \Climb\% \par
                    $\;$ Read languages \Read\% \par
                    $\;$ Backstab  x \Backstab \par
                    $\;$ Thieves cant \par
                    $\;$ Limited use magical/clerical \par
                    $\;\;$ scrolls (10th level)
                  }
                  \typeout{Class '#1' recogniced, setting overclass and abilities.}
                \else
                  \def\comp{Bard}
                  \ifx\arg\comp
                    \addtocounter{cRogueFlag}{1}
                    \addtocounter{cClass}{1}
                    \renewcommand{\Iclass}{$\mbox{Bard}^{\mbox{\tiny Rogue}}$}
                    \ifnum\value{cPickPockets}>0
                      \renewcommand{\PickPockets}{$\;\;$\arabic{cPickPockets}}
                    \fi
                    \ifnum\value{cOpenLocks}>0
                      \renewcommand{\OpenLocks}{$\;\;$\arabic{cOpenLocks}}
                    \fi
                    \ifnum\value{cFRTraps}>0
                      \renewcommand{\FRTraps}{$\;\;$\arabic{cFRTraps}}
                    \fi
                    \ifnum\value{cMoveSil}>0
                      \renewcommand{\MoveSil}{$\;\;$\arabic{cMoveSil}}
                    \fi
                    \ifnum\value{cHide}>0
                      \renewcommand{\Hide}{$\;\;$\arabic{cHide}}
                    \fi
                    \ifnum\value{cDetNoise}>0
                      \renewcommand{\DetNoise}{$\;\;$\arabic{cDetNoise}}
                    \fi
                    \ifnum\value{cClimb}>0
                      \renewcommand{\Climb}{$\;\;$\arabic{cClimb}}
                    \fi
                    \ifnum\value{cRead}>0
                      \renewcommand{\Read}{$\;\;$\arabic{cRead}}
                    \fi
                    \ifnum\value{cBackstab}>0
                      \renewcommand{\Backstab}{\arabic{cBackstab}}
                    \fi
                      \addability
                    {
                      {\bf Bard:} \par
                      $\;$ Sing, chant, play instrument \par
                      $\;$ Pick pockets  \PickPockets\% \par
                      $\;$ Open locks  \OpenLocks\% \par
                      $\;$ Find/Remove tTraps  \FRTraps\% \par
                      $\;$ Move silently  \MoveSil\% \par
                      $\;$ Hide in shadwos  \Hide\% \par
                      $\;$ Detect noise  \DetNoise\% \par
                      $\;$ Climb walls  \Climb\% \par
                      $\;$ Read languages  \Read\% \par
                      $\;$ Backstab  x \Backstab \par
                      $\;$ Influence reactions \par
                      $\;$ Counter songs (poetry, magical)\par
                      $\;$ Read/write\par
                      $\;$ Local history\par
                      $\;$ 5\% to indentify magical item\par
                      $\;$ Use written magical devices (10th level), 15\% backfire
                    }
                      \typeout{Class '#1' recogniced, setting overclass}
                  \else
                    \typeout{Class '#1' not recognized, using only base class}
                    \renewcommand{\Iclass}{#1}
                  \fi
                \fi
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi
}

% alignment
\newcommand{\IAL}{\put(0,-10){\line(1,0){130}}}
\newcommand{\AL}[1]
{
  \def\arg{#1}
  \def\comp{LG}
  \ifx\arg\comp
    \typeout{Alignment '#1' recognized.}
  \else
    \def\comp{NG}
    \ifx\arg\comp
      \typeout{Alignment '#1' recognized.}
    \else
      \def\comp{CG}
      \ifx\arg\comp
        \typeout{Alignment '#1' recognized.}
      \else
        \def\comp{N}
        \ifx\arg\comp
          \typeout{Alignment '#1' recognized.}
        \else
          \def\comp{LE}
          \ifx\arg\comp
            \typeout{Alignment '#1' recognized.}
          \else
            \def\comp{NE}
            \ifx\arg\comp
              \typeout{Alignment '#1' recognized.}
            \else
              \def\comp{CE}
              \ifx\arg\comp
                \typeout{Alignment '#1' recognized.}
              \else
                \def\comp{LN}
                \ifx\arg\comp
                  \typeout{Alignment '#1' recognized.}
                \else
                  \def\comp{CN}
                  \ifx\arg\comp
                    \typeout{Alignment '#1' recognized.}
                  \else
                    \typeout{Alignment '#1' not recognized.}
                  \fi
                \fi
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \fi

  \renewcommand{\IAL}{#1}
}

% level
\newcommand{\level}[1]
{
  \setcounter{cLevel}{#1}
  \typeout{Level set to '#1', setting saving throws.}

  \ifnum\value{cClass}<2
    \ifnum\value{cPriestFlag}>0
      \cTmp=-\value{cLevel}
      \advance\cTmp by 1
      \divide\cTmp by 3
      \multiply\cTmp by 2
      \advance\cTmp by 20
      \setcounter{cWTHACO}{\cTmp}
      \ifcase\value{cLevel}
        \or % 1
          \addtocounter{cSTParalyze}{10}
          \addtocounter{cSTStaff}{14}
          \addtocounter{cSTPetrify}{13}
          \addtocounter{cSTBreath}{16}
          \addtocounter{cSTSpell}{15}
        \or % 2
          \addtocounter{cSTParalyze}{10}
          \addtocounter{cSTStaff}{14}
          \addtocounter{cSTPetrify}{13}
          \addtocounter{cSTBreath}{16}
          \addtocounter{cSTSpell}{15}
        \or % 3
          \addtocounter{cSTParalyze}{10}
          \addtocounter{cSTStaff}{14}
          \addtocounter{cSTPetrify}{13}
          \addtocounter{cSTBreath}{16}
          \addtocounter{cSTSpell}{15}
        \or % 4
          \addtocounter{cSTParalyze}{9}
          \addtocounter{cSTStaff}{13}
          \addtocounter{cSTPetrify}{12}
          \addtocounter{cSTBreath}{15}
          \addtocounter{cSTSpell}{15}
        \or % 5
          \addtocounter{cSTParalyze}{9}
          \addtocounter{cSTStaff}{13}
          \addtocounter{cSTPetrify}{12}
          \addtocounter{cSTBreath}{15}
          \addtocounter{cSTSpell}{15}
        \or % 6
          \addtocounter{cSTParalyze}{9}
          \addtocounter{cSTStaff}{13}
          \addtocounter{cSTPetrify}{12}
          \addtocounter{cSTBreath}{15}
          \addtocounter{cSTSpell}{15}
        \or % 7
          \addtocounter{cSTParalyze}{7}
          \addtocounter{cSTStaff}{11}
          \addtocounter{cSTPetrify}{10}
          \addtocounter{cSTBreath}{13}
          \addtocounter{cSTSpell}{12}
        \or % 8
          \addtocounter{cSTParalyze}{7}
          \addtocounter{cSTStaff}{11}
          \addtocounter{cSTPetrify}{10}
          \addtocounter{cSTBreath}{13}
          \addtocounter{cSTSpell}{12}
        \or % 9
          \addtocounter{cSTParalyze}{7}
          \addtocounter{cSTStaff}{11}
          \addtocounter{cSTPetrify}{10}
          \addtocounter{cSTBreath}{13}
          \addtocounter{cSTSpell}{12}
        \or % 10
          \addtocounter{cSTParalyze}{6}
          \addtocounter{cSTStaff}{10}
          \addtocounter{cSTPetrify}{9}
          \addtocounter{cSTBreath}{12}
          \addtocounter{cSTSpell}{11}
        \or % 11
          \addtocounter{cSTParalyze}{6}
          \addtocounter{cSTStaff}{10}
          \addtocounter{cSTPetrify}{9}
          \addtocounter{cSTBreath}{12}
          \addtocounter{cSTSpell}{11}
        \or % 12
          \addtocounter{cSTParalyze}{6}
          \addtocounter{cSTStaff}{10}
          \addtocounter{cSTPetrify}{9}
          \addtocounter{cSTBreath}{12}
          \addtocounter{cSTSpell}{11}
        \or % 13
          \addtocounter{cSTParalyze}{5}
          \addtocounter{cSTStaff}{9}
          \addtocounter{cSTPetrify}{8}
          \addtocounter{cSTBreath}{11}
          \addtocounter{cSTSpell}{10}
        \or % 14
          \addtocounter{cSTParalyze}{5}
          \addtocounter{cSTStaff}{9}
          \addtocounter{cSTPetrify}{8}
          \addtocounter{cSTBreath}{11}
          \addtocounter{cSTSpell}{10}
        \or % 15
          \addtocounter{cSTParalyze}{5}
          \addtocounter{cSTStaff}{9}
          \addtocounter{cSTPetrify}{8}
          \addtocounter{cSTBreath}{11}
          \addtocounter{cSTSpell}{10}
        \or % 16
          \addtocounter{cSTParalyze}{4}
          \addtocounter{cSTStaff}{8}
          \addtocounter{cSTPetrify}{7}
          \addtocounter{cSTBreath}{10}
          \addtocounter{cSTSpell}{9}
        \or % 17
          \addtocounter{cSTParalyze}{4}
          \addtocounter{cSTStaff}{8}
          \addtocounter{cSTPetrify}{7}
          \addtocounter{cSTBreath}{10}
          \addtocounter{cSTSpell}{9}
        \or % 18
          \addtocounter{cSTParalyze}{4}
          \addtocounter{cSTStaff}{8}
          \addtocounter{cSTPetrify}{7}
          \addtocounter{cSTBreath}{10}
          \addtocounter{cSTSpell}{9}
        \else
          \addtocounter{cSTParalyze}{2}
          \addtocounter{cSTStaff}{6}
          \addtocounter{cSTPetrify}{5}
          \addtocounter{cSTBreath}{8}
          \addtocounter{cSTSpell}{7}
        \fi
    \else
      \ifnum\value{cRogueFlag}>0
        \cTmp=-\value{cLevel}
        \advance\cTmp by 1
        \divide\cTmp by 2
        \advance\cTmp by 20
        \setcounter{cWTHACO}{\cTmp}
        \ifcase\value{cLevel}
          \or % 1
            \addtocounter{cSTParalyze}{13}
            \addtocounter{cSTStaff}{14}
            \addtocounter{cSTPetrify}{12}
            \addtocounter{cSTBreath}{16}
            \addtocounter{cSTSpell}{15}
          \or % 2
            \addtocounter{cSTParalyze}{13}
            \addtocounter{cSTStaff}{14}
            \addtocounter{cSTPetrify}{12}
            \addtocounter{cSTBreath}{16}
            \addtocounter{cSTSpell}{15}
          \or % 3
            \addtocounter{cSTParalyze}{13}
            \addtocounter{cSTStaff}{14}
            \addtocounter{cSTPetrify}{12}
            \addtocounter{cSTBreath}{16}
            \addtocounter{cSTSpell}{15}
          \or % 4
            \addtocounter{cSTParalyze}{13}
            \addtocounter{cSTStaff}{14}
            \addtocounter{cSTPetrify}{12}
            \addtocounter{cSTBreath}{16}
            \addtocounter{cSTSpell}{15}
          \or % 5
            \addtocounter{cSTParalyze}{12}
            \addtocounter{cSTStaff}{12}
            \addtocounter{cSTPetrify}{11}
            \addtocounter{cSTBreath}{15}
            \addtocounter{cSTSpell}{13}
          \or % 6
            \addtocounter{cSTParalyze}{12}
            \addtocounter{cSTStaff}{12}
            \addtocounter{cSTPetrify}{11}
            \addtocounter{cSTBreath}{15}
            \addtocounter{cSTSpell}{13}
          \or % 7
            \addtocounter{cSTParalyze}{12}
            \addtocounter{cSTStaff}{12}
            \addtocounter{cSTPetrify}{11}
            \addtocounter{cSTBreath}{15}
            \addtocounter{cSTSpell}{13}
          \or % 8
            \addtocounter{cSTParalyze}{12}
            \addtocounter{cSTStaff}{12}
            \addtocounter{cSTPetrify}{11}
            \addtocounter{cSTBreath}{15}
            \addtocounter{cSTSpell}{13}
          \or % 9
            \addtocounter{cSTParalyze}{11}
            \addtocounter{cSTStaff}{10}
            \addtocounter{cSTPetrify}{10}
            \addtocounter{cSTBreath}{14}
            \addtocounter{cSTSpell}{11}
          \or % 10
            \addtocounter{cSTParalyze}{11}
            \addtocounter{cSTStaff}{10}
            \addtocounter{cSTPetrify}{10}
            \addtocounter{cSTBreath}{14}
            \addtocounter{cSTSpell}{11}
          \or % 11
            \addtocounter{cSTParalyze}{11}
            \addtocounter{cSTStaff}{10}
            \addtocounter{cSTPetrify}{10}
            \addtocounter{cSTBreath}{14}
            \addtocounter{cSTSpell}{11}
          \or % 12
            \addtocounter{cSTParalyze}{11}
            \addtocounter{cSTStaff}{10}
            \addtocounter{cSTPetrify}{10}
            \addtocounter{cSTBreath}{14}
            \addtocounter{cSTSpell}{11}
          \or % 13
            \addtocounter{cSTParalyze}{10}
            \addtocounter{cSTStaff}{8}
            \addtocounter{cSTPetrify}{9}
            \addtocounter{cSTBreath}{13}
            \addtocounter{cSTSpell}{9}
          \or % 14
            \addtocounter{cSTParalyze}{10}
            \addtocounter{cSTStaff}{8}
            \addtocounter{cSTPetrify}{9}
            \addtocounter{cSTBreath}{13}
            \addtocounter{cSTSpell}{9}
          \or % 15
            \addtocounter{cSTParalyze}{10}
            \addtocounter{cSTStaff}{8}
            \addtocounter{cSTPetrify}{9}
            \addtocounter{cSTBreath}{13}
            \addtocounter{cSTSpell}{9}
          \or % 16
            \addtocounter{cSTParalyze}{10}
            \addtocounter{cSTStaff}{8}
            \addtocounter{cSTPetrify}{9}
            \addtocounter{cSTBreath}{13}
            \addtocounter{cSTSpell}{9}
          \or % 17
            \addtocounter{cSTParalyze}{9}
            \addtocounter{cSTStaff}{6}
            \addtocounter{cSTPetrify}{8}
            \addtocounter{cSTBreath}{12}
            \addtocounter{cSTSpell}{7}
          \or % 18
            \addtocounter{cSTParalyze}{9}
            \addtocounter{cSTStaff}{6}
            \addtocounter{cSTPetrify}{8}
            \addtocounter{cSTBreath}{12}
            \addtocounter{cSTSpell}{7}
          \or % 19
            \addtocounter{cSTParalyze}{9}
            \addtocounter{cSTStaff}{6}
            \addtocounter{cSTPetrify}{8}
            \addtocounter{cSTBreath}{12}
            \addtocounter{cSTSpell}{7}
          \or % 20
            \addtocounter{cSTParalyze}{9}
            \addtocounter{cSTStaff}{6}
            \addtocounter{cSTPetrify}{8}
            \addtocounter{cSTBreath}{12}
            \addtocounter{cSTSpell}{7}
          \else
            \addtocounter{cSTParalyze}{8}
            \addtocounter{cSTStaff}{4}
            \addtocounter{cSTPetrify}{7}
            \addtocounter{cSTBreath}{11}
            \addtocounter{cSTSpell}{5}
          \fi
      \else
        \ifnum\value{cWarFlag}>0
          \cTmp=-\value{cLevel}
          \advance\cTmp by 1
          \advance\cTmp by 20
          \setcounter{cWTHACO}{\cTmp}
          \ifcase\value{cLevel}
            \or % 1
              \addtocounter{cSTParalyze}{14}
              \addtocounter{cSTStaff}{16}
              \addtocounter{cSTPetrify}{15}
              \addtocounter{cSTBreath}{17}
              \addtocounter{cSTSpell}{17}
            \or % 2
              \addtocounter{cSTParalyze}{14}
              \addtocounter{cSTStaff}{16}
              \addtocounter{cSTPetrify}{15}
              \addtocounter{cSTBreath}{17}
              \addtocounter{cSTSpell}{17}
            \or % 3
              \addtocounter{cSTParalyze}{13}
              \addtocounter{cSTStaff}{15}
              \addtocounter{cSTPetrify}{14}
              \addtocounter{cSTBreath}{16}
              \addtocounter{cSTSpell}{16}
            \or % 4
              \addtocounter{cSTParalyze}{13}
              \addtocounter{cSTStaff}{15}
              \addtocounter{cSTPetrify}{14}
              \addtocounter{cSTBreath}{16}
              \addtocounter{cSTSpell}{16}
            \or % 5
              \addtocounter{cSTParalyze}{11}
              \addtocounter{cSTStaff}{13}
              \addtocounter{cSTPetrify}{12}
              \addtocounter{cSTBreath}{13}
              \addtocounter{cSTSpell}{14}
            \or % 6
              \addtocounter{cSTParalyze}{11}
              \addtocounter{cSTStaff}{13}
              \addtocounter{cSTPetrify}{12}
              \addtocounter{cSTBreath}{13}
              \addtocounter{cSTSpell}{14}
            \or % 7
              \addtocounter{cSTParalyze}{10}
              \addtocounter{cSTStaff}{12}
              \addtocounter{cSTPetrify}{11}
              \addtocounter{cSTBreath}{12}
              \addtocounter{cSTSpell}{13}
            \or % 8
              \addtocounter{cSTParalyze}{10}
              \addtocounter{cSTStaff}{12}
              \addtocounter{cSTPetrify}{11}
              \addtocounter{cSTBreath}{12}
              \addtocounter{cSTSpell}{13}
            \or % 9
              \addtocounter{cSTParalyze}{8}
              \addtocounter{cSTStaff}{10}
              \addtocounter{cSTPetrify}{9}
              \addtocounter{cSTBreath}{9}
              \addtocounter{cSTSpell}{11}
            \or % 10
              \addtocounter{cSTParalyze}{8}
              \addtocounter{cSTStaff}{10}
              \addtocounter{cSTPetrify}{9}
              \addtocounter{cSTBreath}{9}
              \addtocounter{cSTSpell}{11}
            \or % 11
              \addtocounter{cSTParalyze}{7}
              \addtocounter{cSTStaff}{9}
              \addtocounter{cSTPetrify}{8}
              \addtocounter{cSTBreath}{8}
              \addtocounter{cSTSpell}{10}
            \or % 12
              \addtocounter{cSTParalyze}{7}
              \addtocounter{cSTStaff}{9}
              \addtocounter{cSTPetrify}{8}
              \addtocounter{cSTBreath}{8}
              \addtocounter{cSTSpell}{10}
            \or % 13
              \addtocounter{cSTParalyze}{5}
              \addtocounter{cSTStaff}{7}
              \addtocounter{cSTPetrify}{6}
              \addtocounter{cSTBreath}{5}
              \addtocounter{cSTSpell}{8}
            \or % 14
              \addtocounter{cSTParalyze}{5}
              \addtocounter{cSTStaff}{7}
              \addtocounter{cSTPetrify}{6}
              \addtocounter{cSTBreath}{5}
              \addtocounter{cSTSpell}{8}
            \or % 15
              \addtocounter{cSTParalyze}{4}
              \addtocounter{cSTStaff}{6}
              \addtocounter{cSTPetrify}{5}
              \addtocounter{cSTBreath}{4}
              \addtocounter{cSTSpell}{7}
            \or % 16
              \addtocounter{cSTParalyze}{4}
              \addtocounter{cSTStaff}{6}
              \addtocounter{cSTPetrify}{5}
              \addtocounter{cSTBreath}{4}
              \addtocounter{cSTSpell}{7}
            \else
              \addtocounter{cSTParalyze}{3}
              \addtocounter{cSTStaff}{5}
              \addtocounter{cSTPetrify}{4}
              \addtocounter{cSTBreath}{4}
              \addtocounter{cSTSpell}{6}
            \fi
        \else
          \ifnum\value{cWizardFlag}>0
            \cTmp=-\value{cLevel}
            \advance\cTmp by 1
            \divide\cTmp by 3
            \advance\cTmp by 20
            \setcounter{cWTHACO}{\cTmp}
            \ifcase\value{cLevel}
              \or % 1
                \addtocounter{cSTParalyze}{14}
                \addtocounter{cSTStaff}{11}
                \addtocounter{cSTPetrify}{13}
                \addtocounter{cSTBreath}{15}
                \addtocounter{cSTSpell}{12}
              \or % 2
                \addtocounter{cSTParalyze}{14}
                \addtocounter{cSTStaff}{11}
                \addtocounter{cSTPetrify}{13}
                \addtocounter{cSTBreath}{15}
                \addtocounter{cSTSpell}{12}
              \or % 3
                \addtocounter{cSTParalyze}{14}
                \addtocounter{cSTStaff}{11}
                \addtocounter{cSTPetrify}{13}
                \addtocounter{cSTBreath}{15}
                \addtocounter{cSTSpell}{12}
              \or % 4
                \addtocounter{cSTParalyze}{14}
                \addtocounter{cSTStaff}{11}
                \addtocounter{cSTPetrify}{13}
                \addtocounter{cSTBreath}{15}
                \addtocounter{cSTSpell}{12}
              \or % 5
                \addtocounter{cSTParalyze}{14}
                \addtocounter{cSTStaff}{11}
                \addtocounter{cSTPetrify}{13}
                \addtocounter{cSTBreath}{15}
                \addtocounter{cSTSpell}{12}
              \or % 6
                \addtocounter{cSTParalyze}{13}
                \addtocounter{cSTStaff}{9}
                \addtocounter{cSTPetrify}{11}
                \addtocounter{cSTBreath}{13}
                \addtocounter{cSTSpell}{10}
              \or % 7
                \addtocounter{cSTParalyze}{13}
                \addtocounter{cSTStaff}{9}
                \addtocounter{cSTPetrify}{11}
                \addtocounter{cSTBreath}{13}
                \addtocounter{cSTSpell}{10}
              \or % 8
                \addtocounter{cSTParalyze}{13}
                \addtocounter{cSTStaff}{9}
                \addtocounter{cSTPetrify}{11}
                \addtocounter{cSTBreath}{13}
                \addtocounter{cSTSpell}{10}
              \or % 9
                \addtocounter{cSTParalyze}{13}
                \addtocounter{cSTStaff}{9}
                \addtocounter{cSTPetrify}{11}
                \addtocounter{cSTBreath}{13}
                \addtocounter{cSTSpell}{10}
              \or % 10
                \addtocounter{cSTParalyze}{13}
                \addtocounter{cSTStaff}{9}
                \addtocounter{cSTPetrify}{11}
                \addtocounter{cSTBreath}{13}
                \addtocounter{cSTSpell}{10}
              \or % 11
                \addtocounter{cSTParalyze}{11}
                \addtocounter{cSTStaff}{7}
                \addtocounter{cSTPetrify}{9}
                \addtocounter{cSTBreath}{11}
                \addtocounter{cSTSpell}{8}
              \or % 12
                \addtocounter{cSTParalyze}{11}
                \addtocounter{cSTStaff}{7}
                \addtocounter{cSTPetrify}{9}
                \addtocounter{cSTBreath}{11}
                \addtocounter{cSTSpell}{8}
              \or % 13
                \addtocounter{cSTParalyze}{11}
                \addtocounter{cSTStaff}{7}
                \addtocounter{cSTPetrify}{9}
                \addtocounter{cSTBreath}{11}
                \addtocounter{cSTSpell}{8}
              \or % 14
                \addtocounter{cSTParalyze}{11}
                \addtocounter{cSTStaff}{7}
                \addtocounter{cSTPetrify}{9}
                \addtocounter{cSTBreath}{11}
                \addtocounter{cSTSpell}{8}
              \or % 15
                \addtocounter{cSTParalyze}{11}
                \addtocounter{cSTStaff}{7}
                \addtocounter{cSTPetrify}{9}
                \addtocounter{cSTBreath}{11}
                \addtocounter{cSTSpell}{8}
              \or % 16
                \addtocounter{cSTParalyze}{10}
                \addtocounter{cSTStaff}{5}
                \addtocounter{cSTPetrify}{7}
                \addtocounter{cSTBreath}{9}
                \addtocounter{cSTSpell}{6}
              \or % 17
                \addtocounter{cSTParalyze}{10}
                \addtocounter{cSTStaff}{5}
                \addtocounter{cSTPetrify}{7}
                \addtocounter{cSTBreath}{9}
                \addtocounter{cSTSpell}{6}
              \or % 18
                \addtocounter{cSTParalyze}{10}
                \addtocounter{cSTStaff}{5}
                \addtocounter{cSTPetrify}{7}
                \addtocounter{cSTBreath}{9}
                \addtocounter{cSTSpell}{6}
              \or % 19
                \addtocounter{cSTParalyze}{10}
                \addtocounter{cSTStaff}{5}
                \addtocounter{cSTPetrify}{7}
                \addtocounter{cSTBreath}{9}
                \addtocounter{cSTSpell}{6}
              \or % 20
                \addtocounter{cSTParalyze}{10}
                \addtocounter{cSTStaff}{5}
                \addtocounter{cSTPetrify}{7}
                \addtocounter{cSTBreath}{9}
                \addtocounter{cSTSpell}{6}
              \else
                \addtocounter{cSTParalyze}{8}
                \addtocounter{cSTStaff}{3}
                \addtocounter{cSTPetrify}{5}
                \addtocounter{cSTBreath}{7}
                \addtocounter{cSTSpell}{4}
              \fi
          \else
            \typeout{Cannot set saving throw, no class given, please add saving throws by hand}
          \fi
        \fi
      \fi
    \fi
  \else
    \typeout{Cannot handle multi class character, please add saving throws by hand}
  \fi
}

% sex
\newcommand{\Isex}{\put(0,-10){\line(1,0){125}}}
\newcommand{\sex}[1]
{
  \def\arg{#1}
  \def\comp{M}
  \ifx\arg\comp
     \typeout{Sex '#1' recognized}
  \else
     \def\comp{F}
     \ifx\arg\comp
       \typeout{Sex '#1' recognized}
     \else
       \typeout{Sex not recognized}
     \fi
  \fi
  \renewcommand{\Isex}{#1}
}

% weight
\newcommand{\Iweight}{\put(0,-10){\line(1,0){390}\ lb.}}
\newcommand{\weight}[1]{\renewcommand{\Iweight}{#1 lb.}}

% age
\newcommand{\Iage}{\put(0,-10){\line(1,0){385}\ yrs}}
\newcommand{\age}[1]{\renewcommand{\Iage}{#1 yrs}}

% height
\newcommand{\Iheight}{\put(0,-10){\line(1,0){415}\ in.}}
\newcommand{\height}[1]{\renewcommand{\Iheight}{#1 in.}}

% appereance
\newcommand{\Iappereance}{\put(0,-10){\line(1,0){1720}}}
\newcommand{\appereance}[1]{\renewcommand{\Iappereance}{#1}}

% subrace
\newcommand{\Isubrace}{\put(0,-10){\line(1,0){440}}}
\newcommand{\subrace}[1]{\renewcommand{\Isubrace}{#1}}

% religion
\newcommand{\Ireligion}{\put(0,-10){\line(1,0){440}}}
\newcommand{\religion}[1]{\renewcommand{\Ireligion}{#1}}

% eyes
\newcommand{\Ieyes}{\put(0,-10){\line(1,0){205}}}
\newcommand{\eyes}[1]{\renewcommand{\Ieyes}{#1}}

% hair
\newcommand{\Ihair}{\put(0,-10){\line(1,0){215}}}
\newcommand{\hair}[1]{\renewcommand{\Ihair}{#1}}

% children
\newcommand{\Ichildren}{\put(0,-10){\line(1,0){440}}}
\newcommand{\children}[1]{\renewcommand{\Ichildren}{#1}}

% siblings
\newcommand{\Isiblings}{\put(0,-10){\line(1,0){440}}}
\newcommand{\siblings}[1]{\renewcommand{\Isiblings}{#1}}

% hometown
\newcommand{\Ihometown}{\put(0,-10){\line(1,0){460}}}
\newcommand{\hometown}[1]{\renewcommand{\Ihometown}{#1}}

% background
\newcommand{\Ibackground}{\put(0,-10){\line(1,0){1720}}}
\newcommand{\background}[1]{\renewcommand{\Ibackground}{#1}}

 % the  abilities box

% strength
\newcommand{\STR}[2]
{
  \def\tmp{#2}
  \ifx\tmp\empty
    \setcounter{cExSTR}{-1}
  \else
    \setcounter{cExSTR}{#2}
  \fi

  \setcounter{cSTR}{#1}

  \ifcase\value{cSTR}
    \typeout{WARNING: STR = 0 !}
  \or %1
    \addtocounter{cHitProb}{-5}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{1}
    \addtocounter{cMaxPress}{3}
    \addtocounter{cOpDrs}{1}
    \setcounter{cMvLghLow}{1}
    \setcounter{cMvLghHigh}{1}
    \setcounter{cMvModLow}{1}
    \setcounter{cMvModHigh}{1}
    \setcounter{cMvHvyLow}{1}
    \setcounter{cMvHvyHigh}{1}
    \setcounter{cMvSevLow}{1}
    \setcounter{cMvSevHigh}{1}
  \or %2
    \addtocounter{cHitProb}{-3}
    \addtocounter{cDmgAdj}{-2}
    \addtocounter{cWgtAll}{1}
    \addtocounter{cMaxPress}{5}
    \addtocounter{cOpDrs}{1}
    \setcounter{cMvLghLow}{2}
    \setcounter{cMvLghHigh}{2}
    \setcounter{cMvModLow}{3}
    \setcounter{cMvModHigh}{3}
    \setcounter{cMvHvyLow}{4}
    \setcounter{cMvHvyHigh}{4}
    \setcounter{cMvSevLow}{5}
    \setcounter{cMvSevHigh}{6}
  \or %3
    \addtocounter{cHitProb}{-3}
    \addtocounter{cDmgAdj}{-1}
    \addtocounter{cWgtAll}{5}
    \addtocounter{cMaxPress}{10}
    \addtocounter{cOpDrs}{2}
    \setcounter{cMvLghLow}{6}
    \setcounter{cMvLghHigh}{6}
    \setcounter{cMvModLow}{7}
    \setcounter{cMvModHigh}{7}
    \setcounter{cMvHvyLow}{8}
    \setcounter{cMvHvyHigh}{9}
    \setcounter{cMvSevLow}{10}
    \setcounter{cMvSevHigh}{10}
  \or %4
    \addtocounter{cHitProb}{-2}
    \addtocounter{cDmgAdj}{-1}
    \addtocounter{cWgtAll}{10}
    \addtocounter{cMaxPress}{25}
    \addtocounter{cOpDrs}{3}
    \setcounter{cMvLghLow}{11}
    \setcounter{cMvLghHigh}{13}
    \setcounter{cMvModLow}{14}
    \setcounter{cMvModHigh}{16}
    \setcounter{cMvHvyLow}{17}
    \setcounter{cMvHvyHigh}{19}
    \setcounter{cMvSevLow}{20}
    \setcounter{cMvSevHigh}{25}
  \or %5
    \addtocounter{cHitProb}{-2}
    \addtocounter{cDmgAdj}{-1}
    \addtocounter{cWgtAll}{10}
    \addtocounter{cMaxPress}{25}
    \addtocounter{cOpDrs}{3}
    \setcounter{cMvLghLow}{11}
    \setcounter{cMvLghHigh}{13}
    \setcounter{cMvModLow}{14}
    \setcounter{cMvModHigh}{16}
    \setcounter{cMvHvyLow}{17}
    \setcounter{cMvHvyHigh}{19}
    \setcounter{cMvSevLow}{20}
    \setcounter{cMvSevHigh}{25}
  \or %6
    \addtocounter{cHitProb}{-1}
    \addtocounter{cWgtAll}{20}
    \addtocounter{cMaxPress}{55}
    \addtocounter{cOpDrs}{4}
    \setcounter{cMvLghLow}{21}
    \setcounter{cMvLghHigh}{29}
    \setcounter{cMvModLow}{30}
    \setcounter{cMvModHigh}{38}
    \setcounter{cMvHvyLow}{39}
    \setcounter{cMvHvyHigh}{46}
    \setcounter{cMvSevLow}{47}
    \setcounter{cMvSevHigh}{55}
  \or %7
    \addtocounter{cHitProb}{-1}
    \addtocounter{cWgtAll}{20}
    \addtocounter{cMaxPress}{55}
    \addtocounter{cOpDrs}{4}
    \setcounter{cMvLghLow}{21}
    \setcounter{cMvLghHigh}{29}
    \setcounter{cMvModLow}{30}
    \setcounter{cMvModHigh}{38}
    \setcounter{cMvHvyLow}{39}
    \setcounter{cMvHvyHigh}{46}
    \setcounter{cMvSevLow}{47}
    \setcounter{cMvSevHigh}{55}
  \or %8
    \addtocounter{cWgtAll}{35}
    \addtocounter{cMaxPress}{90}
    \addtocounter{cOpDrs}{5}
    \addtocounter{cBBLG}{1}
    \setcounter{cMvLghLow}{36}
    \setcounter{cMvLghHigh}{50}
    \setcounter{cMvModLow}{51}
    \setcounter{cMvModHigh}{65}
    \setcounter{cMvHvyLow}{66}
    \setcounter{cMvHvyHigh}{80}
    \setcounter{cMvSevLow}{81}
    \setcounter{cMvSevHigh}{90}
  \or %9
    \addtocounter{cWgtAll}{35}
    \addtocounter{cMaxPress}{90}
    \addtocounter{cOpDrs}{5}
    \addtocounter{cBBLG}{1}
    \setcounter{cMvLghLow}{36}
    \setcounter{cMvLghHigh}{50}
    \setcounter{cMvModLow}{51}
    \setcounter{cMvModHigh}{65}
    \setcounter{cMvHvyLow}{66}
    \setcounter{cMvHvyHigh}{80}
    \setcounter{cMvSevLow}{81}
    \setcounter{cMvSevHigh}{90}
  \or %10
    \addtocounter{cWgtAll}{40}
    \addtocounter{cMaxPress}{115}
    \addtocounter{cOpDrs}{6}
    \addtocounter{cBBLG}{2}
    \setcounter{cMvLghLow}{41}
    \setcounter{cMvLghHigh}{58}
    \setcounter{cMvModLow}{59}
    \setcounter{cMvModHigh}{76}
    \setcounter{cMvHvyLow}{77}
    \setcounter{cMvHvyHigh}{96}
    \setcounter{cMvSevLow}{97}
    \setcounter{cMvSevHigh}{110}
  \or %11
    \addtocounter{cWgtAll}{40}
    \addtocounter{cMaxPress}{115}
    \addtocounter{cOpDrs}{6}
    \addtocounter{cBBLG}{2}
    \setcounter{cMvLghLow}{41}
    \setcounter{cMvLghHigh}{58}
    \setcounter{cMvModLow}{59}
    \setcounter{cMvModHigh}{76}
    \setcounter{cMvHvyLow}{77}
    \setcounter{cMvHvyHigh}{96}
    \setcounter{cMvSevLow}{97}
    \setcounter{cMvSevHigh}{110}
  \or %12
    \addtocounter{cWgtAll}{45}
    \addtocounter{cMaxPress}{140}
    \addtocounter{cOpDrs}{7}
    \addtocounter{cBBLG}{4}
    \setcounter{cMvLghLow}{46}
    \setcounter{cMvLghHigh}{69}
    \setcounter{cMvModLow}{70}
    \setcounter{cMvModHigh}{93}
    \setcounter{cMvHvyLow}{94}
    \setcounter{cMvHvyHigh}{117}
    \setcounter{cMvSevLow}{118}
    \setcounter{cMvSevHigh}{140}
  \or %13
    \addtocounter{cWgtAll}{45}
    \addtocounter{cMaxPress}{140}
    \addtocounter{cOpDrs}{7}
    \addtocounter{cBBLG}{4}
    \setcounter{cMvLghLow}{46}
    \setcounter{cMvLghHigh}{69}
    \setcounter{cMvModLow}{70}
    \setcounter{cMvModHigh}{93}
    \setcounter{cMvHvyLow}{94}
    \setcounter{cMvHvyHigh}{117}
    \setcounter{cMvSevLow}{118}
    \setcounter{cMvSevHigh}{140}
  \or %14
    \addtocounter{cWgtAll}{55}
    \addtocounter{cMaxPress}{170}
    \addtocounter{cOpDrs}{8}
    \addtocounter{cBBLG}{7}
    \setcounter{cMvLghLow}{56}
    \setcounter{cMvLghHigh}{85}
    \setcounter{cMvModLow}{86}
    \setcounter{cMvModHigh}{115}
    \setcounter{cMvHvyLow}{116}
    \setcounter{cMvHvyHigh}{145}
    \setcounter{cMvSevLow}{146}
    \setcounter{cMvSevHigh}{170}
  \or %15
    \addtocounter{cWgtAll}{55}
    \addtocounter{cMaxPress}{170}
    \addtocounter{cOpDrs}{8}
    \addtocounter{cBBLG}{7}
    \setcounter{cMvLghLow}{56}
    \setcounter{cMvLghHigh}{85}
    \setcounter{cMvModLow}{86}
    \setcounter{cMvModHigh}{115}
    \setcounter{cMvHvyLow}{116}
    \setcounter{cMvHvyHigh}{145}
    \setcounter{cMvSevLow}{146}
    \setcounter{cMvSevHigh}{170}
  \or %16
    \addtocounter{cDmgAdj}{+1}
    \addtocounter{cWgtAll}{70}
    \addtocounter{cMaxPress}{195}
    \addtocounter{cOpDrs}{9}
    \addtocounter{cBBLG}{10}
    \setcounter{cMvLghLow}{71}
    \setcounter{cMvLghHigh}{100}
    \setcounter{cMvModLow}{101}
    \setcounter{cMvModHigh}{130}
    \setcounter{cMvHvyLow}{131}
    \setcounter{cMvHvyHigh}{160}
    \setcounter{cMvSevLow}{161}
    \setcounter{cMvSevHigh}{195}
  \or %17
    \addtocounter{cHitProb}{+1}
    \addtocounter{cDmgAdj}{+1}
    \addtocounter{cWgtAll}{85}
    \addtocounter{cMaxPress}{220}
    \addtocounter{cOpDrs}{10}
    \addtocounter{cBBLG}{13}
    \setcounter{cMvLghLow}{86}
    \setcounter{cMvLghHigh}{121}
    \setcounter{cMvModLow}{122}
    \setcounter{cMvModHigh}{157}
    \setcounter{cMvHvyLow}{158}
    \setcounter{cMvHvyHigh}{193}
    \setcounter{cMvSevLow}{194}
    \setcounter{cMvSevHigh}{220}
  \or %18
      % simple 18
    \ifnum\value{cExSTR}<0
      \addtocounter{cHitProb}{+1}
      \addtocounter{cDmgAdj}{+2}
      \addtocounter{cWgtAll}{110}
      \addtocounter{cMaxPress}{255}
      \addtocounter{cOpDrs}{11}
      \addtocounter{cBBLG}{16}
      \setcounter{cMvLghLow}{111}
      \setcounter{cMvLghHigh}{149}
      \setcounter{cMvModLow}{150}
      \setcounter{cMvModHigh}{188}
      \setcounter{cMvHvyLow}{189}
      \setcounter{cMvHvyHigh}{227}
      \setcounter{cMvSevLow}{228}
      \setcounter{cMvSevHigh}{255}
      % 18/00
    \else
      \ifnum\value{cExSTR}= 0
        \addtocounter{cHitProb}{+3}
        \addtocounter{cDmgAdj}{+6}
        \addtocounter{cWgtAll}{335}
        \addtocounter{cMaxPress}{480}
        \addtocounter{cOpDrs}{16}
        \addtocounter{cOpMgDrs}{6}
        \addtocounter{cBBLG}{40}
        \setcounter{cMvLghLow}{336}
        \setcounter{cMvLghHigh}{374}
        \setcounter{cMvModLow}{375}
        \setcounter{cMvModHigh}{413}
        \setcounter{cMvHvyLow}{414}
        \setcounter{cMvHvyHigh}{452}
        \setcounter{cMvSevLow}{453}
        \setcounter{cMvSevHigh}{480}
      % 18/01-50
     \else
        \ifnum\value{cExSTR}<51
          \addtocounter{cHitProb}{+1}
          \addtocounter{cDmgAdj}{+3}
          \addtocounter{cWgtAll}{135}
          \addtocounter{cMaxPress}{280}
          \addtocounter{cOpDrs}{12}
          \addtocounter{cBBLG}{20}
          \setcounter{cMvLghLow}{136}
          \setcounter{cMvLghHigh}{174}
          \setcounter{cMvModLow}{175}
          \setcounter{cMvModHigh}{213}
          \setcounter{cMvHvyLow}{214}
          \setcounter{cMvHvyHigh}{252}
          \setcounter{cMvSevLow}{253}
          \setcounter{cMvSevHigh}{280}
      % 18/51-75
        \else
          \ifnum\value{cExSTR}<76
            \addtocounter{cHitProb}{+2}
            \addtocounter{cDmgAdj}{+3}
            \addtocounter{cWgtAll}{160}
            \addtocounter{cMaxPress}{305}
            \addtocounter{cOpDrs}{13}
            \addtocounter{cBBLG}{25}
            \setcounter{cMvLghLow}{161}
            \setcounter{cMvLghHigh}{199}
            \setcounter{cMvModLow}{200}
            \setcounter{cMvModHigh}{238}
            \setcounter{cMvHvyLow}{239}
            \setcounter{cMvHvyHigh}{277}
            \setcounter{cMvSevLow}{278}
            \setcounter{cMvSevHigh}{305}
      % 18/56-90
          \else
            \ifnum\value{cExSTR}<91
              \addtocounter{cHitProb}{+2}
              \addtocounter{cDmgAdj}{+4}
              \addtocounter{cWgtAll}{185}
              \addtocounter{cMaxPress}{330}
              \addtocounter{cOpDrs}{14}
              \addtocounter{cBBLG}{30}
              \setcounter{cMvLghLow}{186}
              \setcounter{cMvLghHigh}{224}
              \setcounter{cMvModLow}{225}
              \setcounter{cMvModHigh}{263}
              \setcounter{cMvHvyLow}{264}
              \setcounter{cMvHvyHigh}{302}
              \setcounter{cMvSevLow}{303}
              \setcounter{cMvSevHigh}{330}
      % 18/91-99
            \else
              \ifnum\value{cExSTR}>90
                \addtocounter{cHitProb}{+2}
                \addtocounter{cDmgAdj}{+5}
                \addtocounter{cWgtAll}{235}
                \addtocounter{cMaxPress}{380}
                \addtocounter{cOpDrs}{15}
                \addtocounter{cOpMgDrs}{3}
                \addtocounter{cBBLG}{35}
                \setcounter{cMvLghLow}{236}
                \setcounter{cMvLghHigh}{274}
                \setcounter{cMvModLow}{275}
                \setcounter{cMvModHigh}{313}
                \setcounter{cMvHvyLow}{314}
                \setcounter{cMvHvyHigh}{352}
                \setcounter{cMvSevLow}{353}
                \setcounter{cMvSevHigh}{380}
              \fi
            \fi
          \fi
        \fi
      \fi
    \fi
  \or %19
    \addtocounter{cHitProb}{+3}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{485}
    \addtocounter{cMaxPress}{640}
    \addtocounter{cOpDrs}{16}
    \addtocounter{cOpMgDrs}{8}
    \addtocounter{cBBLG}{50}
  \or %20
    \addtocounter{cHitProb}{+3}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{535}
    \addtocounter{cMaxPress}{700}
    \addtocounter{cOpDrs}{17}
    \addtocounter{cOpMgDrs}{10}
    \addtocounter{cBBLG}{60}
  \or %21
    \addtocounter{cHitProb}{+4}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{635}
    \addtocounter{cMaxPress}{810}
    \addtocounter{cOpDrs}{17}
    \addtocounter{cOpMgDrs}{12}
    \addtocounter{cBBLG}{70}
  \or %22
    \addtocounter{cHitProb}{+4}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{785}
    \addtocounter{cMaxPress}{970}
    \addtocounter{cOpDrs}{18}
    \addtocounter{cOpMgDrs}{14}
    \addtocounter{cBBLG}{80}
  \or %23
    \addtocounter{cHitProb}{+5}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{935}
    \addtocounter{cMaxPress}{1130}
    \addtocounter{cOpDrs}{18}
    \addtocounter{cOpMgDrs}{16}
    \addtocounter{cBBLG}{90}
  \or %24
    \addtocounter{cHitProb}{+6}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{1235}
    \addtocounter{cMaxPress}{1440}
    \addtocounter{cOpDrs}{19}
    \addtocounter{cOpMgDrs}{17}
    \addtocounter{cBBLG}{95}
  \or %25
    \addtocounter{cHitProb}{+7}
    \addtocounter{cDmgAdj}{-4}
    \addtocounter{cWgtAll}{1535}
    \addtocounter{cMaxPress}{1750}
    \addtocounter{cOpDrs}{19}
    \addtocounter{cOpMgDrs}{18}
    \addtocounter{cBBLG}{99}
  \else
    \typeout{WARNING: STR > 25 ! You have to do adjust the modifiers by hand !}
  \fi
}

% dexterity
\newcommand{\DEX}[1]
{
  \setcounter{cDEX}{#1}

  \ifcase\value{cDEX}
    \typeout{WARNING: DEX = 0 !}
  \or %1
    \addtocounter{cRctnAdj}{-6}
    \addtocounter{cMissAttAdj}{-6}
    \addtocounter{cDefAdj}{+5}
  \or %2
    \addtocounter{cRctnAdj}{-4}
    \addtocounter{cMissAttAdj}{-4}
    \addtocounter{cDefAdj}{+5}
  \or %3
    \addtocounter{cRctnAdj}{-3}
    \addtocounter{cMissAttAdj}{-3}
    \addtocounter{cDefAdj}{+4}
  \or %4
    \addtocounter{cRctnAdj}{-2}
    \addtocounter{cMissAttAdj}{-2}
    \addtocounter{cDefAdj}{+3}
  \or %5
    \addtocounter{cRctnAdj}{-1}
    \addtocounter{cMissAttAdj}{-1}
    \addtocounter{cDefAdj}{+2}
  \or %6
    \addtocounter{cDefAdj}{+1}
  \or %7
  \or %8
  \or %9
  \or %10
  \or %11
  \or %12
  \or %13
  \or %14
  \or %15
    \addtocounter{cDefAdj}{-1}
  \or %16
    \addtocounter{cRctnAdj}{+1}
    \addtocounter{cMissAttAdj}{+1}
    \addtocounter{cDefAdj}{-2}
  \or %17
    \addtocounter{cRctnAdj}{+2}
    \addtocounter{cMissAttAdj}{+2}
    \addtocounter{cDefAdj}{-3}
  \or %18
    \addtocounter{cRctnAdj}{+2}
    \addtocounter{cMissAttAdj}{+2}
    \addtocounter{cDefAdj}{-4}
  \or %19
    \addtocounter{cRctnAdj}{+3}
    \addtocounter{cMissAttAdj}{+3}
    \addtocounter{cDefAdj}{-4}
  \or %20
    \addtocounter{cRctnAdj}{+3}
    \addtocounter{cMissAttAdj}{+3}
    \addtocounter{cDefAdj}{-4}
  \or %21
    \addtocounter{cRctnAdj}{+4}
    \addtocounter{cMissAttAdj}{+4}
    \addtocounter{cDefAdj}{-5}
  \or %22
    \addtocounter{cRctnAdj}{+4}
    \addtocounter{cMissAttAdj}{+4}
    \addtocounter{cDefAdj}{-5}
  \or %23
    \addtocounter{cRctnAdj}{+4}
    \addtocounter{cMissAttAdj}{+4}
    \addtocounter{cDefAdj}{-5}
  \or %24
    \addtocounter{cRctnAdj}{+5}
    \addtocounter{cMissAttAdj}{+5}
    \addtocounter{cDefAdj}{-6}
  \or %25
    \addtocounter{cRctnAdj}{+5}
    \addtocounter{cMissAttAdj}{+5}
    \addtocounter{cDefAdj}{-6}
  \else
    \typeout{WARNING: DEX > 25 ! You have to do adjust the modifiers by hand !}
  \fi
}

% constitution
\newcommand{\CON}[1]
{
  \setcounter{cCON}{#1}

  \ifcase\value{cCON}
    \typeout{WARNING: CON = 0 !}
  \or %1
    \addtocounter{cHPAdj}{-3}
    \addtocounter{cSysShk}{25}
    \addtocounter{cResSur}{30}
    \addtocounter{cPoisSav}{-2}
    \renewcommand{\tReg}{Nil}
  \or %2
    \addtocounter{cHPAdj}{-2}
    \addtocounter{cSysShk}{30}
    \addtocounter{cResSur}{35}
    \addtocounter{cPoisSav}{-1}
    \renewcommand{\tReg}{Nil}
  \or %3
    \addtocounter{cHPAdj}{-2}
    \addtocounter{cSysShk}{35}
    \addtocounter{cResSur}{40}
    \renewcommand{\tReg}{Nil}
  \or %4
    \addtocounter{cHPAdj}{-1}
    \addtocounter{cSysShk}{40}
    \addtocounter{cResSur}{45}
    \renewcommand{\tReg}{Nil}
  \or %5
    \addtocounter{cHPAdj}{-1}
    \addtocounter{cSysShk}{45}
    \addtocounter{cResSur}{50}
    \renewcommand{\tReg}{Nil}
  \or %6
    \addtocounter{cHPAdj}{-1}
    \addtocounter{cSysShk}{50}
    \addtocounter{cResSur}{55}
    \renewcommand{\ntReg}{Nil}
  \or %7
    \addtocounter{cSysShk}{55}
    \addtocounter{cResSur}{60}
    \renewcommand{\tReg}{Nil}
  \or %8
    \addtocounter{cSysShk}{60}
    \addtocounter{cResSur}{65}
    \renewcommand{\tReg}{Nil}
  \or %9
    \addtocounter{cSysShk}{65}
    \addtocounter{cResSur}{70}
    \renewcommand{\tReg}{Nil}
  \or %10
    \addtocounter{cSysShk}{70}
    \addtocounter{cResSur}{75}
    \renewcommand{\tReg}{Nil}
  \or %11
    \addtocounter{cSysShk}{75}
    \addtocounter{cResSur}{80}
    \renewcommand{\tReg}{Nil}
  \or %12
    \addtocounter{cSysShk}{80}
    \addtocounter{cResSur}{85}
    \renewcommand{\tReg}{Nil}
  \or %13
    \addtocounter{cSysShk}{85}
    \addtocounter{cResSur}{90}
    \renewcommand{\tReg}{Nil}
  \or %14
    \addtocounter{cSysShk}{88}
    \addtocounter{cResSur}{92}
    \renewcommand{\tReg}{Nil}
  \or %15
    \addtocounter{cHPAdj}{+1}
    \addtocounter{cSysShk}{90}
    \addtocounter{cResSur}{94}
    \renewcommand{\tReg}{Nil}
  \or %16
    \addtocounter{cHPAdj}{+2}
    \addtocounter{cSysShk}{95}
    \addtocounter{cResSur}{96}
    \renewcommand{\tReg}{Nil}
  \or %17
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+3}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{97}
    \addtocounter{cResSur}{98}
    \renewcommand{\tReg}{Nil}
  \or %18
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+4}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{99}
    \addtocounter{cResSur}{100}
    \renewcommand{\tReg}{Nil}
  \or %19
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+5}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{99}
    \addtocounter{cResSur}{100}
    \addtocounter{cPoisSav}{+1}
    \renewcommand{\tReg}{Nil}
  \or %20
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+5}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{99}
    \addtocounter{cResSur}{100}
    \addtocounter{cPoisSav}{+1}
    \renewcommand{\tReg}{1/6 t}
  \or %21
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+6}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{99}
    \addtocounter{cResSur}{100}
    \addtocounter{cPoisSav}{+2}
    \renewcommand{\tReg}{1/5 t}
  \or %22
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+6}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{99}
    \addtocounter{cResSur}{100}
    \addtocounter{cPoisSav}{+2}
    \renewcommand{\tReg}{1/4 t}
  \or %23
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+6}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{99}
    \addtocounter{cResSur}{100}
    \addtocounter{cPoisSav}{+3}
    \renewcommand{\tReg}{1/3 t}
  \or %24
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+7}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{99}
    \addtocounter{cResSur}{100}
    \addtocounter{cPoisSav}{+3}
    \renewcommand{\tReg}{1/2 t}
  \or %25
    \ifnum\value{cWarFlag}>0
      addtocounter{cHPAdj}{+7}
    \else
      \addtocounter{cHPAdj}{+2}
    \fi
    \addtocounter{cSysShk}{100}
    \addtocounter{cResSur}{100}
    \addtocounter{cPoisSav}{+4}
    \renewcommand{\tReg}{1/1 t}
  \else
    \typeout{WARNING: CON > 25 ! You have to do adjust the modifiers by hand !}
  \fi
  \addtocounter{cSTParalyzeMod}{\value{cPoisSav}}
}

% intelligence
\newcommand{\INT}[1]
{
  \setcounter{cINT}{#1}

  \ifcase\value{cINT}
    \typeout{WARNING: INT = 0 !}
  \or %1
  \or %2
    \addtocounter{cNoLang}{1}
  \or %3
    \addtocounter{cNoLang}{1}
  \or %4
    \addtocounter{cNoLang}{1}
  \or %5
    \addtocounter{cNoLang}{1}
  \or %6
    \addtocounter{cNoLang}{1}
  \or %7
    \addtocounter{cNoLang}{1}
  \or %8
    \addtocounter{cNoLang}{1}
  \or %9
    \addtocounter{cNoLang}{2}
    \addtocounter{cSpellLvl}{4}
    \addtocounter{cLrnSp}{35}
    \addtocounter{cSppLvl}{6}
  \or %10
    \addtocounter{cNoLang}{2}
    \addtocounter{cSpellLvl}{5}
    \addtocounter{cLrnSp}{40}
    \addtocounter{cSppLvl}{7}
  \or %11
    \addtocounter{cNoLang}{2}
    \addtocounter{cSpellLvl}{5}
    \addtocounter{cLrnSp}{45}
    \addtocounter{cSppLvl}{7}
  \or %12
    \addtocounter{cNoLang}{3}
    \addtocounter{cSpellLvl}{6}
    \addtocounter{cLrnSp}{50}
    \addtocounter{cSppLvl}{7}
  \or %13
    \addtocounter{cNoLang}{3}
    \addtocounter{cSpellLvl}{6}
    \addtocounter{cLrnSp}{55}
    \addtocounter{cSppLvl}{9}
  \or %14
    \addtocounter{cNoLang}{4}
    \addtocounter{cSpellLvl}{7}
    \addtocounter{cLrnSp}{60}
    \addtocounter{cSppLvl}{9}
  \or %15
    \addtocounter{cNoLang}{4}
    \addtocounter{cSpellLvl}{7}
    \addtocounter{cLrnSp}{65}
    \addtocounter{cSppLvl}{11}
  \or %16
    \addtocounter{cNoLang}{5}
    \addtocounter{cSpellLvl}{8}
    \addtocounter{cLrnSp}{70}
    \addtocounter{cSppLvl}{11}
  \or %17
    \addtocounter{cNoLang}{6}
    \addtocounter{cSpellLvl}{8}
    \addtocounter{cLrnSp}{75}
    \addtocounter{cSppLvl}{14}
  \or %18
    \addtocounter{cNoLang}{7}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{85}
    \addtocounter{cSppLvl}{18}
  \or %19
    \addtocounter{cNoLang}{8}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{95}
    \addtocounter{cSppLvl}{100}
    \addtocounter{cSpImm}{1}
  \or %20
    \addtocounter{cNoLang}{9}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{96}
    \addtocounter{cSppLvl}{100}
    \addtocounter{cSpImm}{2}
  \or %21
    \addtocounter{cNoLang}{10}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{97}
    \addtocounter{cSppLvl}{100}
    \addtocounter{cSpImm}{3}
  \or %22
    \addtocounter{cNoLang}{11}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{98}
    \addtocounter{cSppLvl}{100}
    \addtocounter{cSpImm}{4}
  \or %23
    \addtocounter{cNoLang}{12}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{99}
    \addtocounter{cSppLvl}{100}
    \addtocounter{cSpImm}{5}
  \or %24
    \addtocounter{cNoLang}{15}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{100}
    \addtocounter{cSppLvl}{100}
    \addtocounter{cSpImm}{6}
  \or %25
    \addtocounter{cNoLang}{20}
    \addtocounter{cSpellLvl}{9}
    \addtocounter{cLrnSp}{100}
    \addtocounter{cSppLvl}{100}
    \addtocounter{cSpImm}{7}
  \else
    \typeout{WARNING: INT > 25 ! You have to do adjust the modifiers by hand !}
  \fi
}

% wisdom
\newcommand{\WIS}[1]
{
  \setcounter{cWIS}{#1}

  \ifcase\value{cWIS}
    \typeout{WARNING: WIS = 0 !}
  \or %1
    \addtocounter{cMgDAdj}{-6}
    \addtocounter{cSpFail}{80}
  \or %2
    \addtocounter{cMgDAdj}{-4}
    \addtocounter{cSpFail}{60}
  \or %3
    \addtocounter{cMgDAdj}{-3}
    \addtocounter{cSpFail}{50}
  \or %4
    \addtocounter{cMgDAdj}{-2}
    \addtocounter{cSpFail}{45}
  \or %5
    \addtocounter{cMgDAdj}{-1}
    \addtocounter{cSpFail}{40}
  \or %6
    \addtocounter{cMgDAdj}{-1}
    \addtocounter{cSpFail}{35}
  \or %7
    \addtocounter{cMgDAdj}{-1}
    \addtocounter{cSpFail}{30}
  \or %8
    \addtocounter{cSpFail}{25}
  \or %9
    \addtocounter{cSpFail}{20}
  \or %10
    \addtocounter{cSpFail}{15}
  \or %11
    \addtocounter{cSpFail}{10}
  \or %12
    \addtocounter{cSpFail}{5}
  \or %13
    \addtocounter{cBonSp}{1}
  \or %14
    \addtocounter{cBonSp}{1}
  \or %15
    \addtocounter{cMgDAdj}{+1}
    \addtocounter{cBonSp}{1}
  \or %16
    \addtocounter{cMgDAdj}{+2}
    \addtocounter{cBonSp}{1}
  \or %17
    \addtocounter{cMgDAdj}{+3}
    \addtocounter{cBonSp}{1}
  \or %18
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
  \or %19
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
    \addtocounter{cSpImmWIS}{1}
  \or %20
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
    \addtocounter{cSpImmWIS}{1}
  \or %21
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
    \addtocounter{cSpImmWIS}{1}
  \or %22
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
    \addtocounter{cSpImmWIS}{1}
  \or %23
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
    \addtocounter{cSpImmWIS}{1}
  \or %24
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
    \addtocounter{cSpImmWIS}{1}
  \or %25
    \addtocounter{cMgDAdj}{+4}
    \addtocounter{cBonSp}{1}
    \addtocounter{cSpImmWIS}{1}
  \else
    \typeout{WARNING: WIS > 25 ! You have to do adjust the modifiers by hand !}
  \fi
}

% charisma
\newcommand{\CHR}[1]
{
  \setcounter{cCHR}{#1}

  \ifcase\value{cCHR}
    \typeout{WARNING: CHR = 0 !}
  \or %1
    \addtocounter{cLoyBase}{-8}
    \addtocounter{cRctnAdjCHR}{-7}
  \or %2
    \addtocounter{cMaxHench}{1}
    \addtocounter{cLoyBase}{-7}
    \addtocounter{cRctnAdjCHR}{-6}
  \or %3
    \addtocounter{cMaxHench}{1}
    \addtocounter{cLoyBase}{-6}
    \addtocounter{cRctnAdjCHR}{-5}
  \or %4
    \addtocounter{cMaxHench}{1}
    \addtocounter{cLoyBase}{-5}
    \addtocounter{cRctnAdjCHR}{-5}
  \or %5
    \addtocounter{cMaxHench}{2}
    \addtocounter{cLoyBase}{-4}
    \addtocounter{cRctnAdjCHR}{-3}
  \or %6
    \addtocounter{cMaxHench}{2}
    \addtocounter{cLoyBase}{-3}
    \addtocounter{cRctnAdjCHR}{-2}
  \or %7
    \addtocounter{cMaxHench}{3}
    \addtocounter{cLoyBase}{-2}
    \addtocounter{cRctnAdjCHR}{-1}
  \or %8
    \addtocounter{cMaxHench}{3}
    \addtocounter{cLoyBase}{-1}
  \or %9
    \addtocounter{cMaxHench}{4}
  \or %10
    \addtocounter{cMaxHench}{4}
  \or %11
    \addtocounter{cMaxHench}{4}
  \or %12
    \addtocounter{cMaxHench}{5}
  \or %13
    \addtocounter{cMaxHench}{5}
    \addtocounter{cRctnAdjCHR}{+1}
  \or %14
    \addtocounter{cMaxHench}{6}
    \addtocounter{cLoyBase}{+1}
    \addtocounter{cRctnAdjCHR}{+2}
  \or %15
    \addtocounter{cMaxHench}{7}
    \addtocounter{cLoyBase}{+3}
    \addtocounter{cRctnAdjCHR}{+3}
  \or %16
    \addtocounter{cMaxHench}{8}
    \addtocounter{cLoyBase}{+4}
    \addtocounter{cRctnAdjCHR}{+5}
  \or %17
    \addtocounter{cMaxHench}{10}
    \addtocounter{cLoyBase}{+6}
    \addtocounter{cRctnAdjCHR}{+6}
  \or %18
    \addtocounter{cMaxHench}{15}
    \addtocounter{cLoyBase}{+8}
    \addtocounter{cRctnAdjCHR}{+7}
  \or %19
    \addtocounter{cMaxHench}{20}
    \addtocounter{cLoyBase}{+10}
    \addtocounter{cRctnAdjCHR}{+8}
  \or %20
    \addtocounter{cMaxHench}{25}
    \addtocounter{cLoyBase}{+12}
    \addtocounter{cRctnAdjCHR}{+9}
  \or %21
    \addtocounter{cMaxHench}{30}
    \addtocounter{cLoyBase}{+14}
    \addtocounter{cRctnAdjCHR}{+10}
  \or %22
    \addtocounter{cMaxHench}{35}
    \addtocounter{cLoyBase}{+16}
    \addtocounter{cRctnAdjCHR}{+1}
  \or %23
    \addtocounter{cMaxHench}{40}
    \addtocounter{cLoyBase}{+18}
    \addtocounter{cRctnAdjCHR}{+2}
  \or %24
    \addtocounter{cMaxHench}{45}
    \addtocounter{cLoyBase}{+20}
    \addtocounter{cRctnAdjCHR}{+13}
  \or %25
    \addtocounter{cMaxHench}{50}
    \addtocounter{cLoyBase}{+20}
    \addtocounter{cRctnAdjCHR}{+14}
  \else
    \typeout{WARNING: CHR > 25 ! You have to do adjust the modifiers by hand !}
  \fi
}


 % AC
 \newcommand{\addarmor}[2]
 {
   \addtocounter{cArmors}{-1}
   \temptok=\expandafter{\Armor}
   \edef\old{\the\temptok}

   \cTmp=\value{cArmors}
   \multiply\cTmp by 50

   \temptok=\expandafter{\old}
   \edef\Armor
   {
     \the\temptok
     \noexpand\put(370,\the\cTmp){\noexpand\makebox(880,50)[l]{#1}}
     \noexpand\put(1270,\the\cTmp){\noexpand\makebox(80,50)[l]{#2 lb.}}
   }
 }

% special abilities

\newcommand{\append}[2]
{
  \def\tmp{#2}
  \edef\old{#1}

  \edef#1{\old\par\tmp}
}

\newcommand{\abil}{}
\newcommand{\abilitiesI}{}
\newcommand{\abilitiesII}{}
\newcommand{\abilitiesIII}{}

\newcommand{\boxheight}[2]
{
  \savebox{\tmpbox}[46mm][t]{\parbox[t]{46mm}{#2}}
  \setlength{#1}{\ht\tmpbox}
  \addtolength{#1}{\dp\tmpbox}
}

\newcommand{\condline}[3]
{
  \ifnum #2 < #3
    \put(#1,#2){\line(1,0){460}}
  \fi
}

\newcommand{\addability}[1]
{
  \renewcommand{\abil}{\abilitiesI}
  \append{\abil}{#1}
  \boxheight{\lAbil}{\abil}

  \ifdim\lAbil<124mm
    \append{\abilitiesI}{#1}
  \else
    \renewcommand{\abil}{\abilitiesII}
    \append{\abil}{#1}
    \boxheight{\lAbil}{\abil}
    \ifdim\lAbil<124mm
      \append{\abilitiesII}{#1}
    \else
      \renewcommand{\abil}{\abilitiesIII}
      \append{\abil}{#1}
      \boxheight{\lAbil}{\abil}
      \ifdim\lAbil<124mm
        \append{\abilitiesIII}{#1}
      \else
        \typeout{WARNING: unable to append more special abilities.}
      \fi
    \fi
  \fi
}


 % proficiencies

\newcommand{\proflang}{{\bf Languages:}}
\newcommand{\profweap}{{\bf Weapon:}}
\newcommand{\profnweap}{{\bf Non-Weapon:}}
\newcommand{\bproflang}{~}
\newcommand{\bprofweap}{~}
\newcommand{\bprofnweap}{~}
\newcommand{\prof}{}
\newcommand{\bprof}{}

\newcommand{\condprof}[3]
{
  \ifnum #2 < #3
    \put(#1,#2){\line(1,0){320}}
    \setcounter{cTemp}{#1}
    \setcounter{cTempII}{#2}
    \addtocounter{cTemp}{330}
    \addtocounter{cTempII}{-10}
    \put(\value{cTemp},\value{cTempII}){\makebox(150,50){\small\bf (\ \ \ - \ \ \ )}}
  \fi
}

\newcommand{\addlang}[1]
{
  \append{\proflang}{$\;$ #1}
  \append{\bproflang}{~}
  \addtocounter{cProfLang}{1}
}

\newcommand{\addweap}[1]
{
  \append{\profweap}{$\;$ #1}
  \append{\bprofweap}{~}
  \addtocounter{cProfWeap}{1}
}

\newcommand{\addnweap}[3]
{
  \append{\profnweap}{$\;$ #1}
  \append{\bprofnweap}{(#2/#3)}
  \addtocounter{cProfNWeap}{1}
}

 % weapons

 \newcommand{\addwadj}[3]
 {
   \ifcase#1
   \or %1
     \addtocounter{cWAttAdjI}{#2}
     \addtocounter{cWDmgAdjI}{#3}
   \or %2
     \addtocounter{cWAttAdjII}{#2}
     \addtocounter{cWDmgAdjII}{#3}
   \or %3
     \addtocounter{cWAttAdjIII}{#2}
     \addtocounter{cWDmgAdjIII}{#3}
   \or %4
     \addtocounter{cWAttAdjIV}{#2}
     \addtocounter{cWDmgAdjIV}{#3}
   \or %5
     \addtocounter{cWAttAdjV}{#2}
     \addtocounter{cWDmgAdjV}{#3}
   \else
     typeout{ERROR IN 'addwadj' !!}
   \fi
 }

 \newcommand{\addwdmg}[3]
 {
   \ifcase#1
   \or %1
     \renewcommand{\WDmgSMI}{#2}
     \renewcommand{\WDmgLI}{#3}
   \or %2
     \renewcommand{\WDmgSMII}{#2}
     \renewcommand{\WDmgLII}{#3}
   \or %3
     \renewcommand{\WDmgSMIII}{#2}
     \renewcommand{\WDmgLIII}{#3}
   \or %4
     \renewcommand{\WDmgSMIV}{#2}
     \renewcommand{\WDmgLIV}{#3}
   \or %5
     \renewcommand{\WDmgSMV}{#2}
     \renewcommand{\WDmgLV}{#3}
   \else
     typeout{ERROR IN 'addwdmg' !!}
   \fi
 }

 \newcommand{\addwrg}[4]
 {
   \ifcase#1
   \or %1
     \addtocounter{cWRgSI}{#2}
     \addtocounter{cWRgMI}{#3}
     \addtocounter{cWRgLI}{#4}
   \or %2
     \addtocounter{cWRgSII}{#2}
     \addtocounter{cWRgMII}{#3}
     \addtocounter{cWRgLII}{#4}
   \or %3
     \addtocounter{cWRgSIII}{#2}
     \addtocounter{cWRgMIII}{#3}
     \addtocounter{cWRgLIII}{#4}
   \or %4
     \addtocounter{cWRgSIV}{#2}
     \addtocounter{cWRgMIV}{#3}
     \addtocounter{cWRgLIV}{#4}
   \or %5
     \addtocounter{cWRgSV}{#2}
     \addtocounter{cWRgMV}{#3}
     \addtocounter{cWRgLV}{#4}
   \else
     typeout{ERROR IN 'addwarg' !!}
   \fi
 }

 \newcommand{\addweapon}[9]
 {
   \addtocounter{cWeapons}{1}
   \ifcase\value{cWeapons}
   \or %1
     \renewcommand{\WeaponI}{#1}
     \renewcommand{\WNrAttI}{#2}
     \addwadj{1}#3
     \addwdmg{1}#4
     \addwrg{1}#5
     \setcounter{cWWgtI}{#6}
     \renewcommand{\WeapTypeI}{#7}
     \renewcommand{\WeapSizeI}{#8}
     \setcounter{cWSpeedI}{#9}
   \or %2
     \renewcommand{\WeaponII}{#1}
     \renewcommand{\WNrAttII}{#2}
     \addwadj{2}#3
     \addwdmg{2}#4
     \addwrg{2}#5
     \setcounter{cWWgtII}{#6}
     \renewcommand{\WeapTypeII}{#7}
     \renewcommand{\WeapSizeII}{#8}
     \setcounter{cWSpeedII}{#9}
   \or %3
     \renewcommand{\WeaponIII}{#1}
     \renewcommand{\WNrAttIII}{#2}
     \addwadj{3}#3
     \addwdmg{3}#4
     \addwrg{3}#5
     \setcounter{cWWgtIII}{#6}
     \renewcommand{\WeapTypeIII}{#7}
     \renewcommand{\WeapSizeIII}{#8}
     \setcounter{cWSpeedIII}{#9}
   \or %4
     \renewcommand{\WeaponIV}{#1}
     \renewcommand{\WNrAttIV}{#2}
     \addwadj{4}#3
     \addwdmg{4}#4
     \addwrg{4}#5
     \setcounter{cWWgtIV}{#6}
     \renewcommand{\WeapTypeIV}{#7}
     \renewcommand{\WeapSizeIV}{#8}
     \setcounter{cWSpeedIV}{#9}
   \or %5
     \renewcommand{\WeaponV}{#1}
     \renewcommand{\WNrAttV}{#2}
     \addwadj{5}#3
     \addwdmg{5}#4
     \addwrg{5}#5
     \setcounter{cWWgtV}{#6}
     \renewcommand{\WeapTypeV}{#7}
     \renewcommand{\WeapSizeV}{#8}
     \setcounter{cWSpeedV}{#9}
   \else
     \typeout{WARNING: Too much weapons, additional weapon deleted !}
   \fi
 }

 % misc
 \newcommand{\addmisc}[1]
 {
   \addtocounter{cMisc}{-1}
   \temptok=\expandafter{\Misc}
   \edef\old{\the\temptok}

   \cTmp=\value{cMisc}
   \multiply\cTmp by 50
   \advance\cTmp by 10

   \temptok=\expandafter{\old}
   \edef\Misc
   {
     \the\temptok
     \noexpand\put(10,\the\cTmp){\noexpand\makebox(900,50)[l]{#1}}
   }
 }

 \newcommand{\condmisc}[1]
 {
   \cTmp=#1
   \advance\cTmp by -10
   \divide\cTmp by 50
   \ifnum\cTmp<\value{cMisc}
     \put(10,#1){\line(1,0){900}}
   \fi
 }

 % items
 \newcommand{\additem}[3]
 {
   \addtocounter{cItems}{-1}
   \if\value{cItems}<1
     \typeout{WARNING: Too much items added, additional items deleted.}
   \else
     \temptok=\expandafter{\Items}
     \edef\old{\the\temptok}

     \cTmp=\value{cItems}
     \ifnum\value{cItems}>7
       \advance\cTmp by -7
       \multiply\cTmp by 50
       \advance\cTmp by -50

       \temptok=\expandafter{\old}
       \edef\Items
       {
         \the\temptok
         \noexpand\put(10,\the\cTmp){\noexpand\makebox(515,50)[l]{#1}}
         \noexpand\put(120,\the\cTmp){\noexpand\makebox(395,50)[l]{#2}}
         \noexpand\put(535,\the\cTmp){\noexpand\makebox(100,50)[r]{#3 lb.}}
       }
     \else
       \multiply\cTmp by 50
       \advance\cTmp by -50

       \temptok=\expandafter{\old}
       \edef\Items
       {
         \the\temptok
         \noexpand\put(645,\the\cTmp){\noexpand\makebox(535,50)[l]{#1}}
         \noexpand\put(765,\the\cTmp){\noexpand\makebox(415,50)[l]{#2}}
         \noexpand\put(1190,\the\cTmp){\noexpand\makebox(100,50)[r]{#3 lb.}}
       }
     \fi
   \fi
 }

 \newcommand{\conditem}[1]
 {
   \cTmp=#1
   \ifnum\cTmp<\value{cItems}
     \ifnum\cTmp>7
       \advance\cTmp by -7
       \multiply\cTmp by 50
       \advance\cTmp by -40
       \put(10,\cTmp){\line(1,0){515}}
       \put(535,\cTmp){\line(1,0){90}}
     \else
       \multiply\cTmp by 50
       \advance\cTmp by -40
       \put(645,\cTmp){\line(1,0){525}}
       \put(1190,\cTmp){\line(1,0){90}}
     \fi
   \fi
 }


 % henchmen
\newcommand{\addhench}[9]
{
  \addtocounter{cHench}{-1}
  \temptok=\expandafter{\Hench}
  \edef\old{\the\temptok}

  \cTmp=\value{cHench}
  \multiply\cTmp by 100
  \advance\cTmp by -40

  \temptok=\expandafter{\old}
  \edef\Hench
  {
    \the\temptok
    \noexpand\put(10,\the\cTmp){\noexpand\makebox(490,40)[l]{#1}}
    \noexpand\put(510,\the\cTmp){\noexpand\makebox(90,40){#2}}
    \noexpand\put(610,\the\cTmp){\noexpand\makebox(190,40){#3}}
    \noexpand\put(810,\the\cTmp){\noexpand\makebox(90,40){#4}}
    \noexpand\put(910,\the\cTmp){\noexpand\makebox(90,40){#5}}
    \noexpand\put(1010,\the\cTmp){\noexpand\makebox(90,40){#6}}
    \noexpand\put(1110,\the\cTmp){\noexpand\makebox(290,40){#7}}
    \noexpand\put(1410,\the\cTmp){\noexpand\makebox(390,40){#8}}
    \noexpand\put(1810,\the\cTmp){\noexpand\makebox(90,40){#9}}
  }
}

\newcommand{\addhenchback}[1]
{
  \addtocounter{cHenchBack}{-1}
  \temptok=\expandafter{\Hench}
  \edef\old{\the\temptok}

  \cTmp=\value{cHench}
  \multiply\cTmp by 100
  \advance\cTmp by -90

  \temptok=\expandafter{\old}
  \edef\Hench
  {
    \the\temptok
    \noexpand\put(180,\the\cTmp){\noexpand\makebox(1740,40)[l]{#1}}
  }
}

\newcommand{\condhench}[1]
{
  \cTmp=#1
  \ifnum\cTmp<\value{cHench}
    \multiply\cTmp by 100
    \advance\cTmp by -40

    \put(10,\cTmp){\line(1,0){490}}
    \put(510,\cTmp){\line(1,0){90}}
    \put(610,\cTmp){\line(1,0){190}}
    \put(810,\cTmp){\line(1,0){90}}
    \put(910,\cTmp){\line(1,0){90}}
    \put(1010,\cTmp){\line(1,0){90}}
    \put(1110,\cTmp){\line(1,0){290}}
    \put(1410,\cTmp){\line(1,0){390}}
    \put(1810,\cTmp){\line(1,0){90}}
  \fi

  \cTmp=#1
  \ifnum\cTmp<\value{cHenchBack}
    \multiply\cTmp by 100
    \advance\cTmp by -90

    \put(180,\cTmp){\line(1,0){1740}}
  \fi
}



% now lets define the environment for the sheet.
\newenvironment{sheet}[1]
{% start of environment
  % initialisations

    % globals
  \renewcommand{\Iname}{#1}
  \typeout{(Treating sheet '#1')}

    % class flags
  \setcounter{cClass}{0}
  \setcounter{cWarFlag}{0}
  \setcounter{cPriestFlag}{0}
  \setcounter{cRogueFlag}{0}
  \setcounter{cWizardFlag}{0}

    % movement rate flags
  \setcounter{cMvBase}{0}
  \setcounter{cMvLghLow}{0}
  \setcounter{cMvLghHigh}{0}
  \setcounter{cMvLghRate}{0}
  \setcounter{cMvModLow}{0}
  \setcounter{cMvModHigh}{0}
  \setcounter{cMvModRate}{0}
  \setcounter{cMvHvyLow}{0}
  \setcounter{cMvHvyHigh}{0}
  \setcounter{cMvHvyRate}{0}
  \setcounter{cMvSevLow}{0}
  \setcounter{cMvSevHigh}{0}
  \setcounter{cMvSevRate}{0}
  \setcounter{cEncumbrance}{0}

    % level counter
  \setcounter{cLevel}{0}

    % abilities
\setcounter{cSTR}{0}
\setcounter{cExSTR}{0}
\setcounter{cDEX}{0}
\setcounter{cCON}{0}
\setcounter{cINT}{0}
\setcounter{cWIS}{0}
\setcounter{cCHR}{0}

    % modifiers
\setcounter{cHitProb}{0}
\setcounter{cDmgAdj}{0}
\setcounter{cWgtAll}{0}
\setcounter{cMaxPress}{0}
\setcounter{cOpDrs}{0}
\setcounter{cOpMgDrs}{0}
\setcounter{cBBLG}{0}
\setcounter{cRctnAdj}{0}
\setcounter{cMissAttAdj}{0}
\setcounter{cDefAdj}{0}
\setcounter{cHPAdj}{0}
\setcounter{cSysShk}{0}
\setcounter{cResSur}{0}
\setcounter{cPoisSav}{0}
\setcounter{cNoLang}{0}
\setcounter{cSpellLvl}{0}
\setcounter{cLrnSp}{0}
\setcounter{cSppLvl}{0}
\setcounter{cSpImm}{0}
\setcounter{cMgDAdj}{0}
\setcounter{cBonSp}{0}
\setcounter{cSpFail}{0}
\setcounter{cSpImmWIS}{0}
\setcounter{cMaxHench}{0}
\setcounter{cLoyBase}{0}
\setcounter{cRctnAdjCHR}{0}
\renewcommand{\tReg}{}

    % saving throws
  \setcounter{cSTBreath}{0}
  \setcounter{cSTBreathMod}{0}
  \setcounter{cSTParalyze}{0}
  \setcounter{cSTParalyzeMod}{0}
  \setcounter{cSTStaff}{0}
  \setcounter{cSTStaffMod}{0}
  \setcounter{cSTSpell}{0}
  \setcounter{cSTSpellMod}{0}
  \setcounter{cSTPetrify}{0}
  \setcounter{cSTPetrifyMod}{0}
  \setcounter{cSTother}{0}
  \setcounter{cSTotherMod}{0}


    % AC
  \setcounter{cAC}{11}
  \setcounter{cSurprised}{11}
  \setcounter{cShieldless}{11}
  \setcounter{cRear}{11}
  \renewcommand{\Armor}{}
  \setcounter{cArmors}{3}


    % HP
  \setcounter{cHP}{0}
  \setcounter{cHPBase}{0}
  \renewcommand{\Wounds}{}

    % abilities
    \setcounter{cAbil}{0}
    \setcounter{cPickPockets}{0}
    \setcounter{cOpenLocks}{0}
    \setcounter{cFRTraps}{0}
    \setcounter{cMoveSil}{0}
    \setcounter{cHide}{0}
    \setcounter{cDetNoise}{0}
    \setcounter{cClimb}{0}
    \setcounter{cRead}{0}
    \setcounter{cBackstab}{0}
    \renewcommand{\PickPockets}{\_\_\_\_\_\_\_}
    \renewcommand{\OpenLocks}{\_\_\_\_\_\_\_}
    \renewcommand{\FRTraps}{\_\_\_\_\_\_\_}
    \renewcommand{\MoveSil}{\_\_\_\_\_\_\_}
    \renewcommand{\Hide}{\_\_\_\_\_\_\_}
    \renewcommand{\DetNoise}{\_\_\_\_\_\_\_}
    \renewcommand{\Climb}{\_\_\_\_\_\_\_}
    \renewcommand{\Read}{\_\_\_\_\_\_\_}
    \renewcommand{\Backstab}{\_\_\_\_\_\_\_}


    % proficiencies
\renewcommand{\proflang}{{\bf Languages:}}
\renewcommand{\profweap}{{\bf Weapon:}}
\renewcommand{\profnweap}{{\bf Non-Weapon:}}
\renewcommand{\bproflang}{~}
\renewcommand{\bprofweap}{~}
\renewcommand{\bprofnweap}{~}
\setcounter{cProfLang}{0}
\setcounter{cProfWeap}{0}
\setcounter{cProfNWeap}{0}


    % weapons
  \renewcommand{\WeaponI}{}
  \renewcommand{\WeaponII}{}
  \renewcommand{\WeaponIII}{}
  \renewcommand{\WeaponIV}{}
  \renewcommand{\WeaponV}{}
  \setcounter{cWeapons}{0}
  \renewcommand{\WNrAttI}{}
  \renewcommand{\WNrAttII}{}
  \renewcommand{\WNrAttIII}{}
  \renewcommand{\WNrAttIV}{}
  \renewcommand{\WNrAttV}{}
  \setcounter{cWAttAdjI}{0}
  \setcounter{cWAttAdjII}{0}
  \setcounter{cWAttAdjIII}{0}
  \setcounter{cWAttAdjIV}{0}
  \setcounter{cWAttAdjV}{0}
  \setcounter{cWDmgAdjI}{0}
  \setcounter{cWDmgAdjII}{0}
  \setcounter{cWDmgAdjIII}{0}
  \setcounter{cWDmgAdjIV}{0}
  \setcounter{cWDmgAdjV}{0}
  \setcounter{cWTHACO}{0}
  \renewcommand{\WDmgSMI}{}
  \renewcommand{\WDmgSMII}{}
  \renewcommand{\WDmgSMIII}{}
  \renewcommand{\WDmgSMIV}{}
  \renewcommand{\WDmgSMV}{}
  \renewcommand{\WDmgLI}{}
  \renewcommand{\WDmgLII}{}
  \renewcommand{\WDmgLIII}{}
  \renewcommand{\WDmgLIV}{}
  \renewcommand{\WDmgLV}{}
  \setcounter{cWRgSI}{0}
  \setcounter{cWRgSII}{0}
  \setcounter{cWRgSIII}{0}
  \setcounter{cWRgSIV}{0}
  \setcounter{cWRgSV}{0}
  \setcounter{cWRgMI}{0}
  \setcounter{cWRgMII}{0}
  \setcounter{cWRgMIII}{0}
  \setcounter{cWRgMIV}{0}
  \setcounter{cWRgMV}{0}
  \setcounter{cWRgLI}{0}
  \setcounter{cWRgLII}{0}
  \setcounter{cWRgLIII}{0}
  \setcounter{cWRgLIV}{0}
  \setcounter{cWRgLV}{0}
  \setcounter{cWWgtI}{0}
  \setcounter{cWWgtII}{0}
  \setcounter{cWWgtIII}{0}
  \setcounter{cWWgtIV}{0}
  \setcounter{cWWgtV}{0}
  \renewcommand{\WeapTypeI}{}
  \renewcommand{\WeapTypeII}{}
  \renewcommand{\WeapTypeIII}{}
  \renewcommand{\WeapTypeIV}{}
  \renewcommand{\WeapTypeV}{}
  \renewcommand{\WeapSizeI}{}
  \renewcommand{\WeapSizeII}{}
  \renewcommand{\WeapSizeIII}{}
  \renewcommand{\WeapSizeIV}{}
  \renewcommand{\WeapSizeV}{}
  \setcounter{cWSpeedI}{0}
  \setcounter{cWSpeedII}{0}
  \setcounter{cWSpeedIII}{0}
  \setcounter{cWSpeedIV}{0}
  \setcounter{cWSpeedV}{0}

    % special attacks
  \renewcommand{\SpecialAttackI}{\line(1,0){800}}
  \renewcommand{\SpecialAttackII}{\line(1,0){800}}
  \renewcommand{\SpecialAttackIII}{\line(1,0){800}}
  \renewcommand{\AmmunitionI}{\line(1,0){435}}
  \renewcommand{\AmmunitionII}{\line(1,0){435}}
  \renewcommand{\AmmunitionIII}{\line(1,0){435}}


    % items
  \renewcommand{\Items}{}
  \setcounter{cItems}{15}


    % xp
  \setcounter{cXP}{0}
  \setcounter{cXPBonus}{0}

    % treasure
  \setcounter{cCP}{0}
  \setcounter{cSP}{0}
  \setcounter{cGP}{0}
  \setcounter{cEP}{0}
  \setcounter{cPP}{0}
  \renewcommand{\Gems}{}
  \renewcommand{\TreasureI}{\line(1,0){1010}}
  \renewcommand{\TreasureII}{\line(1,0){1010}}
  \renewcommand{\TreasureIII}{\line(1,0){1010}}
  \renewcommand{\TreasureIV}{\line(1,0){1010}}


    % misc
  \renewcommand{\Misc}{}
  \setcounter{cMisc}{23}


    % henchmen
  \renewcommand{\Hench}{}
  \setcounter{cHench}{9}
  \setcounter{cHenchBack}{9}

  }%
{% end of environment
  \setlength{\unitlength}{0.1mm}

  \begin{picture}(1920,2750)
    % first we print and draw all the fix texts in the sheet
    \linethickness{2mm}
    \put(0,0){\framebox(1920,2730)[bl]
    {
      % top box with name, race, ...
      \linethickness{1mm}
      \put(0,2380){\framebox(1920,350)[bl]
      {
        \linethickness{0.01mm}
        % character name
        \put(20,310){\makebox(860,50)[bl]{\normalsize\bf Character's Name: \Icharacter}}

        % player name
        \put(1270,310){\makebox(250,50)[br]{\small\bf Player's Name: \Iplayer}}

        % race
        \put(20,245){\makebox(170,50)[bl]{\small\bf Race:}}
        \put(180,245){\makebox(440,50)[bl]{\small\bf\Irace}}

        % class
        \put(640,245){\makebox(170,50)[bl]{\small\bf Class:}}
        \put(810,245){\makebox(440,50)[bl]{\small\bf\Iclass}}

        % alignment
        \put(1270,245){\makebox(70,50)[bl]{\small\bf AL:}}
        \put(1340,245){\makebox(130,50)[bl]{\small\bf\IAL}}

        % level
        \put(1480,245){\makebox(70,50)[bl]{\small\bf Lvl:}}
        \ifnum\value{cLevel}>0
          \put(1560,245){\makebox(130,50)[bl]{\small\bf\arabic{cLevel}}}
        \else
          \put(1560,245){\makebox(130,50)[bl]{\put(0,-10){\line(1,0){130}}}}
        \fi

        % sex
        \put(1700,245){\makebox(70,50)[bl]{\small\bf Sex:}}
        \put(1780,245){\makebox(120,50)[bl]{\small\bf\Isex}}

        % weight
        \put(20,200){\makebox(170,50)[bl]{\small\bf Weight:}}
        \put(180,200){\makebox(440,50)[bl]{\small\bf\Iweight}}

        % age
        \put(640,200){\makebox(170,50)[bl]{\small\bf Age:}}
        \put(810,200){\makebox(440,50)[bl]{\small\bf\Iage}}

        % height
        \put(1270,200){\makebox(170,50)[bl]{\small\bf Height:}}
        \put(1440,200){\makebox(430,50)[bl]{\small\bf\Iheight}}

        % appereance
        \put(20,155){\makebox(1460,50)[bl]{\small\bf App.:}}
        \put(180,155){\makebox(1460,50)[bl]{\small\bf\Iappereance}}

        % subrace
        \put(20,110){\makebox(170,50)[bl]{\small\bf Subrace:}}
        \put(180,110){\makebox(440,50)[bl]{\small\bf\Isubrace}}

        % religion
        \put(640,110){\makebox(170,50)[bl]{\small\bf Religion:}}
        \put(810,110){\makebox(440,50)[bl]{\small\bf\Ireligion}}

        % eyes
        \put(1270,110){\makebox(100,50)[bl]{\small\bf Eyes:}}
        \put(1370,110){\makebox(205,50)[bl]{\small\bf\Ieyes}}

        % hair
        \put(1585,110){\makebox(100,50)[bl]{\small\bf Hair:}}
        \put(1685,110){\makebox(205,50)[bl]{\small\bf\Ihair}}

        % children
        \put(20,65){\makebox(170,50)[bl]{\small\bf Children:}}
        \put(180,65){\makebox(440,50)[bl]{\small\bf\Ichildren}}

        % siblings
        \put(640,65){\makebox(170,50)[bl]{\small\bf Siblings:}}
        \put(810,65){\makebox(440,50)[bl]{\small\bf\Isiblings}}

        % hometown
        \put(1270,65){\makebox(170,50)[bl]{\small\bf Homet.:}}
        \put(1440,65){\makebox(460,50)[bl]{\small\bf\Ihometown}}

        % background
        \put(20,20){\makebox(1460,50)[bl]{\small\bf Backg.:}}
        \put(180,20){\makebox(18800,50)[bl]{\small\bf\Ibackground}}
      }}

      % abilities box
      \linethickness{1mm}
      \put(0,2010){\framebox(1240,360)[bl]
      {
        \linethickness{0.01mm}

        % abilities
        % strength
        \put(0,300){\framebox(250,60)[bl]
        {
          \put(10,0){\makebox(115,60){\large\bf STR:}}
          \put(135,0){\makebox(95,60)[l]
          {
            \ifnum\value{cSTR}=0
              \put(0,-40){\line(1,0){95}}
            \else
              \ifnum\value{cExSTR}>-1
                $\mbox{\Large\bf\arabic{cSTR}}^{\mbox{\scriptsize\bf\arabic{cExSTR}}}$
              \else
                \Large\bf\arabic{cSTR}
              \fi
            \fi
          }}
        }}

        % dexterity
        \put(0,240){\framebox(250,60)[bl]
        {
          \put(10,0){\makebox(115,60){\large\bf DEX:}}
          \put(135,0){\makebox(125,60)[l]
          {
            \ifnum\value{cDEX}=0
              \put(0,-40){\line(1,0){95}}
            \else
              \Large\bf\arabic{cDEX}
            \fi
          }}
        }}

        % constitution
        \put(0,180){\framebox(250,60)[bl]
        {
          \put(10,0){\makebox(115,60){\large\bf CON:}}
          \put(135,0){\makebox(95,60)[l]
          {
            \ifnum\value{cCON}=0
              \put(0,-40){\line(1,0){95}}
            \else
              \Large\bf\arabic{cCON}
            \fi
          }}
        }}

        % intelligence
        \put(0,120){\framebox(250,60)[bl]
        {
          \put(10,0){\makebox(115,60){\large\bf INT:}}
          \put(135,0){\makebox(95,60)[l]
          {
            \ifnum\value{cINT}=0
              \put(0,-40){\line(1,0){95}}
            \else
              \Large\bf\arabic{cINT}
            \fi
          }}
        }}

        % wisdom
        \put(0,60){\framebox(250,60)[bl]
        {
          \put(10,0){\makebox(115,60){\large\bf WIS:}}
          \put(135,0){\makebox(95,60)[l]
          {
            \ifnum\value{cWIS}=0
              \put(0,-40){\line(1,0){95}}
            \else
              \Large\bf\arabic{cWIS}
            \fi
          }}
        }}

        % charisma
        \put(0,0){\framebox(250,60)[bl]
        {
          \put(10,0){\makebox(115,60){\large\bf CHR:}}
          \put(135,0){\makebox(95,60)[l]
          {
            \ifnum\value{cCHR}=0
              \put(0,-40){\line(1,0){95}}
            \else
              \Large\bf\arabic{cCHR}
            \fi
          }}
        }}

        % modifier
        \linethickness{1mm}
        \put(250,0){\line(0,1){360}}
        \linethickness{0.01mm}

        % strength
        \put(250,300){\framebox(990,60)[l]
        {
          \put(10,0){\parbox{6.5mm}{\tiny\bf Hit.\\ Prob.}}
          \put(175,0){\parbox{6.5mm}{\tiny\bf Dmg.\\ Adj..}}
          \put(340,0){\parbox{6.5mm}{\tiny\bf Wgt.\\ All.}}
          \put(505,0){\parbox{6.5mm}{\tiny\bf Max\\ Press}}
          \put(670,0){\parbox{6.5mm}{\tiny\bf Op.\\ Drs.}}
          \put(835,0){\parbox{6.5mm}{\tiny\bf B.B/\\ L.G.}}

        }}
        \put(250,300){\framebox(990,60)[l]
        {
          \ifnum\value{cSTR}>0
            \put(110,0){\makebox(55,60){\scriptsize\bf\arabic{cHitProb}}}
            \put(275,0){\makebox(55,60){\scriptsize\bf\arabic{cDmgAdj}}}
            \put(440,0){\makebox(55,60){\scriptsize\bf\arabic{cWgtAll}}}
            \put(605,0){\makebox(55,60){\scriptsize\bf\arabic{cMaxPress}}}
            \put(770,0){\makebox(55,60)
            {
              \scriptsize\bf\arabic{cOpDrs}
              \ifnum\value{cOpMgDrs}>0
                (\arabic{cOpMgDrs})
              \fi
            }}
            \put(935,0){\makebox(55,60){\scriptsize\bf\arabic{cBBLG}\%}}
          \fi
        }}

        % dexterity
        \put(250,240){\framebox(990,60)[l]
        {
          \put(10,0){\parbox{8mm}{\tiny\bf Rctn.\\ Adj.}}
          \put(340,0){\parbox{10mm}{\tiny\bf Missile\\ Att Adj.}}
          \put(670,0){\parbox{8mm}{\tiny\bf Def.\\ Adj.}}
        }}
        \ifnum\value{cDEX}>0
          \put(250,240){\makebox(990,60)[l]
          {
            \put(110,0){\makebox(55,60){\scriptsize\bf\arabic{cRctnAdj}}}
            \put(440,0){\makebox(55,60){\scriptsize\bf\arabic{cMissAttAdj}}}
            \put(770,0){\makebox(55,60){\scriptsize\bf\arabic{cDefAdj}}}
          }}
        \fi

        % constitution
        \put(250,180){\framebox(990,60)[l]
        {
          \put(10,0){\parbox{6.5mm}{\tiny\bf HP.\\ Adj.}}
          \put(208,0){\parbox{6.5mm}{\tiny\bf Sys.\\ Shk.}}
          \put(406,0){\parbox{6.5mm}{\tiny\bf Res.\\ Sur.}}
          \put(604,0){\parbox{6.5mm}{\tiny\bf Pois.\\ Sav.}}
          \put(802,0){\parbox{6.5mm}{\tiny\bf Reg.}}
        }}

        \ifnum\value{cCON}>0
          \put(250,180){\makebox(990,60)[l]
          {
            \put(110,0){\makebox(55,60)
            {
              \scriptsize\bf\arabic{cHPAdj}
              \ifnum\value{cWarFlag}>0
                $^{*}$
              \fi
            }}
            \put(308,0){\makebox(55,60){\scriptsize\bf\arabic{cSysShk}\%}}
            \put(506,0){\makebox(55,60){\scriptsize\bf\arabic{cResSur}\%}}
            \put(704,0){\makebox(55,60){\scriptsize\bf\arabic{cPoisSav}}}
            \put(902,0){\makebox(55,60){\scriptsize\bf\tReg}}
          }}
        \fi

        % intelligence
        \put(250,120){\framebox(990,60)[l]
        {
          \put(10,0){\parbox{7mm}{\tiny\bf No.of.\\ Lang.}}
          \put(208,0){\parbox{6.5mm}{\tiny\bf Spell\\ Lvl.}}
          \put(406,0){\parbox{6.5mm}{\tiny\bf Lrn.\\ Sp.}}
          \put(604,0){\parbox{6.5mm}{\tiny\bf Sp/\\ Lvl.}}
          \put(802,0){\parbox{6.5mm}{\tiny\bf Sp.\\ Imm.}}
        }}

        \ifnum\value{cINT}>0
          \put(250,120){\makebox(990,60)[l]
          {
            \put(110,0){\makebox(55,60){\scriptsize\bf\arabic{cNoLang}}}
            \put(308,0){\makebox(55,60){\scriptsize\bf\arabic{cSpellLvl}th}}
            \put(506,0){\makebox(55,60){\scriptsize\bf\arabic{cLrnSp}\%}}
            \ifnum\value{cSppLvl}>99
              \put(704,0){\makebox(55,60){\scriptsize\bf All}}
            \else
              \put(704,0){\makebox(55,60){\scriptsize\bf\arabic{cSppLvl}}}
            \fi
            \put(902,0){\makebox(55,60){\scriptsize\bf\arabic{cSpImm}. Ill}}
          }}
        \fi

        % wisdom
        \put(250,60){\framebox(990,60)[l]
        {
          \put(10,0){\parbox{7.5mm}{\tiny\bf Mg.D.\\ Adj.}}
          \put(257.5,0){\parbox{6.5mm}{\tiny\bf Bon.\\ Sp.}}
          \put(505,0){\parbox{6.5mm}{\tiny\bf Sp.\\ Fail.}}
          \put(752.5,0){\parbox{6.5mm}{\tiny\bf Sp.\\ Imm.}}
        }}

        \ifnum\value{cWIS}>0
          \put(250,60){\makebox(990,60)[l]
          {
            \put(110,0){\makebox(55,60){\scriptsize\bf\arabic{cMgDAdj}}}
            \ifnum\value{cBonSp}>0
              \ifnum\value{cPriestFlag}>0
                \put(357.5,0){\makebox(55,60){\scriptsize\bf Yes}}
              \else
                \put(357.5,0){\makebox(55,60){\scriptsize\bf No}}
              \fi
            \else
              \put(357.5,0){\makebox(55,60){\scriptsize\bf No}}
            \fi
            \put(605,0){\makebox(55,60){\scriptsize\bf\arabic{cSpFail}\%}}
            \ifnum\value{cSpImmWIS}>0
              \put(852.5,0){\makebox(55,60){\scriptsize\bf Yes}}
            \else
              \put(852.5,0){\makebox(55,60){\scriptsize\bf No}}
            \fi
          }}
        \fi

        % charisma
        \put(250,0){\framebox(990,60)[l]
        {
          \put(10,0){\parbox{8mm}{\tiny\bf Max.\\ Hench.}}
          \put(340,0){\parbox{8mm}{\tiny\bf Loy.\\ Base}}
          \put(670,0){\parbox{8mm}{\tiny\bf Rctn.\\ Adj.}}
        }}
        \ifnum\value{cCHR}>0
          \put(250,0){\makebox(990,60)[l]
          {
            \put(110,0){\makebox(55,60){\scriptsize\bf\arabic{cMaxHench}}}
            \put(440,0){\makebox(55,60){\scriptsize\bf\arabic{cLoyBase}}}
            \put(770,0){\makebox(55,60){\scriptsize\bf\arabic{cRctnAdjCHR}}}
          }}
        \fi
      }}


      % movement box
      \linethickness{1mm}
      \put(1250,2010){\framebox(260,360)[bl]
      {
        \linethickness{0.01mm}
        \put(20,300){\makebox(230,60){\small\bf Movement}}
        \put(20,250){\makebox(150,50)[l]{\tiny\bf Base:}}
        \put(20,200){\makebox(70,50)[l]{\tiny\bf Lgh:}}
        \put(20,150){\makebox(70,50)[l]{\tiny\bf Mod:}}
        \put(20,100){\makebox(70,50)[l]{\tiny\bf Hvy:}}
        \put(20,50){\makebox(70,50)[l]{\tiny\bf Sev:}}
        \put(20,0){\makebox(150,50)[l]{\tiny\bf Encumbrance:}}

        \ifnum\value{cSTR}<1
          \put(200,250){\makebox(50,50){\tiny\bf\put(0,-20){\line(1,0){50}}}}
          \put(200,200){\makebox(50,50){\tiny\bf\put(0,-20){\line(1,0){50}}}}
          \put(100,200){\makebox(90,50){\tiny\bf (\ \ \ \ - \ \ \ )}}
          \put(200,150){\makebox(50,50){\tiny\bf\put(0,-20){\line(1,0){50}}}}
          \put(100,150){\makebox(90,50){\tiny\bf (\ \ \ \ - \ \ \ )}}
          \put(200,100){\makebox(50,50){\tiny\bf\put(0,-20){\line(1,0){50}}}}
          \put(100,100){\makebox(90,50){\tiny\bf (\ \ \ \ - \ \ \ )}}
          \put(200,50){\makebox(50,50){\tiny\bf\put(0,-20){\line(1,0){50}}}}
          \put(100,50){\makebox(90,50){\tiny\bf (\ \ \ \ - \ \ \ )}}
        \else
          \put(200,250){\makebox(50,50)
          {
            \tiny\bf\arabic{cMvBase}
          }}
          \put(200,200){\makebox(50,50)
          {
            \tiny\bf\arabic{cMvLghRate}
          }}
          \put(100,200){\makebox(90,50)
          {
            \tiny\bf (\arabic{cMvLghLow} - \arabic{cMvLghHigh})
          }}
          \put(200,150){\makebox(50,50)
          {
            \tiny\bf\arabic{cMvModRate}
          }}
          \put(100,150){\makebox(90,50)
          {
            \tiny\bf (\arabic{cMvModLow} - \arabic{cMvModHigh})
          }}
          \put(200,100){\makebox(50,50)
          {
            \tiny\bf\arabic{cMvHvyRate}
          }}
          \put(100,100){\makebox(90,50)
          {
            \tiny\bf (\arabic{cMvHvyLow} - \arabic{cMvHvyHigh})
          }}
          \put(200,50){\makebox(50,50)
          {
            \tiny\bf\arabic{cMvSevRate}
          }}
          \put(100,50){\makebox(90,50)
          {
            \tiny\bf (\arabic{cMvSevLow} - \arabic{cMvSevHigh})
          }}
        \fi
        \ifnum\value{cEncumbrance}>0
          \put(200,0){\makebox(50,50){\tiny\bf\arabic{cEncumbrance}}}
        \else
          \put(200,0){\makebox(50,50){\tiny\bf\put(0,-20){\line(1,0){50}}}}
        \fi
      }}

      % saving throw box
      \linethickness{1mm}
      \put(1520,2010){\framebox(400,360)[bl]
      {
        \linethickness{0.01mm}
        \put(50,0){\makebox(90,40){\tiny\bf Mod.}}
        \put(150,0){\makebox(90,40){\tiny\bf Sav.Throw}}
        \put(250,0){\makebox(90,40){\tiny\bf Base}}

        % modifiers
        \ifnum\value{cSTBreathMod}>0
          \put(50,300){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTBreathMod}}}
        \else
          \put(50,310){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTParalyzeMod}>0
          \put(50,250){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTParalyzeMod}}}
        \else
          \put(50,260){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTStaffMod}>0
          \put(50,200){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTStaffMod}}}
        \else
          \put(50,210){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTSpellMod}>0
          \put(50,150){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTSpellMod}}}
        \else
          \put(50,160){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTPetrifyMod}>0
          \put(50,100){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTPetrifyMod}}}
        \else
          \put(50,110){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTotherMod}>0
          \put(50,50){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTotherMod}}}
        \else
          \put(50,60){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi


        % base
        \ifnum\value{cSTBreath}>0
          \put(260,300){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTBreath}}}
        \else
          \put(260,310){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTParalyze}>0
          \put(260,250){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTParalyze}}}
        \else
          \put(260,260){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTStaff}>0
          \put(260,200){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTStaff}}}
        \else
          \put(260,210){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTSpell}>0
          \put(260,150){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTSpell}}}
        \else
          \put(260,160){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTPetrify}>0
          \put(260,100){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTPetrify}}}
        \else
          \put(260,110){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi

        \ifnum\value{cSTother}>0
          \put(260,50){\makebox(90,50)[b]{\normalsize\bf\arabic{cSTother}}}
        \else
          \put(260,60){\makebox(90,50)[bl]{\tiny\bf\put(0,-20){\line(1,0){90}}}}
        \fi


        % strings
        \put(155,312){\makebox(90,25){\tiny\bf Breath}}
        \put(155,295){\makebox(90,25){\tiny\bf Weapon}}
        \put(155,262){\makebox(90,25){\tiny\bf Paralyze}}
        \put(155,245){\makebox(90,25){\tiny\bf Poison}}
        \put(155,212){\makebox(90,25){\tiny\bf Rod,Staff}}
        \put(155,195){\makebox(90,25){\tiny\bf or Wand}}
        \put(155,140){\makebox(90,50){\tiny\bf Spells}}
        \put(155,112){\makebox(90,25){\tiny\bf Petrify}}
        \put(155,95){\makebox(90,25){\tiny\bf Polym.}}
        \put(155,40){\makebox(90,50){\tiny\bf\tSTother}}
      }}

      % Armor Class
      \linethickness{1mm}
      \put(0,1800){\framebox(1370,200)[bl]
      {
        \linethickness{0.01mm}
        \put(10,10){\framebox(150,180)[bl]
        {
          \put(10,10){\makebox(130,60){\large\bf AC}}
          \put(10,80){\line(1,0){130}}
          \ifnum\value{cAC}<11
            \put(10,100){\makebox(130,70){{\Large\bf\arabic{cAC}}}}
          \fi

          \put(170,150){\makebox(100,50)[l]{\tiny\bf Modifiers}}
          \put(370,150){\makebox(200,50)[l]{\tiny\bf Armor}}
          \put(1270,150){\makebox(100,50)[l]{\tiny\bf Weight\ }}
          \put(170,100){\makebox(100,50)[l]{\tiny\bf Surprised}}
          \put(170,50){\makebox(100,50)[l]{\tiny\bf Shieldless}}
          \put(170,0){\makebox(100,50)[l]{\tiny\bf Rear}}

          \ifnum\value{cSurprised}<11
            \put(300,100){\makebox(50,50){\arabic{cSurprised}}}
          \else
           \put(300,100){\makebox(50,50)[l]{\put(0,-20){\line(1,0){50}}}}
          \fi

          \ifnum\value{cShieldless}<11
            \put(300,50){\makebox(50,50){\arabic{cShieldless}}}
          \else
          \put(300,50){\makebox(50,50)[l]{\put(0,-20){\line(1,0){50}}}}
          \fi

          \ifnum\value{cRear}<11
            \put(300,0){\makebox(50,50){\arabic{cRear}}}
          \else
            \put(300,0){\makebox(50,50)[l]{\put(0,-20){\line(1,0){50}}}}
          \fi

          \Armor
          \ifnum\value{cArmors}>0
            \put(370,0){\makebox(480,50)[l]{\put(0,-20){\line(1,0){880}}}}
            \put(1270,0){\makebox(480,50)[l]{\put(0,-20){\line(1,0){80}}}}
            \ifnum\value{cArmors}>1
              \put(370,50){\makebox(480,50)[l]{\put(0,-20){\line(1,0){880}}}}
              \put(1270,50){\makebox(480,50)[l]{\put(0,-20){\line(1,0){80}}}}
              \ifnum\value{cArmors}>2
                \put(370,100){\makebox(480,50)[l]{\put(0,-20){\line(1,0){880}}}}
                \put(1270,100){\makebox(480,50)[l]{\put(0,-20){\line(1,0){80}}}}
              \fi
            \fi
          \fi
        }}
      }}


      % Hit Points
      \linethickness{1mm}
      \put(1380,1800){\framebox(540,200)[bl]
      {
        \linethickness{0.01mm}
        \put(10,10){\framebox(150,180)[bl]
        {
          \put(10,10){\makebox(130,60){\large\bf HP}}
          \put(10,80){\line(1,0){130}}

          \ifnum\value{cHP}>0
            \put(10,100){\makebox(130,50){{\Large\bf\arabic{cHP}}}}
          \fi

          \ifnum\value{cHPBase}>0
            \put(0,150){\makebox(180,40)[l]{\tiny\bf Base: \arabic{cHPBase}}}
          \else
            \put(0,150){\makebox(180,40)[l]{\tiny\bf Base:}}
          \fi
        }}
        \put(200,10){\makebox(340,180)[bl]
        {
          \put(10,10){\makebox(320,60){\large\bf Wounds}}
          \put(10,80){\line(1,0){320}}

          \put(10,140){\parbox{32mm}{\small\Wounds}}
        }}
      }}

      % weapons
      \linethickness{1mm}
      \put(0,1500){\framebox(1920,290)[bl]
      {
        \linethickness{0.01mm}
        \put(10,250){\makebox(100,40){\tiny\bf Weapon}}
        \put(630,250){\makebox(100,40){\tiny\bf \#Att}}
        \put(730,250){\makebox(100,40){\tiny\bf AttAdj}}
        \put(830,250){\makebox(100,40){\tiny\bf DAdj}}
        \put(930,250){\makebox(100,40){\tiny\bf THAC0}}
        \put(1030,250){\makebox(100,40){\tiny\bf DmgSM}}
        \put(1130,250){\makebox(100,40){\tiny\bf DmgL}}
        \put(1230,250){\makebox(100,40){\tiny\bf Rg S}}
        \put(1330,250){\makebox(100,40){\tiny\bf Rg M}}
        \put(1430,250){\makebox(100,40){\tiny\bf Rg L}}
        \put(1530,250){\makebox(100,40){\tiny\bf Wght}}
        \put(1630,250){\makebox(100,40){\tiny\bf Type}}
        \put(1730,250){\makebox(100,40){\tiny\bf Size}}
        \put(1830,250){\makebox(100,40){\tiny\bf Speed}}

        \put(0,250){\line(1,0){1920}}
        \put(0,200){\line(1,0){1920}}
        \put(0,150){\line(1,0){1920}}
        \put(0,100){\line(1,0){1920}}
        \put(0,50){\line(1,0){1920}}
        \put(0,0){\line(1,0){1920}}

        \put(630,0){\line(0,1){290}}
        \put(730,0){\line(0,1){290}}
        \put(830,0){\line(0,1){290}}
        \put(930,0){\line(0,1){290}}
        \put(1030,0){\line(0,1){290}}
        \put(1130,0){\line(0,1){290}}
        \put(1230,0){\line(0,1){290}}
        \put(1330,0){\line(0,1){290}}
        \put(1430,0){\line(0,1){290}}
        \put(1530,0){\line(0,1){290}}
        \put(1630,0){\line(0,1){290}}
        \put(1730,0){\line(0,1){290}}
        \put(1830,0){\line(0,1){290}}


        \ifnum\value{cWeapons}>0
          \put(10,200){\makebox(610,50)[l]{\WeaponI}}
          \put(640,200){\makebox(80,50){\WNrAttI}}
          \ifnum\value{cWAttAdjI}>0
            \put(740,200){\makebox(80,50){\arabic{cWAttAdjI}}}
          \fi
          \ifnum\value{cWDmgAdjI}>0
            \put(840,200){\makebox(80,50){\arabic{cWDmgAdjI}}}
          \fi
          \ifnum\value{cWTHACO}>0
            \put(940,200){\makebox(80,50){\arabic{cWTHACO}}}
          \fi
          \put(1040,200){\makebox(80,50){\WDmgSMI}}
          \put(1140,200){\makebox(80,50){\WDmgLI}}
          \ifnum\value{cWRgSI}>0
            \put(1240,200){\makebox(80,50){\arabic{cWRgSI}}}
          \fi
          \ifnum\value{cWRgMI}>0
            \put(1340,200){\makebox(80,50){\arabic{cWRgMI}}}
          \fi
          \ifnum\value{cWRgLI}>0
            \put(1440,200){\makebox(80,50){\arabic{cWRgLI}}}
          \fi
          \ifnum\value{cWWgtI}>0
            \put(1540,200){\makebox(80,50){\arabic{cWWgtI} lb.}}
          \fi
          \put(1640,200){\makebox(80,50){\WeapTypeI}}
          \put(1740,200){\makebox(80,50){\WeapSizeI}}
          \ifnum\value{cWSpeedI}>0
            \put(1840,200){\makebox(80,50){\arabic{cWSpeedI}}}
          \fi
          \ifnum\value{cWeapons}>1
            \put(10,150){\makebox(610,50)[l]{\WeaponII}}
            \put(640,150){\makebox(80,50){\WNrAttII}}
            \ifnum\value{cWAttAdjII}>0
              \put(740,150){\makebox(80,50){\arabic{cWAttAdjII}}}
            \fi
            \ifnum\value{cWDmgAdjII}>0
              \put(840,150){\makebox(80,50){\arabic{cWDmgAdjII}}}
            \fi
            \ifnum\value{cWTHACO}>0
              \put(940,150){\makebox(80,50){\arabic{cWTHACO}}}
            \fi
            \put(1040,150){\makebox(80,50){\WDmgSMII}}
            \put(1140,150){\makebox(80,50){\WDmgLII}}
            \ifnum\value{cWRgSII}>0
              \put(1240,150){\makebox(80,50){\arabic{cWRgSII}}}
            \fi
            \ifnum\value{cWRgMII}>0
              \put(1340,150){\makebox(80,50){\arabic{cWRgMII}}}
            \fi
            \ifnum\value{cWRgLII}>0
              \put(1440,150){\makebox(80,50){\arabic{cWRgLII}}}
            \fi
            \ifnum\value{cWWgtII}>0
              \put(1540,150){\makebox(80,50){\arabic{cWWgtII} lb.}}
            \fi
            \put(1640,150){\makebox(80,50){\WeapTypeII}}
            \put(1740,150){\makebox(80,50){\WeapSizeII}}
            \ifnum\value{cWSpeedII}>0
              \put(1840,150){\makebox(80,50){\arabic{cWSpeedII}}}
            \fi
            \ifnum\value{cWeapons}>2
              \put(10,100){\makebox(610,50)[l]{\WeaponIII}}
              \put(640,100){\makebox(80,50){\WNrAttIII}}
              \ifnum\value{cWAttAdjIII}>0
                \put(740,100){\makebox(80,50){\arabic{cWAttAdjIII}}}
              \fi
              \ifnum\value{cWDmgAdjIII}>0
                \put(840,100){\makebox(80,50){\arabic{cWDmgAdjIII}}}
              \fi
              \ifnum\value{cWTHACO}>0
                \put(940,100){\makebox(80,50){\arabic{cWTHACO}}}
              \fi
              \put(1040,100){\makebox(80,50){\WDmgSMIII}}
              \put(1140,100){\makebox(80,50){\WDmgLIII}}
              \ifnum\value{cWRgSIII}>0
                \put(1240,100){\makebox(80,50){\arabic{cWRgSIII}}}
              \fi
              \ifnum\value{cWRgMIII}>0
                \put(1340,100){\makebox(80,50){\arabic{cWRgMIII}}}
              \fi
              \ifnum\value{cWRgLIII}>0
                \put(1440,100){\makebox(80,50){\arabic{cWRgLIII}}}
              \fi
              \ifnum\value{cWWgtIII}>0
                \put(1540,100){\makebox(80,50){\arabic{cWWgtIII} lb.}}
              \fi
              \put(1640,100){\makebox(80,50){\WeapTypeIII}}
              \put(1740,100){\makebox(80,50){\WeapSizeIII}}
              \ifnum\value{cWSpeedIII}>0
                \put(1840,100){\makebox(80,50){\arabic{cWSpeedIII}}}
              \fi
              \ifnum\value{cWeapons}>3
                \put(10,50){\makebox(610,50)[l]{\WeaponIV}}
                \put(640,50){\makebox(80,50){\WNrAttIV}}
                \ifnum\value{cWAttAdjIV}>0
                  \put(740,50){\makebox(80,50){\arabic{cWAttAdjIV}}}
                \fi
                \ifnum\value{cWDmgAdjIV}>0
                  \put(840,50){\makebox(80,50){\arabic{cWDmgAdjIV}}}
                \fi
                \ifnum\value{cWTHACO}>0
                  \put(940,50){\makebox(80,50){\arabic{cWTHACO}}}
                \fi
                \put(1040,50){\makebox(80,50){\WDmgSMIV}}
                \put(1140,50){\makebox(80,50){\WDmgLIV}}
                \ifnum\value{cWRgSIV}>0
                  \put(1240,50){\makebox(80,50){\arabic{cWRgSIV}}}
                \fi
                \ifnum\value{cWRgMIV}>0
                  \put(1340,50){\makebox(80,50){\arabic{cWRgMIV}}}
                \fi
                \ifnum\value{cWRgLIV}>0
                  \put(1440,50){\makebox(80,50){\arabic{cWRgLIV}}}
                \fi
                \ifnum\value{cWWgtIV}>0
                  \put(1540,50){\makebox(80,50){\arabic{cWWgtIV} lb.}}
                \fi
                \put(1640,50){\makebox(80,50){\WeapTypeIV}}
                \put(1740,50){\makebox(80,50){\WeapSizeIV}}
                \ifnum\value{cWSpeedIV}>0
                  \put(1840,50){\makebox(80,50){\arabic{cWSpeedIV}}}
                \fi
                \ifnum\value{cWeapons}>4
                  \put(10,0){\makebox(610,50)[l]{\WeaponV}}
                  \put(640,0){\makebox(80,50){\WNrAttV}}
                  \ifnum\value{cWAttAdjV}>0
                    \put(740,0){\makebox(80,50){\arabic{cWAttAdjV}}}
                  \fi
                  \ifnum\value{cWDmgAdjV}>0
                    \put(840,0){\makebox(80,50){\arabic{cWDmgAdjV}}}
                  \fi
                  \ifnum\value{cWTHACO}>0
                    \put(940,0){\makebox(80,50){\arabic{cWTHACO}}}
                  \fi
                  \put(1040,0){\makebox(80,50){\WDmgSMV}}
                  \put(1140,0){\makebox(80,50){\WDmgLV}}
                  \ifnum\value{cWRgSV}>0
                    \put(1240,0){\makebox(80,50){\arabic{cWRgSV}}}
                  \fi
                  \ifnum\value{cWRgMV}>0
                    \put(1340,0){\makebox(80,50){\arabic{cWRgMV}}}
                  \fi
                  \ifnum\value{cWRgLV}>0
                    \put(1440,0){\makebox(80,50){\arabic{cWRgLV}}}
                  \fi
                  \ifnum\value{cWWgtV}>0
                    \put(1540,0){\makebox(80,50){\arabic{cWWgtV} lb.}}
                  \fi
                  \put(1640,0){\makebox(80,50){\WeapTypeV}}
                  \put(1740,0){\makebox(80,50){\WeapSizeV}}
                  \ifnum\value{cWSpeedV}>0
                    \put(1840,0){\makebox(80,50){\arabic{cWSpeedV}}}
                  \fi
                \fi
              \fi
            \fi
          \fi
        \fi

      }}

      % special attacks, ammunition
      \linethickness{1mm}
      \put(0,1300){\framebox(1920,190)[bl]
      {
        \linethickness{0.01mm}
        \put(10,150){\makebox(100,40)[l]{\tiny\bf Special Attacks}}
        \put(10,110){\SpecialAttackI}
        \put(10,60){\SpecialAttackII}
        \put(10,10){\SpecialAttackIII}
        \put(820,150){\makebox(100,40)[l]{\tiny\bf Ammunition}}
        \put(820,110){\AmmunitionI}
        \put(820,60){\AmmunitionII}
        \put(820,10){\AmmunitionIII}

        \put(1265,110){\framebox(20,20){}}
        \put(1265,135){\framebox(20,20){}}
        \put(1265,60){\framebox(20,20){}}
        \put(1265,85){\framebox(20,20){}}
        \put(1265,10){\framebox(20,20){}}
        \put(1265,35){\framebox(20,20){}}

        \put(1290,110){\framebox(20,20){}}
        \put(1290,135){\framebox(20,20){}}
        \put(1290,60){\framebox(20,20){}}
        \put(1290,85){\framebox(20,20){}}
        \put(1290,10){\framebox(20,20){}}
        \put(1290,35){\framebox(20,20){}}

        \put(1315,110){\framebox(20,20){}}
        \put(1315,135){\framebox(20,20){}}
        \put(1315,60){\framebox(20,20){}}
        \put(1315,85){\framebox(20,20){}}
        \put(1315,10){\framebox(20,20){}}
        \put(1315,35){\framebox(20,20){}}

        \put(1340,110){\framebox(20,20){}}
        \put(1340,135){\framebox(20,20){}}
        \put(1340,60){\framebox(20,20){}}
        \put(1340,85){\framebox(20,20){}}
        \put(1340,10){\framebox(20,20){}}
        \put(1340,35){\framebox(20,20){}}

        \put(1365,110){\framebox(20,20){}}
        \put(1365,135){\framebox(20,20){}}
        \put(1365,60){\framebox(20,20){}}
        \put(1365,85){\framebox(20,20){}}
        \put(1365,10){\framebox(20,20){}}
        \put(1365,35){\framebox(20,20){}}


        \put(1395,110){\framebox(20,20){}}
        \put(1395,135){\framebox(20,20){}}
        \put(1395,60){\framebox(20,20){}}
        \put(1395,85){\framebox(20,20){}}
        \put(1395,10){\framebox(20,20){}}
        \put(1395,35){\framebox(20,20){}}

        \put(1420,110){\framebox(20,20){}}
        \put(1420,135){\framebox(20,20){}}
        \put(1420,60){\framebox(20,20){}}
        \put(1420,85){\framebox(20,20){}}
        \put(1420,10){\framebox(20,20){}}
        \put(1420,35){\framebox(20,20){}}

        \put(1445,110){\framebox(20,20){}}
        \put(1445,135){\framebox(20,20){}}
        \put(1445,60){\framebox(20,20){}}
        \put(1445,85){\framebox(20,20){}}
        \put(1445,10){\framebox(20,20){}}
        \put(1445,35){\framebox(20,20){}}

        \put(1470,110){\framebox(20,20){}}
        \put(1470,135){\framebox(20,20){}}
        \put(1470,60){\framebox(20,20){}}
        \put(1470,85){\framebox(20,20){}}
        \put(1470,10){\framebox(20,20){}}
        \put(1470,35){\framebox(20,20){}}

        \put(1495,110){\framebox(20,20){}}
        \put(1495,135){\framebox(20,20){}}
        \put(1495,60){\framebox(20,20){}}
        \put(1495,85){\framebox(20,20){}}
        \put(1495,10){\framebox(20,20){}}
        \put(1495,35){\framebox(20,20){}}


        \put(1525,110){\framebox(20,20){}}
        \put(1525,135){\framebox(20,20){}}
        \put(1525,60){\framebox(20,20){}}
        \put(1525,85){\framebox(20,20){}}
        \put(1525,10){\framebox(20,20){}}
        \put(1525,35){\framebox(20,20){}}

        \put(1550,110){\framebox(20,20){}}
        \put(1550,135){\framebox(20,20){}}
        \put(1550,60){\framebox(20,20){}}
        \put(1550,85){\framebox(20,20){}}
        \put(1550,10){\framebox(20,20){}}
        \put(1550,35){\framebox(20,20){}}

        \put(1575,110){\framebox(20,20){}}
        \put(1575,135){\framebox(20,20){}}
        \put(1575,60){\framebox(20,20){}}
        \put(1575,85){\framebox(20,20){}}
        \put(1575,10){\framebox(20,20){}}
        \put(1575,35){\framebox(20,20){}}

        \put(1600,110){\framebox(20,20){}}
        \put(1600,135){\framebox(20,20){}}
        \put(1600,60){\framebox(20,20){}}
        \put(1600,85){\framebox(20,20){}}
        \put(1600,10){\framebox(20,20){}}
        \put(1600,35){\framebox(20,20){}}

        \put(1625,110){\framebox(20,20){}}
        \put(1625,135){\framebox(20,20){}}
        \put(1625,60){\framebox(20,20){}}
        \put(1625,85){\framebox(20,20){}}
        \put(1625,10){\framebox(20,20){}}
        \put(1625,35){\framebox(20,20){}}


        \put(1655,110){\framebox(20,20){}}
        \put(1655,135){\framebox(20,20){}}
        \put(1655,60){\framebox(20,20){}}
        \put(1655,85){\framebox(20,20){}}
        \put(1655,10){\framebox(20,20){}}
        \put(1655,35){\framebox(20,20){}}

        \put(1680,110){\framebox(20,20){}}
        \put(1680,135){\framebox(20,20){}}
        \put(1680,60){\framebox(20,20){}}
        \put(1680,85){\framebox(20,20){}}
        \put(1680,10){\framebox(20,20){}}
        \put(1680,35){\framebox(20,20){}}

        \put(1705,110){\framebox(20,20){}}
        \put(1705,135){\framebox(20,20){}}
        \put(1705,60){\framebox(20,20){}}
        \put(1705,85){\framebox(20,20){}}
        \put(1705,10){\framebox(20,20){}}
        \put(1705,35){\framebox(20,20){}}

        \put(1730,110){\framebox(20,20){}}
        \put(1730,135){\framebox(20,20){}}
        \put(1730,60){\framebox(20,20){}}
        \put(1730,85){\framebox(20,20){}}
        \put(1730,10){\framebox(20,20){}}
        \put(1730,35){\framebox(20,20){}}

        \put(1755,110){\framebox(20,20){}}
        \put(1755,135){\framebox(20,20){}}
        \put(1755,60){\framebox(20,20){}}
        \put(1755,85){\framebox(20,20){}}
        \put(1755,10){\framebox(20,20){}}
        \put(1755,35){\framebox(20,20){}}


        \put(1785,110){\framebox(20,20){}}
        \put(1785,135){\framebox(20,20){}}
        \put(1785,60){\framebox(20,20){}}
        \put(1785,85){\framebox(20,20){}}
        \put(1785,10){\framebox(20,20){}}
        \put(1785,35){\framebox(20,20){}}

        \put(1810,110){\framebox(20,20){}}
        \put(1810,135){\framebox(20,20){}}
        \put(1810,60){\framebox(20,20){}}
        \put(1810,85){\framebox(20,20){}}
        \put(1810,10){\framebox(20,20){}}
        \put(1810,35){\framebox(20,20){}}

        \put(1835,110){\framebox(20,20){}}
        \put(1835,135){\framebox(20,20){}}
        \put(1835,60){\framebox(20,20){}}
        \put(1835,85){\framebox(20,20){}}
        \put(1835,10){\framebox(20,20){}}
        \put(1835,35){\framebox(20,20){}}

        \put(1860,110){\framebox(20,20){}}
        \put(1860,135){\framebox(20,20){}}
        \put(1860,60){\framebox(20,20){}}
        \put(1860,85){\framebox(20,20){}}
        \put(1860,10){\framebox(20,20){}}
        \put(1860,35){\framebox(20,20){}}

        \put(1885,110){\framebox(20,20){}}
        \put(1885,135){\framebox(20,20){}}
        \put(1885,60){\framebox(20,20){}}
        \put(1885,85){\framebox(20,20){}}
        \put(1885,10){\framebox(20,20){}}
        \put(1885,35){\framebox(20,20){}}
      }}

      % special abilities
      \linethickness{1mm}
      \put(0,-10){\framebox(1420,1300)[bl]
      {
        \linethickness{0.01mm}
        \put(10,1260){\makebox(1420,40){\tiny\bf Abilities}}

        \boxheight{\lAbil}{\abilitiesI}
        \cAbil=-\lAbil
        \divide\cAbil by 18647
        \advance\cAbil by 1240
        \put(10,1220){\parbox[t]{46mm}{\small\abilitiesI}}
        \advance\cAbil by -29

        % lines left row
        \condline{10}{10}{\cAbil}
        \condline{10}{60}{\cAbil}
        \condline{10}{110}{\cAbil}
        \condline{10}{160}{\cAbil}
        \condline{10}{210}{\cAbil}
        \condline{10}{260}{\cAbil}
        \condline{10}{310}{\cAbil}
        \condline{10}{360}{\cAbil}
        \condline{10}{410}{\cAbil}
        \condline{10}{460}{\cAbil}
        \condline{10}{510}{\cAbil}
        \condline{10}{560}{\cAbil}
        \condline{10}{610}{\cAbil}
        \condline{10}{660}{\cAbil}
        \condline{10}{710}{\cAbil}
        \condline{10}{760}{\cAbil}
        \condline{10}{810}{\cAbil}
        \condline{10}{860}{\cAbil}
        \condline{10}{910}{\cAbil}
        \condline{10}{960}{\cAbil}
        \condline{10}{1010}{\cAbil}
        \condline{10}{1060}{\cAbil}
        \condline{10}{1110}{\cAbil}
        \condline{10}{1160}{\cAbil}
        \condline{10}{1210}{\cAbil}

        \boxheight{\lAbil}{\abilitiesII}
        \cAbil=-\lAbil
        \divide\cAbil by 18647
        \advance\cAbil by 1240
        \put(480,1220){\parbox[t]{46mm}{\small\abilitiesII}}
        \advance\cAbil by -29

        % lines middle row
        \condline{480}{10}{\cAbil}
        \condline{480}{60}{\cAbil}
        \condline{480}{110}{\cAbil}
        \condline{480}{160}{\cAbil}
        \condline{480}{210}{\cAbil}
        \condline{480}{260}{\cAbil}
        \condline{480}{310}{\cAbil}
        \condline{480}{360}{\cAbil}
        \condline{480}{410}{\cAbil}
        \condline{480}{460}{\cAbil}
        \condline{480}{510}{\cAbil}
        \condline{480}{560}{\cAbil}
        \condline{480}{610}{\cAbil}
        \condline{480}{660}{\cAbil}
        \condline{480}{710}{\cAbil}
        \condline{480}{760}{\cAbil}
        \condline{480}{810}{\cAbil}
        \condline{480}{860}{\cAbil}
        \condline{480}{910}{\cAbil}
        \condline{480}{960}{\cAbil}
        \condline{480}{1010}{\cAbil}
        \condline{480}{1060}{\cAbil}
        \condline{480}{1110}{\cAbil}
        \condline{480}{1160}{\cAbil}
        \condline{480}{1210}{\cAbil}

        \boxheight{\lAbil}{\abilitiesIII}
        \cAbil=-\lAbil
        \divide\cAbil by 18647
        \advance\cAbil by 1240
        \put(950,1220){\parbox[t]{46mm}{\small\abilitiesIII}}
        \advance\cAbil by -29

        % lines left row
        \condline{950}{10}{\cAbil}
        \condline{950}{60}{\cAbil}
        \condline{950}{110}{\cAbil}
        \condline{950}{160}{\cAbil}
        \condline{950}{210}{\cAbil}
        \condline{950}{260}{\cAbil}
        \condline{950}{310}{\cAbil}
        \condline{950}{360}{\cAbil}
        \condline{950}{410}{\cAbil}
        \condline{950}{460}{\cAbil}
        \condline{950}{510}{\cAbil}
        \condline{950}{560}{\cAbil}
        \condline{950}{610}{\cAbil}
        \condline{950}{660}{\cAbil}
        \condline{950}{710}{\cAbil}
        \condline{950}{760}{\cAbil}
        \condline{950}{810}{\cAbil}
        \condline{950}{860}{\cAbil}
        \condline{950}{910}{\cAbil}
        \condline{950}{960}{\cAbil}
        \condline{950}{1010}{\cAbil}
        \condline{950}{1060}{\cAbil}
        \condline{950}{1110}{\cAbil}
        \condline{950}{1160}{\cAbil}
        \condline{950}{1210}{\cAbil}


      }}

      % proficiencies
      \linethickness{1mm}
      \put(1430,-10){\framebox(490,1300)[bl]
      {
        \linethickness{0.01mm}
        \put(10,1260){\makebox(470,40){\tiny\bf Proficiencies}}

        \renewcommand{\prof}{}
        \renewcommand{\bprof}{}

        \ifnum\value{cProfLang}>0
          \append{\prof}{\proflang}
          \append{\bprof}{\bproflang}
        \fi
        \ifnum\value{cProfWeap}>0
          \append{\prof}{\profweap}
          \append{\bprof}{\bprofweap}
        \fi
        \ifnum\value{cProfNWeap}>0
          \append{\prof}{\profnweap}
          \append{\bprof}{\bprofnweap}
        \fi

        \boxheight{\lAbil}{\prof}
        \cAbil=-\lAbil
        \divide\cAbil by 18647
        \advance\cAbil by 1240
        \put(10,1220){\parbox[t]{32mm}{\small\prof}}
        \put(360,1220){\parbox[t]{15mm}{\small\bprof}}
        \advance\cAbil by -29

        \condprof{10}{10}{\cAbil}
        \condprof{10}{60}{\cAbil}
        \condprof{10}{110}{\cAbil}
        \condprof{10}{160}{\cAbil}
        \condprof{10}{210}{\cAbil}
        \condprof{10}{260}{\cAbil}
        \condprof{10}{310}{\cAbil}
        \condprof{10}{360}{\cAbil}
        \condprof{10}{410}{\cAbil}
        \condprof{10}{460}{\cAbil}
        \condprof{10}{510}{\cAbil}
        \condprof{10}{560}{\cAbil}
        \condprof{10}{610}{\cAbil}
        \condprof{10}{660}{\cAbil}
        \condprof{10}{710}{\cAbil}
        \condprof{10}{760}{\cAbil}
        \condprof{10}{810}{\cAbil}
        \condprof{10}{860}{\cAbil}
        \condprof{10}{910}{\cAbil}
        \condprof{10}{960}{\cAbil}
        \condprof{10}{1010}{\cAbil}
        \condprof{10}{1060}{\cAbil}
        \condprof{10}{1110}{\cAbil}
        \condprof{10}{1160}{\cAbil}
        \condprof{10}{1210}{\cAbil}
      }}
    }
  }
  \end{picture}

  \newpage

  % now to the back page
  \begin{picture}(1920,2750)
    % first we print and draw all the fix texts in the sheet
    \linethickness{2mm}
    \put(0,0){\framebox(1920,2730)[bl]
    {
      % items
      \linethickness{1mm}
      \put(0,2340){\framebox(1290,400)[bl]
      {
        \linethickness{0.01mm}
        \put(0,360){\makebox(1200,40){\tiny\bf Gear}}
        \put(10,340){\makebox(100,40)[l]{\tiny\bf Location}}
        \put(120,340){\makebox(100,40)[l]{\tiny\bf Item}}
        \put(535,340){\makebox(90,40)[r]{\tiny\bf Weight}}

        \Items

        \conditem{1}
        \conditem{2}
        \conditem{3}
        \conditem{4}
        \conditem{5}
        \conditem{6}
        \conditem{7}

        \put(645,340){\makebox(100,40)[l]{\tiny\bf Location}}
        \put(765,340){\makebox(100,40)[l]{\tiny\bf Item}}
        \put(1190,340){\makebox(90,40)[r]{\tiny\bf Weight}}

        \conditem{8}
        \conditem{9}
        \conditem{10}
        \conditem{11}
        \conditem{12}
        \conditem{13}
        \conditem{14}
      }}

      \linethickness{1mm}
      \put(1300,2340){\framebox(620,400)[bl]
      {
        \linethickness{0.01mm}
        % water rations
        \put(0,350){\makebox(620,40){\tiny\bf Water}}

        \put(10,330){\framebox(25,25){}}
        \put(40,330){\framebox(25,25){}}
        \put(70,330){\framebox(25,25){}}
        \put(100,330){\framebox(25,25){}}
        \put(130,330){\framebox(25,25){}}

        \put(165,330){\framebox(25,25){}}
        \put(195,330){\framebox(25,25){}}
        \put(225,330){\framebox(25,25){}}
        \put(255,330){\framebox(25,25){}}
        \put(285,330){\framebox(25,25){}}

        \put(320,330){\framebox(25,25){}}
        \put(350,330){\framebox(25,25){}}
        \put(380,330){\framebox(25,25){}}
        \put(410,330){\framebox(25,25){}}
        \put(440,330){\framebox(25,25){}}

        \put(465,330){\framebox(25,25){}}
        \put(495,330){\framebox(25,25){}}
        \put(525,330){\framebox(25,25){}}
        \put(555,330){\framebox(25,25){}}
        \put(585,330){\framebox(25,25){}}


        \put(10,300){\framebox(25,25){}}
        \put(40,300){\framebox(25,25){}}
        \put(70,300){\framebox(25,25){}}
        \put(100,300){\framebox(25,25){}}
        \put(130,300){\framebox(25,25){}}

        \put(165,300){\framebox(25,25){}}
        \put(195,300){\framebox(25,25){}}
        \put(225,300){\framebox(25,25){}}
        \put(255,300){\framebox(25,25){}}
        \put(285,300){\framebox(25,25){}}

        \put(320,300){\framebox(25,25){}}
        \put(350,300){\framebox(25,25){}}
        \put(380,300){\framebox(25,25){}}
        \put(410,300){\framebox(25,25){}}
        \put(440,300){\framebox(25,25){}}

        \put(465,300){\framebox(25,25){}}
        \put(495,300){\framebox(25,25){}}
        \put(525,300){\framebox(25,25){}}
        \put(555,300){\framebox(25,25){}}
        \put(585,300){\framebox(25,25){}}


        % wine rations
        \put(0,255){\makebox(620,40){\tiny\bf Wine}}

        \put(10,235){\framebox(25,25){}}
        \put(40,235){\framebox(25,25){}}
        \put(70,235){\framebox(25,25){}}
        \put(100,235){\framebox(25,25){}}
        \put(130,235){\framebox(25,25){}}

        \put(165,235){\framebox(25,25){}}
        \put(195,235){\framebox(25,25){}}
        \put(225,235){\framebox(25,25){}}
        \put(255,235){\framebox(25,25){}}
        \put(285,235){\framebox(25,25){}}

        \put(320,235){\framebox(25,25){}}
        \put(350,235){\framebox(25,25){}}
        \put(380,235){\framebox(25,25){}}
        \put(410,235){\framebox(25,25){}}
        \put(440,235){\framebox(25,25){}}

        \put(465,235){\framebox(25,25){}}
        \put(495,235){\framebox(25,25){}}
        \put(525,235){\framebox(25,25){}}
        \put(555,235){\framebox(25,25){}}
        \put(585,235){\framebox(25,25){}}


        \put(10,205){\framebox(25,25){}}
        \put(40,205){\framebox(25,25){}}
        \put(70,205){\framebox(25,25){}}
        \put(100,205){\framebox(25,25){}}
        \put(130,205){\framebox(25,25){}}

        \put(165,205){\framebox(25,25){}}
        \put(195,205){\framebox(25,25){}}
        \put(225,205){\framebox(25,25){}}
        \put(255,205){\framebox(25,25){}}
        \put(285,205){\framebox(25,25){}}

        \put(320,205){\framebox(25,25){}}
        \put(350,205){\framebox(25,25){}}
        \put(380,205){\framebox(25,25){}}
        \put(410,205){\framebox(25,25){}}
        \put(440,205){\framebox(25,25){}}

        \put(465,205){\framebox(25,25){}}
        \put(495,205){\framebox(25,25){}}
        \put(525,205){\framebox(25,25){}}
        \put(555,205){\framebox(25,25){}}
        \put(585,205){\framebox(25,25){}}


        % food rations
        \put(0,165){\makebox(620,40){\tiny\bf Rations}}

        \put(10,140){\framebox(25,25){}}
        \put(40,140){\framebox(25,25){}}
        \put(70,140){\framebox(25,25){}}
        \put(100,140){\framebox(25,25){}}
        \put(130,140){\framebox(25,25){}}

        \put(165,140){\framebox(25,25){}}
        \put(195,140){\framebox(25,25){}}
        \put(225,140){\framebox(25,25){}}
        \put(255,140){\framebox(25,25){}}
        \put(285,140){\framebox(25,25){}}

        \put(320,140){\framebox(25,25){}}
        \put(350,140){\framebox(25,25){}}
        \put(380,140){\framebox(25,25){}}
        \put(410,140){\framebox(25,25){}}
        \put(440,140){\framebox(25,25){}}

        \put(465,140){\framebox(25,25){}}
        \put(495,140){\framebox(25,25){}}
        \put(525,140){\framebox(25,25){}}
        \put(555,140){\framebox(25,25){}}
        \put(585,140){\framebox(25,25){}}


        \put(10,110){\framebox(25,25){}}
        \put(40,110){\framebox(25,25){}}
        \put(70,110){\framebox(25,25){}}
        \put(100,110){\framebox(25,25){}}
        \put(130,110){\framebox(25,25){}}

        \put(165,110){\framebox(25,25){}}
        \put(195,110){\framebox(25,25){}}
        \put(225,110){\framebox(25,25){}}
        \put(255,110){\framebox(25,25){}}
        \put(285,110){\framebox(25,25){}}

        \put(320,110){\framebox(25,25){}}
        \put(350,110){\framebox(25,25){}}
        \put(380,110){\framebox(25,25){}}
        \put(410,110){\framebox(25,25){}}
        \put(440,110){\framebox(25,25){}}

        \put(465,110){\framebox(25,25){}}
        \put(495,110){\framebox(25,25){}}
        \put(525,110){\framebox(25,25){}}
        \put(555,110){\framebox(25,25){}}
        \put(585,110){\framebox(25,25){}}


        % feed rations
        \put(0,65){\makebox(620,40){\tiny\bf Feed}}

        \put(10,45){\framebox(25,25){}}
        \put(40,45){\framebox(25,25){}}
        \put(70,45){\framebox(25,25){}}
        \put(100,45){\framebox(25,25){}}
        \put(130,45){\framebox(25,25){}}

        \put(165,45){\framebox(25,25){}}
        \put(195,45){\framebox(25,25){}}
        \put(225,45){\framebox(25,25){}}
        \put(255,45){\framebox(25,25){}}
        \put(285,45){\framebox(25,25){}}

        \put(320,45){\framebox(25,25){}}
        \put(350,45){\framebox(25,25){}}
        \put(380,45){\framebox(25,25){}}
        \put(410,45){\framebox(25,25){}}
        \put(440,45){\framebox(25,25){}}

        \put(465,45){\framebox(25,25){}}
        \put(495,45){\framebox(25,25){}}
        \put(525,45){\framebox(25,25){}}
        \put(555,45){\framebox(25,25){}}
        \put(585,45){\framebox(25,25){}}


        \put(10,15){\framebox(25,25){}}
        \put(40,15){\framebox(25,25){}}
        \put(70,15){\framebox(25,25){}}
        \put(100,15){\framebox(25,25){}}
        \put(130,15){\framebox(25,25){}}

        \put(165,15){\framebox(25,25){}}
        \put(195,15){\framebox(25,25){}}
        \put(225,15){\framebox(25,25){}}
        \put(255,15){\framebox(25,25){}}
        \put(285,15){\framebox(25,25){}}

        \put(320,15){\framebox(25,25){}}
        \put(350,15){\framebox(25,25){}}
        \put(380,15){\framebox(25,25){}}
        \put(410,15){\framebox(25,25){}}
        \put(440,15){\framebox(25,25){}}

        \put(465,15){\framebox(25,25){}}
        \put(495,15){\framebox(25,25){}}
        \put(525,15){\framebox(25,25){}}
        \put(555,15){\framebox(25,25){}}
        \put(585,15){\framebox(25,25){}}


      }}

      \linethickness{1mm}
      % experience box
      \put(0,2130){\framebox(170,200)[bl]
      {
        \linethickness{0.01mm}
        \put(10,10){\framebox(150,180)[bl]
        {
          \put(10,10){\makebox(130,60){\large\bf XP}}
          \put(10,80){\line(1,0){130}}

          \ifnum\value{cXP}>0
            \put(10,100){\makebox(130,50){\large\bf \arabic{cXP}}}
          \fi

          \ifnum\value{cXPBonus}>0
            \put(0,150){\makebox(180,40)[l]{\tiny\bf Bonus: \arabic{cXPBonus}\%}}
          \else
            \put(0,150){\makebox(180,40)[l]{\tiny\bf Bonus: }}
          \fi
        }}
      }}

      \linethickness{1mm}
      % treasure box
      \put(180,2130){\framebox(1740,200)[bl]
      {
        \linethickness{0.01mm}
        \put(0,0){\makebox(710,20){\tiny\bf Gems}}
        \put(10,20){\line(1,0){690}}

        \put(10,60){\parbox{71mm}{\tiny\Gems}}

        \put(0,100){\line(1,0){710}}

        \put(0,100){\makebox(710,20){\tiny\bf Coins}}
        \put(10,120){\line(1,0){690}}

        \ifnum\value{cCP}>0
          \put(10,170){\makebox(180,25)[r]{\small\bf\arabic{cCP}}}
        \else
          \put(10,170){\line(1,0){180}}
        \fi
        \put(200,170){\makebox(20,25){\tiny\bf cp}}

        \ifnum\value{cSP}>0
          \put(10,130){\makebox(180,25)[r]{\small\bf\arabic{cSP}}}
        \else
          \put(10,130){\line(1,0){180}}
        \fi
        \put(200,130){\makebox(20,25){\tiny\bf sp}}

        \ifnum\value{cEP}>0
          \put(240,170){\makebox(180,25)[r]{\small\bf\arabic{cEP}}}
        \else
          \put(240,170){\line(1,0){180}}
        \fi
        \put(440,170){\makebox(20,25){\tiny\bf ep}}

        \ifnum\value{cGP}>0
          \put(240,130){\makebox(180,25)[r]{\small\bf\arabic{cGP}}}
        \else
          \put(240,130){\line(1,0){180}}
        \fi
        \put(440,130){\makebox(20,25){\tiny\bf gp}}

        \ifnum\value{cPP}>0
          \put(480,130){\makebox(180,25)[r]{\small\bf\arabic{cPP}}}
        \else
          \put(480,130){\line(1,0){180}}
        \fi
        \put(680,130){\makebox(20,25){\tiny\bf pp}}

        \put(710,0){\line(0,1){180}}

        \put(720,170){\makebox(1020,40){\tiny\bf other valuabels}}

        \put(720,10){\TreasureI}
        \put(720,55){\TreasureII}
        \put(720,100){\TreasureIII}
        \put(720,145){\TreasureIV}
      }}

      \linethickness{1mm}
      % misc. information
      \put(0,900){\framebox(1920,1220)[bl]
      {
        \linethickness{0.01mm}
        \put(0,1180){\makebox(1920,40){\tiny\bf Misc. Information (Magical Items, Command Words, Small Maps etc.)}}

        \Misc
        \condmisc{10}
        \put(920,10){\line(1,0){1000}}
        \condmisc{60}
        \put(920,60){\line(1,0){1000}}
        \condmisc{110}
        \put(920,110){\line(1,0){1000}}
        \condmisc{160}
        \put(920,160){\line(1,0){1000}}
        \condmisc{210}
        \put(920,210){\line(1,0){1000}}
        \condmisc{260}
        \put(920,260){\line(1,0){1000}}
        \condmisc{310}
        \put(920,310){\line(1,0){1000}}
        \condmisc{360}
        \put(920,360){\line(1,0){1000}}
        \condmisc{410}
        \put(920,410){\line(1,0){1000}}
        \condmisc{460}
        \put(920,460){\line(1,0){1000}}
        \condmisc{510}
        \put(920,510){\line(1,0){1000}}
        \condmisc{560}
        \put(920,560){\line(1,0){1000}}
        \condmisc{610}
        \put(920,610){\line(1,0){1000}}
        \condmisc{660}
        \put(920,660){\line(1,0){1000}}
        \condmisc{710}
        \put(920,710){\line(1,0){1000}}
        \condmisc{760}
        \put(920,760){\line(1,0){1000}}
        \condmisc{810}
        \put(920,810){\line(1,0){1000}}
        \condmisc{860}
        \put(920,860){\line(1,0){1000}}
        \condmisc{910}
        \put(920,910){\line(1,0){1000}}
        \condmisc{960}
        \put(920,960){\line(1,0){1000}}
        \condmisc{1010}
        \put(920,1010){\line(1,0){1000}}
        \condmisc{1060}
        \put(920,1060){\line(1,0){1000}}
        \condmisc{1110}
        \put(920,1110){\line(1,0){1000}}
        \put(920,1160){\line(1,0){1000}}

        \put(920,10){\line(0,1){1150}}
        \put(970,10){\line(0,1){1150}}
        \put(1020,10){\line(0,1){1150}}
        \put(1070,10){\line(0,1){1150}}
        \put(1120,10){\line(0,1){1150}}
        \put(1170,10){\line(0,1){1150}}
        \put(1220,10){\line(0,1){1150}}
        \put(1270,10){\line(0,1){1150}}
        \put(1320,10){\line(0,1){1150}}
        \put(1370,10){\line(0,1){1150}}
        \put(1420,10){\line(0,1){1150}}
        \put(1470,10){\line(0,1){1150}}
        \put(1520,10){\line(0,1){1150}}
        \put(1570,10){\line(0,1){1150}}
        \put(1620,10){\line(0,1){1150}}
        \put(1670,10){\line(0,1){1150}}
        \put(1720,10){\line(0,1){1150}}
        \put(1770,10){\line(0,1){1150}}
        \put(1820,10){\line(0,1){1150}}
        \put(1870,10){\line(0,1){1150}}
      }}

      \linethickness{1mm}
      % henchmen, animal companions
      \put(0,0){\framebox(1920,890)[bl]
      {
        \linethickness{0.01mm}
        \put(0,850){\makebox(1920,40){\tiny\bf Henchmen/Animal Companions}}
        \put(10,820){\makebox(490,40)[l]{\tiny\bf Name}}
        \put(510,820){\makebox(90,40){\tiny\bf AC}}
        \put(610,820){\makebox(190,40){\tiny\bf Race/Class}}
        \put(810,820){\makebox(90,40){\tiny\bf HD/Lvl}}
        \put(910,820){\makebox(90,40){\tiny\bf \#AT}}
        \put(1010,820){\makebox(90,40){\tiny\bf THAC0}}
        \put(1110,820){\makebox(290,40){\tiny\bf Dmg/Effects}}
        \put(1410,820){\makebox(390,40){\tiny\bf Skills/Abilities}}
        \put(1810,820){\makebox(90,40){\tiny\bf HP}}

        \Hench

        \condhench{1}
        \put(10,10){\makebox(170,50){\tiny\bf Background: }}

        \condhench{2}
        \put(10,110){\makebox(170,50){\tiny\bf Background: }}

        \condhench{3}
        \put(10,210){\makebox(170,50){\tiny\bf Background: }}

        \condhench{4}
        \put(10,310){\makebox(170,50){\tiny\bf Background: }}

        \condhench{5}
        \put(10,410){\makebox(170,50){\tiny\bf Background: }}

        \condhench{6}
        \put(10,510){\makebox(170,50){\tiny\bf Background: }}

        \condhench{7}
        \put(10,610){\makebox(170,50){\tiny\bf Background: }}

        \condhench{8}
        \put(10,710){\makebox(170,50){\tiny\bf Background: }}


      }}
   }}
  \end{picture}

  \newpage
}%

