58 lines
3.4 KiB
PHP
58 lines
3.4 KiB
PHP
<?
|
|
if( isset($s[1]) && $s[1] == '12/fontan3' ) {
|
|
//Âñå ïåðåìåííûå ñîõðàíÿòü â ìàññèâå $vad !
|
|
$vad = array(
|
|
'go' => false
|
|
);
|
|
|
|
// Òðåáóåòñÿ äîáàâèòü ïðîâåðêó Íå áîëüøå 2 èãðîêîâ èç ãðóïïû.
|
|
|
|
$vad['use_fontan'] = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_actions` WHERE `uid` = "'.$u->info['id'].'" AND `dn` = "'.$u->info['dnow'].'" AND `vars` = "use_fontan" AND `vals` = "3" LIMIT 1')); // Ïðîâåðêà íà èñïîëüçîâàíåå ðàíåå.
|
|
if(!isset($vad['use_fontan']['id'])) {
|
|
$vad['all_uses'] = mysql_num_rows(mysql_query('SELECT * FROM `dungeon_actions` WHERE `dn` = "'.$u->info['dnow'].'" AND `vars` = "use_fontan" AND `vals` = "3" LIMIT 5'));
|
|
if($vad['all_uses']>=2){
|
|
$r = 'Íè÷åãî íå îñòàëîñü, êòî-òî ïîáûâàë çäåñü ðàíüøå.';
|
|
} else {
|
|
$vad['kill_monsters'] = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE ((`id_bot` = "370" && `x` = "-2" && `y` = "31") OR (`id_bot` = "374" && `x` = "-2" && `y` = "31") OR (`id_bot` = "375" && `x` = "-3" && `y` = "32") OR (`id_bot` = "375" && `x` = "-3" && `y` = "32") OR (`id_bot` = "373" && `x` = "-1" && `y` = "32") OR (`id_bot` = "373" && `x` = "-3" && `y` = "32") OR (`id_bot` = "373" && `x` = "-3" && `y` = "31")) AND `delete` = "0" AND `dn` = "'.$u->info['dnow'].'" AND `for_dn` = "0" LIMIT 10')); //Ïðîâåðÿåì óáèòà ëè ãðóïïà ìîíñòðîâ
|
|
if( !isset($vad['kill_monsters']['0']['id2']) ) {
|
|
$vad['bt'] = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "2" AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
|
|
if( isset($vad['bt']['id']) ) {
|
|
//if( $vad['bt']['inGroup'] > 0 ) {
|
|
// $r = 'Ïðåäìåò íå äîëæåí íàõîäèòüñÿ â ãðóïïå';
|
|
//}else{
|
|
// Âûáèðàåì êàìíè
|
|
$vad['gems']['query'] = mysql_query('SELECT `id`,`inGroup` FROM `items_users` WHERE (`item_id` = "908" OR `item_id` = "906" OR `item_id` = "907" OR `item_id` = "881" OR `item_id` = "878" OR `item_id` = "888") AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `inOdet` = "0" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 99');
|
|
// Âûáèðàåì ðàíäîìíûé êàìåíü èç...
|
|
$vad['gems']['query'] = mysql_result($vad['gems']['query'], (rand(0, (mysql_num_rows($vad['gems']['query'])-1))),0);
|
|
|
|
if( $vad['gems']['query'] != "" ) {
|
|
$vad['go'] = true;
|
|
} else {
|
|
$r = '×òî-òî ïîøëî íå òàê, íåîáõîäèì äðàãîöåííûé êàìåíü...';
|
|
}
|
|
//}
|
|
} else {
|
|
$r = 'Ó âàñ íåò ïóñòîé áóòûëêè.';
|
|
}
|
|
} else {
|
|
$r = 'Âû óâåðåíû ÷òî óáèëè âñþ ãðóïïó ìîíñòðîâ?';
|
|
}
|
|
}
|
|
} else {
|
|
if($u->info['sex']==1)$a='à'; else $a='';
|
|
$r = 'Ìíå êàæåòñÿ, ÷òî çäåñü ÿ óæå áûë'.$a.'..';
|
|
}
|
|
|
|
if( $vad['go'] == true ) {
|
|
|
|
mysql_query('INSERT INTO `dungeon_actions` (`uid`,`dn`,`x`,`y`,`time`,`vars`,`vals`) VALUES ( "'.$u->info['id'].'","'.$u->info['dnow'].'","'.$u->info['x'].'","'.$u->info['y'].'","'.time().'", "use_fontan","3" )'); // Âûïèëè ðàç, âîò è õâàòèò ñ âàñ!
|
|
$r = 'Îïóñòèâ ïóñòóþ áóòûëêó â ôîíòàí âû íàïîëíèëè å¸.';
|
|
|
|
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['gems']['query'])).'" LIMIT 1');
|
|
mysql_query('DELETE FROM `items_users` WHERE `id` = "'.mysql_real_escape_string(intval($vad['bt']['id'])).'" LIMIT 1');
|
|
|
|
$u->addItem(round(1188),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Âåëèêîå çåëüå Îòðèöàíèÿ 1188
|
|
}
|
|
unset($vad);
|
|
}
|
|
?>
|