Файл: lib/zag.php
Строк: 98
<?php
if(!$uid){
header('Location: /index');
exit;
}
if(isMobile()){
mysql_query("UPDATE `l2_user` SET `user_agent`='mobile' WHERE `id`='$uid'");
}else{
mysql_query("UPDATE `l2_user` SET `user_agent`='pc' WHERE `id`='$uid'");
}
/** модули **/
require ($_SERVER['DOCUMENT_ROOT'].'/lib/level.php');
require ($_SERVER['DOCUMENT_ROOT'].'/lib/regen.php');
require ($_SERVER['DOCUMENT_ROOT'].'/lib/func.php');
/** **/
echo '<div class="head"><div class="zaglevel"><small><div class="zlevel">'.$user['level'].'</div></small></div>';
echo "<span style='float:right'><small>".cena($user['aden'])." <img src='/pic/adens.png' width='16'></small></span>";
echo "<strong> <a href='/pers'>$log</a></strong>";
if($user['admin']=='1'){echo " [<a href=/azone/>Админка</a>]";}
$ponl = time()+300;
mysql_query("UPDATE `l2_user` SET `online`='$ponl',`allonline`=`allonline`+'3' WHERE `id`='$uid'");
$cp = ($user['cp']/$user['cpall'])*100;
$hp = ($user['hp']/$user['hpall'])*100;
$mp = ($user['mp']/$user['mpall'])*100;
$vp = round(($user['vp']/$user['vpall'])*100, 2);
if($user['small_line']=='0'){
echo '</div>
<div class="status_style status_big" style="margin-bottom:1px; background-color:#54422C;">
<div class="status_in status_big">CP: '.$user['cp'].'/'.$user['cpall'].'</div>
<div class="status_style status_big" style="width:'.$cp.'%; background-color:#B68031;"></div>
</div>
<div class="status_style status_big" style="margin-bottom:1px; background-color:#7C3A48;">
<div class="status_in status_big">HP: '.$user['hp'].'/'.$user['hpall'].'</div>
<div class="status_style status_big" style="width:'.$hp.'%; background-color:#EC264C;"></div>
</div>
<div class="status_style status_big" style="margin-bottom:1px; background-color:#215C7A;">
<div class="status_in status_big">MP: '.$user['mp'].'/'.$user['mpall'].'</div>
<div class="status_style status_big" style="width:'.$mp.'%; background-color:#04A0DB;"></div>
</div><div class="status_style status_big" style="background-color:#666475;">
<div class="status_in status_big">VP: '.$vp.'%</div>
<div class="status_style status_big" style="width:'.$vp.'%; background-color:#04B431;"></div>
</div>
<div class="status_style status_big" style="margin-top:1px;background-color:#666475;">
<div class="status_in status_big">Опыт: '.$exp.'%</div>
<div class="status_style status_big" style="width:'.$exp.'%; background-color:#A388B7;"></div>
</div>';
}else{
echo '</div>
<div class="status_style status_mini" style="margin-bottom:1px; background-color:#54422C;">
<div class="status_style status_mini" style="width:'.$cp.'%; background-color:#B68031;"></div>
</div>
<div class="status_style status_mini" style="margin-bottom:1px; background-color:#7C3A48;">
<div class="status_style status_mini" style="width:'.$hp.'%; background-color:#EC264C;"></div>
</div>
<div class="status_style status_mini" style="margin-bottom:1px; background-color:#215C7A;">
<div class="status_style status_mini" style="width:'.$mp.'%; background-color:#04A0DB;"></div>
</div>
<div class="status_style status_mini" style="background-color:#666475;">
<div class="status_style status_mini" style="width:'.$vp.'%; background-color:#04B431;"></div>
</div>
<div class="status_style status_mini" style="margin-top:1px;background-color:#666475;">
<div class="status_style status_mini" style="width:'.$exp.'%; background-color:#A388B7;"></div>
</div>';
}
echo "<div class='head'>";
echo viewsession('new_lvl');
clearsession('new_lvl');
echo viewsession('win');
clearsession('win');
echo "</div>";
echo "</div><div class='main'>";
if($user['newpers']=='1'){
echo "<div class='warning s'><center><ul class='list'><li><a href='/savepers'>Сохранить персонажа</a></li></ul></center></div>";
}
if($user['hp']<='0'){
if($user['level']<'85'){
$delexp=($user['exp']/100)*2.5;
}else{
$delexp=($user['exp']/100)*10;
}
$reshp=$user['hpall']*0.75;
mysql_query("UPDATE `l2_user` SET `lose`=`lose`+'1',`exp`=`exp`-'$delexp',`hp`='$reshp' WHERE `id`='$uid'");
setsession("reshp", "<small>Вас убили. Вы потеряли ".number_format($delexp)." опыта. 75% Здоровья восстановлено</small><hr>");
}
echo viewsession('reshp');
clearsession('reshp');
echo viewsession('url_error');
clearsession('url_error');
if($_SERVER['SCRIPT_NAME']!=='/hundler.php' and $_SERVER['SCRIPT_NAME']!=='/battle.mob.php'){
$activ_battle = mysql_query("SELECT * FROM `l2_all_mobs` WHERE `user`='$uid'");
if(mysql_num_rows($activ_battle)>='1'){
$w = mysql_fetch_assoc($activ_battle);
$url_g = dsCrypt('mob'.$w['id']);
echo "<a href='/url_hundler/mob/?id=$url_g'>Бой с <font color=red>монстром</font></a><hr>";
}
}