-
Malin Freeborn authoredMalin Freeborn authored
loot.sty 2.81 KiB
\ProvidesPackage{config/loot}
\newcounter{treasure}
\setcounter{treasure}{\month}
%%%%%%%%%%%%%%%%%%%% LOOT %%%%%%%%%%%%%%%%%%%%
\newcommand{\lootSmall}{%
\iftoggle{bestiarychapter}{%
\ifodd\value{r2}%
$3D6$\else$2D6$%
\fi \glspl{cp}}{%
\randomdozen\multiply\value{r12} by \value{r4}\arabic{r12} \glspl{cp}}%
}
\newcommand{\lootMedium}{%
\iftoggle{bestiarychapter}{%
\ifodd\value{r2}%
$3D6$%
\else%
$2D6$%
\fi~\glspl{sp}}{%
\addtocounter{gold}{\thepage}%
\divide\value{gold} by \value{r4}%
\ifnum\value{gold}<4%
\setcounter{gold}{7}%
\fi%
\arabic{gold}~\glspl{sp}}%
}
\newcommand{\lootBig}{%
\iftoggle{bestiarychapter}{%
\ifodd\thepage $3D6-2$\else$2D6+4$\fi \glspl{gp}}{%
\randomdozen\addtocounter{r12}{8}\arabic{r12}\glspl{gp}%
}%
}
\newcommand{\lootMagic}{%
\ifnum\value{noAppearing}>1%
Mana stone holding 2 MP%
\else%
\iftoggle{bestiarychapter}{}%
{%
\stepcounter{treasure}%
\ifnum\value{treasure}>10\setcounter{treasure}{0}\fi%
\ifcase\value{treasure}\relax%
Sorcerer's Eye\index{Magical Item!Sorcerer's Eye}%
\or%1
quiver with \arabic{r12} Spider Arrows\index{Magical Item!Spider Arrows}%
\or%2
pouch of Wild Seeds\index{Magical Item!Wild Seeds}%
\or%3
Bag of Holding\index{Magical Item!Bag of Holding}%
\or%4
Defensive Heart\index{Magical Item!Defensive Heart}%
\or%5
Portal Scroll\index{Magical Item!Portal Scroll}%
\or%6
Sleeping Dust\index{Magical Item!Sleeping Dust}%
\or%7
Ring of Asphyxiation\index{Magical Item!Ring of Asphyxiation}%
\or%8
Ghost Shield\index{Magical Item!Ghost Shield}%
\or%9
Bag of Tricks\index{Magical Item!Bag of Tricks}%
\or%10
Taming Flute\index{Magical Item!Taming Flute}%
\else%11
Mana Stone with 4 \glspl{mp}%
\fi%
}%
\fi%
}
\newcommand{\lootJewellery}{%
\iftoggle{bestiarychapter}{jewellery worth \ifodd\value{r2}$3D6$sp\else$1D6+2$\glspl{gp}\fi}%
{%
\stepcounter{treasure}%
\ifnum\value{treasure}>10\setcounter{treasure}{0}\fi%
\ifcase\value{treasure}\relax%
golden necklace worth \arabic{r12}~\glspl{sp}%
\or%1
golden ring worth \thechapter~\glspl{sp}%
\or%2
jewel encrusted dagger worth \thepage~\glspl{sp}%
\or%3
ornate silver earrings worth 1 \glspl{gp}%
\or%4
gem encrusted broach worth \arabic{r4b} \glspl{gp}
\or%5
saphire pendant worth \arabic{r3b}\glspl{gp}%
\or%6
gem-encrusted headband, worth \arabic{r4b}~\glspl{gp}%
\or%7
gold-looking necklage made from fool's gold (worthless)%
\or%8
gem-studded ring, worth \arabic{r12}~\glspl{sp}%
\or%9
signet ring, worth \arabic{r2}~\glspl{gp}%
\else%10
gem-studded ring, worth \arabic{r12}~\glspl{sp}%
\fi%
}%
}