Creature treasure generator (ma pimeja nasa)

This chart uses input variables
  • HD
  • Sapient
  • Lair
Code

{% Level = HD %}

{% Coinchance = 1 %}

{% Goodschance = 0 %}

{% Specialchance = 0 %}

{% Coinmult = 1 %}

{% Coinbonus = 0 %}

{%if HD > 3%}

{% Coinchance = 2 %}

{% Specialchance = 1 %}

{%end%}

{%if HD > 5%}

{% Coinchance = 3 %}

{% Specialchance = 2 %}

{%end%}

{%if HD > 7%}

{% Coinchance = 4 %}

{% Specialchance = 3 %}

{%end%}

{%if HD > 9%}

{% Coinchance = 5 %}

{% Specialchance = 4 %}

{%end%}

{%if HD > 11%}

{% Coinchance = 6 %}

{% Specialchance = 5 %}

{%end%}

{%if HD > 2%}

{% Goodschance = 1 %}

{%end%}

{%if HD > 4%}

{% Goodschance = 2 %}

{%end%}

{%if HD > 6%}

{% Goodschance = 3 %}

{%end%}

{%if HD > 8%}

{% Goodschance = 4 %}

{%end%}

{%if HD > 10%}

{% Goodschance = 5 %}

{%end%}

{%if HD > 4%}

{% Coinmult= 5 %}

{%end%}

{%if HD > 8%}

{% Coinmult= 10 %}

{%end%}

{%if HD == 1%}

{% Coinbase= 2 %}

{%end%}

{%if HD == 2%}

{% Coinbase= 3 %}

{%end%}

{%if HD == 3%}

{% Coinbase= 4 %}

{%end%}

{%if HD == 4%}

{% Coinbase= 5 %}

{%end%}

{%if HD == 5%}

{% Coinbase= 3 %}

{%end%}

{%if HD == 6%}

{% Coinbase= 4 %}

{%end%}

{%if HD == 7%}

{% Coinbase= 5 %}

{%end%}

{%if HD == 8%}

{% Coinbase= 6 %}

{%end%}

{%if HD == 9%}

{% Coinbase= 4 %}

{%end%}

{%if HD == 10%}

{% Coinbase= 5 %}

{%end%}

{%if HD == 11%}

{% Coinbase= 6 %}

{%end%}

{%if HD >= 12%}

{% Coinbase= 7 %}

{%end%}

Result

{%if Sapient == "Yes"%}

{% Coinbonus = {{$Coinbonus}+1} %}

{% Coinchance = {{$Coinchance}+1} %}

{% Specialchance = {{$Specialchance}+5} %}

{%end%}

{%if Sapient == "No"%}

{% Goodschance = {{$Goodschance}-1} %}

{% Specialchance = {{$Specialchance}-5} %}

{%end%}

{%if Lair == "Yes"%}

{% Coinbonus = {{$Coinbonus}+2} %}

{% Coinchance = {{$Coinchance}+1} %}

{% Specialchance = {{$Specialchance}+5} %}

{% Goodschance = {{$Goodschance}+1} %}

{%end%}

{%if Lair == "No"%}

{% Coinbonus = {{$Coinbonus}-1} %}

{% Coinchance = {{$Coinchance}-1} %}

{% Goodschance = {{$Goodschance}-1} %}

{%end%}

Roll on "Treasure roll" (render_style="vertical")


Subcharts

Treasure roll (d1)

Coin

{% x = {d6} %}

{%if x <= Coinchance%}

{% Coinroll = {{$Coinbase}+{$Coinbonus}} %}

Roll {$Coinroll}d6*{$Coinmult}

{%end%}

{%if x > Coinchance%}

None

{%end%}

Goods

{% y = {d6} %}

{%if y <= Goodschance%}

Roll on "Goods" 
{%end%}

{%if y > Goodschance%}

None

{%end%}

Special item

{% z = {d100} %}

{%if z <= Specialchance%}

Roll on "Special item" 
{%end%}

{%if z > Specialchance%}

None
{%end%}