game/_incl_data/class/dnaction/3/fontan_win.php

32 lines
1.7 KiB
PHP
Raw Normal View History

2023-03-31 18:42:06 +00:00
<?php
2022-06-06 21:30:34 +00:00
if( isset($s[1]) && $s[1] == '3/fontan_win' ) {
2023-01-10 16:29:32 +00:00
//Все переменные сохранять в массиве $vad !
2022-06-06 21:30:34 +00:00
$vad = array(
'go' => false
);
2023-01-10 16:29:32 +00:00
//Проверяем камни
2022-06-06 21:30:34 +00:00
$vad['sp'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE (`item_id` = "881" OR `item_id` = "878") AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
if( isset($vad['sp']['id']) ) {
2023-01-10 16:29:32 +00:00
// Удалена проверка на группировку предметов 13.10.2015
2022-06-06 21:30:34 +00:00
$vad['pl'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$vad['sp']['item_id'].'" LIMIT 1'));
$vad['go'] = true;
}
if( $vad['go'] == true ) {
$vad['items'] = array(2413,2414,2415,2416);
$vad['items'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($vad['items'][rand(0,count($vad['items'])-1)]).'" LIMIT 1'));
$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$vad['sp']['id'].'" LIMIT 1');
if($upd){
2023-01-10 16:29:32 +00:00
$r = 'Вы растворили &quot;'.$vad['pl']['name'].'&quot;<br>';
$r = 'Обыскав &quot;'.$obj['name'].'&quot; вы обнаружили &quot;'.$vad['items']['name'].'&quot;';
2022-06-06 21:30:34 +00:00
$this->pickitem($obj,$vad['items']['id'],$u->info['id'],'',$vad['dn_delete'][$vad['items']['id']]);
//echo '<script>location.href="main.php"</script>';
} else {
2023-01-10 16:29:32 +00:00
$r = 'Что-то пошло не так, попробуйте позже.';
2022-06-06 21:30:34 +00:00
}
}elseif( !isset($vad['sp']['id']) ) {
2023-01-10 16:29:32 +00:00
$r = 'Требуется один из драгоценных камней';
2022-06-06 21:30:34 +00:00
}
unset($vad);
}
?>