41 lines
1.5 KiB
PHP
41 lines
1.5 KiB
PHP
<?
|
|
if(!defined('GAME'))
|
|
{
|
|
die();
|
|
}
|
|
|
|
if( $itm['magic_inci'] == 'podvig' ) {
|
|
$test = mysql_fetch_array(mysql_query('SELECT `id`,`time` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "podvig" AND `time` > "'.(time()).'" LIMIT 1'));
|
|
if( $u->info['align'] != 2 ) {
|
|
if( isset($test['id']) ) {
|
|
$u->error = 'Çàäåðæêà íå ïðîøëà, åùå '.$u->timeOut($test['time']-time());
|
|
}else{
|
|
//
|
|
$dngcity = array(
|
|
5035 => array('angelscity','Áåçäíà'),
|
|
5036 => array('capitalcity','Ïåùåðà Òûñÿ÷è Ïðîêëÿòèé'),
|
|
5037 => array('demonscity','Êàòàêîìáû'),
|
|
5038 => array('abandonedplain','Ãîðà Ëåãèîíà'), //mooncity
|
|
5039 => array('suncity','Ãðèáíèöà'),
|
|
5040 => array('sandcity','Ïåùåðà Ìãëû')
|
|
);
|
|
//
|
|
$dngcity = $dngcity[$itm['item_id']];
|
|
//
|
|
$hgo1 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > "'.(time()-86400).'" AND `vars` = "psh_qt_'.$dngcity[0].'" LIMIT 1',1);
|
|
if(!isset($hgo1['id'])) {
|
|
$u->error = 'Íåò çàäåðæêè äëÿ ïîäçåìåëüÿ '.$dngcity[1].'.';
|
|
}else{
|
|
//
|
|
$u->addAction(time(),'podvig','');
|
|
//$u->error = 'Âñå ïðîøëî óñïåøíî, çàäåðæêè íà ïîëó÷åíèå çàäàíèÿ â ïåùåðó '.$dngcity[1].' ñíÿòà.';
|
|
$u->error = 'Óñïåøíî èñïîëüçîâàí ñâèòîê Ïðàâî íà Ïîäâèã ('.$dngcity[1].')';
|
|
mysql_query('UPDATE `actions` SET `time` = "'.(time()-86401).'" WHERE `id` = "'.($hgo1['id']).'" LIMIT 1');
|
|
mysql_query('UPDATE `items_users` SET `iznosNOW` = `iznosNOW` + 1 WHERE `id` = "'.$itm['id'].'" LIMIT 1');
|
|
}
|
|
}
|
|
}else{
|
|
$u->error = 'Õàîñíèêè íå ìîãóò ïîëüçîâàòüñÿ ýòèì ñâèòêîì!';
|
|
}
|
|
}
|
|
?>
|