1.4 && $user['align'] < 2) || $user['admin'] == 1)) {
mysql_query("UPDATE `zayavka` SET `coment` = 'Вырезано цензурой!' WHERE `id` = '" . mysql_real_escape_string($_GET['zid']) . "' LIMIT 1");
}
if ($_GET['del'] && $user['admin'] == 1) { //удаление заявки на бой.
$zay = mysql_fetch_array(mysql_query('SELECT `id` FROM `zayavka` WHERE `id` = "' . mysql_real_escape_string((int)$_GET['zid']) . '" LIMIT 1'));
if (isset($zay['id'])) {
mysql_query("UPDATE `users` SET `zayavka` = 0 WHERE `zayavka` = {$zay['id']}");
mysql_query("DELETE FROM `zayavka` WHERE `id` = {$zay['id']} LIMIT 1");
} else {
echo 'Заявка не найдена ...';
}
}
if(isset($_REQUEST['view'])) {
$_SESSION['view'] = $_REQUEST['view'];
}
class zayavka {
var $mysql;
function zayavka() {
global $mysql;
$this->mysql = $mysql;
}
function fteam($team) {
$team = explode(";", $team);
unset($team[count($team)-1]);
return $team;
}
function getlist($razdel = 1, $level = null, $id = null ) {
$fict = mysql_query("SELECT * FROM `zayavka` WHERE ".(($level != null)? " ((`t1min` <= '{$level}' OR `t1min` = '99') AND (`t1max` >= '{$level}' OR `t1max` = '99') ".(($razdel == 4)?"AND (`t2min` <= '{$level}' OR `t2min` = '99') AND (`t2max` >= '{$level}' OR `t2max` = '99')":"").") AND " : "")." `level` = {$razdel} ".(($id != null)? " AND `id` = {$id} " : "")." ORDER BY `podan` DESC");
while($row = mysql_fetch_array($fict)) {
if(($row['start']+300) < time()) {
if(mysql_query("DELETE FROM `zayavka` WHERE `id` = '{$row['id']}' LIMIT 1")) {
$team1 = $this->fteam($row['team1']);
foreach($team1 as $k => $v) {
mysql_query("UPDATE `users` SET `zayavka` = '0' WHERE `id` = {$v}");
}
$team2 = $this->fteam($row['team2']);
foreach($z[$zay]['team2'] as $k => $v) {
mysql_query("UPDATE `users` SET `zayavka` = '0' WHERE `id` = {$v}");
}
}
}
$zay[$row['id']] = array("team1" => $this->fteam($row['team1']), "team2" => $this->fteam($row['team2']), "coment" => $row['coment'], "type" => $row['type'], "timeout" => $row['timeout'], "start" => $row['start'], "t1min" => $row['t1min'], "t1max" => $row['t1max'], "t2min" => $row['t2min'], "t2max" => $row['t2max'], "t1c" => $row['t1c'], "t2c" => $row['t2c'], "podan" => $row['podan'], "id" => $row['id'], "level" => $row['level'], "blood" => $row['blood'], "bots" => $row['bots']);
}
return $zay;
}
function addteam($team = 1, $id, $zay , $r) {
global $user;
$owntravma = mysql_fetch_array(mysql_query("SELECT `id`, `type` FROM `effects` WHERE `owner` = ".$id." AND (`type` = 12 OR `type` = 13)"));
$z = $this->getlist($r, null, $zay);
if($owntravma) {
switch($owntravma['type']) {
case ($owntravma['type'] == 12 && ($z[$zay]['type'] != 4 && $z[$zay]['type'] != 5)): return "У Вас средняя травма, поединки с оружием слишком тяжелы для Вас..."; break;
case 13: return "У Вас тяжелая травма, Вы не сможете драться..."; break;
}
}
if($user['zayavka'] != 0) { return "Вы находитесь в заявке"; }
if($user['hp'] < $user['maxhp']*0.33) {
return "Вы слишком ослаблены для боя, восстановитесь.";
}
if(!$z) {
return "Эта заявка не может быть принята Вами.";
}
if($this->ustatus($id) != 0) {
return "Эта заявка не может быть принята Вами.";
}
if($z[$zay]['type'] == 3 || $z[$zay]['type'] == 5) {
} else {
if($team == 1) { $teamz = 2; } else { $teamz = 1; }
foreach($z[$zay]['team'.$teamz] as $v) {
$toper = mysql_fetch_array(mysql_query("SELECT `klan`, `align` FROM `users` WHERE `id` = '{$v}' LIMIT 1"));
if($toper['klan'] > 0) {
if((int)$user['klan'] == (int)$toper['klan']) {
return "Чтите честь Ваших сокланов.";
}
}
if((int)$user['align'] == 1) {
if((int)$toper['align'] == 1) {
return "Чтите честь Паладинов.";
}
}
if($user['align'] == 6) {
if($toper['align'] == 6) {
return "Не предавайте свет.";
}
}
if($user['align'] == 3) {
if($toper['align'] == 3) {
return "Не предавайте тьму.";
}
}
}
}
if($z[$zay]['t'.$team.'min'] == 99) {
$toper = $z[$zay]['team'.$team][0];
$toper = mysql_fetch_array(mysql_query("SELECT `id`, `login`, `align`, `klan`, `level` FROM `users` WHERE `id` = '{$toper}' LIMIT 1"));
if($toper['klan'] != '') {
if($user['klan'] != $toper['klan']) {
return "Эта заявка не может быть принята Вами.";
}
}
} else {
if($user['level'] > 0 &&!($z[$zay]['t'.$team.'min'] <= $user['level'] && $z[$zay]['t'.$team.'max'] >= $user['level'])) {
return "Эта заявка не может быть принята Вами. - ".$z[$zay]['t'.$team.'min'];
}
}
if(count($z[$zay]['team'.$team]) >= $z[$zay]['t'.$team.'c'] ) { return "Группа уже набрана."; }
$z[$zay]['team'.$team][] = '';
if(mysql_query("UPDATE `users`, `zayavka` SET `users`.`zayavka` = {$zay}, `zayavka`.`team{$team}` = '".implode(";", $z[$zay]['team'.$team])."".$id.";' WHERE `users`.`id` = {$id} AND `users`.`zayavka` = 0 AND `zayavka`.`id` = {$zay}")) {
return "Вы приняли заявку на бой.";
}
}
function delteam($team = 2, $id, $zay, $r) {
$z = $this->getlist($r, null, $zay);
if($z[$zay]['level'] > 3 || $z[$zay]['level'] == null) {
return "Ай-ай-ай!";
}
foreach($z[$zay]['team'.$team] as $v) {
if($v != $id) {
$teams[] = $v;
}
}
if(mysql_query("UPDATE `users`, `zayavka` SET `users`.`zayavka` = '0', `zayavka`.`team{$team}` = '{$teams}' WHERE `users`.`id` = {$id} AND `zayavka`.`id` = {$zay};")) {
return "Вы отозвали запрос";
}
}
function addzayavka($start, $timeout = 3, $t1c, $t2c, $type, $t1min, $t2min, $t1max, $t2max, $coment, $creator, $level = 1, $stavka, $blood = 0) {
global $user;
if((int)$level < 1 || (int)$level > 5) return "Ошибка...";
if($level == 1 && ($type != 1 && $type != 4)) { $type = 1; }
if($level == 2 && ($type != 1 && $type != 4 && $type != 6)) { $type = 1; }
if($level == 4 && ($type != 2 && $type != 4)) { $type = 2; }
if($level == 5 && ($type != 3 && $type != 5)) { $type = 3; }
if(!in_array($start, [3,5,10,15,30,45,60])) {$start = 10;}
if(!in_array($timeout, [3,4,5,7,10])) {$timeout = 3;}
if($this->ustatus($creator) != 0) { exit(); }
$owntravma = mysql_fetch_array(mysql_query("SELECT `type`, `id`, `sila`, `lovk`, `inta` FROM `effects` WHERE `owner` = ".$creator." AND (`type` = 12 OR `type` = 13)"));
if($owntravma) {
switch($owntravma['type']) {
case ($owntravma['type'] == 12 && ($type != 4 && $type != 5)): return "У Вас средняя травма, поединки с оружием слишком тяжелы для Вас..."; break;
case 13: return "У Вас тяжелая травма, Вы не сможети драться..."; break;
}
}
if(!$user['klan'] && $t1min == 99) {return "Вы не состоите в клане.";}
if($user['hp'] < $user['maxhp']*0.33) {return "Вы слишком ослаблены для боя, восстановитесь.";}
if ($type == 3){
$fp = fopen ("tmp/chat.txt","a"); //открытие
flock ($fp,LOCK_EX); //БЛОКИРОВКА ФАЙЛА
fputs($fp ,"\r\n:[".time ()."]:[!sys2all!!]:[ Внимание! Подана заявка на хаотический поединок (".$t1min."-".$t1max.") начнется через ".$start." минут.]:[1]\r\n"); //работа с файлом
fflush ($fp); //ОЧИЩЕНИЕ ФАЙЛОВОГО БУФЕРА И ЗАПИСЬ В ФАЙЛ
flock ($fp,LOCK_UN); //СНЯТИЕ БЛОКИРОВКИ
fclose ($fp); //закрытие
}
$start = time()+$start*60;
$stavka = round($stavka, 2);
mysql_query("INSERT INTO `zayavka`
(`start`, `timeout`, `t1c`, `t2c`, `type`, `level`, `coment`, `team1`, `stavka`, `t1min`, `t2min`, `t1max`, `t2max`,`podan`,`blood`) values
({$start},{$timeout},{$t1c},{$t2c},{$type},{$level},'{$coment}','{$creator};','{$stavka}',{$t1min}, {$t2min}, {$t1max}, {$t2max}, '".date("H:i")."', '{$blood}');");
mysql_query("UPDATE `users` SET `zayavka` = ".mysql_insert_id()." WHERE `id` = {$creator} LIMIT 1");
}
function delzayavka($id, $zay, $r, $f = 1) {
$z = $this->getlist($r, null, $zay);
if($f != 1) {
if($z[$zay]['level'] > 3) {return 'Ай-ай-ай!';}
}
if(mysql_query("DELETE FROM `zayavka` WHERE `id` = {$zay} AND (`team1` LIKE '{$id};%' OR `team2` LIKE '{$id};%') LIMIT 1")) {
if(count($z[$zay]['team1']) > 0) {
foreach($z[$zay]['team1'] as $k => $v) {
mysql_query("UPDATE `users` SET `zayavka` = 0 WHERE `id` = {$v}");
}
}
if(count($z[$zay]['team2']) > 0) {
foreach($z[$zay]['team2'] as $k => $v) {
mysql_query("UPDATE `users` SET `zayavka` = 0 WHERE `id` = {$v}");
}
}
return 'Вы отозвали заявку.';
}
}
function showfiz($row) {
global $user;
$rr = "{$row['podan']} ";
foreach($row['team1'] as $k => $v) {
$rr .= nick::id($v)->full(1);
}
if($row['team2']) {
$rr .= " против ";
foreach($row['team2'] as $k => $v) {
$rr .= nick::id($v)->full(1);
}
}
$rr .= " тип боя: ";
if($row['type'] == 4) {
$rr .= " ";
} elseif($row['type'] == 6) {
$rr .= " ";
} elseif($row['type'] == 1) {
$rr .= " ";
}
$rr .= " (таймаут {$row['timeout']} мин.)
";
return $rr;
}
function showgroup($row) {
if($row['t1min'] == 99) {
$range1 = "клан";
} else {
$range1 = "{$row['t1min']}-{$row['t1max']}";
}
if($row['t2min'] == 99) {
$range2 = "клан";
} else {
$range2 = "{$row['t2min']}-{$row['t2max']}";
}
$rr = "{$row['podan']} {$row['t1c']}({$range1}) (";
foreach($row['team1'] as $k => $v) {
if($k != 0) { $rr .= ", "; }
$rr .= nick::id($v)->full(1);
}
$rr .= ") против {$row['t2c']}({$range2})(";
foreach($row['team2'] as $k => $v) {
if($k != 0) { $rr .= ", "; }
$rr .= nick::id($v)->full(1);
}
if(count($row['team2']) ==0) { $rr .= "группа не набрана"; }
if($row['blood'] && $row['type'] == 5) {
$rr .= "";
}
$ali = mysql_fetch_array(mysql_query("SELECT `align` FROM `users` WHERE `id` = '{$user['id']}' LIMIT 1"));
$rr .= ") тип боя: ";
if($row['blood'] && $row['type'] == 4) {
$rr .= "";
} elseif($row['blood'] && $row['type'] == 2) {
$rr .= "";
} elseif($row['type'] == 2) {
$rr .= "";
} elseif($row['type'] == 4) {
$rr .= "";
}
$rr .= "(таймаут {$row['timeout']} мин.) бой начнется через ".round(($row['start']-time())/60, 1)." мин. ".(($row['coment'])?"(".$row['coment'].")":"")."";
if(($ali['align'] > 1.4 && $ali['align'] < 2) || ($ali['align'] > 2 && $ali['align'] < 3)) {
$rr .= "
";
} else {
$rr .= "
";
}
return $rr;
}
function showhaos($row) {
global $user;
$rs = '';
$rr = "{$row['podan']} (";
if($row['bots'] == '7') {
$rr .= nick::id(10962)->full(1); $rr .= ", ";
$rr .= nick::id(10964)->full(1); $rr .= ", ";
$rr .= nick::id(10965)->full(1); $rr .= ", ";
} elseif($row['bots'] == '8' || $row['bots'] == '13') {
$rr .= nick::id(10124)->full(1); $rr .= ", ";
$rr .= nick::id(10125)->full(1); $rr .= ", ";
$rr .= nick::id(10126)->full(1); $rr .= ", ";
}
foreach($row['team1'] as $k => $v) {
if($k != 0) {
$rr .= ", ";
}
$rr .= nick::id($v)->full(1);
}
if(count($row['team1']) == 0 && $row['bots'] == 0) { $rr.= "группа не набрана"; }
$rr .= ") ({$row['t1min']}-{$row['t1max']}) тип боя: ";
if ($row['blood'] && $row['type'] == 5) {
$rr .= "";
} elseif($row['blood'] && $row['type'] == 3) {
$rr .= "";
} elseif($row['type'] == 3) {
$rr .= "";
} elseif($row['type'] == 5) {
$rr .= "";
}
$rr .= "(таймаут {$row['timeout']} мин.) бой начнется через ".round(($row['start']-time())/60,1)." мин. ".(($row['coment'])?"(".$row['coment'].")":"")."";
if($user['align'] == '2.99') {
$rsr = ' Удалить заявку';
} else {
$rsr = '';
}
if(($user['align'] > 1.4 && $user['align'] < 2) || ($user['align'] > 2 && $user['align'] < 3)) {
$rr .= "$rsr
";
} else {
$rr .= "
";
}
return $rr;
}
function ustatus($id) {
$fict = mysql_fetch_array(mysql_query("SELECT * FROM `zayavka`, `users` WHERE `users`.`id` = '".$id."' AND `zayavka`.`id` = `users`.`zayavka` LIMIT 1"));
$t1 = $this->fteam($fict['team1']);
$t2 = $this->fteam($fict['team2']);
if(in_array($id, $t1)) {
return 1;
} elseif(in_array($id, $t2)) {
return 2;
} else {
return 0;
}
}
function battlestart($id, $zay, $r) {
global $user;
$z = $this->getlist($r, null, $zay);
if($id == 'CHAOS') { $id = $z[$zay]['team1'][0]; }
$this->delzayavka($id, $zay, $r);
$z = $z[$zay];
$count_users = count($z['team1']);
$bot = 0;
if($z['bots'] > 0 && $count_users > 0) {
$bots_raw = array(7 => array(10962, 10964, 10965), 8 => array(10124, 10125, 10126), 13 => array(10124, 10125, 10126));
$i = 0;
while($i <= count($bots_raw[$z['bots']])) {
$bot_id = $bots_raw[$z['bots']][$i];
$bot = createbot($bot_id, '');
$z['team1'][] = $bot['id'];
$i++;
$count_users++;
}
}
if($z['type'] == 4 || $z['type'] == 5) {
foreach($z['team1'] as $k => $v) {
undressall($v);
}
foreach($z['team2'] as $k => $v) {
undressall($v);
}
}
if($z['level'] == 2) {
$btfl = fopen(''.$z['team1'][0].'.btl', 'a');
fwrite($btfl, '{[='.$z['team2'][0].'=]}');
fclose($btfl);
$btfl = fopen(''.$z['team2'][0].'.btl', 'a');
fwrite($btfl, '{[='.$z['team1'][0].'=]}');
fclose($btfl);
}
if($z['type'] == 3 || $z['type'] == 5) {
if($count_users < 4) {
mysql_query("UPDATE `users` SET `zayavka` = 0 WHERE `zayavka` = '".$zay."'");
foreach($z['team1'] as $k => $v) {
if($v < _BOTSEPARATOR_) {
addchp('Внимание! Ваш бой не может начаться по причине Группа не набрана.', '{[]}'.nick::id($v)->short().'{[]}');
die('Bitch');
}
}
mysql_query("UPDATE `variables` SET `value` = '{$count_users}}' WHERE `var` = 'haos_match' LIMIT 1");
mysql_query("DELETE FROM `zayavka` WHERE `id` = '".$zay."' LIMIT 1");
header("Location: zayavka.php");
}
$all = count($z['team1'])-1;
$power1 = 0; $power2 = 0;
for($i = 0; $i <= $all; $i++) {
if($z['team1'][$i] < _BOTSEPARATOR_) {
$gamer = mysql_fetch_array(mysql_query("SELECT (`level`*50)+`sila`+`lovk`+`inta`+`vinos`+`intel`+`stats`+IFNULL((SELECT SUM(`cost`) FROM `inventory` WHERE `owner` = `users`.`id` AND `dressed` = 1), 0) FROM `users` WHERE `id` = '".$z['team1'][$i]."' LIMIT 1"));
} else {
$bt = mysql_fetch_array(mysql_query('SELECT `id`, `prototype` FROM `bots` WHERE `id` = "'.$z['team1'][$i].'"'));
$gamer = mysql_fetch_array(mysql_query("SELECT (`level`*50)+`sila`+`lovk`+`inta`+`vinos`+`intel`+`stats`+IFNULL((SELECT SUM(`cost`) FROM `inventory` WHERE `owner` = `users`.`id` AND `dressed` = 1), 0) FROM `users` WHERE `id` = '".$bt['prototype']."' LIMIT 1"));
}
$cost[] = array($z['team1'][$i], $gamer[0]);
}
$z['team1'] = null;
$z['team2'] = null;
$flag = true;
while($flag) {
$flag = false;
for($ii = 0; $ii <= $all-1; $ii++) {
if($cost[$ii][1] < $cost[$ii+1][1]) {
$ctr = $cost[$ii+1];
$cost[$ii+1] = $cost[$ii];
$cost[$ii] = $ctr;
$flag = true;
}
}
}
while(count($cost) > 0) {
if($power1 <= $power2) {
$tmp = array_shift($cost);
$power1 += $tmp[1];
$z['team1'][] = $tmp[0];
} else {
$tmp = array_shift($cost);
$power2 += $tmp[1];
$z['team2'][] = $tmp[0];
}
}
}
$teams = array();
foreach($z['team1'] as $k => $v) {
foreach($z['team2'] as $kk => $vv) {
$teams[$v][$vv] = array(0, 0, time());
}
}
foreach($z['team2'] as $k => $v) {
foreach($z['team1'] as $kk => $vv) {
$teams[$v][$vv] = array(0, 0, time());
}
}
if(count($z['team2']) == 0) {
mysql_query("UPDATE `users` SET `zayavka` = 0 WHERE `zayavka` = '".$zay."'");
foreach($z['team1'] as $k => $v) {
addchp('Внимание! Ваш бой не может начаться по причине "Группа не набрана".', '{[]}'.nick::id($v)->short().'{[]}');
}
mysql_query("DELETE FROM `zayavka` WHERE `id` = '".$zay."' LIMIT 1");
header("Location: zayavka.php");
die();
}
if($z['timeout'] == 3 || $z['timeout'] == 4 || $z['timeout'] == 5 || $z['timeout'] == 7 || $z['timeout'] == 10) {
} else {
$z['timeout'] = 3;
}
if(count($teams) > 1) {
if($z['type'] == 1 || $z['type'] == 4) {
$rs = ', `fiz`'; $rss = ', 1';
} else {
$rs = ''; $rss = '';
}
mysql_query("INSERT INTO `battle` (`coment`, `teams`, `timeout`, `type`, `status`, `t1`, `t2`, `to1`, `to2`, `blood`$rs, `bots`) VALUES ('{$z['coment']}', '".serialize($teams)."', '{$z['timeout']}', '{$z['type']}', '0', '".implode(";", $z['team1'])."', '".implode(";", $z['team2'])."', '".time()."', '".time()."', '".$z['blood']."'$rss, '".$z['bots']."')");
$id = mysql_insert_id();
$rr = "";
foreach($z['team1'] as $k => $v) {
if($k != 0) { $rr .= ", "; }
$rr .= nick::id($v)->full(1);
addchp('Внимание! Ваш бой начался!
\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ', '{[]}'.nick::id($v)->short().'{[]}');
}
$rr .= " и ";
foreach($z['team2'] as $k => $v) {
if($k != 0) { $rr .= ", "; }
$rr .= nick::id($v)->full(1);
addchp('Внимание! Ваш бой начался!
\'; top.frames[\'main\'].location=\'fbattle.php\'; var z = \' ', '{[]}'.nick::id($v)->short().'{[]}');
}
$rr .= "";
addlog($id, "Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу.
");
foreach($z['team1'] as $k => $v) {
if($v < _BOTSEPARATOR_) {
mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id` = {$v}");
} else {
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$v}");
}
}
foreach($z['team2'] as $k => $v) {
if($v < _BOTSEPARATOR_) {
mysql_query("UPDATE `users` SET `battle` = {$id}, `zayavka` = 0 WHERE `id` = {$v}");
} else {
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$v}");
}
}
if($bot) {
mysql_query("UPDATE `bots` SET `battle` = '$id' WHERE `id` = '$bot[id]'");
}
}
if($user['zayavka'] == $zay) {
die("");
}
}
}
$zay = new zayavka;
header("Cache-Control: no-cache");
if($_POST['open']) {
$f = fopen("/tmp/zayavka/".$user['id'].".txt", "w+");
fputs($f, time());
fclose($f);
}
?>
if($user['room'] != 1 && $user['room'] != 2 && $user['room'] != 3 && $user['room'] != 4 &&
$user['room'] != 5 && $user['room'] != 6 && $user['room'] != 7 && $user['room'] != 9 &&
$user['room'] != 10 && $user['room'] != 15 && $user['room'] != 16 && $user['room'] != 19 &&
$user['room'] != 8 && $user['room'] != 101 && !$_REQUEST['tklogs'] && !$_REQUEST['logs']) {
echo "
| '; echo ' | |
'; if ($z = $zay->getlist(1)) foreach ($z as $k=>$v) { echo $zay->showfiz( $v ); } echo ' |
';
if( $zay->ustatus($user['id'])==0 ) {
echo '';
}
$z = $zay->getlist(2,null,$user['zayavka']);
if( $zay->ustatus($user['id'])==1 ) {
if(count($z[$user['zayavka']]['team2'])>0){
echo "Внимание! ".nick::id($z[$user['zayavka']]['team2'][0])->full(1)." принял заявку на бой, нужно отказать или принять вызов. ";
}
else {
if ($z[$user['zayavka']]['level'] == 2) {
echo "Заявка на бой подана, ожидаем противника. ";
$Path="/tmp/zayavka/".$user['id'].".txt";
$f=fopen($Path,"r");
$timeFigth=fread($f, filesize($Path));
fclose($f);
if($timeFigth < time() && ($user['level'] <= 14)) {
if($_GET['trainstart'] == 1 && $user['hp'] > $user['maxhp']*0.33 && ($user['level'] <= 7 || $user['align'] == 2.99)) {
unlink("/tmp/zayavka/".$user['id'].".txt");
$zay->delzayavka ($user['id'], $user['zayavka'], 2,0);
mysql_query("INSERT INTO `bots` (`name`, `prototype`, `battle`, `hp`) values ('".$user['login']." (Клон 1)','".$user['id']."','','".$user['maxhp']."');");
$bot = mysql_insert_id();
$teams = array();
$teams[$user['id']][$bot] = array(0, 0, time());
$teams[$bot][$user['id']] = array(0, 0, time());
mysql_query("INSERT INTO `battle`
(`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`, `clone`
)
VALUES
('".serialize($teams)."','3','1','0','".$user['id']."','".$bot."','".time()."','".time()."', 1
)");
$id = mysql_insert_id();
mysql_query("UPDATE `bots` SET `battle` = {$id} WHERE `id` = {$bot} LIMIT 1");
$rr = "".nick::id($user['id'])->full(1)." и ".nick::id($bot)->full(1)."";
addlog($id,"Часы показывали ".date("Y.m.d H.i").", когда ".$rr." бросили вызов друг другу. "); mysql_query("UPDATE users SET `battle` ={$id},`zayavka`=0 WHERE `id`= {$user['id']};"); die(""); } $Path="/tmp/zayavka/".$user['id'].".txt"; $f=fopen($Path,"r"); $timeFigth=fread($f, filesize($Path)); fclose($f); if($user['level'] < 7 || $user['align'] == 2.99) { echo " или "; } } } } } if( $zay->ustatus($user['id'])==2 ) { if ($z[$user['zayavka']]['level'] == 2) echo "Ожидаем подтверждения боя. "; } echo ' |
Подать заявку на групповой бойНачало боя через ТаймаутВаша команда бойцов '; if($user['room']!=101) echo'Уровни союзников '; else echo''; echo' Противники бойцов '; if($user['room']!=101) echo'Уровни противников '; else echo''; echo' '; if($user['room']!=101) echo' Кулачный бой Бой без правил (проигравшая сторона получает инвалидность) '; if($user['room']==101) echo' Деньги кр. Опыт единиц '; echo'Комментарий к бою |
';
$z = $zay->getlist(4,null,$_POST['gocombat']);
echo "Ожидаем начала группового боя... Бой начнется через: ".round(($z[$_POST['gocombat']]['start']-time())/60,1)." мин."; echo ' |
Группа 1: Максимальное кол-во: '.$z[$_POST['gocombat']]['t1c'].' Ограничения по уровню: '.($z[$_POST['gocombat']]['t1min']==99?'клан':$z[$_POST['gocombat']]['t1min']." - ".$z[$_POST['gocombat']]['t1max']).' | Группа 2: Максимальное кол-во: '.$z[$_POST['gocombat']]['t2c'].' Ограничения по уровню: '.($z[$_POST['gocombat']]['t2min']==99?'клан':$z[$_POST['gocombat']]['t2min']." - ".$z[$_POST['gocombat']]['t2max']).' | |||||||
';
foreach( $z[$_POST['gocombat']]['team1'] as $k=>$v ) {
if ($k!=0) $rr.=" "; echo nick::id($v)->full(1); } echo ' | ';
foreach( $z[$_POST['gocombat']]['team2'] as $k=>$v ) {
if ($k!=0) $rr.=" "; echo nick::id($v)->full(1); } echo ' | |||||||
'; else echo' | Силы Хаоса | '; } else echo 'Войдите в комнату "Противостояние", чтобы принять эту заявку! | ';} else { if(($user['align']==6)||($user['align']==2.1)||($user['align']==2.99)||(($user['align']>7)&&($user['align']<8))||($user['align']==2)) {echo '';}; if(($user['align']==2.1)||($user['align']==6)) {echo ' | ';}; }; if($user['room'] != 101) { if ($vs_test['versus']==0) {echo ' | ';} else echo ' | '; } else { if(($user['align']==2.2)||($user['align']==3)) {echo ' | ';}; if(($user['align']==3)||($user['align']==2.2)||($user['align']==2.99)||(($user['align']>7)&&($user['align']<8))||($user['align']==2)) { echo ' | '; }; }; echo ' |
';
if( $zay->ustatus($user['id'])==0 )
if(($user['room']==101) && ($user['align'] != 2.2) && ($user['align'] != 2.1))
{
echo " Бой начнется через: ".round(($z[$user['zayavka']]['start']-time())/60,1)." мин."; } } echo ' |
';
if( $zay->ustatus($user['id'])==0 ) {
echo 'Хаотичный бой - разновидность группового, где группы формируются автоматически. Бой не начнется, если собралось меньше 4-х человек. ';
}
if( $zay->ustatus($user['id'])!=0) {
$z = $zay->getlist(5,null,$user['zayavka']);
if ($z[$user['zayavka']]['level'] == 5)
echo "Ожидаем начала группового боя... Бой начнется через: ".round(($z[$user['zayavka']]['start']-time())/60,1)." мин."; } echo ' |
« Предыдущий день | Записи о завершенных боях за '.(($_REQUEST['logs']!=1)?"{$_REQUEST['logs']}":"".date("d.m.y")).' |
Следующий день » |
Показать только бои персонажа: за |