Помощь по скриптам | Арена заварушка
Всем привет. Вобщем нужна ваша помощь. На арене не отображается противник и не идет опыт персонажу. Если кто сможет исправте. С меня +
<?php
require_once ('system/func.php');
$title = 'Сражения';
require_once ('system/header.php');
auth(); // Закроем от гостей
# Настройки #
$id = abs(intval($_GET['id']));
if($id)$profile = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."'"));
else $profile = $user;
$clan = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$profile[id_clan]."'"));
$user['max_health']=$user['max_health']+($clan['clan_hel']);
$batle = mysql_query("SELECT * FROM `arena` WHERE `id_user` = '".$myID."' ORDER BY `id` LIMIT 1");
$batle = mysql_fetch_array($batle);
if(!$batle){
mysql_query("INSERT INTO `arena` SET `id_user` = '$user[id]', `last` = '".time()."'");
header('Location: /arena');
exit();
}
if(isset($_GET['max_energy']) == true and $batle['last'] <= time()){
$_hp = ceil($user['max_health']*10/100);
if($user['energy'] < 1 or $user['gold'] < 1 or $user['health'] < $_hp){
$_SESSION['msg'] = "Для нападения необходимо минимум ".ico('icons','health.png')." 10% здоровья, ".ico('icons','energy.png')." 10 запаса сил и ".ico('icons','gold.png')." 15 золота!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить ".ico('icons','gold.png')." 1</a>";
header('Location: /arena?'.$random.'');
exit();
}else{
$koll = num($user['energy']/10);
$exp = 0;
$crystals = 0;
$win = 0;
$los = 0;
for($kolls = 1; $kolls <= $koll; $kolls++) {
$opponent = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$_GET['max_energy']."'"));
$_str = 0;
$_str_opp = 0;
for($round = 1; $round < num($user[energy]/10); $round++) {
## Это раз ##
$_str_1 = rand(round($user['str']/6), round($user['str']/4));
$_str_opp_1 = rand(round($opponent['str']/6), round($opponent['str']/4));
$_str_opp_1 -= rand(round($user['def']/12), round($user['def']/7));
$_str_1 -= rand(round($opponent['def']/12), round($opponent['def']/7));
if($_str_opp_1 < 0)$_str_opp_1 = 0;
if($_str_1 < 0)$_str_1 = 0;
## Это 2 ##
$_str += $_str_1;
$_str_opp += $_str_opp_1;
}
if($_str_1 > $_str_opp_1){
$exp += num(rand(1,3)*$opponent[level]);
$crystals += num(rand(3,5)*$opponent[level]);
$win += 1;
}else{
$exp += 1;
$crystals += 1;
$los += 1;
}
}
if($effect_2['on'] == 1)$exp = $exp+ceil($exp*15/100);
$exp = exp_koll($exp);
mysql_query("update `users` set
`exp` = '".($user['exp']+$exp)."',
`crystals` = '".($user['crystals']+$crystals)."',
`health` = '".($user['health']-$_str_opp)."',
`energy` = '".($user['energy']-$koll*10)."',
`gold` = '".($user['gold']-1)."'
where (`id` = '".$user['id']."')");
if($user[id_clan] > 0){
mysql_query("UPDATE `users` SET `clan_exp` = '".($user[clan_exp]+ceil($exp*5/100))."' WHERE `id` = '".$myID."' LIMIT 1");
mysql_query("UPDATE `clans` SET `exp` = `exp` + '".ceil($exp*5/100)."' WHERE `id` = '".$user[id_clan]."' LIMIT 1");
mysql_query("INSERT INTO `arena` SET `id_user` = '$myID', `tipe` = 'user', `uron` = '".$_str."', `time` = '".(time()+60)."', `id` = '$batle[last]'");
}
mysql_query("update `arena` set `last` = '".(time()+1)."' where (`id` = '".$batle['id']."')");
$_SESSION['msg'] = ico('icons','sum_stat.png')." <b class='info'>Проведено $round боев</b> ".ico('icons','sum_stat.png')."<br>
<font-size:28px;color:green'>Побед: <b>$win</b></font> | <font color='red'>Поражений: <b>$los</b></font><br>
Награда: ".ico('icons','exp.png')." ".n_f($exp)." опыта и ".ico('icons','crystal.png')." ".n_f($crystals)." серебра<br>
<div class='example3' style='text-align:center'><img src='images/other/koldun.png' class='example_beauty' style='width:100%;border-radius:8px'> <br/>
Здравствуй <b>$myLogin</b> я могу восстановить тебе ".ico('icons','health.png')." 100% здоровья и ".ico('icons','energy.png')." запасов сил.
<a href='/rinok?koldun&url=/arena?max_energy=$opponent[id]' class='link center'>Восстановить и провести бои ".ico('icons','gold.png')." 16</a></div>";
$_SESSION['itog'] = icons_user($myID)." <a>$user[login]</a> нанес $_str урона<br>".icons_user($opponent[id])." <a>$opponent[login]</a> нанес $_str_opp урона";
header('Location: /arena?'.$random.'');
exit();
}
}
if(isset($_GET['attack']) == true and $batle['last'] <= time()){
$_hp = ceil($user['max_health']*10/100);
if($user['health'] < 10 or $user['health'] < $_hp){
$_SESSION['msg'] = "Для нападения необходимо минимум ".ico('icons','health.png')." 10% здоровья!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить ".ico('icons','crystal.png')." ".($user[level]*500)."</a>";
header('Location: /arena');
exit();
}
}
if(isset($_GET['attack']) == true and $batle['last'] <= time()){
$_hp = ceil($user['max_health']*10/100);
if($user['energy'] < 10 or $user['health'] < $_hp){
$_SESSION['msg'] = "Для нападения необходимо минимум ".ico('icons','health.png')." 10% здоровья и ".ico('icons','energy.png')." 10 запаса сил!<br><a href='/rinok?koldun2&url=/arena' class='btn2' data-ajax>Восстановить ".ico('icons','gold.png')." ".($user[level]*5)."</a>";
header('Location: /arena');
exit();
}else{
mysql_query("update `users` set `energy` = '".($user['energy']-10)."' where (`id` = '".$user['id'].&
require_once ('system/func.php');
$title = 'Сражения';
require_once ('system/header.php');
auth(); // Закроем от гостей
# Настройки #
$id = abs(intval($_GET['id']));
if($id)$profile = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."'"));
else $profile = $user;
$clan = mysql_fetch_assoc(mysql_query("SELECT * FROM `clans` WHERE `id` = '".$profile[id_clan]."'"));
$user['max_health']=$user['max_health']+($clan['clan_hel']);
$batle = mysql_query("SELECT * FROM `arena` WHERE `id_user` = '".$myID."' ORDER BY `id` LIMIT 1");
$batle = mysql_fetch_array($batle);
if(!$batle){
mysql_query("INSERT INTO `arena` SET `id_user` = '$user[id]', `last` = '".time()."'");
header('Location: /arena');
exit();
}
if(isset($_GET['max_energy']) == true and $batle['last'] <= time()){
$_hp = ceil($user['max_health']*10/100);
if($user['energy'] < 1 or $user['gold'] < 1 or $user['health'] < $_hp){
$_SESSION['msg'] = "Для нападения необходимо минимум ".ico('icons','health.png')." 10% здоровья, ".ico('icons','energy.png')." 10 запаса сил и ".ico('icons','gold.png')." 15 золота!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить ".ico('icons','gold.png')." 1</a>";
header('Location: /arena?'.$random.'');
exit();
}else{
$koll = num($user['energy']/10);
$exp = 0;
$crystals = 0;
$win = 0;
$los = 0;
for($kolls = 1; $kolls <= $koll; $kolls++) {
$opponent = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '".$_GET['max_energy']."'"));
$_str = 0;
$_str_opp = 0;
for($round = 1; $round < num($user[energy]/10); $round++) {
## Это раз ##
$_str_1 = rand(round($user['str']/6), round($user['str']/4));
$_str_opp_1 = rand(round($opponent['str']/6), round($opponent['str']/4));
$_str_opp_1 -= rand(round($user['def']/12), round($user['def']/7));
$_str_1 -= rand(round($opponent['def']/12), round($opponent['def']/7));
if($_str_opp_1 < 0)$_str_opp_1 = 0;
if($_str_1 < 0)$_str_1 = 0;
## Это 2 ##
$_str += $_str_1;
$_str_opp += $_str_opp_1;
}
if($_str_1 > $_str_opp_1){
$exp += num(rand(1,3)*$opponent[level]);
$crystals += num(rand(3,5)*$opponent[level]);
$win += 1;
}else{
$exp += 1;
$crystals += 1;
$los += 1;
}
}
if($effect_2['on'] == 1)$exp = $exp+ceil($exp*15/100);
$exp = exp_koll($exp);
mysql_query("update `users` set
`exp` = '".($user['exp']+$exp)."',
`crystals` = '".($user['crystals']+$crystals)."',
`health` = '".($user['health']-$_str_opp)."',
`energy` = '".($user['energy']-$koll*10)."',
`gold` = '".($user['gold']-1)."'
where (`id` = '".$user['id']."')");
if($user[id_clan] > 0){
mysql_query("UPDATE `users` SET `clan_exp` = '".($user[clan_exp]+ceil($exp*5/100))."' WHERE `id` = '".$myID."' LIMIT 1");
mysql_query("UPDATE `clans` SET `exp` = `exp` + '".ceil($exp*5/100)."' WHERE `id` = '".$user[id_clan]."' LIMIT 1");
mysql_query("INSERT INTO `arena` SET `id_user` = '$myID', `tipe` = 'user', `uron` = '".$_str."', `time` = '".(time()+60)."', `id` = '$batle[last]'");
}
mysql_query("update `arena` set `last` = '".(time()+1)."' where (`id` = '".$batle['id']."')");
$_SESSION['msg'] = ico('icons','sum_stat.png')." <b class='info'>Проведено $round боев</b> ".ico('icons','sum_stat.png')."<br>
<font-size:28px;color:green'>Побед: <b>$win</b></font> | <font color='red'>Поражений: <b>$los</b></font><br>
Награда: ".ico('icons','exp.png')." ".n_f($exp)." опыта и ".ico('icons','crystal.png')." ".n_f($crystals)." серебра<br>
<div class='example3' style='text-align:center'><img src='images/other/koldun.png' class='example_beauty' style='width:100%;border-radius:8px'> <br/>
Здравствуй <b>$myLogin</b> я могу восстановить тебе ".ico('icons','health.png')." 100% здоровья и ".ico('icons','energy.png')." запасов сил.
<a href='/rinok?koldun&url=/arena?max_energy=$opponent[id]' class='link center'>Восстановить и провести бои ".ico('icons','gold.png')." 16</a></div>";
$_SESSION['itog'] = icons_user($myID)." <a>$user[login]</a> нанес $_str урона<br>".icons_user($opponent[id])." <a>$opponent[login]</a> нанес $_str_opp урона";
header('Location: /arena?'.$random.'');
exit();
}
}
if(isset($_GET['attack']) == true and $batle['last'] <= time()){
$_hp = ceil($user['max_health']*10/100);
if($user['health'] < 10 or $user['health'] < $_hp){
$_SESSION['msg'] = "Для нападения необходимо минимум ".ico('icons','health.png')." 10% здоровья!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить ".ico('icons','crystal.png')." ".($user[level]*500)."</a>";
header('Location: /arena');
exit();
}
}
if(isset($_GET['attack']) == true and $batle['last'] <= time()){
$_hp = ceil($user['max_health']*10/100);
if($user['energy'] < 10 or $user['health'] < $_hp){
$_SESSION['msg'] = "Для нападения необходимо минимум ".ico('icons','health.png')." 10% здоровья и ".ico('icons','energy.png')." 10 запаса сил!<br><a href='/rinok?koldun2&url=/arena' class='btn2' data-ajax>Восстановить ".ico('icons','gold.png')." ".($user[level]*5)."</a>";
header('Location: /arena');
exit();
}else{
mysql_query("update `users` set `energy` = '".($user['energy']-10)."' where (`id` = '".$user['id'].&
Arhidemon , здесь плюса мало будет кто захочет за него копатся в говнокоде этом
<?php
require_once ( 'system/func.php' );
$title = 'Сражения' ;
require_once ( 'system/header.php' );
auth (); // Закроем от гостей
# Настройки #
$id = abs ( intval ($_GET
[ 'id' ]));
if( $id )$profile = mysql_fetch_assoc
( mysql_query
( "SELECT * FROM `users` WHERE `id` = '" .
$id . "'" ));
else $profile = $user ;
$clan = mysql_fetch_assoc
( mysql_query
( "SELECT * FROM `clans` WHERE `id` = '" .
$profile [ id_clan ]. "'" ));
$user [ 'max_health' ]=$user
[ 'max_health' ]+( $clan
[ 'clan_hel' ]);
$batle = mysql_query
( "SELECT * FROM `arena` WHERE `id_user` = '" .
$myID . "' ORDER BY `id` LIMIT 1" );
$batle = mysql_fetch_array
( $batle );
if(! $batle){
mysql_query
( "INSERT INTO `arena` SET `id_user` = ' $user
[ id] ', `last` = '" . time
(). "'" );
header ( 'Location: /arena' );
exit();
}
if(isset( $_GET
[ 'max_energy' ]) == true and $batle
[ 'last' ] <= time ()){
$_hp = ceil( $user
[ 'max_health' ]*10/ 100 );
if( $user
[ 'energy' ] < 10 or $user
[ 'gold' ] < 1 or $user
[ 'health' ] < $_hp ){
$_SESSION
[ 'msg' ] = "Для нападения необходимо минимум " .ico
( 'icons' , 'health.png' ). " 10% здоровья, " .ico
( 'icons' , 'energy.png' ). " 10 запаса сил и " . ico
( 'icons' , 'gold.png' ). " 1 золота!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить " . ico
( 'icons' , 'gold.png' ). " 1</a>" ;
header ( 'Location: /arena?' .
$random .'' );
exit();
}else{
$koll = num ( $user
[ 'energy' ]/ 10 );
$exp = 0;
$crystals = 0 ;
$win = 0;
$los = 0;
for( $kolls = 1; $kolls <= $koll ; $kolls
++) {
$opponent = mysql_fetch_assoc
( mysql_query
( "SELECT * FROM `users` WHERE `id` = '" .
$_GET [ 'max_energy' ]. "'" ));
$_str = 0 ;
$_str_opp = 0 ;
for( $round = 1; $round < num
( $user [ energy ]/ 10); $round
++) {
## Это раз ##
$_str_1 = rand( round( $user
[ 'str' ]/ 6 ), round( $user
[ 'str' ]/ 4 ));
$_str_opp_1 = rand( round
( $opponent[ 'str' ]/ 6 ), round
( $opponent[ 'str' ]/ 4 ));
$_str_opp_1 -= rand ( round
( $user [ 'def' ]/ 12 ), round
( $user [ 'def' ]/ 7 ));
$_str_1 -= rand( round
( $opponent[ 'def' ]/ 12), round
( $opponent[ 'def' ]/ 7 ));
if( $_str_opp_1 < 0 ) $_str_opp_1 = 0 ;
if( $_str_1 < 0 )$_str_1 = 0 ;
## Это 2 ##
$_str += $_str_1 ;
$_str_opp += $_str_opp_1 ;
}
if( $_str_1 > $_str_opp_1 ){
$exp += num ( rand (1 , 3 )*
$opponent [level ]);
$crystals += num (rand ( 3, 5 )*
$opponent [level ]);
$win += 1 ;
}else{
$exp += 1 ;
$crystals += 1;
$los += 1 ;
}
}
if( $effect_2 ['on' ] == 1 ) $exp = $exp
+ ceil( $exp *25 /100 );
$exp = exp_koll ( $exp );
mysql_query
( "update `users` set
`exp` = '" .( $user
[ 'exp' ]+ $exp ). "',
`crystals` = '" .( $user
[ 'crystals' ]+ $crystals). "',
`health` = '" .( $user
[ 'health' ]- $_str_opp ). "',
`energy` = '" .( $user
[ 'energy' ]- $koll *10 ). "',
`gold` = '" .( $user
[ 'gold' ]- 1 ). "'
where (`id` = '" .$user
[ 'id' ]. "')");
if( $user [ id_clan ] > 0 ){
mysql_query
( "UPDATE `users` SET `clan_exp` = '" .( $user [ clan_exp ]+ ceil
( $exp * 15/ 100 )). "' WHERE `id` = '" .
$myID . "' LIMIT 1" );
mysql_query
( "UPDATE `clans` SET `exp` = `exp` + '" . ceil
( $exp * 15/ 100 ). "' WHERE `id` = '" .
$user [ id_clan ]. "' LIMIT 1" );
mysql_query
( "INSERT INTO `arena` SET `id_user` = ' $myID ', `tipe` = 'user', `uron` = '" .
$_str . "', `time` = '" .( time
()+ 60). "', `id` = ' $batle
[ last] '");
}
mysql_query
( "update `arena` set `last` = '" .( time
()+ 1 ). "' where (`id` = '" .
$batle [ 'id' ]. "')");
$_SESSION [ 'msg' ] = ico
( 'icons' , 'sum_stat.png' ). " <b class='info'>Проведено $round боев</b> " .ico
( 'icons' , 'sum_stat.png' ). "<br>
<font-size:28px;color:green'>Побед: <b>
$win </b></font> |<font color='red'>Поражений: <b>
$los </b></font><br>
Награда: " .ico
( 'icons' , 'exp.png' ). " " .n_f
( $exp ). " опыта и " . ico
( 'icons' , 'crystal.png' ). " " . n_f
( $crystals). " серебра<br>
<div class='example3' style='text-align:center'><img src='images/other/koldun.png' class='example_beauty' style='width:100%;border-radius:8px'> <br/>
Здравствуй <b> $myLogin </b> я могу восстановить тебе " . ico
( 'icons' , 'health.png' ). " 100% здоровья и " . ico
( 'icons' , 'energy.png' ). " запасов сил.
<a href='/rinok?koldun&url=/arena?max_energy= $opponent
[ id] ' class='link center'>Восстановить и провести бои " . ico
( 'icons' , 'gold.png' ). " 16</a></div>" ;
$_SESSION
[ 'itog' ] = icons_user
( $myID ). " <a> $user [ login] </a> нанес $_str урона<br>" .icons_user
( $opponent[ id]). " <a>
$opponent [login ]</a> нанес $_str_opp урона" ;
header ( 'Location: /arena?' .
$random .'' );
exit();
}
}
if(isset( $_GET
[ 'attack' ]) == true and $batle
[ 'last' ] <= time ()){
$_hp = ceil( $user
[ 'max_health' ]*10/ 100 );
if( $user
[ 'health' ] < 10 or $user
[ 'health' ] < $_hp ){
$_SESSION
[ 'msg' ] = "Для нападения необходимо минимум " .ico
( 'icons' , 'health.png' ). " 10% здоровья!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить " . ico
( 'icons' , 'crystal.png' ). " " .( $user [ level]*500 ). "</a>" ;
header ( 'Location: /arena' );
exit();
}
}
if(isset( $_GET
[ 'attack' ]) == true and $batle
[ 'last' ] <= time ()){
$_
require_once ( 'system/func.php' );
$title = 'Сражения' ;
require_once ( 'system/header.php' );
auth (); // Закроем от гостей
# Настройки #
$id = abs ( intval ($_GET
[ 'id' ]));
if( $id )$profile = mysql_fetch_assoc
( mysql_query
( "SELECT * FROM `users` WHERE `id` = '" .
$id . "'" ));
else $profile = $user ;
$clan = mysql_fetch_assoc
( mysql_query
( "SELECT * FROM `clans` WHERE `id` = '" .
$profile [ id_clan ]. "'" ));
$user [ 'max_health' ]=$user
[ 'max_health' ]+( $clan
[ 'clan_hel' ]);
$batle = mysql_query
( "SELECT * FROM `arena` WHERE `id_user` = '" .
$myID . "' ORDER BY `id` LIMIT 1" );
$batle = mysql_fetch_array
( $batle );
if(! $batle){
mysql_query
( "INSERT INTO `arena` SET `id_user` = ' $user
[ id] ', `last` = '" . time
(). "'" );
header ( 'Location: /arena' );
exit();
}
if(isset( $_GET
[ 'max_energy' ]) == true and $batle
[ 'last' ] <= time ()){
$_hp = ceil( $user
[ 'max_health' ]*10/ 100 );
if( $user
[ 'energy' ] < 10 or $user
[ 'gold' ] < 1 or $user
[ 'health' ] < $_hp ){
$_SESSION
[ 'msg' ] = "Для нападения необходимо минимум " .ico
( 'icons' , 'health.png' ). " 10% здоровья, " .ico
( 'icons' , 'energy.png' ). " 10 запаса сил и " . ico
( 'icons' , 'gold.png' ). " 1 золота!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить " . ico
( 'icons' , 'gold.png' ). " 1</a>" ;
header ( 'Location: /arena?' .
$random .'' );
exit();
}else{
$koll = num ( $user
[ 'energy' ]/ 10 );
$exp = 0;
$crystals = 0 ;
$win = 0;
$los = 0;
for( $kolls = 1; $kolls <= $koll ; $kolls
++) {
$opponent = mysql_fetch_assoc
( mysql_query
( "SELECT * FROM `users` WHERE `id` = '" .
$_GET [ 'max_energy' ]. "'" ));
$_str = 0 ;
$_str_opp = 0 ;
for( $round = 1; $round < num
( $user [ energy ]/ 10); $round
++) {
## Это раз ##
$_str_1 = rand( round( $user
[ 'str' ]/ 6 ), round( $user
[ 'str' ]/ 4 ));
$_str_opp_1 = rand( round
( $opponent[ 'str' ]/ 6 ), round
( $opponent[ 'str' ]/ 4 ));
$_str_opp_1 -= rand ( round
( $user [ 'def' ]/ 12 ), round
( $user [ 'def' ]/ 7 ));
$_str_1 -= rand( round
( $opponent[ 'def' ]/ 12), round
( $opponent[ 'def' ]/ 7 ));
if( $_str_opp_1 < 0 ) $_str_opp_1 = 0 ;
if( $_str_1 < 0 )$_str_1 = 0 ;
## Это 2 ##
$_str += $_str_1 ;
$_str_opp += $_str_opp_1 ;
}
if( $_str_1 > $_str_opp_1 ){
$exp += num ( rand (1 , 3 )*
$opponent [level ]);
$crystals += num (rand ( 3, 5 )*
$opponent [level ]);
$win += 1 ;
}else{
$exp += 1 ;
$crystals += 1;
$los += 1 ;
}
}
if( $effect_2 ['on' ] == 1 ) $exp = $exp
+ ceil( $exp *25 /100 );
$exp = exp_koll ( $exp );
mysql_query
( "update `users` set
`exp` = '" .( $user
[ 'exp' ]+ $exp ). "',
`crystals` = '" .( $user
[ 'crystals' ]+ $crystals). "',
`health` = '" .( $user
[ 'health' ]- $_str_opp ). "',
`energy` = '" .( $user
[ 'energy' ]- $koll *10 ). "',
`gold` = '" .( $user
[ 'gold' ]- 1 ). "'
where (`id` = '" .$user
[ 'id' ]. "')");
if( $user [ id_clan ] > 0 ){
mysql_query
( "UPDATE `users` SET `clan_exp` = '" .( $user [ clan_exp ]+ ceil
( $exp * 15/ 100 )). "' WHERE `id` = '" .
$myID . "' LIMIT 1" );
mysql_query
( "UPDATE `clans` SET `exp` = `exp` + '" . ceil
( $exp * 15/ 100 ). "' WHERE `id` = '" .
$user [ id_clan ]. "' LIMIT 1" );
mysql_query
( "INSERT INTO `arena` SET `id_user` = ' $myID ', `tipe` = 'user', `uron` = '" .
$_str . "', `time` = '" .( time
()+ 60). "', `id` = ' $batle
[ last] '");
}
mysql_query
( "update `arena` set `last` = '" .( time
()+ 1 ). "' where (`id` = '" .
$batle [ 'id' ]. "')");
$_SESSION [ 'msg' ] = ico
( 'icons' , 'sum_stat.png' ). " <b class='info'>Проведено $round боев</b> " .ico
( 'icons' , 'sum_stat.png' ). "<br>
<font-size:28px;color:green'>Побед: <b>
$win </b></font> |<font color='red'>Поражений: <b>
$los </b></font><br>
Награда: " .ico
( 'icons' , 'exp.png' ). " " .n_f
( $exp ). " опыта и " . ico
( 'icons' , 'crystal.png' ). " " . n_f
( $crystals). " серебра<br>
<div class='example3' style='text-align:center'><img src='images/other/koldun.png' class='example_beauty' style='width:100%;border-radius:8px'> <br/>
Здравствуй <b> $myLogin </b> я могу восстановить тебе " . ico
( 'icons' , 'health.png' ). " 100% здоровья и " . ico
( 'icons' , 'energy.png' ). " запасов сил.
<a href='/rinok?koldun&url=/arena?max_energy= $opponent
[ id] ' class='link center'>Восстановить и провести бои " . ico
( 'icons' , 'gold.png' ). " 16</a></div>" ;
$_SESSION
[ 'itog' ] = icons_user
( $myID ). " <a> $user [ login] </a> нанес $_str урона<br>" .icons_user
( $opponent[ id]). " <a>
$opponent [login ]</a> нанес $_str_opp урона" ;
header ( 'Location: /arena?' .
$random .'' );
exit();
}
}
if(isset( $_GET
[ 'attack' ]) == true and $batle
[ 'last' ] <= time ()){
$_hp = ceil( $user
[ 'max_health' ]*10/ 100 );
if( $user
[ 'health' ] < 10 or $user
[ 'health' ] < $_hp ){
$_SESSION
[ 'msg' ] = "Для нападения необходимо минимум " .ico
( 'icons' , 'health.png' ). " 10% здоровья!<br><a href='/rinok?koldun&url=/arena' class='btn2' data-ajax>Восстановить " . ico
( 'icons' , 'crystal.png' ). " " .( $user [ level]*500 ). "</a>" ;
header ( 'Location: /arena' );
exit();
}
}
if(isset( $_GET
[ 'attack' ]) == true and $batle
[ 'last' ] <= time ()){
$_