Файл: skill.php
Строк: 109
<?php
include_once("files/zag.php");
include_once("files/ini.php");
$polz=mysql_query("SELECT * FROM `users` WHERE `udata0`='$log' AND `udata1`='$pas' LIMIT 1");
if(mysql_num_rows($polz)==0){
header ("Location: index.php?error");
echo'<div class="p">Ошибка! Пользователь с таким логином и паролем не зарегистрирован, или пароль/логин неверен! <a href="index.php">На главную</a><br>';exit;
}else{
$go = htmlspecialchars(stripslashes(addslashes($go)));
$polz2=mysql_query("SELECT * FROM `mags` WHERE `id`='$go' LIMIT 1");
$riba1=mysql_fetch_array($polz2);
$polz1=mysql_query("SELECT * FROM `mag` WHERE `mag8`='$riba1[mag14]' AND `mag11`='$riba1[mag17]' AND `mag10`='$log' LIMIT 1 ");
$riba=mysql_num_rows($polz1);
if($riba==1){
echo"Эта магия у вас уже изучена.";
include_once"files/down.php";
exit;}
//if($riba1[mag6]==$udata33 or $riba1[mag7]==$udata33 or $riba1[mag8]==$udata33 or $riba1[mag9]==$udata33 or $riba1[mag10]==$udata33){
$ttest=mysql_query("SELECT * FROM `skil` WHERE `login`='$log' AND `skil`='$riba1[mag14]' AND `lvl`='$riba1[mag17]' LIMIT 1 ");
$ttt=mysql_num_rows($ttest);
//if($ttt==0){echo"Ошибка."; include_once"files/down.php"; exit;}
if($udata9<$riba1[mag16]){echo"Ошибка."; include_once"files/down.php"; exit;}
if($udata31<$riba1[mag3]){echo"Нехватает SP."; include_once"files/down.php"; exit;}
mysql_query("DELETE FROM `mag` WHERE `mag10`='$log' AND `mag8`='$riba1[mag14]' ");
$udata31=$udata31-$riba1[mag3];
$lvl=$riba1[mag17]+1;
mysql_query("UPDATE `skil` SET `lvl`='$lvl' WHERE `skil`='$riba1[mag14]' and `login`='$log' ");
mysql_query("UPDATE `users` SET `udata31`='$udata31' WHERE `udata0`='$log'");
mysql_query("INSERT INTO `mag` VALUES ('', '$riba1[mag0]', '$riba1[mag1]', '$riba1[mag2]' , '$riba1[mag3]' , '$riba1[mag4]' , '$riba1[mag5]' , '' , '$riba1[mag13]', '$riba1[mag14]', '$riba1[mag15]', '$log', '$riba1[mag17]', '$riba1[mag18]', '$riba1[mag19]', '$riba1[mag20]', '$riba1[mag21]', '$riba1[mag22]', '$riba1[mag23]' )") or die(mysql_error());
if($riba1[mag5]=="addallhp"){
$udata17=50+$udata17;
mysql_query("UPDATE `users` SET `udata17`='$udata17' WHERE `udata0`='$log'");
}
if($riba1[mag5]=="magadd"){
$udata82=5+$udata82;
mysql_query("UPDATE `users` SET `udata82`='$udata82' WHERE `udata0`='$log'");
}
if($riba1[mag5]=="addallmp"){
$udata30=50+$udata30;
mysql_query("UPDATE `users` SET `udata30`='$udata30' WHERE `udata0`='$log'");
}
if($riba1[mag5]=="addhpadd"){
$h=mysql_query("SELECT * FROM `addhpmp` WHERE `login`='$log' and `tip`='hp' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `addhpmp` VALUES ('1', 'hp', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+1;
mysql_query("UPDATE `addhpmp` SET `kol`='$kol' WHERE `login`='$log' AND `tip`='hp' ");}
}
if($riba1[mag5]=="addmpadd"){
$h=mysql_query("SELECT * FROM `addhpmp` WHERE `login`='$log' and `tip`='mp' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `addhpmp` VALUES ('1', 'mp', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+1;
mysql_query("UPDATE `addhpmp` SET `kol`='$kol' WHERE `login`='$log' AND `tip`='mp' ");}
}
if($riba1[mag5]=="addkop"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='5' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', '5', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='5' ");}
}
if($riba1[mag5]=="addrapira"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='9' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', '9', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='9' ");}
}
if($riba1[mag5]=="addme4"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='1' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', '1', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='1' ");}
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='3' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', '3', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='3' ");}
}
if($riba1[mag5]=="addlyk"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='2' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', '2', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='2' ");}
}
if($riba1[mag5]=="addknife"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='4' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', '4', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='4' ");}
}
if($riba1[mag5]=="addkastet"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='6' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', '6', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='6' ");}
}
if($riba1[mag5]=="addatk"){
$udata4=$udata4+10;
mysql_query("UPDATE `users` SET `udata4`='$udata4' WHERE `udata0`='$log' ");
}
if($riba1[mag5]=="addzashita"){
$udata3=$udata3+10;
mysql_query("UPDATE `users` SET `udata3`='$udata3' WHERE `udata0`='$log' ");
}
if($riba1[mag5]=="addatkmatk"){
$udata4=$udata4+10;
$udata83=$udata83+10;
mysql_query("UPDATE `users` SET `udata4`='$udata4', `udata83`='$udata83' WHERE `udata0`='$log' ");
}
if($riba1[mag5]=="addlitle"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='light' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', 'light', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='light' ");}
}
if($riba1[mag5]=="addbig"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='heavy' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', 'heavy', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='heavy' ");}
}
if($riba1[mag5]=="addmag"){
$h=mysql_query("SELECT * FROM `bonusstats` WHERE `login`='$log' and `vid`='magic' LIMIT 1");
$hp=mysql_fetch_array($h);
$hp1=mysql_num_rows($h);
if($hp1==0){
mysql_query("INSERT INTO `bonusstats` VALUES ('', '5', 'magic', '$log')") or die(mysql_error());}
else{
$kol=$hp[kol]+5;
mysql_query("UPDATE `bonusstats` SET `kol`='$kol' WHERE `login`='$log' AND `vid`='magic' ");}
}
echo"Вы выучили скил $riba1[mag14]";
//}else{echo"Ошибка!";}
}
include_once"files/down.php";
?>