2018-01-28 16:40:49 +00:00
< ? php
// magic идентификацыя
if ( $user [ 'battle' ] > 0 ) {
2020-10-29 23:30:05 +00:00
echo " Н е в бою..." ;
2018-01-28 16:40:49 +00:00
} else
2020-10-29 23:30:05 +00:00
if ( $user [ 'intel' ] >= 4 ) {
$int = 71 + $user [ 'intel' ] - 4 ;
if ( $int > 100 ) {
$int = 100 ;
}
} else {
$int = 0 ;
}
if ( rand ( 1 , 100 ) < $int ) {
if ( empty ( $_SESSION [ 'uid' ])) {
header ( " Location: index.php " );
exit ;
}
2020-09-30 12:30:00 +00:00
2018-01-28 16:40:49 +00:00
2020-10-29 23:30:05 +00:00
$dress = mysql_fetch_array ( mysql_query ( " SELECT * FROM `inventory` WHERE (`name` LIKE '%Меч%' OR `name` LIKE '%Жало%') AND `owner` = ' { $user [ 'id' ] } ' AND `name` = ' { $_POST [ 'target' ] } ' AND `sharped` = 0 LIMIT 1; " ));
$svitok = mysql_fetch_array ( mysql_query ( " SELECT * FROM `inventory` WHERE `name` = 'Заточка на мечи +3' AND `owner` = ' { $user [ 'id' ] } ' LIMIT 1; " ));
if ( $dress && $svitok ) {
if ( mysql_query ( " UPDATE `inventory` SET `sharped` = 1, `cost` = `cost`+18,`name` = CONCAT(`name`,'+3'), `minu` = `minu`+3, `maxu`=`maxu`+3, `nmech` = `nmech`+3, `nvinos` = `nvinos`+3 WHERE `id` = { $dress [ 'id' ] } LIMIT 1; " )) {
echo " <font color=red><b>Предмет \" { $_POST [ 'target' ] } \" удачно заточен +3.<b></font> " ;
$bet = 1 ;
} else {
echo " <font color=red><b>Произошла ошибка!<b></font> " ;
}
} else {
echo " <font color=red><b>Неправильное имя предмета или неправильный свиток<b></font> " ;
}
} else {
echo " <font color=red><b>Неудачно...<b></font> " ;
$bet = 1 ;
}