[ header ("Location: arena.php?log=inv");exit; //в бой
}elseif($udata[hp]<=0 OR $udata[mp]<=0){
mysql_query("UPDATE `arenalog` SET `name`='hp' WHERE `usr` = '$log'");
header ("Location: arena.php?log=hp");exit; //в бой
}
ELSE{
if($udata[lvl]>=0 and $udata[lvl]<=5){$koef1=rand(2,4);$koef2=rand(4,8);$koef3=rand(6,10);$bon1=rand(1,4)*1.5;$bon2=rand(2,6)*1.5;$bon3=rand(6,8)*1.5;}
if($udata[lvl]>5 and $udata[lvl]<=10){$koef1=rand(2,4);$koef2=rand(4,8);$koef3=rand(6,10);$bon1=rand(1,4)*1.5;$bon2=rand(5,15)*1.5;$bon3=rand(10,20)*1.5;}
if($udata[lvl]>10 and $udata[lvl]<=20){$koef1=rand(8,16);$koef2=rand(10,20);$koef3=rand(20,30);$bon1=rand(8,16)*1.6;$bon2=rand(10,20)*1.6;$bon3=rand(20,30)*1.6;}
if($udata[lvl]>20 and $udata[lvl]<=30){$koef1=rand(14,22);$koef2=rand(15,25);$koef3=rand(30,40);$bon1=rand(14,22)*1.7;$bon2=rand(15,25)*1.7;$bon3=rand(30,40)*1.7;}
if($udata[lvl]>30 and $udata[lvl]<=40){$koef1=rand(20,28);$koef2=rand(20,35);$koef3=rand(40,50);$bon1=rand(20,28)*1.8;$bon2=rand(20,35)*1.8;$bon3=rand(40,50)*1.8;}
if($udata[lvl]>40 and $udata[lvl]<=50){$koef1=rand(26,32);$koef2=rand(30,45);$koef3=rand(50,60);$bon1=rand(26,32)*1.9;$bon2=rand(30,45)*1.9;$bon3=rand(50,60)*1.9;}
if($udata[lvl]>50 and $udata[lvl]<=60){$koef1=rand(30,36);$koef2=rand(35,55);$koef3=rand(50,65);$bon1=rand(30,36)*2;$bon2=rand(35,55)*2;$bon3=rand(50,70)*2;}
if(!empty($_GET[user1])){$shans=80;$var=round($koef1+$set[razb]*1.5);$bon=round($bon1+$set[razb]*3);$user=$_GET[user1];}
if(!empty($_GET[user2])){$shans=66;$var=round($koef2+$set[razb]*1.5);$bon=round($bon2+$set[razb]*3);$user=$_GET[user2];}
if(!empty($_GET[user3])){$shans=40;$var=round($koef3+$set[razb]*2);$bon=round($bon3+$set[razb]*3);$user=$_GET[user3];}
$stat=$_GET[stat];
$my=$udata[sila]+$udata[hpall]+$udata[lovk]+$udata[prot];
if(($my-$stat)>=10){$shans=80;}
if($shans>=$rand){
$inv=$set[arenainv]-1;
$win=$udata[arenawins]+1;
$los=$udata[arenaloses];
$uron=3+rand(0,$udata[hp]/5);
$uron=round($uron);