Code
<?php
if(!$stat['battle']){
$now=time();
$stat_obj=mysql_fetch_array(mysql_query("SELECT SUM(objects.`hp`) as `hp` FROM slots, objects WHERE slots.id='".$stat['id']."' AND objects.user='".$stat['user']."' AND objects.id IN (slots.1,slots.2,slots.3,slots.4,slots.5,slots.6,slots.7,slots.8,slots.9,slots.10,slots.11,slots.12,slots.13,slots.14,slots.15,slots.16,slot s.17,slots.18,slots.19) LIMIT 1"));
$statSkills = explode("|",$stat['rase_skill']);
$stat['gnom']=$statSkills['3']*5;
$stat['hp']+=$stat_obj['hp'];
$h_hpmax=ceil(($stat['vitality']*5+$stat['hp'])*(1+($stat['gnom']/100)));
$who=$stat['user'];
$cure_hp=$stat['cure_hp'];
$hhh=$h_hpmax;
$time_to_cure=$cure_hp-time();
if ($stat['hp_now']<$hhh){
////if ($cure_hp>$now){
$cure_nav = $stat['cure'];
$cure_full = floor(600-$cure_nav*12/2);
$one=$cure_full/$hhh;
$time=$cure_full-$one*$stat['hp_now'];
$put_to_base=time()+$time;
$hp[0]=$hhh;
$q=mysql_query("UPDATE players SET cure_hp='$put_to_base' WHERE user='$user'");
}
else{
$hp[0]=$hhh;
$SS = mysql_query("UPDATE players SET hp_now='$hp[0]',cure_hp='0' WHERE user='$user'");
}
}
?>
Скрипт регенирации ХП для ИВ
разумеется в зависимости от прокаченных скилов рассы...