<?php
/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/

echo "<html>\r\n";
$classe = new td_class( );
$mid = $classe->checkcookie( );
$character = $classe->checkcookiechar( );
$qChar = mssql_query( "Select * From Character WHERE Name='".$character."'" );
$Char = mssql_fetch_array( $qChar );
$distribuir = $_POST['distribuiok'];
if ( $distribuir )
{
    $forca = stripslashes( $_POST['strength'] );
    $agilidade = stripslashes( $_POST['dexterity'] );
    $vida = stripslashes( $_POST['vitality'] );
    $energia = stripslashes( $_POST['energy'] );
    $classe->checanumeropositivo( $vida );
    $classe->checanumeropositivo( $forca );
    $classe->checanumeropositivo( $energia );
    $classe->checanumeropositivo( $agilidade );
    $somapontos = $forca + $agilidade + $vida + $energia;
    $classe->verificasevaibugar( $character, $forca, "Strength" );
    $classe->verificasevaibugar( $character, $energia, "Energy" );
    $classe->verificasevaibugar( $character, $vida, "Vitality" );
    $classe->verificasevaibugar( $character, $agilidade, "Dexterity" );
    $classe->verificasomapontos( $character, $somapontos );
    $classe->executadistribuirpontos( $character, $forca, $agilidade, $vida, $energia );
}
echo "<form name=\"form1\" method=\"post\" action=\"\">\r\n<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\" width=\"100%\" class=\"paineltitulo\"><tr><td>\r\n<table width=\"100%\" border=\"0\" align=\"center\"><tr><td>\r\n\r\n<tr valign=\"top\">\r\n<td colspan=\"3\">\r\n<table width=\"100%\" height=\"65\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"> \r\n<tr>\r\n<td height=\"22\" colspan=\"10\" align=\"center\" class=\"paineltitulo\">DISTRIBUIR PONTOS</td></tr>\r\n<tr>\r\n<td width=\"26%\" height=\"24\" class=\"paineltextoescuro\">Personagens</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">Reset&atilde;o</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">Reset</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">Level</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">Pks</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">For&ccedil;a</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">Agilid.</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">Vida</td>\r\n<td width=\"9%\" align=\"center\" class=\"paineltextoescuro\">Energia</td>\r\n<td width=\"2%\" align=\"center\" class=\"paineltextoescuro\">Zen</td>\r\n</tr>\r\n<input name=\"character\" type=\"hidden\" value='";
echo $character;
echo "'>\r\n<tr>";
echo "\r\n<td height='19' align='center' class=\"painelchar\">".$character."</td>\r\n<td align='center' class=\"painelchar\">0</td>\r\n<td align='center' class=\"painelchar\">".$Char['Resets']."</td>\r\n<td align='center' class=\"painelchar\">".$Char['cLevel']."</td>\r\n<td align='center' class=\"painelchar\">".$Char['PkCount']."</td>\r\n<td align='center' class=\"painelchar\">".$Char['Strength']."</td>\r\n<td align='center' class=\"painelchar\">".$Char['Dexterity']."</td>\r\n<td align='center' class=\"painelchar\">".$Char['Vitality']."</td>\r\n<td align='center' class=\"painelchar\">".$Char['Energy']."</td>\r\n<td align='center' class=\"painelchar\">".$Char['Money']."</td>";
echo "</tr></table>\r\n</td></tr>\r\n\r\n<tr>\r\n<td width=\"26%\" align=\"center\" class=\"painelchar\">For&ccedil;a  \r\n<td width=\"79\" class=\"painelchar\"><input name=\"strength\" type=\"text\" id=\"strength2\" size=\"6\" value=\"0\" maxlength=\"5\"></td>\r\n<td width=\"270\" align=\"left\" class=\"painelchar\">Pontos Dispon&iacute;veis <b>";
echo $classe->mostrapontosdistribui( $character );
echo "</b></td>\r\n</tr>\r\n<tr> \r\n<td align=\"center\" class=\"painelchar\">Agilidade</td>\r\n<td class=\"painelchar\"><input name=\"dexterity\" type=\"text\" id=\"dexterity2\" value=\"0\" size=6 maxlength=\"5\"></td>\r\n<td></td>\r\n</tr>\r\n<tr> \r\n<td align=\"center\" class=\"painelchar\">Vida</td>\r\n<td class=\"painelchar\"><input name=\"vitality\" type=\"text\" id=\"vitality4\" value=\"0\" size=\"6\" maxlength=\"5\"></td>\r\n<td></td>\r\n</tr>\r\n<tr> \r\n<td align=\"center\" class=\"painelchar\">Energia</td>\r\n<td class=\"painelchar\"><input name=\"energy\" type=\"text\" id=\"energy4\" value=\"0\" size=\"6\" maxlength=\"5\"></td>\r\n<td align=\"left\"><input name=\"distribuiok\" id=\"distribuiok\" type=\"submit\" value=\"Distribuir\"></td>\r\n</tr>\r\n</table>\r\n</td>\r\n</tr>\r\n</table>\r\n</form>\r\n\r\n</body>\r\n</html>";
?>
