2023-03-31 18:42:06 +00:00
< ? php
2023-12-01 21:27:45 +00:00
use Helper\Conversion ;
if ( ! defined ( 'GAME' )) {
die ();
2022-06-06 21:30:34 +00:00
}
2023-12-01 21:27:45 +00:00
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 = 'Задержка не прошла, еще ' . Conversion :: secondsToTimeout ( $test [ 'time' ] - time ());
} else {
//
$dngcity = [
5035 => [ 'angelscity' , 'Бездна' ],
5036 => [ 'capitalcity' , 'Пещера Тысячи Проклятий' ],
5037 => [ 'demonscity' , 'Катакомбы' ],
5038 => [ 'abandonedplain' , 'Гора Легиона' ], //mooncity
5039 => [ 'suncity' , 'Грибница' ],
5040 => [ '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 ] . ')' ;
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 = 'Хаосники не могут пользоваться этим свитком!' ;
}
2022-06-06 21:30:34 +00:00
}