<%args>
$pow1 => ''
$qui1 => ''
$tou1 => ''
$int1 => ''
$wil1 => ''
$pre1 => ''
$off1 => ''
$gua1 => ''
$hpt1 => ''
$exp1 => ''
$crt1 => ''
$min1 => ''
$max1 => ''
$pow2 => ''
$qui2 => ''
$tou2 => ''
$int2 => ''
$wil2 => ''
$pre2 => ''
$off2 => ''
$gua2 => ''
$hpt2 => ''
$exp2 => ''
$crt2 => ''
$min2 => ''
$max2 => ''
$pow3 => ''
$qui3 => ''
$tou3 => ''
$int3 => ''
$wil3 => ''
$pre3 => ''
$off3 => ''
$gua3 => ''
$hpt3 => ''
$exp3 => ''
$crt3 => ''
$min3 => ''
$max3 => ''
%stats => ()
$i => ''
$total => ''
@keys => ()
$MAX_STAT => 6
$MIN_STAT => 1
$STAT_POINTS => 21
$set_num => ''
$BASE_HP => 9
$BASE_LEVEL => 1
$messy => (((($BASE_LEVEL*$BASE_LEVEL) / (sqrt($BASE_LEVEL)) / $BASE_LEVEL) + $BASE_LEVEL))
$attack => ''
$defense => ''
$accuracy => ''
$evasion => ''
%args>
<%init>
$set_num = 1;
while ($set_num <= 3) {
%stats = ( power => '',
quick => '',
tough => '',
intel => '',
will => '',
presn => '',
);
$i = 0;
$total = 0;
@keys = keys(%stats);
while ($keys[$i] && $i <= 22) {
$stats{$keys[$i]} = int(rand($MAX_STAT)+1);
$total += $stats{$keys[$i]};
$i++;
}
if ($total != 21) {
while ($total < 21) {
my $which_stat = int(rand(6)+1);
if ($stats{$keys[$which_stat]} == 6) { return; }
$stats{$keys[$which_stat]}++;
$total++;
}
while ($total > 21) {
my $which_stat = int(rand(6)+1);
if ($stats{$keys[$which_stat]} == 1) { return; }
$stats{$keys[$which_stat]}--;
$total--;
}
}
if ($set_num == 1) {
$pow1 = $stats{power}; $qui1 = $stats{quick}; $tou1 = $stats{tough};
$int1 = $stats{intel}; $wil1 = $stats{will}; $pre1 = $stats{presn};
$attack = int($pow1 * $messy);
$accuracy = int($int1 * $messy);
$off1 = $attack+$accuracy;
$defense = int($tou1 * $messy);
$evasion = int($qui1 * $messy);
$gua1 = $defense+$evasion;
$hpt1 = int($wil1 * (((($BASE_LEVEL*$BASE_LEVEL) / (sqrt($BASE_LEVEL)) / $BASE_LEVEL) + ($BASE_HP + $BASE_LEVEL))));
$min1 = int(($pow1 / 15) * $messy);
$max1 = int(($pow1 / 4) * $messy);
if ($min1 == 0) { $min1++; }
if ($max1 == 0) { $max1++; }
$crt1 = int(($int1/35)*10000);
$exp1 = (int(($pre1*(((($BASE_LEVEL*$BASE_LEVEL) / (sqrt($BASE_LEVEL)) / $BASE_LEVEL))) + $BASE_LEVEL)) / 25)*100;
if ($exp1 > 399) { $exp1 = 400; }
}
if ($set_num == 2) {
$pow2 = $stats{power}; $qui2 = $stats{quick}; $tou2 = $stats{tough};
$int2 = $stats{intel}; $wil2 = $stats{will}; $pre2 = $stats{presn};
$attack = int($pow2 * $messy);
$accuracy = int($int2 * $messy);
$off2 = $attack+$accuracy;
$defense = int($tou2 * $messy);
$evasion = int($qui2 * $messy);
$gua2 = $defense+$evasion;
$hpt2 = int($wil2 * (((($BASE_LEVEL*$BASE_LEVEL) / (sqrt($BASE_LEVEL)) / $BASE_LEVEL) + ($BASE_HP + $BASE_LEVEL))));
$min2 = int(($pow2 / 15) * $messy);
$max2 = int(($pow2 / 4) * $messy);
if ($min2 == 0) { $min2++; }
if ($max2 == 0) { $max2++; }
$crt2 = int(($int2/35)*10000);
$exp2 = (int(($pre2*(((($BASE_LEVEL*$BASE_LEVEL) / (sqrt($BASE_LEVEL)) / $BASE_LEVEL))) + $BASE_LEVEL)) / 25)*100;
if ($exp2 > 399) { $exp2 = 400; }
}
if ($set_num == 3) {
$pow3 = $stats{power}; $qui3 = $stats{quick}; $tou3 = $stats{tough};
$int3 = $stats{intel}; $wil3 = $stats{will}; $pre3 = $stats{presn};
$attack = int($pow3 * $messy);
$accuracy = int($int3 * $messy);
$off3 = $attack+$accuracy;
$defense = int($tou3 * $messy);
$evasion = int($qui3 * $messy);
$gua3 = $defense+$evasion;
$hpt3 = int($wil3 * (((($BASE_LEVEL*$BASE_LEVEL) / (sqrt($BASE_LEVEL)) / $BASE_LEVEL) + ($BASE_HP + $BASE_LEVEL))));
$min3 = int(($pow3 / 15) * $messy);
$max3 = int(($pow3 / 4) * $messy);
if ($min3 == 0) { $min3++; }
if ($max3 == 0) { $max3++; }
$crt3 = int(($int3/35)*10000);
$exp3 = (int(($pre3*(((($BASE_LEVEL*$BASE_LEVEL) / (sqrt($BASE_LEVEL)) / $BASE_LEVEL))) + $BASE_LEVEL)) / 25)*100;
if ($exp3 > 399) { $exp3 = 400; }
}
$set_num++;
}
%init>