View file ascalon/start.php

File size: 20.51Kb
<?php
/*echo"<p align=\"center\"></font color=\"red\">Игра временно закрыта! Проводятся работы по оптимизации!</font><br><a href=\"http://online.wen.ru\">выход</a></p>"; exit;*/
Error_Reporting(E_ALL & ~E_NOTICE);
$mt=mt_rand(10000,99999);
$chas=date("H");
if($chas>=6 && $chas<=17) $chas="дeнь"; else $chas="нoчь";
$ttime=date("H:i:s");
$k=0;
if(isset($_GET['ses'])){
$ses=htmlspecialchars(stripslashes($_GET['ses']));
$dbhost='localhost';
$dbname='db_l2gracia';
$dbusers='db_l2gracia';
$dbpass='FaGw6cgz';
$link=mysql_connect($dbhost,$dbusers,$dbpass) or die ('error connecting');
mysql_select_db($dbname,$link) or die('error selecting db');
$col=mysql_query("SELECT * FROM users WHERE ses=\"$ses\"") or die('error');
$har=mysql_fetch_array($col);

if(isset($har['nick'])){
$nick=$har['nick'];
$pass=$har['pass'];
$class=(int)$har['class'];
$post=(int)$har['post'];
$thp=(int)$har['thp'];
$time=(int)$har['time'];
$lok=(int)$har['lok'];
$name=$har['name'];
$sex=$har['sex'];
$town=$har['town'];
$email=$har['email'];
$infa=$har['infa'];
$online=(int)$har['online'];
$avatar=$har['avatar'];
$nastr=(int)$har['nastr'];
$art1=$har['art1'];
$art2=$har['art2'];
$art3=$har['art3'];
$art4=$har['art4'];
$rep=(int)$har['rep'];
$age=(int)$har['age'];
$nastrs=(int)$har['nastrs'];
$nastrt=(int)$har['nastrt'];
$access=(int)$har['access'];
$slots=(int)$har['slots'];
$mifr=(int)$har['mifr'];
$clan=(int)$har['clan'];
$crafta=(int)$har['crafta'];
$craftm=(int)$har['craftm'];
$crafth=(int)$har['crafth'];
$craftg=(int)$har['craftg'];
$money=(int)$har['money'];
$chit=(int)$har['chit'];
$tmp=(int)$har['tmp'];
$craftr=(int)$har['craftr'];
$craftrun=(int)$har['craftrun'];
$craftc=(int)$har['craftc'];
$craftkr=(int)$har['craftkr'];
$craftu=(int)$har['craftu'];
} else { header("Location:log.php?mt=$mt"); exit;}

$bac=date("U");
$buc=$bac-$online;
if($buc>600){ header("Location:log.php?mt=$mt"); exit;} else $online=$bac;

$brauz=getenv('HTTP_USER_AGENT');
if (getenv("HTTP_X_FORWARDED_FOR"))
$ip=getenv("HTTP_X_FORWARDED_FOR"); else $ip=getenv("REMOTE_ADDR");

$sq=mysql_query("SELECT * FROM ban WHERE nick=\"$nick\"")or die('error');
$ro=mysql_fetch_array($sq);
if(isset($ro['nick'])){
$p1=(int)$ro['char1'];
$p2=(int)$ro['char2'];
$p3=(int)$ro['char3'];
if($p3>=$bac){ $razn=$p3-$bac; $why=$ro['kom3']; echo"<p align=\"center\"><font color=\"red\">Ваш персораж забанен! Причина: $why! Время до окончания бана: $razn сек!</font></p>"; exit;}
if($p1>=$bac) $sile=1;
if($p2>0){ header("Location:work.php?ses=$ses&amp;mt=$mt"); exit;}
if($p3<$bac && $p1<$bac && $p2<=0) mysql_query("DELETE FROM ban WHERE nick=\"$nick\"")or die('del error');
}

$key=1;
$sq=mysql_query("SELECT * FROM equip WHERE nick=\"$nick\"") or die('er');
$qs=mysql_fetch_array($sq);
$fx1=$qs['eq1'];
$fx2=$qs['eq2'];
$fx3=$qs['eq3'];
$fx4=$qs['eq4'];
$fx5=$qs['eq5'];
$fx6=$qs['eq6'];
$th1=@explode(".",$fx1);
$th2=@explode(".",$fx2);
$th3=@explode(".",$fx3);
$th4=@explode(".",$fx4);
$th5=@explode(".",$fx5);
$th6=@explode(".",$fx6);
$atk_kr=0;
$def_kr=0;
$mdef_kr=0;
$hp_kr=0;
$int_kr=0;
$m_kr=0;
if(isset($th1[2])){ $d1=(int)$th1[2];
if(isset($th1[6])){
if((int)$th1[6]==1){ $atk_kr=(int)($d1*10/100)+$atk_kr;}
if((int)$th1[6]==2){ $atk_kr=(int)($d1*20/100)+$atk_kr;}
if((int)$th1[6]==3){ $atk_kr=(int)($d1*30/100)+$atk_kr;}
if((int)$th1[6]==19){ $atk_kr=(int)($d1*40/100)+$atk_kr;}

if((int)$th1[6]==4){ $def_kr=(int)($d1*7/100)+$def_kr;}
if((int)$th1[6]==5){ $def_kr=(int)($d1*14/100)+$def_kr;}
if((int)$th1[6]==6){ $def_kr=(int)($d1*21/100)+$def_kr;}
if((int)$th1[6]==20){ $def_kr=(int)($d1*28/100)+$def_kr;}

if((int)$th1[6]==7){ $mdef_kr=(int)(sqrt($d1*10*1.7/100))+$mdef_kr;}
if((int)$th1[6]==8){ $mdef_kr=(int)(sqrt($d1*15*1.7/100))+$mdef_kr;}
if((int)$th1[6]==9){ $mdef_kr=(int)(sqrt($d1*20*1.7/100))+$mdef_kr;}
if((int)$th1[6]==21){ $mdef_kr=(int)(sqrt($d1*25*1.7/100))+$mdef_kr;}

if((int)$th1[6]==10){ $hp_kr=(int)($d1*10/100)+$hp_kr;}
if((int)$th1[6]==11){ $hp_kr=(int)($d1*20/100)+$hp_kr;}
if((int)$th1[6]==12){ $hp_kr=(int)($d1*30/100)+$hp_kr;}
if((int)$th1[6]==22){ $hp_kr=(int)($d1*40/100)+$hp_kr;}

if((int)$th1[6]==13){ $int_kr=(int)($d1*3/100)+$int_kr;}
if((int)$th1[6]==14){ $int_kr=(int)($d1*4/100)+$int_kr;}
if((int)$th1[6]==15){ $int_kr=(int)($d1*5/100)+$int_kr;}
if((int)$th1[6]==23){ $int_kr=(int)($d1*6/100)+$int_kr;}

if((int)$th1[6]==16){ $m_kr=(int)($d1*4/100)+$m_kr;}
if((int)$th1[6]==17){ $m_kr=(int)($d1*8/100)+$m_kr;}
if((int)$th1[6]==18){ $m_kr=(int)($d1*12/100)+$m_kr;}
if((int)$th1[6]==24){ $m_kr=(int)($d1*16/100)+$m_kr;}
}} else $d1=0;

if(isset($th2[2])){ $d2=(int)$th2[2];
if(isset($th2[6])){
if((int)$th2[6]==1){ $atk_kr=(int)($d2*10/100)+$atk_kr;}
if((int)$th2[6]==2){ $atk_kr=(int)($d2*20/100)+$atk_kr;}
if((int)$th2[6]==3){ $atk_kr=(int)($d2*30/100)+$atk_kr;}
if((int)$th2[6]==19){ $atk_kr=(int)($d2*40/100)+$atk_kr;}

if((int)$th2[6]==4){ $def_kr=(int)($d2*7/100)+$def_kr;}
if((int)$th2[6]==5){ $def_kr=(int)($d2*14/100)+$def_kr;}
if((int)$th2[6]==6){ $def_kr=(int)($d2*21/100)+$def_kr;}
if((int)$th2[6]==20){ $def_kr=(int)($d2*28/100)+$def_kr;}

if((int)$th2[6]==7){ $mdef_kr=(int)(sqrt($d2*10*1.7/100))+$mdef_kr;}
if((int)$th2[6]==8){ $mdef_kr=(int)(sqrt($d2*15*1.7/100))+$mdef_kr;}
if((int)$th2[6]==9){ $mdef_kr=(int)(sqrt($d2*20*1.7/100))+$mdef_kr;}
if((int)$th2[6]==21){ $mdef_kr=(int)(sqrt($d2*25*1.7/100))+$mdef_kr;}

if((int)$th2[6]==10){ $hp_kr=(int)($d2*10/100)+$hp_kr;}
if((int)$th2[6]==11){ $hp_kr=(int)($d2*20/100)+$hp_kr;}
if((int)$th2[6]==12){ $hp_kr=(int)($d2*30/100)+$hp_kr;}
if((int)$th2[6]==22){ $hp_kr=(int)($d2*40/100)+$hp_kr;}

if((int)$th2[6]==13){ $int_kr=(int)($d2*3/100)+$int_kr;}
if((int)$th2[6]==14){ $int_kr=(int)($d2*4/100)+$int_kr;}
if((int)$th2[6]==15){ $int_kr=(int)($d2*5/100)+$int_kr;}
if((int)$th2[6]==23){ $int_kr=(int)($d2*6/100)+$int_kr;}

if((int)$th2[6]==16){ $m_kr=(int)($d2*4/100)+$m_kr;}
if((int)$th2[6]==17){ $m_kr=(int)($d2*8/100)+$m_kr;}
if((int)$th2[6]==18){ $m_kr=(int)($d2*12/100)+$m_kr;}
if((int)$th2[6]==24){ $m_kr=(int)($d2*16/100)+$m_kr;}
}} else $d2=0;

if(isset($th3[2])){ $d3=(int)$th3[2];
if(isset($th3[6])){
if((int)$th3[6]==1){ $atk_kr=(int)($d3*10/100)+$atk_kr;}
if((int)$th3[6]==2){ $atk_kr=(int)($d3*20/100)+$atk_kr;}
if((int)$th3[6]==3){ $atk_kr=(int)($d3*30/100)+$atk_kr;}
if((int)$th3[6]==19){ $atk_kr=(int)($d3*40/100)+$atk_kr;}

if((int)$th3[6]==4){ $def_kr=(int)($d3*7/100)+$def_kr;}
if((int)$th3[6]==5){ $def_kr=(int)($d3*14/100)+$def_kr;}
if((int)$th3[6]==6){ $def_kr=(int)($d3*21/100)+$def_kr;}
if((int)$th3[6]==20){ $def_kr=(int)($d3*28/100)+$def_kr;}

if((int)$th3[6]==7){ $mdef_kr=(int)(sqrt($d3*10*1.7/100))+$mdef_kr;}
if((int)$th3[6]==8){ $mdef_kr=(int)(sqrt($d3*15*1.7/100))+$mdef_kr;}
if((int)$th3[6]==9){ $mdef_kr=(int)(sqrt($d3*20*1.7/100))+$mdef_kr;}
if((int)$th3[6]==21){ $mdef_kr=(int)(sqrt($d3*25*1.7/100))+$mdef_kr;}

if((int)$th3[6]==10){ $hp_kr=(int)($d3*10/100)+$hp_kr;}
if((int)$th3[6]==11){ $hp_kr=(int)($d3*20/100)+$hp_kr;}
if((int)$th3[6]==12){ $hp_kr=(int)($d3*30/100)+$hp_kr;}
if((int)$th3[6]==22){ $hp_kr=(int)($d3*40/100)+$hp_kr;}

if((int)$th3[6]==13){ $int_kr=(int)($d3*3/100)+$int_kr;}
if((int)$th3[6]==14){ $int_kr=(int)($d3*4/100)+$int_kr;}
if((int)$th3[6]==15){ $int_kr=(int)($d3*5/100)+$int_kr;}
if((int)$th3[6]==23){ $int_kr=(int)($d3*6/100)+$int_kr;}

if((int)$th3[6]==16){ $m_kr=(int)($d3*4/100)+$m_kr;}
if((int)$th3[6]==17){ $m_kr=(int)($d3*8/100)+$m_kr;}
if((int)$th3[6]==18){ $m_kr=(int)($d3*12/100)+$m_kr;}
if((int)$th3[6]==24){ $m_kr=(int)($d3*16/100)+$m_kr;}
}} else $d3=0;

if(isset($th4[2])){ $d4=(int)$th4[2];
if(isset($th4[6])){
if((int)$th4[6]==1){ $atk_kr=(int)($d4*10/100)+$atk_kr;}
if((int)$th4[6]==2){ $atk_kr=(int)($d4*20/100)+$atk_kr;}
if((int)$th4[6]==3){ $atk_kr=(int)($d4*30/100)+$atk_kr;}
if((int)$th4[6]==19){ $atk_kr=(int)($d4*40/100)+$atk_kr;}

if((int)$th4[6]==4){ $def_kr=(int)($d4*7/100)+$def_kr;}
if((int)$th4[6]==5){ $def_kr=(int)($d4*14/100)+$def_kr;}
if((int)$th4[6]==6){ $def_kr=(int)($d4*21/100)+$def_kr;}
if((int)$th4[6]==20){ $def_kr=(int)($d4*28/100)+$def_kr;}

if((int)$th4[6]==7){ $mdef_kr=(int)(sqrt($d4*10*1.7/100))+$mdef_kr;}
if((int)$th4[6]==8){ $mdef_kr=(int)(sqrt($d4*15*1.7/100))+$mdef_kr;}
if((int)$th4[6]==9){ $mdef_kr=(int)(sqrt($d4*20*1.7/100))+$mdef_kr;}
if((int)$th4[6]==21){ $mdef_kr=(int)(sqrt($d4*25*1.7/100))+$mdef_kr;}

if((int)$th4[6]==10){ $hp_kr=(int)($d4*10/100)+$hp_kr;}
if((int)$th4[6]==11){ $hp_kr=(int)($d4*20/100)+$hp_kr;}
if((int)$th4[6]==12){ $hp_kr=(int)($d4*30/100)+$hp_kr;}
if((int)$th4[6]==22){ $hp_kr=(int)($d4*40/100)+$hp_kr;}

if((int)$th4[6]==13){ $int_kr=(int)($d4*3/100)+$int_kr;}
if((int)$th4[6]==14){ $int_kr=(int)($d4*4/100)+$int_kr;}
if((int)$th4[6]==15){ $int_kr=(int)($d4*5/100)+$int_kr;}
if((int)$th4[6]==23){ $int_kr=(int)($d4*6/100)+$int_kr;}

if((int)$th4[6]==16){ $m_kr=(int)($d4*4/100)+$m_kr;}
if((int)$th4[6]==17){ $m_kr=(int)($d4*8/100)+$m_kr;}
if((int)$th4[6]==18){ $m_kr=(int)($d4*12/100)+$m_kr;}
if((int)$th4[6]==24){ $m_kr=(int)($d4*16/100)+$m_kr;}
}} else $d4=0;

if(isset($th5[2])){ $d5=(int)$th5[2];
if(isset($th5[6])){
if((int)$th5[6]==1){ $atk_kr=(int)($d5*10/100)+$atk_kr;}
if((int)$th5[6]==2){ $atk_kr=(int)($d5*20/100)+$atk_kr;}
if((int)$th5[6]==3){ $atk_kr=(int)($d5*30/100)+$atk_kr;}
if((int)$th5[6]==19){ $atk_kr=(int)($d5*40/100)+$atk_kr;}

if((int)$th5[6]==4){ $def_kr=(int)($d5*7/100)+$def_kr;}
if((int)$th5[6]==5){ $def_kr=(int)($d5*14/100)+$def_kr;}
if((int)$th5[6]==6){ $def_kr=(int)($d5*21/100)+$def_kr;}
if((int)$th5[6]==20){ $def_kr=(int)($d5*28/100)+$def_kr;}

if((int)$th5[6]==7){ $mdef_kr=(int)(sqrt($d5*10*1.7/100))+$mdef_kr;}
if((int)$th5[6]==8){ $mdef_kr=(int)(sqrt($d5*15*1.7/100))+$mdef_kr;}
if((int)$th5[6]==9){ $mdef_kr=(int)(sqrt($d5*20*1.7/100))+$mdef_kr;}
if((int)$th5[6]==21){ $mdef_kr=(int)(sqrt($d5*25*1.7/100))+$mdef_kr;}

if((int)$th5[6]==10){ $hp_kr=(int)($d5*10/100)+$hp_kr;}
if((int)$th5[6]==11){ $hp_kr=(int)($d5*20/100)+$hp_kr;}
if((int)$th5[6]==12){ $hp_kr=(int)($d5*30/100)+$hp_kr;}
if((int)$th5[6]==22){ $hp_kr=(int)($d5*40/100)+$hp_kr;}

if((int)$th5[6]==13){ $int_kr=(int)($d5*3/100)+$int_kr;}
if((int)$th5[6]==14){ $int_kr=(int)($d5*4/100)+$int_kr;}
if((int)$th5[6]==15){ $int_kr=(int)($d5*5/100)+$int_kr;}
if((int)$th5[6]==23){ $int_kr=(int)($d5*6/100)+$int_kr;}

if((int)$th5[6]==16){ $m_kr=(int)($d5*4/100)+$m_kr;}
if((int)$th5[6]==17){ $m_kr=(int)($d5*8/100)+$m_kr;}
if((int)$th5[6]==18){ $m_kr=(int)($d5*12/100)+$m_kr;}
if((int)$th5[6]==24){ $m_kr=(int)($d5*16/100)+$m_kr;}
}} else $d5=0;

if(isset($th6[2])){ $d6=(int)$th6[2];
if(isset($th6[6])){
if((int)$th6[6]==1){ $atk_kr=(int)($d6*10/100)+$atk_kr;}
if((int)$th6[6]==2){ $atk_kr=(int)($d6*20/100)+$atk_kr;}
if((int)$th6[6]==3){ $atk_kr=(int)($d6*30/100)+$atk_kr;}
if((int)$th6[6]==19){ $atk_kr=(int)($d6*40/100)+$atk_kr;}

if((int)$th6[6]==4){ $def_kr=(int)($d6*7/100)+$def_kr;}
if((int)$th6[6]==5){ $def_kr=(int)($d6*14/100)+$def_kr;}
if((int)$th6[6]==6){ $def_kr=(int)($d6*21/100)+$def_kr;}
if((int)$th6[6]==20){ $def_kr=(int)($d6*28/100)+$def_kr;}

if((int)$th6[6]==7){ $mdef_kr=(int)(sqrt($d6*10*1.7/100))+$mdef_kr;}
if((int)$th6[6]==8){ $mdef_kr=(int)(sqrt($d6*15*1.7/100))+$mdef_kr;}
if((int)$th6[6]==9){ $mdef_kr=(int)(sqrt($d6*20*1.7/100))+$mdef_kr;}
if((int)$th6[6]==21){ $mdef_kr=(int)(sqrt($d6*25*1.7/100))+$mdef_kr;}

if((int)$th6[6]==10){ $hp_kr=(int)($d6*10/100)+$hp_kr;}
if((int)$th6[6]==11){ $hp_kr=(int)($d6*20/100)+$hp_kr;}
if((int)$th6[6]==12){ $hp_kr=(int)($d6*30/100)+$hp_kr;}
if((int)$th6[6]==22){ $hp_kr=(int)($d6*40/100)+$hp_kr;}

if((int)$th6[6]==13){ $int_kr=(int)($d6*3/100)+$int_kr;}
if((int)$th6[6]==14){ $int_kr=(int)($d6*4/100)+$int_kr;}
if((int)$th6[6]==15){ $int_kr=(int)($d6*5/100)+$int_kr;}
if((int)$th6[6]==23){ $int_kr=(int)($d6*6/100)+$int_kr;}

if((int)$th6[6]==16){ $m_kr=(int)($d6*4/100)+$m_kr;}
if((int)$th6[6]==17){ $m_kr=(int)($d6*8/100)+$m_kr;}
if((int)$th6[6]==18){ $m_kr=(int)($d6*12/100)+$m_kr;}
if((int)$th6[6]==24){ $m_kr=(int)($d6*16/100)+$m_kr;}
}} else $d6=0;

$def=(int)$def1+(int)$d1+(int)$d2+(int)$d4+(int)$d5+(int)$d6+$def_kr;

$lvl=1;
$ia=0;
$aa=0;
while($ia==0){
$aa=$aa+40*$lvl;
if($post>=$aa) $lvl=$lvl+1; else $ia=1;
}
$npost=$aa-$post;
if($class!=1) $hp=16+9*$lvl; else $hp=16+14*$lvl;
$hp=$hp+$hp_kr;
$str=3+$lvl*3+$atk_kr;
$mdef=$mdef_kr;
$ind=0;

$aad1=@explode(".",$art1);
if(!isset($aad1[1])){
$art1=0;
$aad1[0]=0;
$aad1[1]=0;
$aad1[2]=0;
$aad1[3]=0;
$aad1[4]=0;
$aad1[5]=0;}
$kuku=(int)$aad1[3];
$obsh=((int)$aad1[2]+$kuku/4+(int)$aad1[4])/5.5;
$obsh1=(int)$obsh;
if($obsh1==0) $obsh1=1;

$aad2=@explode(".",$art2);
if(!isset($aad2[1])){
$art2=0;
$aad2[0]=0;
$aad2[1]=0;
$aad2[2]=0;
$aad2[3]=0;
$aad2[4]=0;
$aad2[5]=0;}
$kuku=(int)$aad2[3];
$obsh=((int)$aad2[2]+$kuku/4+(int)$aad2[4])/5.5;
$obsh2=(int)$obsh;
if($obsh2==0) $obsh2=1;

$aad3=@explode(".",$art3);
if(!isset($aad3[1])){
$art3=0;
$aad3[0]=0;
$aad3[1]=0;
$aad3[2]=0;
$aad3[3]=0;
$aad3[4]=0;
$aad3[5]=0;}
$kuku=(int)$aad3[3];
$obsh=((int)$aad3[2]+$kuku/4+(int)$aad3[4])/5.5;
$obsh3=(int)$obsh;
if($obsh3==0) $obsh3=1;

$aad4=@explode(".",$art4);
if(!isset($aad4[1])){
$art4=0;
$aad4[0]=0;
$aad4[1]=0;
$aad4[2]=0;
$aad4[3]=0;
$aad4[4]=0;
$aad4[5]=0;}
$kuku=(int)$aad4[3];
$obsh=((int)$aad4[2]+$kuku/4+(int)$aad4[4])/5.5;
$obsh4=(int)$obsh;
if($obsh3==0) $obsh3=1;

$artnaz1=$aad1[0];
$artimg1=$aad1[1];
$artnaz2=$aad2[0];
$artimg2=$aad2[1];
$artnaz3=$aad3[0];
$artimg3=$aad3[1];
$artnaz4=$aad4[0];
$artimg4=$aad4[1];

if($obsh1<=$lvl){
$str=$str+(int)$aad1[2];
$hp=$hp+(int)$aad1[3];
$ind=$ind+(int)$aad1[4];}

if($obsh2<=$lvl){
$str=$str+(int)$aad2[2];
$hp=$hp+(int)$aad2[3];
$ind=$ind+(int)$aad2[4];}

if($obsh3<=$lvl){
$str=$str+(int)$aad3[2];
$hp=$hp+(int)$aad3[3];
$ind=$ind+(int)$aad3[4];}

if($obsh4<=$lvl){
$str=$str+(int)$aad4[2];
$hp=$hp+(int)$aad4[3];
$ind=$ind+(int)$aad4[4];}

$str=$str+(int)$d3;

$newl=0;
$gg=mysql_query("SELECT * FROM dop WHERE nick=\"$nick\" LIMIT 1");
$ggg=mysql_fetch_array($gg);
$n_zags=$ggg['zags'];
$ssb=$ggg['letters'];
if($ssb!=''){$let=@explode(":|||:",$ssb);
$new=count($let);
$newl=1;} else $new=0;

$sql=mysql_query("SELECT * FROM skills WHERE nick=\"$nick\"") or die('error');
$row=mysql_fetch_array($sql);
$int=$int_kr+$lvl;
$i=1;
$k=$row['skill_i']/3;
if($k>0){while($i<=$k){$int=$int+4+$i; $i++;}}
$ind=$ind+$int+$m_kr;
if($tmp>$ind) $tmp=$ind;
if($tmp<0)$tmp=0;
$i=1;
$k=$row['skill_h']/3;
if($k>0){while($i<=$k){$hp=$hp+8+$i*4; $i++;}}
$i=1;
$k=$row['skill_s']/3;
if($k>0){while($i<=$k){$str=$str+4+$i; $i++;}}

if($class==1){

if($row['skill2']==10) $hp=(int)($hp*106/100);
if($row['skill2']==21) $hp=(int)($hp*112/100);
if($row['skill2']==33) $hp=(int)($hp*118/100);
if($row['skill2']==46) $hp=(int)($hp*124/100);
if($row['skill2']==60) $hp=(int)($hp*130/100);

if($row['skill4']==20) $str=(int)($str*108/100);
if($row['skill4']==41) $str=(int)($str*116/100);
if($row['skill4']==63) $str=(int)($str*124/100);
if($row['skill4']==86) $str=(int)($str*132/100);
if($row['skill4']==110) $str=(int)($str*140/100);

if($row['skill1']==5) $pas_aur=6;
if($row['skill1']==11) $pas_aur=12;
if($row['skill1']==18) $pas_aur=18;
if($row['skill1']==26) $pas_aur=24;
if($row['skill1']==35) $pas_aur=30;

if($row['skill1']>0) $aur1=1;
if($row['skill2']>0) $aur2=1;
if($row['skill4']>0) $aur4=1;
}

if($class==2){

if($row['skill1']==5){ $str=(int)($str*106/100); $aur1=1;}
if($row['skill1']==11){ $str=(int)($str*112/100); $aur1=1;}
if($row['skill1']==18){ $str=(int)($str*118/100); $aur1=1;}
if($row['skill1']==26){ $str=(int)($str*124/100); $aur1=1;}
if($row['skill1']==35){ $str=(int)($str*130/100); $aur1=1;}

if($row['skill2']==10){ $pas_aur=12; $aur2=1;}
if($row['skill2']==21){ $pas_aur=24; $aur2=1;}
if($row['skill2']==33){ $pas_aur=36; $aur2=1;}
if($row['skill2']==46){ $pas_aur=48; $aur2=1;}
if($row['skill2']==60){ $pas_aur=60; $aur2=1;}

if($row['skill4']>20 && $row['time4']>$bac) {$aur4=1; $mdef=$mdef+10; $def=(int)($def*11/10); $str=(int)($str*12/10);}
}

if($class==3){

if($row['skill3']>0 && $row['time3']>$bac) $aur3=1;
if($row['skill2']==10){ $pas_aur=12; $aur2=1;}
if($row['skill2']==21){ $pas_aur=24; $aur2=1;}
if($row['skill2']==33){ $pas_aur=36; $aur2=1;}
if($row['skill2']==46){ $pas_aur=48; $aur2=1;}
if($row['skill2']==60){ $pas_aur=60; $aur2=1;}
}

if($class==4){
$neg=0;
if($row['skill4']==20){ $neg=4; $aur4=1;}
if($row['skill4']==41){ $neg=8; $aur4=1;}
if($row['skill4']==63){ $neg=12; $aur4=1;}
if($row['skill4']==86){ $neg=16; $aur4=1;}
if($row['skill4']==110){ $neg=20; $aur4=1;}

if($row['skill1']==5){ $pas_aur=12; $aur1=1;}
if($row['skill1']==11){ $pas_aur=24; $aur1=1;}
if($row['skill1']==18){ $pas_aur=36; $aur1=1;}
if($row['skill1']==26){ $pas_aur=48; $aur1=1;}
if($row['skill1']==35){ $pas_aur=60; $aur1=1;}
}

if($class==5){

if($row['skill1']==5 && $row['time1']>$bac){ $aur1=1; $def=(int)($def*21/20);}
if($row['skill1']==11 && $row['time1']>$bac){ $aur1=1; $def=(int)($def*11/10);}
if($row['skill1']==18 && $row['time1']>$bac){ $aur1=1; $def=(int)($def*23/20);}
if($row['skill1']==26 && $row['time1']>$bac){ $aur1=1; $def=(int)($def*6/5);}
if($row['skill1']==35 && $row['time1']>$bac){ $aur1=1; $def=(int)($def*5/4);}

if($row['skill4']==20 && $row['time4']>$bac){ $aur4=1; $mdef=$mdef+10;}
if($row['skill4']==41 && $row['time4']>$bac){ $aur4=1; $mdef=$mdef+20;}
if($row['skill4']==63 && $row['time4']>$bac){ $aur4=1; $mdef=$mdef+30;}
if($row['skill4']==86 && $row['time4']>$bac){ $aur4=1; $mdef=$mdef+40;}
if($row['skill4']==110 && $row['time4']>$bac){ $aur4=1; $mdef=$mdef+50;}

if($row['skill2']==10){ $pas_aur=12; $aur2=1;}
if($row['skill2']==21){ $pas_aur=24; $aur2=1;}
if($row['skill2']==33){ $pas_aur=36; $aur2=1;}
if($row['skill2']==46){ $pas_aur=48; $aur2=1;}
if($row['skill2']==60){ $pas_aur=60; $aur2=1;}
}

if($class==6){
if($row['skill5']>0 && $row['time5']>0) $aur5=1;
}

$sson=0;
if($row['bad1']>$bac) $sson=1;

if ($chas=="день" && $rep>5&& $str>=5) $str=$str+(int)($str*1/5);
if($chas=="ночь" && $rep<-5 && $str>=5)$str=$str+(int)($str*1/5);

if($mdef>85) $mdef=85;
if($thp>$hp) $thp=$hp;
if($post<0) $post=0;

if($thp<=0){ $timen=$bac-$time; $tim=240-$timen;
if($timen<240){
echo'<html><head><title>Лечение</title>';
require"css.php";
echo'</head><body><div class=kto>Бoльницa</div>';
echo"Ceйчac вaш пepcoнaж нaxoдитcя нa лeчeнии. Дo oкoнчaния ocтaлocь $tim(ceк).
<br>* * * * *<br>
<a href=\"index.php?ses=$ses&amp;mt=$mt\">oбнoвить</a><br>* * * * *<br>
<a href=\"death.php?ses=$ses&amp;mt=$mt\"><font color=\"red\">*преисподня*</font></a><br>
<a href=\"forum/index.php?ses=$ses&amp;mt=$mt\"><font color=\"green\">форум</font></a><br>
<a href=\"bibl.php?ses=$ses&amp;mt=$mt\">почитать библиотеку</a>
<br>* * * * *<br>
<div class=kto><a href=\"log.php\">выxoд на главную</a></div></body></html>"; $lok=0;
mysql_query("UPDATE users SET lok=\"$lok\", online=\"$online\" WHERE ses=\"$ses\"")or die('error'); exit;
} else $thp=$hp;
}

$tm=$bac-$time;
if(isset($numb)) $numb=(int)(htmlspecialchars(stripslashes($numb))); else $numb=$lok;
if($thp>0 && $lok!=0 && $lok!=$numb && $lok!=10 && $lok!=30 && $lok!=31 && $lok<500 && $sson==1){ $echo="0:||:<div class=death>$nick, на вас действует эффект сна!</div>\r\n"; $mon=@file("room$lok.dat"); $zis=sizeof($mon); $mon[$zis]=$echo; $o=@implode("",$mon); $n=@fopen("room$lok.dat","w"); fputs($n,$o); fclose($n); header("Location:room$lok.php?ses=$ses&amp;mt=$mt"); exit;}
if($thp>0 && $lok!=0 && $lok!=$numb && $lok!=10 && $tm<=40 && $lok!=30 && $lok!=31 && $lok<500){ $tm1=40-$tm; $echo="0:||:<div class=dv>$nick тaймayт движeния $tm1 ceк.</div>\r\n"; $mon=@file("room$lok.dat"); $zis=sizeof($mon); $mon[$zis]=$echo; $o=@implode("",$mon); $n=@fopen("room$lok.dat","w"); fputs($n,$o); fclose($n); header("Location:room$lok.php?ses=$ses&amp;mt=$mt"); exit;}
$lok=$numb;

if($thp>0){ $sql=mysql_query("SELECT * FROM dop WHERE nick=\"$nick\"") or die ('error');
$mak=mysql_fetch_array($sql);
if($mak['bots']!=''){
if($lok==10){
$jgj=$mak['bots'];
$nex=@explode(":||:",$jgj);
$nick2=$nex[0];
$lvl2=(int)$nex[1];
$str2=(int)$nex[2];
$thp2=(int)$nex[3];
$post2=(int)$nex[4];
$local2=(int)$nex[5];}
else { header("Location:bot.php?ses=$ses&amp;mt=$mt"); exit;}
}}
} else {header("Location:log.php"); exit;}
mysql_query("UPDATE users SET lok=\"$lok\", online=\"$online\" WHERE ses=\"$ses\"")or die('error'); ?>