diff --git a/labirint(1).php b/labirint(1).php
deleted file mode 100644
index 34d0ba9..0000000
--- a/labirint(1).php
+++ /dev/null
@@ -1,917 +0,0 @@
- '0'){
- die("");
-}
-
-$vipUsers = array(
- 'SaulDin',
- 'Дед Мазай',
- 'Лик Ужаса',
-
-);
-$errkom = '';
-
-$varsitm = array(array(270, 1));
-
-$varsitm2 = array(array(87, 1), array(88, 1), array(48, 1), array(49, 1), array(29, 1), array(66, 1), array(97, 1), array(67, 1), array(98, 1), array(115, 1));
-
-function labaItemAdd($id, $type) {
- global $user;
- if($type == 1) {
- $dress = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.(int)$id.'" LIMIT 1'));
- } else {
- $dress = mysql_fetch_array(mysql_query('SELECT * FROM `ashop` WHERE `id` = "'.(int)$id.'" LIMIT 1'));
- }
- if(isset($dress['id'])) {
- mysql_query("INSERT INTO `inventory` (`laba`, `prototype`,`owner`,`name`,`type`,`massa`,`cost`, `img`,`maxdur`,`isrep`,`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`koll`) VALUES ('$type', '{$dress['id']}','{$user['id']}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}','{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron2']}','{$dress['bron3']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dress[koll]}')");
- }
-}
-
-function money_add($sum) {
- global $user;
- $user['money'] += $sum;
- mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
-}
-
-if($user['room'] == 1052) {
- if($user['id'] == 10022) {
- $lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- } else {
- $lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- }
-
- $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$user['laba'].'" AND `vars` = "dielaba" LIMIT 1'));
- $dies = $dies[0];
- $map_d = json_decode($map['data']);
- $usersDng = setHP($user['hp'], $user['maxhp'], 0);
- $errors = '';
- $effed = '';
- $mapsee = '';
- $varos = array();
- $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'));
-
- $real_x = $user['x'];
- $real_y = $user['y'];
- if($real_y < 6) { $real_y = 6; }
- if($real_x < 6) { $real_x = 6; }
-
- if($real_y > count($map_d) - 7) {
- $real_y = count($map_d) - 7;
- }
-
- if($real_x > count($map_d) - 7) {
- $real_x = count($map_d) - 7;
- }
-
- $objs = array();
-
- $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;
- }
-
- $i = 1;
- $goodgoo = array(1 => 0, 2 => 0, 3 => 0, 4 => 0);
- while($i <= 4) {
- $goto = array('x' => $user['y'], 'y' => $user['x']);
- if($i == 1) {
- $goto['x']--;
- } elseif($i == 2) {
- $goto['y']--;
- } elseif($i == 3) {
- $goto['x']++;
- } elseif($i == 4) {
- $goto['y']++;
- }
- if($map_d[$goto['y']][$goto['x']] == 0 && $goto['x'] > 0 && $goto['x'] < count($map_d)-1 && $user['timeGo'] <= time()) {
- $goodgoo[$i] = 1;
- }
- $i++;
- }
-
- if(isset($_GET['goto'])) {
- $goto = array('x' => $user['y'], 'y' => $user['x']);
- if($_GET['goto'] == 1 ) {
- $goto['x']--;
- } elseif($_GET['goto'] == 2) {
- $goto['y']--;
- } elseif($_GET['goto'] == 3) {
- $goto['x']++;
- } elseif($_GET['goto'] == 4) {
- $goto['y']++;
- }
-
- if($goodgoo[$_GET['goto']] == 1 && $user['timeGo'] <= time()) {
- $user['y'] = $goto['x'];
- $user['x'] = $goto['y'];
- $real_x = $user['x'];
- $real_y = $user['y'];
- $varos['timego'] = 0; #5
- if(isset($varos['trap1']['id'])) {
- $varos['timego'] += 3;
- }
- if($user['align'] == 2.99) { $varos['timego'] = 0; }
- $user['timeGo'] = (time()+$varos['timego']);
- $user['timeGoL'] = time();
- if(!mysql_query('UPDATE `users` SET `x` = "'.$user['x'].'", `y` = "'.$user['y'].'", `timeGoL` = "'.$user['timeGoL'].'", `timeGo` = "'.$user['timeGo'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1')) {
- $errors = 'Ошибка перемещения!';
- }
- }
- }
-
- if($real_y < 6) { $real_y = 6; }
- if($real_x < 6) { $real_x = 6; }
-
- if($real_y > count($map_d) - 7) {
- $real_y = count($map_d) - 7;
- }
- if($real_x > count($map_d) - 7) {
- $real_x = count($map_d) - 7;
- }
-
- $tmdg = ($user['timeGo']-time());
- $tmdgl = ($user['timeGo']-$user['timeGoL']);
- $tmdgp = floor(100-$tmdg/$tmdgl*100);
- if($tmdgp < 1) { $tmdgp = 1; } elseif($tmdgp > 100) { $tmdgp = 100; }
- $tmdgm = 25*$tmdgl;
- $tmdg = floor(40/100*$tmdgp);
-
- if($tmdg < 1) {
- $tmdg = 1;
- } elseif($tmdg > 40) {
- $tmdg = 40;
- }
-
- if(isset($_POST['exit'])) {
- if($lab['users'] < 2) {
- mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"');
- } else {
- $lab['users']--;
- mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- }
- $dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "'.$user['id'].'"');
- while($pl = mysql_fetch_array($dresed)) {
- dropitemid($pl['type'], $user['id']);
- }
- mysql_query('DELETE FROM `inventory` WHERE `laba` > 0 AND `owner` = "'.$user['id'].'"');
- mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'");
- mysql_query('UPDATE `qst_user` SET `val` = "0" WHERE `uid` = "'.$user['id'].'" AND `cancel` = "0" AND `finish` = "0"');
- addActions(time(), 'go_labirint', (time()+60*60*6), $user['id']);
- header('Location: lab_enter.php');
- }
-
- $itms = '';
-
- if(isset($objs[$user['x']][$user['y']]['id'])) {
- $var = array();
- $mitm = $objs[$user['x']][$user['y']];
- if($mitm['type'] == 2) {
- if($mitm['use'] == 0) {
- $btl_pix = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` > 0 AND `laba` = "'.$lab['id'].'" AND `x` = "'.$user['x'].'" AND `y` = "'.$user['y'].'" LIMIT 1'));
- if(!isset($btl_pix['id']) ) {
- $bots = array(
- 0 => array(10025, 10026, 10027, 10028, 10031, 10032, 10033, 10034),
- 1 => array(10111, 10112, 10113, 10114, 10115, 10116),
- 2 => array(10111, 10112, 10113)
- );
- $bot_pix2 = $bots[$lab['type']];
-
- $teams = array();
- $where = ''; $bot_ids = '';
- $i = 0;
- $j = (1+rand(0, floor($user['level']/rand(3, 4))));
- while($i < $j) {
- $bot_pix = $bot_pix2[rand(0, count($bot_pix2)-1)];
- $bot_pix = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$bot_pix.'" LIMIT 1'));
- mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('".$bot_pix['login']." (Бот #$i)', '".$bot_pix['id']."', '', '".$bot_pix['maxhp']."')");
- $bot = mysql_insert_id();
- $bot_ids .= $bot.';';
- $teams[$user['id']][$bot] = array(0, 0, time());
- $teams[$bot][$user['id']] = array(0, 0, time());
- $where = ' `id` = '.$bot.' OR';
- $i++;
- }
- $bot_ids = rtrim($bot_ids, ';');
- $where = rtrim($where, ' OR');
-
- if(!mysql_query("INSERT INTO `battle` (`teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`, `x`, `y`) VALUES ('".serialize($teams)."', '3', '1', '0', '".$user['id']."', '".$bot_ids."', '".time()."', '".time()."', '".$user['x']."', '".$user['y']."')")) { die('Error #2'); }
-
- $id = mysql_insert_id();
- $bts = explode(';', $bot_ids);
- $is = 0;
- while($is <= count($bts)) {
- $nicks .= nick::id($bts[$is])->full(1).', ';
- $i_d .= $bts[$is].', ';
- $is++;
- }
- $nicks = rtrim($nicks, ', ');
- $who = '`id` IN ('.rtrim($i_d, ', ').')';
-
- if($user1['invis'] == 1) {
- $rr = "невидимка и ".$nicks."";
- } else {
- $rr = "".nick::id($user['id'])->full(1)." и ".$nicks."";
- }
-
- if(!mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE ".$who."")) { die('Error #1'.$who); }
- mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id`= {$user['id']} LIMIT 1");
- addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
");
- } else {
- $bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$btl_pix['battle'].'" LIMIT 1'));
- $botd = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `battle` = "'.$bd['id'].'" LIMIT 1'));
- $battle = unserialize($bd['teams']);
- $ak = array_keys($battle[$botd['id']]);
- $battle[$user['id']] = $battle[$ak[0]];
- foreach($battle[$user['id']] as $k => $v) {
- $battle[$user['id']][$k] = array(0, 0, time());
- $battle[$k][$user['id']] = array(0, 0, time());
- }
- $t1 = explode(";", $bd['t1']);
- $ttt = 1;
- addlog($jert['battle'], ''.date("H:i").' '.nick5($user['id'], "B".$ttt).' вмешался в поединок!
');
- mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$btl_pix['battle'].'" LIMIT 1');
- mysql_query("UPDATE `users` SET `battle` = '".$bd['id']."', `zayavka` = 0 WHERE `id` = '".$user['id']."' LIMIT 1");
- header("Location: fbattle.php");
- }
- die("");
- }
- } elseif($mitm['type'] == 1) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- } elseif($mitm['type'] == 3) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- } elseif($mitm['type'] == 4) {
- if($mitm['use'] == 0) {
- $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" 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');
- } else {
- mysql_query('INSERT INTO `laba_act` (`uid`, `time`, `lib`, `vars`, `vals`) VALUES ("'.$user['id'].'", "'.(time()+$var['time']*60).'", "'.$lab['id'].'", "trap1", "'.$var['time'].'")');
- }
- $mitm['use'] = $user['id'];
- mysql_query('UPDATE `laba_obj` SET `use` = "'.$mitm['use'].'" WHERE `id` = "'.$mitm['id'].'" LIMIT 1');
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['text'] = ' '.$user['login'].' угодил'.$var['sex'].' в ловушку...';
- $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'));
- $errors .= ' '.$user['login'].' угодил'.$var['sex'].' в ловушку... Время перехода +3 секунды (Длительность: +'.$var['time'].' мин.)';
- }
- } elseif($mitm['type'] == 5) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- } elseif($mitm['type'] == 6) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- }
- unset($var);
- }
-
- if($user['y'] >= count($map_d)-2) {
- if($lab['users'] < 2) {
- mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"');
- } else {
- $lab['users']--;
- mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- }
- $dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "'.$user['id'].'"');
- while($pl = mysql_fetch_array($dresed)) {
- dropitemid($pl['type'], $user['id']);
- }
- mysql_query('UPDATE `inventory` SET `laba` = 0 WHERE `laba` = 1 AND `owner` = "'.$user['id'].'"');
- mysql_query('DELETE FROM `inventory` WHERE `laba` = 2 AND `owner` = "'.$user['id'].'"');
- mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'");
- addActions(time(), 'go_labirint', (time()+60*60*6), $user['id']);
- header('Location: lab_enter.php');
- }
-
- if(isset($_GET['takeitm'])) {
- $errors = 'Предмет не найден...';
- } elseif(isset($_GET['useobj'])) {
- $var = array('obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "'.mysql_real_escape_string($_GET['useobj']).'" AND `lib` = "'.$lab['id'].'" AND `x` = "'.$user['x'].'" AND `y` = "'.$user['y'].'" LIMIT 1')));
- if(isset($var['obj']['id'])) {
- if($var['obj']['use'] == 0) {
- if($var['obj']['type'] == 1) {
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['itm'] = $varsitm[rand(0, count($varsitm)-1)];
- $var['itm'] = $var['itm'][0];
- $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `shop` WHERE `id` = "'.$var['itm'].'" LIMIT 1'));
- if(isset($var['itm']['id'])) {
- if($var['itm']['id'] == 270) {
- $arr = array(0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2);
- $kr = $arr[rand(0, count($arr)-1)];
- $var['itm']['name'] = $kr.' кр';
- money_add($kr);
- unset($kr);
- } else {
- labaItemAdd($var['itm']['id'], 1);
- }
- } else {
- $var['itm']['name'] = 'Предмет рассыпался на глазах...';
- }
- $errors .= ' '.$user['login'].' открыл'.$var['sex'].' сундук...и забрал "'.$var['itm']['name'].'"';
- $var['obj']['use'] = $user['id'];
- } elseif($var['obj']['type'] == 5) {
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['itm'] = $varsitm2[rand(0, count($varsitm2)-1)];
- $var['itm'] = $var['itm'][0];
- $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `ashop` WHERE `id` = "'.$var['itm'].'" LIMIT 1'));
- if(isset($var['itm']['id'])) {
- labaItemAdd($var['itm']['id'], 2);
- } else {
- $var['itm']['name'] = 'Предмет рассыпался на глазах...';
- }
- $errors .= ' '.$user['login'].' открыл'.$var['sex'].' Ящик Пандоры...и забрал "'.$var['itm']['name'].'"';
- $var['obj']['use'] = $user['id'];
- } elseif($var['obj']['type'] == 3) {
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['hpp'] = rand(2, 5)*10;
- $var['hp'] = round($user['maxhp']/100*$var['hpp']);
- $user['hp'] += $var['hp'];
- if($user['hp'] > $user['maxhp']) {
- $user['hp'] = $user['maxhp'];
- }
- mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
- $errors .= ' '.$user['login'].' пополнил'.$var['sex'].' здоровье, Уровень Жизни +'.$var['hpp'].'% (+'.$var['hp'].'HP)';
- $var['obj']['use'] = $user['id'];
- } elseif($var['obj']['type'] == 6) {
- $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'));
- if(isset($var['trap1']['id'])) {
- $var['time'] = rand(1, 50);
- if($var['trap1']['time'] <= (time()+60*$var['time'])) {
- mysql_query('DELETE FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1');
- $errors .= '
Действие ловушки закончилось.';
- unset($var['trap1'], $var['time']);
- } else {
- $var['trap1']['time'] -= 60*$var['time'];
- mysql_query('UPDATE `laba_act` SET `time` = "'.$var['trap1']['time'].'" WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1');
- $errors = '
Действие ловушки снижено на '.$var['time'].' мин...';
- }
- $var['obj']['use'] = $user['id'];
- } else {
- $errors .= '
Вам нечего очищать ...';
- }
- }
- if($var['obj']['use'] > 0) {
- mysql_query('UPDATE `laba_obj` SET `use` = "'.$var['obj']['use'].'" WHERE `id` = "'.$var['obj']['id'].'" LIMIT 1');
- $var['obj']['use'] = $var['obj']['use'];
- }
- } else {
- $errors = 'Кто-то уже использовал это до Вас...';
- }
- } else {
- $errors = 'Обьект не найден...';
- }
- unset($var);
- }
-
- $sp = mysql_query('SELECT `x`, `y`, `level`, `login` FROM `users` WHERE `laba` = "'.$lab['id'].'" AND `id` != "'.$user['id'].'" LIMIT 3');
- $pi = 1;
- while($pl = mysql_fetch_array($sp)) {
- $objs[$pl['x']][$pl['y']] = array(2 => '');
- $pi++;
- }
-
- $objs[$user['x']][$user['y']] = array(2 => '');
- $i = 0;
- while($i <= count($map_d)) {
- $j = 0;
- while($j < count($map_d[$i])) {
- if($i > $real_x - 6 && $i < $real_x + 6 && $j > $real_y - 6 && $j < $real_y + 6) {
- if($map_d[$i][$j] == 1) {
- $mapsee .= ''.$objs[$i][$j][2].'
';
- } else {
- if(!isset($objs[$i][$j]['id'])) {
- if(isset($objs[$i][$j][2])) {
-
- } elseif($j == 1) {
- $objs[$i][$j][2] = '';
- } elseif($j == count($map_d)-2) {
- $objs[$i][$j][2] = '';
- }
- } else {
- if($objs[$i][$j]['use'] == 0) {
- $objs[$i][$j][2] = '';
- } else {
- $objs[$i][$j][2] = '';
- }
- }
- $mapsee .= ''.$objs[$i][$j][2].'
';
- }
- }
- $j++;
- }
- if($i > $real_x - 6 && $i < $real_x + 6) {
- $mapsee .= '
';
- }
- $i++;
- }
- $mapsee = ''.$mapsee.'
';
-
- if($user['align'] == 2.99) {
- unset($objs);
- $objs[$user['x']][$user['y']] = array(2 => '');
- $i = 0;
- while($i <= count($map_d)) {
- $j = 0;
- while($j < count($map_d[$i])) {
- if($map_d[$i][$j] == 1) {
- $mapsee2 .= ''.$objs[$i][$j][2].'
';
- } else {
- if(!isset($objs[$i][$j]['id'])) {
- if(isset($objs[$i][$j][2])) {
-
- } elseif($j == 1 && $i > 0 && $i < count($map_d)-2) {
- $objs[$i][$j][2] = '';
- } elseif($j == count($map_d)-2 && $i > 0 && $i < count($map_d)-2) {
- $objs[$i][$j][2] = '';
- }
- } else {
- if($objs[$i][$j]['use'] == 0) {
- $objs[$i][$j][2] = '';
- } else {
- $objs[$i][$j][2] = '';
- }
- }
- $mapsee2 .= ''.$objs[$i][$j][2].'
';
- }
- $j++;
- }
- $mapsee2 .= '
';
- $i++;
- }
- $mapsee2 = ''.$mapsee2.'
';
- }
-
- if(isset($varos['trap1']['vals']) && $varos['trap1']['vals'] > 0) {
- $effed .= ' - Время перехода +3 секунды (Осталось : '.timeOut($varos['trap1']['time']-time()).')
';
- }
- unset($varos);
-?>
-
-
-
-
-
-
-
-
-
-
-
-
- /*if ($user['align'] == 2.7) {*/ ?>
-
- /*}*/ ?>
-
-
-
- |
- |
- |
-
-
-
-
-
- |
-
-
-
-
-
-
- if( $effed != '' ) { echo $effed; } ?>
-
-
- if( $dies > 0 ) {
- echo 'Кол-во смертей : '.$dies.'/3 ';
- }
- ?>
- Карта : #=$lab['id']?>. Координаты : {X = =$user['x']?> | Y = =$user['y']?>}
-
|
- |
-
-
- |
-
-
- if( isset($q1['id']) ) {
- echo 'Задание: '.$q1['name'].' • ';
- if( $q1['type'] == 1 ) {
- echo 'Собрать ресурсы: ';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
-
- $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "'.$user['id'].'" AND "name" = "'.$qobj['obj_id'].'" LIMIT 1'));
- if( $q2['val'] != $qobj[0] ) {
- mysql_query('UPDATE `qst_user` SET `val` = "'.$qobj[0].'" WHERE `id` = "'.$q2['id'].'" LIMIT 1');
- $q2['val'] = $qobj[0];
- }
- echo ''.$qobj['name'].' ';
- }elseif( $q1['type'] == 2 ) {
- echo 'Собрать трофеи: ';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
- $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "'.$user['id'].'" AND "name" = "'.$qobj['obj_id'].'" LIMIT 1'));
-
- echo ''.$qobj['name'].'';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
- if( $q2['val'] != $qobj[0] ) {
- mysql_query('UPDATE `qst_user` SET `val` = "'.$qobj[0].'" WHERE `id` = "'.$q2['id'].'" LIMIT 1');
- $q2['val'] = $qobj[0];
- }
- echo ' c монстров '.$qobj['name'].' ';
- }elseif( $q1['type'] == 3 ) {
- echo 'Убить монстров: ';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
- echo ''.$qobj['login'].' ['.$qobj['level'].'] ';
- }
- echo '['.$q2['val'].'/'.$q1['obj_val'].'] ';
- echo '(Задание не засчитается, если Вы не найдёте выход.)';
- }
- ?>
- |
- |
-
-
- |
- if( $errors != '' ) { echo $errors.' '; } ?>
- =$itms?>
-
- if($user['align'] == 2.99) {
- echo ' '.$mapsee2;
- }
- ?>
- |
- |
-
-
- |
- |
- |
-
-
-
-
-
- } ?>
\ No newline at end of file
diff --git a/labirint(2).php b/labirint(2).php
deleted file mode 100644
index aa14412..0000000
--- a/labirint(2).php
+++ /dev/null
@@ -1,911 +0,0 @@
- '0'){
- die("");
-}
-
-$vipUsers = array(
- 'SaulDin',
- 'Дед Мазай',
- 'Лик Ужаса',
-
-);
-$errkom = '';
-
-$varsitm = array(array(270, 1));
-
-$varsitm2 = array(array(87, 1), array(88, 1), array(48, 1), array(49, 1), array(29, 1), array(66, 1), array(97, 1), array(67, 1), array(98, 1), array(115, 1));
-
-function labaItemAdd($id, $type) {
- global $user;
- if($type == 1) {
- $dress = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.(int)$id.'" LIMIT 1'));
- } else {
- $dress = mysql_fetch_array(mysql_query('SELECT * FROM `ashop` WHERE `id` = "'.(int)$id.'" LIMIT 1'));
- }
- if(isset($dress['id'])) {
- mysql_query("INSERT INTO `inventory` (`laba`, `prototype`,`owner`,`name`,`type`,`massa`,`cost`, `img`,`maxdur`,`isrep`,`gsila`,`glovk`,`ginta`,`gintel`,`ghp`,`gnoj`,`gtopor`,`gdubina`,`gmech`,`gfire`,`gwater`,`gair`,`gearth`,`glight`,`ggray`,`gdark`,`needident`,`nsila`,`nlovk`,`ninta`,`nintel`,`nmudra`,`nvinos`,`nnoj`,`ntopor`,`ndubina`,`nmech`,`nfire`,`nwater`,`nair`,`nearth`,`nlight`,`ngray`,`ndark`,`mfkrit`,`mfakrit`,`mfuvorot`,`mfauvorot`,`bron1`,`bron2`,`bron3`,`bron4`,`maxu`,`minu`,`magic`,`nlevel`,`nalign`,`dategoden`,`goden`,`otdel`,`gmp`,`gmeshok`,`encicl`,`artefact`,`koll`) VALUES ('$type', '{$dress['id']}','{$user['id']}','{$dress['name']}','{$dress['type']}',{$dress['massa']},{$dress['cost']},'{$dress['img']}',{$dress['maxdur']},{$dress['isrep']},'{$dress['gsila']}','{$dress['glovk']}','{$dress['ginta']}','{$dress['gintel']}','{$dress['ghp']}','{$dress['gnoj']}','{$dress['gtopor']}','{$dress['gdubina']}','{$dress['gmech']}','{$dress['gfire']}','{$dress['gwater']}','{$dress['gair']}','{$dress['gearth']}','{$dress['glight']}','{$dress['ggray']}','{$dress['gdark']}','{$dress['needident']}','{$dress['nsila']}','{$dress['nlovk']}','{$dress['ninta']}','{$dress['nintel']}','{$dress['nmudra']}','{$dress['nvinos']}','{$dress['nnoj']}','{$dress['ntopor']}','{$dress['ndubina']}','{$dress['nmech']}','{$dress['nfire']}','{$dress['nwater']}','{$dress['nair']}','{$dress['nearth']}','{$dress['nlight']}','{$dress['ngray']}','{$dress['ndark']}','{$dress['mfkrit']}','{$dress['mfakrit']}','{$dress['mfuvorot']}','{$dress['mfauvorot']}','{$dress['bron1']}','{$dress['bron2']}','{$dress['bron3']}','{$dress['bron4']}','{$dress['maxu']}','{$dress['minu']}','{$dress['magic']}','{$dress['nlevel']}','{$dress['nalign']}','".(($dress['goden'])?($dress['goden']*24*60*60+time()):"")."','{$dress['goden']}','{$dress['razdel']}','{$dress['gmp']}','{$dress['gmeshok']}','{$dress['encicl']}','{$dress['artefact']}','{$dress[koll]}')");
- }
-}
-
-function money_add($sum) {
- global $user;
- $user['money'] += $sum;
- mysql_query('UPDATE `users` SET `money` = "'.$user['money'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
-}
-
-if($user['room'] == 1052) {
- if($user['id'] == 10022) {
- $lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- } else {
- $lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- $map = mysql_fetch_array(mysql_query('SELECT `id`,`data`,`update` FROM `laba_map` WHERE `id` = "'.$user['laba'].'" LIMIT 1'));
- }
-
- $dies = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$user['laba'].'" AND `vars` = "dielaba" LIMIT 1'));
- $dies = $dies[0];
- $map_d = json_decode($map['data']);
- $usersDng = setHP($user['hp'], $user['maxhp'], 0);
- $errors = '';
- $effed = '';
- $mapsee = '';
- $varos = array();
- $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'));
-
- $real_x = $user['x'];
- $real_y = $user['y'];
- if($real_y < 6) { $real_y = 6; }
- if($real_x < 6) { $real_x = 6; }
-
- if($real_y > count($map_d) - 7) {
- $real_y = count($map_d) - 7;
- }
-
- if($real_x > count($map_d) - 7) {
- $real_x = count($map_d) - 7;
- }
-
- $objs = array();
-
- $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;
- }
-
- $i = 1;
- $goodgoo = array(1 => 0, 2 => 0, 3 => 0, 4 => 0);
- while($i <= 4) {
- $goto = array('x' => $user['y'], 'y' => $user['x']);
- if($i == 1) {
- $goto['x']--;
- } elseif($i == 2) {
- $goto['y']--;
- } elseif($i == 3) {
- $goto['x']++;
- } elseif($i == 4) {
- $goto['y']++;
- }
- if($map_d[$goto['y']][$goto['x']] == 0 && $goto['x'] > 0 && $goto['x'] < count($map_d)-1 && $user['timeGo'] <= time()) {
- $goodgoo[$i] = 1;
- }
- $i++;
- }
-
- if(isset($_GET['goto'])) {
- $goto = array('x' => $user['y'], 'y' => $user['x']);
- if($_GET['goto'] == 1 ) {
- $goto['x']--;
- } elseif($_GET['goto'] == 2) {
- $goto['y']--;
- } elseif($_GET['goto'] == 3) {
- $goto['x']++;
- } elseif($_GET['goto'] == 4) {
- $goto['y']++;
- }
-
- if($goodgoo[$_GET['goto']] == 1 && $user['timeGo'] <= time()) {
- $user['y'] = $goto['x'];
- $user['x'] = $goto['y'];
- $real_x = $user['x'];
- $real_y = $user['y'];
- $varos['timego'] = 0; #5
- if(isset($varos['trap1']['id'])) {
- $varos['timego'] += 3;
- }
- if($user['align'] == 2.99) { $varos['timego'] = 0; }
- $user['timeGo'] = (time()+$varos['timego']);
- $user['timeGoL'] = time();
- if(!mysql_query('UPDATE `users` SET `x` = "'.$user['x'].'", `y` = "'.$user['y'].'", `timeGoL` = "'.$user['timeGoL'].'", `timeGo` = "'.$user['timeGo'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1')) {
- $errors = 'Ошибка перемещения!';
- }
- }
- }
-
- if($real_y < 6) { $real_y = 6; }
- if($real_x < 6) { $real_x = 6; }
-
- if($real_y > count($map_d) - 7) {
- $real_y = count($map_d) - 7;
- }
- if($real_x > count($map_d) - 7) {
- $real_x = count($map_d) - 7;
- }
-
- $tmdg = ($user['timeGo']-time());
- $tmdgl = ($user['timeGo']-$user['timeGoL']);
- $tmdgp = floor(100-$tmdg/$tmdgl*100);
- if($tmdgp < 1) { $tmdgp = 1; } elseif($tmdgp > 100) { $tmdgp = 100; }
- $tmdgm = 25*$tmdgl;
- $tmdg = floor(40/100*$tmdgp);
-
- if($tmdg < 1) {
- $tmdg = 1;
- } elseif($tmdg > 40) {
- $tmdg = 40;
- }
-
- if(isset($_POST['exit'])) {
- if($lab['users'] < 2) {
- mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"');
- } else {
- $lab['users']--;
- mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- }
- $dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "'.$user['id'].'"');
- while($pl = mysql_fetch_array($dresed)) {
- dropitemid($pl['type'], $user['id']);
- }
- mysql_query('DELETE FROM `inventory` WHERE `laba` > 0 AND `owner` = "'.$user['id'].'"');
- mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'");
- mysql_query('UPDATE `qst_user` SET `val` = "0" WHERE `uid` = "'.$user['id'].'" AND `cancel` = "0" AND `finish` = "0"');
- addActions(time(), 'go_labirint', (time()+60*60*6), $user['id']);
- header('Location: lab_enter.php');
- }
-
- $itms = '';
-
- if(isset($objs[$user['x']][$user['y']]['id'])) {
- $var = array();
- $mitm = $objs[$user['x']][$user['y']];
- if($mitm['type'] == 2) {
- if($mitm['use'] == 0) {
- $btl_pix = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `battle` > 0 AND `laba` = "'.$lab['id'].'" AND `x` = "'.$user['x'].'" AND `y` = "'.$user['y'].'" LIMIT 1'));
- if(!isset($btl_pix['id']) ) {
- $bots = array(
- 0 => array(10025, 10026, 10027, 10028, 10031, 10032, 10033, 10034),
- 1 => array(10111, 10112, 10113, 10114, 10115, 10116),
- 2 => array(10111, 10112, 10113)
- );
- $bot_pix2 = $bots[$lab['type']];
-
- $teams = array();
- $where = ''; $bot_ids = '';
- $i = 0;
- $j = (1+rand(0, floor($user['level']/rand(3, 4))));
- while($i < $j) {
- $bot_pix = $bot_pix2[rand(0, count($bot_pix2)-1)];
- $bot_pix = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$bot_pix.'" LIMIT 1'));
- mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) VALUES ('".$bot_pix['login']." (Бот #$i)', '".$bot_pix['id']."', '', '".$bot_pix['maxhp']."')");
- $bot = mysql_insert_id();
- $bot_ids .= $bot.';';
- $teams[$user['id']][$bot] = array(0, 0, time());
- $teams[$bot][$user['id']] = array(0, 0, time());
- $where = ' `id` = '.$bot.' OR';
- $i++;
- }
- $bot_ids = rtrim($bot_ids, ';');
- $where = rtrim($where, ' OR');
-
- if(!mysql_query("INSERT INTO `battle` (`teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`, `x`, `y`) VALUES ('".serialize($teams)."', '3', '1', '0', '".$user['id']."', '".$bot_ids."', '".time()."', '".time()."', '".$user['x']."', '".$user['y']."')")) { die('Error #2'); }
-
- $id = mysql_insert_id();
- $bts = explode(';', $bot_ids);
- $is = 0;
- while($is <= count($bts)) {
- $nicks .= nick::id($bts[$is])->full(1).', ';
- $i_d .= $bts[$is].', ';
- $is++;
- }
- $nicks = rtrim($nicks, ', ');
- $who = '`id` IN ('.rtrim($i_d, ', ').')';
-
- if($user1['invis'] == 1) {
- $rr = "невидимка и ".$nicks."";
- } else {
- $rr = "".nick::id($user['id'])->full(1)." и ".$nicks."";
- }
-
- if(!mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE ".$who."")) { die('Error #1'.$who); }
- mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id`= {$user['id']} LIMIT 1");
- addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
");
- } else {
- $bd = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$btl_pix['battle'].'" LIMIT 1'));
- $botd = mysql_fetch_array(mysql_query('SELECT * FROM `bots` WHERE `battle` = "'.$bd['id'].'" LIMIT 1'));
- $battle = unserialize($bd['teams']);
- $ak = array_keys($battle[$botd['id']]);
- $battle[$user['id']] = $battle[$ak[0]];
- foreach($battle[$user['id']] as $k => $v) {
- $battle[$user['id']][$k] = array(0, 0, time());
- $battle[$k][$user['id']] = array(0, 0, time());
- }
- $t1 = explode(";", $bd['t1']);
- $ttt = 1;
- addlog($jert['battle'], ''.date("H:i").' '.nick5($user['id'], "B".$ttt).' вмешался в поединок!
');
- mysql_query('UPDATE `battle` SET `teams` = \''.serialize($battle).'\', `t'.$ttt.'` = CONCAT(`t'.$ttt.'`,\';'.$user['id'].'\') WHERE `id` = "'.$btl_pix['battle'].'" LIMIT 1');
- mysql_query("UPDATE `users` SET `battle` = '".$bd['id']."', `zayavka` = 0 WHERE `id` = '".$user['id']."' LIMIT 1");
- header("Location: fbattle.php");
- }
- die("");
- }
- } elseif($mitm['type'] == 1) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- } elseif($mitm['type'] == 3) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- } elseif($mitm['type'] == 4) {
- if($mitm['use'] == 0) {
- $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" 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');
- } else {
- mysql_query('INSERT INTO `laba_act` (`uid`, `time`, `lib`, `vars`, `vals`) VALUES ("'.$user['id'].'", "'.(time()+$var['time']*60).'", "'.$lab['id'].'", "trap1", "'.$var['time'].'")');
- }
- $mitm['use'] = $user['id'];
- mysql_query('UPDATE `laba_obj` SET `use` = "'.$mitm['use'].'" WHERE `id` = "'.$mitm['id'].'" LIMIT 1');
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['text'] = ' '.$user['login'].' угодил'.$var['sex'].' в ловушку...';
- $varos['trap1'] = mysql_fetch_array(mysql_query('SELECT `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'));
- $errors .= ' '.$user['login'].' угодил'.$var['sex'].' в ловушку... Время перехода +3 секунды (Длительность: +'.$var['time'].' мин.)';
- }
- } elseif($mitm['type'] == 5) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- } elseif($mitm['type'] == 6) {
- if($mitm['use'] == 0) {
- $itms .= '
';
- } else {
- $itms .= '
';
- }
- }
- unset($var);
- }
-
- if($user['y'] >= count($map_d)-2) {
- if($lab['users'] < 2) {
- mysql_query('DELETE FROM `laba_now` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_map` WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- mysql_query('DELETE FROM `laba_obj` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_act` WHERE `lib` = "'.$lab['id'].'"');
- mysql_query('DELETE FROM `laba_itm` WHERE `lib` = "'.$lab['id'].'"');
- } else {
- $lab['users']--;
- mysql_query('UPDATE `laba_now` SET `users` = "'.$lab['users'].'" WHERE `id` = "'.$lab['id'].'" LIMIT 1');
- }
- $dresed = mysql_query('SELECT `id`, `type` FROM `inventory` WHERE `dressed` = 1 AND `laba` = 2 AND `owner` = "'.$user['id'].'"');
- while($pl = mysql_fetch_array($dresed)) {
- dropitemid($pl['type'], $user['id']);
- }
- mysql_query('UPDATE `inventory` SET `laba` = 0 WHERE `laba` = 1 AND `owner` = "'.$user['id'].'"');
- mysql_query('DELETE FROM `inventory` WHERE `laba` = 2 AND `owner` = "'.$user['id'].'"');
- mysql_query("UPDATE `users`, `online` SET `users`.`room` = '1051', `online`.`room` = '1051', `users`.`x` = '0', `users`.`y` = '0', `users`.`laba` = '0' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '".$user['id']."'");
- addActions(time(), 'go_labirint', (time()+60*60*6), $user['id']);
- header('Location: lab_enter.php');
- }
-
- if(isset($_GET['takeitm'])) {
- $errors = 'Предмет не найден...';
- } elseif(isset($_GET['useobj'])) {
- $var = array('obj' => mysql_fetch_array(mysql_query('SELECT * FROM `laba_obj` WHERE `id` = "'.mysql_real_escape_string($_GET['useobj']).'" AND `lib` = "'.$lab['id'].'" AND `x` = "'.$user['x'].'" AND `y` = "'.$user['y'].'" LIMIT 1')));
- if(isset($var['obj']['id'])) {
- if($var['obj']['use'] == 0) {
- if($var['obj']['type'] == 1) {
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['itm'] = $varsitm[rand(0, count($varsitm)-1)];
- $var['itm'] = $var['itm'][0];
- $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `shop` WHERE `id` = "'.$var['itm'].'" LIMIT 1'));
- if(isset($var['itm']['id'])) {
- if($var['itm']['id'] == 270) {
- $arr = array(0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2);
- $kr = $arr[rand(0, count($arr)-1)];
- $var['itm']['name'] = $kr.' кр';
- money_add($kr);
- unset($kr);
- } else {
- labaItemAdd($var['itm']['id'], 1);
- }
- } else {
- $var['itm']['name'] = 'Предмет рассыпался на глазах...';
- }
- $errors .= ' '.$user['login'].' открыл'.$var['sex'].' сундук...и забрал "'.$var['itm']['name'].'"';
- $var['obj']['use'] = $user['id'];
- } elseif($var['obj']['type'] == 5) {
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['itm'] = $varsitm2[rand(0, count($varsitm2)-1)];
- $var['itm'] = $var['itm'][0];
- $var['itm'] = mysql_fetch_array(mysql_query('SELECT `id`, `name` FROM `ashop` WHERE `id` = "'.$var['itm'].'" LIMIT 1'));
- if(isset($var['itm']['id'])) {
- labaItemAdd($var['itm']['id'], 2);
- } else {
- $var['itm']['name'] = 'Предмет рассыпался на глазах...';
- }
- $errors .= ' '.$user['login'].' открыл'.$var['sex'].' Ящик Пандоры...и забрал "'.$var['itm']['name'].'"';
- $var['obj']['use'] = $user['id'];
- } elseif($var['obj']['type'] == 3) {
- $var['sex'] = '';
- if($user['sex'] == 0) { $var['sex'] = 'а'; }
- $var['hpp'] = rand(2, 5)*10;
- $var['hp'] = round($user['maxhp']/100*$var['hpp']);
- $user['hp'] += $var['hp'];
- if($user['hp'] > $user['maxhp']) {
- $user['hp'] = $user['maxhp'];
- }
- mysql_query('UPDATE `users` SET `hp` = "'.$user['hp'].'" WHERE `id` = "'.$user['id'].'" LIMIT 1');
- $errors .= ' '.$user['login'].' пополнил'.$var['sex'].' здоровье, Уровень Жизни +'.$var['hpp'].'% (+'.$var['hp'].'HP)';
- $var['obj']['use'] = $user['id'];
- } elseif($var['obj']['type'] == 6) {
- $var['trap1'] = mysql_fetch_array(mysql_query('SELECT `id`, `vals`, `time` FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1'));
- if(isset($var['trap1']['id'])) {
- $var['time'] = rand(1, 50);
- if($var['trap1']['time'] <= (time()+60*$var['time'])) {
- mysql_query('DELETE FROM `laba_act` WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1');
- $errors .= '
Действие ловушки закончилось.';
- unset($var['trap1'], $var['time']);
- } else {
- $var['trap1']['time'] -= 60*$var['time'];
- mysql_query('UPDATE `laba_act` SET `time` = "'.$var['trap1']['time'].'" WHERE `uid` = "'.$user['id'].'" AND `lib` = "'.$lab['id'].'" AND `time` > "'.time().'" ORDER BY `time` DESC LIMIT 1');
- $errors = '
Действие ловушки снижено на '.$var['time'].' мин...';
- }
- $var['obj']['use'] = $user['id'];
- } else {
- $errors .= '
Вам нечего очищать ...';
- }
- }
- if($var['obj']['use'] > 0) {
- mysql_query('UPDATE `laba_obj` SET `use` = "'.$var['obj']['use'].'" WHERE `id` = "'.$var['obj']['id'].'" LIMIT 1');
- $var['obj']['use'] = $var['obj']['use'];
- }
- } else {
- $errors = 'Кто-то уже использовал это до Вас...';
- }
- } else {
- $errors = 'Обьект не найден...';
- }
- unset($var);
- }
-
- $sp = mysql_query('SELECT `x`, `y`, `level`, `login` FROM `users` WHERE `laba` = "'.$lab['id'].'" AND `id` != "'.$user['id'].'" LIMIT 3');
- $pi = 1;
- while($pl = mysql_fetch_array($sp)) {
- $objs[$pl['x']][$pl['y']] = array(2 => '');
- $pi++;
- }
-
- $objs[$user['x']][$user['y']] = array(2 => '');
- $i = 0;
- while($i <= count($map_d)) {
- $j = 0;
- while($j < count($map_d[$i])) {
- if($i > $real_x - 6 && $i < $real_x + 6 && $j > $real_y - 6 && $j < $real_y + 6) {
- if($map_d[$i][$j] == 1) {
- $mapsee .= ''.$objs[$i][$j][2].'
';
- } else {
- if(!isset($objs[$i][$j]['id'])) {
- if(isset($objs[$i][$j][2])) {
-
- } elseif($j == 1) {
- $objs[$i][$j][2] = '';
- } elseif($j == count($map_d)-2) {
- $objs[$i][$j][2] = '';
- }
- } else {
- if($objs[$i][$j]['use'] == 0) {
- $objs[$i][$j][2] = '';
- } else {
- $objs[$i][$j][2] = '';
- }
- }
- $mapsee .= ''.$objs[$i][$j][2].'
';
- }
- }
- $j++;
- }
- if($i > $real_x - 6 && $i < $real_x + 6) {
- $mapsee .= '
';
- }
- $i++;
- }
- $mapsee = ''.$mapsee.'
';
-
- if($user['align'] == 2.99) {
- unset($objs);
- $objs[$user['x']][$user['y']] = array(2 => '');
- $i = 0;
- while($i <= count($map_d)) {
- $j = 0;
- while($j < count($map_d[$i])) {
- if($map_d[$i][$j] == 1) {
- $mapsee2 .= ''.$objs[$i][$j][2].'
';
- } else {
- if(!isset($objs[$i][$j]['id'])) {
- if(isset($objs[$i][$j][2])) {
-
- } elseif($j == 1 && $i > 0 && $i < count($map_d)-2) {
- $objs[$i][$j][2] = '';
- } elseif($j == count($map_d)-2 && $i > 0 && $i < count($map_d)-2) {
- $objs[$i][$j][2] = '';
- }
- } else {
- if($objs[$i][$j]['use'] == 0) {
- $objs[$i][$j][2] = '';
- } else {
- $objs[$i][$j][2] = '';
- }
- }
- $mapsee2 .= ''.$objs[$i][$j][2].'
';
- }
- $j++;
- }
- $mapsee2 .= '
';
- $i++;
- }
- $mapsee2 = ''.$mapsee2.'
';
- }
-
- if(isset($varos['trap1']['vals']) && $varos['trap1']['vals'] > 0) {
- $effed .= ' - Время перехода +3 секунды (Осталось : '.timeOut($varos['trap1']['time']-time()).')
';
- }
- unset($varos);
-?>
-
-
-
-
-
-
-
-
-
-
-
-
- /*if ($user['align'] == 2.7) {*/ ?>
-
- /*}*/ ?>
-
-
-
- |
- |
- |
-
-
-
-
-
- |
-
-
-
-
-
-
- if( $effed != '' ) { echo $effed; } ?>
-
-
- if( $dies > 0 ) {
- echo 'Кол-во смертей : '.$dies.'/3 ';
- }
- ?>
- Карта : #=$lab['id']?>. Координаты : {X = =$user['x']?> | Y = =$user['y']?>}
-
|
- |
-
-
- |
-
-
- if( isset($q1['id']) ) {
- echo 'Задание: '.$q1['name'].' • ';
- if( $q1['type'] == 1 ) {
- echo 'Собрать ресурсы: ';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
-
- $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "'.$user['id'].'" AND "name" = "'.$qobj['obj_id'].'" LIMIT 1'));
- if( $q2['val'] != $qobj[0] ) {
- mysql_query('UPDATE `qst_user` SET `val` = "'.$qobj[0].'" WHERE `id` = "'.$q2['id'].'" LIMIT 1');
- $q2['val'] = $qobj[0];
- }
- echo ''.$qobj['name'].' ';
- }elseif( $q1['type'] == 2 ) {
- echo 'Собрать трофеи: ';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `shop` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
- $qobj_f = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `inventory` WHERE `owner` = "'.$user['id'].'" AND "name" = "'.$qobj['obj_id'].'" LIMIT 1'));
-
- echo ''.$qobj['name'].'';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
- if( $q2['val'] != $qobj[0] ) {
- mysql_query('UPDATE `qst_user` SET `val` = "'.$qobj[0].'" WHERE `id` = "'.$q2['id'].'" LIMIT 1');
- $q2['val'] = $qobj[0];
- }
- echo ' c монстров '.$qobj['name'].' ';
- }elseif( $q1['type'] == 3 ) {
- echo 'Убить монстров: ';
- $qobj = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$q1['obj_id'].'" LIMIT 1'));
- echo ''.$qobj['login'].' ['.$qobj['level'].'] ';
- }
- echo '['.$q2['val'].'/'.$q1['obj_val'].'] ';
- echo '(Задание не засчитается, если Вы не найдёте выход.)';
- }
- ?>
- |
- |
-
-
- |
- if( $errors != '' ) { echo $errors.' '; } ?>
- =$itms?>
-
- if($user['align'] == 2.99) {
- echo ' '.$mapsee2;
- }
- ?>
- |
- |
-
-
- |
- |
- |
-
-
-
-
-
- } ?>
\ No newline at end of file
diff --git a/labirint.php b/labirint.php
index 2d98d82..fe84341 100644
--- a/labirint.php
+++ b/labirint.php
@@ -660,6 +660,24 @@ function setHPlocal() {
tkHP += maxHP/53/20*(speed/100);
TimerOn = tkHP < maxHP?setTimeout("setHPlocal()", delay*100):-1
}
+
+function GoAJAX(goLink){
+//
+ $.ajax({
+ url: goLink + '&ajax=true',
+ cache: false,
+ type: "GET",
+ dataType: "html",
+ success: function(html){
+ $('#ViewLab').html(html);
+ }
+ });
+// }
+}
+function confirmSubmit(mes){
+ var agree = confirm(mes);
+ return agree ? true : false ;
+}
if($user['battle'] == 0) { ?>
setHP(=$user['hp'];?>, =$user['maxhp'];?>, 100);
} ?>