2018-01-28 16:40:49 +00:00
< ? php
session_start ();
2020-09-29 22:39:06 +00:00
$stat_nm = [ " 1 " => " Сила " , " 2 " => " Ловкость " , " 3 " => " Интуиция " , " 4 " => " Выносливость " , " 5 " => " Интеллект " , " 6 " => " Мудрость " ];
$stat_nmdb = [ " 1 " => " sila " , " 2 " => " lovk " , " 3 " => " inta " , " 4 " => " vinos " , " 5 " => " intel " , " 6 " => " mudra " ];
$stat_nmto = [ " 1 " => " в силу " , " 2 " => " в ловкость " , " 3 " => " в интуицию " , " 4 " => " в выносливость " , " 5 " => " в интеллект " , " 6 " => " в мудрость " ];
$trv = " " ;
if ( $_SESSION [ 'uid' ] == null ) {
header ( " Location: index.php " );
die ();
}
require_once " functions.php " ;
if ( $user -> battle ) {
header ( 'location: fbattle.php' );
die ();
}
2018-01-28 16:40:49 +00:00
?>
2020-09-29 22:39:06 +00:00
< HTML >
< HEAD >
< link rel = stylesheet href = " css/main.css " >
< meta charset = utf - 8 " >
< title > Комната знахаря </ title >
2018-01-28 16:40:49 +00:00
</ HEAD >
< body leftmargin = 5 topmargin = 5 marginwidth = 5 marginheight = 5 bgcolor = #e0e0e0>
2020-09-29 22:39:06 +00:00
< div style = 'color:#8F0000; font-weight:bold; font-size:16px; text-align:center; float:left;' > Комната Знахаря </ div >
< div style = 'float:right; padding-right:6px;' >< input type = button value = 'Вернуться'
OnClick = " location.href='city.php?bps=1' " ></ div >
< div style = 'clear:both;' ></ div >
< br >
< ? $d = mysql_fetch_array ( mysql_query ( " SELECT sum(`massa`) FROM `inventory` WHERE `owner` = ' { $user [ 'id' ] } ' AND `dressed` = 0 AND `setsale` = 0 ; " ));
if ( $d [ 0 ] > get_meshok ()) {
echo " <font color=red><b>У вас переполнен рюкзак, вы не можете передвигаться...</b></font><br> " ;
} ?>
2018-01-28 16:40:49 +00:00
< b >< i > Запахи трав наполняют помещение , непонятные и пугающие предметы скрываются в пляшущих тенях ...< br >
2020-09-29 22:39:06 +00:00
Говорят , здесь можно изменить свою судьбу . Стать кем - то иным ... кем раньше был лишь в мечтах ...</ b ></ i >< br >< br >
2018-01-28 16:40:49 +00:00
В с е имеет цену . Н о не все можно купить . Помните - некоторые шансы даются лишь раз в жизни ...< br >
< ?
2020-09-29 22:39:06 +00:00
$owntravma = mysql_fetch_array ( mysql_query ( " SELECT `type` FROM `effects` WHERE `owner` = " . ( int ) $_SESSION [ 'uid' ] . " AND (type=12 OR type=13 OR type=11 OR type=14 OR type=188 OR type=21 OR type=201 OR type=202); " ));
if ( $owntravma [ 'type' ] == 11 or $owntravma [ 'type' ] == 12 or $owntravma [ 'type' ] == 13 or $owntravma [ 'type' ] == 14 ) {
echo " <br><font color=red><b>Вы не можете воспользоваться услугами Знахаря имея травму!</b></font> " ;
die ();
} elseif ( $owntravma [ 'type' ] == 188 or $owntravma [ 'type' ] == 21 or $owntravma [ 'type' ] == 201 or $owntravma [ 'type' ] == 202 ) {
echo " <br><font color=red><b>Вы не можете воспользоваться услугами Знахаря находясь под действием эликсиров и эффектов!</b></font> " ;
die ();
}
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
if ( $_POST [ 'undr' ] == '1' ) undressall (( int ) $_SESSION [ 'uid' ]);
$s = mysql_fetch_row ( mysql_query ( " SELECT count(id) FROM inventory WHERE dressed!=0 AND owner= " . ( int ) $_SESSION [ 'uid' ]));
if (( int ) $s [ 0 ] > 0 ) {
echo " <form method=post>Перед входом в комнату Знахарь требует полного очищения! <input type=hidden value=1 name='undr'><input type=submit value='Раздеться'></form> " ;
die ();
}
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
if ( @ ( int ) $_POST [ 'move_ab' ] > 0 && $user [ 'money' ] >= 32 ) {
if (( $stat_nmdb [( int ) $_POST [ 'move_ab' ]] == 'sila' && $user [ 'sila' ] < 4 ) || ( $stat_nmdb [( int ) $_POST [ 'move_ab' ]] == 'lovk' && $user [ 'lovk' ] < 4 ) || ( $stat_nmdb [( int ) $_POST [ 'move_ab' ]] == 'inta' && $user [ 'inta' ] < 4 ) || ( $stat_nmdb [( int ) $_POST [ 'move_ab' ]] == 'vinos' && $user [ 'vinos' ] < ( 4 + $user [ 'level' ]))) echo " <font color=red><b>Невозможно перераспределить статы ниже минимального уровня.</b></font> " ;
else {
if ( @ ( int ) $_POST [ 'move_ab_top' ] > 0 ) {
$money_need = $user [ $stat_nmdb [( int ) $_POST [ 'move_ab_top' ]]] <= 10 ? " 10 " : $user [ $stat_nmdb [( int ) $_POST [ 'move_ab_top' ]]];
#$money_need = 0;
if ( @ ( int ) $_POST [ 'move_ab' ] == @ ( int ) $_POST [ 'move_ab_top' ]) echo " <font color=red><b>Переносить умение можно только в другое!</b></font> " ;
elseif ( ! $user [ $stat_nmdb [( int ) $_POST [ 'move_ab' ]]] > 0 ) {
echo " <font color=red><b>Недостаточно умений для перераспределения!</b></font> " ;
} elseif (( $user [ 'money' ] - $money_need ) < 0 ) {
echo " <font color=red><b>Недостаточно кредитов для совершения операции!</b></font> " ;
} else {
mysql_query ( " UPDATE `users` SET ` " . $stat_nmdb [( int ) $_POST [ 'move_ab' ]] . " `=(` " . $stat_nmdb [( int ) $_POST [ 'move_ab' ]] . " `-1), ` " . $stat_nmdb [( int ) $_POST [ 'move_ab_top' ]] . " `=(` " . $stat_nmdb [( int ) $_POST [ 'move_ab_top' ]] . " `+1), money=(money- " . $money_need . " ) WHERE id= " . ( int ) $_SESSION [ 'uid' ] . " " );
echo " <font color=red>Перераспределение статов \" " . $stat_nm [( int ) $_POST [ 'move_ab' ]] . " " . $stat_nmto [( int ) $_POST [ 'move_ab_top' ]] . " \" произведено успешно. Цена операции " . $money_need . " </font> " ;
$user [ $stat_nmdb [( int ) $_POST [ 'move_ab_top' ]]] ++ ;
$user [ $stat_nmdb [( int ) $_POST [ 'move_ab' ]]] -- ;
$user [ 'money' ] -= $money_need ;
#$trv=settravma((int)$_SESSION['uid'],20,rand(300,600),1);
}
}
}
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
} elseif (( int ) $_POST [ 'sbr_nav' ] > 0 && $user [ 'money' ] >= 32 ) {
if (( $user [ 'noj' ] + $user [ 'mec' ] + $user [ 'topor' ] + $user [ 'dubina' ] + $user [ 'mfire' ] + $user [ 'mwater' ] + $user [ 'mair' ] + $user [ 'mearth' ] + $user [ 'mlight' ] + $user [ 'mgray' ] + $user [ 'mdark' ]) == 0 ) echo " <font color=red><b>У В а с нет нераспределённых умений!</b></font> " ;
elseif ( ! file_exists ( '/tmp/memcache/uml' . $_SESSION [ 'uid' ])) {
if ( mysql_query ( " UPDATE `users` SET `master` = noj+mec+topor+dubina+mfire+mwater+mair+mearth+mlight+mgray+mdark+master,noj=0,mec=0,topor=0,dubina=0,mfire=0,mwater=0,mair=0,mearth=0,mlight=0,mgray=0,mdark=0,money=(money-32) WHERE `id`= " . ( int ) $_SESSION [ 'uid' ] . " LIMIT 1; " )) {
mysql_query ( " INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0',' { $_SESSION [ 'uid' ] } ',' \" " . $user [ 'login' ] . " \" перераспределил умения, заплатив 32 кр в Комнате Знахаря. ',1,' " . time () . " '); " );
echo " <font color=red>В с е прошло удачно.Цена операции <b>32</b> кр. Вы можете перераспределить умения.</font> " ;
$flum = fopen ( '/tmp/memcache/uml' . $_SESSION [ 'uid' ], 'w' );
fwrite ( $flum , date ( 'Y-m-d H:i:s' ));
fclose ( $flum );
$user [ 'money' ] -= 32 ;
$trv = settravma (( int ) $_SESSION [ 'uid' ], 20 , rand ( 300 , 600 ), 1 );
} else echo " <font color=red>Произошла ошибка!</font> " ;
} else {
if ( $user [ 'money' ] < 32 ) {
echo " <font color=red><b>Недостаточно кредитов для совершения операции!</b></font> " ;
} else {
if ( mysql_query ( " UPDATE `users` SET `master` = noj+mec+topor+dubina+mfire+mwater+mair+mearth+mlight+mgray+mdark+master,noj=0,mec=0,topor=0,dubina=0,mfire=0,mwater=0,mair=0,mearth=0,mlight=0,mgray=0,mdark=0,money=(money-32) WHERE `id`= " . ( int ) $_SESSION [ 'uid' ] . " LIMIT 1; " )) {
mysql_query ( " INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0',' { $_SESSION [ 'uid' ] } ',' \" " . $user [ 'login' ] . " \" перераспределил умения, заплатив 32 кр. в Комнате Знахаря. ',1,' " . time () . " '); " );
echo " <font color=red>В с е прошло удачно.Цена операции <b>32</b> кр. Вы можете перераспределить умения.</font> " ;
$user [ 'money' ] -= 32 ;
$trv = settravma (( int ) $_SESSION [ 'uid' ], 20 , rand ( 300 , 60 ), 1 );
} else echo " <font color=red>Произошла ошибка!</font> " ;
}
}
} elseif (( int ) $_POST [ 'sbr_par' ] > 0 ) {
$expstats = [
/* nextup,summstats*/
" 20 " => 3 , //exp 0-19
" 45 " => 4 , //exp 20-44
" 75 " => 5 , //exp 45-74
" 110 " => 6 , //exp 75-109
" 160 " => 9 , //1лвл, exp 110-159
" 215 " => 10 , //exp 160-214
" 280 " => 11 , //exp 215-279
" 350 " => 12 , //exp 280-349
" 410 " => 13 , //exp 350-409
" 530 " => 16 , //2лвл exp 410-529
" 670 " => 17 ,
" 830 " => 18 ,
" 950 " => 19 ,
" 1100 " => 20 ,
" 1300 " => 21 ,
" 1450 " => 24 , //3лвл
" 1650 " => 25 ,
" 1850 " => 26 ,
" 2050 " => 27 ,
" 2200 " => 28 ,
" 2500 " => 29 ,
" 2900 " => 34 , //4лвл
" 3350 " => 35 ,
" 3800 " => 36 ,
" 4200 " => 37 ,
" 4600 " => 38 ,
" 5000 " => 39 ,
" 6000 " => 42 , //5лвл
" 7000 " => 43 ,
" 8000 " => 44 ,
" 9000 " => 45 ,
" 10000 " => 46 ,
" 11000 " => 47 ,
" 12000 " => 48 ,
" 12500 " => 49 ,
" 14000 " => 52 , //6лвл
" 15500 " => 53 ,
" 17000 " => 54 ,
" 19000 " => 55 ,
" 21000 " => 56 ,
" 23000 " => 57 ,
" 27000 " => 58 ,
" 30000 " => 59 ,
" 60000 " => 64 , //7лвл
" 75000 " => 65 ,
" 150000 " => 66 ,
" 175000 " => 67 ,
" 200000 " => 68 ,
" 225000 " => 69 ,
" 250000 " => 70 ,
" 260000 " => 71 ,
" 280000 " => 72 ,
" 300000 " => 73 ,
" 1500000 " => 78 , //8лвл
" 1750000 " => 79 ,
" 2000000 " => 80 ,
" 2175000 " => 81 ,
" 2300000 " => 82 ,
" 2400000 " => 83 ,
" 2500000 " => 84 ,
" 2600000 " => 85 ,
" 2800000 " => 86 ,
" 3000000 " => 87 ,
" 6000000 " => 94 , //9лвл
" 6500000 " => 95 ,
" 7500000 " => 96 ,
" 8500000 " => 97 ,
" 9000000 " => 98 ,
" 9250000 " => 99 ,
" 9500000 " => 100 ,
" 9750000 " => 101 ,
" 9900000 " => 102 ,
" 10000000 " => 103 ,
" 13000000 " => 112 , //10лвл
" 14000000 " => 114 ,
" 15000000 " => 116 ,
" 16000000 " => 118 ,
" 17000000 " => 120 ,
" 17500000 " => 122 ,
" 18000000 " => 124 ,
" 19000000 " => 126 ,
" 19500000 " => 128 ,
" 20000000 " => 130 ,
" 30000000 " => 132 ,
" 32000000 " => 134 ,
" 34000000 " => 136 ,
" 35000000 " => 138 ,
" 36000000 " => 140 ,
" 38000000 " => 142 ,
" 40000000 " => 144 ,
" 42000000 " => 146 ,
" 44000000 " => 148 ,
" 45000000 " => 150 ,
" 46000000 " => 152 ,
" 48000000 " => 154 ,
" 50000000 " => 156 ,
" 52000000 " => 158 ,
" 55000000 " => 168 , //11лвл
" 60000000 " => 169 ,
" 65000000 " => 170 ,
" 70000000 " => 171 ,
" 75000000 " => 172 ,
" 80000000 " => 173 ,
" 85000000 " => 174 ,
" 90000000 " => 175 ,
" 95000000 " => 176 ,
" 100000000 " => 177 ,
" 120000000 " => 178 ,
" 150000000 " => 188 , //12лвл
" 180000000 " => 190 ,
" 210000000 " => 192 ,
" 240000000 " => 194 ,
" 270000000 " => 196 ,
" 310000000 " => 198 ,
" 340000000 " => 200 ,
" 370000000 " => 202 ,
" 400000000 " => 204 ,
" 430000000 " => 206 ,
" 470000000 " => 208 ,
" 500000000 " => 210 ,
" 600000000 " => 220 //13лвл
];
$vinoslvl = [
/* level,summvinos*/
" 0 " => 3 ,
" 1 " => 4 ,
" 2 " => 5 ,
" 3 " => 6 ,
" 4 " => 7 ,
" 5 " => 8 ,
" 6 " => 9 ,
" 7 " => 10 ,
" 8 " => 11 ,
" 9 " => 13 ,
" 10 " => 16 ,
" 11 " => 21 ,
" 12 " => 26 ,
" 13 " => 31 ];
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
if ( ! file_exists ( '/tmp/memcache/par' . $_SESSION [ 'uid' ]) && $user [ 'money' ] >= 10 ) {
if ( mysql_query ( " UPDATE `users` SET `stats` = " . $expstats [ $user [ 'nextup' ]] . " , `sila`=3,`lovk`=3,`inta`=3,`mudra`=0,`intel`=0,`duh`=0,`vinos`= " . $vinoslvl [ $user [ 'level' ]] . " ,`maxhp`= " . $vinoslvl [ $user [ 'level' ]] . " *6,`maxmana`= 0,`mana`= '0',`hp`= " . $vinoslvl [ $user [ 'level' ]] . " *6, `money`=(`money`-10) WHERE `id`= " . ( int ) $_SESSION [ 'uid' ] . " LIMIT 1; " )) {
mysql_query ( " INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0',' { $_SESSION [ 'uid' ] } ',' \" " . $user [ 'login' ] . " \" сбросил параметры, заплатив 10 кр. в Комнате Знахаря. ',1,' " . time () . " '); " );
echo " <font color=red>В с е прошло удачно.Цена операции <b>10</b> кр. Вы можете перераспределить параметры.</font> " ;
$flum = fopen ( '/tmp/memcache/par' . $_SESSION [ 'uid' ], 'w' );
fwrite ( $flum , date ( 'Y-m-d H:i:s' ));
fclose ( $flum );
$trv = settravma (( int ) $_SESSION [ 'uid' ], 20 , rand ( 300 , 600 ), 1 );
$user [ 'money' ] -= 10 ;
} else echo " <font color=red>Произошла ошибка!</font> " ;
} else {
if ( $user [ 'money' ] < 10 ) echo " <font color=red><b>Недостаточно кредитов для совершения операции!</b></font> " ;
else {
if ( mysql_query ( " UPDATE `users` SET `stats` = " . $expstats [ $user [ 'nextup' ]] . " , `sila`=3,`lovk`=3,`inta`=3,`mudra`=0,`intel`=0,`duh`=0,`vinos`= " . $vinoslvl [ $user [ 'level' ]] . " ,`maxhp`= " . $vinoslvl [ $user [ 'level' ]] . " *6,`maxmana`= 0,`mana`= 0,`money`=(`money`-10) WHERE `id`= " . ( int ) $_SESSION [ 'uid' ] . " LIMIT 1; " )) {
mysql_query ( " INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0',' { $_SESSION [ 'uid' ] } ',' \" " . $user [ 'login' ] . " \" сбросил параметры, заплатив 10 кр. в Комнате Знахаря. ',1,' " . time () . " '); " );
echo " <font color=red>В с е прошло удачно.Цена операции <b>10</b> кр. Вы можете перераспределить параметры.</font> " ;
$trv = settravma (( int ) $_SESSION [ 'uid' ], 20 , rand ( 300 , 600 ), 1 );
$user [ 'money' ] -= 10 ;
} else echo " <font color=red>Произошла ошибка!</font> " ;
}
}
}
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
if ( $trv != " " ) echo " <br>Вы чувствуете слабость.. " . $trv . " " ;
2018-01-28 16:40:49 +00:00
?>
2020-09-29 22:39:06 +00:00
< br > Деньги : < b >< ? = $user [ 'money' ]; ?> </b> кр.
2018-01-28 16:40:49 +00:00
< br >< br >
< fieldset >
2020-09-29 22:39:06 +00:00
< legend style = 'font-weight:bold; color:#8F0000;' > Навыки владения оружием и магией </ legend >
< form method = post >< input type = hidden value = '<?= $_SESSION[' uid ']; ?>' name = 'sbr_nav' > У В а с есть шанс забыть старое
ради нового : < input type = submit
value = 'Отпустить умения <? echo file_exists(' / tmp / memcache / uml ' . $_SESSION[' uid ']) ? "(32кр .)" : "(32кр .)" ?>' >
</ form >
</ fieldset >
< br >< br >
2018-01-28 16:40:49 +00:00
< fieldset >
2020-09-29 22:39:06 +00:00
< legend style = 'font-weight:bold; color:#8F0000;' > Параметры </ legend >
< form method = post >< input type = hidden value = '<?= $_SESSION[' uid ']; ?>' name = 'sbr_par' > У В а с есть шанс забыть старое
ради нового : < input type = submit
value = 'Отпустить параметры <? echo file_exists(' / tmp / memcache / par ' . $_SESSION[' uid ']) ? "(10кр .)" : "(10кр .)" ?>' >
</ form >
</ fieldset >
< br >< br >
2018-01-28 16:40:49 +00:00
< fieldset >
2020-09-29 22:39:06 +00:00
< legend style = 'font-weight:bold; color:#8F0000;' > Параметры </ legend >
Вы можете стать иным - более ловким , сильным или мудрым ... но лишь за счет других параметров < br >
< ? echo $stat_nm [ 1 ] . " " . $user [ 'sila' ]; ?> <br>
< ? echo $stat_nm [ 2 ] . " " . $user [ 'lovk' ]; ?> <br>
< ? echo $stat_nm [ 3 ] . " " . $user [ 'inta' ]; ?> <br>
< ? echo $stat_nm [ 4 ] . " " . $user [ 'vinos' ]; ?> <br>
< ? echo $stat_nm [ 5 ] . " " . $user [ 'intel' ]; ?> <br>
< ? echo $stat_nm [ 6 ] . " " . $user [ 'mudra' ]; ?> <br>
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
< form method = post >
Перенести < select name = 'move_ab' >
< option value = 1 >< ? = $stat_nm [ 1 ]; ?> </option>
< option value = 2 >< ? = $stat_nm [ 2 ]; ?> </option>
< option value = 3 >< ? = $stat_nm [ 3 ]; ?> </option>
< option value = 4 >< ? = $stat_nm [ 4 ]; ?> </option>
< option value = 5 >< ? = $stat_nm [ 5 ]; ?> </option>
< option value = 6 >< ? = $stat_nm [ 6 ]; ?> </option>
</ select > в
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
< select name = 'move_ab_top' >
< option value = 1 >< ? echo $stat_nmto [ 1 ] . " " . ( $user [ 'sila' ] <= 10 ? " 10 кр. " : $user [ 'sila' ] . " кр. " ) ?> </option>
< option value = 2 >< ? echo $stat_nmto [ 2 ] . " " . ( $user [ 'lovk' ] <= 10 ? " 10 кр. " : $user [ 'lovk' ] . " кр. " ) ?> </option>
< option value = 3 >< ? echo $stat_nmto [ 3 ] . " " . ( $user [ 'inta' ] <= 10 ? " 10 кр. " : $user [ 'inta' ] . " кр. " ) ?> </option>
< option value = 4 >< ? echo $stat_nmto [ 4 ] . " " . ( $user [ 'vinos' ] <= 10 ? " 10 кр. " : $user [ 'vinos' ] . " кр. " ) ?> </option>
< option value = 5 >< ? echo $stat_nmto [ 5 ] . " " . ( $user [ 'intel' ] <= 10 ? " 10 кр. " : $user [ 'intel' ] . " кр. " ) ?> </option>
< option value = 6 >< ? echo $stat_nmto [ 6 ] . " " . ( $user [ 'mudra' ] <= 10 ? " 10 кр. " : $user [ 'mudra' ] . " кр. " ) ?> </option>
</ select >< br >
2018-01-28 16:40:49 +00:00
2020-09-29 22:39:06 +00:00
<!--
2018-01-28 16:40:49 +00:00
< select name = 'move_ab_top' >
2020-09-29 22:39:06 +00:00
< option value = 1 >< ? echo $stat_nmto [ 1 ] . " Бесплатно " ; ?> </option>
< option value = 2 >< ? echo $stat_nmto [ 2 ] . " Бесплатно " ; ?> </option>
< option value = 3 >< ? echo $stat_nmto [ 3 ] . " Бесплатно " ; ?> </option>
< option value = 4 >< ? echo $stat_nmto [ 4 ] . " Бесплатно " ; ?> </option>
< option value = 5 >< ? echo $stat_nmto [ 5 ] . " Бесплатно " ; ?> </option>
< option value = 6 >< ? echo $stat_nmto [ 6 ] . " Бесплатно " ; ?> </option>
2018-01-28 16:40:49 +00:00
</ select >< br >
-->
2020-09-29 22:39:06 +00:00
Роспись : < input type = submit value = 'Согласен' ></ form >
2018-01-28 16:40:49 +00:00
</ fieldset >
</ BODY >
</ HTML >