35 lines
1.4 KiB
PHP
35 lines
1.4 KiB
PHP
<?
|
|
if( isset($s[1]) && $s[1] == '101/altar' ) {
|
|
/*
|
|
Àëòàðü
|
|
* Òåëåïîðòèðóåò íà íåîáõîäèìóþ êëåòêó õ -3 , ó 7
|
|
* Äëÿ ïðîõîäà òðåáóåòñÿ 1 êàìåíü òèïà 881 èëè 878
|
|
*/
|
|
//Âñå ïåðåìåííûå ñîõðàíÿòü â ìàññèâå $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 ) {
|
|
mysql_query('UPDATE `stats` SET `x` = "-3",`y` = "7",`s` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
|
|
// $u->deleteItem(,$u->info['id'],1); // Óáðàíî 14.10.2015
|
|
$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$vad['sp']['id'].'" LIMIT 1');
|
|
if($upd){
|
|
$r = 'Âû ðàñòâîðèëè "'.$vad['pl']['name'].'" â àëòàðå è ïðîèçîøåë âçðûâ. Àëòàðü ïåðåìåñòèë âàñ â òàéíóþ êîìíàòó';
|
|
echo '<script>location.href="main.php"</script>';
|
|
} else {
|
|
$r = '×òî-òî ïîøëî íå òàê, ïîïðîáóéòå ïîçæå.';
|
|
}
|
|
}elseif( !isset($vad['sp']['id']) ) {
|
|
$r = 'Äëÿ ïåðåìåùåíèÿ òðåáóåòñÿ îäèí èç äðàãîöåííûõ êàìíåé';
|
|
}
|
|
unset($vad);
|
|
}
|
|
?>
|