2018-01-28 16:40:49 +00:00
< ? php
2020-07-06 13:22:33 +00:00
session_start ();
2020-09-30 12:01:33 +00:00
if ( $_SESSION [ 'uid' ] == null ) {
header ( " Location: index.php " );
exit ;
}
2020-07-06 13:22:33 +00:00
include " config.php " ;
include " functions.php " ;
include " startpodzemel.php " ;
2020-09-30 12:01:33 +00:00
if ( $user -> battle ) {
2020-07-06 13:22:33 +00:00
header ( 'location: fbattle.php' );
2020-09-30 12:01:33 +00:00
exit ;
2018-01-28 16:40:49 +00:00
}
2020-07-06 13:22:33 +00:00
$df = mysql_query ( " select `location`,`name`,`glava` from `labirint` where `user_id`=' " . $_SESSION [ 'uid' ] . " ' " );
$fd = mysql_fetch_array ( $df );
$cd = mysql_query ( " select `n18` from `podzem3` where `glava`=' " . $fd [ 'glava' ] . " ' and `name`='Канализация 1 этаж' " );
$vb = mysql_fetch_array ( $cd );
if ( $fd [ 'location' ] == '28' and $fd [ 'name' ] == 'Канализация 1 этаж' and $vb [ 'n18' ] == '8' ) {
?>
<! DOCTYPE html PUBLIC " -//W3C//DTD XHTML 1.0 Transitional//EN "
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
< html xmlns = " http://www.w3.org/1999/xhtml " >
< head >
< meta http - equiv = " Content-Type " content = " text/html; charset=utf-8 " />
< link rel = stylesheet type = " text/css " href = " css/main.css " >
< title > Подземка - Лука </ title >
< style >
BODY {
FONT - FAMILY : Verdana , Arial , Helvetica , sans - serif ;
font - size : 10 px ;
margin : 0 0 0 0 ;
scrollbar - face - color : #e3ac67;
scrollbar - highlight - color : #e0c3a0;
scrollbar - shadow - color : #b78d58;
scrollbar - 3 dlight - color : #b78d58;
scrollbar - arrow - color : #b78d58;
scrollbar - track - color : #e0c3a0;
scrollbar - darkshadow - color : #b78d58;
}
. menu {
z - index : 100 ;
background - color : #E4F2DF;
border - style : solid ;
border - width : 2 px ;
border - color : #77c3fc
position : absolute ;
left : 0 ;
top : 0 ;
visibility : hidden ;
cursor : hand ;
}
a . menuItem {
border : 0 solid #000000;
background - color : #484848;
color : #000000;
display : block ;
font - family : Verdana , Arial ;
font - size : 8 pt ;
font - weight : bold ;
padding : 2 px 12 px 2 px 8 px ;
text - decoration : none ;
}
a . menuItem : hover {
background - color : #d4cbaa;
color : #000000;
}
</ style >
</ head >
< body leftmargin = 0 topmargin = 0 marginwidth = 0 marginheight = 0 bgcolor = " #e2e0e0 "
onload = " top.setHP(<?= $user['hp'] ?>,<?= $user['maxhp'] ?>) " >
< div id = hint3 class = ahint ></ div >
< TABLE width = 100 % cellspacing = 0 cellpadding = 0 border = 0 >
< TR >
< TD valign = top >
< TABLE width = 250 cellspacing = 0 cellpadding = 0 >
< TR >
< TD valign = top width = 250 nowrap >
< CENTER >
< ? php
$userInfo = new User ( $_SESSION [ 'uid' ]);
$userInfo -> showUserDoll ();
2020-07-06 13:29:49 +00:00
?>
2020-07-06 13:22:33 +00:00
</ CENTER >
</ TD >
</ TR >
</ TABLE >
</ TD >
< TD >
< i >
< ?
$gag = mysql_query ( " SELECT * FROM qwest WHERE login=' " . $user [ 'login' ] . " ' " );
while ( $qw = mysql_fetch_array ( $gag )) {
$name_qwest = $qw [ " name_items " ];
if ( $name_qwest == " Ключиик " ) {
$qwest = " 1 " ;
$name_qw = " kluchiik " ;
}
}
$sasd = mysql_query ( " SELECT * FROM `qwest` WHERE `login`=' " . $user [ 'login' ] . " ' and `name_qwest`=' $name_qw ' " );
$qwus = mysql_fetch_array ( $sasd );
$qwest_status = $qwus [ " status " ];
$qwes = mysql_query ( " SELECT * FROM `inventory` WHERE type='200' and name='Ключиик' and owner= " . $user [ " id " ] . " " );
$qwesta = mysql_fetch_array ( $qwes );
if ( $qwesta ) {
$ok_qwest = " 1 " ;
}
if ( ! $_GET [ 'd' ]) {
print " Запах... ОНИ! Мою хороошую, мою чистую канализацию испортилиии... " ;
}
if ( $_GET [ 'd' ] == '1' ) {
print " О Н ... Он был тут первым... САМЫМ! Гайки, болты, вентили... чинииил... Лука помогал ему... А он... О Н ! он ПРЕДАААЛ!! Луку... ЛУКУ ОБИИИИДЕЛ! Он... он теперь не с намиии... ПОМОЙКАаа... Запаааах... Найди.. УБЕЕЙ! а .. Лука, лука даст тебе новые жетоны. Целых 3!!" ;
}
if ( $_GET [ 'd' ] == '1.1' ) {
print " Ты НАШООЛ их.? Лука хочет менять! Лука тебе даст жетоны, а ты дашь Луке ИХ! Согла-а -асен? " ;
}
if ( $qwest_status != 'ok' ) {
if ( $ok_qwest == '1' ) {
if ( $_GET [ 'd' ] == '1.2' ) {
print " О о о ... Лука рад... Лука очень благодарен тебе... Лука даст тебе подарок... Лука даст тебе одно из двух... Лука даст Гайку силы или Гайку мудрости... выбирай..." ;
}
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $ok_qwest == '1' ) {
if ( $_GET [ 'd' ] == '1.3' ) {
$sql = " INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','15','8','10','10','','3','','','','60','50','30','','','g_sila.gif',' " . $user [ 'id' ] . " ','5','5','5','5','2','2','1','41','1') " ;
$res = mysql_query ( $sql );
mysql_query ( " DELETE FROM `inventory` WHERE owner=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Ключиик' " );
mysql_query ( " UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`=' " . $user [ 'login' ] . " ' " );
if ( ! $res ) {
echo mysql_error ();
}
print " <font style='font-size:11px; color:red;'>Вы получили 'Гайку силы'.</font><br><br>
Лука говарит спасибо ... " ;
}
}
if ( $ok_qwest == '1' ) {
if ( $_GET [ 'd' ] == '1.4' ) {
$sql = " INSERT INTO `inventory`(name,duration,maxdur,cost,nlevel,nsila,nlovk,ninta,nvinos,nintel,gsila,glovk,ginta,gintel,ghp,mfkrit,mfakrit,mfuvorot,mfauvorot,img,owner,bron1,bron2,bron3,bron4,type,massa,isrep,otdel,podzem) VALUES ('Гайка силы','0','30','90','4','5','4','4','10','15','','','','3','80','','50','50','','g_mudr.gif',' " . $user [ 'id' ] . " ','5','5','5','5','2','2','1','41','1') " ;
$res = mysql_query ( $sql );
mysql_query ( " DELETE FROM `inventory` WHERE owner=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Ключиик' " );
mysql_query ( " UPDATE `qwest` SET `status`='ok' WHERE `name_qwest`='kluchiik' and `login`=' " . $user [ 'login' ] . " ' " );
if ( ! $res ) {
echo mysql_error ();
}
print " <font style='font-size:11px; color:red;'>Вы получили 'Гайку мудрости'.</font><br><br>
Лука говарит спасибо ... " ;
}
}
}
if (( $_GET [ 'd' ] == '2' ) && ( $user [ 'level' ] >= 4 ) && ( $user [ 'level' ] < 7 )) {
print " Цена-а а ? У Луки много жетонов. Лука не жаадный. Лука берет 3 Гайки и отдает жетон. Лука дает жетон за целый болт. Лука дает ТРИ жетона за найденный вентиль.<br> Лука дает жетоны серебрянные, если Гайки и Вентили Чистые, а Болт Длинный! Лука дает золотые жетоны, если Гайки с Резьбой, Вентиль Рабочий, а Болт Нужный! " ;
}
if (( $_GET [ 'd' ] == '2' ) && ( $user [ 'level' ] >= 7 ) && ( $user [ 'level' ] <= 8 )) {
print " Цена-а а ? У Луки много жетонов. Лука не жаадный. Лука берет 9 Гаек и отдает жетон. Лука дает жетон за три болта. Лука дает целый жетон за найденный вентиль.<br> Лука дает жетоны серебрянные, если Гайки и Вентили Чистые, а Болт Длинный! Лука дает золотые жетоны, если Гайки с Резьбой, Вентиль Рабочий, а Болт Нужный! " ;
}
/////////////////////
if ( $_GET [ 'd' ] == '3' ) {
$sear = mysql_query ( " SELECT maxdur,id FROM `inventory` WHERE `type`='200' and `name`='Гайка' and owner=' " . $user [ " id " ] . " ' " );
while ( $alls = mysql_fetch_array ( $sear )) {
$total_mass += $alls [ 'maxdur' ];
$alls_id = $alls [ 'id' ];
}
$vear = mysql_query ( " SELECT maxdur,id FROM `inventory` WHERE `type`='200' and `name`='Вентиль' and owner=' " . $user [ " id " ] . " ' " );
while ( $vls = mysql_fetch_array ( $vear )) {
$total_mass_v += $vls [ 'maxdur' ];
$vls_id = $vls [ 'id' ];
}
$vearb = mysql_query ( " SELECT maxdur,id FROM `inventory` WHERE `type`='200' and `name`='Болт' and owner=' " . $user [ " id " ] . " ' " );
while ( $bls = mysql_fetch_array ( $vearb )) {
$total_mass_b += $bls [ 'maxdur' ];
$bls_id = $bls [ 'id' ];
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if (( $user [ 'level' ] >= 4 ) && ( $user [ 'level' ] < 7 )) {
if ( $total_mass < 3 ) {
$vsego = " 0 " ;
$ziton = " 0 " ;
}
if ( $total_mass >= 3 ) {
$vsego = " 3 " ;
$ziton = " 1 " ;
}
if ( $total_mass >= 6 ) {
$vsego = " 6 " ;
$ziton = " 2 " ;
}
if ( $total_mass >= 9 ) {
$vsego = " 9 " ;
$ziton = " 3 " ;
}
if ( $total_mass >= 12 ) {
$vsego = " 12 " ;
$ziton = " 4 " ;
}
if ( $total_mass >= 15 ) {
$vsego = " 15 " ;
$ziton = " 5 " ;
}
if ( $total_mass >= 18 ) {
$vsego = " 18 " ;
$ziton = " 6 " ;
}
if ( $total_mass >= 21 ) {
$vsego = " 21 " ;
$ziton = " 7 " ;
}
if ( $total_mass >= 24 ) {
$vsego = " 24 " ;
$ziton = " 8 " ;
}
if ( $total_mass >= 27 ) {
$vsego = " 27 " ;
$ziton = " 9 " ;
}
if ( $total_mass >= 30 ) {
$vsego = " 30 " ;
$ziton = " 10 " ;
}
if ( $total_mass >= 33 ) {
$vsego = " 33 " ;
$ziton = " 11 " ;
}
if ( $total_mass >= 36 ) {
$vsego = " 36 " ;
$ziton = " 12 " ;
}
if ( $total_mass >= 39 ) {
$vsego = " 39 " ;
$ziton = " 13 " ;
}
if ( $total_mass >= 42 ) {
$vsego = " 42 " ;
$ziton = " 14 " ;
}
if ( $total_mass >= 45 ) {
$vsego = " 45 " ;
$ziton = " 15 " ;
}
if ( $total_mass >= 48 ) {
$vsego = " 48 " ;
$ziton = " 16 " ;
}
if ( $total_mass >= 51 ) {
$vsego = " 51 " ;
$ziton = " 17 " ;
}
if ( $total_mass >= 54 ) {
$vsego = " 54 " ;
$ziton = " 18 " ;
}
if ( $total_mass >= 57 ) {
$vsego = " 57 " ;
$ziton = " 19 " ;
}
if ( $total_mass >= 60 ) {
$vsego = " 60 " ;
$ziton = " 20 " ;
}
} elseif (( $user [ 'level' ] >= 7 ) && ( $user [ 'level' ] <= 8 )) {
if ( $total_mass < 9 ) {
$vsego = " 0 " ;
$ziton = " 0 " ;
}
if ( $total_mass >= 9 ) {
$vsego = " 9 " ;
$ziton = " 1 " ;
}
if ( $total_mass >= 18 ) {
$vsego = " 18 " ;
$ziton = " 2 " ;
}
if ( $total_mass >= 27 ) {
$vsego = " 27 " ;
$ziton = " 3 " ;
}
if ( $total_mass >= 36 ) {
$vsego = " 36 " ;
$ziton = " 4 " ;
}
if ( $total_mass >= 45 ) {
$vsego = " 45 " ;
$ziton = " 5 " ;
}
if ( $total_mass >= 54 ) {
$vsego = " 54 " ;
$ziton = " 6 " ;
}
if ( $total_mass >= 63 ) {
$vsego = " 63 " ;
$ziton = " 7 " ;
}
if ( $total_mass >= 72 ) {
$vsego = " 72 " ;
$ziton = " 8 " ;
}
if ( $total_mass >= 81 ) {
$vsego = " 81 " ;
$ziton = " 9 " ;
}
if ( $total_mass >= 100 ) {
$vsego = " 100 " ;
$ziton = " 10 " ;
}
if ( $total_mass >= 109 ) {
$vsego = " 109 " ;
$ziton = " 11 " ;
}
if ( $total_mass >= 118 ) {
$vsego = " 118 " ;
$ziton = " 12 " ;
}
if ( $total_mass >= 127 ) {
$vsego = " 127 " ;
$ziton = " 13 " ;
}
if ( $total_mass >= 136 ) {
$vsego = " 136 " ;
$ziton = " 14 " ;
}
if ( $total_mass >= 145 ) {
$vsego = " 145 " ;
$ziton = " 15 " ;
}
if ( $total_mass >= 154 ) {
$vsego = " 154 " ;
$ziton = " 16 " ;
}
if ( $total_mass >= 163 ) {
$vsego = " 163 " ;
$ziton = " 17 " ;
}
if ( $total_mass >= 172 ) {
$vsego = " 172 " ;
$ziton = " 18 " ;
}
if ( $total_mass >= 181 ) {
$vsego = " 181 " ;
$ziton = " 19 " ;
}
if ( $total_mass >= 200 ) {
$vsego = " 200 " ;
$ziton = " 20 " ;
}
2018-01-28 16:40:49 +00:00
}
2020-07-06 13:22:33 +00:00
$ostalos = $total_mass - $vsego ;
if ( $ostalos == '0' ) {
mysql_query ( " DELETE FROM `inventory` WHERE `name`='Гайка' and owner=' " . $user [ " id " ] . " ' " );
} else {
$ze_m = $ostalos * 0.1 ;
mysql_query ( " UPDATE `inventory` SET `maxdur`=' $ostalos ', `massa`=' $ze_m ' WHERE `id`=' $alls_id ' " );
// mysql_query("DELETE FROM `inventory` WHERE `name`='Гайка' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$alls_id'");// x_mis ставим 0
}
if (( $user [ 'level' ] >= 4 ) && ( $user [ 'level' ] < 7 )) {
if ( $total_mass_v <= 0 ) {
$vsego_v = " 0 " ;
$ziton_v = " 0 " ;
}
if ( $total_mass_v >= 1 ) {
$vsego_v = " 1 " ;
$ziton_v = " 3 " ;
}
if ( $total_mass_v >= 2 ) {
$vsego_v = " 2 " ;
$ziton_v = " 6 " ;
}
if ( $total_mass_v >= 3 ) {
$vsego_v = " 3 " ;
$ziton_v = " 9 " ;
}
if ( $total_mass_v >= 4 ) {
$vsego_v = " 4 " ;
$ziton_v = " 12 " ;
}
if ( $total_mass_v >= 5 ) {
$vsego_v = " 5 " ;
$ziton_v = " 15 " ;
}
if ( $total_mass_v >= 6 ) {
$vsego_v = " 6 " ;
$ziton_v = " 18 " ;
}
if ( $total_mass_v >= 7 ) {
$vsego_v = " 7 " ;
$ziton_v = " 21 " ;
}
if ( $total_mass_v >= 8 ) {
$vsego_v = " 8 " ;
$ziton_v = " 24 " ;
}
if ( $total_mass_v >= 9 ) {
$vsego_v = " 9 " ;
$ziton_v = " 27 " ;
}
if ( $total_mass_v >= 10 ) {
$vsego_v = " 10 " ;
$ziton_v = " 30 " ;
}
if ( $total_mass_v >= 11 ) {
$vsego_v = " 11 " ;
$ziton_v = " 33 " ;
}
if ( $total_mass_v >= 12 ) {
$vsego_v = " 12 " ;
$ziton_v = " 36 " ;
}
if ( $total_mass_v >= 13 ) {
$vsego_v = " 13 " ;
$ziton_v = " 39 " ;
}
if ( $total_mass_v >= 14 ) {
$vsego_v = " 14 " ;
$ziton_v = " 42 " ;
}
if ( $total_mass_v >= 15 ) {
$vsego_v = " 15 " ;
$ziton_v = " 45 " ;
}
if ( $total_mass_v >= 16 ) {
$vsego_v = " 16 " ;
$ziton_v = " 48 " ;
}
if ( $total_mass_v >= 17 ) {
$vsego_v = " 17 " ;
$ziton_v = " 51 " ;
}
if ( $total_mass_v >= 18 ) {
$vsego_v = " 18 " ;
$ziton_v = " 54 " ;
}
if ( $total_mass_v >= 19 ) {
$vsego_v = " 19 " ;
$ziton_v = " 57 " ;
}
if ( $total_mass_v >= 20 ) {
$vsego_v = " 20 " ;
$ziton_v = " 60 " ;
}
} elseif (( $user [ 'level' ] >= 7 ) && ( $user [ 'level' ] <= 8 )) {
if ( $total_mass_v <= 0 ) {
$vsego_v = " 0 " ;
$ziton_v = " 0 " ;
}
if ( $total_mass_v >= 1 ) {
$vsego_v = " 1 " ;
$ziton_v = " 1 " ;
}
if ( $total_mass_v >= 2 ) {
$vsego_v = " 2 " ;
$ziton_v = " 2 " ;
}
if ( $total_mass_v >= 3 ) {
$vsego_v = " 3 " ;
$ziton_v = " 3 " ;
}
if ( $total_mass_v >= 4 ) {
$vsego_v = " 4 " ;
$ziton_v = " 4 " ;
}
if ( $total_mass_v >= 5 ) {
$vsego_v = " 5 " ;
$ziton_v = " 5 " ;
}
if ( $total_mass_v >= 6 ) {
$vsego_v = " 6 " ;
$ziton_v = " 6 " ;
}
if ( $total_mass_v >= 7 ) {
$vsego_v = " 7 " ;
$ziton_v = " 7 " ;
}
if ( $total_mass_v >= 8 ) {
$vsego_v = " 8 " ;
$ziton_v = " 8 " ;
}
if ( $total_mass_v >= 9 ) {
$vsego_v = " 9 " ;
$ziton_v = " 9 " ;
}
if ( $total_mass_v >= 10 ) {
$vsego_v = " 10 " ;
$ziton_v = " 10 " ;
}
if ( $total_mass_v >= 11 ) {
$vsego_v = " 11 " ;
$ziton_v = " 11 " ;
}
if ( $total_mass_v >= 12 ) {
$vsego_v = " 12 " ;
$ziton_v = " 12 " ;
}
if ( $total_mass_v >= 13 ) {
$vsego_v = " 13 " ;
$ziton_v = " 13 " ;
}
if ( $total_mass_v >= 14 ) {
$vsego_v = " 14 " ;
$ziton_v = " 14 " ;
}
if ( $total_mass_v >= 15 ) {
$vsego_v = " 15 " ;
$ziton_v = " 15 " ;
}
if ( $total_mass_v >= 16 ) {
$vsego_v = " 16 " ;
$ziton_v = " 16 " ;
}
if ( $total_mass_v >= 17 ) {
$vsego_v = " 17 " ;
$ziton_v = " 17 " ;
}
if ( $total_mass_v >= 18 ) {
$vsego_v = " 18 " ;
$ziton_v = " 18 " ;
}
if ( $total_mass_v >= 19 ) {
$vsego_v = " 19 " ;
$ziton_v = " 19 " ;
}
if ( $total_mass_v >= 20 ) {
$vsego_v = " 20 " ;
$ziton_v = " 20 " ;
}
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
$ostalos_v = $total_mass_v - $vsego_v ;
if ( $ostalos_v == '0' ) {
mysql_query ( " DELETE FROM `inventory` WHERE `name`='Вентиль' and owner=' " . $user [ " id " ] . " ' " );
} else {
$ze_v = $ostalos_v * 0.2 ;
mysql_query ( " UPDATE `inventory` SET `maxdur`=' $ostalos_v ',`massa`=' $ze_v ' WHERE `id`=' $vls_id ' " );
// mysql_query("DELETE FROM `inventory` WHERE `name`='Вентиль' and `x_mis`='0' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$vls_id'");// x_mis ставим 0
}
if (( $user [ 'level' ] >= 4 ) && ( $user [ 'level' ] < 7 )) {
if ( $total_mass_b <= 0 ) {
$vsego_b = " 0 " ;
$ziton_b = " 0 " ;
}
if ( $total_mass_b >= 1 ) {
$vsego_b = " 1 " ;
$ziton_b = " 1 " ;
}
if ( $total_mass_b >= 2 ) {
$vsego_b = " 2 " ;
$ziton_b = " 2 " ;
}
if ( $total_mass_b >= 3 ) {
$vsego_b = " 3 " ;
$ziton_b = " 3 " ;
}
if ( $total_mass_b >= 4 ) {
$vsego_b = " 4 " ;
$ziton_b = " 4 " ;
}
if ( $total_mass_b >= 5 ) {
$vsego_b = " 5 " ;
$ziton_b = " 5 " ;
}
if ( $total_mass_b >= 6 ) {
$vsego_b = " 6 " ;
$ziton_b = " 6 " ;
}
if ( $total_mass_b >= 7 ) {
$vsego_b = " 7 " ;
$ziton_b = " 7 " ;
}
if ( $total_mass_b >= 8 ) {
$vsego_b = " 8 " ;
$ziton_b = " 8 " ;
}
if ( $total_mass_b >= 9 ) {
$vsego_b = " 9 " ;
$ziton_b = " 9 " ;
}
if ( $total_mass_b >= 10 ) {
$vsego_b = " 10 " ;
$ziton_b = " 10 " ;
}
if ( $total_mass_b >= 11 ) {
$vsego_b = " 11 " ;
$ziton_b = " 11 " ;
}
if ( $total_mass_b >= 12 ) {
$vsego_b = " 12 " ;
$ziton_b = " 12 " ;
}
if ( $total_mass_b >= 13 ) {
$vsego_b = " 13 " ;
$ziton_b = " 13 " ;
}
if ( $total_mass_b >= 14 ) {
$vsego_b = " 14 " ;
$ziton_b = " 14 " ;
}
if ( $total_mass_b >= 15 ) {
$vsego_b = " 15 " ;
$ziton_b = " 15 " ;
}
if ( $total_mass_b >= 16 ) {
$vsego_b = " 16 " ;
$ziton_b = " 16 " ;
}
if ( $total_mass_b >= 17 ) {
$vsego_b = " 17 " ;
$ziton_b = " 17 " ;
}
if ( $total_mass_b >= 18 ) {
$vsego_b = " 18 " ;
$ziton_b = " 18 " ;
}
if ( $total_mass_b >= 19 ) {
$vsego_b = " 19 " ;
$ziton_b = " 19 " ;
}
if ( $total_mass_b >= 20 ) {
$vsego_b = " 20 " ;
$ziton_b = " 20 " ;
}
} elseif (( $user [ 'level' ] >= 7 ) && ( $user [ 'level' ] <= 8 )) {
if ( $total_mass_b < 9 ) {
$vsego_b = " 0 " ;
$ziton_b = " 0 " ;
}
if ( $total_mass_b >= 9 ) {
$vsego_b = " 9 " ;
$ziton_b = " 1 " ;
}
if ( $total_mass_b >= 18 ) {
$vsego_b = " 18 " ;
$ziton_b = " 2 " ;
}
if ( $total_mass_b >= 27 ) {
$vsego_b = " 27 " ;
$ziton_b = " 3 " ;
}
if ( $total_mass_b >= 36 ) {
$vsego_b = " 36 " ;
$ziton_b = " 4 " ;
}
if ( $total_mass_b >= 45 ) {
$vsego_b = " 45 " ;
$ziton_b = " 5 " ;
}
if ( $total_mass_b >= 54 ) {
$vsego_b = " 54 " ;
$ziton_b = " 6 " ;
}
if ( $total_mass_b >= 63 ) {
$vsego_b = " 63 " ;
$ziton_b = " 7 " ;
}
if ( $total_mass_b >= 72 ) {
$vsego_b = " 72 " ;
$ziton_b = " 8 " ;
}
if ( $total_mass_b >= 81 ) {
$vsego_b = " 81 " ;
$ziton_b = " 9 " ;
}
if ( $total_mass_b >= 100 ) {
$vsego_b = " 100 " ;
$ziton_b = " 10 " ;
}
if ( $total_mass_b >= 109 ) {
$vsego_b = " 109 " ;
$ziton_b = " 11 " ;
}
if ( $total_mass_b >= 118 ) {
$vsego_b = " 118 " ;
$ziton_b = " 12 " ;
}
if ( $total_mass_b >= 127 ) {
$vsego_b = " 127 " ;
$ziton_b = " 13 " ;
}
if ( $total_mass_b >= 136 ) {
$vsego_b = " 136 " ;
$ziton_b = " 14 " ;
}
if ( $total_mass_b >= 145 ) {
$vsego_b = " 145 " ;
$ziton_b = " 15 " ;
}
if ( $total_mass_b >= 154 ) {
$vsego_b = " 154 " ;
$ziton_b = " 16 " ;
}
if ( $total_mass_b >= 163 ) {
$vsego_b = " 163 " ;
$ziton_b = " 17 " ;
}
if ( $total_mass_b >= 172 ) {
$vsego_b = " 172 " ;
$ziton_b = " 18 " ;
}
if ( $total_mass_b >= 181 ) {
$vsego_b = " 181 " ;
$ziton_b = " 19 " ;
}
if ( $total_mass_b >= 200 ) {
$vsego_b = " 200 " ;
$ziton_b = " 20 " ;
}
}
$ostalos_b = $total_mass_b - $vsego_b ;
if ( $ostalos_b == '0' ) {
mysql_query ( " DELETE FROM `inventory` WHERE `name`='Болт' and owner=' " . $user [ " id " ] . " ' " );
} else {
$ze_b = $ostalos_b * 0.1 ;
mysql_query ( " UPDATE `inventory` SET `maxdur`=' $ostalos_b ',`massa`=' $ze_b ' WHERE `id`=' $bls_id ' " );
// mysql_query("DELETE FROM `inventory` WHERE `name`='Болт' and owner='".$user["id"]."'");
// mysql_query("UPDATE `inventory` SET `x_mis`='0' WHERE `id`='$bls_id'");// x_mis ставим 0
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $ziton != '0' ) { //1
$g = mysql_fetch_array ( mysql_query ( " SELECT `maxdur` FROM `inventory` WHERE `owner`=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Жетон' " ));
$koll = $g [ " maxdur " ];
$mas = $ziton * 0.1 ;
if ( $koll > '0' ) {
mysql_query ( " UPDATE `inventory` SET maxdur=maxdur+ $ziton , massa=massa+ $mas ,`present`='Лука' WHERE owner=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Жетон' " );
} else {
$mas = $ziton * 0.1 ;
$fo = mysql_query ( " INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa,present) VALUES('Жетон','0',' $ziton ','ziton.gif',' " . $user [ 'id' ] . " ','200','0',' $mas ', 'Лука') " );
}
} //1
if ( $ziton_v != '0' ) { //1
$gv = mysql_fetch_array ( mysql_query ( " SELECT `maxdur` FROM `inventory` WHERE `owner`=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Жетон' " ));
$kollv = $gv [ " maxdur " ];
$mas = $ziton_v * 0.1 ;
if ( $kollv > '0' ) {
mysql_query ( " UPDATE `inventory` SET maxdur=maxdur+ $ziton_v , massa=massa+ $mas ,`present`='Лука' WHERE owner=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Жетон' " );
} else {
$mas = $ziton_v * 0.1 ;
$fov = mysql_query ( " INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0',' $ziton_v ','ziton.gif',' " . $user [ 'id' ] . " ','200','0',' $mas ', 'Лука') " );
}
} //1
if ( $ziton_b != '0' ) { //1
$gb = mysql_fetch_array ( mysql_query ( " SELECT `maxdur` FROM `inventory` WHERE `owner`=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Жетон' " ));
$kollb = $gb [ " maxdur " ];
$mas = $ziton_b * 0.1 ;
if ( $kollb > '0' ) {
mysql_query ( " UPDATE `inventory` SET maxdur=maxdur+ $ziton_b , massa=massa+ $mas ,`present`='Лука' WHERE owner=' " . $user [ 'id' ] . " ' and `type`='200' and `name`='Жетон' " );
} else {
$mas = $ziton_b * 0.1 ;
$fob = mysql_query ( " INSERT INTO `inventory`(name,duration,maxdur,img,owner,type,isrep,massa, present) VALUES('Жетон','0',' $ziton_b ','ziton.gif',' " . $user [ 'id' ] . " ','200','0',' $mas ', 'Лука') " );
}
} //1
if ( $ziton <= 0 and $ziton_v <= 0 and $ziton_b <= 0 ) {
print " ИХ больше у тебя нету... Неси еще, Луке нужно больше ИХ! " ;
}
if ( $ziton > 0 ) {
print " Вы отдали: <b> $vsego </b> шт.Гаек <br> Получили: <b> $ziton </b> шт.Жетонов.<br> " ;
}
if ( $ziton_v > 0 ) {
print " Вы отдали: <b> $vsego_v </b> шт.Вентиль <br> Получили: <b> $ziton_v </b> шт.Жетонов.<br> " ;
}
if ( $ziton_b > 0 ) {
print " Вы отдали: <b> $vsego_b </b> шт.Болтов <br> Получили: <b> $ziton_b </b> шт.Жетонов. " ;
}
}
//////////////////////
if ( $_GET [ 'd' ] == '4' ) {
print " А ?..." ;
}
if ( $_GET [ 'd' ] == '5' ) {
print " Лука и Мартын тут живут давно... чииинят трубыы. Лука Чинит. Лука не любит пауков... Лука любит жетоны... Они красивые... Лука любит играть с ними... Мартын к паукам ушел... Теперь Лука один, чииинит... " ;
}
if ( $qwest != '1' ) {
if ( $_GET [ 'd' ] == '6' ) {
print " Да да! Мартын гаад... он украл у Луки важную вещь 'Ключиик'... убей Мартына... забери 'Ключиик'... принеси е г о к Луке... Лука вознаградит тебя... " ;
}
if ( $_GET [ 'd' ] == '7' ) {
if ( $qwest != '1' ) {
$T1 = mysql_query ( " INSERT INTO qwest (user_id,login,name_qwest,name_items,id_items,dlja,zadanie,kw,status) VALUES(' " . $user [ 'id' ] . " ',' " . $user [ 'login' ] . " ','kluchiik','Ключиик','','Лука','Найти ключиик','0','no') " );
print " <font style='font-size:11px; color:red;'>Вы приняли задание.(Найти 'ключиик').</font><br><br>
Хорошо ... Лука будет ждать ... " ;
} else {
print " <font style='font-size:11px; color:red;'>Вы уже приняли задание.(Найти 'ключиик').</font><br><br>
Н у что ? Лука ждёт ... " ;
}
}
}
?>
</ i >
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
< BR >< BR >
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
< ?
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
//Вопросы)
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( ! isset ( $_GET [ 'd' ])) {
print " •<A href='?act=luka&d=1'> Запах?? Ты вообще о чем? </A><BR> " ;
}
if ( ! isset ( $_GET [ 'd' ])) {
print " •<A href='?act=luka&d=1.1'> Я тут гайки-вентили нашел, тебе они случайно не нужны? </A><BR> " ;
}
if ( $qwest_status != 'ok' ) {
if ( $ok_qwest == '1' ) {
if ( ! isset ( $_GET [ 'd' ])) {
print " •<A href='?act=luka&d=1.2'> Вот твой ключиик! </A><BR> " ;
}
}
}
if ( ! isset ( $_GET [ 'd' ])) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '1' ) {
print " •<A href='?act=luka'> Понятно. Н о я хотел поговорить о другом. </A><BR> " ;
}
if ( $_GET [ 'd' ] == '1' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '1.1' ) {
print " •<A href='?act=luka&d=2'> Я хочу знать, сколько жетонов ты мне дашь. </A><BR> " ;
}
if ( $_GET [ 'd' ] == '1.1' ) {
print " •<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR> " ;
}
if ( $_GET [ 'd' ] == '1.1' ) {
print " •<A href='?act=luka'> С гайками все ясно. Вернемся назад. </A><BR> " ;
}
if ( $_GET [ 'd' ] == '1.1' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
if ( $ok_qwest == '1' ) {
if ( $_GET [ 'd' ] == '1.2' ) {
print " •<A href='?act=luka&d=1.3'> Выбераю Гайку силы.</A><BR> " ;
}
}
if ( $ok_qwest == '1' ) {
if ( $_GET [ 'd' ] == '1.2' ) {
print " •<A href='?act=luka&d=1.4'> Выбераю Гайку мудрости.</A><BR> " ;
}
}
if ( $ok_qwest == '1' ) {
if ( $_GET [ 'd' ] == '1.2' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду..</A><BR> " ;
}
}
if ( $_GET [ 'd' ] == '1.3' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
if ( $_GET [ 'd' ] == '1.4' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '2' ) {
print " •<A href='?act=luka&d=3'> Я хочу поменять ИХ на жетоны. </A><BR> " ;
}
if ( $_GET [ 'd' ] == '2' ) {
print " •<A href='?act=luka'> Спасибо, за прайс-лист. </A><BR> " ;
}
if ( $_GET [ 'd' ] == '2' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '3' ) {
print " •<A href='?act=luka&d=4'> Я хотел еще спросить... </A><BR> " ;
}
if ( $_GET [ 'd' ] == '3' ) {
print " •<A href='main.php?act=none'> Хорошо, пойду еще принесу.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '4' ) {
print " •<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR> " ;
}
if ( $_GET [ 'd' ] == '4' ) {
print " •<A href='?act=luka&d=5'> Расскажи мне о с е б е . </A><BR> " ;
}
if ( $_GET [ 'd' ] == '4' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '5' ) {
print " •<A href='?act=luka&d=1.1'> Что ты там говорил про гайки-вентили? </A><BR> " ;
}
if ( $qwest != '1' ) {
if ( $_GET [ 'd' ] == '5' ) {
print " •<A href='?act=luka&d=6'> Может помочь чем? </A><BR> " ;
}
}
if ( $_GET [ 'd' ] == '5' ) {
print " •<A href='main.php?act=none'> Я, пожалуй, пойду.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '6' ) {
print " •<A href='?act=luka&d=7'> Я помогу тебе... принесу я ключиик... жди! </A><BR> " ;
}
if ( $_GET [ 'd' ] == '6' ) {
print " •<A href='main.php?act=none'> Да ну тя сам разберайся.</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
if ( $_GET [ 'd' ] == '7' ) {
print " •<A href='main.php?act=none'> Я, пойду.(конец диалога).</A><BR> " ;
}
2018-01-28 16:40:49 +00:00
2020-07-06 13:22:33 +00:00
print " </i><BR><BR> " ;
?>
</ TD >
< TD >
< ? php
$bot = " Лука " ;
$buser = mysql_fetch_array ( mysql_query ( " SELECT * FROM `users` WHERE `login` = ' $bot ' LIMIT 1; " ));
//FIXME Этот класс не умеет работать с ботами! Этот вызов - заглушка!
$botInfo = new User ( 'Лука' );
$botInfo -> showUserDoll ();
?>
</ TD >
</ TR >
</ TABLE >
<!-- < DIV ID = oMenu CLASS = menu onmouseout = " closeMenu() " ></ DIV > -->
< DIV ID = " oMenu " style = " position:absolute; border:1px solid #666; background-color:#CCC; display:none; " ></ DIV >
< TEXTAREA ID = holdtext STYLE = " display:none; " ></ TEXTAREA >
</ body >
</ html >
< ?
2018-01-28 16:40:49 +00:00
}
?>