game/_incl_data/class/dnaction/12/fontan2.php
2022-06-07 00:30:34 +03:00

44 lines
2.3 KiB
PHP

<?
if( isset($s[1]) && $s[1] == '12/fontan2' ) {
//Âñå ïåðåìåííûå ñîõðàíÿòü â ìàññèâå $vad !
$vad = array(
'go' => false
);
// Òðåáóåòñÿ äîáàâèòü íà ïðîâåðêó Íå áîëüøå 4 èãðîêîâ èç ãðóïïû.
$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` = "2" 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` = "2" LIMIT 5'));
if($vad['all_uses']>=4){
$r = 'Íè÷åãî íå îñòàëîñü, êòî-òî ïîáûâàë çäåñü ðàíüøå.';
} else {
$vad['kill_dk'] = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_bots` WHERE `id_bot` = "123" AND `dn` = "'.$u->info['dnow'].'" AND `for_dn` = "0" LIMIT 1')); //Ïðîâåðÿåì óáèòà ëè Äàðüÿíà Êîðò
if( isset($vad['kill_dk']['id2']) ) {
if( $vad['kill_dk']['delete'] > 0 ) {
$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']) ) {
$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","2" )'); // Âûïèëè ðàç, âîò è õâàòèò ñ âàñ!
$r = 'Îïóñòèâ ïóñòóþ áóòûëêó â ôîíòàí âû íàïîëíèëè å¸.';
$u->deleteItem(intval($vad['bt']['id']),$u->info['id'],1); // Óäàëÿåì Ïóñòàÿ Áóòûëêà = 2.
$u->addItem(round(1186),$u->info['id'],'|musor=2|noremont=1|nosale=1',12, 3); // Âåëèêîå çåëüå Ñòîéêîñòè 1186
}
unset($vad);
}
?>