query('LOCK TABLES `bots` WRITE, `laba_obj` WRITE, `qst_user` WRITE, `qst` WRITE, `` WRITE, `battle` WRITE, `logs` WRITE, `users` WRITE, `inventory` WRITE, `magic` WRITE, `effects` WRITE, `online` WRITE, `clans` WRITE, `variables` WRITE, `logs_arena` WRITE, `cavebots` WRITE, `caveparties` WRITE'); if (isset($user['id'])) { db::c()->query('UPDATE `online` SET `real_time` = ?i WHERE `id` = ?i', time(), $user['id']); } include('./classes/battle_new.class.php'); $fbattle = new fbattle($user['battle']); ?>
return) { case 1 : ?>

Поединок

Ваш ход  
3) { if (@$_GET['use']) { $dressed = mysql_fetch_row(mysql_query("SELECT `id` FROM `inventory` WHERE `id` = '" . (int)$_GET['use'] . "' AND `dressed` = 1")); if ((int)$dressed[0] > 0) { $my_class = $fbattle->my_class; ob_start(); usemagic($_GET['use'], "" . $_POST['target']); $bb = explode("
Обновить Сменить противника
0) && $fbattle->battle) { echo '
Ожидаем хода противника...
0) ? "battle" : "end") . '>
'; } elseif ($user['hp'] <= 0 && $fbattle->battle) { ref_drop(); echo '
Ожидаем, пока бой закончат другие игроки...
0) ? "battle" : "end") . '>
'; } break; case 3 : echo "

Противник долго не делает свой ход, вы можете закончить бой победителем

"; if (!$fbattle->user['in_tower'] && $fbattle->user['room'] != 200) { echo "или признать ничью

"; } echo "или
"; break; } if ($enemy == 0) { // проверяем на вшивость if (!$fbattle->battle) { if ($user['battle']) { $ll = $user['battle']; } else { $ll = $_POST['batl']; } if (!$ll) { $ll_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `battle` WHERE (`t1` LIKE '%{$user['id']}%' || `t2` LIKE '%{$user['id']}%') AND `win` = '3' LIMIT 1")); $ll = $ll_r['id']; } $data = @mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE `id` = {$ll} LIMIT 1")); $damage = unserialize($data['damage']); $exp = unserialize($data['exp']); if (empty($damage[$user['id']])) { $damage[$user['id']] = 0; } if ($user['caveleader'] > 0 || $user['laba'] > 0) { $rep = floor($damage[$user['id']] / 300); if ($rep <= 0) { $rep = 0; } $ads = '. Репутации: ' . $rep . ' ед.'; } else { $rep = 0; $ads = '.'; } echo '

Бой закончен! Всего вами нанесено урона ' . $damage[$user['id']] . ' HP. Получено опыта ' . (int)$exp[$user['id']] . ' (' . check_proc($user['id']) . '%)' . $ads . '

'; } } else { ?> battle) { ?>
t1 as $k => $v) { if (in_array($v, array_keys($fbattle->battle))) { ++$i; if ($i > 1) { $cc = ', '; } else { $cc = ''; } $ffs .= $cc . nick4($v, "B1"); $zz .= "private [" . nick::id($v)->short() . "] "; } } $i = 0; ?> против t2 as $k => $v) { if (in_array($v, array_keys($fbattle->battle))) { ++$i; if ($i > 1) { $cc = ', '; } else { $cc = ''; } $ffs .= $cc . nick4($v, "B2"); $zz .= "private [" . nick::id($v)->short() . "] "; } } $i = 0; ?>
На данный момент вами нанесено урона: damage[$user['id']] ?> HP. (Бой идет с таймаутом battle_data['timeout'] ?> мин.)

"; } if ($user['battle']) { $ll = $user['battle']; } elseif ($_REQUEST['batl']) { $ll = $_REQUEST['batl']; } else { $ll = $_SESSION['batl']; } if (!$ll) { $ll_r = mysql_fetch_array(mysql_query("SELECT `id` FROM `battle` WHERE (`t1` LIKE '%{$user['id']}%' OR `t2` LIKE '%{$user['id']}%') AND `win` = 3 LIMIT 1")); $ll = $ll_r['id']; } $fs = filesize("backup/logs/battle" . $ll . ".txt"); $fh = fopen("backup/logs/battle" . $ll . ".txt", "r"); fseek($fh, -4256, SEEK_END); $log[0] = fread($fh, 4256); fclose($fh); $log = explode("
", $log[0]); $ic = count($log) - 2; if ($fs >= 4256) { $max = 1; } else { $max = 0; } for ($i = $ic; $i >= 0 + $max; --$i) { if (eregi("
", $log[$i])) { $log[$i] = str_replace("
", "", $log[$i]); $log[$i] = $log[$i] . "
"; } if (eregi(">" . $user['login'] . "", $log[$i])) { $log[$i] = str_replace("", "", $log[$i]); } if ($ll != 0) { if (eregi("
", $log[$i])) { echo $log[$i]; } else { echo $log[$i] . "
"; } } } unset($ic); if ($max == 1) { ?> Обрезано для уменьшения объема информации. Полную версию смотрите здесь»
(Бой идет с таймаутом battle_data['timeout'] ?> мин.)

На данный момент вами нанесено урона: damage[$user['id']] ?> HP.
return == 1) { echo showinf_pers($fbattle->enemy, 1, 1); } else { if ($fbattle->battle_data['type'] == 4 || $fbattle->battle_data['type'] == 5) { $a = array(6, 16); echo ""; } elseif ($fbattle->return > 1) { echo ""; } elseif ($exp[$user['id']] > 0) { echo ""; } else { echo ""; } } if ($fbattle->needrefresh) { header("Location: fbattle.php?" . time()); } if ($fbattle->battle_data['needbb']) { foreach ($fbattle->battle as $k => $v) { if ($k > _BOTSEPARATOR_) { foreach ($v as $k2 => $v2) { if ($k2 < _BOTSEPARATOR_) continue; $hp_1 = mysql_fetch_array(mysql_query('SELECT `hp` FROM `bots` WHERE `id` = "' . $k . '" LIMIT 1')); $hp_2 = mysql_fetch_array(mysql_query('SELECT `hp` FROM `bots` WHERE `id` = "' . $k2 . '" LIMIT 1')); if ($fbattle->battle[$k][$k2][0] && $fbattle->battle[$k2][$k][0] && $hp_1['hp'] > 0 && $hp_2['hp'] > 0 && time() - $fbattle->battle[$k][$k2][2] > 1 && time() - $fbattle->battle[$k2][$k][2] > 1) { $at_1 = $fbattle->battle[$k][$k2][0]; $def_1 = $fbattle->battle[$k][$k2][1]; $at_2 = $fbattle->battle[$k2][$k][0]; $def_2 = $fbattle->battle[$k2][$k][1]; $fbattle->makechange($k, $k2, $at_1, $at_2, $def_1, $def_2); $fbattle->write_log(); $fbattle->battle[$k][$k2] = array(0, 0, time()); $fbattle->battle[$k2][$k] = array(0, 0, time()); $fbattle->needupdate = 1; } } } } if ($fbattle->needupdate) { $fbattle->UpdateBattle(); } } ?>