All pastes #796515 Raw Edit

Tisteca

public text v1 · immutable
#796515 ·published 2007-11-25 03:23 UTC
rendered paste body
<?php
$title="Random roll";
require_once("header.inc");

function calcstat($iter,$one,$nn) {
return floor((.8+$iter/50)*$iter*(($nn-$one)/275.222)+$one+.1);
}

$hp = rand(30,50);$mhp = $hp*200;
$str = rand(5,10);$mst = $str*50;
$vit = rand(5,10);$mvt = $vit*50;
$agi = rand(5,10);$mag = $agi*50;
$acr = rand(5,10);$mac = $acr*50;
$int = rand(5,10);$min = $int*50;
$wis = rand(5,10);$mws = $wis*50;
$nlv = 10;
?><table>
	<tr>
		<th><small>Level</small></th>
		<th><small>HP</small></th>
		<th><small>STR</small></th>
		<th><small>VIT</small></th>
		<th><small>ACR</small></th>
		<th><small>AGI</small></th>
		<th><small>INT</small></th>
		<th><small>WIS</small></th>
		<th><small>XP Value</small></th>
		<th><small>Next Lvl</small></th>
	</tr>
<?php
for ($i=0;$i<=98;$i++) {
$lhp = calcstat($i,$hp,$mhp);
$lst = calcstat($i,$str,$mst);
$lvt = calcstat($i,$vit,$mvt);
$lag = calcstat($i,$agi,$mag);
$lac = calcstat($i,$acr,$mac);
$lin = calcstat($i,$int,$min);
$lws = calcstat($i,$wis,$mws);
$val = floor(($lst+$lvt+$lag+$lac+$lin+$lws)/6);
?>
	<tr>
		<td><small><?php echo $i+1; ?></small></td>
		<td><small><?php echo $lhp; ?></small></td>
		<td><small><?php echo $lst; ?></small></td>
		<td><small><?php echo $lvt; ?></small></td>
		<td><small><?php echo $lag; ?></small></td>
		<td><small><?php echo $lac; ?></small></td>
		<td><small><?php echo $lin; ?></small></td>
		<td><small><?php echo $lws; ?></small></td>
		<td><small><?php echo $val; ?></small></td>
		<td><small><?php echo $nlv; ?></small></td>
	</tr>
<?php
$nlv = floor($nlv*1.2+3);
if ($nlv > 300000)
$nlv = 300000;
}
echo "</table>";
require_once("footer.inc");
?>