<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">

<head><meta http-equiv='content-type' content='application/xhtml+xml; charset=windows-1251'/>
<link rel="shortcut icon" href="ico.ico" type="image/x-icon" />
<title>Кантарес</title>
<link rel="stylesheet" href="../styleN.css" type="text/css" />
</head>
<body>
<div class="footto">
<?
$d=$_GET['d'];
$useswords=mysql_query("SELECT * FROM seconskills WHERE NICK_SSKILLS=\"$NICK\" AND KEY_SSKILLS=\"usebow\"");
#Луки
$BOW=mysql_query("SELECT * FROM inv WHERE ID_IL=\"$idT\" AND IL_CLASS=\"bow\" AND ID_USERS=\"$NICK\"");
#Арбалеты
$CROSSBOW=mysql_query("SELECT * FROM inv WHERE ID_IL=\"$idT\" AND IL_CLASS=\"crossbow\" AND ID_USERS=\"$NICK\"");

$usesw2=mysql_fetch_assoc($useswords);
$tochS=mysql_query("SELECT * FROM users WHERE NICK=\"$NICK\"");
$tochS2=mysql_fetch_assoc($tochS);

if($usesw2[LVL_SSKILLS]==7){
echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a>".'<br/>ваше мастерство владения стрелковым оружием на максимальном уровне';die;}
if($d=='1'){
if($tochS2[money]<350 AND mysql_num_rows($useswords)<1){echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>недостаточно золото";die;}
if($tochS2[money]<700 AND $usesw2[LVL_SSKILLS]==1){echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>недостаточно золото";die;}
if($tochS2[money]<1050 AND $usesw2[LVL_SSKILLS]==2){echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>недостаточно золото";die;}
if($tochS2[money]<1400 AND $usesw2[LVL_SSKILLS]==3){echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>недостаточно золото";die;}
if($tochS2[money]<1750 AND $usesw2[LVL_SSKILLS]==4){echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>недостаточно золото";die;}
if($tochS2[money]<2100 AND $usesw2[LVL_SSKILLS]==5){echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>недостаточно золото";die;}
if($tochS2[money]<2450 AND $usesw2[LVL_SSKILLS]==6){echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>недостаточно золото";die;}
echo"<a href=\"game.php?NICK=$NICK&pass=$pass\">в игру</a><br/>".'вы стали лучше обращаться с стрелковым оружием<br/>
владение стрелковым оружием +1<br/>
золото -
';
if(mysql_num_rows($useswords)<1){echo' 350';
$usSWIN=mysql_query("INSERT INTO seconskills (NAME_SSKILLS,NICK_SSKILLS,LVL_SSKILLS,KEY_SSKILLS) VALUES ('стрелковое оружие','$NICK','1','usebow')");
$toch=$tochS2[U_TOCH]+10;
$money=$tochS2[money]-350;
if(mysql_num_rows($BOW)>0 OR mysql_num_rows($CROSSBOW)>0){
$TOCH=mysql_query("UPDATE users SET U_TOCH=\"$toch\" WHERE NICK=\"$NICK\"");}
$money=mysql_query("UPDATE users SET money=\"$money\" WHERE NICK=\"$NICK\"");
}
if(mysql_num_rows($useswords)>0){

if($usesw2[LVL_SSKILLS]==1){echo' 700';


$toch=$tochS2[U_TOCH]+10;
$money=$tochS2[money]-700;
$LVLSK=$usesw2[LVL_SSKILLS]+1;
$usSWIN=mysql_query("UPDATE seconskills SET LVL_SSKILLS=\"$LVLSK\" WHERE NICK_SSKILLS=\"$NICK\"");
if(mysql_num_rows($BOW)>0 OR mysql_num_rows($CROSSBOW)>0){
$TOCH=mysql_query("UPDATE users SET U_TOCH=\"$toch\" WHERE NICK=\"$NICK\"");}
$money=mysql_query("UPDATE users SET money=\"$money\" WHERE NICK=\"$NICK\"");
}
if($usesw2[LVL_SSKILLS]==2){echo' 1050';

$toch=$tochS2[U_TOCH]+10;
$money=$tochS2[money]-1050;
$LVLSK=$usesw2[LVL_SSKILLS]+1;
$usSWIN=mysql_query("UPDATE seconskills SET LVL_SSKILLS=\"$LVLSK\" WHERE NICK_SSKILLS=\"$NICK\"");
if(mysql_num_rows($BOW)>0 OR mysql_num_rows($CROSSBOW)>0){
$TOCH=mysql_query("UPDATE users SET U_TOCH=\"$toch\" WHERE NICK=\"$NICK\"");}
$money=mysql_query("UPDATE users SET money=\"$money\" WHERE NICK=\"$NICK\"");
}
if($usesw2[LVL_SSKILLS]==3){echo' 1400';
$toch=$tochS2[U_TOCH]+10;
$money=$tochS2[money]-1400;
$LVLSK=$usesw2[LVL_SSKILLS]+1;
$usSWIN=mysql_query("UPDATE seconskills SET LVL_SSKILLS=\"$LVLSK\" WHERE NICK_SSKILLS=\"$NICK\"");
if(mysql_num_rows($BOW)>0 OR mysql_num_rows($CROSSBOW)>0){
$TOCH=mysql_query("UPDATE users SET U_TOCH=\"$toch\" WHERE NICK=\"$NICK\"");}
$money=mysql_query("UPDATE users SET money=\"$money\" WHERE NICK=\"$NICK\"");
}
if($usesw2[LVL_SSKILLS]==4){echo' 1750';
$toch=$tochS2[U_TOCH]+10;
$money=$tochS2[money]-1750;
$LVLSK=$usesw2[LVL_SSKILLS]+1;
$usSWIN=mysql_query("UPDATE seconskills SET LVL_SSKILLS=\"$LVLSK\" WHERE NICK_SSKILLS=\"$NICK\"");
if(mysql_num_rows($BOW)>0 OR mysql_num_rows($CROSSBOW)>0){
$TOCH=mysql_query("UPDATE users SET U_TOCH=\"$toch\" WHERE NICK=\"$NICK\"");}
$money=mysql_query("UPDATE users SET money=\"$money\" WHERE NICK=\"$NICK\"");
}
if($usesw2[LVL_SSKILLS]==5){echo' 2100';
$toch=$tochS2[U_TOCH]+10;
$money=$tochS2[money]-2100;
$LVLSK=$usesw2[LVL_SSKILLS]+1;
$usSWIN=mysql_query("UPDATE seconskills SET LVL_SSKILLS=\"$LVLSK\" WHERE NICK_SSKILLS=\"$NICK\"");
if(mysql_num_rows($BOW)>0 OR mysql_num_rows($CROSSBOW)>0){
$TOCH=mysql_query("UPDATE users SET U_TOCH=\"$toch\" WHERE NICK=\"$NICK\"");}
$money=mysql_query("UPDATE users SET money=\"$money\" WHERE NICK=\"$NICK\"");
}
if($usesw2[LVL_SSKILLS]==6){echo' 2450';
$toch=$tochS2[U_TOCH]+10;
$money=$tochS2[money]-2450;
$LVLSK=$usesw2[LVL_SSKILLS]+1;
$usSWIN=mysql_query("UPDATE seconskills SET LVL_SSKILLS=\"$LVLSK\" WHERE NICK_SSKILLS=\"$NICK\"");
if(mysql_num_rows($BOW)>0 OR mysql_num_rows($CROSSBOW)>0){
$TOCH=mysql_query("UPDATE users SET U_TOCH=\"$toch\" WHERE NICK=\"$NICK\"");}
$money=mysql_query("UPDATE users SET money=\"$money\" WHERE NICK=\"$NICK\"");
}
}
die;}
echo"
<font color=\"lime\">
<a href=\"game.php?NICK=$aNickName&pass=$pass\"><img src=\"img/al.png\"> в игру</a>
<br/>
<img src=\"img/stell.jpeg\" height=\"108\" width=\"74\"/>
<br/>стоимость обучения составит

";
if($usesw2[LVL_SSKILLS]==1){echo" 700 золото";}
if($usesw2[LVL_SSKILLS]==2){echo" 1050 золото";}
if($usesw2[LVL_SSKILLS]==3){echo" 1400 золото";}
if($usesw2[LVL_SSKILLS]==4){echo" 1750 золото";}
if($usesw2[LVL_SSKILLS]==5){echo" 2100 золото";}
if($usesw2[LVL_SSKILLS]==6){echo" 2450 золото";}
echo"
<br/>
<img src=\"img/chat.png\" height=\"12\" width=\"12\">  <a href=\"game.php?NICK=$aNickName&pass=$pass&speak=stell&id=stell_learn&d=1\">Ок,по рукам</a><br/>
<img src=\"img/chat.png\" height=\"12\" width=\"12\"> <a href=\"game.php?NICK=$aNickName&pass=$pass&speak=stell&id=stell_end\">Ты с дуба рухнул чтоли? Давай дешевле!</a><br/>
<img src=\"img/chat.png\" height=\"12\" width=\"12\"> <a href=\"game.php?NICK=$aNickName&pass=$pass&speak=stell&id=stell_end\">Вернусь когда накоплю</a>

</div>
</body>
</html>";
die;

?>
