room['file'] == 'novich') { $tst = mysql_fetch_array(mysql_query('SELECT * FROM `dialog_act` WHERE `uid` = "' . $u->info['id'] . '" AND `var` = "noobqst1" LIMIT 1')); if (!isset($tst['id'])) { if (isset($_GET['noobgo']) || $c['noobgade'] == false) { if ($_GET['noobgo'] == 1 && $c['noobgade'] == true) { //Согласился (создаем пещеру и телепортируем туда $ins = mysql_query('INSERT INTO `dungeon_now` (`city`,`uid`,`id2`,`name`,`time_start`) VALUES ("' . $u->info['city'] . '","' . $u->info['id'] . '","106","Академия Новичков","' . 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`.`id`="' . $u->info['id'] . '"'); $ids = ''; $map_locs = []; $spm2 = mysql_query('select id,x,y from dungeon_map where id_dng = 106'); 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'; } $ids = rtrim($ids, 'OR'); $snew = 0; $upd1 = mysql_query('UPDATE `stats` SET `s`="4",`res_s`="1",`x`="0",`y`="0",`res_x`="0",`res_y`="0",`dn` = "0",`dnow` = "' . $zid . '" WHERE ' . $ids . ''); if ($upd1) { $upd2 = mysql_query('UPDATE `users` SET `room` = "391" WHERE ' . $ids . ''); //Добавляем ботов и обьекты в пещеру $zid с for_dn = $dungeon['id'] //Добавляем ботов $vls = ''; $sp = mysql_query('select * from dungeon_bots where for_dn = 106'); 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 = 106'); 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) { die(''); } else { $error = 'Ошибка перехода в подземелье...'; } } else { $error = 'Ошибка перехода в подземелье...'; } } else { $error = 'Ошибка перехода в подземелье...'; } // //header('location: main.php'); die(); } else { //Отказался (добавляем квест, системку и пошел нах) mysql_query('INSERT INTO `dialog_act` ( `uid`,`var`,`time` ) VALUES ( "' . $u->info['id'] . '","noobqst1","' . time() . '" )'); //Начало обучения $humor = [ 0 => [ '', ], 1 => [ '', ], ]; $humor = $humor[$u->info['sex']]; //$u->info['fnq'] = 1; //mysql_query('UPDATE `users` SET `fnq` = "'.$u->info['fnq'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); //Отправляем сообщение в чат о новичке //mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = 0 AND `item_id` = 4703'); //mysql_query('UPDATE `users` SET `room` = 4 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); //mysql_query('UPDATE `stats` SET `hpNow` = 1000,`mpNow` = 1000,`dn` = 0 , `dnow` = 0 , `x` = 0 , `y` = 0 , `s` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); //$u->send('','','','','','В нашем мире появился новый игрок "' . $u->info['login'] . '"! '.$humor[rand(0,count($humor)-1)].'',time(),6,0,0,0,1,0); //echo '
getInfoPers($u->info['id'], 0); if ($usee != false) { echo $usee[0]; } else { echo 'information is lost.'; } ?> |
Внимание!Смените пароль на уникальный,который не использовался ранее в подобных проектах,это обезопасит вашего персонажа от взлома. Администрация. = $rowonmax; ?> |