Эффект "' . $u->stats['effects'][$i]['name'] . '" был принудительно завершен.
';
$clr = $clr == 'C7' ? 'D5' : 'C7';
} else {
- $ae .= '' . $v1 . ' ' . $v2 . ' ' . $u->timeOut($e['endTime'] - time()) . ' ' . $v1 . ' ' . $v2 . ' ' . Conversion::secondsToTimeout($e['endTime'] - time()) . ' pgpar[$tp];
- $ae .= '• ' . $v[0] . ' [' . $lvlp . '], еще ' . $u->timeOut($pl['timeUse'] - time()) . ', начнет действовать через ' . $u->timeOut($pl['deactiveTime'] - time()) . ' ';
+ $ae .= '• ' . $v[0] . ' [' . $lvlp . '], еще ' . Conversion::secondsToTimeout($pl['timeUse'] - time()) . ', начнет действовать через ' . Conversion::secondsToTimeout($pl['deactiveTime'] - time()) . ' ';
}
if ($ae) {
@@ -1587,7 +1587,7 @@ $tma = '';
);
if (isset($psh['id'])) {
$clr = $clr == 'C7' ? 'D5' : 'C7';
- echo ' Время до подземелья: ' . $u->timeOut(($psh['time'] + 60 * 60 * 3) - time()) . ' ';
+ echo ' Время до подземелья: ' . Conversion::secondsToTimeout(($psh['time'] + 60 * 60 * 3) - time()) . ' ';
}
?>
Эффекты:
@@ -2278,7 +2278,7 @@ $tma = '';
);
while ($pl = mysql_fetch_array($sp)) {
$ic1 = str_replace('psh_qt_', '', $pl['vars']);
- echo ' Задержка на получение задания в ' . $u->city_name[$ic1] . ' ' . $u->timeOut((86400 + $pl['time']) - time()) . ' ';
+ echo ' Задержка на получение задания в ' . $u->city_name[$ic1] . ' ' . Conversion::secondsToTimeout((86400 + $pl['time']) - time()) . ' ';
}
//Пещеры
$dungeon_timeout = $u->testAction(
@@ -2286,7 +2286,7 @@ $tma = '';
1
);
if ($dungeon_timeout['vars'] == "psh0") {
- echo 'Задержка на посещение подземелья: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . ' ';
+ echo 'Задержка на посещение подземелья: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']) . ' ';
}
?>
diff --git a/modules_data/location/bsenter.php b/modules_data/location/bsenter.php
index 7f0155a2..579cda5a 100644
--- a/modules_data/location/bsenter.php
+++ b/modules_data/location/bsenter.php
@@ -1,273 +1,340 @@
room['file'] == 'bsenter') {
- $r = 2;
- if(isset($_GET['r'])) {
- $_GET['r'] = (int)$_GET['r'];
- if($_GET['r'] == 7 || $_GET['r'] == 8 || $_GET['r'] == 9 || $_GET['r'] == 10 || $_GET['r'] == 11) { $r = round($_GET['r']-6); }
- if($u->info['level'] < $r+6) { $r = 1; }
+use Helper\Conversion;
+
+if (!defined('GAME')) {
+ die();
}
-function changeSleep($uid,$sleep_action){
- global $u;
- if( $sleep_action == 1 ){
- //
- mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("'.$uid.'","'.time().'","1")');
- //
- mysql_query("UPDATE `eff_users` SET `sleeptime`=".time().",`deactiveLast` = ( `deactiveTime` - ".time()." ) WHERE `uid`='".mysql_real_escape_string($uid)."' AND `no_Ace` = 0 AND `delete` = 0");
- mysql_query('UPDATE `items_users` SET `time_sleep` = "'.time().'" WHERE `uid` = "'.$uid.'" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"');
- $u->addAction(time(),'sleep',$u->info['city']);
- //
- } elseif( $sleep_action == 2 ){
- //
- mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("'.$uid.'","'.time().'","2")');
- //
- $sp = mysql_query('SELECT * FROM `items_users` WHERE `time_sleep` > 0 AND `uid` = "'.$uid.'" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"');
- while( $pl = mysql_fetch_array($sp) ) {
- $tm_add = time() - $pl['time_sleep'];
- mysql_query('UPDATE `items_users` SET `time_sleep` = "0",`time_create` = "'.($pl['time_create'] + $tm_add).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- }
- $sp = mysql_query('SELECT `id`,`deactiveTime`,`deactiveLast` FROM `eff_users` WHERE `v1` LIKE "pgb%" AND `delete` = "0" AND `deactiveTime` > 0 AND `uid` = "'.$uid.'" ORDER BY `timeUse` DESC');
- while($pl = mysql_fetch_array($sp)) {
- mysql_query("UPDATE `eff_users` SET `deactiveTime` = ".(time()+$pl['deactiveLast'])." WHERE `id`='".$pl['id']."' ");
- }
- $sp = mysql_query('SELECT `id`,`sleeptime`,`timeUse` FROM `eff_users` WHERE `uid`="'.mysql_real_escape_string($uid).'" AND `no_Ace` = 0 AND `sleeptime` > 0 AND `delete` = 0');
- while($pl = mysql_fetch_array($sp)) {
- $timeUsen = time()-($pl['sleeptime']-$pl['timeUse']);
- mysql_query("UPDATE `eff_users` SET `timeUse`='".$timeUsen."',`sleeptime`='0' WHERE `id`='".$pl['id']."' ");
- }
- mysql_query('UPDATE `actions` SET `vars` = "unsleep",`val` = "'.time().'" WHERE `id` = "'.$sleep['id'].'" LIMIT 1');
- }
-}
+if ($u->room['file'] == 'bsenter') {
+ $r = 2;
+ if (isset($_GET['r'])) {
+ $_GET['r'] = (int)$_GET['r'];
+ if ($_GET['r'] == 7 || $_GET['r'] == 8 || $_GET['r'] == 9 || $_GET['r'] == 10 || $_GET['r'] == 11) {
+ $r = round($_GET['r'] - 6);
+ }
+ if ($u->info['level'] < $r + 6) {
+ $r = 1;
+ }
+ }
-$t = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "'.$u->info['city'].'" AND `level` = "'.((int)($r+6)).'" LIMIT 1'));
-if(isset($t['id'])) {
- if($t['time_start'] > time()) {
- $tz = mysql_fetch_array(mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` = 0 LIMIT 1'));
- $tz_all = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` <= "'.$t['time_start'].'" LIMIT 1'));
- }
- if(isset($_POST['coin']) && $t['time_start'] > time() ) {
- $_POST['coin'] = round((int)$_POST['coin'],2);
- if((round((int)$tz['money'], 2) + $_POST['coin']) > 3*$u->info['level'] || $tz_all[0] > 3*$u->info['level']) {
- $error = 'Вам нельзя делать ставку выше '.(3* $u->info['level']).' кр.';
- } elseif(($_POST['coin'] >= $t['min_money'] || (isset($tz['id']) && $_POST['coin'] >= 1)) && $u->info['money'] >= $_POST['coin']) {
- $t['money'] += $_POST['coin'];
- $u->info['money'] -= $_POST['coin'];
- if(isset($tz['id'])) {
- $tz['money'] += $_POST['coin'];
- mysql_query('UPDATE `bs_zv` SET `money` = "'.$tz['money'].'" WHERE `id` = "'.$tz['id'].'" LIMIT 1');
- } else {
- //создаем
- $tz_all = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1'));
- $ins = mysql_query('INSERT INTO `bs_zv` (`bsid`,`money`,`time`,`uid`) VALUES ("'.$t['id'].'","'.mysql_real_escape_string($_POST['coin']).'","'.$t['time_start'].'","'.$u->info['id'].'")');
- if($ins) {
- $tz_all = mysql_fetch_array(mysql_query('SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "'.$t['id'].'" AND `time` = "'.$t['time_start'].'" AND `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1'));
- if( $tz_all[0] > 0 ) {
- $_POST['coin'] = $tz_all[0];
- $error = 'Ваша ставка была возвращена. ('.round($_POST['coin'],2).' кр.)';
- }
- $t['users']++;
- $tz = array('id'=>1, 'bsid'=>$t['id'], 'money'=>$_POST['coin'], 'time'=>$t['time_start'], 'finish'=>0);
- }
- }
- mysql_query('UPDATE `bs_turnirs` SET `money` = "'.$t['money'].'", `users` = "'.$t['users'].'" WHERE `id` = "'.$t['id'].'" LIMIT 1');
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
-}
+ function changeSleep($uid, $sleep_action)
+ {
+ global $u;
+ if ($sleep_action == 1) {
+ //
+ mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","1")');
+ //
+ mysql_query(
+ "UPDATE `eff_users` SET `sleeptime`=" . time() . ",`deactiveLast` = ( `deactiveTime` - " . time() . " ) WHERE `uid`='" . mysql_real_escape_string(
+ $uid
+ ) . "' AND `no_Ace` = 0 AND `delete` = 0"
+ );
+ mysql_query('UPDATE `items_users` SET `time_sleep` = "' . time() . '" WHERE `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"');
+ $u->addAction(time(), 'sleep', $u->info['city']);
+ //
+ } elseif ($sleep_action == 2) {
+ //
+ mysql_query('INSERT INTO `sleep` (`uid`,`time`,`sleep`) VALUES ("' . $uid . '","' . time() . '","2")');
+ //
+ $sp = mysql_query('SELECT * FROM `items_users` WHERE `time_sleep` > 0 AND `uid` = "' . $uid . '" AND `delete` < 1001 AND `data` LIKE "%|sleep_moroz=1%"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $tm_add = time() - $pl['time_sleep'];
+ mysql_query('UPDATE `items_users` SET `time_sleep` = "0",`time_create` = "' . ($pl['time_create'] + $tm_add) . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ }
+ $sp = mysql_query(
+ 'SELECT `id`,`deactiveTime`,`deactiveLast` FROM `eff_users` WHERE `v1` LIKE "pgb%" AND `delete` = "0" AND `deactiveTime` > 0 AND `uid` = "' . $uid . '" ORDER BY `timeUse` DESC'
+ );
+ while ($pl = mysql_fetch_array($sp)) {
+ mysql_query("UPDATE `eff_users` SET `deactiveTime` = " . (time() + $pl['deactiveLast']) . " WHERE `id`='" . $pl['id'] . "' ");
+ }
+ $sp = mysql_query('SELECT `id`,`sleeptime`,`timeUse` FROM `eff_users` WHERE `uid`="' . mysql_real_escape_string($uid) . '" AND `no_Ace` = 0 AND `sleeptime` > 0 AND `delete` = 0');
+ while ($pl = mysql_fetch_array($sp)) {
+ $timeUsen = time() - ($pl['sleeptime'] - $pl['timeUse']);
+ mysql_query("UPDATE `eff_users` SET `timeUse`='" . $timeUsen . "',`sleeptime`='0' WHERE `id`='" . $pl['id'] . "' ");
+ }
+ mysql_query('UPDATE `actions` SET `vars` = "unsleep",`val` = "' . time() . '" WHERE `id` = "' . $sleep['id'] . '" LIMIT 1');
+ }
+ }
-if($u->info['id'] != 7) {
-?>
-
-'.$re.' ';
-}
-?>
-
-
-
-
= $u->room['name']; ?>
-
-
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
+ $t = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "' . $u->info['city'] . '" AND `level` = "' . ((int)($r + 6)) . '" LIMIT 1'));
+ if (isset($t['id'])) {
+ if ($t['time_start'] > time()) {
+ $tz = mysql_fetch_array(
+ mysql_query('SELECT * FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` = 0 LIMIT 1')
+ );
+ $tz_all = mysql_fetch_array(
+ mysql_query(
+ 'SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` <= "' . $t['time_start'] . '" LIMIT 1'
+ )
+ );
+ }
+ if (isset($_POST['coin']) && $t['time_start'] > time()) {
+ $_POST['coin'] = round((int)$_POST['coin'], 2);
+ if ((round((int)$tz['money'], 2) + $_POST['coin']) > 3 * $u->info['level'] || $tz_all[0] > 3 * $u->info['level']) {
+ $error = 'Вам нельзя делать ставку выше ' . (3 * $u->info['level']) . ' кр.';
+ } elseif (($_POST['coin'] >= $t['min_money'] || (isset($tz['id']) && $_POST['coin'] >= 1)) && $u->info['money'] >= $_POST['coin']) {
+ $t['money'] += $_POST['coin'];
+ $u->info['money'] -= $_POST['coin'];
+ if (isset($tz['id'])) {
+ $tz['money'] += $_POST['coin'];
+ mysql_query('UPDATE `bs_zv` SET `money` = "' . $tz['money'] . '" WHERE `id` = "' . $tz['id'] . '" LIMIT 1');
+ } else {
+ //создаем
+ $tz_all = mysql_fetch_array(
+ mysql_query(
+ 'SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1'
+ )
+ );
+ $ins = mysql_query(
+ 'INSERT INTO `bs_zv` (`bsid`,`money`,`time`,`uid`) VALUES ("' . $t['id'] . '","' . mysql_real_escape_string(
+ $_POST['coin']
+ ) . '","' . $t['time_start'] . '","' . $u->info['id'] . '")'
+ );
+ if ($ins) {
+ $tz_all = mysql_fetch_array(
+ mysql_query(
+ 'SELECT SUM(`money`) FROM `bs_zv` WHERE `bsid` = "' . $t['id'] . '" AND `time` = "' . $t['time_start'] . '" AND `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1'
+ )
+ );
+ if ($tz_all[0] > 0) {
+ $_POST['coin'] = $tz_all[0];
+ $error = 'Ваша ставка была возвращена. (' . round($_POST['coin'], 2) . ' кр.)';
+ }
+ $t['users']++;
+ $tz = ['id' => 1, 'bsid' => $t['id'], 'money' => $_POST['coin'], 'time' => $t['time_start'], 'finish' => 0];
+ }
+ }
+ mysql_query('UPDATE `bs_turnirs` SET `money` = "' . $t['money'] . '", `users` = "' . $t['users'] . '" WHERE `id` = "' . $t['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ }
+
+ if ($u->info['id'] != 7) {
+ ?>
+
+ ' . $re . ' ';
+ }
+ ?>
+
+
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
-
-
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-Поздравляем! Вы успешно допускаетесь к турниру!
-
-
+
+
+
+
+ Поздравляем! Вы успешно допускаетесь к турниру!
+
+
+
+
-Топ 10 игроков (новая статистиика) турнир 5//=$t['level']?> уровней
-0 ORDER BY `win_bs` DESC LIMIT 10');
-$i = 1;
-while ($pl = mysql_fetch_array($sp)) {
- $wuser = ''.$pl['login'].' ['.$pl['level'].'] ';
- if( $pl['clan'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- if( $pl['align'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- echo ''.$i.'. Место: '.$wuser.' побед: '.$pl['win_bs'].' ';
- $i++;
-}
-?>
-Победители 10-ти предыдущих турниров для 5//=$t['level']?> уровней
- 0 ORDER BY `id` DESC LIMIT 10');
-$i = 1;
-while ($pl = mysql_fetch_array($sp)) {
- $wuser = ''.$pl['wlogin'].' ['.$pl['wlevel'].'] ';
- if( $pl['wclan'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- if( $pl['walign'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- echo $i.'. Победитель: '.$wuser.' Начало турнира '.date('d.m.Y H:i',($pl['time_start']+60)).' продолжительность '.$u->timeOut( $pl['time_sf'] ).' приз: '.$pl['money'].' История турнира »» ';
- $i++;
-}
-?>
-Максимальный выигрыш для 5//=$t['level']?> уровней
- 0 ORDER BY `money` DESC LIMIT 1');
-$i = 1;
-while ($pl = mysql_fetch_array($sp)) {
- $wuser = ''.$pl['wlogin'].' ['.$pl['wlevel'].'] ';
- if( $pl['wclan'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- if( $pl['walign'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- echo 'Победитель: '.$wuser.' Начало турнира '.date('d.m.Y H:i',($pl['time_start']+60)).' продолжительность '.$u->timeOut( $pl['time_sf'] ).' приз: '.$pl['money'].' История турнира »» ';
- $i++;
-}
-?>
-Самый продолжительный турнир для 5//=$t['level']?> уровней
- 0 ORDER BY `time_sf` DESC LIMIT 1');
-$i = 1;
-while ($pl = mysql_fetch_array($sp)) {
- $wuser = ''.$pl['wlogin'].' ['.$pl['wlevel'].'] ';
- if( $pl['wclan'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- if( $pl['walign'] > 0 ) {
- $wuser = ' '.$wuser;
- }
- echo 'Победитель: '.$wuser.' Начало турнира'.date('d.m.Y H:i',($pl['time_start']+60)).' продолжительность '.$u->timeOut( $pl['time_sf'] ).' приз: '.$pl['money'].' История турнира »» ';
- $i++;
-}
-?>
-
-
\ No newline at end of file
+ $notowerlog = false;
+ $log = mysql_fetch_array(mysql_query('SELECT `id`,`count_bs`,`m` FROM `bs_logs` WHERE `count_bs` = "' . mysql_real_escape_string($t['count']) . '" ORDER BY `id` ASC LIMIT 1'));
+ if (!isset($log['id'])) {
+ $notowerlog = true;
+ $r = 'Скорее всего Архивариус снова потерял пергамент с хрониками турниров ...
';
+ } else {
+ $sp = mysql_query('SELECT * FROM `bs_logs` WHERE `count_bs` = "' . $log['count_bs'] . '" ORDER BY `id` ASC');
+ while ($pl = mysql_fetch_array($sp)) {
+ $datesb = '';
+ if ($pl['type'] == 2) {
+ $datesb = '2';
+ }
+ $r .= '' . date('d.m.y H:i', $pl['time']) . ' ' . $pl['text'] . '';
+ }
+ $liveusers = '';
+ $sp = mysql_query('SELECT `id` FROM `users` WHERE `inTurnir` = "' . $t['id'] . '"');
+ while ($plu = mysql_fetch_array($sp)) {
+ $pl = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`level` FROM `users` WHERE `inUser` = "' . $plu['id'] . '"'));
+ if (isset($pl['id'])) {
+ $alc = '';
+ if ($pl['align'] > 0) {
+ $alc .= ' ';
+ }
+ if ($pl['clan'] > 0) {
+ $alc .= ' ';
+ }
+ $liveusers .= ', ' . $alc . $pl['login'] . ' [' . $pl['level'] . '] ';
+ }
+ }
+ $r .= ' Всего живых участников на данный момент: ' . $t['users'] . ' (' . ltrim($liveusers, ', ') . ')';
+ unset($liveusers, $alc);
+ }
+ if ($notowerlog == false) { ?>
+ Призовой фонд: = $log['m'] ?> кр.
+
+
+
+
+
+ Топ 10 игроков (новая статистиика) турнир 5 //=$t['level']?> уровней
+ 0 ORDER BY `win_bs` DESC LIMIT 10');
+ $i = 1;
+ while ($pl = mysql_fetch_array($sp)) {
+ $wuser = '' . $pl['login'] . ' [' . $pl['level'] . '] ';
+ if ($pl['clan'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ if ($pl['align'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ echo '' . $i . '. Место: ' . $wuser . ' побед: ' . $pl['win_bs'] . ' ';
+ $i++;
+ }
+ ?>
+ Победители 10-ти предыдущих турниров для 5 //=$t['level']?> уровней
+ 0 ORDER BY `id` DESC LIMIT 10');
+ $i = 1;
+ while ($pl = mysql_fetch_array($sp)) {
+ $wuser = '' . $pl['wlogin'] . ' [' . $pl['wlevel'] . '] ';
+ if ($pl['wclan'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ if ($pl['walign'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ echo $i . '. Победитель: ' . $wuser . ' Начало турнира ' . date(
+ 'd.m.Y H:i', ($pl['time_start'] + 60)
+ ) . ' продолжительность ' . Conversion::secondsToTimeout(
+ $pl['time_sf']
+ ) . ' приз: ' . $pl['money'] . ' История турнира »» ';
+ $i++;
+ }
+ ?>
+ Максимальный выигрыш для 5 уровней
+ 0 ORDER BY `money` DESC LIMIT 1');
+ $i = 1;
+ while ($pl = mysql_fetch_array($sp)) {
+ $wuser = '' . $pl['wlogin'] . ' [' . $pl['wlevel'] . '] ';
+ if ($pl['wclan'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ if ($pl['walign'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ echo 'Победитель: ' . $wuser . ' Начало турнира ' . date('d.m.Y H:i', ($pl['time_start'] + 60)) . ' продолжительность ' . Conversion::secondsToTimeout(
+ $pl['time_sf']
+ ) . ' приз: ' . $pl['money'] . ' История турнира »» ';
+ $i++;
+ }
+ ?>
+ Самый продолжительный турнир для 5 //=$t['level']?> уровней
+ 0 ORDER BY `time_sf` DESC LIMIT 1');
+ $i = 1;
+ while ($pl = mysql_fetch_array($sp)) {
+ $wuser = '' . $pl['wlogin'] . ' [' . $pl['wlevel'] . '] ';
+ if ($pl['wclan'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ if ($pl['walign'] > 0) {
+ $wuser = ' ' . $wuser;
+ }
+ echo 'Победитель: ' . $wuser . ' Начало турнира' . date('d.m.Y H:i', ($pl['time_start'] + 60)) . ' продолжительность ' . Conversion::secondsToTimeout(
+ $pl['time_sf']
+ ) . ' приз: ' . $pl['money'] . ' История турнира »» ';
+ $i++;
+ }
+ ?>
+
+
\ No newline at end of file
diff --git a/modules_data/location/dragopsh.php b/modules_data/location/dragopsh.php
index efa134d4..354323ea 100644
--- a/modules_data/location/dragopsh.php
+++ b/modules_data/location/dragopsh.php
@@ -1,4 +1,7 @@
room['file'] != 'dragopsh') {
}
$d = new Dungeon;
-function sendSysChat(string $message, bool $hasDn = false, bool $hasReceiver = false) {
+function sendSysChat(string $message, bool $hasDn = false, bool $hasReceiver = false)
+{
global $u;
$cmsg = new ChatMessage();
$cmsg->setCity($u->info['city']);
@@ -55,13 +59,23 @@ $dies = $dies[0];
$map_d = json_decode($map['data']);
$varos = [];
-$varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1'));
+$varos['trap1'] = mysql_fetch_array(
+ mysql_query(
+ 'SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1'
+ )
+);
$errors = '';
$effed = '';
if (isset($_GET['takeitm'])) {
- $var = ['obj' => mysql_fetch_array(mysql_query('SELECT `i`.*,`m`.`name`,`m`.`inslot` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`id` = "' . mysql_real_escape_string($_GET['takeitm']) . '" AND `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" LIMIT 1'))];
+ $var = ['obj' => mysql_fetch_array(
+ mysql_query(
+ 'SELECT `i`.*,`m`.`name`,`m`.`inslot` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`id` = "' . mysql_real_escape_string(
+ $_GET['takeitm']
+ ) . '" AND `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" LIMIT 1'
+ )
+ )];
if (isset($var['obj']['id'])) {
if ($var['obj']['take'] == 0) {
$var['sex'] = '';
@@ -84,7 +98,13 @@ if (isset($_GET['takeitm'])) {
$errors = 'Предмет не найден... ';
}
} elseif (isset($_GET['useobj'])) {
- $var = ['obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "' . mysql_real_escape_string($_GET['useobj']) . '" AND `lib` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1'))];
+ $var = ['obj' => mysql_fetch_array(
+ mysql_query(
+ 'SELECT * FROM `laba_obj` WHERE `id` = "' . mysql_real_escape_string(
+ $_GET['useobj']
+ ) . '" AND `lib` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1'
+ )
+ )];
if (isset($var['obj']['id'])) {
if ($var['obj']['use'] == 0) {
if ($var['obj']['type'] == 1) {
@@ -101,9 +121,11 @@ if (isset($_GET['takeitm'])) {
$var['itm'] = $var['itm'][0];
$var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1'));
if (isset($var['itm']['id'])) {
- mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
+ mysql_query(
+ 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
"' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['itm']['id'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0"
- )');
+ )'
+ );
} else {
$var['itm']['name'] = 'Предмет рассыпался на глазах...';
}
@@ -135,9 +157,11 @@ if (isset($_GET['takeitm'])) {
$var['itm'] = $var['itm'][0];
$var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1'));
if (isset($var['itm']['id'])) {
- mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
+ mysql_query(
+ 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
"' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['itm']['id'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0"
- )');
+ )'
+ );
} else {
$var['itm']['name'] = 'Предмет рассыпался на глазах...';
}
@@ -146,9 +170,11 @@ if (isset($_GET['takeitm'])) {
$var['itm'] = $var['itm'][0];
$var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "' . $var['itm'] . '" LIMIT 1'));
if (isset($var['itm']['id'])) {
- mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
+ mysql_query(
+ 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
"' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['itm']['id'] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0"
- )');
+ )'
+ );
} else {
$var['itm']['name'] = 'Предмет рассыпался на глазах...';
}
@@ -207,7 +233,9 @@ if ($real_x > count($map_d) - 7) {
$objs = [];
-$sp = mysql_query('SELECT * FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '" AND `x` > ' . ($real_x - 7) . ' AND `x` < ' . ($real_x + 7) . ' AND `y` > ' . ($real_y - 12) . ' AND `y` < ' . ($real_y + 12) . ' LIMIT 144');
+$sp = mysql_query(
+ 'SELECT * FROM `laba_obj` WHERE `lib` = "' . $lab['id'] . '" AND `x` > ' . ($real_x - 7) . ' AND `x` < ' . ($real_x + 7) . ' AND `y` > ' . ($real_y - 12) . ' AND `y` < ' . ($real_y + 12) . ' LIMIT 144'
+);
while ($pl = mysql_fetch_array($sp)) {
$objs[$pl['x']][$pl['y']] = $pl;
}
@@ -260,7 +288,9 @@ if (isset($_GET['goto'])) {
}
$u->info['timeGo'] = time() + $varos['timego'];
$u->info['timeGoL'] = time();
- mysql_query('UPDATE `stats` SET `x` = "' . $u->info['x'] . '" ,`y` = "' . $u->info['y'] . '",`timeGoL` = "' . $u->info['timeGoL'] . '",`timeGo` = "' . $u->info['timeGo'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query(
+ 'UPDATE `stats` SET `x` = "' . $u->info['x'] . '" ,`y` = "' . $u->info['y'] . '",`timeGoL` = "' . $u->info['timeGoL'] . '",`timeGo` = "' . $u->info['timeGo'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'
+ );
}
}
@@ -331,9 +361,11 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) {
if ($var['add'][1] > 0) {
$j = 0;
while ($j < $var['add'][1]) {
- mysql_query('INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
+ mysql_query(
+ 'INSERT INTO `laba_itm` (`uid`,`lib`,`time`,`itm`,`x`,`y`,`take`) VALUES (
"' . $u->info['id'] . '","' . $lab['id'] . '","' . time() . '","' . $var['add'][0] . '","' . $u->info['x'] . '","' . $u->info['y'] . '","0"
- )');
+ )'
+ );
$j++;
}
}
@@ -346,7 +378,9 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) {
mysql_query('DELETE FROM `laba_obj` WHERE `id` = "' . $mitm['id'] . '" LIMIT 1');
} elseif ($mitm['type'] == 2) {
if ($mitm['use'] == 0) {
- $tbtl = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `team_win` = -1 AND `dn_id` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1'));
+ $tbtl = mysql_fetch_array(
+ mysql_query('SELECT * FROM `battle` WHERE `team_win` = -1 AND `dn_id` = "' . $lab['id'] . '" AND `x` = "' . $u->info['x'] . '" AND `y` = "' . $u->info['y'] . '" LIMIT 1')
+ );
if (isset($tbtl['id'])) {
//вступаем в поединок
mysql_query('UPDATE `users` SET `battle` = "' . $tbtl['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
@@ -378,7 +412,8 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) {
$expB = 0;
$btld = ['players' => '', 'timeout' => 180, 'type' => 0, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0];
- $ins = mysql_query('INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+ $ins = mysql_query(
+ 'INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
"102",
"' . $lab['id'] . '",
"' . $u->info['x'] . '",
@@ -393,7 +428,8 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) {
"' . $btld['travmChance'] . '",
"' . $btld['typeBattle'] . '",
"' . $btld['addExp'] . '",
- "' . $btld['money'] . '")');
+ "' . $btld['money'] . '")'
+ );
$btl_id = mysql_insert_id();
}
if ($btl_id > 0) {
@@ -444,14 +480,23 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) {
} elseif ($mitm['type'] == 4) {
if ($mitm['use'] == 0) {
//Ловушка
- $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`,`vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1'));
+ $var['trap1'] = mysql_fetch_array(
+ mysql_query(
+ 'SELECT `id`,`vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time(
+ ) . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1'
+ )
+ );
$var['time'] = rand(1, 60);
if (isset($var['trap1']['id'])) {
- mysql_query('UPDATE `laba_act` SET `vals` = "' . ($var['trap1']['vals'] + $var['time']) . '",`time` = "' . ($var['trap1']['time'] + $var['time'] * 60) . '" WHERE `id` = "' . $var['trap1']['id'] . '" LIMIT 1');
+ mysql_query(
+ 'UPDATE `laba_act` SET `vals` = "' . ($var['trap1']['vals'] + $var['time']) . '",`time` = "' . ($var['trap1']['time'] + $var['time'] * 60) . '" WHERE `id` = "' . $var['trap1']['id'] . '" LIMIT 1'
+ );
} else {
- mysql_query('INSERT INTO `laba_act` (`uid`,`time`,`lib`,`vars`,`vals`) VALUES (
+ mysql_query(
+ 'INSERT INTO `laba_act` (`uid`,`time`,`lib`,`vars`,`vals`) VALUES (
"' . $u->info['id'] . '","' . (time() + $var['time'] * 60) . '","' . $lab['id'] . '","trap1","' . $var['time'] . '"
- )');
+ )'
+ );
}
mysql_query('UPDATE `laba_obj` SET `use` = "' . $u->info['id'] . '" WHERE `id` = "' . $mitm['id'] . '" LIMIT 1');
@@ -461,7 +506,12 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) {
}
$var['text'] = ' ' . $u->info['login'] . ' угодил' . $var['sex'] . ' в ловушку...';
- $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time() . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1'));
+ $varos['trap1'] = mysql_fetch_array(
+ mysql_query(
+ 'SELECT `vals`,`time` FROM `laba_act` WHERE `uid` = "' . $u->info['id'] . '" AND `lib` = "' . $lab['id'] . '" AND `time` > "' . time(
+ ) . '" AND `vars` = "trap1" ORDER BY `time` DESC LIMIT 1'
+ )
+ );
sendSysChat($var['text'], true);
$errors .= ' ' . $u->info['login'] . ' угодил' . $var['sex'] . ' в ловушку... Время перехода +3 секунды (Длительность: +' . $var['time'] . ' мин.)';
}
@@ -476,7 +526,9 @@ if (isset($objs[$u->info['x']][$u->info['y']]['id'])) {
unset($var);
}
-$sp = mysql_query('SELECT `i`.*,`m`.`name`,`m`.`img` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" AND `i`.`take` = "0"');
+$sp = mysql_query(
+ 'SELECT `i`.*,`m`.`name`,`m`.`img` FROM `laba_itm` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`itm` WHERE `i`.`lib` = "' . $lab['id'] . '" AND `i`.`x` = "' . $u->info['x'] . '" AND `i`.`y` = "' . $u->info['y'] . '" AND `i`.`take` = "0"'
+);
while ($pl = mysql_fetch_array($sp)) {
$itms .= ' ';
}
@@ -497,7 +549,10 @@ if ($itms != '') {
mysql_query('UPDATE `laba_now` SET `users` = "' . $lab['users'] . '" WHERE `id` = "' . $lab['id'] . '" LIMIT 1');
}
\User\ItemsModel::addItem(4392, $u->info['id'], '|fromlaba=1|nosale=1');
- mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%" AND `data` LIKE "%nosavelaba=1%"');
+ mysql_query(
+ 'UPDATE `items_users` SET `delete` = "' . time(
+ ) . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%fromlaba=1%" AND `data` LIKE "%nosavelaba=1%"'
+ );
mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` < 1234567890 AND `inShop` = "0" AND `data` LIKE "%nosavelaba=1%"');
mysql_query('UPDATE `users` SET `room` = "369" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `dnow` = "0",`x`="0",`y`="0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
@@ -510,7 +565,9 @@ if ($itms != '') {
die('');
}
-$sp = mysql_query('SELECT `s`.`x`,`s`.`y`,`u`.`id`,`u`.`login`,`u`.`level` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $lab['id'] . '" AND `s`.`id` != "' . $u->info['id'] . '" LIMIT 5');
+$sp = mysql_query(
+ 'SELECT `s`.`x`,`s`.`y`,`u`.`id`,`u`.`login`,`u`.`level` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`dnow` = "' . $lab['id'] . '" AND `s`.`id` != "' . $u->info['id'] . '" LIMIT 5'
+);
$pi = 1;
while ($pl = mysql_fetch_array($sp)) {
$objs[$pl['x']][$pl['y']] = [2 => '
']; //Персонаж 1
@@ -556,169 +613,171 @@ $mapsee = '' . $mapsee . '
//Эффекты на персонаже
if (isset($varos['trap1']['vals']) && $varos['trap1']['vals'] > 0) {
- $effed .= '
- Время перехода +3 секунды (Осталось: ' . $u->timeOut($varos['trap1']['time'] - time()) . ')
';
+ $effed .= '
- Время перехода +3 секунды (Осталось: ' . Conversion::secondsToTimeout(
+ $varos['trap1']['time'] - time()
+ ) . ')
';
}
unset($varos);
?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- = $u->error ?>
- Карта: = $lab['id'] ?>
-
-
-
-
-
+
+ .ddp1 {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/m.gif");
+ }
+
+ .ddpStart {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/os.gif");
+ }
+
+ .ddpExit {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/of.gif");
+ }
+
+ .ddp1s {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/s.gif");
+ }
+
+ .ddp1m {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/r.gif");
+ }
+
+ .ddp1h {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/h.gif");
+ }
+
+ .ddp1l {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/b.gif");
+ }
+
+ .ddp1p {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/p.gif");
+ }
+
+ .ddp1me {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/u.gif");
+ }
+
+ .ddp1ee1 {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/e1.gif");
+ }
+
+ .ddp1ee2 {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/e2.gif");
+ }
+
+ .ddp1ee3 {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/e3.gif");
+ }
+
+ .ddp1ee4 {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/e4.gif");
+ }
+
+ .ddp1ee5 {
+ display: inline-block;
+ width: 15px;
+ height: 15px;
+ background-image: url("//img.new-combats.tech/drgn/bg/e5.gif");
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = $u->error ?>
+ Карта: = $lab['id'] ?>
+
-
+
+ = $d->usersDng($lab['id']); ?>
+
+
+
+
+
+
+ 0) {
echo 'Кол-во смертей: ' . $dies . '/3 ';
}
@@ -934,9 +993,7 @@ unset($varos);
-
+ = $mapsee; ?>
@@ -957,5 +1014,3 @@ unset($varos);
-
\ No newline at end of file
diff --git a/modules_data/location/dungeon_enter.php b/modules_data/location/dungeon_enter.php
index 3796f306..89613846 100644
--- a/modules_data/location/dungeon_enter.php
+++ b/modules_data/location/dungeon_enter.php
@@ -1,944 +1,1081 @@
room['file']=='dungeon_enter') {
+use Helper\Conversion;
- $error = ''; // Собираем ошибки.
- $dungeonGroupList = ''; // Сюда помещаем список Групп.
- $dungeonGo = 1; // По умолчанию, мы идем в пещеру.
-$dungeon = mysql_fetch_assoc( mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="'.$u->room['id'].'" LIMIT 1') );
-
-if(isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание
- else $roomSection = 0; // Собираем группу для похода
-//if( $u->info['admin'] > 0 ) var_info($dungeon);
-
-$all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 ');
-while( $t = mysql_fetch_array($all_dungeon) ) { $dungeon['list'][] = $t['city']; }
-unset($all_dungeon);
-
-if( $u->info['dn'] > 0 ) {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id'])){
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
+if (!defined('GAME')) {
+ die();
}
+if ($u->room['file'] == 'dungeon_enter') {
-$dungeon_timeout = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh0" AND `time` > '.(time()-60*60*2).' LIMIT 1',1);
-if($u->info['admin']>0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры.
-if(isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
-{
- $dungeonGo = 0;
- if(isset($_GET['start'])){
- $error = 'До следующего похода осталось еще: '.$u->timeOut(60*60*2-time()+$dungeon_timeout['time']);
- }
-}
+ $error = ''; // Собираем ошибки.
+ $dungeonGroupList = ''; // Сюда помещаем список Групп.
+ $dungeonGo = 1; // По умолчанию, мы идем в пещеру.
+ $dungeon = mysql_fetch_assoc(
+ mysql_query(
+ 'SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1'
+ )
+ );
-if( isset( $_GET['start'] ) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1 ) {
- $ig = 1;
- if( $ig > 0 ){ //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh'.$dun,'');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dungeon['id'].'","'.$dungeon['name'].'","'.time().'")');
- if($ins){
- $zid = mysql_insert_id();
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" /*LIMIT '.($zv['team_max']+1).'*/');
- $ids = '';
-
- $map_locs = array();
- $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "'.$dungeon['id'].'"');
- while( $plm2 = mysql_fetch_array( $spm2 ) ) {
- $map_locs[] = array($plm2['x'],$plm2['y']);
- }
- unset( $spm2 , $plm2 );
-
- $pxd = 0;
- while( $pu = mysql_fetch_array($su) ) {
- $pxd++;
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- if( $u->stats['silver'] >= 3 ) {
- $u->addAction( ( time() - ((60*60*2)/100*30) ) ,'psh0',$pu['id'],$pu['id']);
- }else{
- $u->addAction(time(),'psh0',$pu['id'],$pu['id']);
- }
- //Добавляем квестовые обьекты для персонажей
- $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `room` = '.$dungeon['room'].' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
- while($pl2 = mysql_fetch_array($sp)){
- $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.(str_replace('start_quest','',$pl2['vars'])).'" AND `line` = "'.$dungeon['id'].'" LIMIT 1'));
- if( isset($pl['id']) ) {
- $act = explode(',',$pl['act_date']);
- $i = 0;
- while( $i < count($act) ) {
- $act_date = explode(':|:',$act[$i]);
- foreach($act_date as $key=>$val){
- $val = explode(':=:',$val);
- $actdate[$val[0]] = $val[1];
- }
- //Сбор ресурсов
- if( isset($actdate['tk_itm']) && $actdate['tk_itm'] != '' ) {
- $xr2 = explode('=',$actdate['tk_itm']);
- if( $xr2[2] == 0 ) {
- if( isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']) ) {
- $actdate['tk_itm_fromY'] = (integer)$actdate['tk_itm_fromY'];
- $actdate['tk_itm_toY'] = (integer)$actdate['tk_itm_toY'];
- }
- $ml_arr = array();
- foreach($map_locs as $ml){ // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов.
- if( (isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) OR (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) ) {
- if( $ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1] )$ml_arr[] = $ml;
- elseif( !isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1] ) $ml_arr[] = $ml;
- } else $ml_arr[] = $ml;
- }
- if( isset($ml_arr) && count($ml_arr) == 0 ) $ml_arr = $map_locs;
- //Добавляем обьект для юзера
- $j = 0;
- while( $j < $xr2[1] ){
- $cord = $ml_arr[rand(0,count($ml_arr)-1)];
- if( $cord[0] != 0 || $cord[1] != 0 ) {
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
- "'.$zid.'","'.$u->info['id'].'","'.$xr2[0].'","'.time().'","'.$cord[0].'","'.$cord[1].'","'.$u->info['id'].'","'.$pl['id'].'"
- )');
- }
- $j++;
- }
- }else{
- //Предмет находится в конкретном месте
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
- "'.$zid.'","'.$u->info['id'].'","'.$xr2[0].'","'.time().'","'.$xr2[2].'","'.$xr2[3].'","'.$u->info['id'].'","'.$pl['id'].'"
- )');
- }
- }
- $i++;
- }
- }
- }
-
- }
- $ids = rtrim($ids,'OR');
- $snew = 1;
- if($dungeon['id'] == 106) {
- $snew = 4;
- }elseif($dungeon['id'] == 104) {
- $snew = 4;
- }
- $upd1 = mysql_query('UPDATE `stats` SET `s`="'.$snew.'",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- if( $upd1 ){
- $upd2 = mysql_query('UPDATE `users` SET `room` = "'.$dungeon['d_room'].'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dungeon['id'].'"');
- while( $pl = mysql_fetch_array( $sp ) ) {
- if( $pl['id_bot'] == 0 && $pl['bot_group'] !=''){
- $bots = explode( ',', $pl['bot_group'] );
- $pl['id_bot'] = (int)$bots[rand(0, count($bots)-1 )];
- }
- if( $pl['id_bot'] > 0 )$vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'","'.$pl['go_bot'].'","'.$pl['noatack'].'"),';
- unset($bots);
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dungeon['id'].'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- //Добавление обьектов (день святого валентина)
- if( floor(date('m')) == 2 && floor(date('d')) >= 7 ) {
- if( floor(date('m')) == 2 && floor(date('d')) >= 14 ) {
- //Появляются мобы которые принимают цветы
- $vlsbts = '';
- $ins1bts = NULL;
- if( $dungeon['id'] == 1 ) {
- //4 уровня (КАНАЛИЗАЦИЯ)
- $vlsbts .='("'.$zid.'","410","1","","-5","3","8","0","0"),';
- //4-7 уровня
- $vlsbts .='("'.$zid.'","413","1","","8","46","9","0","0"),';
- }elseif( $dungeon['id'] == 12 ) {
- //(ПТП)
- //4-7 уровня
- $vlsbts .='("'.$zid.'","413","1","","-3","18","9","0","0"),';
- //4-9 уровня
- $vlsbts .='("'.$zid.'","414","1","","-2","29","10","0","0"),';
- }elseif( $dungeon['id'] == 3 ) {
- //(КАТАКОМБЫ)
- //4-7 уровня
- $vlsbts .='("'.$zid.'","413","1","","15","8","9","0","0"),';
- //4-9 уровня
- $vlsbts .='("'.$zid.'","414","1","","3","35","10","0","0"),';
- }elseif( $dungeon['id'] == 101 ) {
- //(бездна)
- //4-7 уровня
- $vlsbts .='("'.$zid.'","413","1","","-2","21","9","0","0"),';
- //4-9 уровня
- $vlsbts .='("'.$zid.'","414","1","","2","43","10","0","0"),';
- }
-
- if( $vlsbts != '' ) {
- $vlsbts = rtrim($vlsbts,',');
- $ins1bts = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`) VALUES '.$vlsbts.'');
- }
- unset($vlsbts,$ins1bts);
- }
- //Раскидываем предметы по пещере (Блёклый подземник)
- $dcords = array();
- $c_sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "'.$dungeon['id'].'"');
- while( $c_pl = mysql_fetch_array($c_sp)) {
- $dcords[] = array($c_pl['x'],$c_pl['y']);
- }
- $fcords = array();
- $i = 1;
- while($i <= $pxd) {
- $j = rand(1,10);
- while( $j >= 0 ) {
- $rndxy = rand(0,count($dcords)-1);
- $rndx = $dcords[$rndxy][0];
- $rndy = $dcords[$rndxy][1];
- $fcords[$rndx][$rndy] = true;
- unset($dcords[$rndxy]);
- $vls .= '("'.$zid.'","Блеклый подземник","vbig1.gif","'.$rndx.'","'.$rndy.'","fileact:vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
- $j--;
- }
- $i++;
- }
- //Раскидываем предметы по пещере (Черепичный подземник)
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dungeon['id'].'"');
- $test = array();
- $dcords2 = array();
- $dcords3 = array();
- while( $pl = mysql_fetch_array( $sp ) ) {
- if(!isset($test[$pl['id_bot']])) {
- $test[$pl['id_bot']] = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$pl['id_bot'].'" LIMIT 1'));
- }
- if( isset($test[$pl['id_bot']]['id']) && $test[$pl['id_bot']] != 2 ) {
- if( $test[$pl['id_bot']]['level'] > 6 ) {
- $dcords2[] = array($pl['x'],$pl['y']);
- }
- if( $test[$pl['id_bot']]['level'] >= 8 && $test[$pl['id_bot']]['align'] == 9 ) {
- $dcords3[] = array($pl['x'],$pl['y']);
- }
- }else{
- $test[$pl['id_bot']] = 2;
- }
- }
- $i = 1;
- while($i <= $pxd) {
- $j = rand(1,5);
- while( $j >= 0 ) {
- $rndxy = rand(0,count($dcords2)-1);
- $rndx = $dcords2[$rndxy][0];
- $rndy = $dcords2[$rndxy][1];
- if(!isset($fcords[$rndx][$rndy]) && isset($dcords2[$rndxy][0])) {
- $fcords[$rndx][$rndy] = true;
- unset($dcords2[$rndxy]);
- $vls .= '("'.$zid.'","Черепичный подземник","vbig2.gif","'.$rndx.'","'.$rndy.'","fileact:vbig2","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
- }
- $j--;
- }
- $i++;
- }
- $i = 1;
- while($i <= $pxd) {
- $j = rand(1,2);
- while( $j >= 0 ) {
- $rndxy = rand(0,count($dcords3)-1);
- $rndx = $dcords3[$rndxy][0];
- $rndy = $dcords3[$rndxy][1];
- if(!isset($fcords[$rndx][$rndy]) && isset($dcords3[$rndxy][0])) {
- $fcords[$rndx][$rndy] = true;
- unset($dcords3[$rndxy]);
- $vls .= '("'.$zid.'","Кровавый подземник","vbig3.gif","'.$rndx.'","'.$rndy.'","fileact:vbig3","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
- }
- $j--;
- }
- $i++;
- }
- unset($test);
- }
- //
- $vls = rtrim($vls,',');
- if( $vls != '' ) {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
- } else {
- $ins2 = true;
- }
- if( $upd2 && $ins1 && $ins2 ){
- die('');
- } else {
- $error = 'Ошибка перехода в подземелье...';
- }
- } else {
- $error = 'Ошибка перехода в подземелье...';
- }
- } else {
- $error = 'Ошибка перехода в подземелье...';
- }
- }
-} elseif( isset( $_POST['go'] , $_POST['goid'] ) && $dungeonGo == 1 ) {
- if(!isset($zv['id'])) {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if( isset( $zv['id'] ) && $u->info['dn'] == 0) {
- if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) {
- $error = 'Вы ввели неправильный пароль';
- } elseif( $u->info['level'] > 7 && $zv['dun'] != 1 ){
- $row = 0;
- if( 5 > $row ) {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if( !$upd ){
- $error = 'Не удалось вступить в эту группу';
- unset($zv);
- } else {
- $u->info['dn'] = $zv['id'];
- }
- } else {
- $error = 'В группе нет места';
- unset($zv);
- }
- } elseif( $zv['dun'] == 1 ){
- //Канализация
- $row_max = 5;
- if( $u->info['level'] == 4 ) {
- $row_max = 4;
- }elseif( $u->info['level'] == 5 ) {
- $row_max = 3;
- }elseif( $u->info['level'] == 6 ) {
- $row_max = 2;
- }elseif( $u->info['level'] >= 7 ) {
- $row_max = 1;
- }
- $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1'));
- $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1'));
- $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$row1['id'].'" LIMIT 1'));
- $row = $row[0];
- $l45 = 0;
- if( $row2['level'] == 4 && $u->info['level'] == 5 ) {
- $l45 = 1;
- }elseif( $row2['level'] == 5 && $u->info['level'] == 4 ) {
- $l45 = 1;
- }
- if( $u->info['admin'] > 0 ) {
- $l45 = 1;
- }
- if( $row2['level'] != $u->info['level'] && $l45 == 0 ) {
- $error = 'Вы не подходите по уровню';
- }elseif( $row_max > $row ) {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if( !$upd ){
- $error = 'Не удалось вступить в эту группу';
- unset($zv);
- } else {
- $u->info['dn'] = $zv['id'];
- }
- } else {
- $error = 'В группе нет места';
- unset($zv);
- }
- } elseif( ($u->info['level'] < 4 && $zv['dun'] == 104) || $u->info['admin'] > 0 ){
- //Шахты
- $row_max = 3;
- if( $u->info['level'] > 3 ) {
- $row_max = 1;
- }
- $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1'));
- $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 1'));
- $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$row1['id'].'" LIMIT 1'));
- $row = $row[0];
- if( $row2['level'] != $u->info['level'] && $u->info['level'] > 3 && $u->info['admin'] == 0 ) {
- $error = 'Вы не подходите по уровню';
- }elseif( $row_max > $row ) {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if( !$upd ){
- $error = 'Не удалось вступить в эту группу';
- unset($zv);
- } else {
- $u->info['dn'] = $zv['id'];
- }
- } else {
- $error = 'В группе для вас нет места';
- unset($zv);
- }
- } else {
- $error = 'Вы не подходите по уровню';
- unset($zv);
- }
- } else {
- $error = 'Заявка не найдена';
- }
- } else {
- $error = 'Вы уже находитесь в группе';
- }
-} elseif( isset( $_POST['leave'] ) && isset( $zv['id'] ) && $dungeonGo == 1 ) {
- if( $zv['uid'] == $u->info['id'] ) {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if( isset($ld['id']) ){
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- } else {
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- } else {
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-} elseif( isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1 ) {
- if( $u->info['dn'] == 0 ) {
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ if (isset($_GET['rz']) && $dungeon['quest'] == 1) {
+ $roomSection = 1;
+ } // Получаем Задание
+ else {
+ $roomSection = 0;
+ } // Собираем группу для похода
+ //if( $u->info['admin'] > 0 ) var_info($dungeon);
+
+ $all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 ');
+ while ($t = mysql_fetch_array($all_dungeon)) {
+ $dungeon['list'][] = $t['city'];
+ }
+ unset($all_dungeon);
+
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
+
+ $dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh0" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1);
+
+ if ($u->info['admin'] > 0) {
+ unset($dungeon_timeout);
+ } // $dungeon_timeout - задержка на посещение пещеры.
+ if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
+ {
+ $dungeonGo = 0;
+ if (isset($_GET['start'])) {
+ $error = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']);
+ }
+ }
+
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
+ $ig = 1;
+ if ($ig > 0) { //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh'.$dun,'');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dungeon['id'] . '","' . $dungeon['name'] . '","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/'
+ );
+ $ids = '';
+
+ $map_locs = [];
+ $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $dungeon['id'] . '"');
+ while ($plm2 = mysql_fetch_array($spm2)) {
+ $map_locs[] = [$plm2['x'], $plm2['y']];
+ }
+ unset($spm2, $plm2);
+
+ $pxd = 0;
+ while ($pu = mysql_fetch_array($su)) {
+ $pxd++;
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ if ($u->stats['silver'] >= 3) {
+ $u->addAction((time() - ((60 * 60 * 2) / 100 * 30)), 'psh0', $pu['id'], $pu['id']);
+ } else {
+ $u->addAction(time(), 'psh0', $pu['id'], $pu['id']);
+ }
+ //Добавляем квестовые обьекты для персонажей
+ $sp = mysql_query(
+ 'SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'
+ );
+ while ($pl2 = mysql_fetch_array($sp)) {
+ $pl = mysql_fetch_array(
+ mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "' . $dungeon['id'] . '" LIMIT 1')
+ );
+ if (isset($pl['id'])) {
+ $act = explode(',', $pl['act_date']);
+ $i = 0;
+ while ($i < count($act)) {
+ $act_date = explode(':|:', $act[$i]);
+ foreach ($act_date as $key => $val) {
+ $val = explode(':=:', $val);
+ $actdate[$val[0]] = $val[1];
+ }
+ //Сбор ресурсов
+ if (isset($actdate['tk_itm']) && $actdate['tk_itm'] != '') {
+ $xr2 = explode('=', $actdate['tk_itm']);
+ if ($xr2[2] == 0) {
+ if (isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) {
+ $actdate['tk_itm_fromY'] = (integer)$actdate['tk_itm_fromY'];
+ $actdate['tk_itm_toY'] = (integer)$actdate['tk_itm_toY'];
+ }
+ $ml_arr = [];
+ foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов.
+ if ((isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) or (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']))) {
+ if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) {
+ $ml_arr[] = $ml;
+ } elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) {
+ $ml_arr[] = $ml;
+ }
+ } else {
+ $ml_arr[] = $ml;
+ }
+ }
+ if (isset($ml_arr) && count($ml_arr) == 0) {
+ $ml_arr = $map_locs;
+ }
+ //Добавляем обьект для юзера
+ $j = 0;
+ while ($j < $xr2[1]) {
+ $cord = $ml_arr[rand(0, count($ml_arr) - 1)];
+ if ($cord[0] != 0 || $cord[1] != 0) {
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time(
+ ) . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
+ )'
+ );
+ }
+ $j++;
+ }
+ } else {
+ //Предмет находится в конкретном месте
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
+ )'
+ );
+ }
+ }
+ $i++;
+ }
+ }
+ }
+
+ }
+ $ids = rtrim($ids, 'OR');
+ $snew = 1;
+ if ($dungeon['id'] == 106) {
+ $snew = 4;
+ } elseif ($dungeon['id'] == 104) {
+ $snew = 4;
+ }
+ $upd1 = mysql_query(
+ 'UPDATE `stats` SET `s`="' . $snew . '",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "' . $dungeon['d_room'] . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dungeon['id'] . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ if ($pl['id_bot'] == 0 && $pl['bot_group'] != '') {
+ $bots = explode(',', $pl['bot_group']);
+ $pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)];
+ }
+ if ($pl['id_bot'] > 0) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),';
+ }
+ unset($bots);
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`,`noatack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dungeon['id'] . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ //Добавление обьектов (день святого валентина)
+ if (floor(date('m')) == 2 && floor(date('d')) >= 7) {
+ if (floor(date('m')) == 2 && floor(date('d')) >= 14) {
+ //Появляются мобы которые принимают цветы
+ $vlsbts = '';
+ $ins1bts = null;
+ if ($dungeon['id'] == 1) {
+ //4 уровня (КАНАЛИЗАЦИЯ)
+ $vlsbts .= '("' . $zid . '","410","1","","-5","3","8","0","0"),';
+ //4-7 уровня
+ $vlsbts .= '("' . $zid . '","413","1","","8","46","9","0","0"),';
+ } elseif ($dungeon['id'] == 12) {
+ //(ПТП)
+ //4-7 уровня
+ $vlsbts .= '("' . $zid . '","413","1","","-3","18","9","0","0"),';
+ //4-9 уровня
+ $vlsbts .= '("' . $zid . '","414","1","","-2","29","10","0","0"),';
+ } elseif ($dungeon['id'] == 3) {
+ //(КАТАКОМБЫ)
+ //4-7 уровня
+ $vlsbts .= '("' . $zid . '","413","1","","15","8","9","0","0"),';
+ //4-9 уровня
+ $vlsbts .= '("' . $zid . '","414","1","","3","35","10","0","0"),';
+ } elseif ($dungeon['id'] == 101) {
+ //(бездна)
+ //4-7 уровня
+ $vlsbts .= '("' . $zid . '","413","1","","-2","21","9","0","0"),';
+ //4-9 уровня
+ $vlsbts .= '("' . $zid . '","414","1","","2","43","10","0","0"),';
+ }
+
+ if ($vlsbts != '') {
+ $vlsbts = rtrim($vlsbts, ',');
+ $ins1bts = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`,`go_bot`) VALUES ' . $vlsbts . '');
+ }
+ unset($vlsbts, $ins1bts);
+ }
+ //Раскидываем предметы по пещере (Блёклый подземник)
+ $dcords = [];
+ $c_sp = mysql_query('SELECT * FROM `dungeon_map` WHERE `id_dng` = "' . $dungeon['id'] . '"');
+ while ($c_pl = mysql_fetch_array($c_sp)) {
+ $dcords[] = [$c_pl['x'], $c_pl['y']];
+ }
+ $fcords = [];
+ $i = 1;
+ while ($i <= $pxd) {
+ $j = rand(1, 10);
+ while ($j >= 0) {
+ $rndxy = rand(0, count($dcords) - 1);
+ $rndx = $dcords[$rndxy][0];
+ $rndy = $dcords[$rndxy][1];
+ $fcords[$rndx][$rndy] = true;
+ unset($dcords[$rndxy]);
+ $vls .= '("' . $zid . '","Блеклый подземник","vbig1.gif","' . $rndx . '","' . $rndy . '","fileact:vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
+ $j--;
+ }
+ $i++;
+ }
+ //Раскидываем предметы по пещере (Черепичный подземник)
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dungeon['id'] . '"');
+ $test = [];
+ $dcords2 = [];
+ $dcords3 = [];
+ while ($pl = mysql_fetch_array($sp)) {
+ if (!isset($test[$pl['id_bot']])) {
+ $test[$pl['id_bot']] = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $pl['id_bot'] . '" LIMIT 1'));
+ }
+ if (isset($test[$pl['id_bot']]['id']) && $test[$pl['id_bot']] != 2) {
+ if ($test[$pl['id_bot']]['level'] > 6) {
+ $dcords2[] = [$pl['x'], $pl['y']];
+ }
+ if ($test[$pl['id_bot']]['level'] >= 8 && $test[$pl['id_bot']]['align'] == 9) {
+ $dcords3[] = [$pl['x'], $pl['y']];
+ }
+ } else {
+ $test[$pl['id_bot']] = 2;
+ }
+ }
+ $i = 1;
+ while ($i <= $pxd) {
+ $j = rand(1, 5);
+ while ($j >= 0) {
+ $rndxy = rand(0, count($dcords2) - 1);
+ $rndx = $dcords2[$rndxy][0];
+ $rndy = $dcords2[$rndxy][1];
+ if (!isset($fcords[$rndx][$rndy]) && isset($dcords2[$rndxy][0])) {
+ $fcords[$rndx][$rndy] = true;
+ unset($dcords2[$rndxy]);
+ $vls .= '("' . $zid . '","Черепичный подземник","vbig2.gif","' . $rndx . '","' . $rndy . '","fileact:vbig2","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
+ }
+ $j--;
+ }
+ $i++;
+ }
+ $i = 1;
+ while ($i <= $pxd) {
+ $j = rand(1, 2);
+ while ($j >= 0) {
+ $rndxy = rand(0, count($dcords3) - 1);
+ $rndx = $dcords3[$rndxy][0];
+ $rndy = $dcords3[$rndxy][1];
+ if (!isset($fcords[$rndx][$rndy]) && isset($dcords3[$rndxy][0])) {
+ $fcords[$rndx][$rndy] = true;
+ unset($dcords3[$rndxy]);
+ $vls .= '("' . $zid . '","Кровавый подземник","vbig3.gif","' . $rndx . '","' . $rndy . '","fileact:vbig3","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
+ }
+ $j--;
+ }
+ $i++;
+ }
+ unset($test);
+ }
+ //
+ $vls = rtrim($vls, ',');
+ if ($vls != '') {
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
+ } else {
+ $ins2 = true;
+ }
+ if ($upd2 && $ins1 && $ins2) {
+ die('');
+ } else {
+ $error = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $error = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $error = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id']) && $u->info['dn'] == 0) {
+ if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) {
+ $error = 'Вы ввели неправильный пароль';
+ } elseif ($u->info['level'] > 7 && $zv['dun'] != 1) {
+ $row = 0;
+ if (5 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $error = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $error = 'В группе нет места';
+ unset($zv);
+ }
+ } elseif ($zv['dun'] == 1) {
+ //Канализация
+ $row_max = 5;
+ if ($u->info['level'] == 4) {
+ $row_max = 4;
+ } elseif ($u->info['level'] == 5) {
+ $row_max = 3;
+ } elseif ($u->info['level'] == 6) {
+ $row_max = 2;
+ } elseif ($u->info['level'] >= 7) {
+ $row_max = 1;
+ }
+ $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1'));
+ $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1'));
+ $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $row1['id'] . '" LIMIT 1'));
+ $row = $row[0];
+ $l45 = 0;
+ if ($row2['level'] == 4 && $u->info['level'] == 5) {
+ $l45 = 1;
+ } elseif ($row2['level'] == 5 && $u->info['level'] == 4) {
+ $l45 = 1;
+ }
+ if ($u->info['admin'] > 0) {
+ $l45 = 1;
+ }
+ if ($row2['level'] != $u->info['level'] && $l45 == 0) {
+ $error = 'Вы не подходите по уровню';
+ } elseif ($row_max > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $error = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $error = 'В группе нет места';
+ unset($zv);
+ }
+ } elseif (($u->info['level'] < 4 && $zv['dun'] == 104) || $u->info['admin'] > 0) {
+ //Шахты
+ $row_max = 3;
+ if ($u->info['level'] > 3) {
+ $row_max = 1;
+ }
+ $row = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1'));
+ $row1 = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 1'));
+ $row2 = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $row1['id'] . '" LIMIT 1'));
+ $row = $row[0];
+ if ($row2['level'] != $u->info['level'] && $u->info['level'] > 3 && $u->info['admin'] == 0) {
+ $error = 'Вы не подходите по уровню';
+ } elseif ($row_max > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $error = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $error = 'В группе для вас нет места';
+ unset($zv);
+ }
+ } else {
+ $error = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $error = 'Заявка не найдена';
+ }
+ } else {
+ $error = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $dungeonGo == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1) {
+ if ($u->info['dn'] == 0) {
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dungeon['id'].'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dungeon['id'] . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
"8",
"21",
- "5")');
- if( $ins ) {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $error = 'Вы успешно создали группу';
- } else {
- $error = 'Не удалось создать группу';
- }
- } else {
- $error = 'Вы уже находитесь в группе';
- }
-}
+ "5")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $error = 'Вы успешно создали группу';
+ } else {
+ $error = 'Не удалось создать группу';
+ }
+ } else {
+ $error = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "'.$dungeon['id'].'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while( $pl = mysql_fetch_array( $sp ) ){
- $dungeonGroupList .= '';
- if( $u->info['dn'] == 0 ) $dungeonGroupList .= '
';
- $dungeonGroupList .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while( $pu = mysql_fetch_array( $su ) ) {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim( $pus, ', ' );
-
- $dungeonGroupList .= $pus; unset($pus);
-
- if( $pl['pass'] != '' && $u->info['dn'] == 0 ) $dungeonGroupList .= '
';
-
- if( $pl['com'] != '' ) {
- $dl = '';
- // Если модератор, даем возможность удалять комментарий к походу.
- $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
- if( ( $moder['boi'] == 1 || $u->info['admin'] > 0 ) && $pl['dcom'] == 0 ){
- $dl .= ' (
удалить комментарий )';
- if( isset( $_GET['delcom'] ) && $_GET['delcom'] == $pl['id'] && $u->newAct( $_GET['key'] ) == true ) {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
- if( $pl['dcom'] > 0 ) {
- $dl = '
комментарий удален модератором ';
- }
- if( $pl['dcom'] > 0 ) {
- if( $moder['boi'] == 1 || $u->info['admin'] > 0 ) {
- $pl['com'] = '
'.$pl['com'].' ';
- } else {
- $pl['com'] = '';
- }
- }
- $dungeonGroupList .= '
| '.$pl['com'].''.$dl.' ';
- }
- $dungeonGroupList .= '
';
-}
-?>
+ //Генерируем список групп
+ $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "' . $dungeon['id'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $dungeonGroupList .= '';
+ if ($u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
+ $dungeonGroupList .= '
' . date('H:i', $pl['time']) . ' ';
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '' . $pu['login'] . ' [' . $pu['level'] . '] ';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dungeonGroupList .= $pus;
+ unset($pus);
+
+ if ($pl['pass'] != '' && $u->info['dn'] == 0) {
+ $dungeonGroupList .= ' ';
+ }
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ // Если модератор, даем возможность удалять комментарий к походу.
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+ if ($pl['dcom'] > 0) {
+ $dl = ' комментарий удален модератором ';
+ }
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+ $dungeonGroupList .= ' | ' . $pl['com'] . '' . $dl . ' ';
+ }
+ $dungeonGroupList .= '';
+ }
+ ?>
+
+
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
- 0 ) {
- $shop = mysql_fetch_array( mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "'.$dungeon['shop'].'" LIMIT 1') );
- if( isset($shop['code']) ){?>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+ 0) {
+ $shop = mysql_fetch_array(
+ mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1')
+ );
+ if (isset($shop['code'])) {
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
'.$error.' ';
+
+
+
+
+
+
+
' . $error . ' ';
+ }
-//отображаем
-if( $dungeonGroupList == '' ) {
- $dungeonGroupList = '';
-} else {
- if( !isset( $zv['id'] ) || $u->info['dn'] == 0 ){
- if($dungeonGo==1 || $u->info['dn'] == 0 ){
- $pr = '
';
- }
- $dungeonGroupList = '
';
- }
- $dungeonGroupList .= '
';
-}
+ //отображаем
+ if ($dungeonGroupList == '') {
+ $dungeonGroupList = '';
+ } else {
+ if (!isset($zv['id']) || $u->info['dn'] == 0) {
+ if ($dungeonGo == 1 || $u->info['dn'] == 0) {
+ $pr = '
';
+ }
+ $dungeonGroupList = '
';
+ }
+ $dungeonGroupList .= '
';
+ }
-if( $roomSection == 0 ) { echo $dungeonGroupList; }
-if( $roomSection == 1 ) {
- # endQuest завершаем задание по нажатию.
- if( isset( $_GET['endQuest'] ) && $_GET['endQuest'] != '' ){
- $action = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = '.$u->info['id'].' AND `id`="'.$_GET['endQuest'].'" AND `vals` = "go" LIMIT 1'));
- $quest = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$action['vars']).'" LIMIT 1'));
- if( $q->questCheckEnd($quest)==1 ){
- $q->questSuccesEnd($quest, $action);
- }
- }
-?>
-
-
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
- }
- }else{
- echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(60*60*2-time()+$dungeon_timeout['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
- }
- }
+ }
+ }
+ } else {
+ echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(
+ 60 * 60 * 2 - time() + $dungeon_timeout['time']
+ ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
+ }
}
-?>
+
diff --git a/modules_data/location/dungeon_enter_all.php b/modules_data/location/dungeon_enter_all.php
index c41854c6..a3de4357 100644
--- a/modules_data/location/dungeon_enter_all.php
+++ b/modules_data/location/dungeon_enter_all.php
@@ -656,7 +656,9 @@ if ($roomSection == 1) {
if (!isset($hgo1['id'])) { ?>
Пещера Тысячи Проклятий
-
(Пещера Тысячи Проклятий)'
+
(Пещера Тысячи Проклятий)'
onclick='location="main.php?rz=1&add_quest=1&city_quest=capitalcity"'/>
@@ -1078,7 +1080,7 @@ if ($roomSection == 1) {
}
}
} else {
- echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(
+ echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(
60 * 60 * 2 - time() + $dungeon_timeout['time']
) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
diff --git a/modules_data/location/enterbezdna.php b/modules_data/location/enterbezdna.php
index f564acfd..510da259 100644
--- a/modules_data/location/enterbezdna.php
+++ b/modules_data/location/enterbezdna.php
@@ -1,781 +1,796 @@
room['file']=='enterbezdna')
-{
+if ($u->room['file'] == 'enterbezdna') {
-if(isset($_GET['rz'])) {
- $rz = 1;
-}else{
- $rz = 0;
-}
+ if (isset($_GET['rz'])) {
+ $rz = 1;
+ } else {
+ $rz = 0;
+ }
-$dun = 101;
+ $dun = 101;
-$er = '';
+ $er = '';
-$dzs = '';
+ $dzs = '';
-$g111 = 1;
+ $g111 = 1;
-$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh101" AND `time` > '.(time()-60*60*2).' LIMIT 1',1);
+ $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh101" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1);
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
-if($u->info['dn']>0)
-{
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id']))
- {
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if (isset($g11['id'])) {
+ $g111 = 0;
+ if (isset($_GET['start'])) {
+ $re = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $g11['time']);
+ }
+ }
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) {
+ //начинаем поход
+ //начинаем поход
+ $ig = 1;
+ if ($ig > 0) {
+ //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh101','');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Бездна","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ $ids = '';
-if(isset($g11['id']))
-{
- $g111 = 0;
- if(isset($_GET['start']))
- {
- $re = 'До следующего похода осталось еще: '.$u->timeOut(60*60*2-time()+$g11['time']);
- }
-}
-if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1)
-{
- //начинаем поход
- //начинаем поход
- $ig = 1;
- if($ig>0)
- {
- //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh101','');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Бездна","'.time().'")');
- if($ins)
- {
- $zid = mysql_insert_id();
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).'');
- $ids = '';
-
- $map_locs = array();
- $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "'.$dun.'"');
- while( $plm2 = mysql_fetch_array($spm2)) {
- $map_locs[] = array($plm2['x'],$plm2['y']);
- }
- unset($spm2,$plm2);
-
- $ppx = 0;
- while($pu = mysql_fetch_array($su))
- {
- $ppx++;
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- $u->addAction(time(),'psh101','',$pu['id']);
- //Добавляем квестовые обьекты для персонажей
- $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$pu['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
- //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
- while($pl2 = mysql_fetch_array($sp))
- {
- $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.(str_replace('start_quest','',$pl2['vars'])).'" AND `line` = "101" LIMIT 1'));
- if( isset($pl['id']) ) {
- $act = explode(',',$pl['act_date']);
- $i = 0;
- while( $i < count($act) ) {
- $xr = explode(':=:',$act[$i]);
- //Сбор ресурсов
- if( $xr[0] == 'tk_itm' ) {
- $xr2 = explode('=',$xr[1]);
- if( $xr2[2] == 0 ) {
- //Добавляем обьект для юзера
- $j = 0;
- while( $j < $xr2[1] ) {
- $cord = $map_locs[rand(0,count($map_locs)-1)];
- if( $cord[0] != 0 || $cord[1] != 0 ) {
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
- "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$cord[0].'","'.$cord[1].'","'.$pu['id'].'","'.$pl['id'].'"
- )');
- }
- $j++;
- }
- }else{
- //Предмет находится в конкретном месте
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
- "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$xr2[2].'","'.$xr2[3].'","'.$pu['id'].'","'.$pl['id'].'"
- )');
- }
- //
- }
- $i++;
- }
- }
- }
- //
- }
- $ids = rtrim($ids,'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- if($upd1)
- {
- $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- //Добавление обьектов (день святого валентина)
- if( floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0 ) {
- //Раскидываем предметы по пещере (Блёклый подземник)
- $i = 1;
- while($i <= $ppx) {
- $j = rand(1,3);
- while( $j >= 0 ) {
- $rndx = 0;
- $rndy = 0;
- $vls .= '("'.$zid.'","Блеклый подземник","vbig1.gif","'.$rndx.'","'.$rndy.'","fileact:101/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
- $j--;
- }
- $i++;
- }
- }
- //
- $vls = rtrim($vls,',');
- if($vls!='')
- {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
- }else{
- $ins2 = true;
- }
- if($upd2 && $ins1 && $ins2)
- {
- die('');
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }
-}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1)
-{
- if(!isset($zv['id']))
- {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv['id']) && $u->info['dn'] == 0)
- {
- if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) {
- $re = 'Вы ввели неправильный пароль';
- }elseif($u->info['level'] > 7)
- {
- $row = 0;
- if(5 > $row)
- {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd)
- {
- $re = 'Не удалось вступить в эту группу';
- unset($zv);
- }else{
- $u->info['dn'] = $zv['id'];
- }
- }else{
- $re = 'В группе нет места';
- unset($zv);
- }
- }else{
- $re = 'Вы не подходите по уровню';
- unset($zv);
- }
- }else{
- $re = 'Заявка не найдена';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1)
-{
- if($zv['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id']))
- {
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1)
-{
- if($u->info['dn']==0)
- {
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ $map_locs = [];
+ $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $dun . '"');
+ while ($plm2 = mysql_fetch_array($spm2)) {
+ $map_locs[] = [$plm2['x'], $plm2['y']];
+ }
+ unset($spm2, $plm2);
+
+ $ppx = 0;
+ while ($pu = mysql_fetch_array($su)) {
+ $ppx++;
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ $u->addAction(time(), 'psh101', '', $pu['id']);
+ //Добавляем квестовые обьекты для персонажей
+ $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $pu['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
+ //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
+ while ($pl2 = mysql_fetch_array($sp)) {
+ $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "101" LIMIT 1'));
+ if (isset($pl['id'])) {
+ $act = explode(',', $pl['act_date']);
+ $i = 0;
+ while ($i < count($act)) {
+ $xr = explode(':=:', $act[$i]);
+ //Сбор ресурсов
+ if ($xr[0] == 'tk_itm') {
+ $xr2 = explode('=', $xr[1]);
+ if ($xr2[2] == 0) {
+ //Добавляем обьект для юзера
+ $j = 0;
+ while ($j < $xr2[1]) {
+ $cord = $map_locs[rand(0, count($map_locs) - 1)];
+ if ($cord[0] != 0 || $cord[1] != 0) {
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $pu['id'] . '","' . $pl['id'] . '"
+ )'
+ );
+ }
+ $j++;
+ }
+ } else {
+ //Предмет находится в конкретном месте
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $pu['id'] . '","' . $pl['id'] . '"
+ )'
+ );
+ }
+ //
+ }
+ $i++;
+ }
+ }
+ }
+ //
+ }
+ $ids = rtrim($ids, 'OR');
+ $upd1 = mysql_query(
+ 'UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ //Добавление обьектов (день святого валентина)
+ if (floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0) {
+ //Раскидываем предметы по пещере (Блёклый подземник)
+ $i = 1;
+ while ($i <= $ppx) {
+ $j = rand(1, 3);
+ while ($j >= 0) {
+ $rndx = 0;
+ $rndy = 0;
+ $vls .= '("' . $zid . '","Блеклый подземник","vbig1.gif","' . $rndx . '","' . $rndy . '","fileact:101/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
+ $j--;
+ }
+ $i++;
+ }
+ }
+ //
+ $vls = rtrim($vls, ',');
+ if ($vls != '') {
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
+ } else {
+ $ins2 = true;
+ }
+ if ($upd2 && $ins1 && $ins2) {
+ die('');
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id']) && $u->info['dn'] == 0) {
+ if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) {
+ $re = 'Вы ввели неправильный пароль';
+ } elseif ($u->info['level'] > 7) {
+ $row = 0;
+ if (5 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $re = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $re = 'В группе нет места';
+ unset($zv);
+ }
+ } else {
+ $re = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $re = 'Заявка не найдена';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
"8",
"21",
- "5")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $re = 'Вы успешно создали группу';
- }else{
- $re = 'Не удалось создать группу';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}
+ "5")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $re = 'Вы успешно создали группу';
+ } else {
+ $re = 'Не удалось создать группу';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "101" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while($pl = mysql_fetch_array($sp))
-{
- $dzs .= '
';
- if($u->info['dn']==0)
- {
- $dzs .= '
';
- }
- $dzs .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while($pu = mysql_fetch_array($su))
- {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim($pus,', ');
-
- $dzs .= $pus;
-
- if( $pl['pass'] != '' && $u->info['dn']==0 ) {
- $dzs .= '
';
- }
-
- if($pl['com']!='')
- {
- $dl = '';
- if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0)
- {
- $dl .= ' (
удалить комментарий )';
- if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true)
- {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
-
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
-
- if($pl['dcom']>0)
- {
- $dl = '
комментарий удален модератором ';
- }
-
- if($pl['dcom']>0)
- {
- if($moder['boi']==1 || $u->info['admin']>0)
- {
- $pl['com'] = '
'.$pl['com'].' ';
- }else{
- $pl['com'] = '';
- }
- }
-
- $dzs .= '
| '.$pl['com'].''.$dl.' ';
- }
-
- $dzs .= '
';
-}
-?>
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ //Генерируем список групп
+ $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "101" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $dzs .= '';
+ if ($u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+ $dzs .= '
' . date('H:i', $pl['time']) . ' ';
+
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dzs .= $pus;
+
+ if ($pl['pass'] != '' && $u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (
удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+
+ if ($pl['dcom'] > 0) {
+ $dl = '
комментарий удален модератором ';
+ }
+
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '
' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+
+ $dzs .= '
| ' . $pl['com'] . '' . $dl . ' ';
+ }
+
+ $dzs .= '
';
+ }
+ ?>
+
+
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
'.$re.' ';
-}
+
+
+
+
+
+
+
' . $re . ' ';
+ }
-//отображаем
-if($dzs=='')
-{
- $dzs = '';
-}else{
- if(!isset($zv['id']) || $u->info['dn'] == 0)
- {
- if($g111==1 || $u->info['dn'] == 0)
- {
- $pr = '
';
- }
- $dzs = '
'.$pr.' '.$dzs.''.$pr.' ';
- }
- $dzs .= '
';
-}
+ //отображаем
+ if ($dzs == '') {
+ $dzs = '';
+ } else {
+ if (!isset($zv['id']) || $u->info['dn'] == 0) {
+ if ($g111 == 1 || $u->info['dn'] == 0) {
+ $pr = '
';
+ }
+ $dzs = '
' . $pr . ' ' . $dzs . '' . $pr . ' ';
+ }
+ $dzs .= '
';
+ }
-if($rz==0) { echo $dzs; }
-if($rz == 1) {
-?>
-
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_angelscity" LIMIT 1',1);
-if(isset($_GET['add_quest'])) {
- if(isset($hgo['id'])) {
- echo 'Нельзя получать задания чаще одного раза в сутки ';
- }else{
-
- $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 101');
- $dq_add = array();
- while($pl = mysql_fetch_array($sp)) {
- if($u->rep['repangelscity'] == 9999) {
- //квет, рыцарского задания
- if( $pl['kin'] == 1 ) {
- $dq_add = array( 0 => $pl );
- }
- }elseif($u->rep['repangelscity'] == 24999) {
- //квет, рыцарского задания
- if( $pl['kin'] == 2 ) {
- $dq_add = array( 0 => $pl );
- }
- }else{
- if( $pl['kin'] == 0 ) {
- $dq_add[count($dq_add)] = $pl;
- }
- }
- }
-
- $dq_add = $dq_add[rand(0,count($dq_add)-1)];
-
- if($q->testGood($dq_add)==1 && $dq_add > 0)
- {
- $q->startq_dn($dq_add['id']);
- echo 'Вы успешно получили новое задание "'.$dq_add['name'].'". ';
- $hgo['id'] = 1;
- $u->addAction(time(),'psh_qt_angelscity',$dq_add['id']);
- }else{
- if($u->rep['repangelscity'] == 9999) {
- //квет, рыцарского задания
- echo 'Вы уже получили задание на достижение титула рыцаря! ';
- }elseif($u->rep['repangelscity'] == 24999) {
- //квет, рыцарского задания
- echo 'Вы завершили квестовую линию, ожидайте новых заданий! ';
- }else{
- echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще... ';
- }
- }
- unset($dq_add);
- }
-}
+ if ($rz == 0) {
+ echo $dzs;
+ }
+ if ($rz == 1) {
+ ?>
+
+
+ testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_angelscity" LIMIT 1', 1);
+ if (isset($_GET['add_quest'])) {
+ if (isset($hgo['id'])) {
+ echo 'Нельзя получать задания чаще одного раза в сутки ';
+ } else {
-//Генерируем список текущих квестов
-$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100');
-while($pl = mysql_fetch_array($sp))
-{
- $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1'));
- $qsee .= ' '.$pq['name'].' '.$pq['info'].' '.$q->info($pq).'
';
- $qx++;
-}
+ $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 101');
+ $dq_add = [];
+ while ($pl = mysql_fetch_array($sp)) {
+ if ($u->rep['repangelscity'] == 9999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 1) {
+ $dq_add = [0 => $pl];
+ }
+ } elseif ($u->rep['repangelscity'] == 24999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 2) {
+ $dq_add = [0 => $pl];
+ }
+ } else {
+ if ($pl['kin'] == 0) {
+ $dq_add[count($dq_add)] = $pl;
+ }
+ }
+ }
-if($qsee == '')
-{
- $qsee = 'К сожалению у вас нет ни одного задания';
-}
-?>
-
-
-Текущие задания: [=$qx?>/28]
-=$qsee?>
-
+ $dq_add = $dq_add[rand(0, count($dq_add) - 1)];
+
+ if ($q->testGood($dq_add) == 1 && $dq_add > 0) {
+ $q->startq_dn($dq_add['id']);
+ echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '". ';
+ $hgo['id'] = 1;
+ $u->addAction(time(), 'psh_qt_angelscity', $dq_add['id']);
+ } else {
+ if ($u->rep['repangelscity'] == 9999) {
+ //квет, рыцарского задания
+ echo 'Вы уже получили задание на достижение титула рыцаря! ';
+ } elseif ($u->rep['repangelscity'] == 24999) {
+ //квет, рыцарского задания
+ echo 'Вы завершили квестовую линию, ожидайте новых заданий! ';
+ } else {
+ echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще... ';
+ }
+ }
+ unset($dq_add);
+ }
+ }
+
+ //Генерируем список текущих квестов
+ $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100');
+ while ($pl = mysql_fetch_array($sp)) {
+ $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1'));
+ $qsee .= ' ' . $pq['name'] . ' ' . $pq['info'] . ' ' . $q->info(
+ $pq
+ ) . '
';
+ $qx++;
+ }
+
+ if ($qsee == '') {
+ $qsee = 'К сожалению у вас нет ни одного задания';
+ }
+ ?>
+
+
+ Текущие задания: [= $qx ?>/28]
+ = $qsee ?>
+
-
-
-'.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' ) ';
+if (!isset($hgo['id'])) {
+ ?>
+
+
+ ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout(
+ $hgo['time'] + 60 * 60 * 24 - time()
+ ) . ' ) ';
}
?>
-
-
-
- 'capitalcity',2=>'demonscity',3=>'angelscity');
- if($_GET['buy1']==1) {
- //покупаем статы
- $price = 2000+($u->rep['add_stats']*100);
- $cur_price = array('price'=>0);
- if(25-$u->rep['add_stats']>0 && $u->rep['allrep']-$u->rep['allnurep']>=$price) { // Характеристики!
-
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 способность за '.$price.' ед. награды ';
- $u->info['ability'] += 1;
- $u->rep['add_stats'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- } elseif($_GET['buy1']==2) { // Умения!
- $price = 2000+(2000*$u->rep['add_skills']);
- $cur_price = array('price'=>0);
- if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения!
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 умение за '.$price.' ед. награды ';
- $u->info['skills'] += 1;
- $u->rep['add_skills'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- }elseif($_GET['buy1']==3) { // Кредиты
- $price = 100;
- $cur_price = array('price'=>0);
- if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 10 кр. за '.$price.' ед. награды ';
- $u->info['money'] += 10;
- $u->rep['add_money'] += 10;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- }else{
- echo '
Ничего не получилось... ';
- }
- }elseif( $_GET['buy1'] == 4 ) { // Особенности
- $price = 3000;
- $cur_price = array('price'=>0);
- if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 особенность за '.$price.' ед. награды ';
- $u->info['nskills'] += 1;
- $u->rep['add_skills2'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- }else{
- echo '
Ничего не получилось... ';
- }
- }
- }
- ?>
-
- Награда:
- =($u->rep['allrep']-$u->rep['allnurep'])?>
- ед.
-
-
+
+
+
+ 'capitalcity', 2 => 'demonscity', 3 => 'angelscity'];
+ if ($_GET['buy1'] == 1) {
+ //покупаем статы
+ $price = 2000 + ($u->rep['add_stats'] * 100);
+ $cur_price = ['price' => 0];
+ if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики!
+
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 способность за ' . $price . ' ед. награды ';
+ $u->info['ability'] += 1;
+ $u->rep['add_stats'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 2) { // Умения!
+ $price = 2000 + (2000 * $u->rep['add_skills']);
+ $cur_price = ['price' => 0];
+ if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения!
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 умение за ' . $price . ' ед. награды ';
+ $u->info['skills'] += 1;
+ $u->rep['add_skills'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 3) { // Кредиты
+ $price = 100;
+ $cur_price = ['price' => 0];
+ if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды ';
+ $u->info['money'] += 10;
+ $u->rep['add_money'] += 10;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 4) { // Особенности
+ $price = 3000;
+ $cur_price = ['price' => 0];
+ if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды ';
+ $u->info['nskills'] += 1;
+ $u->rep['add_skills2'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ }
+ }
+ ?>
+
+ Награда:
+ = ($u->rep['allrep'] - $u->rep['allnurep']) ?>
+ ед.
+
+
info['id'].'" LIMIT 1000'));
- if(isset($_GET['buy777']) && $chk[0]>0) {
- $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000');
- while($chk_pl = mysql_fetch_array($chk_cl)) {
- if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1'));
- {
- $x++; $prc += $chk_pl['price1'];
- }
- }
- $u->info['money'] += $prc;
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр. ';
- $chk[0] = 0;
-
- }
- if($chk[0]>0) {
- ?>
- шт.) находящиеся у Вас в инвентаре за =$chk[1]?> кр. ?')) {location='main.php?rz=1&buy777=1'}" />
-
+ $chk = mysql_fetch_array(
+ mysql_query(
+ 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ )
+ );
+ if (isset($_GET['buy777']) && $chk[0] > 0) {
+ $chk_cl = mysql_query(
+ 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ );
+ while ($chk_pl = mysql_fetch_array($chk_cl)) {
+ if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
+ ;
+ }
+ {
+ $x++;
+ $prc += $chk_pl['price1'];
+ }
+ }
+ $u->info['money'] += $prc;
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр. ';
+ $chk[0] = 0;
+
+ }
+ if ($chk[0] > 0) {
+ ?>
+
+
-
-
-
-
- Репутация в Capital city:
- =$u->rep['repcapitalcity']?> ед.
-
-
- Репутация в Demons city:
- =$u->rep['repdemonscity']?> ед.
-
-
- Репутация в Angels city:
- =$u->rep['repangelscity']?> ед.
-
-
- Текущая репутация:
-
-
-info['dn']==0)
-{
-?>
-
-info['id'])
- {
- $psh_start = ' ';
- }
-
- echo '
+
+
+
+
+ Репутация в Capital city:
+ = $u->rep['repcapitalcity'] ?> ед.
+
+
+ Репутация в Demons city:
+ = $u->rep['repdemonscity'] ?> ед.
+
+
+ Репутация в Angels city:
+ = $u->rep['repangelscity'] ?> ед.
+
+
+ Текущая репутация:
+
+
+ info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = '
';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
-}
-?>
+ }
+ }
+ ?>
-timeOut(60*60*2-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
+ }
}
-}
-}
-?>
+
diff --git a/modules_data/location/entercat.php b/modules_data/location/entercat.php
index 33da7d73..b0c135fd 100644
--- a/modules_data/location/entercat.php
+++ b/modules_data/location/entercat.php
@@ -1,694 +1,704 @@
room['file']=='entercat')
-{
+if ($u->room['file'] == 'entercat') {
-if(isset($_GET['rz'])) {
- $rz = 1;
-}else{
- $rz = 0;
-}
+ if (isset($_GET['rz'])) {
+ $rz = 1;
+ } else {
+ $rz = 0;
+ }
-$dun = 3; //для новичков 2-7 лвл
+ $dun = 3; //для новичков 2-7 лвл
-$er = '';
+ $er = '';
-$dzs = '';
+ $dzs = '';
-$g111 = 1;
-$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh1" AND `time`>'.(time()-7200).' LIMIT 1',1);
+ $g111 = 1;
+ $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh1" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1);
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
-if($u->info['dn']>0)
-{
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id']))
- {
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
-if(isset($g11['id']))
-{
- $g111 = 0;
- if(isset($_GET['start']))
- {
- $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']);
- }
-}
-if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1)
-{
- //начинаем поход
- //начинаем поход
- $ig = 1;
- if($ig>0)
- {
- //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh1','');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Катакомбы","'.time().'")');
- if($ins)
- {
- $zid = mysql_insert_id();
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).'');
- $ids = '';
- while($pu = mysql_fetch_array($su))
- {
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- $u->addAction(time(),'psh1','',$pu['id']);
- }
- $ids = rtrim($ids,'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- if($upd1)
- {
- $upd2 = mysql_query('UPDATE `users` SET `room` = "19" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- $vls = rtrim($vls,',');
- if($vls!='')
- {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
- }else{
- $ins2 = true;
- }
- if($upd2 && $ins1 && $ins2)
- {
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- die('');
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }
-}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1)
-{
- if(!isset($zv['id']))
- {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv['id']))
- {
- if($u->info['level']>7)
- {
- $row = 0;
- if(5>$row)
- {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd)
- {
- $re = 'Не удалось вступить в эту группу';
- unset($zv);
- }else{
- $u->info['dn'] = $zv['id'];
- }
- }else{
- $re = 'В группе нет места';
- unset($zv);
- }
- }else{
- $re = 'Вы не подходите по уровню';
- unset($zv);
- }
- }else{
- $re = 'Заявка не найдена';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1)
-{
- if($zv['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id']))
- {
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1)
-{
- if($u->info['dn']==0)
- {
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ if (isset($g11['id'])) {
+ $g111 = 0;
+ if (isset($_GET['start'])) {
+ $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']);
+ }
+ }
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) {
+ //начинаем поход
+ //начинаем поход
+ $ig = 1;
+ if ($ig > 0) {
+ //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh1','');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Катакомбы","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ $ids = '';
+ while ($pu = mysql_fetch_array($su)) {
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ $u->addAction(time(), 'psh1', '', $pu['id']);
+ }
+ $ids = rtrim($ids, 'OR');
+ $upd1 = mysql_query(
+ 'UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "19" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ if ($vls != '') {
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
+ } else {
+ $ins2 = true;
+ }
+ if ($upd2 && $ins1 && $ins2) {
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ die('');
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id'])) {
+ if ($u->info['level'] > 7) {
+ $row = 0;
+ if (5 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $re = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $re = 'В группе нет места';
+ unset($zv);
+ }
+ } else {
+ $re = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $re = 'Заявка не найдена';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
"8",
"21",
- "5")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $re = 'Вы успешно создали группу';
- }else{
- $re = 'Не удалось создать группу';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}
+ "5")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $re = 'Вы успешно создали группу';
+ } else {
+ $re = 'Не удалось создать группу';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "3" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while($pl = mysql_fetch_array($sp))
-{
- $dzs .= '
';
- if($u->info['dn']==0)
- {
- $dzs .= '
';
- }
- $dzs .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while($pu = mysql_fetch_array($su))
- {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim($pus,', ');
-
- $dzs .= $pus;
-
- if($pl['com']!='')
- {
- $dl = '';
- if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0)
- {
- $dl .= ' (
удалить комментарий )';
- if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true)
- {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
-
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
-
- if($pl['dcom']>0)
- {
- $dl = '
комментарий удален модератором ';
- }
-
- if($pl['dcom']>0)
- {
- if($moder['boi']==1 || $u->info['admin']>0)
- {
- $pl['com'] = '
'.$pl['com'].' ';
- }else{
- $pl['com'] = '';
- }
- }
-
- $dzs .= '
| '.$pl['com'].''.$dl.' ';
- }
-
- $dzs .= '
';
-}
-?>
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ //Генерируем список групп
+ $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "3" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $dzs .= '';
+ if ($u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+ $dzs .= '
' . date('H:i', $pl['time']) . ' ';
+
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dzs .= $pus;
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (
удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+
+ if ($pl['dcom'] > 0) {
+ $dl = '
комментарий удален модератором ';
+ }
+
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '
' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+
+ $dzs .= '
| ' . $pl['com'] . '' . $dl . ' ';
+ }
+
+ $dzs .= '
';
+ }
+ ?>
+
+
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
'.$re.' ';
-}
+
+
+
+
+
+
+
' . $re . ' ';
+ }
-//отображаем
-if($dzs=='')
-{
- $dzs = '';
-}else{
- if(!isset($zv['id']))
- {
- if($g111==1)
- {
- $pr = '
';
- }
- $dzs = '
'.$pr.' '.$dzs.''.$pr.' ';
- }
- $dzs .= '
';
-}
+ //отображаем
+ if ($dzs == '') {
+ $dzs = '';
+ } else {
+ if (!isset($zv['id'])) {
+ if ($g111 == 1) {
+ $pr = '
';
+ }
+ $dzs = '
' . $pr . ' ' . $dzs . '' . $pr . ' ';
+ }
+ $dzs .= '
';
+ }
-if($rz==0) { echo $dzs; }
-if($rz == 1) {
-?>
-
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_demonscity" LIMIT 1',1);
-if(isset($_GET['add_quest'])) {
- if(isset($hgo['id'])) {
- echo 'Нельзя получать задания чаще одного раза в сутки ';
- }else{
-
- $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 3');
- $dq_add = array();
- while($pl = mysql_fetch_array($sp)) {
- if($u->rep['repdemonscity'] == 9999) {
- //квет, рыцарского задания
- if( $pl['kin'] == 1 ) {
- $dq_add = array( 0 => $pl );
- }
- }elseif($u->rep['repdemonscity'] == 24999) {
- //квет, рыцарского задания
- if( $pl['kin'] == 2 ) {
- $dq_add = array( 0 => $pl );
- }
- }else{
- if( $pl['kin'] == 0 ) {
- $dq_add[count($dq_add)] = $pl;
- }
- }
- }
-
- $dq_add = $dq_add[rand(0,count($dq_add)-1)];
-
- if($q->testGood($dq_add)==1)
- {
- $q->startq_dn($dq_add['id']);
- echo 'Вы успешно получили новое задание "'.$dq_add['name'].'". ';
- $hgo['id'] = 1;
- $u->addAction(time(),'psh_qt_demonscity',$dq_add['id']);
- }else{
- echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще... ';
- }
- unset($dq_add);
- }
-}
+ if ($rz == 0) {
+ echo $dzs;
+ }
+ if ($rz == 1) {
+ ?>
+
+
+ testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_demonscity" LIMIT 1', 1);
+ if (isset($_GET['add_quest'])) {
+ if (isset($hgo['id'])) {
+ echo 'Нельзя получать задания чаще одного раза в сутки ';
+ } else {
-//Генерируем список текущих квестов
-$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100');
-while($pl = mysql_fetch_array($sp))
-{
- $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1'));
- $qsee .= ' '.$pq['name'].' '.$pq['info'].' '.$q->info($pq).'
';
- $qx++;
-}
+ $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 3');
+ $dq_add = [];
+ while ($pl = mysql_fetch_array($sp)) {
+ if ($u->rep['repdemonscity'] == 9999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 1) {
+ $dq_add = [0 => $pl];
+ }
+ } elseif ($u->rep['repdemonscity'] == 24999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 2) {
+ $dq_add = [0 => $pl];
+ }
+ } else {
+ if ($pl['kin'] == 0) {
+ $dq_add[count($dq_add)] = $pl;
+ }
+ }
+ }
-if($qsee == '')
-{
- $qsee = 'К сожалению у вас нет ни одного задания';
-}
-?>
-
-
-Текущие задания: [=$qx?>/28]
-=$qsee?>
-
+ $dq_add = $dq_add[rand(0, count($dq_add) - 1)];
+
+ if ($q->testGood($dq_add) == 1) {
+ $q->startq_dn($dq_add['id']);
+ echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '". ';
+ $hgo['id'] = 1;
+ $u->addAction(time(), 'psh_qt_demonscity', $dq_add['id']);
+ } else {
+ echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще... ';
+ }
+ unset($dq_add);
+ }
+ }
+
+ //Генерируем список текущих квестов
+ $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100');
+ while ($pl = mysql_fetch_array($sp)) {
+ $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1'));
+ $qsee .= ' ' . $pq['name'] . ' ' . $pq['info'] . ' ' . $q->info(
+ $pq
+ ) . '
';
+ $qx++;
+ }
+
+ if ($qsee == '') {
+ $qsee = 'К сожалению у вас нет ни одного задания';
+ }
+ ?>
+
+
+ Текущие задания: [= $qx ?>/28]
+ = $qsee ?>
+
-
-
-'.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' ) ';
+if (!isset($hgo['id'])) {
+ ?>
+
+
+ ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout(
+ $hgo['time'] + 60 * 60 * 24 - time()
+ ) . ' ) ';
}
?>
-
-
-
- 'capitalcity',2=>'demonscity',3=>'angelscity');
- if($_GET['buy1']==1) {
- //покупаем статы
- $price = 2000+($u->rep['add_stats']*100);
- $cur_price = array('price'=>0);
- if(25-$u->rep['add_stats']>0 && $u->rep['allrep']-$u->rep['allnurep']>=$price) { // Характеристики!
-
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 способность за '.$price.' ед. награды ';
- $u->info['ability'] += 1;
- $u->rep['add_stats'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- } elseif($_GET['buy1']==2) { // Умения!
- $price = 2000+(2000*$u->rep['add_skills']);
- $cur_price = array('price'=>0);
- if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения!
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 умение за '.$price.' ед. награды ';
- $u->info['skills'] += 1;
- $u->rep['add_skills'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- }elseif($_GET['buy1']==3) { // Кредиты
- $price = 100;
- $cur_price = array('price'=>0);
- if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 10 кр. за '.$price.' ед. награды ';
- $u->info['money'] += 10;
- $u->rep['add_money'] += 10;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- }else{
- echo '
Ничего не получилось... ';
- }
- }elseif( $_GET['buy1'] == 4 ) { // Особенности
- $price = 3000;
- $cur_price = array('price'=>0);
- if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 особенность за '.$price.' ед. награды ';
- $u->info['nskills'] += 1;
- $u->rep['add_skills2'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- }else{
- echo '
Ничего не получилось... ';
- }
- }
- }
- ?>
-
- Награда:
- =($u->rep['allrep']-$u->rep['allnurep'])?>
- ед.
-
-
+
+
+
+ 'capitalcity', 2 => 'demonscity', 3 => 'angelscity'];
+ if ($_GET['buy1'] == 1) {
+ //покупаем статы
+ $price = 2000 + ($u->rep['add_stats'] * 100);
+ $cur_price = ['price' => 0];
+ if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики!
+
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 способность за ' . $price . ' ед. награды ';
+ $u->info['ability'] += 1;
+ $u->rep['add_stats'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 2) { // Умения!
+ $price = 2000 + (2000 * $u->rep['add_skills']);
+ $cur_price = ['price' => 0];
+ if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения!
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 умение за ' . $price . ' ед. награды ';
+ $u->info['skills'] += 1;
+ $u->rep['add_skills'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 3) { // Кредиты
+ $price = 100;
+ $cur_price = ['price' => 0];
+ if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды ';
+ $u->info['money'] += 10;
+ $u->rep['add_money'] += 10;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 4) { // Особенности
+ $price = 3000;
+ $cur_price = ['price' => 0];
+ if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды ';
+ $u->info['nskills'] += 1;
+ $u->rep['add_skills2'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ }
+ }
+ ?>
+
+ Награда:
+ = ($u->rep['allrep'] - $u->rep['allnurep']) ?>
+ ед.
+
+
info['id'].'" LIMIT 1000'));
- if(isset($_GET['buy777']) && $chk[0]>0) {
- $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000');
- while($chk_pl = mysql_fetch_array($chk_cl)) {
- if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1'));
- {
- $x++; $prc += $chk_pl['price1'];
- }
- }
- $u->info['money'] += $prc;
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр. ';
- $chk[0] = 0;
-
- }
- if($chk[0]>0) {
- ?>
- шт.) находящиеся у Вас в инвентаре за =$chk[1]?> кр. ?')) {location='main.php?rz=1&buy777=1'}" />
-
+ $chk = mysql_fetch_array(
+ mysql_query(
+ 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ )
+ );
+ if (isset($_GET['buy777']) && $chk[0] > 0) {
+ $chk_cl = mysql_query(
+ 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ );
+ while ($chk_pl = mysql_fetch_array($chk_cl)) {
+ if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
+ ;
+ }
+ {
+ $x++;
+ $prc += $chk_pl['price1'];
+ }
+ }
+ $u->info['money'] += $prc;
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр. ';
+ $chk[0] = 0;
+
+ }
+ if ($chk[0] > 0) {
+ ?>
+
+
-
-
-
-
- Репутация в Capital city:
- =$u->rep['repcapitalcity']?> ед.
-
-
- Репутация в Demons city:
- =$u->rep['repdemonscity']?> ед.
-
-
- Репутация в Angels city:
- =$u->rep['repangelscity']?> ед.
-
-
- Текущая репутация:
-
-
-info['dn']==0)
-{
-?>
-
-info['id'])
- {
- $psh_start = ' ';
- }
-
- echo '
+
+
+
+
+ Репутация в Capital city:
+ = $u->rep['repcapitalcity'] ?> ед.
+
+
+ Репутация в Demons city:
+ = $u->rep['repdemonscity'] ?> ед.
+
+
+ Репутация в Angels city:
+ = $u->rep['repangelscity'] ?> ед.
+
+
+ Текущая репутация:
+
+
+ info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = '
';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
-}
-?>
+ }
+ }
+ ?>
-timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
+ }
}
-}
-}
-?>
+
diff --git a/modules_data/location/enterdrago.php b/modules_data/location/enterdrago.php
index 6f280839..452e8ae4 100644
--- a/modules_data/location/enterdrago.php
+++ b/modules_data/location/enterdrago.php
@@ -1,935 +1,1051 @@
room['file']=='enterdrago') {
-if(isset($_GET['rz'])) $roomSection = 1; // Получаем Задание
- else $roomSection = 0; // Собираем группу для похода
- $error = ''; // Собираем ошибки.
- $dungeonGroupList = ''; // Сюда помещаем список Групп.
- $dungeonGo = 1; // По умолчанию, мы идем в пещеру.
+use Helper\Conversion;
-$dungeon = mysql_fetch_assoc( mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name FROM `dungeon_room` WHERE `id`="'.$u->room['id'].'" LIMIT 1') );
-//var_info($dungeon);
-$all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 ');
-while( $t = mysql_fetch_array($all_dungeon) ) { $dungeon['list'][] = $t['city']; }
-unset($all_dungeon);
+if (!defined('GAME')) {
+ die();
+}
+if ($u->room['file'] == 'enterdrago') {
-if( $u->info['dn'] > 0 ) {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id'])){
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if (isset($_GET['rz'])) {
+ $roomSection = 1;
+ } // Получаем Задание
+ else {
+ $roomSection = 0;
+ } // Собираем группу для похода
+ $error = ''; // Собираем ошибки.
+ $dungeonGroupList = ''; // Сюда помещаем список Групп.
+ $dungeonGo = 1; // По умолчанию, мы идем в пещеру.
-$dungeon_timeout = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh'.$dungeon['id'].'" AND `time` > '.(time()-60*60*20).' LIMIT 1',1);
-//if($u->info['admin']>0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры.
-if(isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
-{
- $dungeonGo = 0;
- if(isset($_GET['start'])){
- $error = 'До следующего похода осталось еще: '.$u->timeOut(60*60*20-time()+$dungeon_timeout['time']);
- }
-}
+ $dungeon = mysql_fetch_assoc(
+ mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1')
+ );
+ //var_info($dungeon);
+ $all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 ');
+ while ($t = mysql_fetch_array($all_dungeon)) {
+ $dungeon['list'][] = $t['city'];
+ }
+ unset($all_dungeon);
-if( isset($_GET['start']) && $zv['uid']==$u->info['id'] && $dungeonGo == 1 ) { //начинаем поход
- //Генирируем случайный поход
- //$level = $u->info['level'];
- if( $zv['type'] == 0 ) {
- $level = 5;
- }elseif( $zv['type'] == 1 ) {
- $level = 8;
- }elseif( $zv['type'] == 2 ) {
- $level = 10;
- }
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
- $k=floor(2.5*$level); // k=maze size
- $s=$k*2+3; // s=array size
- $r=10; // r=cell size (in pixels)
- $count=1; // count=cells visited.
-
- $a=array(); // A [Row][Col] array of cells (0=open, 1=filled) of the maze.
- for($y=0;$y<$s;$y++) { // Initialize array to all 1 (green).
- for($x=0;$x<$s;$x++) {
- $a[$y][$x]=1;
- }
- }
- for($x=0;$x<$s;$x++) { // Clear rim to 0, to serve as a barricade.
- $a[0][$x]=0;$a[$s-1][$x]=0;
- $a[$x][0]=0;$a[$x][$s-1]=0;
- }
- $x=$y=($k-1)>>1;$a[$y*2+2][$x*2+2]=0; // start from center
- while(1) { // Open paths for k^2 cells.
- do { // Dig as far as possible until we reach a cul-de-sac.
- $d=rand(0,3); // Pick initial direction raqndomly.
- for($i=0;$i<4;$i++) { // Look for a good direction.
- if($d==0 && $a[$y*2+2][$x*2+4]) { // right
- $a[$y*2+2][$x++*2+3]=0;$a[$y*2+2][$x*2+2]=0;
- $i=5;$count++;break; // found
- } elseif($d==1 && $a[$y*2][$x*2+2]) { // up
- $a[$y--*2+1][$x*2+2]=0;$a[$y*2+2][$x*2+2]=0;
- $i=5;$count++;break; // found
- } elseif($d==2 && $a[$y*2+2][$x*2]) { // left
- $a[$y*2+2][$x--*2+1]=0;$a[$y*2+2][$x*2+2]=0;
- $i=5;$count++;break; // found
- } elseif($d==3 && $a[$y*2+4][$x*2+2]) { // down
- $a[$y++*2+3][$x*2+2]=0;$a[$y*2+2][$x*2+2]=0;
- $i=5;$count++;break; // found
- }
- $d=($d+1)%4; // wrap right->up->left->down->right
- } // for
- } while ($i!=4); // i=4 means we are stuck
- if($count>=$k*$k) { // Did we visit k^2 cells?
- break; // while(1) The entire maze has been created.
- }
- $x=rand(0,$k-1);$y=rand(0,$k-1); // Pick random cell on maze.
- // Scan left-to-right top-to-botton for a dug cell with at least
- while($a[$y*2+2][$x*2+2] || // one expandable neighbor
- !$a[$y*2+2][$x*2+4] && !$a[$y*2][$x*2+2] &&
- !$a[$y*2+2][$x*2] && !$a[$y*2+4][$x*2+2]) {
- if(++$x>=$k) { // wrap right edge to left edge
- $x=0;
- if(++$y>=$k) { // wrap bottom to top
- $y=0;
- }
- }
- }
- } // while(1)
- $rnds = array(
- rand(1,3), //start
- rand(1,3) //end
- );
- $srg = array();
- $objects = array();
-
- if( $rnds[0] == 1 ) {
- //вход сверху
- $a[2][1]=0;
- $a[2][2]=0;
- $srg = array( 2,1 );
- $objects[2][1] = '
';
- }elseif( $rnds[0] == 2 ) {
- //вход по центру
- $a[$k][1]=0;
- $a[$k][2]=0;
- $srg = array( $k,1 );
- $objects[$k][1] = '
';
- }elseif( $rnds[0] == 3 ) {
- //вход снизу
- $a[$k*2][1]=0;
- $a[$k*2][2]=0;
- $srg = array( $k*2,1 );
- $objects[$k*2][1] = '
';
- }
-
- if( $rnds[1] == 1 ) {
- //вход сверху
- $a[2][$k*2+1]=0;
- $a[2][$k*2]=0;
- $objects[2][$k*2+1] = '
';
- }elseif( $rnds[1] == 2 ) {
- //вход по центру
- $a[$k][$k*2+1]=0;
- $a[$k][$k*2]=0;
- $objects[$k][$k*2+1] = '
';
- }elseif( $rnds[1] == 3 ) {
- //вход снизу
- $a[$k*2][$k*2+1]=0;
- $a[$k*2][$k*2]=0;
- $objects[$k*2][$k*2+1] = '
';
- }
- //$a[1][2]=0;
- //$a[$k*2+1][$k*2]=0; // Draw entrance and exit.
-?>
-
- 1 && $j > 1 && $i <= $k*2 && $j <= $k*2 ) {
- $map[] = array($i,$j);
- }
- $j++;
- }
- $i++;
- }
-
- //Раскидываем обьекты (XX %)
- /*
- $proc1 = 10; //Сколько % занимают сундуки
- $proc2 = 15; //Сколько % занимают монстры
- $proc3 = 10; //Сколько % занимают хилки
- $proc4 = 5; //Сколько % занимают ловушки
- $proc5 = 2; //Сколько % занимают пандоры*/
- $proc1 = round(1.7*$level); //Сколько % занимают сундуки
- $proc2 = round(2.5*$level); //Сколько % занимают монстры
- $proc3 = round(1.35*$level); //Сколько % занимают хилки
- $proc4 = round(0.5*$level); //Сколько % занимают ловушки
- $proc5 = round(0.1*$level); //Сколько % занимают пандоры
- //
- $proc1 = round($proc1/2);
- $proc1 = round(count($map)/100*$proc1);
- $proc2 = round($proc2/2);
- $proc2 = round(count($map)/100*$proc2);
- $proc3 = round($proc3/2);
- $proc3 = round(count($map)/100*$proc3);
- $proc4 = round($proc4/2);
- $proc4 = round(count($map)/100*$proc4);
- $proc5 = round($proc5/2);
- $proc5 = round(count($map)/100*$proc5);
- //
- //if( $u->info['id'] == 1002 ) {
-
- $usi = 0;
-
- //Сохраняем карту
- mysql_query('INSERT INTO `laba_now` ( `time`,`uid`,`users`,`map_id`,`end`,`type` ) VALUES (
- "'.time().'","'.$u->info['id'].'","-1","0","0","'.$zv['type'].'"
- )');
- $ding = mysql_insert_id();
- $sp = mysql_query( 'SELECT `id`,`dn` FROM `stats` WHERE `dn` = "'.$zv['id'].'" LIMIT 4' );
- while( $pl = mysql_fetch_array( $sp ) ) {
- $u->addAction(time(),'psh102','',$pl['id']);
- mysql_query('UPDATE `users` SET `room` = "370" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0",`dnow` = "'.$ding.'",`x` = "'.$srg[0].'",`y` = "'.$srg[1].'",`res_x` = "'.$srg[0].'",`res_y` = "'.$srg[1].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $usi++;
- }
- mysql_query('UPDATE `laba_now` SET `users` = "'.$usi.'" WHERE `id` = "'.$ding.'" LIMIT 1');
- mysql_query('INSERT INTO `laba_map` ( `id`,`data`,`update` ) VALUES (
- "'.$ding.'","'.json_encode($a).'","'.time().'"
- )');
- mysql_query('DELETE FROM `dungeon_zv` WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- //}
- //
- $i = 1;
- while( $i <= 5 ) {
- if( ${'proc'.$i} > 0 ) {
- $j = 0;
- while( $j < ${'proc'.$i} ) {
- $cord = $map[rand(0,count($map)-1)];
- $obj = '';
- if( $i == 1 ) {
- //сундуки
- $obj = 'ddp1s';
- }elseif( $i == 2 ) {
- //монстры
- $obj = 'ddp1m';
- }elseif( $i == 3 ) {
- //хилки
- $obj = 'ddp1h';
- }elseif( $i == 4 ) {
- //ловушки
- $obj = 'ddp1l';
- }elseif( $i == 5 ) {
- //пандора
- $obj = 'ddp1p';
- }
- $test = mysql_fetch_assoc(mysql_query(' SELECT id FROM `laba_obj` WHERE `img`="'.$obj.'" AND `x`= "'.$cord[0].'" AND `y`= "'.$cord[1].'" AND `lib` = "'.$ding.'" '));
- if( !isset($test['id']) ){
- mysql_query('INSERT INTO `laba_obj` ( `lib`,`x`,`y`,`type`,`img`,`name`,`time`,`use` ) VALUES (
- "'.$ding.'","'.$cord[0].'","'.$cord[1].'","'.$i.'","'.$obj.'","{standart}","'.time().'","0"
- )');
- $j++;
- }
- //$objects[$cord[0]][$cord[1]] = $obj;
-
- }
- }
- $i++;
- }
-
- die('');
-
- //Генирация карты
- /*
- $i = 1;
- while( $i < count($a) - 1 ) {
- $j = 1;
- while( $j < count($a[$i]) - 1 ) {
- if( $a[$i][$j] == 0 ) {
- echo '
'.$objects[$i][$j].'
';
- }else{
- echo '
';
- }
- $j++;
- }
- echo '
';
- $i++;
- }
- */
-
-}elseif(isset($_POST['go'],$_POST['goid']) && $dungeonGo==1){
- if(!isset($zv['id'])){
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv['id']) && $u->info['dn'] == 0){
- if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) {
- $error = 'Вы ввели неправильный пароль';
- }elseif($u->info['level'] > 3 && $u->info['level'] == $zv['lvlmin']){
- $row = 0;
- if(4 > $row){
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd){
- $error = 'Не удалось вступить в эту группу';
- unset($zv);
- }else{
- $u->info['dn'] = $zv['id'];
- }
- }else{
- $error = 'В группе нет места';
- unset($zv);
- }
- }else{
- $error = 'Вы не подходите по уровню';
- unset($zv);
- }
- }else{
- $error = 'Заявка не найдена';
- }
- }else{
- $error = 'Вы уже находитесь в группе';
- }
-}elseif( isset($_POST['leave']) && isset($zv['id']) && $dungeonGo == 1 ) {
- if($zv['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id'])){
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $dungeonGo == 1){
- if($u->info['dn']==0){
- if( $_POST['type_gors'] == 1 ) {
- $_POST['type_gors'] = 1;
- }elseif( $_POST['type_gors'] == 2 ) {
- $_POST['type_gors'] = 2;
- }else{
- $_POST['type_gors'] = 0;
- }
- if( $_POST['type_gors'] == 2 && ($u->info['level'] < 9 || $u->rep['rep3'] < 20000) ) {
- $error = 'Создавать турниры для Легендарных могут персонажи страше 8-го уровня
Так-же у персонажа должно быть более 20000 воинственности!';
- }elseif( $_POST['type_gors'] == 1 && $u->info['level'] < 8 ) {
- $error = 'Создавать турниры для Опытных могут персонажи страше 7-го уровня';
- }elseif( $_POST['type_gors'] == 0 && $u->info['level'] > 7 ) {
- $error = 'Создавать турниры для Новичков могут персонажи младше 8-го уровня';
- }else{
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ $dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh' . $dungeon['id'] . '" AND `time` > ' . (time() - 60 * 60 * 20) . ' LIMIT 1', 1);
+
+ if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
+ {
+ $dungeonGo = 0;
+ if (isset($_GET['start'])) {
+ $error = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 20 - time() + $dungeon_timeout['time']);
+ }
+ }
+
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) { //начинаем поход
+ //Генирируем случайный поход
+ //$level = $u->info['level'];
+ if ($zv['type'] == 0) {
+ $level = 5;
+ } elseif ($zv['type'] == 1) {
+ $level = 8;
+ } elseif ($zv['type'] == 2) {
+ $level = 10;
+ }
+
+ $k = floor(2.5 * $level); // k=maze size
+ $s = $k * 2 + 3; // s=array size
+ $r = 10; // r=cell size (in pixels)
+ $count = 1; // count=cells visited.
+
+ $a = []; // A [Row][Col] array of cells (0=open, 1=filled) of the maze.
+ for ($y = 0; $y < $s; $y++) { // Initialize array to all 1 (green).
+ for ($x = 0; $x < $s; $x++) {
+ $a[$y][$x] = 1;
+ }
+ }
+ for ($x = 0; $x < $s; $x++) { // Clear rim to 0, to serve as a barricade.
+ $a[0][$x] = 0;
+ $a[$s - 1][$x] = 0;
+ $a[$x][0] = 0;
+ $a[$x][$s - 1] = 0;
+ }
+ $x = $y = ($k - 1) >> 1;
+ $a[$y * 2 + 2][$x * 2 + 2] = 0; // start from center
+ while (1) { // Open paths for k^2 cells.
+ do { // Dig as far as possible until we reach a cul-de-sac.
+ $d = rand(0, 3); // Pick initial direction raqndomly.
+ for ($i = 0; $i < 4; $i++) { // Look for a good direction.
+ if ($d == 0 && $a[$y * 2 + 2][$x * 2 + 4]) { // right
+ $a[$y * 2 + 2][$x++ * 2 + 3] = 0;
+ $a[$y * 2 + 2][$x * 2 + 2] = 0;
+ $i = 5;
+ $count++;
+ break; // found
+ } elseif ($d == 1 && $a[$y * 2][$x * 2 + 2]) { // up
+ $a[$y-- * 2 + 1][$x * 2 + 2] = 0;
+ $a[$y * 2 + 2][$x * 2 + 2] = 0;
+ $i = 5;
+ $count++;
+ break; // found
+ } elseif ($d == 2 && $a[$y * 2 + 2][$x * 2]) { // left
+ $a[$y * 2 + 2][$x-- * 2 + 1] = 0;
+ $a[$y * 2 + 2][$x * 2 + 2] = 0;
+ $i = 5;
+ $count++;
+ break; // found
+ } elseif ($d == 3 && $a[$y * 2 + 4][$x * 2 + 2]) { // down
+ $a[$y++ * 2 + 3][$x * 2 + 2] = 0;
+ $a[$y * 2 + 2][$x * 2 + 2] = 0;
+ $i = 5;
+ $count++;
+ break; // found
+ }
+ $d = ($d + 1) % 4; // wrap right->up->left->down->right
+ } // for
+ } while ($i != 4); // i=4 means we are stuck
+ if ($count >= $k * $k) { // Did we visit k^2 cells?
+ break; // while(1) The entire maze has been created.
+ }
+ $x = rand(0, $k - 1);
+ $y = rand(0, $k - 1); // Pick random cell on maze.
+ // Scan left-to-right top-to-botton for a dug cell with at least
+ while ($a[$y * 2 + 2][$x * 2 + 2] || // one expandable neighbor
+ !$a[$y * 2 + 2][$x * 2 + 4] && !$a[$y * 2][$x * 2 + 2] &&
+ !$a[$y * 2 + 2][$x * 2] && !$a[$y * 2 + 4][$x * 2 + 2]) {
+ if (++$x >= $k) { // wrap right edge to left edge
+ $x = 0;
+ if (++$y >= $k) { // wrap bottom to top
+ $y = 0;
+ }
+ }
+ }
+ } // while(1)
+ $rnds = [
+ rand(1, 3), //start
+ rand(1, 3), //end
+ ];
+ $srg = [];
+ $objects = [];
+
+ if ($rnds[0] == 1) {
+ //вход сверху
+ $a[2][1] = 0;
+ $a[2][2] = 0;
+ $srg = [2, 1];
+ $objects[2][1] = '
';
+ } elseif ($rnds[0] == 2) {
+ //вход по центру
+ $a[$k][1] = 0;
+ $a[$k][2] = 0;
+ $srg = [$k, 1];
+ $objects[$k][1] = '
';
+ } elseif ($rnds[0] == 3) {
+ //вход снизу
+ $a[$k * 2][1] = 0;
+ $a[$k * 2][2] = 0;
+ $srg = [$k * 2, 1];
+ $objects[$k * 2][1] = '
';
+ }
+
+ if ($rnds[1] == 1) {
+ //вход сверху
+ $a[2][$k * 2 + 1] = 0;
+ $a[2][$k * 2] = 0;
+ $objects[2][$k * 2 + 1] = '
';
+ } elseif ($rnds[1] == 2) {
+ //вход по центру
+ $a[$k][$k * 2 + 1] = 0;
+ $a[$k][$k * 2] = 0;
+ $objects[$k][$k * 2 + 1] = '
';
+ } elseif ($rnds[1] == 3) {
+ //вход снизу
+ $a[$k * 2][$k * 2 + 1] = 0;
+ $a[$k * 2][$k * 2] = 0;
+ $objects[$k * 2][$k * 2 + 1] = '
';
+ }
+ //$a[1][2]=0;
+ //$a[$k*2+1][$k*2]=0; // Draw entrance and exit.
+ ?>
+
+ 1 && $j > 1 && $i <= $k * 2 && $j <= $k * 2) {
+ $map[] = [$i, $j];
+ }
+ $j++;
+ }
+ $i++;
+ }
+
+ //Раскидываем обьекты (XX %)
+ /*
+ $proc1 = 10; //Сколько % занимают сундуки
+ $proc2 = 15; //Сколько % занимают монстры
+ $proc3 = 10; //Сколько % занимают хилки
+ $proc4 = 5; //Сколько % занимают ловушки
+ $proc5 = 2; //Сколько % занимают пандоры*/
+ $proc1 = round(1.7 * $level); //Сколько % занимают сундуки
+ $proc2 = round(2.5 * $level); //Сколько % занимают монстры
+ $proc3 = round(1.35 * $level); //Сколько % занимают хилки
+ $proc4 = round(0.5 * $level); //Сколько % занимают ловушки
+ $proc5 = round(0.1 * $level); //Сколько % занимают пандоры
+ //
+ $proc1 = round($proc1 / 2);
+ $proc1 = round(count($map) / 100 * $proc1);
+ $proc2 = round($proc2 / 2);
+ $proc2 = round(count($map) / 100 * $proc2);
+ $proc3 = round($proc3 / 2);
+ $proc3 = round(count($map) / 100 * $proc3);
+ $proc4 = round($proc4 / 2);
+ $proc4 = round(count($map) / 100 * $proc4);
+ $proc5 = round($proc5 / 2);
+ $proc5 = round(count($map) / 100 * $proc5);
+ //
+ //if( $u->info['id'] == 1002 ) {
+
+ $usi = 0;
+
+ //Сохраняем карту
+ mysql_query(
+ 'INSERT INTO `laba_now` ( `time`,`uid`,`users`,`map_id`,`end`,`type` ) VALUES (
+ "' . time() . '","' . $u->info['id'] . '","-1","0","0","' . $zv['type'] . '"
+ )'
+ );
+ $ding = mysql_insert_id();
+ $sp = mysql_query('SELECT `id`,`dn` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" LIMIT 4');
+ while ($pl = mysql_fetch_array($sp)) {
+ $u->addAction(time(), 'psh102', '', $pl['id']);
+ mysql_query('UPDATE `users` SET `room` = "370" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ mysql_query(
+ 'UPDATE `stats` SET `dn` = "0",`dnow` = "' . $ding . '",`x` = "' . $srg[0] . '",`y` = "' . $srg[1] . '",`res_x` = "' . $srg[0] . '",`res_y` = "' . $srg[1] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1'
+ );
+ $usi++;
+ }
+ mysql_query('UPDATE `laba_now` SET `users` = "' . $usi . '" WHERE `id` = "' . $ding . '" LIMIT 1');
+ mysql_query(
+ 'INSERT INTO `laba_map` ( `id`,`data`,`update` ) VALUES (
+ "' . $ding . '","' . json_encode($a) . '","' . time() . '"
+ )'
+ );
+ mysql_query('DELETE FROM `dungeon_zv` WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ //}
+ //
+ $i = 1;
+ while ($i <= 5) {
+ if (${'proc' . $i} > 0) {
+ $j = 0;
+ while ($j < ${'proc' . $i}) {
+ $cord = $map[rand(0, count($map) - 1)];
+ $obj = '';
+ if ($i == 1) {
+ //сундуки
+ $obj = 'ddp1s';
+ } elseif ($i == 2) {
+ //монстры
+ $obj = 'ddp1m';
+ } elseif ($i == 3) {
+ //хилки
+ $obj = 'ddp1h';
+ } elseif ($i == 4) {
+ //ловушки
+ $obj = 'ddp1l';
+ } elseif ($i == 5) {
+ //пандора
+ $obj = 'ddp1p';
+ }
+ $test = mysql_fetch_assoc(
+ mysql_query(' SELECT id FROM `laba_obj` WHERE `img`="' . $obj . '" AND `x`= "' . $cord[0] . '" AND `y`= "' . $cord[1] . '" AND `lib` = "' . $ding . '" ')
+ );
+ if (!isset($test['id'])) {
+ mysql_query(
+ 'INSERT INTO `laba_obj` ( `lib`,`x`,`y`,`type`,`img`,`name`,`time`,`use` ) VALUES (
+ "' . $ding . '","' . $cord[0] . '","' . $cord[1] . '","' . $i . '","' . $obj . '","{standart}","' . time() . '","0"
+ )'
+ );
+ $j++;
+ }
+ //$objects[$cord[0]][$cord[1]] = $obj;
+
+ }
+ }
+ $i++;
+ }
+
+ die('');
+
+ //Генирация карты
+ /*
+ $i = 1;
+ while( $i < count($a) - 1 ) {
+ $j = 1;
+ while( $j < count($a[$i]) - 1 ) {
+ if( $a[$i][$j] == 0 ) {
+ echo '
'.$objects[$i][$j].'
';
+ }else{
+ echo '
';
+ }
+ $j++;
+ }
+ echo '
';
+ $i++;
+ }
+ */
+
+ } elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id']) && $u->info['dn'] == 0) {
+ if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) {
+ $error = 'Вы ввели неправильный пароль';
+ } elseif ($u->info['level'] > 3 && $u->info['level'] == $zv['lvlmin']) {
+ $row = 0;
+ if (4 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $error = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $error = 'В группе нет места';
+ unset($zv);
+ }
+ } else {
+ $error = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $error = 'Заявка не найдена';
+ }
+ } else {
+ $error = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $dungeonGo == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1) {
+ if ($u->info['dn'] == 0) {
+ if ($_POST['type_gors'] == 1) {
+ $_POST['type_gors'] = 1;
+ } elseif ($_POST['type_gors'] == 2) {
+ $_POST['type_gors'] = 2;
+ } else {
+ $_POST['type_gors'] = 0;
+ }
+ if ($_POST['type_gors'] == 2 && ($u->info['level'] < 9 || $u->rep['rep3'] < 20000)) {
+ $error = 'Создавать турниры для Легендарных могут персонажи страше 8-го уровня
Так-же у персонажа должно быть более 20000 воинственности!';
+ } elseif ($_POST['type_gors'] == 1 && $u->info['level'] < 8) {
+ $error = 'Создавать турниры для Опытных могут персонажи страше 7-го уровня';
+ } elseif ($_POST['type_gors'] == 0 && $u->info['level'] > 7) {
+ $error = 'Создавать турниры для Новичков могут персонажи младше 8-го уровня';
+ } else {
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`,`type`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dungeon['id'].'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
- "'.$u->info['level'].'",
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dungeon['id'] . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
+ "' . $u->info['level'] . '",
"21",
"5",
- "'.mysql_real_escape_string($_POST['type_gors']).'")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $error = 'Вы успешно создали группу';
- }else{
- $error = 'Не удалось создать группу';
- }
- }
- }else{
- $error = 'Вы уже находитесь в группе';
- }
-}
+ "' . mysql_real_escape_string($_POST['type_gors']) . '")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $error = 'Вы успешно создали группу';
+ } else {
+ $error = 'Не удалось создать группу';
+ }
+ }
+ } else {
+ $error = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$pltype = array(
- 0 => 'Новичок',
- 1 => 'Опытный',
- 2 => 'Старый'
-);
+ //Генерируем список групп
+ $pltype = [
+ 0 => 'Новичок',
+ 1 => 'Опытный',
+ 2 => 'Старый',
+ ];
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `lvlmin` = "'.$u->info['level'].'" AND `dun` = "'.$dungeon['id'].'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
+ $sp = mysql_query(
+ 'SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `lvlmin` = "' . $u->info['level'] . '" AND `dun` = "' . $dungeon['id'] . '" AND `delete` = "0" AND `time` > "' . (time(
+ ) - 60 * 60 * 2) . '"'
+ );
-while( $pl = mysql_fetch_array( $sp ) ) {
- $dungeonGroupList .= '
';
- if( $u->info['dn'] == 0 ) $dungeonGroupList .= '
';
- $dungeonGroupList .= '
'.date('H:i',$pl['time']).' ';
- $dungeonGroupList .= 'Тип:
'.$pltype[$pl['type']].' | ';
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while( $pu = mysql_fetch_array( $su ) ) {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim( $pus, ', ' );
-
- $dungeonGroupList .= $pus; unset($pus);
+ while ($pl = mysql_fetch_array($sp)) {
+ $dungeonGroupList .= '
';
+ if ($u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
+ $dungeonGroupList .= '
' . date('H:i', $pl['time']) . ' ';
+ $dungeonGroupList .= 'Тип:
' . $pltype[$pl['type']] . ' | ';
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
- if( $pl['pass'] != '' && $u->info['dn'] == 0 ) $dungeonGroupList .= '
';
- if( $pl['com'] != '' ) {
- $dl = '';
- // Если модератор, даем возможность удалять комментарий к походу.
- $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
- if( ( $moder['boi'] == 1 || $u->info['admin'] > 0 ) && $pl['dcom'] == 0 ){
- $dl .= ' (
удалить комментарий )';
- if( isset( $_GET['delcom'] ) && $_GET['delcom'] == $pl['id'] && $u->newAct( $_GET['key'] ) == true ) {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
- if( $pl['dcom'] > 0 ) {
- $dl = '
комментарий удален модератором ';
- }
- if( $pl['dcom'] > 0 ) {
- if( $moder['boi'] == 1 || $u->info['admin'] > 0 ) {
- $pl['com'] = '
'.$pl['com'].' ';
- } else {
- $pl['com'] = '';
- }
- }
- $dungeonGroupList .= '
| '.$pl['com'].''.$dl.' ';
- }
- $dungeonGroupList .= '
';
-}
-?>
-
-
-
-
- error!='') {
- echo ''.$u->error.' ';
- }elseif($re!='') {
- echo ''.$re.' ';
- }
- ?>
-
-
= $u->room['name']; ?>
-
- Если вы не найдете выход из пещеры, то любые найденные вами ресурсы (даже в предыдущих походах) - исчезнут. То же самое, если вы умрёте 3 раза.
-
-
-
+ $dungeonGroupList .= $pus;
+ unset($pus);
+
+ if ($pl['pass'] != '' && $u->info['dn'] == 0) {
+ $dungeonGroupList .= ' ';
+ }
+ if ($pl['com'] != '') {
+ $dl = '';
+ // Если модератор, даем возможность удалять комментарий к походу.
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+ if ($pl['dcom'] > 0) {
+ $dl = ' комментарий удален модератором ';
+ }
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+ $dungeonGroupList .= ' | ' . $pl['com'] . '' . $dl . ' ';
+ }
+ $dungeonGroupList .= '';
+ }
+ ?>
+
+
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ error != '') {
+ echo '' . $u->error . ' ';
+ } elseif ($re != '') {
+ echo '' . $re . ' ';
+ }
+ ?>
+
+
= $u->room['name']; ?>
+
+ Если вы не найдете выход из пещеры, то любые найденные вами ресурсы (даже в предыдущих походах) - исчезнут. То же самое, если вы умрёте 3 раза.
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
'.$error.' ';
-}
+
+
+
+
+
+
+
' . $error . ' ';
+ }
-//отображаем
-if($dungeonGroupList=='')
-{
- $dungeonGroupList = '';
-}else{
- if(!isset($zv['id']) || $u->info['dn'] == 0)
- {
- if($dungeonGo==1 || $u->info['dn'] == 0)
- {
- $pr = '
';
- }
- $dungeonGroupList = '
'.$pr.' '.$dungeonGroupList.''.$pr.' ';
- }
- $dungeonGroupList .= '
';
-}
+ //отображаем
+ if ($dungeonGroupList == '') {
+ $dungeonGroupList = '';
+ } else {
+ if (!isset($zv['id']) || $u->info['dn'] == 0) {
+ if ($dungeonGo == 1 || $u->info['dn'] == 0) {
+ $pr = '
';
+ }
+ $dungeonGroupList = '
' . $pr . ' ' . $dungeonGroupList . '' . $pr . ' ';
+ }
+ $dungeonGroupList .= '
';
+ }
-if($roomSection==0) { echo $dungeonGroupList; }
- if($roomSection == 1) {
- ?>
-
-
- testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_'.$dungeon['city'].'" LIMIT 1',1);
- $qc=0; // Quest Count
- //Генерируем список текущих квестов
- $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100');
- while( $pl = mysql_fetch_array( $sp ) ) {
- if($pl['room'] == $u->info['room']){
- $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1'));
- $qsee .= ' '.$pq['name'].' '.$pq['info'].' '.$q->info($pq).'
';
- $qc++;
- }
- }
-
- if( isset( $_GET['add_quest'] ) && $qc == 0 ) {
- if( isset( $hgo['id'] ) ) {
- echo 'Нельзя получать задания чаще одного раза в сутки ';
- } else {
- $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = '.$dungeon['id'].'');
- $dq_add = array();
- while( $pl = mysql_fetch_array( $sp ) ) {
- if( $u->rep['rep'.$dungeon['city']] == 9999 ) {
- //квет, рыцарского задания
- if( $pl['kin'] == 1 ) {
- $dq_add = array( 0 => $pl );
- }
- } elseif( $u->rep['rep'.$dungeon['city']] == 19999 ) {
- //квет, рыцарского задания
- if( $pl['kin'] == 2 ) {
- $dq_add = array( 0 => $pl );
- }
- } else {
- if( $pl['kin'] == 0 ) {
- $dq_add[count($dq_add)] = $pl;
- }
- }
- }
- $dq_add = $q->onlyOnceQuest($dq_add, $u->info['id']);
- $dq_add = $dq_add[rand(0,count($dq_add)-1)];
-
-
- if( $q->testGood($dq_add) == 1 && $dq_add > 0 ) {
- $q->startq_dn($dq_add['id']);
- echo 'Вы успешно получили новое задание "'.$dq_add['name'].'". ';
- $u->addAction(time(),'psh_qt_'.$dungeon['city'],$dq_add['id']);
- } else {
- if ( $u->rep['rep'.$dungeon['city']] == 9999 ) {
- //квест, рыцарского задания
- echo 'Вы уже получили задание на достижение титула рыцаря! ';
- } elseif( $u->rep['rep'.$dungeon['city']] == 19999 ) {
- //квест, рыцарского задания
- echo 'Вы завершили квестовую линию, ожидайте новых заданий! ';
- } else {
- echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще... ';
- }
- }
- unset( $dq_add );
- }
- } elseif( isset( $_GET['add_quest'] ) && $qc > 0 ) {
- echo 'Что-то пошло не так... осторожнее.. ';
- }
- if( $qsee == '' ) {
- $qsee = 'К сожалению у вас нет ни одного задания ';
- }
- ?>
-
-
- Текущие задания:
- =$qsee?>
-
+ if ($roomSection == 0) {
+ echo $dungeonGroupList;
+ }
+ if ($roomSection == 1) {
+ ?>
+
+
+ testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1);
+ $qc = 0; // Quest Count
+ //Генерируем список текущих квестов
+ $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100');
+ while ($pl = mysql_fetch_array($sp)) {
+ if ($pl['room'] == $u->info['room']) {
+ $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1'));
+ $qsee .= ' ' . $pq['name'] . ' ' . $pq['info'] . ' ' . $q->info(
+ $pq
+ ) . '
';
+ $qc++;
+ }
+ }
+
+ if (isset($_GET['add_quest']) && $qc == 0) {
+ if (isset($hgo['id'])) {
+ echo 'Нельзя получать задания чаще одного раза в сутки ';
+ } else {
+ $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = ' . $dungeon['id'] . '');
+ $dq_add = [];
+ while ($pl = mysql_fetch_array($sp)) {
+ if ($u->rep['rep' . $dungeon['city']] == 9999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 1) {
+ $dq_add = [0 => $pl];
+ }
+ } elseif ($u->rep['rep' . $dungeon['city']] == 19999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 2) {
+ $dq_add = [0 => $pl];
+ }
+ } else {
+ if ($pl['kin'] == 0) {
+ $dq_add[count($dq_add)] = $pl;
+ }
+ }
+ }
+ $dq_add = $q->onlyOnceQuest($dq_add, $u->info['id']);
+ $dq_add = $dq_add[rand(0, count($dq_add) - 1)];
+
+
+ if ($q->testGood($dq_add) == 1 && $dq_add > 0) {
+ $q->startq_dn($dq_add['id']);
+ echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '". ';
+ $u->addAction(time(), 'psh_qt_' . $dungeon['city'], $dq_add['id']);
+ } else {
+ if ($u->rep['rep' . $dungeon['city']] == 9999) {
+ //квест, рыцарского задания
+ echo 'Вы уже получили задание на достижение титула рыцаря! ';
+ } elseif ($u->rep['rep' . $dungeon['city']] == 19999) {
+ //квест, рыцарского задания
+ echo 'Вы завершили квестовую линию, ожидайте новых заданий! ';
+ } else {
+ echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще... ';
+ }
+ }
+ unset($dq_add);
+ }
+ } elseif (isset($_GET['add_quest']) && $qc > 0) {
+ echo 'Что-то пошло не так... осторожнее.. ';
+ }
+ if ($qsee == '') {
+ $qsee = 'К сожалению у вас нет ни одного задания ';
+ }
+ ?>
+
+
+ Текущие задания:
+ = $qsee ?>
+
0 ){
- echo 'Вы еще не справились с текущим заданием.';
- } elseif( !isset( $hgo['id'] ) && $qc == 0 ) {
- ?>
-
-
- '.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' ) ';
- }
- ?>
+ if ($qc > 0) {
+ echo 'Вы еще не справились с текущим заданием.';
+ } elseif (!isset($hgo['id']) && $qc == 0) {
+ ?>
+
+
+ ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout(
+ $hgo['time'] + 60 * 60 * 24 - time()
+ ) . ' )';
+ }
+ ?>
-
-
-
-
- rep['add_stats']*100);
- $cur_price = array('price'=>0);
- if( 25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price ) { // Характеристики!
- foreach( $dungeon['list'] as $key => $val ) {
- if( !( $cur_price['price'] >= $price ) ) {
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if( $price == $cur_price['price'] ) {
- foreach( $dungeon['list'] as $key => $val ) {
- if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) {
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if($r) $rt = 1; else $rt = 0;
- }
- }
- if($rt==1){
- $u->info['ability'] += 1; $u->rep['add_stats'] += 1;
- mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo '
Вы успешно приобрели 1 способность за '.$price.' ед. награды ';
- } else {
- echo '
Ничего не получилось... ';
- }
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- } elseif( $_GET['buy1'] == 2 ) { // Умения!
- $price = 2000+(2000*$u->rep['add_skills']);
- $cur_price = array('price'=>0);
- if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения!
- foreach($dungeon['list'] as $key=>$val){
- if( !( $cur_price['price'] >= $price ) ) {
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if( $price == $cur_price['price'] ) {
- foreach( $dungeon['list'] as $key => $val ) {
- if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) {
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if($r) $rt = 1; else $rt = 0;
- }
- }
- if($rt==1){
- $u->info['skills'] += 1; $u->rep['add_skills'] += 1;
- mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo '
Вы успешно приобрели 1 умение за '.$price.' ед. награды ';
- } else {
- echo '
Ничего не получилось... ';
- }
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- } elseif( $_GET['buy1'] == 3 ) { // Кредиты
- $price = 100;
- $cur_price = array('price'=>0);
- if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
- foreach($dungeon['list'] as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price; $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ) {
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if( $price == $cur_price['price'] ) {
- foreach( $dungeon['list'] as $key => $val ) {
- if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) {
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if($r) $rt = 1; else $rt = 0;
- }
- }
- if($rt==1){
- $u->info['money'] += 10; $u->rep['add_money'] += 10;
- mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo '
Вы успешно приобрели 10 кр. за '.$price.' ед. награды ';
- } else {
- echo '
Ничего не получилось... ';
- }
- } else echo 'Недостаточно репутации.';
- }else{
- echo '
Ничего не получилось... ';
- }
- } elseif( $_GET['buy1'] == 4 ) { // Особенности
- $price = 3000;
- $cur_price = array('price'=>0);
- if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности
- foreach($dungeon['list'] as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1))); $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if( $price == $cur_price['price'] ) {
- foreach( $dungeon['list'] as $key => $val ) {
- if( isset( $cur_price['nu_'.$val] ) && isset( $u->rep['nu_'.$val] ) && $rt == 1 ) {
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- $r = mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if($r) $rt = 1; else $rt = 0;
- }
- }
- if($rt==1){
- $u->info['sskills'] += 1; $u->rep['add_skills2'] += 1;
- mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `sskills` = "'.$u->info['sskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo '
Вы успешно приобрели 1 особенность за '.$price.' ед. награды ';
- } else {
- echo '
Ничего не получилось... ';
- }
- } else echo 'Недостаточно репутации.';
-
- } else {
- echo '
Ничего не получилось... ';
- }
- }
- }
- ?>
-
- Награда: =($u->rep['allrep']-$u->rep['allnurep'])?> ед.
-
-
- info['id'].'" LIMIT 1000'));
- if(isset($_GET['buy777']) && $chk[0]>0) {
- $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000');
- while($chk_pl = mysql_fetch_array($chk_cl)) {
- if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1'));
- {
- $x++; $prc += $chk_pl['price1'];
- }
- }
- $u->info['money'] += $prc;
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр. ';
- $chk[0] = 0;
-
- }
- if($chk[0]>0) {
- ?>
-
-
-
-
-
-
-
- Репутация в Dragons city:
- =$u->rep['repdragonscity']?> ед.
-
-
- Репутация в Capital city:
- =$u->rep['repcapitalcity']?> ед.
-
-
- Репутация в Demons city:
- =$u->rep['repdemonscity']?> ед.
-
-
- Репутация в Angels city:
- =$u->rep['repangelscity']?> ед.
-
-
- Текущая репутация:
-
-
- info['dn']==0){
- ?>
-
+
+
+
+
+ rep['add_stats'] * 100);
+ $cur_price = ['price' => 0];
+ if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики!
+ foreach ($dungeon['list'] as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ foreach ($dungeon['list'] as $key => $val) {
+ if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
+ }
+ }
+ if ($rt == 1) {
+ $u->info['ability'] += 1;
+ $u->rep['add_stats'] += 1;
+ mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo '
Вы успешно приобрели 1 способность за ' . $price . ' ед. награды ';
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 2) { // Умения!
+ $price = 2000 + (2000 * $u->rep['add_skills']);
+ $cur_price = ['price' => 0];
+ if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения!
+ foreach ($dungeon['list'] as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ foreach ($dungeon['list'] as $key => $val) {
+ if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
+ }
+ }
+ if ($rt == 1) {
+ $u->info['skills'] += 1;
+ $u->rep['add_skills'] += 1;
+ mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo '
Вы успешно приобрели 1 умение за ' . $price . ' ед. награды ';
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 3) { // Кредиты
+ $price = 100;
+ $cur_price = ['price' => 0];
+ if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
+ foreach ($dungeon['list'] as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ foreach ($dungeon['list'] as $key => $val) {
+ if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
+ }
+ }
+ if ($rt == 1) {
+ $u->info['money'] += 10;
+ $u->rep['add_money'] += 10;
+ mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo '
Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды ';
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 4) { // Особенности
+ $price = 3000;
+ $cur_price = ['price' => 0];
+ if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности
+ foreach ($dungeon['list'] as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ foreach ($dungeon['list'] as $key => $val) {
+ if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ $r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
+ }
+ }
+ if ($rt == 1) {
+ $u->info['sskills'] += 1;
+ $u->rep['add_skills2'] += 1;
+ mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `sskills` = "' . $u->info['sskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo '
Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды ';
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ }
+ }
+ ?>
+
+ Награда: = ($u->rep['allrep'] - $u->rep['allnurep']) ?> ед.
+
+
info['id'])
- {
- $psh_start = ' ';
- }
-
- echo '
+ $chk = mysql_fetch_array(
+ mysql_query(
+ 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ )
+ );
+ if (isset($_GET['buy777']) && $chk[0] > 0) {
+ $chk_cl = mysql_query(
+ 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ );
+ while ($chk_pl = mysql_fetch_array($chk_cl)) {
+ if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
+ ;
+ }
+ {
+ $x++;
+ $prc += $chk_pl['price1'];
+ }
+ }
+ $u->info['money'] += $prc;
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр. ';
+ $chk[0] = 0;
+
+ }
+ if ($chk[0] > 0) {
+ ?>
+
+
+
+
+
+
+
+ Репутация в Dragons city:
+ = $u->rep['repdragonscity'] ?> ед.
+
+
+ Репутация в Capital city:
+ = $u->rep['repcapitalcity'] ?> ед.
+
+
+ Репутация в Demons city:
+ = $u->rep['repdemonscity'] ?> ед.
+
+
+ Репутация в Angels city:
+ = $u->rep['repangelscity'] ?> ед.
+
+
+ Текущая репутация:
+
+
+ info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = '
';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
- }
- } else {
- echo 'Поход в пещеры разрешен один раз в двадцать часов. Осталось еще: '.$u->timeOut(60*60*20-time()+$dungeon_timeout['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
- }
- }
+ }
+ }
+ } else {
+ echo 'Поход в пещеры разрешен один раз в двадцать часов. Осталось еще: ' . Conversion::secondsToTimeout(
+ 60 * 60 * 20 - time() + $dungeon_timeout['time']
+ ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
+ }
}
-?>
+
diff --git a/modules_data/location/entergrib.php b/modules_data/location/entergrib.php
index 7f0272fd..ace2fda4 100644
--- a/modules_data/location/entergrib.php
+++ b/modules_data/location/entergrib.php
@@ -1,572 +1,572 @@
room['file']=='entergrib')
-{
+if ($u->room['file'] == 'entergrib') {
-if(isset($_GET['rz'])) {
- $rz = 1;
-}else{
- $rz = 0;
-}
+ if (isset($_GET['rz'])) {
+ $rz = 1;
+ } else {
+ $rz = 0;
+ }
-$dun = 10; //для новичков 2-7 лвл
+ $dun = 10; //для новичков 2-7 лвл
-$er = '';
+ $er = '';
-$dzs = '';
+ $dzs = '';
-$g111 = 1;
-//Задержка в Санд
-$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh2" AND `time`>'.(time()-7200).' LIMIT 1',1);
+ $g111 = 1;
+ //Задержка в Санд
+ $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh2" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1);
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
-if($u->info['dn']>0)
-{
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id']))
- {
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
-if(isset($g11['id']))
-{
- $g111 = 0;
- if(isset($_GET['start']))
- {
- $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']);
- }
-}
-if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1)
-{
- //начинаем поход
- //начинаем поход
- $ig = 1;
- if($ig>0)
- {
- //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh2','');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Катакомбы","'.time().'")');
- if($ins)
- {
- $zid = mysql_insert_id();
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).'');
- $ids = '';
- while($pu = mysql_fetch_array($su))
- {
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- $u->addAction(time(),'psh2','',$pu['id']);
- }
- $ids = rtrim($ids,'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- if($upd1)
- {
- $upd2 = mysql_query('UPDATE `users` SET `room` = "305" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- $vls = rtrim($vls,',');
- if($vls!='')
- {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
- }else{
- $ins2 = true;
- }
- if($upd2 && $ins1 && $ins2)
- {
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- die('');
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }
-}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1)
-{
- if(!isset($zv['id']))
- {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv['id']))
- {
- if($u->info['level']>7)
- {
- $row = 0;
- if(5>$row)
- {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd)
- {
- $re = 'Не удалось вступить в эту группу';
- unset($zv);
- }else{
- $u->info['dn'] = $zv['id'];
- }
- }else{
- $re = 'В группе нет места';
- unset($zv);
- }
- }else{
- $re = 'Вы не подходите по уровню';
- unset($zv);
- }
- }else{
- $re = 'Заявка не найдена';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1)
-{
- if($zv['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id']))
- {
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1)
-{
- if($u->info['dn']==0)
- {
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ if (isset($g11['id'])) {
+ $g111 = 0;
+ if (isset($_GET['start'])) {
+ $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']);
+ }
+ }
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) {
+ //начинаем поход
+ //начинаем поход
+ $ig = 1;
+ if ($ig > 0) {
+ //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh2','');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Катакомбы","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ $ids = '';
+ while ($pu = mysql_fetch_array($su)) {
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ $u->addAction(time(), 'psh2', '', $pu['id']);
+ }
+ $ids = rtrim($ids, 'OR');
+ $upd1 = mysql_query(
+ 'UPDATE `stats` SET `s`="0",`res_s`="0",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "305" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ if ($vls != '') {
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
+ } else {
+ $ins2 = true;
+ }
+ if ($upd2 && $ins1 && $ins2) {
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ die('');
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id'])) {
+ if ($u->info['level'] > 7) {
+ $row = 0;
+ if (5 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $re = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $re = 'В группе нет места';
+ unset($zv);
+ }
+ } else {
+ $re = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $re = 'Заявка не найдена';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
"8",
"21",
- "5")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $re = 'Вы успешно создали группу';
- }else{
- $re = 'Не удалось создать группу';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}
+ "5")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $re = 'Вы успешно создали группу';
+ } else {
+ $re = 'Не удалось создать группу';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "3" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while($pl = mysql_fetch_array($sp))
-{
- $dzs .= '
';
- if($u->info['dn']==0)
- {
- $dzs .= '
';
- }
- $dzs .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while($pu = mysql_fetch_array($su))
- {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim($pus,', ');
-
- $dzs .= $pus;
-
- if($pl['com']!='')
- {
- $dl = '';
- if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0)
- {
- $dl .= ' (
удалить комментарий )';
- if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true)
- {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
-
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
-
- if($pl['dcom']>0)
- {
- $dl = '
комментарий удален модератором ';
- }
-
- if($pl['dcom']>0)
- {
- if($moder['boi']==1 || $u->info['admin']>0)
- {
- $pl['com'] = '
'.$pl['com'].' ';
- }else{
- $pl['com'] = '';
- }
- }
-
- $dzs .= '
| '.$pl['com'].''.$dl.' ';
- }
-
- $dzs .= '
';
-}
-?>
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ //Генерируем список групп
+ $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "3" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $dzs .= '';
+ if ($u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+ $dzs .= '
' . date('H:i', $pl['time']) . ' ';
+
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dzs .= $pus;
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (
удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+
+ if ($pl['dcom'] > 0) {
+ $dl = '
комментарий удален модератором ';
+ }
+
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '
' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+
+ $dzs .= '
| ' . $pl['com'] . '' . $dl . ' ';
+ }
+
+ $dzs .= '
';
+ }
+ ?>
+
+
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
'.$re.' ';
-}
+
+
+
+
+
+
+
' . $re . ' ';
+ }
-//отображаем
-if($dzs=='')
-{
- $dzs = '';
-}else{
- if(!isset($zv['id']))
- {
- if($g111==1)
- {
- $pr = '
';
- }
- $dzs = '
'.$pr.' '.$dzs.''.$pr.' ';
- }
- $dzs .= '
';
-}
+ //отображаем
+ if ($dzs == '') {
+ $dzs = '';
+ } else {
+ if (!isset($zv['id'])) {
+ if ($g111 == 1) {
+ $pr = '
';
+ }
+ $dzs = '
' . $pr . ' ' . $dzs . '' . $pr . ' ';
+ }
+ $dzs .= '
';
+ }
-if($rz==0) { echo $dzs; }
-if($rz == 1) {
-?>
-
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_allcity" LIMIT 1',1);
-if(isset($_GET['add_quest'])) {
- if(isset($hgo['id'])) {
- echo 'Нельзя получать задания чаще одного раза в сутки ';
- }else{
-
- $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 4');
- $dq_add = array();
- while($pl = mysql_fetch_array($sp)) {
- $dq_add[count($dq_add)] = $pl;
- }
-
- $dq_add = $dq_add[rand(0,count($dq_add)-1)];
-
- if($q->testGood($dq_add)==1)
- {
- $q->startq_dn($dq_add['id']);
- echo 'Вы успешно получили новое задание "'.$dq_add['name'].'". ';
- $hgo['id'] = 1;
- $u->addAction(time(),'psh_qt_allcity',$dq_add['id']);
- }else{
- echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще... ';
- }
- unset($dq_add);
- }
-}
+ if ($rz == 0) {
+ echo $dzs;
+ }
+ if ($rz == 1) {
+ ?>
+
+
+ testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_allcity" LIMIT 1', 1);
+ if (isset($_GET['add_quest'])) {
+ if (isset($hgo['id'])) {
+ echo 'Нельзя получать задания чаще одного раза в сутки ';
+ } else {
-//Генерируем список текущих квестов
-$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100');
-while($pl = mysql_fetch_array($sp))
-{
- $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1'));
- $qsee .= ' '.$pq['name'].' '.$pq['info'].' '.$q->info($pq).'
';
- $qx++;
-}
+ $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 4');
+ $dq_add = [];
+ while ($pl = mysql_fetch_array($sp)) {
+ $dq_add[count($dq_add)] = $pl;
+ }
-if($qsee == '')
-{
- $qsee = 'К сожалению у вас нет ни одного задания';
-}
-?>
-
-
-Текущие задания: [=$qx?>/28]
-=$qsee?>
-
+ $dq_add = $dq_add[rand(0, count($dq_add) - 1)];
+
+ if ($q->testGood($dq_add) == 1) {
+ $q->startq_dn($dq_add['id']);
+ echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '". ';
+ $hgo['id'] = 1;
+ $u->addAction(time(), 'psh_qt_allcity', $dq_add['id']);
+ } else {
+ echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще... ';
+ }
+ unset($dq_add);
+ }
+ }
+
+ //Генерируем список текущих квестов
+ $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100');
+ while ($pl = mysql_fetch_array($sp)) {
+ $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1'));
+ $qsee .= ' ' . $pq['name'] . ' ' . $pq['info'] . ' ' . $q->info(
+ $pq
+ ) . '
';
+ $qx++;
+ }
+
+ if ($qsee == '') {
+ $qsee = 'К сожалению у вас нет ни одного задания';
+ }
+ ?>
+
+
+ Текущие задания: [= $qx ?>/28]
+ = $qsee ?>
+
-
-
-'.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' ) ';
+if (!isset($hgo['id'])) {
+ ?>
+
+
+ ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout(
+ $hgo['time'] + 60 * 60 * 24 - time()
+ ) . ' ) ';
}
?>
-
-
-
- rep['add_stats']>0 && $u->rep['repsuncity']-$u->rep['nu_suncity']>=2000) {
- echo '
Вы успешно приобрели 1 способность за 2000 ед. награды ';
- $u->info['ability'] += 1;
- $u->rep['nu_suncity'] += 2000;
- $u->rep['add_stats'] += 1;
- mysql_query('UPDATE `rep` SET `add_stats` = `add_stats`+1,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }else{
- echo '
Ничего не получилось... ';
- }
- }elseif($_GET['buy1']==2) {
- //покупаем статы
- if(10-$u->rep['add_skills']>0 && $u->rep['repsuncity']-$u->rep['nu_suncity']>=2000) {
- echo '
Вы успешно приобрели 1 умение за 2000 ед. награды ';
- $u->info['skills'] += 1;
- $u->rep['nu_suncity'] += 2000;
- $u->rep['add_skills'] += 1;
- mysql_query('UPDATE `rep` SET `add_skills` = `add_skills`+1,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }else{
- echo '
Ничего не получилось... ';
- }
- }elseif($_GET['buy1']==3) {
- //покупаем статы
- if($u->rep['repsuncity']-$u->rep['nu_suncity']>=100) {
- echo '
Вы успешно приобрели 10 кр. за 100 ед. награды ';
- $u->info['money'] += 10;
- $u->rep['nu_suncity'] += 100;
- $u->rep['add_money'] += 10;
- mysql_query('UPDATE `rep` SET `add_money` = `add_money`+10,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }else{
- echo '
Ничего не получилось... ';
- }
- }elseif($_GET['buy1']==4) {
- //покупаем статы
- if(5-$u->rep['add_skills2']>0 && $u->rep['repsuncity']-$u->rep['nu_suncity']>=3000) {
- echo '
Вы успешно приобрели 1 особенность за 3000 ед. награды ';
- $u->info['nskills'] += 1;
- $u->rep['nu_suncity'] += 3000;
- $u->rep['add_skills2'] += 1;
- mysql_query('UPDATE `rep` SET `add_skills2` = `add_skills2`+1,`nu_suncity` = "'.$u->rep['nu_suncity'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }else{
- echo '
Ничего не получилось... ';
- }
- }
- }
- ?>
-
- Награда:
- =($u->rep['repsuncity']-$u->rep['nu_suncity'])?>
- ед.
-
-
+
+
+
+ rep['add_stats'] > 0 && $u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 2000) {
+ echo '
Вы успешно приобрели 1 способность за 2000 ед. награды ';
+ $u->info['ability'] += 1;
+ $u->rep['nu_suncity'] += 2000;
+ $u->rep['add_stats'] += 1;
+ mysql_query('UPDATE `rep` SET `add_stats` = `add_stats`+1,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 2) {
+ //покупаем статы
+ if (10 - $u->rep['add_skills'] > 0 && $u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 2000) {
+ echo '
Вы успешно приобрели 1 умение за 2000 ед. награды ';
+ $u->info['skills'] += 1;
+ $u->rep['nu_suncity'] += 2000;
+ $u->rep['add_skills'] += 1;
+ mysql_query('UPDATE `rep` SET `add_skills` = `add_skills`+1,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 3) {
+ //покупаем статы
+ if ($u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 100) {
+ echo '
Вы успешно приобрели 10 кр. за 100 ед. награды ';
+ $u->info['money'] += 10;
+ $u->rep['nu_suncity'] += 100;
+ $u->rep['add_money'] += 10;
+ mysql_query('UPDATE `rep` SET `add_money` = `add_money`+10,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 4) {
+ //покупаем статы
+ if (5 - $u->rep['add_skills2'] > 0 && $u->rep['repsuncity'] - $u->rep['nu_suncity'] >= 3000) {
+ echo '
Вы успешно приобрели 1 особенность за 3000 ед. награды ';
+ $u->info['nskills'] += 1;
+ $u->rep['nu_suncity'] += 3000;
+ $u->rep['add_skills2'] += 1;
+ mysql_query('UPDATE `rep` SET `add_skills2` = `add_skills2`+1,`nu_suncity` = "' . $u->rep['nu_suncity'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ }
+ }
+ ?>
+
+ Награда:
+ = ($u->rep['repsuncity'] - $u->rep['nu_suncity']) ?>
+ ед.
+
+
info['id'].'" LIMIT 1000'));
- if(isset($_GET['buy777']) && $chk[0]>0) {
- $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000');
- while($chk_pl = mysql_fetch_array($chk_cl)) {
- if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1'));
- {
- $x++; $prc += $chk_pl['price1'];
- }
- }
- $u->info['money'] += $prc;
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр. ';
- $chk[0] = 0;
-
- }
- if($chk[0]>0) {
- ?>
- шт.) находящиеся у Вас в инвентаре за =$chk[1]?> кр. ?')) {location='main.php?rz=1&buy777=1'}" />
-
+ $chk = mysql_fetch_array(
+ mysql_query(
+ 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ )
+ );
+ if (isset($_GET['buy777']) && $chk[0] > 0) {
+ $chk_cl = mysql_query(
+ 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ );
+ while ($chk_pl = mysql_fetch_array($chk_cl)) {
+ if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
+ ;
+ }
+ {
+ $x++;
+ $prc += $chk_pl['price1'];
+ }
+ }
+ $u->info['money'] += $prc;
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр. ';
+ $chk[0] = 0;
+
+ }
+ if ($chk[0] > 0) {
+ ?>
+
+
-
-
- Репутация в Sun city: =$u->rep['repsuncity']?>
-
-
-info['dn']==0)
-{
-?>
-
-info['id'])
- {
- $psh_start = ' ';
- }
-
- echo '
+
+
+ Репутация в Sun city: = $u->rep['repsuncity'] ?>
+
+
+ info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = '
';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
-}
-?>
+ }
+ }
+ ?>
-timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
+ }
}
-}
-}
-?>
+
diff --git a/modules_data/location/enternekro.php b/modules_data/location/enternekro.php
index e6c298e7..ffbaeb0c 100644
--- a/modules_data/location/enternekro.php
+++ b/modules_data/location/enternekro.php
@@ -1,369 +1,352 @@
room['file']=='enternekro')
-{
+if ($u->room['file'] == 'enternekro') {
-$dun = 11; //для новичков 2-7 лвл
+ $dun = 11; //для новичков 2-7 лвл
-$er = '';
+ $er = '';
-$dzs = '';
+ $dzs = '';
-$g111 = 1;
-$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh1" AND `time`>'.(time()-7200).' LIMIT 1',1);
+ $g111 = 1;
+ $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh1" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1);
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
-if($u->info['dn']>0)
-{
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id']))
- {
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
-if(isset($g11['id']))
-{
- $g111 = 0;
- if(isset($_GET['start']))
- {
- $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']);
- }
-}
-if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1)
-{
- //начинаем поход
- //начинаем поход
- $ig = 1;
- if($ig>0)
- {
- //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh1','');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Бездна","'.time().'")');
- if($ins)
- {
- $zid = mysql_insert_id();
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).'');
- $ids = '';
- while($pu = mysql_fetch_array($su))
- {
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- $u->addAction(time(),'psh1','',$pu['id']);
- }
- $ids = rtrim($ids,'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `x`="1",`y`="-6",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- if($upd1)
- {
- $upd2 = mysql_query('UPDATE `users` SET `room` = "297" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- $vls = rtrim($vls,',');
- if($vls!='')
- {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
- }else{
- $ins2 = true;
- }
- if($upd2 && $ins1 && $ins2)
- {
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- die('');
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }
-}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1)
-{
- if(!isset($zv['id']))
- {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv['id']))
- {
- if($u->info['level']>5)
- {
- $row = 0;
- if(5>$row)
- {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd)
- {
- $re = 'Не удалось вступить в эту группу';
- unset($zv);
- }else{
- $u->info['dn'] = $zv['id'];
- }
- }else{
- $re = 'В группе нет места';
- unset($zv);
- }
- }else{
- $re = 'Вы не подходите по уровню';
- unset($zv);
- }
- }else{
- $re = 'Заявка не найдена';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1)
-{
- if($zv['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id']))
- {
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1)
-{
- if($u->info['dn']==0)
- {
- $lmn = 6;
- $lmx = 21;
- $tmx = 5;
-
- //только своего уровня
- $lmn = $u->info['level'];
-
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ if (isset($g11['id'])) {
+ $g111 = 0;
+ if (isset($_GET['start'])) {
+ $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']);
+ }
+ }
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) {
+ //начинаем поход
+ //начинаем поход
+ $ig = 1;
+ if ($ig > 0) {
+ //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh1','');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Бездна","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ $ids = '';
+ while ($pu = mysql_fetch_array($su)) {
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ $u->addAction(time(), 'psh1', '', $pu['id']);
+ }
+ $ids = rtrim($ids, 'OR');
+ $upd1 = mysql_query('UPDATE `stats` SET `x`="1",`y`="-6",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "297" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ if ($vls != '') {
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
+ } else {
+ $ins2 = true;
+ }
+ if ($upd2 && $ins1 && $ins2) {
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ die('');
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id'])) {
+ if ($u->info['level'] > 5) {
+ $row = 0;
+ if (5 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $re = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $re = 'В группе нет места';
+ unset($zv);
+ }
+ } else {
+ $re = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $re = 'Заявка не найдена';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ $lmn = 6;
+ $lmx = 21;
+ $tmx = 5;
+
+ //только своего уровня
+ $lmn = $u->info['level'];
+
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
- "'.$lmn.'",
- "'.$lmx.'",
- "'.$tmx.'")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $re = 'Вы успешно создали группу';
- }else{
- $re = 'Не удалось создать группу';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
+ "' . $lmn . '",
+ "' . $lmx . '",
+ "' . $tmx . '")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $re = 'Вы успешно создали группу';
+ } else {
+ $re = 'Не удалось создать группу';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while($pl = mysql_fetch_array($sp))
-{
- $dzs .= '
';
- if($u->info['dn']==0)
- {
- $dzs .= '
';
- }
- $dzs .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while($pu = mysql_fetch_array($su))
- {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim($pus,', ');
-
- $dzs .= $pus;
-
- if($pl['com']!='')
- {
- $dl = '';
- if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0)
- {
- $dl .= ' (
удалить комментарий )';
- if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true)
- {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
-
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
-
- if($pl['dcom']>0)
- {
- $dl = '
комментарий удален модератором ';
- }
-
- if($pl['dcom']>0)
- {
- if($moder['boi']==1 || $u->info['admin']>0)
- {
- $pl['com'] = '
'.$pl['com'].' ';
- }else{
- $pl['com'] = '';
- }
- }
-
- $dzs .= '
| '.$pl['com'].''.$dl.' ';
- }
-
- $dzs .= '
';
-}
-?>
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ //Генерируем список групп
+ $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $dzs .= '';
+ if ($u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+ $dzs .= '
' . date('H:i', $pl['time']) . ' ';
+
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dzs .= $pus;
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (
удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+
+ if ($pl['dcom'] > 0) {
+ $dl = '
комментарий удален модератором ';
+ }
+
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '
' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+
+ $dzs .= '
| ' . $pl['com'] . '' . $dl . ' ';
+ }
+
+ $dzs .= '
';
+ }
+ ?>
+
+
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
'.$re.' ';
-}
+
+
' . $re . ' ';
+ }
-//отображаем
-if($dzs=='')
-{
- $dzs = '';
-}else{
- if(!isset($zv['id']))
- {
- if($g111==1)
- {
- $pr = '
';
- }
- $dzs = '
'.$pr.' '.$dzs.''.$pr.' ';
- }
- $dzs .= '
';
-}
+ //отображаем
+ if ($dzs == '') {
+ $dzs = '';
+ } else {
+ if (!isset($zv['id'])) {
+ if ($g111 == 1) {
+ $pr = '
';
+ }
+ $dzs = '
' . $pr . ' ' . $dzs . '' . $pr . ' ';
+ }
+ $dzs .= '
';
+ }
-echo $dzs;
-if($g111 == 1)
-{
-if($u->info['dn']==0)
-{
-?>
-
-info['id'])
- {
- $psh_start = '
';
- }
-
- echo '
+ echo $dzs;
+ if ($g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = ' ';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
-}
-?>
+ }
+ }
+ ?>
-timeOut(7200-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
}
-}
-
-?>
diff --git a/modules_data/location/enternizin.php b/modules_data/location/enternizin.php
index f5c8bd7a..154b1d4e 100644
--- a/modules_data/location/enternizin.php
+++ b/modules_data/location/enternizin.php
@@ -1,777 +1,783 @@
room['file']=='enternizin')
-{
+if ($u->room['file'] == 'enternizin') {
-if(isset($_GET['rz'])) {
- $rz = 1;
-}else{
- $rz = 0;
-}
+ if (isset($_GET['rz'])) {
+ $rz = 1;
+ } else {
+ $rz = 0;
+ }
-$dun = 444;
+ $dun = 444;
-$er = '';
+ $er = '';
-$dzs = '';
+ $dzs = '';
-$g111 = 1;
+ $g111 = 1;
-$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh444" AND `time` > '.(time()-60*60*2).' LIMIT 1',1);
+ $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh444" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1);
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
-if($u->info['dn']>0)
-{
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id']))
- {
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if (isset($g11['id'])) {
+ $g111 = 0;
+ if (isset($_GET['start'])) {
+ $re = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $g11['time']);
+ }
+ }
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) {
+ //начинаем поход
+ //начинаем поход
+ $ig = 1;
+ if ($ig > 0) {
+ //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh444','');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Низины","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ $ids = '';
-if(isset($g11['id']))
-{
- $g111 = 0;
- if(isset($_GET['start']))
- {
- $re = 'До следующего похода осталось еще: '.$u->timeOut(60*60*2-time()+$g11['time']);
- }
-}
-if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1)
-{
- //начинаем поход
- //начинаем поход
- $ig = 1;
- if($ig>0)
- {
- //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh444','');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Низины","'.time().'")');
- if($ins)
- {
- $zid = mysql_insert_id();
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).'');
- $ids = '';
-
- $map_locs = array();
- $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "'.$dun.'"');
- while( $plm2 = mysql_fetch_array($spm2)) {
- $map_locs[] = array($plm2['x'],$plm2['y']);
- }
- unset($spm2,$plm2);
-
- $ppx = 0;
- while($pu = mysql_fetch_array($su))
- {
- $ppx++;
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- $u->addAction(time(),'psh444','',$pu['id']);
- //Добавляем квестовые обьекты для персонажей
- $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$pu['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
- //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
- while($pl2 = mysql_fetch_array($sp))
- {
- $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.(str_replace('start_quest','',$pl2['vars'])).'" AND `line` = "444" LIMIT 1'));
- if( isset($pl['id']) ) {
- $act = explode(',',$pl['act_date']);
- $i = 0;
- while( $i < count($act) ) {
- $xr = explode(':=:',$act[$i]);
- //Сбор ресурсов
- if( $xr[0] == 'tk_itm' ) {
- $xr2 = explode('=',$xr[1]);
- if( $xr2[2] == 0 ) {
- //Добавляем обьект для юзера
- $j = 0;
- while( $j < $xr2[1] ) {
- $cord = $map_locs[rand(0,count($map_locs)-1)];
- if( $cord[0] != 0 || $cord[1] != 0 ) {
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
- "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$cord[0].'","'.$cord[1].'","'.$pu['id'].'","'.$pl['id'].'"
- )');
- }
- $j++;
- }
- }else{
- //Предмет находится в конкретном месте
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
- "'.$zid.'","'.$pu['id'].'","'.$xr2[0].'","'.time().'","'.$xr2[2].'","'.$xr2[3].'","'.$pu['id'].'","'.$pl['id'].'"
- )');
- }
- //
- }
- $i++;
- }
- }
- }
- //
- }
- $ids = rtrim($ids,'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- if($upd1)
- {
- $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- //Добавление обьектов (день святого валентина)
- if( floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0 ) {
- //Раскидываем предметы по пещере (Блёклый подземник)
- $i = 1;
- while($i <= $ppx) {
- $j = rand(1,3);
- while( $j >= 0 ) {
- $rndx = 0;
- $rndy = 0;
- $vls .= '("'.$zid.'","Блеклый подземник","vbig1.gif","'.$rndx.'","'.$rndy.'","fileact:444/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
- $j--;
- }
- $i++;
- }
- }
- //
- $vls = rtrim($vls,',');
- if($vls!='')
- {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
- }else{
- $ins2 = true;
- }
- if($upd2 && $ins1 && $ins2)
- {
- die('');
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }
-}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1)
-{
- if(!isset($zv['id']))
- {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv['id']) && $u->info['dn'] == 0)
- {
- if( $zv['pass'] != '' && $_POST['pass_com'] != $zv['pass'] ) {
- $re = 'Вы ввели неправильный пароль';
- }elseif($u->info['level'] > 7)
- {
- $row = 0;
- if(5 > $row)
- {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd)
- {
- $re = 'Не удалось вступить в эту группу';
- unset($zv);
- }else{
- $u->info['dn'] = $zv['id'];
- }
- }else{
- $re = 'В группе нет места';
- unset($zv);
- }
- }else{
- $re = 'Вы не подходите по уровню';
- unset($zv);
- }
- }else{
- $re = 'Заявка не найдена';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1)
-{
- if($zv['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id']))
- {
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1)
-{
- if($u->info['dn']==0)
- {
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ $map_locs = [];
+ $spm2 = mysql_query('SELECT `id`,`x`,`y` FROM `dungeon_map` WHERE `id_dng` = "' . $dun . '"');
+ while ($plm2 = mysql_fetch_array($spm2)) {
+ $map_locs[] = [$plm2['x'], $plm2['y']];
+ }
+ unset($spm2, $plm2);
+
+ $ppx = 0;
+ while ($pu = mysql_fetch_array($su)) {
+ $ppx++;
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ $u->addAction(time(), 'psh444', '', $pu['id']);
+ //Добавляем квестовые обьекты для персонажей
+ $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $pu['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
+ //$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
+ while ($pl2 = mysql_fetch_array($sp)) {
+ $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "444" LIMIT 1'));
+ if (isset($pl['id'])) {
+ $act = explode(',', $pl['act_date']);
+ $i = 0;
+ while ($i < count($act)) {
+ $xr = explode(':=:', $act[$i]);
+ //Сбор ресурсов
+ if ($xr[0] == 'tk_itm') {
+ $xr2 = explode('=', $xr[1]);
+ if ($xr2[2] == 0) {
+ //Добавляем обьект для юзера
+ $j = 0;
+ while ($j < $xr2[1]) {
+ $cord = $map_locs[rand(0, count($map_locs) - 1)];
+ if ($cord[0] != 0 || $cord[1] != 0) {
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $pu['id'] . '","' . $pl['id'] . '"
+ )'
+ );
+ }
+ $j++;
+ }
+ } else {
+ //Предмет находится в конкретном месте
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ "' . $zid . '","' . $pu['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $pu['id'] . '","' . $pl['id'] . '"
+ )'
+ );
+ }
+ //
+ }
+ $i++;
+ }
+ }
+ }
+ //
+ }
+ $ids = rtrim($ids, 'OR');
+ $upd1 = mysql_query(
+ 'UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "360" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ //Добавление обьектов (день святого валентина)
+ if (floor(date('m')) == 2 && floor(date('d')) >= 7 && $u->info['admin'] > 0) {
+ //Раскидываем предметы по пещере (Блёклый подземник)
+ $i = 1;
+ while ($i <= $ppx) {
+ $j = rand(1, 3);
+ while ($j >= 0) {
+ $rndx = 0;
+ $rndy = 0;
+ $vls .= '("' . $zid . '","Блеклый подземник","vbig1.gif","' . $rndx . '","' . $rndy . '","fileact:444/vbig1","0","81","81","0","0","5","8","12","0","0","0","0","{use:\'takeit\',rt2:154,rl2:146,rt3:139,rl3:154,rt4:125,rl4:161}"),';
+ $j--;
+ }
+ $i++;
+ }
+ }
+ //
+ $vls = rtrim($vls, ',');
+ if ($vls != '') {
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
+ } else {
+ $ins2 = true;
+ }
+ if ($upd2 && $ins1 && $ins2) {
+ die('');
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id']) && $u->info['dn'] == 0) {
+ if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) {
+ $re = 'Вы ввели неправильный пароль';
+ } elseif ($u->info['level'] > 7) {
+ $row = 0;
+ if (5 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $re = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $re = 'В группе нет места';
+ unset($zv);
+ }
+ } else {
+ $re = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $re = 'Заявка не найдена';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
"8",
"21",
- "5")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $re = 'Вы успешно создали группу';
- }else{
- $re = 'Не удалось создать группу';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}
+ "5")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $re = 'Вы успешно создали группу';
+ } else {
+ $re = 'Не удалось создать группу';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "444" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while($pl = mysql_fetch_array($sp))
-{
- $dzs .= '
';
- if($u->info['dn']==0)
- {
- $dzs .= '
';
- }
- $dzs .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while($pu = mysql_fetch_array($su))
- {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim($pus,', ');
-
- $dzs .= $pus;
-
- if( $pl['pass'] != '' && $u->info['dn']==0 ) {
- $dzs .= '
';
- }
-
- if($pl['com']!='')
- {
- $dl = '';
- if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0)
- {
- $dl .= ' (
удалить комментарий )';
- if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true)
- {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
-
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
-
- if($pl['dcom']>0)
- {
- $dl = '
комментарий удален модератором ';
- }
-
- if($pl['dcom']>0)
- {
- if($moder['boi']==1 || $u->info['admin']>0)
- {
- $pl['com'] = '
'.$pl['com'].' ';
- }else{
- $pl['com'] = '';
- }
- }
-
- $dzs .= '
| '.$pl['com'].''.$dl.' ';
- }
-
- $dzs .= '
';
-}
-?>
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ //Генерируем список групп
+ $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "444" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $dzs .= '';
+ if ($u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+ $dzs .= '
' . date('H:i', $pl['time']) . ' ';
+
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dzs .= $pus;
+
+ if ($pl['pass'] != '' && $u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (
удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+
+ if ($pl['dcom'] > 0) {
+ $dl = '
комментарий удален модератором ';
+ }
+
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '
' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+
+ $dzs .= '
| ' . $pl['com'] . '' . $dl . ' ';
+ }
+
+ $dzs .= '
';
+ }
+ ?>
+
+
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
'.$re.' ';
-}
+
+
+
+
+
+
+
' . $re . ' ';
+ }
-//отображаем
-if($dzs=='')
-{
- $dzs = '';
-}else{
- if(!isset($zv['id']) || $u->info['dn'] == 0)
- {
- if($g111==1 || $u->info['dn'] == 0)
- {
- $pr = '
';
- }
- $dzs = '
'.$pr.' '.$dzs.''.$pr.' ';
- }
- $dzs .= '
';
-}
+ //отображаем
+ if ($dzs == '') {
+ $dzs = '';
+ } else {
+ if (!isset($zv['id']) || $u->info['dn'] == 0) {
+ if ($g111 == 1 || $u->info['dn'] == 0) {
+ $pr = '
';
+ }
+ $dzs = '
' . $pr . ' ' . $dzs . '' . $pr . ' ';
+ }
+ $dzs .= '
';
+ }
-if($rz==0) { echo $dzs; }
-if($rz == 1) {
-?>
-
-
-testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.(time()-60*60*24).' AND `vars` = "psh_qt_angelscity" LIMIT 1',1);
-if(isset($_GET['add_quest'])) {
- if(isset($hgo['id'])) {
- echo 'Нельзя получать задания чаще одного раза в сутки ';
- }else{
-
- $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 444');
- $dq_add = array();
- while($pl = mysql_fetch_array($sp)) {
- if($u->rep['repangelscity'] == 9999) {
- //квет, рыцарского задания
- if( $pl['kin'] == 1 ) {
- $dq_add = array( 0 => $pl );
- }
- }elseif($u->rep['repangelscity'] == 24999) {
- //квет, рыцарского задания
- if( $pl['kin'] == 2 ) {
- $dq_add = array( 0 => $pl );
- }
- }else{
- if( $pl['kin'] == 0 ) {
- $dq_add[count($dq_add)] = $pl;
- }
- }
- }
-
- $dq_add = $dq_add[rand(0,count($dq_add)-1)];
-
- if($q->testGood($dq_add)==1 && $dq_add > 0)
- {
- $q->startq_dn($dq_add['id']);
- echo 'Вы успешно получили новое задание "'.$dq_add['name'].'". ';
- $hgo['id'] = 1;
- $u->addAction(time(),'psh_qt_angelscity',$dq_add['id']);
- }else{
- if($u->rep['repangelscity'] == 9999) {
- //квет, рыцарского задания
- echo 'Вы уже получили задание на достижение титула рыцаря! ';
- }elseif($u->rep['repangelscity'] == 24999) {
- //квет, рыцарского задания
- echo 'Вы завершили квестовую линию, ожидайте новых заданий! ';
- }else{
- echo 'Не удалось получить задание "'.$dq_add['name'].'". Попробуйте еще... ';
- }
- }
- unset($dq_add);
- }
-}
+ if ($rz == 0) {
+ echo $dzs;
+ }
+ if ($rz == 1) {
+ ?>
+
+
+ testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_angelscity" LIMIT 1', 1);
+ if (isset($_GET['add_quest'])) {
+ if (isset($hgo['id'])) {
+ echo 'Нельзя получать задания чаще одного раза в сутки ';
+ } else {
-//Генерируем список текущих квестов
-$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100');
-while($pl = mysql_fetch_array($sp))
-{
- $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1'));
- $qsee .= ' '.$pq['name'].' '.$pq['info'].' '.$q->info($pq).'
';
- $qx++;
-}
+ $sp = mysql_query('SELECT * FROM `quests` WHERE `line` = 444');
+ $dq_add = [];
+ while ($pl = mysql_fetch_array($sp)) {
+ if ($u->rep['repangelscity'] == 9999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 1) {
+ $dq_add = [0 => $pl];
+ }
+ } elseif ($u->rep['repangelscity'] == 24999) {
+ //квет, рыцарского задания
+ if ($pl['kin'] == 2) {
+ $dq_add = [0 => $pl];
+ }
+ } else {
+ if ($pl['kin'] == 0) {
+ $dq_add[count($dq_add)] = $pl;
+ }
+ }
+ }
-if($qsee == '')
-{
- $qsee = 'К сожалению у вас нет ни одного задания';
-}
-?>
-
-
-Текущие задания: [=$qx?>/28]
-=$qsee?>
-
+ $dq_add = $dq_add[rand(0, count($dq_add) - 1)];
+
+ if ($q->testGood($dq_add) == 1 && $dq_add > 0) {
+ $q->startq_dn($dq_add['id']);
+ echo 'Вы успешно получили новое задание "' . $dq_add['name'] . '". ';
+ $hgo['id'] = 1;
+ $u->addAction(time(), 'psh_qt_angelscity', $dq_add['id']);
+ } else {
+ if ($u->rep['repangelscity'] == 9999) {
+ //квет, рыцарского задания
+ echo 'Вы уже получили задание на достижение титула рыцаря! ';
+ } elseif ($u->rep['repangelscity'] == 24999) {
+ //квет, рыцарского задания
+ echo 'Вы завершили квестовую линию, ожидайте новых заданий! ';
+ } else {
+ echo 'Не удалось получить задание "' . $dq_add['name'] . '". Попробуйте еще... ';
+ }
+ }
+ unset($dq_add);
+ }
+ }
+
+ //Генерируем список текущих квестов
+ $sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100');
+ while ($pl = mysql_fetch_array($sp)) {
+ $pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1'));
+ $qsee .= ' ' . $pq['name'] . ' ' . $pq['info'] . ' ' . $q->info(
+ $pq
+ ) . '
';
+ $qx++;
+ }
+
+ if ($qsee == '') {
+ $qsee = 'К сожалению у вас нет ни одного задания';
+ }
+ ?>
+
+
+ Текущие задания: [= $qx ?>/28]
+ = $qsee ?>
+
-
-
-'.date('d.m.Y H:i',$hgo['time']+60*60*24).' ( Через '.$u->timeOut($hgo['time']+60*60*24-time()).' ) ';
+if (!isset($hgo['id'])) {
+ ?>
+
+
+ ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout($hgo['time'] + 60 * 60 * 24 - time()) . ' )';
}
?>
-
-
-
- 'capitalcity',2=>'demonscity',3=>'angelscity');
- if($_GET['buy1']==1) {
- //покупаем статы
- $price = 2000+($u->rep['add_stats']*100);
- $cur_price = array('price'=>0);
- if(25-$u->rep['add_stats']>0 && $u->rep['allrep']-$u->rep['allnurep']>=$price) { // Характеристики!
-
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 способность за '.$price.' ед. награды ';
- $u->info['ability'] += 1;
- $u->rep['add_stats'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_stats` = "'.$u->rep['add_stats'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `ability` = "'.$u->info['ability'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- } elseif($_GET['buy1']==2) { // Умения!
- $price = 2000+(2000*$u->rep['add_skills']);
- $cur_price = array('price'=>0);
- if(10-$u->rep['add_skills']>0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Умения!
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 умение за '.$price.' ед. награды ';
- $u->info['skills'] += 1;
- $u->rep['add_skills'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_skills` = "'.$u->rep['add_skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `skills` = "'.$u->info['skills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- } else {
- echo '
Ничего не получилось... ';
- }
- }elseif($_GET['buy1']==3) { // Кредиты
- $price = 100;
- $cur_price = array('price'=>0);
- if( $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 10 кр. за '.$price.' ед. награды ';
- $u->info['money'] += 10;
- $u->rep['add_money'] += 10;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_money` = "'.$u->rep['add_money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- }else{
- echo '
Ничего не получилось... ';
- }
- }elseif( $_GET['buy1'] == 4 ) { // Особенности
- $price = 3000;
- $cur_price = array('price'=>0);
- if( 5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep']-$u->rep['allnurep'] >= $price ) { // Особенности
- foreach($dungeon as $key=>$val){
- if(!($cur_price['price'] >= $price)){
- if( $u->rep['rep'.$val] - $u->rep['nu_'.$val] > $price ){
- $cur_price['price'] = $price;
- $cur_price['nu_'.$val] = $price;
- } elseif( $u->rep['rep'.$val] - $u->rep['nu_'.$val] < $price ){
- $cur_price['price'] += $cur = ( $price > ($cur_price['price'] + ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) ) ? ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) : ( ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) - (( ( $price - $cur_price['price'] ) - ( $u->rep['rep'.$val] - $u->rep['nu_'.$val] ) )*-1)));
- $cur_price['nu_'.$val] = $cur;
- }
- }
- }
- if($price==$cur_price['price']) {
- echo '
Вы успешно приобрели 1 особенность за '.$price.' ед. награды ';
- $u->info['nskills'] += 1;
- $u->rep['add_skills2'] += 1;
-
- foreach($dungeon as $key=>$val){
- if($key!='price'){
- $u->rep['nu_'.$val] += $cur_price['nu_'.$val];
- mysql_query('UPDATE `rep` SET `nu_'.$val.'` = "'.$u->rep['nu_'.$val].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- }
- }
- mysql_query('UPDATE `rep` SET `add_skills2` = "'.$u->rep['add_skills2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `nskills` = "'.$u->info['nskills'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- } else echo 'Недостаточно репутации.';
- }else{
- echo '
Ничего не получилось... ';
- }
- }
- }
- ?>
-
- Награда:
- =($u->rep['allrep']-$u->rep['allnurep'])?>
- ед.
-
-
+
+
+
+ 'capitalcity', 2 => 'demonscity', 3 => 'angelscity'];
+ if ($_GET['buy1'] == 1) {
+ //покупаем статы
+ $price = 2000 + ($u->rep['add_stats'] * 100);
+ $cur_price = ['price' => 0];
+ if (25 - $u->rep['add_stats'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Характеристики!
+
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 способность за ' . $price . ' ед. награды ';
+ $u->info['ability'] += 1;
+ $u->rep['add_stats'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 2) { // Умения!
+ $price = 2000 + (2000 * $u->rep['add_skills']);
+ $cur_price = ['price' => 0];
+ if (10 - $u->rep['add_skills'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Умения!
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 умение за ' . $price . ' ед. награды ';
+ $u->info['skills'] += 1;
+ $u->rep['add_skills'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 3) { // Кредиты
+ $price = 100;
+ $cur_price = ['price' => 0];
+ if ($u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Покупаем кредиты
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 10 кр. за ' . $price . ' ед. награды ';
+ $u->info['money'] += 10;
+ $u->rep['add_money'] += 10;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ } elseif ($_GET['buy1'] == 4) { // Особенности
+ $price = 3000;
+ $cur_price = ['price' => 0];
+ if (5 - $u->rep['add_skills2'] > 0 && $u->rep['allrep'] - $u->rep['allnurep'] >= $price) { // Особенности
+ foreach ($dungeon as $key => $val) {
+ if (!($cur_price['price'] >= $price)) {
+ if ($u->rep['rep' . $val] - $u->rep['nu_' . $val] > $price) {
+ $cur_price['price'] = $price;
+ $cur_price['nu_' . $val] = $price;
+ } elseif ($u->rep['rep' . $val] - $u->rep['nu_' . $val] < $price) {
+ $cur_price['price'] += $cur = ($price > ($cur_price['price'] + ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) ? ($u->rep['rep' . $val] - $u->rep['nu_' . $val]) : (($u->rep['rep' . $val] - $u->rep['nu_' . $val]) - ((($price - $cur_price['price']) - ($u->rep['rep' . $val] - $u->rep['nu_' . $val])) * -1)));
+ $cur_price['nu_' . $val] = $cur;
+ }
+ }
+ }
+ if ($price == $cur_price['price']) {
+ echo '
Вы успешно приобрели 1 особенность за ' . $price . ' ед. награды ';
+ $u->info['nskills'] += 1;
+ $u->rep['add_skills2'] += 1;
+
+ foreach ($dungeon as $key => $val) {
+ if ($key != 'price') {
+ $u->rep['nu_' . $val] += $cur_price['nu_' . $val];
+ mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ }
+ }
+ mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `nskills` = "' . $u->info['nskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ } else {
+ echo 'Недостаточно репутации.';
+ }
+ } else {
+ echo '
Ничего не получилось... ';
+ }
+ }
+ }
+ ?>
+
+ Награда:
+ = ($u->rep['allrep'] - $u->rep['allnurep']) ?>
+ ед.
+
+
info['id'].'" LIMIT 1000'));
- if(isset($_GET['buy777']) && $chk[0]>0) {
- $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "'.$u->info['id'].'" LIMIT 1000');
- while($chk_pl = mysql_fetch_array($chk_cl)) {
- if(mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$chk_pl['id'].'" LIMIT 1'));
- {
- $x++; $prc += $chk_pl['price1'];
- }
- }
- $u->info['money'] += $prc;
- mysql_query('UPDATE `users` SET `money` = "'.$u->info['money'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- echo 'Вы успешно сдали чеки в количестве '.$x.' шт. на сумму '.$prc.' кр. ';
- $chk[0] = 0;
-
- }
- if($chk[0]>0) {
- ?>
- шт.) находящиеся у Вас в инвентаре за =$chk[1]?> кр. ?')) {location='main.php?rz=1&buy777=1'}" />
-
+ $chk = mysql_fetch_array(
+ mysql_query(
+ 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ )
+ );
+ if (isset($_GET['buy777']) && $chk[0] > 0) {
+ $chk_cl = mysql_query(
+ 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ );
+ while ($chk_pl = mysql_fetch_array($chk_cl)) {
+ if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
+ ;
+ }
+ {
+ $x++;
+ $prc += $chk_pl['price1'];
+ }
+ }
+ $u->info['money'] += $prc;
+ mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ echo 'Вы успешно сдали чеки в количестве ' . $x . ' шт. на сумму ' . $prc . ' кр. ';
+ $chk[0] = 0;
+
+ }
+ if ($chk[0] > 0) {
+ ?>
+
+
-
-
-
-
- Репутация в Capital city:
- =$u->rep['repcapitalcity']?> ед.
-
-
- Репутация в Demons city:
- =$u->rep['repdemonscity']?> ед.
-
-
- Репутация в Angels city:
- =$u->rep['repangelscity']?> ед.
-
-
- Текущая репутация:
-
-
-info['dn']==0)
-{
-?>
-
-info['id'])
- {
- $psh_start = ' ';
- }
-
- echo '
+
+
+
+
+ Репутация в Capital city:
+ = $u->rep['repcapitalcity'] ?> ед.
+
+
+ Репутация в Demons city:
+ = $u->rep['repdemonscity'] ?> ед.
+
+
+ Репутация в Angels city:
+ = $u->rep['repangelscity'] ?> ед.
+
+
+ Текущая репутация:
+
+
+ info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = '
';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
+ }
+ }
+ } else {
+ echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(
+ 60 * 60 * 2 - time() + $g11['time']
+ ) . '
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
+ }
}
-?>
-
-timeOut(60*60*2-time()+$g11['time']).'
Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
-}
-}
-}
-?>
diff --git a/modules_data/location/enterptp.php b/modules_data/location/enterptp.php
index c5dae366..dea7af98 100644
--- a/modules_data/location/enterptp.php
+++ b/modules_data/location/enterptp.php
@@ -1,4 +1,7 @@
info['dn'] > 0) { // Если ты пошел гулять, так ид
}
$dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh' . $dungeon['id'] . '" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1); // Проверка - последний визит?
-// if($u->info['admin']>0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры.
+
if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
{
$dungeonGo = 0;
if (isset($_GET['start'])) {
- $re = 'До следующего похода осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']);
+ $re = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']);
}
}
@@ -63,13 +66,17 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
if ($ig > 0) {
//перемещаем игроков в пещеру
//$u->addAction(time(),'psh'.$dun,'');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dungeon['id'] . '","Бездна","' . time() . '")');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dungeon['id'] . '","Бездна","' . time() . '")'
+ );
if ($ins) {
$zid = mysql_insert_id();
mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
//обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . '');
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
$ids = '';
$map_locs = [];
@@ -100,17 +107,21 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
while ($j < $xr2[1]) {
$cord = $map_locs[rand(0, count($map_locs) - 1)];
if ($cord[0] != 0 || $cord[1] != 0) {
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
"' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
- )');
+ )'
+ );
}
$j++;
}
} else {
//Предмет находится в конкретном месте
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
"' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
- )');
+ )'
+ );
}
//
}
@@ -121,7 +132,9 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
//
}
$ids = rtrim($ids, 'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ $upd1 = mysql_query(
+ 'UPDATE `stats` SET `s`="1",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
if ($upd1) {
$upd2 = mysql_query('UPDATE `users` SET `room` = "374" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
@@ -141,7 +154,9 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
}
$vls = rtrim($vls, ',');
if ($vls != '') {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '');
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
} else {
$ins2 = true;
}
@@ -159,7 +174,9 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
}
} elseif (isset($_POST['go'], $_POST['goid']) && $dungeonGo == 1) {
if (!isset($zv['id'])) {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1'));
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
if (isset($zv['id']) && $u->info['dn'] == 0) {
if ($zv['pass'] != '' && $_POST['pass_com'] != $zv['pass']) {
$re = 'Вы ввели неправильный пароль';
@@ -212,14 +229,16 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
}
} elseif (isset($_POST['add']) && $u->info['level'] > 1 && $dungeonGo == 1) {
if ($u->info['dn'] == 0) {
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dungeon['id'] . '",
"' . mysql_real_escape_string($_POST['pass']) . '",
"' . mysql_real_escape_string($_POST['text']) . '",
"8",
"21",
- "5")');
+ "5")'
+ );
if ($ins) {
$u->info['dn'] = mysql_insert_id();
$zv['id'] = $u->info['dn'];
@@ -238,11 +257,15 @@ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "' . $dungeon['id'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
while ($pl = mysql_fetch_array($sp)) {
$dungeonGroupList .= '
';
- if ($u->info['dn'] == 0) $dungeonGroupList .= '
';
+ if ($u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
$dungeonGroupList .= '
' . date('H:i', $pl['time']) . ' ';
$pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '');
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
while ($pu = mysql_fetch_array($su)) {
$pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
$pus .= ', ';
@@ -252,7 +275,9 @@ while ($pl = mysql_fetch_array($sp)) {
$dungeonGroupList .= $pus;
unset($pus);
- if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= '
';
+ if ($pl['pass'] != '' && $u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
if ($pl['com'] != '') {
$dl = '';
@@ -286,79 +311,79 @@ while ($pl = mysql_fetch_array($sp)) {
$dungeonGroupList .= '
';
}
?>
-
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
-
-
-
-
-
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
+
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ ?>">info['city'] == 'fallenearth') {
+ echo "Темный Портал";
+ } else {
+ echo "Магический Портал";
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -377,7 +402,9 @@ while ($pl = mysql_fetch_array($sp)) {
' . $re . ' ';
+if ($re != '') {
+ echo '
' . $re . ' ';
+}
//отображаем
if ($dungeonGroupList == '') {
@@ -411,11 +438,11 @@ if ($roomSection == 1) {
echo '
Нельзя получать задания чаще одного раза в сутки ';
} else {
-//if($u->info['admin']>0){
-// $sp = mysql_query('SELECT * FROM `quests` WHERE `id` = "236" && `tr_date` LIKE "%tr_dn:=:'.$dun.'%"'); // Только дашку
-//} else {
+ //if($u->info['admin']>0){
+ // $sp = mysql_query('SELECT * FROM `quests` WHERE `id` = "236" && `tr_date` LIKE "%tr_dn:=:'.$dun.'%"'); // Только дашку
+ //} else {
$sp = mysql_query('SELECT * FROM `quests` WHERE `line` = ' . $dungeon['id'] . '');
-//}
+ //}
$dq_add = [];
while ($pl = mysql_fetch_array($sp)) {
@@ -462,7 +489,9 @@ if ($roomSection == 1) {
$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100');
while ($pl = mysql_fetch_array($sp)) {
$pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1'));
- $qsee .= '
' . $pq['name'] . ' ' . $pq['info'] . ' ' . $q->info($pq) . '
';
+ $qsee .= '
' . $pq['name'] . ' ' . $pq['info'] . ' ' . $q->info(
+ $pq
+ ) . '
';
$qx++;
}
@@ -482,7 +511,7 @@ if (!isset($hgo['id'])) {
' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . '
( Через ' . $u->timeOut($hgo['time'] + 60 * 60 * 24 - time()) . ' ) ';
+ echo 'Получить новое задание можно
' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout($hgo['time'] + 60 * 60 * 24 - time()) . ' )';
}
?>
@@ -522,7 +551,9 @@ if (!isset($hgo['id'])) {
}
mysql_query('UPDATE `rep` SET `add_stats` = "' . $u->rep['add_stats'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `ability` = "' . $u->info['ability'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
} else {
echo '
Ничего не получилось... ';
}
@@ -554,7 +585,9 @@ if (!isset($hgo['id'])) {
}
mysql_query('UPDATE `rep` SET `add_skills` = "' . $u->rep['add_skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `skills` = "' . $u->info['skills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
} else {
echo '
Ничего не получилось... ';
}
@@ -586,7 +619,9 @@ if (!isset($hgo['id'])) {
}
mysql_query('UPDATE `rep` SET `add_money` = "' . $u->rep['add_money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
} else {
echo '
Ничего не получилось... ';
}
@@ -618,7 +653,9 @@ if (!isset($hgo['id'])) {
}
mysql_query('UPDATE `rep` SET `add_skills2` = "' . $u->rep['add_skills2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
mysql_query('UPDATE `stats` SET `sskills` = "' . $u->info['sskills'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
// echo '
Вы успешно приобрели 1 особенность за 3000 ед. награды ';
// $u->info['nskills'] += 1;
@@ -668,11 +705,19 @@ if (!isset($hgo['id'])) {
info['id'] . '" LIMIT 1000'));
+ $chk = mysql_fetch_array(
+ mysql_query(
+ 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ )
+ );
if (isset($_GET['buy777']) && $chk[0] > 0) {
- $chk_cl = mysql_query('SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000');
+ $chk_cl = mysql_query(
+ 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ );
while ($chk_pl = mysql_fetch_array($chk_cl)) {
- if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) ;
+ if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
+ ;
+ }
{
$x++;
$prc += $chk_pl['price1'];
@@ -750,7 +795,9 @@ if (!isset($hgo['id'])) {
}
}
} else {
- echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . 'Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(
+ 60 * 60 * 2 - time() + $dungeon_timeout['time']
+ ) . 'Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
}
}
-?>
+
diff --git a/modules_data/location/entersnow.php b/modules_data/location/entersnow.php
index 51e64977..e931ad2e 100644
--- a/modules_data/location/entersnow.php
+++ b/modules_data/location/entersnow.php
@@ -1,370 +1,357 @@
room['file']=='entersnow')
-{
+if ($u->room['file'] == 'entersnow') {
-$dun = 20; //для новичков 2-7 лвл
+ $dun = 20; //для новичков 2-7 лвл
-$er = '';
+ $er = '';
-$dzs = '';
+ $dzs = '';
-$g111 = 1;
+ $g111 = 1;
-$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh1" AND `time`>'.(time()-7200).' LIMIT 1',1);
+ $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh1" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1);
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
-if($u->info['dn']>0)
-{
- $zv_dn = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `dun` = "'.$dun.'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv_dn['id']))
- {
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if ($u->info['dn'] > 0) {
+ $zv_dn = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `dun` = "' . $dun . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv_dn['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
-if(isset($g11['id']))
-{
- $g111 = 0;
- if(isset($_GET['start']))
- {
- $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']);
- }
-}
-if(isset($_GET['start']) && $zv_dn['uid']==$u->info['id'] && $g111 == 1)
-{
- //начинаем поход
- //начинаем поход
- $ig = 1;
- if($ig>0)
- {
- //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh1','');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv_dn['city'].'","'.$zv_dn['uid'].'","'.$dun.'","Ледяная пещера","'.time().'")');
- if($ins)
- {
- $zid = mysql_insert_id();
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv_dn['id'].'" LIMIT '.($zv_dn['team_max']+1).'');
- $ids = '';
- while($pu = mysql_fetch_array($su))
- {
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- $u->addAction(time(),'psh1','',$pu['id']);
- }
- $ids = rtrim($ids,'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `x`="0",`y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv_dn['team_max']+1).'');
- if($upd1)
- {
- $upd2 = mysql_query('UPDATE `users` SET `room` = "304" WHERE '.$ids.' LIMIT '.($zv_dn['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- $vls = rtrim($vls,',');
- if($vls!='')
- {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
- }else{
- $ins2 = true;
- }
- if($upd2 && $ins1 && $ins2)
- {
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv_dn['id'].'" LIMIT 1');
- die('');
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }
-}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1)
-{
- if(!isset($zv_dn['id']))
- {
- $zv_dn = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `dun` = "'.$dun.'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv_dn['id']))
- {
- if($u->info['level']>5)
- {
- $row = 0;
- if(5>$row)
- {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv_dn['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd)
- {
- $re = 'Не удалось вступить в эту группу';
- unset($zv_dn);
- }else{
- $u->info['dn'] = $zv_dn['id'];
- }
- }else{
- $re = 'В группе нет места';
- unset($zv_dn);
- }
- }else{
- $re = 'Вы не подходите по уровню';
- unset($zv_dn);
- }
- }else{
- $re = 'Заявка не найдена';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}elseif(isset($_POST['leave']) && isset($zv_dn['id']) && $g111 == 1)
-{
- if($zv_dn['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv_dn['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id']))
- {
- $zv_dn['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv_dn['uid'].'" WHERE `id` = "'.$zv_dn['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv_dn);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv_dn['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv_dn);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv_dn);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1)
-{
- if($u->info['dn']==0)
- {
- $lmn = 6;
- $lmx = 21;
- $tmx = 5;
-
- //только своего уровня
- $lmn = $u->info['level'];
-
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ if (isset($g11['id'])) {
+ $g111 = 0;
+ if (isset($_GET['start'])) {
+ $re = 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']);
+ }
+ }
+ if (isset($_GET['start']) && $zv_dn['uid'] == $u->info['id'] && $g111 == 1) {
+ //начинаем поход
+ //начинаем поход
+ $ig = 1;
+ if ($ig > 0) {
+ //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh1','');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv_dn['city'] . '","' . $zv_dn['uid'] . '","' . $dun . '","Ледяная пещера","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv_dn['id'] . '" LIMIT ' . ($zv_dn['team_max'] + 1) . ''
+ );
+ $ids = '';
+ while ($pu = mysql_fetch_array($su)) {
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ $u->addAction(time(), 'psh1', '', $pu['id']);
+ }
+ $ids = rtrim($ids, 'OR');
+ $upd1 = mysql_query('UPDATE `stats` SET `x`="0",`y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv_dn['team_max'] + 1) . '');
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "304" WHERE ' . $ids . ' LIMIT ' . ($zv_dn['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ if ($vls != '') {
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
+ } else {
+ $ins2 = true;
+ }
+ if ($upd2 && $ins1 && $ins2) {
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv_dn['id'] . '" LIMIT 1');
+ die('');
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) {
+ if (!isset($zv_dn['id'])) {
+ $zv_dn = mysql_fetch_array(
+ mysql_query(
+ 'SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string(
+ $_POST['goid']
+ ) . '" AND `dun` = "' . $dun . '" AND `delete` = "0" LIMIT 1'
+ )
+ );
+ if (isset($zv_dn['id'])) {
+ if ($u->info['level'] > 5) {
+ $row = 0;
+ if (5 > $row) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv_dn['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $re = 'Не удалось вступить в эту группу';
+ unset($zv_dn);
+ } else {
+ $u->info['dn'] = $zv_dn['id'];
+ }
+ } else {
+ $re = 'В группе нет места';
+ unset($zv_dn);
+ }
+ } else {
+ $re = 'Вы не подходите по уровню';
+ unset($zv_dn);
+ }
+ } else {
+ $re = 'Заявка не найдена';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv_dn['id']) && $g111 == 1) {
+ if ($zv_dn['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv_dn['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv_dn['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv_dn['uid'] . '" WHERE `id` = "' . $zv_dn['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv_dn);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv_dn['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv_dn);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv_dn);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ $lmn = 6;
+ $lmx = 21;
+ $tmx = 5;
+
+ //только своего уровня
+ $lmn = $u->info['level'];
+
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
- "'.$lmn.'",
- "'.$lmx.'",
- "'.$tmx.'")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv_dn['id'] = $u->info['dn'];
- $zv_dn['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $re = 'Вы успешно создали группу';
- }else{
- $re = 'Не удалось создать группу';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
+ "' . $lmn . '",
+ "' . $lmx . '",
+ "' . $tmx . '")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv_dn['id'] = $u->info['dn'];
+ $zv_dn['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $re = 'Вы успешно создали группу';
+ } else {
+ $re = 'Не удалось создать группу';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `dun` = "'.$dun.'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while($pl = mysql_fetch_array($sp))
-{
- $dzs .= '';
- if($u->info['dn']==0)
- {
- $dzs .= '
';
- }
- $dzs .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while($pu = mysql_fetch_array($su))
- {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim($pus,', ');
-
- $dzs .= $pus;
-
- if($pl['com']!='')
- {
- $dl = '';
- if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0)
- {
- $dl .= ' (
удалить комментарий )';
- if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true)
- {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
-
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
-
- if($pl['dcom']>0)
- {
- $dl = '
комментарий удален модератором ';
- }
-
- if($pl['dcom']>0)
- {
- if($moder['boi']==1 || $u->info['admin']>0)
- {
- $pl['com'] = '
'.$pl['com'].' ';
- }else{
- $pl['com'] = '';
- }
- }
-
- $dzs .= '
| '.$pl['com'].''.$dl.' ';
- }
-
- $dzs .= '
';
-}
-?>
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ //Генерируем список групп
+ $sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `dun` = "' . $dun . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $dzs .= '';
+ if ($u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+ $dzs .= '
' . date('H:i', $pl['time']) . ' ';
+
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dzs .= $pus;
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (
удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+
+ if ($pl['dcom'] > 0) {
+ $dl = '
комментарий удален модератором ';
+ }
+
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '
' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+
+ $dzs .= '
| ' . $pl['com'] . '' . $dl . ' ';
+ }
+
+ $dzs .= '
';
+ }
+ ?>
+
+
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
'.$re.' ';
-}
+
+ ' . $re . ' ';
+ }
-//отображаем
-if($dzs=='')
-{
- $dzs = '';
-}else{
- if(!isset($zv_dn['id']))
- {
- if($g111==1)
- {
- $pr = ' ';
- }
- $dzs = ''.$pr.' '.$dzs.''.$pr.' ';
- }
- $dzs .= ' ';
-}
+ //отображаем
+ if ($dzs == '') {
+ $dzs = '';
+ } else {
+ if (!isset($zv_dn['id'])) {
+ if ($g111 == 1) {
+ $pr = ' ';
+ }
+ $dzs = '' . $pr . ' ' . $dzs . '' . $pr . ' ';
+ }
+ $dzs .= ' ';
+ }
-echo $dzs;
-if($g111 == 1)
-{
-if($u->info['dn']==0)
-{
-?>
-
-info['id'])
- {
- $psh_start = ' ';
- }
-
- echo '
+ echo $dzs;
+ if ($g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = ' ';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
-}
-?>
+ }
+ }
+ ?>
-timeOut(7200-time()+$g11['time']).'Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
}
-}
-
-?>
diff --git a/modules_data/location/house_belaun.php b/modules_data/location/house_belaun.php
index 33d361d7..cf973819 100644
--- a/modules_data/location/house_belaun.php
+++ b/modules_data/location/house_belaun.php
@@ -1,5 +1,10 @@
room['file'] == 'house_belaun') {
$notify = ['type' => '', 'text' => '']; // Ошибки или Уведомления здесь!
$action = '';
@@ -292,7 +297,9 @@ if ($u->room['file'] == 'house_belaun') {
' . $notify['text'] . '
';
+ if ($notify['text'] != '') {
+ echo '' . $notify['text'] . '
';
+ }
if ($action == "dialog") {
}
@@ -305,12 +312,16 @@ if ($u->room['file'] == 'house_belaun') {
$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
while ($pl = mysql_fetch_array($sp)) {
$dungeonGroupList .= '';
- if ($u->info['dn'] == 0) $dungeonGroupList .= '
';
+ if ($u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
$dungeonGroupList .= '
' . date('H:i', $pl['time']) . ' ';
$dungeonGroupList .= '
';
$pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '');
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
while ($pu = mysql_fetch_array($su)) {
$pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
$pus .= ', ';
@@ -320,7 +331,9 @@ if ($u->room['file'] == 'house_belaun') {
$dungeonGroupList .= $pus;
unset($pus);
- if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= '
';
+ if ($pl['pass'] != '' && $u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
if ($pl['com'] != '') {
$dl = '';
@@ -427,7 +440,11 @@ if ($u->room['file'] == 'house_belaun' && false) {
$error = ''; // Собираем ошибки.
$dungeonGroupList = ''; // Сюда помещаем список Групп.
$dungeonGo = 1; // По умолчанию, мы идем в пещеру.
- $dungeon = mysql_fetch_assoc(mysql_query('SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1'));
+ $dungeon = mysql_fetch_assoc(
+ mysql_query(
+ 'SELECT `id` as room, city, `dungeon_room` as d_room, city, `shop`, `dungeon_id` as id, `dungeon_name` as name, quest FROM `dungeon_room` WHERE `id`="' . $u->room['id'] . '" LIMIT 1'
+ )
+ );
$dunname = [
12 => ['capitalcity', 'Пещера Тысячи Проклятий'],
@@ -439,9 +456,13 @@ if ($u->room['file'] == 'house_belaun' && false) {
//106 => array('devilscity','Туманные Низины')
];
- if (isset($_GET['rz']) && $dungeon['quest'] == 1) $roomSection = 1; // Получаем Задание
- else $roomSection = 0; // Собираем группу для похода
-//if( $u->info['admin'] > 0 ) var_info($dungeon);
+ if (isset($_GET['rz']) && $dungeon['quest'] == 1) {
+ $roomSection = 1;
+ } // Получаем Задание
+ else {
+ $roomSection = 0;
+ } // Собираем группу для похода
+ //if( $u->info['admin'] > 0 ) var_info($dungeon);
$all_dungeon = mysql_query('SELECT `city` FROM `dungeon_room` WHERE `city` IS NOT NULL AND `active`=1 ');
while ($t = mysql_fetch_array($all_dungeon)) {
@@ -459,28 +480,32 @@ if ($u->room['file'] == 'house_belaun' && false) {
$dungeon_timeout = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh0" AND `time` > ' . (time() - 60 * 60 * 2) . ' LIMIT 1', 1);
- if ($u->info['admin'] > 0) unset($dungeon_timeout); // $dungeon_timeout - задержка на посещение пещеры.
+ if ($u->info['admin'] > 0) {
+ unset($dungeon_timeout);
+ } // $dungeon_timeout - задержка на посещение пещеры.
if (isset($dungeon_timeout['id'])) // Кто-то передумал и не пойдет в пещеру, так-как уже там был.
{
$dungeonGo = 0;
if (isset($_GET['start'])) {
- $error = 'До следующего похода осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']);
+ $error = 'До следующего похода осталось еще: ' . Conversion::secondsToTimeout(60 * 60 * 2 - time() + $dungeon_timeout['time']);
}
}
if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $dungeonGo == 1) {
$ig = 1;
if ($ig > 0) { //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh'.$dun,'');
- //
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $zv['dun'] . '","' . $dunname[$zv['dun']][1] . '","' . time() . '")');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $zv['dun'] . '","' . $dunname[$zv['dun']][1] . '","' . time() . '")'
+ );
if ($ins) {
$zid = mysql_insert_id();
mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
//обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/');
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" /*LIMIT ' . ($zv['team_max'] + 1) . '*/'
+ );
$ids = '';
$map_locs = [];
@@ -500,9 +525,13 @@ if ($u->room['file'] == 'house_belaun' && false) {
$u->addAction(time(), 'psh0', $pu['id'], $pu['id']);
}
//Добавляем квестовые обьекты для персонажей
- $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
+ $sp = mysql_query(
+ 'SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `room` = ' . $dungeon['room'] . ' AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100'
+ );
while ($pl2 = mysql_fetch_array($sp)) {
- $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "' . $dungeon['id'] . '" LIMIT 1'));
+ $pl = mysql_fetch_array(
+ mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" AND `line` = "' . $dungeon['id'] . '" LIMIT 1')
+ );
if (isset($pl['id'])) {
$act = explode(',', $pl['act_date']);
$i = 0;
@@ -523,27 +552,39 @@ if ($u->room['file'] == 'house_belaun' && false) {
$ml_arr = [];
foreach ($map_locs as $ml) { // tk_itm_fromY tk_itm_toY - отсеиваем позицию для дропа предметов.
if ((isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY'])) or (!isset($actdate['tk_itm_fromY']) && isset($actdate['tk_itm_toY']))) {
- if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml;
- elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) $ml_arr[] = $ml;
- } else $ml_arr[] = $ml;
+ if ($ml[1] > $actdate['tk_itm_fromY'] && $actdate['tk_itm_toY'] > $ml[1]) {
+ $ml_arr[] = $ml;
+ } elseif (!isset($actdate['tk_itm_fromY']) && $actdate['tk_itm_toY'] > $ml[1]) {
+ $ml_arr[] = $ml;
+ }
+ } else {
+ $ml_arr[] = $ml;
+ }
+ }
+ if (isset($ml_arr) && count($ml_arr) == 0) {
+ $ml_arr = $map_locs;
}
- if (isset($ml_arr) && count($ml_arr) == 0) $ml_arr = $map_locs;
//Добавляем обьект для юзера
$j = 0;
while ($j < $xr2[1]) {
$cord = $ml_arr[rand(0, count($ml_arr) - 1)];
if ($cord[0] != 0 || $cord[1] != 0) {
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
- "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
- )');
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ "' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time(
+ ) . '","' . $cord[0] . '","' . $cord[1] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
+ )'
+ );
}
$j++;
}
} else {
//Предмет находится в конкретном месте
- mysql_query('INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
+ mysql_query(
+ 'INSERT INTO `dungeon_items` (`dn`,`user`,`item_id`,`time`,`x`,`y`,`onlyfor`,`quest`) VALUES (
"' . $zid . '","' . $u->info['id'] . '","' . $xr2[0] . '","' . time() . '","' . $xr2[2] . '","' . $xr2[3] . '","' . $u->info['id'] . '","' . $pl['id'] . '"
- )');
+ )'
+ );
}
}
$i++;
@@ -554,7 +595,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
}
$ids = rtrim($ids, 'OR');
$snew = 1;
- $upd1 = mysql_query('UPDATE `stats` SET `s`="' . $snew . '",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ $upd1 = mysql_query(
+ 'UPDATE `stats` SET `s`="' . $snew . '",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
if ($upd1) {
$upd2 = mysql_query('UPDATE `users` SET `room` = "405" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
//Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id']
@@ -566,7 +609,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
$bots = explode(',', $pl['bot_group']);
$pl['id_bot'] = (int)$bots[rand(0, count($bots) - 1)];
}
- if ($pl['id_bot'] > 0) $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),';
+ if ($pl['id_bot'] > 0) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '","' . $pl['go_bot'] . '","' . $pl['noatack'] . '"),';
+ }
unset($bots);
}
$vls = rtrim($vls, ',');
@@ -692,7 +737,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
//
$vls = rtrim($vls, ',');
if ($vls != '') {
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . '');
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
} else {
$ins2 = true;
}
@@ -839,14 +886,16 @@ if ($u->room['file'] == 'house_belaun' && false) {
$dun5 = 12; //ПТП
}
//
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
("all","' . time() . '","' . $u->info['id'] . '","' . $dun5 . '",
"' . mysql_real_escape_string($_POST['pass']) . '",
"' . mysql_real_escape_string($_POST['text']) . '",
"8",
"21",
- "5")');
+ "5")'
+ );
if ($ins) {
$u->info['dn'] = mysql_insert_id();
$zv['id'] = $u->info['dn'];
@@ -861,17 +910,21 @@ if ($u->room['file'] == 'house_belaun' && false) {
}
}
-//Генерируем список групп
+ //Генерируем список групп
$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "all" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"');
while ($pl = mysql_fetch_array($sp)) {
$dungeonGroupList .= '
';
- if ($u->info['dn'] == 0) $dungeonGroupList .= '
';
+ if ($u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
$dungeonGroupList .= '
' . date('H:i', $pl['time']) . ' ';
$dungeonGroupList .= '
';
$pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . '');
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
while ($pu = mysql_fetch_array($su)) {
$pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
$pus .= ', ';
@@ -881,7 +934,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
$dungeonGroupList .= $pus;
unset($pus);
- if ($pl['pass'] != '' && $u->info['dn'] == 0) $dungeonGroupList .= '
';
+ if ($pl['pass'] != '' && $u->info['dn'] == 0) {
+ $dungeonGroupList .= '
';
+ }
if ($pl['com'] != '') {
$dl = '';
@@ -1011,7 +1066,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
?>
0) {
- $shop = mysql_fetch_array(mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1'));
+ $shop = mysql_fetch_array(
+ mysql_query('SELECT `id` as shop_id, `code` FROM `room` WHERE `id` = "' . $dungeon['shop'] . '" LIMIT 1')
+ );
if (isset($shop['code'])) {
?>
@@ -1057,9 +1114,11 @@ if ($u->room['file'] == 'house_belaun' && false) {
' . $error . ' ';
+ if ($error != '') {
+ echo '' . $error . ' ';
+ }
-//отображаем
+ //отображаем
if ($dungeonGroupList == '') {
$dungeonGroupList = '';
} else {
@@ -1089,14 +1148,20 @@ if ($u->room['file'] == 'house_belaun' && false) {
testAction('`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1);
+ $hgo = $u->testAction(
+ '`uid` = "' . $u->info['id'] . '" AND `room` = "' . $u->info['room'] . '" AND `time` >= ' . (time() - 60 * 60 * 24) . ' AND `vars` = "psh_qt_' . $dungeon['city'] . '" LIMIT 1', 1
+ );
$qc = 0; // Quest Count
//Генерируем список текущих квестов
$sp = mysql_query('SELECT * FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100');
while ($pl = mysql_fetch_array($sp)) {
if ($pl['room'] == $u->info['room']) {
$pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . str_replace('start_quest', '', $pl['vars']) . '" LIMIT 1'));
- if ($q->questCheckEnd($pq) == 1) $qsee2 = ' '; else $qsee2 = '';
+ if ($q->questCheckEnd($pq) == 1) {
+ $qsee2 = ' ';
+ } else {
+ $qsee2 = '';
+ }
$qsee .= '
@@ -1175,7 +1240,7 @@ if ($u->room['file'] == 'house_belaun' && false) {
' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . $u->timeOut($hgo['time'] + 60 * 60 * 24 - time()) . ' ) ';
+ echo 'Получить новое задание можно ' . date('d.m.Y H:i', $hgo['time'] + 60 * 60 * 24) . ' ( Через ' . Conversion::secondsToTimeout($hgo['time'] + 60 * 60 * 24 - time()) . ' )';
}
?>
@@ -1202,7 +1267,11 @@ if ($u->room['file'] == 'house_belaun' && false) {
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- if ($r) $rt = 1; else $rt = 0;
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
}
}
if ($rt == 1) {
@@ -1214,7 +1283,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
} else {
echo 'Ничего не получилось... ';
}
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
} else {
echo 'Ничего не получилось... ';
}
@@ -1233,7 +1304,11 @@ if ($u->room['file'] == 'house_belaun' && false) {
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- if ($r) $rt = 1; else $rt = 0;
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
}
}
if ($rt == 1) {
@@ -1245,7 +1320,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
} else {
echo 'Ничего не получилось... ';
}
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
} else {
echo 'Ничего не получилось... ';
}
@@ -1264,7 +1341,11 @@ if ($u->room['file'] == 'house_belaun' && false) {
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- if ($r) $rt = 1; else $rt = 0;
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
}
}
if ($rt == 1) {
@@ -1276,7 +1357,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
} else {
echo 'Ничего не получилось... ';
}
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
} else {
echo 'Ничего не получилось... ';
}
@@ -1295,7 +1378,11 @@ if ($u->room['file'] == 'house_belaun' && false) {
if (isset($cur_price['nu_' . $val]) && isset($u->rep['nu_' . $val]) && $rt == 1) {
$u->rep['nu_' . $val] += $cur_price['nu_' . $val];
$r = mysql_query('UPDATE `rep` SET `nu_' . $val . '` = "' . $u->rep['nu_' . $val] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
- if ($r) $rt = 1; else $rt = 0;
+ if ($r) {
+ $rt = 1;
+ } else {
+ $rt = 0;
+ }
}
}
if ($rt == 1) {
@@ -1307,7 +1394,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
} else {
echo 'Ничего не получилось... ';
}
- } else echo 'Недостаточно репутации.';
+ } else {
+ echo 'Недостаточно репутации.';
+ }
} else {
echo 'Ничего не получилось... ';
@@ -1350,15 +1439,23 @@ if ($u->room['file'] == 'house_belaun' && false) {
info['id'] . '" LIMIT 1000'));
+ $chk = mysql_fetch_array(
+ mysql_query(
+ 'SELECT COUNT(`u`.`id`),SUM(`m`.`price1`) FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ )
+ );
if (isset($_GET['buy777']) && $chk[0] > 0) {
?>
info['id'] . '" LIMIT 1000');
+ $chk_cl = mysql_query(
+ 'SELECT `u`.`id`,`m`.`price1` FROM `items_users` AS `u` LEFT JOIN `items_main` AS `m` ON `u`.`item_id` = `m`.`id` WHERE `m`.`type` = "61" AND `u`.`delete` = "0" AND `u`.`inOdet` = "0" AND `u`.`inShop` = "0" AND `u`.`inTransfer` = "0" AND `u`.`uid` = "' . $u->info['id'] . '" LIMIT 1000'
+ );
while ($chk_pl = mysql_fetch_array($chk_cl)) {
- if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) ;
+ if (mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $chk_pl['id'] . '" LIMIT 1')) {
+ ;
+ }
{
$x++;
$prc += $chk_pl['price1'];
@@ -1468,7 +1565,9 @@ if ($u->room['file'] == 'house_belaun' && false) {
}
}
} else {
- echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . $u->timeOut(60 * 60 * 2 - time() + $dungeon_timeout['time']) . 'Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ echo 'Поход в пещеры разрешен один раз в два часа. Осталось еще: ' . Conversion::secondsToTimeout(
+ 60 * 60 * 2 - time() + $dungeon_timeout['time']
+ ) . 'Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
}
}
}
diff --git a/modules_data/location/penter.php b/modules_data/location/penter.php
index 70d06c33..c95f888a 100644
--- a/modules_data/location/penter.php
+++ b/modules_data/location/penter.php
@@ -1,391 +1,385 @@
room['file']=='penter')
-{
+if ($u->room['file'] == 'penter') {
-$dun = 1; //для новичков 2-7 лвл
+ $dun = 1; //для новичков 2-7 лвл
-$er = '';
+ $er = '';
-$dzs = '';
+ $dzs = '';
-$g111 = 1;
-$g11 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "psh1" AND `time`>'.(time()-7200).' LIMIT 1',1);
+ $g111 = 1;
+ $g11 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "psh1" AND `time`>' . (time() - 7200) . ' LIMIT 1', 1);
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
+ $moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
+ if ($u->info['dn'] > 0) {
+ $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="' . $u->info['dn'] . '" AND `delete` = "0" LIMIT 1'));
+ if (!isset($zv['id'])) {
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ }
+ }
-if($u->info['dn']>0)
-{
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `id`="'.$u->info['dn'].'" AND `delete` = "0" LIMIT 1'));
- if(!isset($zv['id']))
- {
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- }
-}
+ if (isset($g11['id'])) {
+ $g111 = 0;
+ if (isset($_GET['start'])) {
+ $re = 'Поход в пещеры запрещен. Осталось еще: ' . Conversion::secondsToTimeout(7200 - time() + $g11['time']);
+ }
+ }
+ if (isset($_GET['start']) && $zv['uid'] == $u->info['id'] && $g111 == 1) {
+ //начинаем поход
+ //начинаем поход
+ $ig = 1;
+ if ($ig > 0) {
+ //перемещаем игроков в пещеру
+ //$u->addAction(time(),'psh1','');
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
+ VALUES ("' . $zv['city'] . '","' . $zv['uid'] . '","' . $dun . '","Канализация","' . time() . '")'
+ );
+ if ($ins) {
+ $zid = mysql_insert_id();
+ //обновляем пользователей
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $zv['id'] . '" LIMIT ' . ($zv['team_max'] + 1) . ''
+ );
+ $ids = '';
+ while ($pu = mysql_fetch_array($su)) {
+ $ids .= ' `id` = "' . $pu['id'] . '" OR';
+ $u->addAction(time(), 'psh1', '', $pu['id']);
+ }
+ $ids = rtrim($ids, 'OR');
+ $upd1 = mysql_query('UPDATE `stats` SET `x`="0",`y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ if ($upd1) {
+ $upd2 = mysql_query('UPDATE `users` SET `room` = "189" WHERE ' . $ids . ' LIMIT ' . ($zv['team_max'] + 1) . '');
+ //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
+ //Добавляем ботов
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['id_bot'] . '","' . $pl['colvo'] . '","' . $pl['items'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['dialog'] . '","' . $pl['items'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES ' . $vls . '');
+ //Добавляем обьекты
+ $vls = '';
+ $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "' . $dun . '"');
+ while ($pl = mysql_fetch_array($sp)) {
+ $vls .= '("' . $zid . '","' . $pl['name'] . '","' . $pl['img'] . '","' . $pl['x'] . '","' . $pl['y'] . '","' . $pl['action'] . '","' . $pl['type'] . '","' . $pl['w'] . '","' . $pl['h'] . '","' . $pl['s'] . '","' . $pl['s2'] . '","' . $pl['os1'] . '","' . $pl['os2'] . '","' . $pl['os3'] . '","' . $pl['os4'] . '","' . $pl['type2'] . '","' . $pl['top'] . '","' . $pl['left'] . '","' . $pl['date'] . '"),';
+ }
+ $vls = rtrim($vls, ',');
+ $ins2 = mysql_query(
+ 'INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES ' . $vls . ''
+ );
-if(isset($g11['id']))
-{
- $g111 = 0;
- if(isset($_GET['start']))
- {
- $re = 'Поход в пещеры запрещен. Осталось еще: '.$u->timeOut(7200-time()+$g11['time']);
- }
-}
-if(isset($_GET['start']) && $zv['uid']==$u->info['id'] && $g111 == 1)
-{
- //начинаем поход
- //начинаем поход
- $ig = 1;
- if($ig>0)
- {
- //перемещаем игроков в пещеру
- //$u->addAction(time(),'psh1','');
- $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`)
- VALUES ("'.$zv['city'].'","'.$zv['uid'].'","'.$dun.'","Канализация","'.time().'")');
- if($ins)
- {
- $zid = mysql_insert_id();
- //обновляем пользователей
- $su = mysql_query('SELECT `u`.`id`,`st`.`dn` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$zv['id'].'" LIMIT '.($zv['team_max']+1).'');
- $ids = '';
- while($pu = mysql_fetch_array($su))
- {
- $ids .= ' `id` = "'.$pu['id'].'" OR';
- $u->addAction(time(),'psh1','',$pu['id']);
- }
- $ids = rtrim($ids,'OR');
- $upd1 = mysql_query('UPDATE `stats` SET `x`="0",`y`="0",`dn` = "0",`dnow` = "'.$zid.'" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- if($upd1)
- {
- $upd2 = mysql_query('UPDATE `users` SET `room` = "189" WHERE '.$ids.' LIMIT '.($zv['team_max']+1).'');
- //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dun
- //Добавляем ботов
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_bots` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['id_bot'].'","'.$pl['colvo'].'","'.$pl['items'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['dialog'].'","'.$pl['items'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins1 = mysql_query('INSERT INTO `dungeon_bots` (`dn`,`id_bot`,`colvo`,`items`,`x`,`y`,`dialog`,`atack`) VALUES '.$vls.'');
- //Добавляем обьекты
- $vls = '';
- $sp = mysql_query('SELECT * FROM `dungeon_obj` WHERE `for_dn` = "'.$dun.'"');
- while($pl = mysql_fetch_array($sp))
- {
- $vls .= '("'.$zid.'","'.$pl['name'].'","'.$pl['img'].'","'.$pl['x'].'","'.$pl['y'].'","'.$pl['action'].'","'.$pl['type'].'","'.$pl['w'].'","'.$pl['h'].'","'.$pl['s'].'","'.$pl['s2'].'","'.$pl['os1'].'","'.$pl['os2'].'","'.$pl['os3'].'","'.$pl['os4'].'","'.$pl['type2'].'","'.$pl['top'].'","'.$pl['left'].'","'.$pl['date'].'"),';
- }
- $vls = rtrim($vls,',');
- $ins2 = mysql_query('INSERT INTO `dungeon_obj` (`dn`,`name`,`img`,`x`,`y`,`action`,`type`,`w`,`h`,`s`,`s2`,`os1`,`os2`,`os3`,`os4`,`type2`,`top`,`left`,`date`) VALUES '.$vls.'');
-
- if($upd2 && $ins1 && $ins2)
- {
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- die('');
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }else{
- $re = 'Ошибка перехода в подземелье...';
- }
- }
-}elseif(isset($_POST['go'],$_POST['goid']) && $g111==1)
-{
- if(!isset($zv['id']))
- {
- $zv = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `id`="'.mysql_real_escape_string($_POST['goid']).'" AND `delete` = "0" LIMIT 1'));
- if(isset($zv['id']))
- {
- if($zv['lvlmin']==$u->info['level'] || $u->info['admin']>0)
- {
- $row = 0;
- if($zv['team_max']>$row || $u->info['admin']>0)
- {
- $upd = mysql_query('UPDATE `stats` SET `dn` = "'.$zv['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- if(!$upd)
- {
- $re = 'Не удалось вступить в эту группу';
- unset($zv);
- }else{
- $u->info['dn'] = $zv['id'];
- }
- }else{
- $re = 'В группе нет места';
- unset($zv);
- }
- }else{
- $re = 'Вы не подходите по уровню';
- unset($zv);
- }
- }else{
- $re = 'Заявка не найдена';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}elseif(isset($_POST['leave']) && isset($zv['id']) && $g111 == 1)
-{
- if($zv['uid']==$u->info['id'])
- {
- //ставим в группу нового руководителя
- $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "'.$zv['id'].'" AND `id` != "'.$u->info['id'].'" LIMIT 1'));
- if(isset($ld['id']))
- {
- $zv['uid'] = $ld['id'];
- mysql_query('UPDATE `dungeon_zv` SET `uid` = "'.$zv['uid'].'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }else{
- //удаляем группу целиком
- mysql_query('UPDATE `dungeon_zv` SET `delete` = "'.time().'" WHERE `id` = "'.$zv['id'].'" LIMIT 1');
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
- }else{
- //просто выходим с группы
- mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $u->info['dn'] = 0;
- unset($zv);
- }
-}elseif(isset($_POST['add']) && $u->info['level']>1 && $g111 == 1)
-{
- if($u->info['dn']==0)
- {
- $lmn = $u->info['level']-1;
- $lmx = $u->info['level']+1;
- $tmx = 0;
-
- if($lmn<2){ $lmn = 2; }
- if($lmn>7){ $lmn = 7; }
- if($lmx<2){ $lmx = 2; }
- if($lmx>7){ $lmx = 7; }
-
- if($u->info['level']>=6 && $u->info['admin']==0)
- {
- $tmx = 0;
- }else{
- $tmx = 5;
- }
-
- //только своего уровня
- $lmn = $u->info['level'];
-
- $ins = mysql_query('INSERT INTO `dungeon_zv`
+ if ($upd2 && $ins1 && $ins2) {
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ die('');
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ } else {
+ $re = 'Ошибка перехода в подземелье...';
+ }
+ }
+ } elseif (isset($_POST['go'], $_POST['goid']) && $g111 == 1) {
+ if (!isset($zv['id'])) {
+ $zv = mysql_fetch_array(
+ mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `id`="' . mysql_real_escape_string($_POST['goid']) . '" AND `delete` = "0" LIMIT 1')
+ );
+ if (isset($zv['id'])) {
+ if ($zv['lvlmin'] == $u->info['level'] || $u->info['admin'] > 0) {
+ $row = 0;
+ if ($zv['team_max'] > $row || $u->info['admin'] > 0) {
+ $upd = mysql_query('UPDATE `stats` SET `dn` = "' . $zv['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ if (!$upd) {
+ $re = 'Не удалось вступить в эту группу';
+ unset($zv);
+ } else {
+ $u->info['dn'] = $zv['id'];
+ }
+ } else {
+ $re = 'В группе нет места';
+ unset($zv);
+ }
+ } else {
+ $re = 'Вы не подходите по уровню';
+ unset($zv);
+ }
+ } else {
+ $re = 'Заявка не найдена';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ } elseif (isset($_POST['leave']) && isset($zv['id']) && $g111 == 1) {
+ if ($zv['uid'] == $u->info['id']) {
+ //ставим в группу нового руководителя
+ $ld = mysql_fetch_array(mysql_query('SELECT `id` FROM `stats` WHERE `dn` = "' . $zv['id'] . '" AND `id` != "' . $u->info['id'] . '" LIMIT 1'));
+ if (isset($ld['id'])) {
+ $zv['uid'] = $ld['id'];
+ mysql_query('UPDATE `dungeon_zv` SET `uid` = "' . $zv['uid'] . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ } else {
+ //удаляем группу целиком
+ mysql_query('UPDATE `dungeon_zv` SET `delete` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '" LIMIT 1');
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } else {
+ //просто выходим с группы
+ mysql_query('UPDATE `stats` SET `dn` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $u->info['dn'] = 0;
+ unset($zv);
+ }
+ } elseif (isset($_POST['add']) && $u->info['level'] > 1 && $g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ $lmn = $u->info['level'] - 1;
+ $lmx = $u->info['level'] + 1;
+ $tmx = 0;
+
+ if ($lmn < 2) {
+ $lmn = 2;
+ }
+ if ($lmn > 7) {
+ $lmn = 7;
+ }
+ if ($lmx < 2) {
+ $lmx = 2;
+ }
+ if ($lmx > 7) {
+ $lmx = 7;
+ }
+
+ if ($u->info['level'] >= 6 && $u->info['admin'] == 0) {
+ $tmx = 0;
+ } else {
+ $tmx = 5;
+ }
+
+ //только своего уровня
+ $lmn = $u->info['level'];
+
+ $ins = mysql_query(
+ 'INSERT INTO `dungeon_zv`
(`city`,`time`,`uid`,`dun`,`pass`,`com`,`lvlmin`,`lvlmax`,`team_max`) VALUES
- ("'.$u->info['city'].'","'.time().'","'.$u->info['id'].'","'.$dun.'",
- "'.mysql_real_escape_string($_POST['pass']).'",
- "'.mysql_real_escape_string($_POST['text']).'",
- "'.$lmn.'",
- "'.$lmx.'",
- "'.$tmx.'")');
- if($ins)
- {
- $u->info['dn'] = mysql_insert_id();
- $zv['id'] = $u->info['dn'];
- $zv['uid'] = $u->info['id'];
- mysql_query('UPDATE `stats` SET `dn` = "'.$u->info['dn'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
- $re = 'Вы успешно создали группу';
- }else{
- $re = 'Не удалось создать группу';
- }
- }else{
- $re = 'Вы уже находитесь в группе';
- }
-}
+ ("' . $u->info['city'] . '","' . time() . '","' . $u->info['id'] . '","' . $dun . '",
+ "' . mysql_real_escape_string($_POST['pass']) . '",
+ "' . mysql_real_escape_string($_POST['text']) . '",
+ "' . $lmn . '",
+ "' . $lmx . '",
+ "' . $tmx . '")'
+ );
+ if ($ins) {
+ $u->info['dn'] = mysql_insert_id();
+ $zv['id'] = $u->info['dn'];
+ $zv['uid'] = $u->info['id'];
+ mysql_query('UPDATE `stats` SET `dn` = "' . $u->info['dn'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+ $re = 'Вы успешно создали группу';
+ } else {
+ $re = 'Не удалось создать группу';
+ }
+ } else {
+ $re = 'Вы уже находитесь в группе';
+ }
+ }
-//Генерируем список групп
-$sp = mysql_query('SELECT * FROM `dungeon_zv` WHERE `city` = "'.$u->info['city'].'" AND `lvlmin` = "'.$u->info['level'].'" AND `delete` = "0" AND `time` > "'.(time()-60*60*2).'"');
-while($pl = mysql_fetch_array($sp))
-{
- $dzs .= '';
- if($u->info['dn']==0)
- {
- $dzs .= '
';
- }
- $dzs .= '
'.date('H:i',$pl['time']).' ';
-
- $pus = ''; //группа
- $su = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="'.$pl['id'].'" LIMIT '.($pl['team_max']+1).'');
- while($pu = mysql_fetch_array($su))
- {
- $pus .= '
'.$pu['login'].' ['.$pu['level'].']
';
- $pus .= ', ';
- }
- $pus = trim($pus,', ');
-
- $dzs .= $pus;
-
- if($pl['com']!='')
- {
- $dl = '';
- if(($moder['boi']==1 || $u->info['admin']>0) && $pl['dcom']==0)
- {
- $dl .= ' (
удалить комментарий )';
- if(isset($_GET['delcom']) && $_GET['delcom']==$pl['id'] && $u->newAct($_GET['key'])==true)
- {
- mysql_query('UPDATE `dungeon_zv` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
- $pl['dcom'] = $u->info['id'];
- }
- }
-
- $pl['com'] = htmlspecialchars($pl['com'],NULL);
-
- if($pl['dcom']>0)
- {
- $dl = '
комментарий удален модератором ';
- }
-
- if($pl['dcom']>0)
- {
- if($moder['boi']==1 || $u->info['admin']>0)
- {
- $pl['com'] = '
'.$pl['com'].' ';
- }else{
- $pl['com'] = '';
- }
- }
-
- $dzs .= '
| '.$pl['com'].''.$dl.' ';
- }
-
- $dzs .= '
';
-}
-?>
-
-
-
-
-
= $u->room['name']; ?>
-
-
-
+ //Генерируем список групп
+ $sp = mysql_query(
+ 'SELECT * FROM `dungeon_zv` WHERE `city` = "' . $u->info['city'] . '" AND `lvlmin` = "' . $u->info['level'] . '" AND `delete` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '"'
+ );
+ while ($pl = mysql_fetch_array($sp)) {
+ $dzs .= '';
+ if ($u->info['dn'] == 0) {
+ $dzs .= '
';
+ }
+ $dzs .= '
' . date('H:i', $pl['time']) . ' ';
+
+ $pus = ''; //группа
+ $su = mysql_query(
+ 'SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`st`.`dn`,`u`.`city`,`u`.`room` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`dn`="' . $pl['id'] . '" LIMIT ' . ($pl['team_max'] + 1) . ''
+ );
+ while ($pu = mysql_fetch_array($su)) {
+ $pus .= '
' . $pu['login'] . ' [' . $pu['level'] . ']
';
+ $pus .= ', ';
+ }
+ $pus = trim($pus, ', ');
+
+ $dzs .= $pus;
+
+ if ($pl['com'] != '') {
+ $dl = '';
+ if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+ $dl .= ' (
удалить комментарий )';
+ if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+ mysql_query('UPDATE `dungeon_zv` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+ $pl['dcom'] = $u->info['id'];
+ }
+ }
+
+ $pl['com'] = htmlspecialchars($pl['com'], null);
+
+ if ($pl['dcom'] > 0) {
+ $dl = '
комментарий удален модератором ';
+ }
+
+ if ($pl['dcom'] > 0) {
+ if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+ $pl['com'] = '
' . $pl['com'] . ' ';
+ } else {
+ $pl['com'] = '';
+ }
+ }
+
+ $dzs .= '
| ' . $pl['com'] . '' . $dl . ' ';
+ }
+
+ $dzs .= '
';
+ }
+ ?>
+
+
-
-
-
-
- = $goLis; ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
= $u->room['name']; ?>
+
+
+
+
+
+
+
+
+
+
+
+ = $goLis; ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
'.$re.' ';
-}
+
+ ' . $re . ' ';
+ }
-//отображаем
-if($dzs=='')
-{
- $dzs = '';
-}else{
- if(!isset($zv['id']))
- {
- if($g111==1)
- {
- $pr = ' ';
- }
- $dzs = ''.$pr.' '.$dzs.''.$pr.' ';
- }
- $dzs .= ' ';
-}
+ //отображаем
+ if ($dzs == '') {
+ $dzs = '';
+ } else {
+ if (!isset($zv['id'])) {
+ if ($g111 == 1) {
+ $pr = ' ';
+ }
+ $dzs = '' . $pr . ' ' . $dzs . '' . $pr . ' ';
+ }
+ $dzs .= ' ';
+ }
-echo $dzs;
-if($g111 == 1)
-{
-if($u->info['dn']==0)
-{
-?>
-
-info['id'])
- {
- $psh_start = ' ';
- }
-
- echo '
+ echo $dzs;
+ if ($g111 == 1) {
+ if ($u->info['dn'] == 0) {
+ ?>
+
+ info['id']) {
+ $psh_start = ' ';
+ }
+
+ echo '
Группа
- '.$psh_start.'
+ ' . $psh_start . '
';
- }
-}
-?>
+ }
+ }
+ ?>
-timeOut(7200-time()+$g11['time']).'Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ Но Вы всегда можете приобрести ключ от прохода у любого "копателя пещер" в Торговом зале ;) ';
+ }
}
-}
-
-?>
diff --git a/modules_data/stats_inv.php b/modules_data/stats_inv.php
index b81c7d3a..2ed11842 100644
--- a/modules_data/stats_inv.php
+++ b/modules_data/stats_inv.php
@@ -1,4 +1,7 @@
info['noreal']) && $c['bonussocial'] == true) {
$gd = 0;
$zdml = 3600; //час
if (isset($mcf['id']) && $mcf['time'] > time() - $zdml) {
- echo 'Нельзя подтверждать эл.почту так часто. Осталось ' . $u->timeOut(
+ echo ' Нельзя подтверждать эл.почту так часто. Осталось ' . Conversion::secondsToTimeout(
$mcf['time'] + $zdml - time()
- ) . ' ';
+ ) . ' ';
$gd = 1;
} elseif (!preg_match(
'#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $_GET['confmail']
)) {
- echo '
Вы указали явно ошибочный E-mail. ';
+ echo 'Вы указали явно ошибочный E-mail. ';
$gd = 1;
}