Файл: inc/regeneration.php
Строк: 36
<?php
$date = time();
if($account[vip]==1){
$t=2;
$t2=5;
}else{
$t=1;
$t2=10;
}
$be=mysql_fetch_array(mysql_query("SELECT * FROM `account` WHERE `id`= '$account[id]' LIMIT 1"));
$k_point=intval((time()-$be['regenerator'])/$t2);
$qr_result=mysql_query("SELECT * FROM `account` WHERE `arena_status` = 'off'");
while($data = mysql_fetch_array($qr_result)){
$yss=mysql_fetch_array(mysql_query("SELECT * FROM `arena_travma` WHERE `account`= '$data[id]'"));
if ($yss['time'] <= time() || empty($yss['time']))
{
mysql_query("UPDATE `account` SET `arena_status`='on' WHERE `id`='$data[id]'");
mysql_query("DELETE FROM `arena_travma` WHERE `account` = '$data[id]'");
}
}
if($k_point>=1){
$newhp=$account[hp]+$t*$k_point;
$newmp=$account[mp]+$t*$k_point;
if($newhp>$account[hpall]){$newhp=$account[hpall];}
if($newmp>$account[mpall]){$newmp=$account[mpall];}
mysql_query("UPDATE `account` SET `hp`= '$newhp',`mp`='$newmp',`regenerator` = '$date' WHERE `id`='$account[id]' LIMIT 1");
}
?>