Файл: kyzn.php
Строк: 788
<?
define('PROTECTOR', 1);
include('files/db.php');
include($path.'files/auth.php');
if ($user_id==0){
header('location: index.php');exit;
}
$textl='Кузнец';
include($path.'files/core.php');
$mobs1=mysql_query("SELECT * FROM `arena_usr` WHERE `usr`='".$udata['id']."'");
$rows1=mysql_num_rows($mobs1);
if($rows1!=0)
{
header('location: arena.php');exit;
}
$mobs2=mysql_query("SELECT * FROM `avan_usr` WHERE `usr`='".$udata['id']."'");
$rows2=mysql_num_rows($mobs2);
if($rows2!=0)
{
header('location: avan.php');exit;
}
$mobs3=mysql_query("SELECT * FROM `battle` WHERE `usr`='".$udata['id']."'");
$rows3=mysql_num_rows($mobs3);
if($rows3!=0)
{
header('location: battle.php');exit;
}
$mobs4=mysql_query("SELECT * FROM `ohota` WHERE `usr`='".$udata['id']."'");
$rows4=mysql_num_rows($mobs4);
if($rows4!=0)
{
header('location: b_oh.php');exit;
}
$mobs5=mysql_query("SELECT * FROM `okr_usr` WHERE `usr`='".$udata['id']."'");
$rows5=mysql_num_rows($mobs5);
if($rows5!=0)
{
header('location: b_okr.php');exit;
}
$mobs6=mysql_query("SELECT * FROM `str_usr` WHERE `usr`='".$udata['id']."'");
$rows6=mysql_num_rows($mobs6);
if($rows6!=0)
{
header('location: b_str.php');exit;
}
$mobs7=mysql_query("SELECT * FROM `terr_usr` WHERE `usr`='".$udata['id']."'");
$rows7=mysql_num_rows($mobs7);
if($rows7!=0)
{
header('location: terr_b.php');exit;
}
if(isset($_GET['b1']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<100 or $udata['fm']<15)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-100;
$fm=$udata['fm']-15;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+5;
$cena=$avto['cena']+50;
mysql_query("UPDATE `item` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='1' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='1' WHERE `id`='".$avto['id_gi']."'");
}
$dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b2']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<200 or $udata['fm']<40)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-200;
$fm=$udata['fm']-40;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+10;
$cena=$avto['cena']+100;
mysql_query("UPDATE `item` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='2' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='2' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b3']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<400 or $udata['fm']<100)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-400;
$fm=$udata['fm']-100;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+15;
$cena=$avto['cena']+200;
mysql_query("UPDATE `item` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='3' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='3' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b4']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<800 or $udata['fm']<300)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-800;
$fm=$udata['fm']-300;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+20;
$cena=$avto['cena']+350;
mysql_query("UPDATE `item` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='4' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `arm`='".$arm."', `cena`='".$cena."', `mist`='4' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b5']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<100 or $udata['fm']<15)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-100;
$fm=$udata['fm']-15;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['sila']+5;
$cena=$avto['cena']+50;
mysql_query("UPDATE `item` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='5' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='5' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b6']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<200 or $udata['fm']<40)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-200;
$fm=$udata['fm']-40;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['sila']+10;
$cena=$avto['cena']+100;
mysql_query("UPDATE `item` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='6' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='6' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b7']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<400 or $udata['fm']<100)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-400;
$fm=$udata['fm']-100;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['sila']+15;
$cena=$avto['cena']+200;
mysql_query("UPDATE `item` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='7' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='7' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b8']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<800 or $udata['fm']<300)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-800;
$fm=$udata['fm']-300;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['sila']+20;
$cena=$avto['cena']+350;
mysql_query("UPDATE `item` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='8' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `sila`='".$arm."', `cena`='".$cena."', `mist`='8' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b9']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<100 or $udata['fm']<15)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-100;
$fm=$udata['fm']-15;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['hp']+5;
$cena=$avto['cena']+50;
mysql_query("UPDATE `item` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='9' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='9' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b10']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<200 or $udata['fm']<40)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-200;
$fm=$udata['fm']-40;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['hp']+10;
$cena=$avto['cena']+100;
mysql_query("UPDATE `item` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='10' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='10' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b11']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<400 or $udata['fm']<100)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-400;
$fm=$udata['fm']-100;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['hp']+15;
$cena=$avto['cena']+200;
mysql_query("UPDATE `item` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='11' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='11' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b12']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<800 or $udata['fm']<300)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-800;
$fm=$udata['fm']-300;
mysql_query("UPDATE `users` SET `money`='".$mon."', `fm`='".$fm."' WHERE `id`='".$udata['id']."'");
$arm=$avto['hp']+20;
$cena=$avto['cena']+350;
mysql_query("UPDATE `item` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='12' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$arm."', `cena`='".$cena."', `mist`='12' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b13']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['jem']<5)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['jem']-5;
mysql_query("UPDATE `users` SET `jem`='".$mon."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+5;
$sila=$avto['sila']+5;
$hp=$avto['hp']+5;
$cena=$avto['cena']+500;
mysql_query("UPDATE `item` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='13' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='13' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b14']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['jem']<10)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['jem']-5;
mysql_query("UPDATE `users` SET `jem`='".$mon."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+10;
$sila=$avto['sila']+10;
$hp=$avto['hp']+10;
$cena=$avto['cena']+1500;
mysql_query("UPDATE `item` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='14' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='14' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b15']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['jem']<20)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['jem']-20;
mysql_query("UPDATE `users` SET `jem`='".$mon."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+15;
$sila=$avto['sila']+15;
$hp=$avto['hp']+15;
$cena=$avto['cena']+4000;
mysql_query("UPDATE `item` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='15' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='15' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b16']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['jem']<40)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['jem']-40;
mysql_query("UPDATE `users` SET `jem`='".$mon."' WHERE `id`='".$udata['id']."'");
$arm=$avto['arm']+20;
$sila=$avto['sila']+20;
$hp=$avto['hp']+20;
$cena=$avto['cena']+8000;
mysql_query("UPDATE `item` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='16' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `cena`='".$cena."', `mist`='16' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b17']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk' or $avto['tip']=='pet1' or $avto['tip']=='pet2')
{
header('location: ?no');exit;
}
else
{
if($udata['jem']<60)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['jem']-60;
mysql_query("UPDATE `users` SET `jem`='".$mon."' WHERE `id`='".$udata['id']."'");
$hp=$avto['hp']+20;
$sila=$avto['sila']+20;
$arm=$avto['arm']+20;
$krit=$avto['krit']+1;
$cena=$avto['cena']+10000;
mysql_query("UPDATE `item` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `krit`='".$krit."', `cena`='".$cena."', `mist`='17' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `krit`='".$krit."', `cena`='".$cena."', `mist`='17' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['b18']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk' or $avto['tip']=='pet1' or $avto['tip']=='pet2')
{
header('location: ?no');exit;
}
else
{
if($udata['jem']<60)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['jem']-60;
mysql_query("UPDATE `users` SET `jem`='".$mon."' WHERE `id`='".$udata['id']."'");
$hp=$avto['hp']+20;
$sila=$avto['sila']+20;
$arm=$avto['arm']+20;
$blok=$avto['blok']+1;
$cena=$avto['cena']+10000;
mysql_query("UPDATE `item` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `blok`='".$blok."', `cena`='".$cena."', `mist`='18' WHERE `id`='".$avto['id']."'");
if($avto['id_gi']!=0)
{
mysql_query("UPDATE `tai` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `blok`='".$blok."', `cena`='".$cena."', `mist`='18' WHERE `id`='".$avto['id_gi']."'");
} $dost=mysql_fetch_array(mysql_query("SELECT * FROM `users_dost` WHERE `usr`='".$udata['id']."'"));
$dk=$dost['kyzn_exp']+1;
mysql_query("UPDATE `users_dost` SET `kyzn_exp`='".$dk."' WHERE `id`='".$dost['id']."'");
header('location: ?yes');exit;
}
}
}
if(isset($_GET['snt']))
{
$id=mysql_real_escape_string($_GET['snt']);
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`!='0' and `id`='".$id."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
header('location: ?no');exit;
}
else
{
if($udata['jem']<0)
{
header('location: ?no');exit;
}
else
{
$mon=50;
$kl=50;
if($udata['money']<$mon or $udata['kl']<$kl)
{
header('location: ?no');exit;
}else
{
$m=$udata['money']-50;
$k=$udata['kl']-50;
mysql_query("UPDATE `users` SET `money`='".$m."', `kl`='".$k."' WHERE `id`='".$udata['id']."'");
if($avto['mist']==1){$hp=$avto['hp']-0;$sila=$avto['sila']-0;$arm=$avto['arm']-5;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-50;}
if($avto['mist']==2){$hp=$avto['hp']-0;$sila=$avto['sila']-0;$arm=$avto['arm']-10;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-100;}
if($avto['mist']==3){$hp=$avto['hp']-0;$sila=$avto['sila']-0;$arm=$avto['arm']-15;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-200;}
if($avto['mist']==4){$hp=$avto['hp']-0;$sila=$avto['sila']-0;$arm=$avto['arm']-20;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-350;}
if($avto['mist']==5){$hp=$avto['hp']-0;$sila=$avto['sila']-5;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-50;}
if($avto['mist']==6){$hp=$avto['hp']-0;$sila=$avto['sila']-10;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-100;}
if($avto['mist']==7){$hp=$avto['hp']-0;$sila=$avto['sila']-15;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-200;}
if($avto['mist']==8){$hp=$avto['hp']-0;$sila=$avto['sila']-20;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-350;}
if($avto['mist']==9){$hp=$avto['hp']-5;$sila=$avto['sila']-0;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-50;}
if($avto['mist']==10){$hp=$avto['hp']-10;$sila=$avto['sila']-0;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-100;}
if($avto['mist']==11){$hp=$avto['hp']-15;$sila=$avto['sila']-0;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-200;}
if($avto['mist']==12){$hp=$avto['hp']-20;$sila=$avto['sila']-0;$arm=$avto['arm']-0;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-350;}
if($avto['mist']==13){$hp=$avto['hp']-5;$sila=$avto['sila']-5;$arm=$avto['arm']-5;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-500;}
if($avto['mist']==14){$hp=$avto['hp']-10;$sila=$avto['sila']-10;$arm=$avto['arm']-10;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-1500;}
if($avto['mist']==15){$hp=$avto['hp']-15;$sila=$avto['sila']-15;$arm=$avto['arm']-15;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-4000;}
if($avto['mist']==16){$hp=$avto['hp']-20;$sila=$avto['sila']-20;$arm=$avto['arm']-20;$krit=$avto['krit']-0;$blok=$avto['blok']-0;$cena=$avto['cena']-8000;}
if($avto['mist']==17){$hp=$avto['hp']-20;$sila=$avto['sila']-20;$arm=$avto['arm']-20;$krit=$avto['krit']-1;$blok=$avto['blok'];$cena=$avto['cena']-10000;}
if($avto['mist']==18){$hp=$avto['hp']-20;$sila=$avto['sila']-20;$arm=$avto['arm']-20;$krit=$avto['krit'];$blok=$avto['blok']-1;$cena=$avto['cena']-10000;}
if($krit<0){$krit=0;}
if($blok<0){$blok=0;}
mysql_query("UPDATE `item` SET `hp`='".$hp."', `sila`='".$sila."', `arm`='".$arm."', `krit`='".$krit."', `blok`='".$blok."', `cena`='".$cena."', `mist`='0' WHERE `id`='".$avto['id']."'");
header('location: ?yes2');exit;
}
}
}
}
if(isset($_GET['sv1']))
{
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$num=mysql_num_rows($mobs);
if($num==0)
{
header('location: ?no');exit;
}
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk' or $avto['tip']=='oplot' or $avto['tip']=='zarad' or $avto['tip']=='idol')
{
header('location: ?no');exit;
}
else
{
if($udata['money']<250)
{
header('location: ?no');exit;
}
else
{
$mon=$udata['money']-250;
mysql_query("UPDATE `users` SET `money`='".$mon."' WHERE `id`='".$udata['id']."'");
mysql_query("UPDATE `item` SET `arm`='".$arm."', `cena`='".$cena."', `sv`='1' WHERE `id`='".$avto['id']."'");
header('location: ?yes3');exit;
}
}
}
include($path.'files/head.php');
include($path.'files/zag.php');
if(isset($_GET['no']))
{
echo '<div class="bat m bts brs bls bbs p"><font color=#ff0000>Ошибка!</font>
</div>';
}
elseif(isset($_GET['yes']))
{
echo '<div class="bat m bts brs bls bbs p"><font color=#00ff00>Вы успешно улучшили вещь!</font>
</div>';
}
elseif(isset($_GET['yes2']))
{
echo '<div class="bat m bts brs bls bbs p"><font color=#00ff00>Вы успешно сняли чары с вещи!</font>
</div>';
}
echo '<table width=100%>
<tr>
<td width=35%>
<a href=game.php><div style="background: #882222; border-radius: 7px 0 0 7px" class="m p bts bbs brs bls" align=center>Главная</div></a>
</td><td>';
echo '<a href=?><div class="line bts brs bls bbs p m" style="border-radius: 0 7px 7px 0">
<font color=#ffffff>Кузнец</font>
</div></a></td></tr></table>';
echo '<div class="bat bts brs bls bbs p">';
switch($_GET['k'])
{
default:
echo '<div align=center><img src=img/inter/10.jpg></div>
<div class="v4 p"><font color=#ff9900>Здесь мощь древних рун можно нанести на свои вещи</font></div>';
echo '<img src=img/main/e28.png> <a href=?k=cr>Зачарить вещи</a><br>';
echo '<img src=img/main/e28.png> <a href=?k=sn>Снятие чар</a><br>';
break;
case 'sn':
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`!='0'");
while($avto=mysql_fetch_array($mobs))
{
if($avto['tip']=='orden' or $avto['tip']=='syndyk' or $avto['tip']=='oplot')
{
}
else
{
echo '<table><tr>';
echo '<td><img src=img/arm/'.$avto['tip'].'/'.$avto['img'].'.jpg></td>';
$kac='p28';
echo '<td><img src=img/main/'.$kac.'.png> <a href=info_arm.php?id='.$avto['id'].'>'.$avto['name'].'</a>
<img src=img/main/p10.png>'.$avto['lvl'].'
<br>';
echo '<a href=?snt='.$avto['id'].'><font color=#ff0000>снять чары</font></a> за <img src=img/main/r16.png>50 <img src=img/main/p5.png>50';
echo '</td>';
echo '</tr></table>';
}
}
break;
case 'cr':
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0'");
while($avto=mysql_fetch_array($mobs))
{
if($avto['tip']=='orden' or $avto['tip']=='syndyk' or $avto['tip']=='oplot')
{
}
else
{
echo '<table><tr>';
echo '<td><img src=img/arm/'.$avto['tip'].'/'.$avto['img'].'.jpg></td>';
$kac='p28';
echo '<td><img src=img/main/'.$kac.'.png> <a href=info_arm.php?id='.$avto['id'].'>'.$avto['name'].'</a>
<img src=img/main/p10.png>'.$avto['lvl'].'
<br>';
echo '<a href=?k=ob&id='.$avto['id'].'><font color=#ff0000>выбрать</font></a>';
echo '</td>';
echo '</tr></table>';
}
}
break;
case 'ob':
$mobs=mysql_query("SELECT * FROM `item` WHERE `status`='off' and `usr`='".$udata['id']."' and `mist`='0' and `id`='".$_GET['id']."'");
$avto=mysql_fetch_array($mobs);
if($avto['tip']=='orden' or $avto['tip']=='syndyk')
{
}
else
{
echo '<a href=?b1&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+5</b> за <img src=img/main/r17.png> 15 <img src=img/main/p5.png> 100<br>';
echo '<a href=?b2&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+10</b> за <img src=img/main/r17.png> 40 <img src=img/main/p5.png> 200<br>';
echo '<a href=?b3&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+15</b> за <img src=img/main/r17.png> 100 <img src=img/main/p5.png> 400<br>';
echo '<a href=?b4&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+20</b> за <img src=img/main/r17.png> 300 <img src=img/main/p5.png> 800<br>';
echo '<a href=?b5&id='.$avto['id'].'>улучшить</a> <img src=img/main/b8.png> <b>+5</b> за <img src=img/main/r17.png> 15 <img src=img/main/p5.png> 100<br>';
echo '<a href=?b6&id='.$avto['id'].'>улучшить</a> <img src=img/main/b8.png> <b>+10</b> за <img src=img/main/r17.png> 40 <img src=img/main/p5.png> 200<br>';
echo '<a href=?b7&id='.$avto['id'].'>улучшить</a> <img src=img/main/b8.png> <b>+15</b> за <img src=img/main/r17.png> 100 <img src=img/main/p5.png> 400<br>';
echo '<a href=?b8&id='.$avto['id'].'>улучшить</a> <img src=img/main/b8.png> <b>+20</b> за <img src=img/main/r17.png> 300 <img src=img/main/p5.png> 800<br>';
echo '<a href=?b9&id='.$avto['id'].'>улучшить</a> <img src=img/main/p3.png> <b>+5</b> за <img src=img/main/r17.png> 15 <img src=img/main/p5.png> 100<br>';
echo '<a href=?b10&id='.$avto['id'].'>улучшить</a> <img src=img/main/p3.png> <b>+10</b> за <img src=img/main/r17.png> 40 <img src=img/main/p5.png> 200<br>';
echo '<a href=?b11&id='.$avto['id'].'>улучшить</a> <img src=img/main/p3.png> <b>+15</b> за <img src=img/main/r17.png> 100 <img src=img/main/p5.png> 400<br>';
echo '<a href=?b12&id='.$avto['id'].'>улучшить</a> <img src=img/main/p3.png> <b>+20</b> за <img src=img/main/r17.png> 300 <img src=img/main/p5.png> 800<br>';
echo '<a href=?b13&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+5</b> <img src=img/main/b8.png> <b>+5</b> <img src=img/main/p3.png> <b>+5</b> за <img src=img/main/p13.png> 5<br>';
echo '<a href=?b14&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+10</b> <img src=img/main/b8.png> <b>+10</b> <img src=img/main/p3.png> <b>+10</b> за <img src=img/main/p13.png> 10<br>';
echo '<a href=?b15&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+15</b> <img src=img/main/b8.png> <b>+15</b> <img src=img/main/p3.png> <b>+15</b> за <img src=img/main/p13.png> 20<br>';
echo '<a href=?b16&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+20</b> <img src=img/main/b8.png> <b>+20</b> <img src=img/main/p3.png> <b>+20</b> за <img src=img/main/p13.png> 40<br>';
if($avto['tip']!='pet1' and $avto['tip']!='pet2'){
echo '<a href=?b17&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+20</b> <img src=img/main/b8.png> <b>+20</b> <img src=img/main/p3.png> <b>+20</b> <img src=img/main/b2.png> <b>+1%</b> за <img src=img/main/p13.png> 60<br>';
echo '<a href=?b18&id='.$avto['id'].'>улучшить</a> <img src=img/main/p2.png> <b>+20</b> <img src=img/main/b8.png> <b>+20</b> <img src=img/main/p3.png> <b>+20</b> <img src=img/main/b23.png> <b>+1%</b> за <img src=img/main/p13.png> 60<br>';
}
}
break;
}
echo '</div></div>';
include('files/down.php');
?>