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

32 lines
1.7 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
if( isset($s[1]) && $s[1] == '3/fontan_win' ) {
//Все переменные сохранять в массиве $vad !
$vad = array(
'go' => false
);
//Проверяем камни
$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']) ) {
// Удалена проверка на группировку предметов 13.10.2015
$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){
$r = 'Вы растворили &quot;'.$vad['pl']['name'].'&quot;<br>';
$r = 'Обыскав &quot;'.$obj['name'].'&quot; вы обнаружили &quot;'.$vad['items']['name'].'&quot;';
$this->pickitem($obj,$vad['items']['id'],$u->info['id'],'',$vad['dn_delete'][$vad['items']['id']]);
//echo '<script>location.href="main.php"</script>';
} else {
$r = 'Что-то пошло не так, попробуйте позже.';
}
}elseif( !isset($vad['sp']['id']) ) {
$r = 'Требуется один из драгоценных камней';
}
unset($vad);
}
?>