From 1406f27cd62b3e1afc965f0f3b94b4b0d1eca989 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sat, 25 Jun 2022 16:02:04 +0300
Subject: [PATCH 01/12] Closes #10.

---
 modules_data/titul.php | 1870 ++++++++++++++++++++--------------------
 1 file changed, 922 insertions(+), 948 deletions(-)

diff --git a/modules_data/titul.php b/modules_data/titul.php
index 4137bb30..d7e866fd 100644
--- a/modules_data/titul.php
+++ b/modules_data/titul.php
@@ -1,1040 +1,1014 @@
-<?
-				echo "
-				<script language='JavaScript'>
-				var elem = document.getElementById('se-pre-con');
-				elem.parentNode.removeChild(elem);
-				</script>
-				";
-				
-if(!defined('GAME'))
-{
-	die();
+<script language='JavaScript'>
+    var elem = document.getElementById('se-pre-con');
+    elem.parentNode.removeChild(elem);
+</script>
+
+<?php
+if (!defined('GAME')) {
+    die();
 }
-$sunduk1="i/titul/nagr1.gif";
-$sunduk2="i/titul/nagr2.gif";
-$sunduk3="i/titul/nagr3.gif";
-$sunduk4="i/titul/nagr4.gif";
-$sunduk5="i/titul/nagr5.gif";
-$ai=$u->achivInf($u->info['id'],1);
-if (isset($_GET['nagr']))
-{
-	//����� ������� zb
-	
-	if ($_GET['nagr']==11 && $ai['klaszb']>$ai['zb_n'] && $ai['zb_n']==0){
-		$u->rangup($u->info['id'],1,'zb');
-		$ai['zb_n']=1;
-		$i=0;
-		$colvo=5;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==12 && $ai['klaszb']>$ai['zb_n'] && $ai['zb_n']==1){
-		$u->rangup($u->info['id'],2,'zb');
-		$ai['zb_n']=2;
-		$i=0;
-		$colvo=20;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==13 && $ai['klaszb']>$ai['zb_n'] && $ai['zb_n']==2){
-		$u->rangup($u->info['id'],3,'zb');
-		$ai['zb_n']=3;
-		$i=0;
-		$colvo=40;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==14 && $ai['klaszb']>$ai['zb_n'] && $ai['zb_n']==3){
-		$u->rangup($u->info['id'],4,'zb');
-		$ai['zb_n']=4;
-		$i=0;
-		$colvo=60;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==15 && $ai['klaszb']>$ai['zb_n'] && $ai['zb_n']==4){
-		$u->rangup($u->info['id'],5,'zb');
-		$ai['zb_n']=5;
-		$i=0;
-		$colvo=100;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}
-	//���� ������� vx
-	elseif ($_GET['nagr']==21 && $ai['klasvx']>$ai['vx_n'] && $ai['vx_n']==0){
-		$u->rangup($u->info['id'],1,'vx');
-		$ai['vx_n']=1;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 25) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 25 ���.';
-	}elseif($_GET['nagr']==22 && $ai['klasvx']>$ai['vx_n'] && $ai['vx_n']==1){
-		$u->rangup($u->info['id'],2,'vx');
-		$ai['vx_n']=2;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 50 ���.';
-	}elseif($_GET['nagr']==23 && $ai['klasvx']>$ai['vx_n'] && $ai['vx_n']==2){
-		$u->rangup($u->info['id'],3,'vx');
-		$ai['vx_n']=3;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 75) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 75 ���.';
-	}elseif($_GET['nagr']==24 && $ai['klasvx']>$ai['vx_n'] && $ai['vx_n']==3){
-		$u->rangup($u->info['id'],4,'vx');
-		$ai['vx_n']=4;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 100) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 100 ���.';
-	}elseif($_GET['nagr']==25 && $ai['klasvx']>$ai['vx_n'] && $ai['vx_n']==4){
-		$u->rangup($u->info['id'],5,'vx');
-		$ai['vx_n']=5;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 200 ���.';
-	}
-	//������� ��������� snt 10/15/20/25/50
-		elseif ($_GET['nagr']==31 && $ai['klassnt']>$ai['snt_n'] && $ai['snt_n']==0){
-		$u->rangup($u->info['id'],1,'snt');
-		$ai['snt_n']=1;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 10) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 10 ���.';
-	}elseif($_GET['nagr']==32 && $ai['klassnt']>$ai['snt_n'] && $ai['snt_n']==1){
-		$u->rangup($u->info['id'],2,'snt');
-		$ai['snt_n']=2;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 25) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 25 ���.';
-	}elseif($_GET['nagr']==33 && $ai['klassnt']>$ai['snt_n'] && $ai['snt_n']==2){
-		$u->rangup($u->info['id'],3,'snt');
-		$ai['snt_n']=3;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 50 ���.';
-	}elseif($_GET['nagr']==34 && $ai['klassnt']>$ai['snt_n'] && $ai['snt_n']==3){
-		$u->rangup($u->info['id'],4,'snt');
-		$ai['snt_n']=4;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 75) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 75 ���.';
-	}elseif($_GET['nagr']==35 && $ai['klassnt']>$ai['snt_n'] && $ai['snt_n']==4){
-		$u->rangup($u->info['id'],5,'snt');
-		$ai['snt_n']=5;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 200���.';
-	}
-	//���� 8 ���. rp 5/10/15/20/25
-	elseif ($_GET['nagr']==41 && $ai['klasrp']>$ai['rp_n'] && $ai['rp_n']==0){
-		$u->rangup($u->info['id'],1,'rp');
-		$ai['rp_n']=1;
-		$i=0;
-		$colvo=5;
-		while($i<$colvo)
-		{
-			$u->addItem(10038,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ������ ��������� X'.$colvo;
-	}elseif($_GET['nagr']==42 && $ai['klasrp']>$ai['rp_n'] && $ai['rp_n']==1){
-		$u->rangup($u->info['id'],2,'rp');
-		$ai['rp_n']=2;
-		$i=0;
-		$colvo=7;
-		while($i<$colvo)
-		{
-			$u->addItem(10038,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ������ ��������� X'.$colvo;
-	}elseif($_GET['nagr']==43 && $ai['klasrp']>$ai['rp_n'] && $ai['rp_n']==2){
-		$u->rangup($u->info['id'],3,'rp');
-		$ai['rp_n']=3;
-		$i=0;
-		$colvo=10;
-		while($i<$colvo)
-		{
-			$u->addItem(10038,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ������ ��������� X'.$colvo;
-	}elseif($_GET['nagr']==44 && $ai['klasrp']>$ai['rp_n'] && $ai['rp_n']==3){
-		$u->rangup($u->info['id'],4,'rp');
-		$ai['rp_n']=4;
-		$i=0;
-		$colvo=12;
-		while($i<$colvo)
-		{
-			$u->addItem(10038,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ������ ��������� X'.$colvo;
-	}elseif($_GET['nagr']==45 && $ai['klasrp']>$ai['rp_n'] && $ai['rp_n']==4){
-		$u->rangup($u->info['id'],5,'rp');
-		$ai['rp_n']=5;
-		$i=0;
-		$colvo=15;
-		while($i<$colvo)
-		{
-			$u->addItem(10038,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ������ ��������� X'.$colvo;
-	}
-	//���� 9 ���. rn 5/10/20/40/60
-	elseif ($_GET['nagr']==51 && $ai['klasrn']>$ai['rn_n'] && $ai['rn_n']==0){
-		$u->rangup($u->info['id'],1,'rn');
-		$ai['rn_n']=1;
-		$i=0;
-		$colvo=5;
-		while($i<$colvo)
-		{
-			$u->addItem(10039,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ���������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==52 && $ai['klasrn']>$ai['rn_n'] && $ai['rn_n']==1){
-		$u->rangup($u->info['id'],2,'rn');
-		$ai['rn_n']=2;
-		$i=0;
-		$colvo=7;
-		while($i<$colvo)
-		{
-			$u->addItem(10039,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ���������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==53 && $ai['klasrn']>$ai['rn_n'] && $ai['rn_n']==2){
-		$u->rangup($u->info['id'],3,'rn');
-		$ai['rn_n']=3;
-		$i=0;
-		$colvo=9;
-		while($i<$colvo)
-		{
-			$u->addItem(10039,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ���������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==54 && $ai['klasrn']>$ai['rn_n'] && $ai['rn_n']==3){
-		$u->rangup($u->info['id'],4,'rn');
-		$ai['rn_n']=4;
-		$i=0;
-		$colvo=12;
-		while($i<$colvo)
-		{
-			$u->addItem(10039,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ���������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==55 && $ai['klasrn']>$ai['rn_n'] && $ai['rn_n']==4){
-		$u->rangup($u->info['id'],5,'rn');
-		$ai['rn_n']=5;
-		$i=0;
-		$colvo=15;
-		while($i<$colvo)
-		{
-			$u->addItem(10039,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ���������� ��������� X'.$colvo;
-	}
-	//���� 10 ���. rb 2/4/6/10/15
-	elseif ($_GET['nagr']==61 && $ai['klasrb']>$ai['rb_n'] && $ai['rb_n']==0){
-		$u->rangup($u->info['id'],1,'rb');
-		$ai['rb_n']=1;
-		$i=0;
-		$colvo=2;
-		while($i<$colvo)
-		{
-			$u->addItem(10040,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ��������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==62 && $ai['klasrb']>$ai['rb_n'] && $ai['rb_n']==1){
-		$u->rangup($u->info['id'],2,'rb');
-		$ai['rb_n']=2;
-		$i=0;
-		$colvo=4;
-		while($i<$colvo)
-		{
-			$u->addItem(10040,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ��������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==63 && $ai['klasrb']>$ai['rb_n'] && $ai['rb_n']==2){
-		$u->rangup($u->info['id'],3,'rb');
-		$ai['rb_n']=3;
-		$i=0;
-		$colvo=6;
-		while($i<$colvo)
-		{
-			$u->addItem(10040,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ��������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==64 && $ai['klasrb']>$ai['rb_n'] && $ai['rb_n']==3){
-		$u->rangup($u->info['id'],4,'rb');
-		$ai['rb_n']=4;
-		$i=0;
-		$colvo=10;
-		while($i<$colvo)
-		{
-			$u->addItem(10040,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ��������� ��������� X'.$colvo;
-	}elseif($_GET['nagr']==65 && $ai['klasrb']>$ai['rb_n'] && $ai['rb_n']==4){
-		$u->rangup($u->info['id'],5,'rb');
-		$ai['rb_n']=5;
-		$i=0;
-		$colvo=15;
-		while($i<$colvo)
-		{
-			$u->addItem(10040,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ��������� ��������� X'.$colvo;
-	}
-	
-	//������  pg 10/20/40/60/80
-	elseif ($_GET['nagr']==71 && $ai['klaspg']>$ai['pg_n'] && $ai['pg_n']==0){
-		$u->rangup($u->info['id'],1,'pg');
-		$ai['pg_n']=1;
-		$i=0;
-		$colvo=10;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==72 && $ai['klaspg']>$ai['pg_n'] && $ai['pg_n']==1){
-		$u->rangup($u->info['id'],2,'pg');
-		$ai['pg_n']=2;
-		$i=0;
-		$colvo=20;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==73 && $ai['klaspg']>$ai['pg_n'] && $ai['pg_n']==2){
-		$u->rangup($u->info['id'],3,'pg');
-		$ai['pg_n']=3;
-		$i=0;
-		$colvo=40;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==74 && $ai['klaspg']>$ai['pg_n'] && $ai['pg_n']==3){
-		$u->rangup($u->info['id'],4,'pg');
-		$ai['pg_n']=4;
-		$i=0;
-		$colvo=60;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}elseif($_GET['nagr']==75 && $ai['klaspg']>$ai['pg_n'] && $ai['pg_n']==4){
-		$u->rangup($u->info['id'],5,'pg');
-		$ai['pg_n']=5;
-		$i=0;
-		$colvo=80;
-		while($i<$colvo)
-		{
-			$u->addItem(10020,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� ����� ������ X'.$colvo;
-	}
-		//������� ������� ��������� ���� � ������ bv 500/1000/2000/4000/5000
-		elseif ($_GET['nagr']==81 && $ai['klasbv']>$ai['bv_n'] && $ai['bv_n']==0){
-		$u->rangup($u->info['id'],1,'bv');
-		$ai['bv_n']=1;
-		mysql_query('UPDATE `users` SET `money` = (`money` + 500) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 500 ��.';
-	}elseif($_GET['nagr']==82 && $ai['klasbv']>$ai['bv_n'] && $ai['bv_n']==1){
-		$u->rangup($u->info['id'],2,'bv');
-		$ai['bv_n']=2;
-		mysql_query('UPDATE `users` SET `money` = (`money` + 1000) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 1000 ��.';
-	}elseif($_GET['nagr']==83 && $ai['klasbv']>$ai['bv_n'] && $ai['bv_n']==2){
-		$u->rangup($u->info['id'],3,'bv');
-		$ai['bv_n']=3;
-		mysql_query('UPDATE `users` SET `money` = (`money` + 2000) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 2000 ��.';
-	}elseif($_GET['nagr']==84 && $ai['klasbv']>$ai['bv_n'] && $ai['bv_n']==3){
-		$u->rangup($u->info['id'],4,'bv');
-		$ai['bv_n']=4;
-		mysql_query('UPDATE `users` SET `money` = (`money` + 4000) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 4000 ��.';
-	}elseif($_GET['nagr']==85 && $ai['klasbv']>$ai['bv_n'] && $ai['bv_n']==4){
-		$u->rangup($u->info['id'],5,'bv');
-		$ai['bv_n']=5;
-		mysql_query('UPDATE `users` SET `money` = (`money` + 5000) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 5000 ��.';
-	}
-	//���� ���  kw 4917 
-	elseif ($_GET['nagr']==91 && $ai['klaskw']>$ai['kw_n'] && $ai['kw_n']==0){
-		$u->rangup($u->info['id'],1,'kw');
-		$ai['kw_n']=1;
-		$i=0;
-		$colvo=1;
-		while($i<$colvo)
-		{
-			$u->addItem(4917,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� �������� ���� +50000 X'.$colvo;
-	}elseif($_GET['nagr']==92 && $ai['klaskw']>$ai['kw_n'] && $ai['kw_n']==1){
-		$u->rangup($u->info['id'],2,'kw');
-		$ai['kw_n']=2;
-		$i=0;
-		$colvo=2;
-		while($i<$colvo)
-		{
-			$u->addItem(4917,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� �������� ���� +50000 X'.$colvo;
-	}elseif($_GET['nagr']==93 && $ai['klaskw']>$ai['kw_n'] && $ai['kw_n']==2){
-		$u->rangup($u->info['id'],3,'kw');
-		$ai['kw_n']=3;
-		$i=0;
-		$colvo=5;
-		while($i<$colvo)
-		{
-			$u->addItem(4917,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� �������� ���� +50000 X'.$colvo;
-	}elseif($_GET['nagr']==94 && $ai['klaskw']>$ai['kw_n'] && $ai['kw_n']==3){
-		$u->rangup($u->info['id'],4,'kw');
-		$ai['kw_n']=4;
-		$i=0;
-		$colvo=10;
-		while($i<$colvo)
-		{
-			$u->addItem(4917,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� �������� ���� +50000 X'.$colvo;
-	}elseif($_GET['nagr']==95 && $ai['klaskw']>$ai['kw_n'] && $ai['kw_n']==4){
-		$u->rangup($u->info['id'],5,'kw');
-		$ai['kw_n']=5;
-		$i=0;
-		$colvo=15;
-		while($i<$colvo)
-		{
-			$u->addItem(4917,$u->info['id'],'');
-			$i++;
-		}
-		$nagrtxt='�� ����������� ����������, �� �������� �������� ���� +50000 X'.$colvo;
-	}
-	
-		//����� ������ ������� bs
-	elseif ($_GET['nagr']==101 && $ai['klasbs']>$ai['bs_n'] && $ai['bs_n']==0){
-		$u->rangup($u->info['id'],1,'bs');
-		$ai['bs_n']=1;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 1) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 1 ���.';
-	}elseif($_GET['nagr']==102 && $ai['klasbs']>$ai['bs_n'] && $ai['bs_n']==1){
-		$u->rangup($u->info['id'],2,'bs');
-		$ai['bs_n']=2;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 5) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 5 ���.';
-	}elseif($_GET['nagr']==103 && $ai['klasbs']>$ai['bs_n'] && $ai['bs_n']==2){
-		$u->rangup($u->info['id'],3,'bs');
-		$ai['bs_n']=3;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 10) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 10 ���.';
-	}elseif($_GET['nagr']==104 && $ai['klasbs']>$ai['bs_n'] && $ai['bs_n']==3){
-		$u->rangup($u->info['id'],4,'bs');
-		$ai['bs_n']=4;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 50 ���.';
-	}elseif($_GET['nagr']==105 && $ai['klasbs']>$ai['bs_n'] && $ai['bs_n']==4){
-		$u->rangup($u->info['id'],5,'bs');
-		$ai['bs_n']=5;
-		mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		$nagrtxt='�� ����������� ����������, �� �������� 200 ���.';
-	}
-	//-------------
-	mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','".$u->info['login']."','".$nagrtxt."','-1','6','0')");
+$sunduk1 = "i/titul/nagr1.gif";
+$sunduk2 = "i/titul/nagr2.gif";
+$sunduk3 = "i/titul/nagr3.gif";
+$sunduk4 = "i/titul/nagr4.gif";
+$sunduk5 = "i/titul/nagr5.gif";
+$ai = $u->achivInf($u->info['id'], 1);
+if (isset($_GET['nagr'])) {
+    if ( //Это надо переписать полностью. Эта проверка - сраный костыль.
+        in_array($_GET['nagr'], [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]) &&
+        $u->info['level'] < 9
+    ) {
+        $nagrtxt = 'Вы не можете получить эту награду на этом уровне!';
+    } else
+
+        //бабка задание zb
+        if ($_GET['nagr'] == 11 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'zb');
+            $ai['zb_n'] = 1;
+            $i = 0;
+            $colvo = 5;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 12 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'zb');
+            $ai['zb_n'] = 2;
+            $i = 0;
+            $colvo = 20;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 13 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'zb');
+            $ai['zb_n'] = 3;
+            $i = 0;
+            $colvo = 40;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 14 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'zb');
+            $ai['zb_n'] = 4;
+            $i = 0;
+            $colvo = 60;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 15 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'zb');
+            $ai['zb_n'] = 5;
+            $i = 0;
+            $colvo = 100;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
+        } //Хаот задание vx
+        elseif ($_GET['nagr'] == 21 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'vx');
+            $ai['vx_n'] = 1;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 25) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 25 екр.';
+        } elseif ($_GET['nagr'] == 22 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'vx');
+            $ai['vx_n'] = 2;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 50 екр.';
+        } elseif ($_GET['nagr'] == 23 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'vx');
+            $ai['vx_n'] = 3;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 75) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 75 екр.';
+        } elseif ($_GET['nagr'] == 24 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'vx');
+            $ai['vx_n'] = 4;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 100) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 100 екр.';
+        } elseif ($_GET['nagr'] == 25 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'vx');
+            $ai['vx_n'] = 5;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 200 екр.';
+        } //Сундуки трупожора snt 10/15/20/25/50
+        elseif ($_GET['nagr'] == 31 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'snt');
+            $ai['snt_n'] = 1;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 10) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 10 екр.';
+        } elseif ($_GET['nagr'] == 32 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'snt');
+            $ai['snt_n'] = 2;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 25) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 25 екр.';
+        } elseif ($_GET['nagr'] == 33 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'snt');
+            $ai['snt_n'] = 3;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 50 екр.';
+        } elseif ($_GET['nagr'] == 34 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'snt');
+            $ai['snt_n'] = 4;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 75) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 75 екр.';
+        } elseif ($_GET['nagr'] == 35 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'snt');
+            $ai['snt_n'] = 5;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 200екр.';
+        } //Руны 8 лвл. rp 5/10/15/20/25
+        elseif ($_GET['nagr'] == 41 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'rp');
+            $ai['rp_n'] = 1;
+            $i = 0;
+            $colvo = 5;
+            while ($i < $colvo) {
+                $u->addItem(10038, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 42 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'rp');
+            $ai['rp_n'] = 2;
+            $i = 0;
+            $colvo = 7;
+            while ($i < $colvo) {
+                $u->addItem(10038, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 43 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'rp');
+            $ai['rp_n'] = 3;
+            $i = 0;
+            $colvo = 10;
+            while ($i < $colvo) {
+                $u->addItem(10038, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 44 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'rp');
+            $ai['rp_n'] = 4;
+            $i = 0;
+            $colvo = 12;
+            while ($i < $colvo) {
+                $u->addItem(10038, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 45 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'rp');
+            $ai['rp_n'] = 5;
+            $i = 0;
+            $colvo = 15;
+            while ($i < $colvo) {
+                $u->addItem(10038, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
+        } //Руны 9 лвл. rn 5/10/20/40/60
+        elseif ($_GET['nagr'] == 51 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'rn');
+            $ai['rn_n'] = 1;
+            $i = 0;
+            $colvo = 5;
+            while ($i < $colvo) {
+                $u->addItem(10039, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 52 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'rn');
+            $ai['rn_n'] = 2;
+            $i = 0;
+            $colvo = 7;
+            while ($i < $colvo) {
+                $u->addItem(10039, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 53 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'rn');
+            $ai['rn_n'] = 3;
+            $i = 0;
+            $colvo = 9;
+            while ($i < $colvo) {
+                $u->addItem(10039, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 54 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'rn');
+            $ai['rn_n'] = 4;
+            $i = 0;
+            $colvo = 12;
+            while ($i < $colvo) {
+                $u->addItem(10039, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 55 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'rn');
+            $ai['rn_n'] = 5;
+            $i = 0;
+            $colvo = 15;
+            while ($i < $colvo) {
+                $u->addItem(10039, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
+        } //Руны 10 лвл. rb 2/4/6/10/15
+        elseif ($_GET['nagr'] == 61 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'rb');
+            $ai['rb_n'] = 1;
+            $i = 0;
+            $colvo = 2;
+            while ($i < $colvo) {
+                $u->addItem(10040, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 62 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'rb');
+            $ai['rb_n'] = 2;
+            $i = 0;
+            $colvo = 4;
+            while ($i < $colvo) {
+                $u->addItem(10040, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 63 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'rb');
+            $ai['rb_n'] = 3;
+            $i = 0;
+            $colvo = 6;
+            while ($i < $colvo) {
+                $u->addItem(10040, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 64 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'rb');
+            $ai['rb_n'] = 4;
+            $i = 0;
+            $colvo = 10;
+            while ($i < $colvo) {
+                $u->addItem(10040, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
+        } elseif ($_GET['nagr'] == 65 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'rb');
+            $ai['rb_n'] = 5;
+            $i = 0;
+            $colvo = 15;
+            while ($i < $colvo) {
+                $u->addItem(10040, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
+        } //Героик  pg 10/20/40/60/80
+        elseif ($_GET['nagr'] == 71 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'pg');
+            $ai['pg_n'] = 1;
+            $i = 0;
+            $colvo = 10;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 72 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'pg');
+            $ai['pg_n'] = 2;
+            $i = 0;
+            $colvo = 20;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 73 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'pg');
+            $ai['pg_n'] = 3;
+            $i = 0;
+            $colvo = 40;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 74 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'pg');
+            $ai['pg_n'] = 4;
+            $i = 0;
+            $colvo = 60;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
+        } elseif ($_GET['nagr'] == 75 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'pg');
+            $ai['pg_n'] = 5;
+            $i = 0;
+            $colvo = 80;
+            while ($i < $colvo) {
+                $u->addItem(10020, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
+        } //Продать бабушке найденные вещи в пещере bv 500/1000/2000/4000/5000
+        elseif ($_GET['nagr'] == 81 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'bv');
+            $ai['bv_n'] = 1;
+            mysql_query('UPDATE `users` SET `money` = (`money` + 500) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 500 кр.';
+        } elseif ($_GET['nagr'] == 82 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'bv');
+            $ai['bv_n'] = 2;
+            mysql_query('UPDATE `users` SET `money` = (`money` + 1000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 1000 кр.';
+        } elseif ($_GET['nagr'] == 83 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'bv');
+            $ai['bv_n'] = 3;
+            mysql_query('UPDATE `users` SET `money` = (`money` + 2000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 2000 кр.';
+        } elseif ($_GET['nagr'] == 84 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'bv');
+            $ai['bv_n'] = 4;
+            mysql_query('UPDATE `users` SET `money` = (`money` + 4000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 4000 кр.';
+        } elseif ($_GET['nagr'] == 85 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'bv');
+            $ai['bv_n'] = 5;
+            mysql_query('UPDATE `users` SET `money` = (`money` + 5000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 5000 кр.';
+        } //Клан вар  kw 4917
+        elseif ($_GET['nagr'] == 91 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'kw');
+            $ai['kw_n'] = 1;
+            $i = 0;
+            $colvo = 1;
+            while ($i < $colvo) {
+                $u->addItem(4917, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
+        } elseif ($_GET['nagr'] == 92 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'kw');
+            $ai['kw_n'] = 2;
+            $i = 0;
+            $colvo = 2;
+            while ($i < $colvo) {
+                $u->addItem(4917, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
+        } elseif ($_GET['nagr'] == 93 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'kw');
+            $ai['kw_n'] = 3;
+            $i = 0;
+            $colvo = 5;
+            while ($i < $colvo) {
+                $u->addItem(4917, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
+        } elseif ($_GET['nagr'] == 94 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'kw');
+            $ai['kw_n'] = 4;
+            $i = 0;
+            $colvo = 10;
+            while ($i < $colvo) {
+                $u->addItem(4917, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
+        } elseif ($_GET['nagr'] == 95 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'kw');
+            $ai['kw_n'] = 5;
+            $i = 0;
+            $colvo = 15;
+            while ($i < $colvo) {
+                $u->addItem(4917, $u->info['id'], '');
+                $i++;
+            }
+            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
+        } //Башня смерти задание bs
+        elseif ($_GET['nagr'] == 101 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 0) {
+            $u->rangup($u->info['id'], 1, 'bs');
+            $ai['bs_n'] = 1;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 1) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 1 екр.';
+        } elseif ($_GET['nagr'] == 102 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 1) {
+            $u->rangup($u->info['id'], 2, 'bs');
+            $ai['bs_n'] = 2;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 5) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 5 екр.';
+        } elseif ($_GET['nagr'] == 103 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 2) {
+            $u->rangup($u->info['id'], 3, 'bs');
+            $ai['bs_n'] = 3;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 10) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 10 екр.';
+        } elseif ($_GET['nagr'] == 104 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 3) {
+            $u->rangup($u->info['id'], 4, 'bs');
+            $ai['bs_n'] = 4;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 50 екр.';
+        } elseif ($_GET['nagr'] == 105 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 4) {
+            $u->rangup($u->info['id'], 5, 'bs');
+            $ai['bs_n'] = 5;
+            mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            $nagrtxt = 'За выполненное достижение, Вы получили 200 екр.';
+        }
+    //-------------
+    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $nagrtxt . "','-1','6','0')");
 }
-	
+
 ?>
 
-<P align=right><INPUT class="btn" TYPE=button value="���������" onclick="window.open('/encicl/help/titul.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')">
-<INPUT TYPE="button" class="btn" onClick="top.frames['main'].location = 'main.php';" value="���������" name=edit></P>
-<H3>����������</H3>
+<P align=right><INPUT class="btn" TYPE=button value="Подсказка"
+                      onclick="window.open('/encicl/help/titul.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')">
+    <INPUT TYPE="button" class="btn" onClick="top.frames['main'].location = 'main.php';" value="Вернуться" name=edit>
+</P>
+<H3>Достижения</H3>
 
-<? $zd='zb';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>��������� ������� �����.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>��������� ������� �����.</title>
+<? $zd = 'zb'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Выполнить задания бабки.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Выполнить задания бабки.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">25</td>
-<td style="text-align: center;">50 </td>
-<td style="text-align: center;">100</td>
-<td style="text-align: center;">250</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">����� <br>������ <br>5</td>
-<td style="text-align: center;">����� <br>������ <br>20</td>
-<td style="text-align: center;">����� <br>������ <br>40</td>
-<td style="text-align: center;">����� <br>������ <br>60</td>
-<td style="text-align: center;">����� <br>������ <br>100</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Заданий</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">25</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">100</td>
+        <td style="text-align: center;">250</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">Жетон <br>успеха <br>5</td>
+        <td style="text-align: center;">Жетон <br>успеха <br>20</td>
+        <td style="text-align: center;">Жетон <br>успеха <br>40</td>
+        <td style="text-align: center;">Жетон <br>успеха <br>60</td>
+        <td style="text-align: center;">Жетон <br>успеха <br>100</td>
+    </tr>
 </table>
 </body>
 
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //����� �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=11\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>������ ������: 1</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=12\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>������ ������: 2</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=13\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>������ ������: 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=14\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>������ ������: 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=15\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>������ ������: 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Бабка задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=11\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>жетоны успеха: 1</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=12\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>жетоны успеха: 2</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=13\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>жетоны успеха: 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=14\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>жетоны успеха: 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=15\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>жетоны успеха: 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='vx';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>�������� � ����������� ����.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>�������� � ����������� ����.</title>
+<? $zd = 'vx'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Победить в хаотических боях.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Победить в хаотических боях.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�����</td>
-<td style="text-align: center;">50</td>
-<td style="text-align: center;">300</td>
-<td style="text-align: center;">400</td>
-<td style="text-align: center;">500</td>
-<td style="text-align: center;">1000</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">25 ���.</td>
-<td style="text-align: center;">50 ���.</td>
-<td style="text-align: center;">75 ���.</td>
-<td style="text-align: center;">100 ���.</td>
-<td style="text-align: center;">200 ���.</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">300</td>
+        <td style="text-align: center;">400</td>
+        <td style="text-align: center;">500</td>
+        <td style="text-align: center;">1000</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">25 екр.</td>
+        <td style="text-align: center;">50 екр.</td>
+        <td style="text-align: center;">75 екр.</td>
+        <td style="text-align: center;">100 екр.</td>
+        <td style="text-align: center;">200 екр.</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //���� �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=21\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>25 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=22\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>50 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=23\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>75 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=24\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>100 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=25\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>200 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Хаот задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=21\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>25 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=22\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>50 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=23\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>75 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=24\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>100 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=25\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>200 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='snt';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>������� ������ ���������.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>������� ������ ���������.</title>
+<? $zd = 'snt'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Открыть сундук трупожора.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Открыть сундук трупожора.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">��������</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">25</td>
-<td style="text-align: center;">50</td>
-<td style="text-align: center;">100</td>
-<td style="text-align: center;">250</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">10 ���.</td> 
-<td style="text-align: center;">25 ���.</td>
-<td style="text-align: center;">50 ���.</td>
-<td style="text-align: center;">75 ���.</td>
-<td style="text-align: center;">200 ���.</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Открытий</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">25</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">100</td>
+        <td style="text-align: center;">250</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">10 екр.</td>
+        <td style="text-align: center;">25 екр.</td>
+        <td style="text-align: center;">50 екр.</td>
+        <td style="text-align: center;">75 екр.</td>
+        <td style="text-align: center;">200 екр.</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //������ �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=31\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>10 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=32\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>25 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=33\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>50 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=34\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>75 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=35\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>200 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Сундук задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=31\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>10 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=32\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>25 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=33\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>50 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=34\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>75 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=35\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>200 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='rp';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>�������� ���� ��� ������ ������ ���������. ( S ���� )</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>�������� ���� ��� ������ ������ ���������. ( S ���� )</title>
+<? $zd = 'rp'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Получить руну при плавке плохих заготовок. ( S руну )</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Получить руну при плавке плохих заготовок. ( S руну )</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">���</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">10</td>
-<td style="text-align: center;">25</td>
-<td style="text-align: center;">50</td>
-<td style="text-align: center;">100</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td> 
-<td style="text-align: center;">������ <br> ��������� <br> 5</td> 
-<td style="text-align: center;">������ <br> ��������� <br> 7</td>
-<td style="text-align: center;">������ <br> ��������� <br> 10</td>
-<td style="text-align: center;">������ <br> ��������� <br> 12</td>
-<td style="text-align: center;">������ <br> ��������� <br> 15</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Рун</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">10</td>
+        <td style="text-align: center;">25</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">100</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">Плохие <br> заготовки <br> 5</td>
+        <td style="text-align: center;">Плохие <br> заготовки <br> 7</td>
+        <td style="text-align: center;">Плохие <br> заготовки <br> 10</td>
+        <td style="text-align: center;">Плохие <br> заготовки <br> 12</td>
+        <td style="text-align: center;">Плохие <br> заготовки <br> 15</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //S �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=41\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>������ ��������� 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=42\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>������ ��������� 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=43\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>������ ��������� 15</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=44\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>������ ��������� 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=45\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>������ ��������� 25</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //S задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=41\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Плохие заготовки 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=42\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Плохие заготовки 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=43\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Плохие заготовки 15</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=44\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Плохие заготовки 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=45\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Плохие заготовки 25</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='rn';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>�������� ���� ��� ������ ���������� ���������. ( M ���� )</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>�������� ���� ��� ������ ���������� ���������. ( M ���� )</title>
+<? $zd = 'rn'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Получить руну при плавке нормальных заготовок. ( M руну )</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Получить руну при плавке нормальных заготовок. ( M руну )</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">���</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">10</td>
-<td style="text-align: center;">15</td>
-<td style="text-align: center;">25</td>
-<td style="text-align: center;">50</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">���������� <br> ��������� <br> 5</td> 
-<td style="text-align: center;">���������� <br> ��������� <br> 7</td>
-<td style="text-align: center;">���������� <br> ��������� <br> 9</td>
-<td style="text-align: center;">���������� <br> ��������� <br> 12</td>
-<td style="text-align: center;">���������� <br> ��������� <br> 15</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Рун</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">10</td>
+        <td style="text-align: center;">15</td>
+        <td style="text-align: center;">25</td>
+        <td style="text-align: center;">50</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">Нормальные <br> заготовки <br> 5</td>
+        <td style="text-align: center;">Нормальные <br> заготовки <br> 7</td>
+        <td style="text-align: center;">Нормальные <br> заготовки <br> 9</td>
+        <td style="text-align: center;">Нормальные <br> заготовки <br> 12</td>
+        <td style="text-align: center;">Нормальные <br> заготовки <br> 15</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //M �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=51\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>���������� ��������� 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=52\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>���������� ��������� 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=53\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>���������� ��������� 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=54\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>���������� ��������� 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=55\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>���������� ��������� 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //M задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=51\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Нормальные заготовки 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=52\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Нормальные заготовки 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=53\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Нормальные заготовки 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=54\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Нормальные заготовки 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=55\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Нормальные заготовки 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='rb';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>�������� ���� ��� ������ ��������� ���������. ( L ���� )</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>�������� ���� ��� ������ ��������� ���������. ( L ���� )</title>
+<? $zd = 'rb'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Получить руну при плавке идеальных заготовок. ( L руну )</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Получить руну при плавке идеальных заготовок. ( L руну )</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">���</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">8</td>
-<td style="text-align: center;">11</td>
-<td style="text-align: center;">15</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">��������� <br> ��������� <br> 2</td> 
-<td style="text-align: center;">��������� <br> ��������� <br> 4</td>
-<td style="text-align: center;">��������� <br> ��������� <br> 6</td>
-<td style="text-align: center;">��������� <br> ��������� <br> 10</td>
-<td style="text-align: center;">��������� <br> ��������� <br> 15</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Рун</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">8</td>
+        <td style="text-align: center;">11</td>
+        <td style="text-align: center;">15</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">Идеальные <br> заготовки <br> 2</td>
+        <td style="text-align: center;">Идеальные <br> заготовки <br> 4</td>
+        <td style="text-align: center;">Идеальные <br> заготовки <br> 6</td>
+        <td style="text-align: center;">Идеальные <br> заготовки <br> 10</td>
+        <td style="text-align: center;">Идеальные <br> заготовки <br> 15</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //L �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=61\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>��������� ��������� 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=62\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>��������� ��������� 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=63\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>��������� ��������� 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=64\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>��������� ��������� 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=65\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>��������� ��������� 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //L задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=61\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Идеальные заготовки 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=62\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Идеальные заготовки 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=63\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Идеальные заготовки 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=64\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Идеальные заготовки 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=65\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Идеальные заготовки 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='pg';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>������������� � ����������� ��������.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>������������� � ����������� ��������.</title>
+<? $zd = 'pg'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Поучаствовать в героическом сражении.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Поучаствовать в героическом сражении.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">100</td>
-<td style="text-align: center;">200</td>
-<td style="text-align: center;">400</td>
-<td style="text-align: center;">600</td>
-<td style="text-align: center;">1000</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">����� <br> ������ <br> 10</td> 
-<td style="text-align: center;">����� <br> ������ <br> 20</td>
-<td style="text-align: center;">����� <br> ������ <br> 40</td>
-<td style="text-align: center;">����� <br> ������ <br> 60</td>
-<td style="text-align: center;">����� <br> ������ <br> 80</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Участий</td>
+        <td style="text-align: center;">100</td>
+        <td style="text-align: center;">200</td>
+        <td style="text-align: center;">400</td>
+        <td style="text-align: center;">600</td>
+        <td style="text-align: center;">1000</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">Жетон <br> Успеха <br> 10</td>
+        <td style="text-align: center;">Жетон <br> Успеха <br> 20</td>
+        <td style="text-align: center;">Жетон <br> Успеха <br> 40</td>
+        <td style="text-align: center;">Жетон <br> Успеха <br> 60</td>
+        <td style="text-align: center;">Жетон <br> Успеха <br> 80</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //������ �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=71\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>����� ������ 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=72\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>����� ������ 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=73\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>����� ������ 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=74\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>����� ������ 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=75\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>����� ������ 80</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Героик задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=71\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Жетон Успеха 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=72\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Жетон Успеха 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=73\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Жетон Успеха 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=74\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Жетон Успеха 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=75\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Жетон Успеха 80</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='bv';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>������� ������� ��������� ���� � ������.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>������� ������� ��������� ���� � ������.</title>
+<? $zd = 'bv'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Продать бабушке найденные вещи в пещере.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Продать бабушке найденные вещи в пещере.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">������</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">25</td>
-<td style="text-align: center;">50</td>
-<td style="text-align: center;">100</td>
-<td style="text-align: center;">250</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">500��.</td>  
-<td style="text-align: center;">1000��.</td>
-<td style="text-align: center;">2000��.</td>
-<td style="text-align: center;">4000��.</td>
-<td style="text-align: center;">5000��.</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Продаж</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">25</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">100</td>
+        <td style="text-align: center;">250</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">500кр.</td>
+        <td style="text-align: center;">1000кр.</td>
+        <td style="text-align: center;">2000кр.</td>
+        <td style="text-align: center;">4000кр.</td>
+        <td style="text-align: center;">5000кр.</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //������ �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=81\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>500��.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=82\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>1000��.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=83\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>2000��.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=84\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>4000��.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=85\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>5000��.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Героик задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=81\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>500кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=82\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>1000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=83\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>2000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=84\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>4000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=85\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>5000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='kw';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>�������� � �������� �����.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>�������� � �������� �����.</title>
+<? $zd = 'kw'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Победить в клановой войне.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Победить в клановой войне.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�����</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">25</td>
-<td style="text-align: center;">50</td>
-<td style="text-align: center;">100</td>
-<td style="text-align: center;">250</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;">������ <br> ���������<br> ����� 1</td>  
-<td style="text-align: center;">������ <br> ���������<br> ����� 2</td>
-<td style="text-align: center;">������ <br> ���������<br> ����� 5</td>
-<td style="text-align: center;">������ <br> ���������<br> ����� 10</td>
-<td style="text-align: center;">������ <br> ���������<br> ����� 15</td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">25</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">100</td>
+        <td style="text-align: center;">250</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;">Свиток <br> кланового<br> опыта 1</td>
+        <td style="text-align: center;">Свиток <br> кланового<br> опыта 2</td>
+        <td style="text-align: center;">Свиток <br> кланового<br> опыта 5</td>
+        <td style="text-align: center;">Свиток <br> кланового<br> опыта 10</td>
+        <td style="text-align: center;">Свиток <br> кланового<br> опыта 15</td>
+    </tr>
 </table>
 </body>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //���� ��� �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=91\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>������ <br> ���������<br> ����� 1.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=92\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>������ <br> ���������<br> ����� 2.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=93\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>������ <br> ���������<br> ����� 5.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=94\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>������ <br> ���������<br> ����� 10.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=95\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>������ <br> ���������<br> ����� 15.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Клан вар задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=91\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 1.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=92\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 2.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=93\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 5.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=94\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 10.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=95\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 15.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
-<? $zd='pa';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>�������� ��������������� ������.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>�������� ��������������� ������.</title>
+<? $zd = 'pa'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Получить покровительство Ангела.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Получить покровительство Ангела.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�����</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">25</td>
-<td style="text-align: center;">50</td>
-<td style="text-align: center;">100</td>
-<td style="text-align: center;">250</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;"> - </td>  
-<td style="text-align: center;"> - </td>
-<td style="text-align: center;"> - </td>
-<td style="text-align: center;"> - </td>
-<td style="text-align: center;"> - </td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">25</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">100</td>
+        <td style="text-align: center;">250</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;"> -</td>
+        <td style="text-align: center;"> -</td>
+        <td style="text-align: center;"> -</td>
+        <td style="text-align: center;"> -</td>
+        <td style="text-align: center;"> -</td>
+    </tr>
 </table>
 </body>
 <hr>
-<? $zd='bs';?>
-<H4><? echo $ai['name'.$zd];?></H4>
-<b>������ � ����� ������.</b><br> 
-������ � ��� ����: <b><? echo $ai['klas'.$zd]; ?></b>. ���������� ����������: <b><? echo $ai[$zd]; ?>=<? echo $ai['klasP'.$zd]; ?>%</b><br>
-<title>�������� ��������������� ������.</title>
+<? $zd = 'bs'; ?>
+<H4><? echo $ai['name' . $zd]; ?></H4>
+<b>Победы в башне смерти.</b><br>
+Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
+    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
+<title>Получить покровительство Ангела.</title>
 </head>
 <body>
 <table border="0" cellpadding="3" cellspacing="1">
-<tr bgcolor="#A5A5A5">
-<td style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">2</td>
-<td style="text-align: center;">3</td>
-<td style="text-align: center;">4</td>
-<td style="text-align: center;">5</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�����</td>
-<td style="text-align: center;">1</td>
-<td style="text-align: center;">5</td>
-<td style="text-align: center;">10</td>
-<td style="text-align: center;">50</td>
-<td style="text-align: center;">500</td>
-</tr>
-<tr bgcolor="#C7C7C7">
-<td bgcolor="#A5A5A5" style="text-align: center;">�������</td>
-<td style="text-align: center;"> 1 ���. </td>  
-<td style="text-align: center;"> 5 ���. </td>
-<td style="text-align: center;"> 10 ���. </td>
-<td style="text-align: center;"> 50 ���. </td>
-<td style="text-align: center;"> 200 ���. </td>
-</tr>
+    <tr bgcolor="#A5A5A5">
+        <td style="text-align: center;">Ранги</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">2</td>
+        <td style="text-align: center;">3</td>
+        <td style="text-align: center;">4</td>
+        <td style="text-align: center;">5</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
+        <td style="text-align: center;">1</td>
+        <td style="text-align: center;">5</td>
+        <td style="text-align: center;">10</td>
+        <td style="text-align: center;">50</td>
+        <td style="text-align: center;">500</td>
+    </tr>
+    <tr bgcolor="#C7C7C7">
+        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
+        <td style="text-align: center;"> 1 Екр.</td>
+        <td style="text-align: center;"> 5 Екр.</td>
+        <td style="text-align: center;"> 10 Екр.</td>
+        <td style="text-align: center;"> 50 Екр.</td>
+        <td style="text-align: center;"> 200 Екр.</td>
+    </tr>
 </table>
 <?
-if ($ai['klas'.$zd]>$ai[$zd.'_n']) //���� �������
-	{
-		echo '<br>�������:<br>';
-		if ($ai[$zd.'_n'] ==0){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=101\';" onMouseOver="top.hi(this,\'<b>������ 1 �����<hr>��������:<hr>1 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk1.'">';
-		}elseif ($ai[$zd.'_n'] ==1){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=102\';" onMouseOver="top.hi(this,\'<b>������ 2 �����<hr>��������:<hr>5 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk2.'">';
-		}elseif ($ai[$zd.'_n'] ==2){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=103\';" onMouseOver="top.hi(this,\'<b>������ 3 �����<hr>��������:<hr>10 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk3.'">';
-		}elseif ($ai[$zd.'_n'] ==3){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=104\';" onMouseOver="top.hi(this,\'<b>������ 4 �����<hr>��������:<hr>50 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk4.'">';
-		}elseif ($ai[$zd.'_n'] ==4){
-		echo '<img onclick="location.href=\'/main.php?titul&nagr=105\';" onMouseOver="top.hi(this,\'<b>������ 5 �����<hr>��������:<hr>200 ���.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/'.$sunduk5.'">';
-		}
-	}
+if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Хаот задание
+{
+    echo '<br>Награда:<br>';
+    if ($ai[$zd . '_n'] == 0) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=101\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>1 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
+    } elseif ($ai[$zd . '_n'] == 1) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=102\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>5 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
+    } elseif ($ai[$zd . '_n'] == 2) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=103\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>10 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
+    } elseif ($ai[$zd . '_n'] == 3) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=104\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>50 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
+    } elseif ($ai[$zd . '_n'] == 4) {
+        echo '<img onclick="location.href=\'/main.php?titul&nagr=105\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>200 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+    }
+}
 ?>
 <hr>
 
-<?='<br>'.$red?>
\ No newline at end of file
+<?= '<br>' . $red ?>
\ No newline at end of file
-- 
2.45.2


From 03a4fa12751795ad5b305494ba7c453cde6b3e44 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sat, 25 Jun 2022 16:02:40 +0300
Subject: [PATCH 02/12] include to require_once

---
 _incl_data/class/__battle.php               |  1478 +--
 _incl_data/class/__dungeon.php              |     2 +-
 _incl_data/class/__filter_class.php         |   456 +-
 _incl_data/class/__quest.php                |  2104 ++-
 _incl_data/class/__userOLD.php              | 12519 ------------------
 _incl_data/class/dialog.class.php           |     2 +-
 _incl_data/class/items_info.php             |     2 +-
 jx/battle/refresh.php                       |    16 +-
 jx/battle/refresh1.php                      |    14 -
 jx/battle/refresh2.php                      |    10 +-
 jx/battle/refresh_bot.php                   |    16 +-
 jx/battle/refresh_vip.php                   |    16 +-
 main.php                                    |  1266 +-
 modules_data/cp.php1                        |     2 +-
 modules_data/location/_locations.php        |     2 +-
 modules_data/location/ab/cp.php             |     2 +-
 modules_data/location/ab/cp2.php            |     2 +-
 modules_data/location/ab/hram.php           |     2 +-
 modules_data/location/ab/izlom16.php        |     2 +-
 modules_data/location/ab/izlom2.php         |     2 +-
 modules_data/location/ab/quest.php          |     2 +-
 modules_data/location/an/bk.php             |     4 +-
 modules_data/location/an/bk2.php            |     2 +-
 modules_data/location/an/cp1.php            |     2 +-
 modules_data/location/an/cp2.php            |     2 +-
 modules_data/location/an/kinght.php         |     2 +-
 modules_data/location/an/torg.php           |     2 +-
 modules_data/location/an/zalu.php           |     2 +-
 modules_data/location/an/zalu_pal.php       |     2 +-
 modules_data/location/an/zv1.php            |     2 +-
 modules_data/location/an/zv2.php            |     2 +-
 modules_data/location/an/zv3.php            |     2 +-
 modules_data/location/an/zv4.php            |     2 +-
 modules_data/location/bk.php                |     4 +-
 modules_data/location/bk2.php               |     2 +-
 modules_data/location/btl_.php              |    10 +-
 modules_data/location/cp1.php               |     6 +-
 modules_data/location/cp2.php               |     2 +-
 modules_data/location/cp3.php               |     2 +-
 modules_data/location/cp4.php               |     2 +-
 modules_data/location/dragopsh.php          |     2 +-
 modules_data/location/dungeon.php           |     4 +-
 modules_data/location/dungeon_enter_all.php |     7 +-
 modules_data/location/em/cp.php             |     2 +-
 modules_data/location/em/cp2.php            |     2 +-
 modules_data/location/fe/bk.php             |     2 +-
 modules_data/location/fe/cp.php             |     2 +-
 modules_data/location/fe/sclep.php          |     2 +-
 modules_data/location/fe/zv1.php            |     2 +-
 modules_data/location/fe/zv2.php            |     2 +-
 modules_data/location/fe/zv3.php            |     2 +-
 modules_data/location/fe/zv4.php            |     2 +-
 modules_data/location/fight-club.php        |     4 +-
 modules_data/location/izlom2.php            |     2 +-
 modules_data/location/kinght.php            |     2 +-
 modules_data/location/nc/bk.php             |     2 +-
 modules_data/location/nc/cp.php             |     2 +-
 modules_data/location/nc/zv1.php            |     2 +-
 modules_data/location/nc/zv2.php            |     2 +-
 modules_data/location/nc/zv3.php            |     2 +-
 modules_data/location/nc/zv4.php            |     2 +-
 modules_data/location/newtower.php1         |     2 +-
 modules_data/location/novich.php            |     2 +-
 modules_data/location/perehod.php           |     2 +-
 modules_data/location/poklon.php            |     2 +-
 modules_data/location/ric_zv.php            |     2 +-
 modules_data/location/room_xot.php          |     2 +-
 modules_data/location/test/cp.php           |     2 +-
 modules_data/location/torg.php              |     2 +-
 modules_data/location/trade_zv.php          |     2 +-
 modules_data/location/turnir.php            |     2 +-
 modules_data/location/zalu.php              |     2 +-
 modules_data/location/zalu_pal.php          |     2 +-
 modules_data/location/zalu_pal2.php         |     2 +-
 modules_data/location/zalu_pal3.php         |     2 +-
 modules_data/location/zalu_pal4.php         |     2 +-
 modules_data/location/zv1.php               |     2 +-
 modules_data/location/zv2.php               |     2 +-
 modules_data/location/zv3.php               |     2 +-
 modules_data/location/zv4.php               |     2 +-
 modules_data/location/zv_svet.php           |     2 +-
 modules_data/transfer.php.bac               |     4 +-
 online.php                                  |  1859 +--
 rating_script/index.php                     |     4 +-
 84 files changed, 2741 insertions(+), 17188 deletions(-)
 delete mode 100644 _incl_data/class/__userOLD.php

diff --git a/_incl_data/class/__battle.php b/_incl_data/class/__battle.php
index 69830fc6..ea503568 100644
--- a/_incl_data/class/__battle.php
+++ b/_incl_data/class/__battle.php
@@ -512,73 +512,21 @@ class battleClass
 		if ($y < 0) { /*echo '[r]';*/
 			$y = 0;
 		}
-		//
-		// $addExp = 0+(($y/$s2['hpAll'])*100);
+
 		$addExp = 0 + ($y * $oplevel[$this->users[$this->uids[$s2['id']]]['level']]);
 		if ($s2['hpAll'] - $y <= 0) {
 			//echo '[a]';
 			$addExp = 100;
 		}
 
-		//if($this->users[$this->uids[$s2['id']]]['host_reg'] == 'real_bot_user') {
-		//	$addExp = floor($addExp*0.76);
-		//}
-
 		if ($addExp < 0) {
 			$addExp = 0;
 		}
 		if ($s2['levels'] != 'undefined' && $this->users[$this->uids[$s2['id']]]['pass'] != 'saintlucia') {
-			//$doexp = mysql_fetch_array(mysql_query('SELECT SUM(`items_main`.`price1`) FROM `items_users`,`items_main` WHERE `items_users`.`inOdet` > 0 AND `items_main`.`inSlot` < 50 AND `items_users`.`uid` = "'.$id2.'" AND `items_users`.`delete` = 0 AND `items_main`.`id` = `items_users`.`item_id` ORDER BY `items_main`.`inSlot` ASC LIMIT 50'));
-			//if($doexp[0]>0) {
-			//	$doexp = floor($doexp[0]/15);
-			//}else{
-			//	$doexp = 0;
-			//}
-			//$doexp = floor(($this->users[$this->uids[$id2]]['btl_cof']-$this->users[$this->uids[$id1]]['btl_cof']*0.80)/5);
-			/*if( $this->users[$this->uids[$id2]]['btl_cof'] > $this->users[$this->uids[$s2['id']]]['level']*350 ) {
-					//������
-					$doexp = floor($this->users[$this->uids[$s2['id']]]['level']*350 + ($this->users[$this->uids[$id2]]['btl_cof']/20));
-				}else{
-					//�� ������
-					$doexp = floor(($this->users[$this->uids[$id2]]['btl_cof']));
-				}*/
-
 			if ($doexp < 0) {
 				$doexp = 0;
 			}
-			//$addExp = $addExp*(1+($s2['levels']['expBtlMax']+$s2['irka'])+($doexp*1.01/10))/100;
-			/*
-				$bmxx = $s2['levels']['expBtlMax'];
 
-				if ($s2['levels']['bprice'] == 0)
-				{
-				$bmxx = round( $bmxx  * $s2['prckr']);
-				}
-				else
-				{
-				$bmxx = round( $bmxx  * ( $s2['prckr'] / $s2['levels']['bprice'] ) );
-				}
-
-				if( $bmxx < $s2['levels']['expBtlMax'] / 2 ) {
-					$bmxx = round($s2['levels']['expBtlMax']/5);
-				}
-
-				if( $this->info['type'] == 1 ) {
-					$addExp = $addExp*($bmxx/10)/100;
-				}else{
-					$xty = 0;
-
-					// $xty = ($s2['reting']-$s1['reting']/2);
-					// if( $xty < 0 ) {
-						// $xty = 0;
-					// }
-
-					$addExp = $addExp*(($bmxx+$xty))/100;
-				}*/
-
-
-			//echo '(������� ����: '.$s2['levels']['expBtlMax'].')';
-			//
 			if ($this->info['razdel'] != 5 && $c['exp_limit_many'] == true) {
 				$texp = mysql_fetch_array(mysql_query('SELECT COUNT(`a`.`id`) FROM `battle_users` AS `a` WHERE `a`.`uid` = "' . $id1 . '" AND `a`.`battle` IN ( SELECT `b`.`battle` FROM `battle_users` AS `b` WHERE `b`.`uid` = "' . $id2 . '" AND `b`.`team` != `a`.`team` AND `b`.`time` > "' . (time() - 86400) . '" ) LIMIT 1'));
 				$texp = $texp[0];
@@ -645,14 +593,6 @@ class battleClass
 			} else {
 				$e = 0;
 			}
-			/*
-				if( $this->users[$this->uids[$id1]]['level'] > $this->users[$this->uids[$id2]]['level'] ) {
-					$rez = $this->users[$this->uids[$id1]]['level']-$this->users[$this->uids[$id2]]['level'];
-					$e = round($e/100*(21-$rez*3));
-					if( $e < 0 ) {
-						$e = 0;
-					}
-				}*/
 
 			if ((int)$this->users[$this->uids[$id1]]['bot_id'] == 0 && $this->users[$this->uids[$id1]]['dnow'] != 0 && $this->info['dungeon'] != 1) {
 				$dun_limitForLevel = [ // �������� ��� ������� ������.
@@ -726,14 +666,6 @@ class battleClass
 					$e = floor($e * 0.002);
 				}
 			}
-			/*
-				if( (int)$this->users[$this->uids[$id1]]['bot_id'] == 0 && $this->users[$this->uids[$id1]]['dnow'] != 0 && $this->info['dungeon'] != 1 ) {
-					if($this->users[$this->uids[$id1]]['level'] >= 7 ) {
-						$itmsCfc = ($s1['itmsCfc']+$s2['itmsCfc'])/26;
-						$itmsCfc = round($itmsCfc,5);
-						$e = $e*$itmsCfc;
-					}
-				}*/
 
 			$this->users[$this->uids[$id1]]['battle_exp'] += floor($e);//round($e,5);
 			//echo '[['.$id1.']+'.$e.']';
@@ -757,13 +689,6 @@ class battleClass
 				}
 			}
 
-			//if($y != 0) {
-			//	$this->users[$this->uids[$id1]]['tactic6'] = -$y;
-			//}
-			//if($u->info['admin'] > 0 ) {
-			//	echo '['.$id1.' ������ '.$id2.' � ������� +'.$y.' � ����������� ����� � +'.$e.' �����]';
-			//}
-
 			$upd = mysql_query('UPDATE `stats` SET `last_hp` = "' . $this->users[$this->uids[$id1]]['last_hp'] . '",`tactic6` = "' . $this->users[$this->uids[$id1]]['tactic6'] . '",`battle_yron` = "' . $this->users[$this->uids[$id1]]['battle_yron'] . '",`battle_exp` = "' . $this->users[$this->uids[$id1]]['battle_exp'] . '" WHERE `id` = "' . ((int)$id1) . '" LIMIT 1');
 			if (!$upd) {
 				echo '[�� ����� ��� ������������� ������]';
@@ -889,40 +814,6 @@ class battleClass
 							$time_still -= time();
 							if ($eff[$i]['bp'] == 0 && $eff[$i]['timeUse'] != 77) {
 								if ($eff[$i]['type1'] != 13) {
-									/*$tmp = floor($time_still/2592000);
-									$id=0;
-									if ($tmp > 0) {
-										$id++;
-										if ($id<3) {$out .= $tmp." ���. ";}
-										$time_still = $time_still-$tmp*2592000;
-									}
-									$tmp = floor($time_still/604800);
-									if ($tmp > 0) {
-									$id++;
-									if ($id<3) {$out .= $tmp." ���. ";}
-									$time_still = $time_still-$tmp*604800;
-									}
-									$tmp = floor($time_still/86400);
-									if ($tmp > 0) {
-										$id++;
-										if ($id<3) {$out .= $tmp." ��. ";}
-										$time_still = $time_still-$tmp*86400;
-									}
-									$tmp = floor($time_still/3600);
-									if ($tmp > 0) {
-										$id++;
-										if ($id<3) {$out .= $tmp." �. ";}
-										$time_still = $time_still-$tmp*3600;
-									}
-									$tmp = floor($time_still/60);
-									if ($tmp > 0) {
-										$id++;
-										if ($id<3) {$out .= $tmp." ���. ";}
-									}
-									if($out=='')
-									{
-										$out = $time_still.' ���.';
-									}*/
 									$ei .= '��������: ' . $u->timeOut($time_still) . '';
 								}
 							} else {
@@ -1589,46 +1480,7 @@ class battleClass
 					}
 					//
 					unset($logins_bot);
-					//
-					//
-					//
-					/*if( true == false ) {
-							$mz = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `izlom` WHERE `izlom` = "'.$this->info['izlom'].'" AND `level` = "'.$this->info['izlomLvl'].'" LIMIT 50'));
-							$mz = $mz[0];
-							$pz = $this->info['izlomRound']+rand(1,3);
-							if($pz/$mz>1){
-								$zz = floor($pz/$mz);
-								$pz = $pz-($zz*$mz);
-							}
-							$iz = mysql_fetch_array(mysql_query('SELECT * FROM `izlom` WHERE `izlom` = "'.$this->info['izlom'].'" AND `level` = "'.$this->info['izlomLvl'].'" AND `round` = "'.$pz.'" LIMIT 1'));
-							$i = 0; $bots = $iz['bots']; $bots = explode('|',$bots); $j = 0; $k = 0; $obr = 0;
-							$logins_bot = array();
-							while($i<count($bots))
-							{
-								if($bots[$i]>0)
-								{
-									$k = $u->addNewbot($bots[$i],NULL,NULL,$logins_bot);
-									if($k!=false)
-									{
-										$logins_bot = $k['logins_bot'];
-										$upd = mysql_query('UPDATE `users` SET `battle` = "'.$this->info['id'].'" WHERE `id` = "'.$k['id'].'" LIMIT 1');
-										if($upd)
-										{
-											$upd = mysql_query('UPDATE `stats` SET `team` = "2" WHERE `id` = "'.$k['id'].'" LIMIT 1');
-											if($upd)
-											{
-												$j++; if(rand(0,10000) < 1500){ $obr++; }
-											}
-										}
-									}
-								}
-								$i++;
-							}
-							unset($logins_bot);
-						}*/
-					//
-					//
-					//
+
 					if ($j == 0) {
 						//����� ������
 						$this->finishBattle($tml, $tmv, null, $tl);
@@ -2017,18 +1869,7 @@ class battleClass
 
 									mysql_query('UPDATE `users` SET `room` = "303" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1');
 
-									/*$truptime=mysql_fetch_array(mysql_query('SELECT `s`.`id` , `s`.`res_x` FROM `stats` AS `s` WHERE `s`.`id` IN (SELECT `u`.`id` FROM `users` AS `u` WHERE `u`.`no_ip` = "trupojor") ORDER BY `s`.`res_x` DESC LIMIT 1'));
-									$truptimelast=$truptime['res_x']+2700;
-									if ($truptimelast > (time()+10080) || $truptimelast < time() )
-									{
-										$truptimelast=time()+10080;
-									}*/
-									// if ($this->users[$i]['level']>9)
-									// {
 									$truptimelast = time() + rand(1800, 3600);
-									//}
-									// else
-									// {$truptimelast=time()+10080;}
 
 
 									mysql_query('UPDATE `stats` SET `res_x` = "' . $truptimelast . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1');
@@ -2286,34 +2127,10 @@ class battleClass
 				$bm = [];
 				$bms = [];
 
-				//��������� ������
-				$i = 0;
-				while ($i < count($this->users)) {
-					if ($this->users[$i]['bot'] == 0 && $this->users[$i]['id'] == $u->info['id']) {
-						$q->bfinuser($this->users[$i], $this->info['id'], $this->info['team_win']);
-					}
-					$i++;
-				}
-				//��������� ������
-
 				//��������� ��������
 				$i = $this->uids[$u->info['id']];
 
 				if ($this->info['team_win'] >= 0) {
-					//�������� +100% �����
-					/*
-						if(date('w') == 0 || date('w') == 6) {
-							$this->stats[$i]['exp'] += 100;
-						}
-						*/
-
-					/*if( date('d.m') == '15.05' ) {
-						//������ 40 ��� (54, �� ���������� 40)
-						//$this->stats[$i]['exp'] += 100;
-					}elseif( date('d.m') == '13.06' ) {
-						//���� �����
-						//$this->stats[$i]['exp'] += 100;
-					}*/
 
 					if ($this->stats[$i]['pbe'] > 0) {
 						//����� ����������
@@ -2705,84 +2522,6 @@ class battleClass
 								$u->addDelo(4, $this->users[$i]['id'], '&quot;<font color="olive">System.battle</font>&quot;: �������� ������� <strong>' . $admn . ' ���</strong> (� ��� �' . $this->info['id'] . ').', time(), $this->info['city'], 'System.battle', 0, 0);
 								$this->users[$i]['money2'] += $admn;
 							}
-
-							//$bnsv = 0.50;
-							/*
-								if( $this->info['otmorozok_use'] > 0 ) {
-									$bnsv += 1;
-								}
-								if( $c['w'] == 0 || $c['w'] == 6 ) {
-									$bnsv += 0.50;
-								}
-								$admnb = round($bnsv+(($this->stats[$i]['prckr']/100)*$c['money_haot_proc']),2);
-								if($act01!=1) {
-									$admnb = round($admnb/10,2);
-								}
-								*/
-							/*$admnb = 0;
-								//
-								if( $admnb >= 0.01 ) {
-									$adexp = array(
-										0 => 0,
-										1 => 0,
-										2 => 0,
-										3 => 0,
-										4 => 0,
-										5 => 0,
-										6 => 0,
-										7 => 0,
-										8 => 3000,
-										9 => 5000,
-										10 => 8000,
-										11 => 12000,
-										12 => 20000,
-										13 => 30000,
-										14 => 30000,
-										15 => 30000,
-										16 => 30000,
-										17 => 30000,
-										18 => 30000,
-										19 => 30000,
-										20 => 30000,
-										21 => 30000
-									);
-									$adexp = $adexp[$this->users[$i]['level']];
-									if( $adexp > 0 && $adexp >  ) {
-										if($act01!=1) {
-											$adexp = round($adexp/10);
-										}
-										//$uzrbtl = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `battle_users` WHERE `battle` = "'.$this->info['id'].'" AND `login` NOT LIKE "%(%)&" AND `align` != "" LIMIT 1'));
-										//$uzrbtl = $uzrbtl[0];
-										if( $this->users[$i]['battle_exp'] < $adexp ) {
-											//��� ������� �.�. �� ������� ������������ �����
-											$prc .= ', ������� <strong>0 ���</strong> �� ���� ���, ��������� ������ �����.';
-										}else{
-											$prc .= ', ������� <strong>'.$admnb.' ���</strong> �� ���� ���.';
-											$u->addDelo(4,$this->users[$i]['id'],'&quot;<font color="olive">System.battle</font>&quot;: �������� ������� <strong>'.$admnb.' ���</strong> (� ��� �'.$this->info['id'].').',time(),$this->info['city'],'System.battle',0,0);
-											$this->users[$i]['money2'] += $admnb;
-										}
-									}
-									//
-									$minpsh = 0;
-									if($act01==1){
-										//������
-										$minpsh = 25;
-									}elseif($act01==2){
-										//���������
-										$minpsh = 15;
-									}else{
-										//�����
-										$minpsh = 15;
-									}
-									if( $c['w'] == 0 || $c['w'] == 6 ) {
-										$minpsh += 10;
-									}
-									if( $minpsh > 0 ) {
-										mysql_query('UPDATE `actions` SET `time` = `time` - "'.($minpsh*60).'" WHERE `vars` LIKE "psh0" AND `uid` = "'.$this->users[$i]['id'].'"');
-										$prc .= ', �������� ��������� ����� ��������� �� '.$minpsh.' �����.';
-									}
-									//
-									*/
 						}
 					}
 					//
@@ -3064,35 +2803,10 @@ class battleClass
 								� ������ ������ (�3)
 
 							*/
+
 						if ($this->info['type'] == 33)//��� ���� ���� ����
 						{
-							/*
-								$pld = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `inUser` = "'.$this->users[$i]['id'].'" LIMIT 1'));
-								if (isset($pld['id']))
-									{
-									$u->addItem(4754,$pld['id'],'');
-									$u->addItem(4754,$pld['id'],'');
-									$u->addItem(4754,$pld['id'],'');
-									$u->addItem(4754,$pld['id'],'');
-									$u->addItem(4754,$pld['id'],'');
-									$this->users[$i]['battle_text'] .= ' �� ����������� �������� �� ��������� <strong>�������� ������ (x5)</strong>. ';
-									mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "'.$pld['id'].'" LIMIT 1');
-									mysql_query('DELETE FROM `users` WHERE `id` = "'.$this->users[$i]['id'].'" LIMIT 1');
-									mysql_query('DELETE FROM `stats` WHERE `id` = "'.$this->users[$i]['id'].'" LIMIT 1');
-									mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$this->users[$i]['id'].'" LIMIT 100');
-									mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$this->users[$i]['id'].'" LIMIT 100');
-									}
 
-								if($this->users[$i]['team']==$this->info['team_win'] && isset($pld['id']))
-									{
-										if(rand(1,100)<=5)
-											{
-												$u->addItem(10020,$pld['id'],'');
-												$this->users[$i]['battle_text'] .= ' � <strong>����� ������</strong>. ';
-											}
-
-									}
-									*/
 
 						} else {
 
@@ -3323,9 +3037,6 @@ class battleClass
 							}
 
 
-							/*if( $this->info['players_c'] > 4 ) {
-									$rzbvo = 2*$this->info['players_c'];
-								}*/
 							if ($this->info['type'] != 33) {
 								$this->users[$i]['battle_text'] .= ' �� �������� ' . $rzbvo . ' �������������� �� ���� ���.';
 							}
@@ -3347,34 +3058,14 @@ class battleClass
 					} else {
 						$this->stats[$i]['hpNow'] = 0;
 					}
-					/*
-						$this->stats[$i]['test_heal'] = ($this->stats[$i]['hpNow']-$this->stats[$i]['hpAll']) + $this->stats[$i]['test_heal'];
-						if($this->users[$i]['team']==$this->info['team_win']){
-							//��������� �� ����� ����
-							$this->stats[$i]['hpNow'] -= $this->stats[$i]['test_heal'];
-							$this->users[$i]['hpNow'] = $this->stats[$i]['hpNow'];
-							if(floor($this->stats[$i]['hpNow']) < 0) {
-								$this->stats[$i]['hpNow'] = 0;
-							}
-						}else{
-							$this->stats[$i]['hpNow'] = 0;
-						}
-						*/
 					unset($this->stats[$i]['test_heal']);
 
 					$this->users[$i]['last_b'] = $this->info['id']; //stats
 					$this->users[$i]['last_a'] = $act01;
 					$this->users[$i]['battle'] = -1; //users
 					$this->users[$i]['battle_yron'] = 0; //stats
-
 					$this->users[$i]['exp'] += $this->users[$i]['battle_exp']; //users
 
-					/*if($this->stats[$i]['speeden']>2) { // ��� �������������� ������� (�������� ��������)
-							$this->users[$i]['enNow']+= $this->stats[$i]['enNow']; //users
-							$upd2 = mysql_query('UPDATE `stats` SET `enNow` = "'.$this->users[$i]['enNow'].'" WHERE `id` = "'.$this->users[$i]['id'].'" LIMIT 1');
-						}*/
-					//��������� ���� ���� (��� ����� �����)
-
 					if ($this->users[$i]['clan'] > 0) {
 						$cpr = 1;
 						if ($this->info['typeBattle'] == 9) {
@@ -3536,16 +3227,6 @@ class battleClass
 					//��������� ��� ���
 					$upd3 = mysql_query('UPDATE `battle` SET `time_over` = "' . time() . '",`team_win` = "' . $this->info['team_win'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
 
-					//���� ��� �� (������ ������)
-					/*$tinf = mysql_fetch_array(mysql_query('SELECT * FROM `dungeon_now` WHERE `id` = "'.$this->info['dn_id'].'" LIMIT 1'));
-					if(isset($tinf['id']) && $tinf['bsid']>0)
-					{
-						$bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `city` = "'.$u->info['city'].'" AND `id` = "'.$tinf['bsid'].'" AND `time_start` = "'.$tinf['time_start'].'" LIMIT 1'));
-						if(isset($bs['id']))
-						{
-							$u->bsfinish($bs,$this->users,$this->info);
-						}
-					}*/
 					// ����� �����
 					if ($this->users[$i]['animal'] > 0) {
 						$a = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "' . $this->users[$i]['id'] . '" AND `id` = "' . $this->users[$i]['animal'] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
@@ -3563,8 +3244,6 @@ class battleClass
 						echo '<script>document.getElementById(\'teams\').style.display=\'none\';var battleFinishData = "' . $u->info['battle_text'] . '";</script>';
 					}
 
-				} else {
-					//echo '<font color=red><strong>�������� ����������, �� �� ������� ��� � 0-�� ������, �������� �������������!</strong></font>';
 				}
 			}
 			//unlink($lock_file);
@@ -3914,20 +3593,6 @@ class battleClass
 		global $u;
 		if (!isset($this->ga[$u->info['id']][$u->info['enemy']])) {
 			if ($this->stats[$this->uids[$u->info['id']]]['hpNow'] > 0) {
-				/*$us = $this->stats[$this->uids[$u->info['id']]];
-					$i = 1; $no = 0;
-					if($us['weapon1']!=1 && $us['weapon2']==1)
-					{
-						$uz['zona'] += 1;
-					}
-					while($i<=$uz['zona'])
-					{
-						if($this->uAtc['a'][$i]==0)
-						{
-							$no = 1;
-						}
-						$i++;
-					}*/
 				$us = $this->stats[$this->uids[$u->info['id']]];
 				$i = 1;
 				$no = 0;
@@ -4233,13 +3898,11 @@ class battleClass
 		if ($this->atacks[$id]['out1'] == 0) {
 			$at[1] = $this->usersTestAtack($id, $uid1, $uid2);
 		} else {
-			//echo '['. $this->users[$this->uids[$uid1]]['login'] .' ��������� ���]';
 			$at[1] = [0];
 		}
 		if ($this->atacks[$id]['out2'] == 0) {
 			$at[2] = $this->usersTestAtack($id, $uid2, $uid1);
 		} else {
-			//echo '['. $this->users[$this->uids[$uid2]]['login'] .' ��������� ���]';
 			$at[2] = [0];
 		}
 
@@ -5042,10 +4705,6 @@ class battleClass
 			]
 		];
 
-		//if( $u->info['admin'] > 0 ) {
-		//echo '[a: '.count($at[1]['atack']).'/'.count($at['p'][1]['atack']).', b: '.count($at[2]['atack']).'/'.count($at['p'][2]['atack']).']';
-		//}
-
 		$i = 1;
 		while ($i <= 2) {
 			if ($i == 1) {
@@ -5230,19 +4889,6 @@ class battleClass
 					if ($mas['text'] != '') {
 						$mas['text'] = '{tm1} ' . $mas['text'];
 					}
-					/*
-						'.$mass['time'].'",
-						"'.$mass['battle'].'",
-						"'.$mass['id_hod'].'",
-						"'.$mass['text'].'",
-						"'.$mass['vars'].'",
-						"'.$mass['zona1'].'",
-						"'.$mass['zonb1'].'",
-						"'.$mass['zona2'].'",
-						"'.$mass['zonb2'].'",
-						"'.$mass['type'].'
-						*/
-					//
 					if (count($at[$a]['atack'][$j]['yron']['plog']) > 0) {
 						$il = 0;
 						while ($il <= count($at[$a]['atack'][$j]['yron']['plog'])) {
@@ -5364,21 +5010,6 @@ class battleClass
 				$rtnglos = [-1, -2, -4, -8, -16, -32, -64, -128, -256];
 			}
 
-			/*
-				$btlstatus 				if( $x < 50000 ) {
-					//������� ���
-				}elseif( $x >= 50000 && $x < 100000 ) {
-					$r = array(25,50,'������� �����','�������� �����');
-				}elseif( $x < 150000 ) {
-					$r = array(50,75,'���������� �����','�������� �����');
-				}elseif( $x < 200000 ) {
-					$r = array(75,100,'������������ �����','�������� ����');
-				}elseif( $x < 250000 ) {
-					$r = array(100,125,'���������� �����','�������� �������');
-				}elseif( $x >= 250000 ) {
-					$r = array(150,150,'������ ����','������ ����');
-				}
-				*/
 
 			if ($dies[1] == 1) {
 				if ($this->info['dn_id'] > 0) {
@@ -5474,25 +5105,6 @@ class battleClass
 	//������� ������
 	public function contrRestart($id, $at, $v, $rjd = 0)
 	{
-		//
-		/*$at['p'] = $at;
-			//����
-			$at = $this->mf2Razmen($id,$at,$v,true);
-			//���� ����� (���� ���� ���, �������)
-			$at = $this->mf4Razmen($id,$at,$v,true);
-			//������
-			$at = $this->mf1Razmen($id,$at,$v,true);
-			//�����������
-			$at = $this->mf3Razmen($id,$at,$v,true);
-			//���������
-			//$at = $this->mf5Razmen($id,$at,$v);
-			//��������� ����
-			$at = $this->yronRazmen($id,$at,true);
-			//$at = $this->yronRazmen($id,$at);
-
-			$at = $at['p'];*/
-
-
 		//������
 		$at = $this->mf1Razmen($id, $at, $v, true, $rjd);
 		//�����������
@@ -5507,34 +5119,9 @@ class battleClass
 		$at = $this->mf2Razmen($id, $at, $v, true, $rjd);
 		$at = $this->yronRazmen($id, $at, true, $rjd);
 
-
 		return $at;
 	}
 
-	//������� ������
-	/*	public function contrRestart($id,$at,$v) {
-			//
-			$at['p'] = $at;
-			//����
-			//$at = $this->mf2Razmen($id,$at,$v,true);
-			//���� ����� (���� ���� ���, �������)
-			$at = $this->mf4Razmen($id,$at,$v,true);
-			//������
-			$at = $this->mf1Razmen($id,$at,$v,true);
-			//�����������
-			$at = $this->mf3Razmen($id,$at,$v,true);
-			//���������
-			//$at = $this->mf5Razmen($id,$at,$v);
-			//��������� ����
-			//$at = $this->yronRazmen($id,$at,true);
-			$at = $this->yronRazmen($id,$at);
-
-			$at = $at['p'];
-
-			return $at;
-		}
-	*/
-
 	//����������� ����� ��� ���������� ���� �����
 	public function yronGetrazmenStats($s, $z)
 	{
@@ -5617,17 +5204,6 @@ class battleClass
 	public function yronGetrazmen($uid1, $uid2, $wp, $zona)
 	{
 		global $u;
-		//$oldst1 = $this->stats[$this->uids[$uid1]];
-		//$oldst2 = $this->stats[$this->uids[$uid2]];
-		//�������� ����� ������ 1 � 2 ��� ���������� ����
-		//$this->stats[$this->uids[$uid1]] = $this->yronGetrazmenStats( $this->stats[$this->uids[$uid1]] , $zona );
-		//$this->stats[$this->uids[$uid2]] = $this->yronGetrazmenStats( $this->stats[$this->uids[$uid2]] , $zona );
-		//$this->a_save_stats($uid1);
-		//$this->a_save_stats($uid2);
-		//
-		//$this->a_testing_stats($uid1,$zona);
-		//$this->a_testing_stats($uid2,$zona);
-		//
 		$r = [
 			'y' => 0,
 			'r' => '--'
@@ -5646,9 +5222,7 @@ class battleClass
 			$witm = $this->stats[$this->uids[$uid1]]['items'][$this->stats[$this->uids[$uid1]]['wp' . $wp . 'id']];
 			$witm_data = $u->lookStats($witm['data']);
 			$witm_type = $this->weaponTx($witm);
-			//$r['wt'] = $witm['type'];
 		}
-		//$witm_type=1;
 		if ($witm_type == 0 || $witm_type == 12) {
 			$witm_type2 = '';
 		} else {
@@ -5727,22 +5301,6 @@ class battleClass
 		$wAp = 0;
 		$w3p = 0;
 		$w14p = 0;
-		/*
-			������ �������, �� ���� �������� �������� ��� �������� ����� ����������� ������ �������� �����
-			if($witm_type==12) {
-				//���� �������
-				$wAp += $this->stats[$this->uids[$uid1]]['m10'];
-				if($this->users[$this->uids[$uid1]]['align']==7) {
-					$wAp += 15;
-				}
-			}elseif($witm_type < 5) {
-				$wAp += $this->stats[$this->uids[$uid1]]['pa'.$witm_type.''] + $this->stats[$this->uids[$uid1]]['m10'] + $witm_data['sv_pa'.$witm_type.''];
-				$wAp -= $this->stats[$this->uids[$uid2]]['antpa'.$witm_type.''];
-			}else{
-				$wAp += $this->stats[$this->uids[$uid1]]['pm'.($witm_type-4).''] + $this->stats[$this->uids[$uid1]]['m11a'] + $witm_data['sv_pm'.($witm_type-4).''];
-				$wAp -= $this->stats[$this->uids[$uid2]]['antpm'.($witm_type-4).''];
-			}
-			*/
 		if ($witm_type == 12) {
 			//���� �������
 			$wAp += $this->stats[$this->uids[$uid1]]['m10'];
@@ -5771,31 +5329,7 @@ class battleClass
 			$r['pb'] = 1;
 		}
 
-
-		/*if( $this->mfs(4, $witm_data['m9']  , $this->users[$this->uids[$uid1]]['level'] , $this->users[$this->uids[$uid2]]['level']) == 1 ) {
-				$proboi = $witm_data['m9'];
-				$r['pb'] = 1;
-			}
-			if( $this->mfs(4, $witm_data['add_m9']  , $this->users[$this->uids[$uid1]]['level'] , $this->users[$this->uids[$uid2]]['level']) == 1 ) {
-				$proboi = $witm_data['add_m9'];
-				$r['pb'] = 1;
-			}*/
-
-		//������ ��������� �� % ������ � ������ ���� (������)
-		/*if( $witm_data['sv_m9'] > 0 ) {
-				$proboi = $witm_data['sv_m9'];
-				$r['pb'] = 1;
-			}*/
-		//������ ��������� �� % ������ � ������ ���� (�����)
-
-		if ($witm['2h'] > 0) {
-			//$witm_data['sv_yron_min'] = $witm_data['sv_yron_min']*2;
-			//$witm_data['sv_yron_max'] = $witm_data['sv_yron_max']*2;
-		}
-
 		$y = $this->yrn(
-		//$st1, $st2, $u1, $u2, $level, $level2, $type, $min_yron, $max_yron, $min_bron, $max_bron,
-		//$vladenie, $power_yron, $power_krit, $zashita, $ozashita, $proboi, $weapom_damage
 			$this->stats[$this->uids[$uid1]],
 			$this->stats[$this->uids[$uid2]],
 			$this->users[$this->uids[$uid1]],
@@ -5839,17 +5373,6 @@ class battleClass
 		//���� ������ ������ - ���� ���� �� 50%
 		$wp1 = $this->stats[$this->uids[$uid1]]['items'][$this->stats[$this->uids[$uid1]]['wp3id']];
 		$wp2 = $this->stats[$this->uids[$uid1]]['items'][$this->stats[$this->uids[$uid1]]['wp14id']];
-		/*if( $wp == 14 ) {
-				if( $wp1['level'] >= $wp2['level'] ) {
-					$r['y'] = floor( $r['y'] * 0.5 );
-					$r['k'] = floor( $r['k'] * 0.5 );
-				}
-			}elseif( $wp == 3 ) {
-				if( $wp2['level'] > $wp1['level'] ) {
-					$r['y'] = floor( $r['y'] * 0.5 );
-					$r['k'] = floor( $r['k'] * 0.5 );
-				}
-			}*/
 
 		//��� �� ������
 		if ($witm['type'] == 18) {
@@ -5984,22 +5507,12 @@ class battleClass
 				//
 				$at[$a]['atack'][$j]['yhod'] = $yhod[$a];
 				//
-				/*if ($checkhp1>0)
-					{*/
 				if (!isset($at[$a]['atack'][$j]['yron']) && (
 						$at[$a]['atack'][$j][1] == 1 ||
 						$at[$a]['atack'][$j][1] == 4 ||
 						$at[$a]['atack'][$j][1] == 5)
 				) {
-					//
-					//$at[$a]['atack'][$j]['yron'] = $this->yronGetrazmen($u1,$u2,$wp,$at[$a]['atack'][$j][0]);
 					$at[$a]['atack'][$j]['yron'] = $this->yronGetrazmen($u1, $u2, $wp, $at[$a]['atack'][$j][0], $yhod[$b]);
-					/*if ($checkhp1 <1)
-							{
-							$at[$a]['atack'][$j]['yron']['y']=0;
-							$at[$a]['atack'][$j]['yron']['k']=0;
-							}*/
-
 
 					if ($at[$a]['atack'][$j][1] == 4) {
 						$at[$a]['atack'][$j]['yron']['y_old'] = $at[$a]['atack'][$j]['yron']['y'];
@@ -6017,25 +5530,10 @@ class battleClass
 					} else {
 						$at[$a]['atack'][$j]['yron']['r'] = '-' . $at[$a]['atack'][$j]['yron']['y'];
 					}
-
-					/*if(	($at[$a]['atack'][$j][1] == 1 ||
-								$at[$a]['atack'][$j][1] == 4 ||
-								$at[$a]['atack'][$j][1] == 5)&& $at[$a]['atack'][$j][2] != 3)
-									{
-										$checkhp1=$checkhp1-$at[$a]['atack'][$j]['yron']['y'];
-									}*/
-
-
 					//
 				} else {
 					//
-					//$at[$a]['atack'][$j]['block'] = $this->yronGetrazmen($u1,$u2,$wp,$at[$a]['atack'][$j][0]);
 					$at[$a]['atack'][$j]['block'] = $this->yronGetrazmen($u1, $u2, $wp, $at[$a]['atack'][$j][0], $yhod[$b]);
-					/*if ($checkhp1 <1)
-							{
-							$at[$a]['atack'][$j]['block']['y']=0;
-							$at[$a]['atack'][$j]['block']['k']=0;
-							}*/
 					if ($at[$a]['atack'][$j][1] == 4) {
 						$at[$a]['atack'][$j]['block']['y_old'] = $at[$a]['atack'][$j]['block']['y'];
 						$at[$a]['atack'][$j]['block']['y'] = round($at[$a]['atack'][$j]['block']['k'] / 2);
@@ -6052,67 +5550,9 @@ class battleClass
 					} else {
 						$at[$a]['atack'][$j]['block']['r'] = '-' . $at[$a]['atack'][$j]['block']['y'];
 					}
-					/*
-							if(	($at[$a]['atack'][$j][1] == 1 ||
-								$at[$a]['atack'][$j][1] == 4 ||
-								$at[$a]['atack'][$j][1] == 5)&& $at[$a]['atack'][$j][2] != 3)
-									{
-									$checkhp1=$checkhp1-$at[$a]['atack'][$j]['block']['y'];
-									}*/
-					//
 				}
-				/*}
-					else
-					{
-
-						if( $at[$a]['atack'][$j][1] == 1 ||	$at[$a]['atack'][$j][1] == 4 ||	$at[$a]['atack'][$j][1] == 5 )
-						 {
-							//
-							$at[$a]['atack'][$j]['yron'] = $this->yronGetrazmen($u1,$u2,$wp,$at[$a]['atack'][$j][0]);
-							$at[$a]['atack'][$j]['yron']['y']=0;
-							$at[$a]['atack'][$j]['yron']['k']=0;
-							if( $at[$a]['atack'][$j][1] == 4 ) {
-								$at[$a]['atack'][$j]['yron']['y_old'] = $at[$a]['atack'][$j]['yron']['y'];
-								$at[$a]['atack'][$j]['yron']['y'] = round($at[$a]['atack'][$j]['yron']['k']/2);
-							}elseif( $at[$a]['atack'][$j][1] == 5 ) {
-								$at[$a]['atack'][$j]['yron']['y_old'] = $at[$a]['atack'][$j]['yron']['y'];
-								$at[$a]['atack'][$j]['yron']['y'] = $at[$a]['atack'][$j]['yron']['k'];
-							}
-							$at[$a]['atack'][$j]['yron']['2h'] = $witm['2h'];
-							$at[$a]['atack'][$j]['yron']['w'] = $wp;
-							if( $at[$a]['atack'][$j]['yron']['y'] < 1 ) {
-								$at[$a]['atack'][$j]['yron']['r'] = '--';
-							}else{
-								$at[$a]['atack'][$j]['yron']['r'] = '-' . $at[$a]['atack'][$j]['yron']['y'];
-							}
-							//
-						}else{
-							//
-							$at[$a]['atack'][$j]['block'] = $this->yronGetrazmen($u1,$u2,$wp,$at[$a]['atack'][$j][0]);
-							$at[$a]['atack'][$j]['block']['y']=0;
-							$at[$a]['atack'][$j]['block']['k']=0;
-							if( $at[$a]['atack'][$j][1] == 4 ) {
-								$at[$a]['atack'][$j]['block']['y_old'] = $at[$a]['atack'][$j]['block']['y'];
-								$at[$a]['atack'][$j]['block']['y'] = round($at[$a]['atack'][$j]['block']['k']/2);
-							}elseif( $at[$a]['atack'][$j][1] == 5 ) {
-								$at[$a]['atack'][$j]['block']['y_old'] = $at[$a]['atack'][$j]['block']['y'];
-								$at[$a]['atack'][$j]['block']['y'] = $at[$a]['atack'][$j]['block']['k'];
-							}
-							$at[$a]['atack'][$j]['block']['2h'] = $witm['2h'];
-							$at[$a]['atack'][$j]['block']['w'] = $wp;
-							if( $at[$a]['atack'][$j]['block']['y'] < 1 ) {
-								$at[$a]['atack'][$j]['block']['r'] = '--';
-							}else{
-								$at[$a]['atack'][$j]['block']['r'] = '-' . $at[$a]['atack'][$j]['block']['y'];
-							}
-							//
-						}
-
-
-					}*/
 				$j++;
 			}
-
 			$i++;
 		}
 
@@ -6723,18 +6163,6 @@ class battleClass
 				$j++;
 			}
 			//������ ������
-			/*$j = 0;
-				while( $j <= count( $this->stats[$this->uids[$u1]]['u_priem'] ) ) {
-					if( $this->stats[$this->uids[$u1]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u1]]['u_priem'][$j][4] == 8 ) {
-						if(file_exists('../../_incl_data/class/priem/'.$this->stats[$this->uids[$u1]]['u_priem'][$j][1].'.php')) {
-							$pr_used_this = $u1;
-							require('priem/'.$this->stats[$this->uids[$u1]]['u_priem'][$j][1].'.php');
-							$at = $fx_priem($id,$at,$u1,$j);
-							unset(${'fx_priem'});
-						}
-					}
-					$j++;
-				}*/
 
 			$i++;
 		}
@@ -7003,12 +6431,6 @@ class battleClass
 					$yron = $fx_moment($u2, $u1, $j, $yron, $profil);
 					unset(${'fx_moment'});
 					//
-					/*}else{
-							echo '[('.$u2.')';
-							print_r($this->stats[$this->uids[$u2]]['um_priem']);
-							echo '!]';
-							echo '[USED:'.$this->stats[$this->uids[$u2]]['u_priem'][$j][1].']';
-						}*/
 				}
 			}
 			$j++;
@@ -7025,10 +6447,6 @@ class battleClass
 						$yron = $fx_moment($u1, $u2, $j, $yron, $profil, $inlog);
 					}
 					unset(${'fx_moment'});
-					/*$pr_tested_this = $u1;
-						require('priem/'.$this->stats[$this->uids[$u1]]['u_priem'][$j][1].'.php');
-						$at = $fx_priem($id,$at,$u1,$j);
-						unset(${'fx_priem'});*/
 				}
 			}
 			$j++;
@@ -7061,10 +6479,6 @@ class battleClass
 						$yron = $fx_moment($u2, $u1, $j, $yron, $profil, $inlog);
 					}
 					unset(${'fx_moment'});
-					/*$pr_tested_this = $u1;
-						require('priem/'.$this->stats[$this->uids[$u1]]['u_priem'][$j][1].'.php');
-						$at = $fx_priem($id,$at,$u1,$j);
-						unset(${'fx_priem'});*/
 				}
 			}
 			if ($this->stats[$this->uids[$u2]]['u_priem'][$j][2] > 0 && $this->stats[$this->uids[$u2]]['u_priem'][$j][4] == 9) {
@@ -7075,10 +6489,6 @@ class battleClass
 						$yron = $fx_moment($u2, $u1, $j, $yron, $profil, $inlog);
 					}
 					unset(${'fx_moment'});
-					/*$pr_tested_this = $u1;
-						require('priem/'.$this->stats[$this->uids[$u1]]['u_priem'][$j][1].'.php');
-						$at = $fx_priem($id,$at,$u1,$j);
-						unset(${'fx_priem'});*/
 				}
 			}
 			$j++;
@@ -7209,13 +6619,6 @@ class battleClass
 			'uid2' => $this->atacks[$id]['uid2']
 		];
 		//
-		/*
-			if( $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0 ) {
-				$this->atacks[$id]['uid1'] = $this->atacks[$id]['uid2'];
-			}elseif( $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod'] > 0 ) {
-				$this->atacks[$id]['uid2'] = $this->atacks[$id]['uid1'];
-			}
-			*/
 		if (isset($this->atacks[$id]) && $this->atacks[$id]['lock'] == 0) {
 
 			//����� ��������� �������
@@ -7287,15 +6690,6 @@ class battleClass
 				$j--;
 				$i++;
 			}
-			if ($u->info['admin'] > 0) {
-				//die('test');
-			}
-			//
-			//UPDATE ... SET `lock` = 1
-			//�������� ��������������
-			//$this->a_save_stats($this->atacks[$id]['uid1']);
-			//$this->a_save_stats($this->atacks[$id]['uid2']);
-			//
 
 			//�������������� ����� 1% �� ���
 			if ($this->atacks[$id]['out1'] == 0) {
@@ -7315,10 +6709,6 @@ class battleClass
 				}
 				$this->users[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'];
 			}
-			//
-			//$this->users[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'];
-			//$this->users[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'];
-			//
 
 			//���������
 			if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['antm3'] != 0) {
@@ -7327,18 +6717,6 @@ class battleClass
 			if ($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['antm3'] != 0) {
 				$this->stats[$this->uids[$this->atacks[$id]['uid1']]]['m3'] -= round($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['antm3']);
 			}
-			//���� � ������� �������� ������ ������ - ��������� ������ ��,,
-			/*if( $this->users[$this->uids[$this->atacks[$id]['uid1']]]['level'] == 7 ) {
-					if( $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['s2'] > 55 ) {
-						$this->stats[$this->uids[$this->atacks[$id]['uid1']]]['m5'] += ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['s2']-5)*6;
-					}
-				}
-
-				if( $this->users[$this->uids[$this->atacks[$id]['uid2']]]['level'] == 7 ) {
-					if( $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['s2'] > 55 ) {
-						$this->stats[$this->uids[$this->atacks[$id]['uid2']]]['m5'] += ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['s2']-5)*6;
-					}
-				}*/
 
 			//
 			$last_yrn = [
@@ -7358,29 +6736,11 @@ class battleClass
 			$this->priemsRazmenMoment($id, $at);
 			$this->priemsRazmen($id, $at);
 
-			// ��������� ������� (�������� ���� ����� ������, ���� �����, ���� ����)
-			if ($this->atacks[$id]['uid2'] == 1) {
-				//	$this->stats[$this->uids[$this->atacks[$id]['uid1']]]['zona'] += 1;
-				//	$this->stats[$this->uids[$this->atacks[$id]['uid2']]]['zona'] += 1;
-			}
 			$at = $this->newRazmen($id);
 
 			// ��������� ����� ��� ����� ���� �������� ��� �����
 			// ������, �����������, ����, ������� ����, ���� �����
 			// ���� ����� (���� ���� ���, �������)
-			/*
-				$at = $this->mf4Razmen($id,$at,0);
-				// ����
-				$at = $this->mf2Razmen($id,$at,0);
-				// ������
-				$at = $this->mf1Razmen($id,$at,0);
-				// �����������
-				$at = $this->mf3Razmen($id,$at,0);
-				// ���������
-				$at = $this->mf5Razmen($id,$at,0);
-				// ������� ��� ����� � ����
-				$at = $this->yronRazmen($id,$at);
-				*/
 			$at = $this->mf2Razmen($id, $at, $v); //����
 			$at = $this->mf3Razmen($id, $at, $v); //�����������
 			$at = $this->mf4Razmen($id, $at, $v); //���� �����
@@ -7410,25 +6770,12 @@ class battleClass
 			$at = $this->updateHealth($id, $at);
 
 			// ������� � ���� + ���������� ���������� ���
-			//mysql_query('LOCK TABLES battle_logs WRITE');
 			$this->addlogRazmen($id, $at);
-			//mysql_query('UNLOCK TABLES');
-			//echo $this->seeRazmen($id,$at);
-			// NEW BATTLE SYSTEM
 
 			//��������� ����� ���������
 			$this->magicItems($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2'], $id);
 			$this->magicItems($this->atacks[$id]['uid2'], $this->atacks[$id]['uid1'], $id);
 
-			/*
-				if( $this->stats[$this->uids[$vrm['uid1']]]['yhod'] > 0 ) {
-					$this->atacks[$id]['uid1'] = $vrm['uid1'];
-				}elseif( $this->stats[$this->uids[$vrm['uid2']]]['yhod'] > 0 ) {
-					$this->atacks[$id]['uid2'] = $vrm['uid2'];
-				}
-				*/
-
-			//
 			//��������� ���� �����
 			$this->restZonb($this->atacks[$id]['uid1'], $this->atacks[$id]['uid2']);
 			//��������� �������� �������
@@ -7444,45 +6791,12 @@ class battleClass
 			while ($i5 < 51) {
 				if (isset($zd1[$i5]) && $zd1[$i5] > 0) {
 					//���� ������ �� ������� ���
-					//$tstpm = mysql_fetch_array(mysql_query('SELECT `id` FROM `priems` WHERE `id` = "'.$zd1id[$i5].'" AND `activ` = 1 AND `img` NOT LIKE "wis_%" LIMIT 1'));
-					//
-					//if(isset($tstpm['id'])) {
-					//
 					$zd1[$i5] -= 1;
-					//}elseif( $this->users[$this->uids[$this->atacks[$id]['uid2']]]['id'] == $this->users[$this->uids[$this->atacks[$id]['uid1']]]['enemy'] ) {
-					//�������� ������ �� ��������� ���
-					//	$zd1[$i5] -= 1;
-					//}else{
-					//�� �������� (������ �� ��� ������� ���)
-					//	if(!isset($prmos[$zd1id[$i5]])) {
-					//		$prmos[$zd1id[$i5]] = mysql_fetch_array(mysql_query('SELECT `id`,`tr_hod` FROM `priems` WHERE `id` = "'.$zd1id[$i5].'" LIMIT 1'));
-					//	}
-					//	if( $prmos[$zd1id[$i5]]['tr_hod'] > 0 ) {
-					//		$zd1[$i5] -= 1;
-					//	}
-					//}
 				} else {
 					$zd1[$i5] = 0;
 				}
 				if (isset($zd2[$i5]) && $zd2[$i5] > 0) {
-					//���� ������ �� ������� ���
-					//$tstpm = mysql_fetch_array(mysql_query('SELECT `id` FROM `priems` WHERE `id` = "'.$zd2id[$i5].'" AND `activ` = 1 AND `img` NOT LIKE "wis_%" LIMIT 1'));
-					//
-					//if(isset($tstpm['id'])) {
-					//
 					$zd2[$i5] -= 1;
-					//}elseif( $this->users[$this->uids[$this->atacks[$id]['uid1']]]['id'] == $this->users[$this->uids[$this->atacks[$id]['uid2']]]['enemy'] ) {
-					//�������� ������ �� ��������� ���
-					//	$zd2[$i5] -= 1;
-					//}else{
-					//�� �������� (������ �� ��� ������� ���)
-					//	if(!isset($prmos[$zd2id[$i5]])) {
-					//		$prmos[$zd2id[$i5]] = mysql_fetch_array(mysql_query('SELECT `id`,`tr_hod` FROM `priems` WHERE `id` = "'.$zd2id[$i5].'" LIMIT 1'));
-					//	}
-					//	if( $prmos[$zd2id[$i5]]['tr_hod'] > 0 ) {
-					//		$zd2[$i5] -= 1;
-					//	}
-					//}
 				} else {
 					$zd2[$i5] = 0;
 				}
@@ -7547,14 +6861,6 @@ class battleClass
 					WHERE `battle` = "' . $this->info['id'] . '" AND `uid` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1');
 			//�������������� ����� 25% �� �������� �� ���
 
-
-			//$this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] += floor($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['s6']/4 /*+ $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hod_minmana']*/ );
-			//$this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'] += floor($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['s6']/4 /*+ $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hod_minmana']*/ );
-			//
-			//$this->users[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['mpNow'];
-			//$this->users[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'] = $this->stats[$this->uids[$this->atacks[$id]['uid2']]]['mpNow'];
-			//
-
 			$last_yrn = [
 				1 => $last_yrn[1],
 				2 => $last_yrn[2],
@@ -7564,13 +6870,6 @@ class battleClass
 
 			$last_yrn[100] = floor($last_yrn[10] - $last_yrn[1]);
 			$last_yrn[200] = floor($last_yrn[20] - $last_yrn[2]);
-
-			/*
-				$this->users[$this->uids[$this->atacks[$id]['uid1']]]['last_yrn'] = $last_yrn[100];
-				$this->users[$this->uids[$this->atacks[$id]['uid2']]]['last_yrn'] = $last_yrn[200];
-				unset($last_yrn);
-				*/
-
 			if ($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod'] > 0) {
 				$this->save_stats($this->yhod_user($this->atacks[$id]['uid2'], $this->atacks[$id]['uid1'], $this->stats[$this->uids[$this->atacks[$id]['uid1']]]['yhod']));
 			} elseif ($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['yhod'] > 0) {
@@ -7617,27 +6916,6 @@ class battleClass
 				WHERE `id` = "' . $this->atacks[$id]['uid2'] . '" LIMIT 1');
 			//
 			$this->priemsRazmenMomentEnd($id, $at);
-			//
-			//������� ��������� ������ ������ tr_life_user
-			/*if( floor($this->stats[$this->uids[$this->atacks[$id]['uid1']]]['hpNow']) < 1 ) {
-					$sp = mysql_query('SELECT * FROM `eff_users` WHERE `tr_life_user` = "'.$this->atacks[$id]['uid1'].'" AND `delete` = "0" LIMIT 50');
-					while( $pl = mysql_fetch_array($sp) ) {
-						$pl['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "'.$pl['v2'].'" LIMIT 1'));
-						$this->delPriem($pl,$this->users[$this->uids[$this->atacks[$id]['uid1']]],3,$this->atacks[$id]['uid2']);
-						echo 1;
-					}
-					echo 2;
-				}
-				if( floor($this->stats[$this->uids[$this->atacks[$id]['uid2']]]['hpNow']) < 1 ) {
-					$sp = mysql_query('SELECT * FROM `eff_users` WHERE `tr_life_user` = "'.$this->atacks[$id]['uid2'].'" AND `delete` = "0" LIMIT 50');
-					while( $pl = mysql_fetch_array($sp) ) {
-						$pl['priem'] = mysql_fetch_array(mysql_query('SELECT * FROM `priems` WHERE `id` = "'.$pl['v2'].'" LIMIT 1'));
-						$this->delPriem($pl,$this->users[$this->uids[$this->atacks[$id]['uid2']]],3,$this->atacks[$id]['uid1']);
-						echo 3;
-					}
-					echo 4;
-				}*/
-			//
 			//�������� ����� ������ \ �������
 			$j = 1;
 			$jn = 1;
@@ -7720,12 +6998,6 @@ class battleClass
 								//echo '[��������������� '.round(rand($pvr['x1'],$pvr['x2'])).'% ����.]';
 								unset($pvr);
 							}
-							/*
-								$re = $priem->hodUsePriem($eff[$i],$eff[$i]['priem']);
-								if(isset($re['hod'])) {
-									$eff[$i]['hod'] = $re['hod'];
-								}
-								*/
 							if (isset($this->rehodeff[$eff[$i]['id']])) {
 								$eff[$i]['hod'] = $this->rehodeff[$eff[$i]['id']];
 							}
@@ -7831,20 +7103,12 @@ class battleClass
 			mysql_query('DELETE FROM `battle_act` WHERE ( `uid1` = "' . $this->atacks[$id]['uid1'] . '" AND `uid2` = "' . $this->atacks[$id]['uid2'] . '" ) OR
 				( `uid2` = "' . $this->atacks[$id]['uid1'] . '" AND `uid1` = "' . $this->atacks[$id]['uid2'] . '" )');
 
-			//$this->a_restart_stats($this->atacks[$id]['uid1'],1);
-			//$this->a_restart_stats($this->atacks[$id]['uid2'],1);
 
 			unset($old_s1, $old_s2);
 			unset($this->ga[$this->atacks[$id]['uid1']][$this->atacks[$id]['uid2']], $this->ga[$this->atacks[$id]['uid2']][$this->atacks[$id]['uid1']]);
 			unset($this->ag[$this->atacks[$id]['uid1']][$this->atacks[$id]['uid2']], $this->ag[$this->atacks[$id]['uid2']][$this->atacks[$id]['uid1']]);
 			unset($this->atacks[$id]);
 			mysql_query('DELETE FROM `battle_act` WHERE `id` = "' . $id . '" LIMIT 1');
-			//
-			//���������� ������ ��������������
-			/*
-				$this->stats[$this->uids[$this->atacks[$id]['uid1']]] = $old_s1;
-				$this->stats[$this->uids[$this->atacks[$id]['uid2']]] = $old_s2;
-				*/
 			unset($old_s1, $old_s2);
 			//
 		}
@@ -7906,83 +7170,6 @@ class battleClass
 		$this->add_log($mas1);
 	}
 
-
-	//������� ��� ���
-	/*	public function logCache()
-		{
-			global $c,$u,$log_text;
-			sleep(2);
-			$thishodID = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_logs` WHERE `battle` = "'.$this->info['id'].'" ORDER BY `id` DESC LIMIT 1'));
-			if(isset($hodID['id'])) {
-				$hodID = $hodID['id'];
-			}else{
-				$hodID = 0;
-			}
-			if( $hodID > $this->info['hod'] ) {
-				unlink("../../battle_logs/btl_".$this->info['id'].".js");
-				$this->info['hod'] = $hodID;
-				mysql_query('UPDATE `battle` SET `hod` = "'.$hodID.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if( $u->info['design'] == 1 ) {
-					$js = ''; $pll = 0;
-					if($_POST['idlog']<1){ $_POST['idlog'] = 0; }
-					//
-					$sp = mysql_query('SELECT
-					`id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2`
-					FROM `battle_logs` WHERE `battle` = "'.$this->info['id'].'" AND `id` > '.mysql_real_escape_string($_POST['idlog']).' AND `id_hod` > '.($this->hodID-7).' LIMIT 100');
-					$jin = 0; $forYou2 = 0;
-					while($pl = mysql_fetch_array($sp))
-					{
-						$jin++;
-						$rt = $pl['text'];
-						$pl['vars'] = str_replace('^^^^','rvnO',$pl['vars']);
-						$rt = str_replace('{tm1}','<span class=\"date {fru}\">'.date('H:i',$pl['time']).'</span>',$rt);
-						$rt = str_replace('{tm2}','<span class=\"date {fru}\">'.date('H:i',$pl['time']).'</span>',$rt);
-						$rt = str_replace('{tm3}','<span class=\"date {fru}\">'.date('d.m.Y H:i',$pl['time']).'</span>',$rt);
-						$rt = str_replace('{tm4}','<span class=\"date {fru}\">'.date('d.m.Y H:i',$pl['time']).'</span>',$rt);
-						$pl['text'] = $rt;
-						unset($rt);
-						if($pll < $pl['id']) {
-							$pll = $pl['id'];
-						}
-						$js = 'add_log('.$pl['id'].','.$forYou2.',"'.$pl['text'].'",'.$pl['id_hod'].',0,0,"'.str_replace('"','&quot;',$pl['vars']).'");'.$js;
-					}
-					$js .= 'id_log='.$pll.';';
-				}else{
-					$js = ''; $pll = 0;
-					if($_POST['idlog']<1){ $_POST['idlog'] = 0; }
-					//
-					$sp = mysql_query('SELECT
-					`id`,`type`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zona2`,`zonb1`,`zonb2`
-					FROM `battle_logs` WHERE `battle` = "'.$this->info['id'].'" AND `id` > '.mysql_real_escape_string($_POST['idlog']).' AND `id_hod` > '.($this->hodID-7).' LIMIT 100');
-					$jin = 0; $forYou2 = 0;
-					while($pl = mysql_fetch_array($sp))
-					{
-						$jin++;
-						$rt = $pl['text'];
-						//$rt = str_replace('^^^^','=',$rt);
-						$pl['vars'] = str_replace('^^^^','rvnO',$pl['vars']);
-						$rt = str_replace('{tm1}','<span class=\"date {fru}\">'.date('H:i',$pl['time']).'</span>',$rt);
-						$rt = str_replace('{tm2}','<span class=\"date {fru}\">'.date('H:i',$pl['time']).'</span>',$rt);
-						$rt = str_replace('{tm3}','<span class=\"date {fru}\">'.date('d.m.Y H:i',$pl['time']).'</span>',$rt);
-						$rt = str_replace('{tm4}','<span class=\"date {fru}\">'.date('d.m.Y H:i',$pl['time']).'</span>',$rt);
-						$pl['text'] = $rt;
-						unset($rt);
-						if($pll < $pl['id']) {
-							$pll = $pl['id'];
-						}
-						$js = 'add_log('.$pl['id'].','.$forYou2.',"'.$pl['text'].'",'.$pl['id_hod'].',0,0,"'.str_replace('"','&quot;',$pl['vars']).'");'.$js;
-					}
-					$js .= 'id_log='.$pll.';';
-				}
-				//
-				$fp = fopen("battle_logs/btl_".$this->info['id'].".js", "w");
-				fwrite($fp, 'var vlogid = '.$this->info['hod'].';var loadingLogNow = true;function logRefleshedCache(){ '.$js.' }');
-				fclose($fp);
-				//
-			}
-			return true;
-		}*/
-
 	//������� ��� ���
 	public function lookLog()
 	{
@@ -8240,54 +7427,6 @@ class battleClass
 		$t[11]['z'] = round(0 + $itm['tym7']);
 		$t[11]['t'] = 11;
 
-		//������ �������� �������
-		/*
-				$inr = array();
-				$i = 1;
-				while( $i <= 11 ) {
-					if( $t[$i] > 0 ) {
-						$j = 0;
-						while( $j < $t[$i] ) {
-							//if(isset($itm['tya'.$i]) && $itm['tya'.$i] > 0 && $i < 5 && $itm['tya'.$i] > 0) {
-								//$inr[] = $i;
-							//}elseif(isset($itm['tym'.($i-4)]) && $itm['tym'.($i-4)] > 0 && $i > 4 && $itm['tym'.($i-4)] > 0) {
-								//$inr[] = $i;
-							//}
-							if( isset($itm['tya'.$i]) && $itm['tya'.$i] > 0 ) {
-								$inr[] = $i;
-								$rk .= '*'.$i.'='.$j.'%*|';
-							}else{
-								$rk .= ''.$i.'='.$j.'%|';
-							}
-							$j++;
-						}
-						//if( $u->info['admin'] > 0 ) {
-
-						//}
-					}
-					$i++;
-				}
-				//shuffle($inr);
-				$tp = $inr[rand(0,count($inr)-1)];
-				if( !isset($itm['tya'.$tp]) || $itm['tya'.$tp] < 1 ) {
-					if(isset($item['id'])) {
-						$this->error($u->info['id'],'battle::weaponTx. ��� ������: id ��������: -'.$item['id'].'-b<a href="/logs.php?log='.$this->info['id'].'" target="_blank">'.$this->info['id'].'</a>.(��� �����: tya'.$tp.'['.$itm['tya'.$tp].']).(��������� ���� �����: '.$rk.').(���������� ��������� ����: '.count($inr).')');
-					}
-				}
-
-				//��� �� ������
-				if( $item['type'] == 18 ) {
-					$tp = 1;
-				}elseif( $item['type'] == 19 ) {
-					$tp = 2;
-				}elseif( $item['type'] == 20 ) {
-					$tp = 3;
-				}elseif( $item['type'] == 21 ) {
-					$tp = 4;
-				}else{
-					//$tp = 0;
-				}*/
-
 		$tpt = $t[0]['z'];
 		$tpmin = $t[0];
 		$tpmax = $t[0];
@@ -8325,12 +7464,6 @@ class battleClass
 		return $tp;
 	}
 
-	//������� ������
-	/*public function error($login,$t) {
-			mysql_query('INSERT INTO `chat_system` (`text`,`city`,`login`,`to`,`type`,`new`,`time`) VALUES ("<font color=#cb0000>'.mysql_real_escape_string($t).'</font>","capitalcity","<font color=green>�������</font>","'.$login.'","3","1","'.time().'")');
-		}*/
-
-
 	//������ ����� �� ������
 	public function weaponAt($item, $st, $x)
 	{
@@ -8494,36 +7627,6 @@ class battleClass
 		);
 		*/
 
-	/*
-		public function domino_all($v1,$v2,$d1,$d2) {
-			// �������� ������ 1 , �������� ������ 2 , ���� 1 , ���� 2
-			//������ �������
-			$mx = 0;
-			$cs = array(NULL,'����','������','����','�������','���������','���');
-			$r = array(
-				0 => 0,
-				'����'=>array(),
-				'����'=>array(),
-				'������'=>array(),
-				'���������'=>array(),
-				'�������'=>array(),
-				'���'=>array()
-			);
-			$i = 0;
-			while($i <= 7) {
-				if(isset($v1[$i]) || isset($v2[$i])) {
-					$r[$cs[$i]] = round(((1+($v1[$i]*1.3)-$v2[$i]+$d1[$i]+$d2[$i])/1300),2);
-					if($v1[$i] > $mx) {
-						$mx = $v1[$i];
-						$r[0] = $cs[$i];
-						$r[1] = $i;
-					}
-				}
-				$i++;
-			}
-			return $r;
-		}*/
-
 	public function yronLvl($lvl1, $lvl2)
 	{
 		$r = [
@@ -8619,11 +7722,6 @@ class battleClass
 				*/
 		];
 
-		//$p['M'] = $p['M'] * 0.70;
-		//$p['K'] = $p['K'] * 0.70; //��� �������� �����
-
-		//���������� 1.33 ��� �������� � 1.00 ��� ����� ����
-		//if ($weapom_damage == 0) { $p['T'] = 1; }elseif($weapom_damage == 1) { $p['T'] = 2.33;$p['iT'] = 2.33;}
 
 		$witmdata = $this->lookStats($witm['data']);
 
@@ -8666,95 +7764,11 @@ class battleClass
 			$p['S'] = 0;
 			$p['U'] = 0; // ��� ������(����� ������������
 		}
-		//��� ����� ��������
-		//�������
-		/*if($r['type'] == 1) {			//s2 �����
-					if ($st1['s2']<100)
-					{
-						$p['S'] = $p['S']*0.15;
-					}elseif ($st1['s2']>=150 && $st1['s2']<250){
-						$p['S'] = $p['S']*0.25;
-					}elseif ($st1['s2']>=250 && $st1['s2']<300){
-						$p['S'] = $p['S']*0.50;
-					}elseif ($st1['s2']>=300){
-						$p['S'] = $p['S']*0.65;
-					}
-
-				//�������
-				}elseif($r['type'] == 2) {		//s1 ����
-					if ($st1['s1']<100)
-					{
-						$p['S'] = $p['S']*0.25;
-					}elseif ($st1['s1']>=100 && $st1['s1']<200){
-						$p['S'] = $p['S']*0.35;
-					}elseif ($st1['s1']>=200 && $st1['s1']<250){
-						$p['S'] = $p['S']*0.45;
-					}elseif ($st1['s1']>=250){
-						$p['S'] = $p['S']*0.50;
-					}
-
-				//��������
-				}elseif($r['type'] == 3) {		//s1 ����
-					if ($st1['s1']<100)
-					{
-						$p['S'] = $p['S']*0.50;
-					}elseif ($st1['s1']>=125 && $st1['s1']<150){
-						$p['S'] = $p['S']*0.65;
-					}elseif ($st1['s1']>=150 && $st1['s1']<175){
-						$p['S'] = $p['S']*0.75;
-					}elseif ($st1['s1']>=175){
-						$p['S'] = $p['S']*0.85;
-					}
-
-				//�������
-				}elseif($r['type'] == 4) {		//s3 ����
-					if ($st1['s3']<100)
-					{
-						$p['S'] = $p['S']*0.10;
-					}elseif ($st1['s3']>=150 && $st1['s3']<200){
-						$p['S'] = $p['S']*0.15;
-					}elseif ($st1['s3']>=200 && $st1['s3']<250){
-						$p['S'] = $p['S']*0.20;
-					}elseif ($st1['s3']>=250){
-						$p['S'] = $p['S']*0.25;
-					}
-
-				}*/
 
 		$r['bron']['rnd'] = rand($r['bron'][0], $r['bron'][1]);
 
-		//
-		/*$r['bron'] = array($min_bron, $max_bron); //����� ���� ���� ����
-				$r['bron']['rnd'] = rand($r['bron'][0],$r['bron'][1]);
-				//$r['bron']['rnd'] += $r['bron']['rnd']*0.01; //������������ �������� ����� +1%
-
-				$r['za'] = $zashita; //������ �� �����
-				$r['oza'] = $ozashita; //����������� ������ �� �����
-
-				$r['zm'] = $zashitam; //������ �� �����
-				$r['ozm'] = $ozashitam; //����������� ������ �� �����*/
-
-
-		/*
-	//������� ����
-				r.B[0] = $('#v1').val() * 0.51;
-				r.B[1] = r.B[0] + 3.73;
-				r.B[0] = Math.ceil(r.B[0]);
-				r.B[1] = Math.floor(r.B[1]);
-				if( r.B[0] < 0 ) { r.B[0] = 0; }
-				if( r.B[1] < 0 ) { r.B[1] = 0; }
-				r.B[0] += 5;
-				r.B[1] += 6;
-				//
-				*/
-
-		//��������� �������	 (���������)
-		//$p['B'][0] = $st1['s1']*0.51;
-		//$p['B'][1] = $p['B'][0] + 3.73;
 		$p['B'][0] = 2 + $level + $st1['s1'] - round($st1['s1'] / 5);
 		$p['B'][1] = $p['B'][0] + 3;
-		/*$p['B'][0] += 5;
-				$p['B'][1] += 6;*/
 
 		$p['B']['rnd'] = rand($p['B'][0], $p['B'][1]);
 		$p['W']['rnd'] = rand($p['W'][0], $p['W'][1]);
@@ -8767,143 +7781,31 @@ class battleClass
 		} else {
 			$r['min'] = (($p['B'][0] + $p['S'] * 2 + $weapom_min * 2 + $p['U'] * 2) * $p['T']) * (1 + $p['M'] / 100);
 			$r['max'] = (($p['B'][1] + $p['S'] * 2 + $weapom_max * 2 + $p['U'] * 2) * $p['T']) * (1 + $p['M'] / 100);
-			//$r['min']  = (($p['B'][0]+$p['S']+$weapom_min)*$p['T']*(1+($u1['level']/200)*$p['U']))*(1+$p['M']/100);
-			//$r['max']  = (($p['B'][1]+$p['S']+$weapom_max)*$p['T']*(1+($u1['level']/200)*$p['U']))*(1+$p['M']/100);
 			if ($witmdata['tr_lvl'] < $level) {
-				/*
-							$minp = 3*($level-$witmdata['tr_lvl']);
-							$r['min'] -= ceil($r['min'] / 100 * $minp);
-							$r['max'] -= ceil($r['max'] / 100 * $minp);
-						*/
 			}
 		}
 
-		//$r['minm'] = $r['min']*0.13;
-		//$r['maxm'] = $r['max']*0.13;
-
-		/*if( $wp_type == 22 ) {
-					//������
-					$r['min'] = $r['min']/2;
-					$r['max'] = $r['max']/2;
-				}*/
-
-		//����������� ����
-		//�����
-		//$r['Kmin'] = $r['min'];
-		//$r['Kmax'] = $r['max'];
-
-		/*$r['min'] += $weapom_min;
-				$r['max'] += $weapom_max;
-				$r['Kmin'] += $weapom_min*2;
-				$r['Kmax'] += $weapom_max*2;*/
-
-		//����������� �������� �����
-		//$r['min_'] = floor($r['min']*0.13);
-		//$r['max_'] = floor($r['max']*0.13);
-		//$r['Kmin_'] = floor($r['Kmin']*0.13);
-		//$r['Kmax_'] = floor($r['Kmax']*0.13);
-
-		//����������� ������
-		//$r['ozash_rnd'] = $r['oza'][$r['type']][1]; /*rand($r['oza'][$r['type']][0],$r['oza'][$r['type']][1]);*/
-
-		//if($r['ozash_rnd'] > 80) { $r['ozash_rnd'] = 80; }
-		//if($r['ozash_rnd'] < 0) { $r['ozash_rnd'] = 0; }
-
-
-		//$r['ozash_rnd'] = 100-$r['ozash_rnd'];
-
-		//$p['iT']
-
-		/*$r['min'] = floor($r['min']*$p['iT'] + $weapom_min);
-				$r['max'] = floor($r['max']*$p['iT'] + $weapom_max);
-				$r['Kmin'] = floor($r['Kmin']*$p['iT'] + $weapom_min*2);
-				$r['Kmax'] = floor($r['Kmax']*$p['iT'] + $weapom_max*2);
-				$r['min_'] = floor($r['min_']*$p['iT'] + $weapom_min);
-				$r['max_'] = floor($r['max_']*$p['iT'] + $weapom_max);
-				$r['Kmin_'] = floor($r['Kmin_']*$p['iT'] + $weapom_min*2);
-				$r['Kmax_'] = floor($r['Kmax_']*$p['iT'] + $weapom_max*2);
-				*/
-
-		//$r['min'] -= ($r['min']/(200+$r['ozash_rnd'])*$r['ozash_rnd']);
-		//$r['max'] -= ($r['max']/(200+$r['ozash_rnd'])*$r['ozash_rnd']);
-
-		//$r['Kmin'] -= ($r['Kmin']/(200+$r['ozash_rnd'])*$r['ozash_rnd']);
-		//$r['Kmax'] -= ($r['Kmax']/(200+$r['ozash_rnd'])*$r['ozash_rnd']);
-
 		$r['bRND'] = $p['B']['rnd'];
-
-		//$r['min'] += $min_yron;
-		//$r['max'] += $max_yron;
-
-		//
-
-		/*if( $r['minm'] > $r['min'] ) {
-					$r['min'] = $r['minm'];
-				}
-				if( $r['maxm'] > $r['max'] ) {
-					$r['max'] = $r['maxm'];
-				}*/
-
 		$r['Kmin'] = ceil((2 + (0 + $p['K'] / 100)) * $r['min']);
 		$r['Kmax'] = ceil((2 + (0 + $p['K'] / 100)) * $r['max']);
 
-		//$r['Kmin'] = ceil( ( 1 + ( 1 + $p['K']/100 ) ) * $r['min']);
-		//$r['Kmax'] = ceil( ( 1 + ( 1 + $p['K']/100 ) ) * $r['max']);
-
-		//$r['Kmin'] = ceil( ( $r['min'] * 2 ) * ( 1 + $p['K']/100 ));
-		//$r['Kmax'] = ceil( ( $r['max'] * 2 ) * ( 1 + $p['K']/100 ));
-
-		//$r['Kmin'] = ceil( ( $r['min'] ) * ( 2 + $p['K']/100 ));
-		//$r['Kmax'] = ceil( ( $r['max'] ) * ( 2 + $p['K']/100 ));
-		//
-		//$r['Kminm'] = $r['Kmin']*0.05;
-		//$r['Kmaxm'] = $r['Kmax']*0.05;
-
 		//������ �����
 		//��� ��������
 		if ($r['type'] < 5 || $r['type'] == 12) {
 			$r['min_abron'] = round($r['min'] * 0.05);
 			$r['max_abron'] = round($r['max'] * 0.05);
 
-			/*if($proboi != 0) {
-						$r['bron']['rndold'] = $r['bron']['rnd'];
-						$r['yrnrz'] = $r['max']-$r['min'];
-						if( $r['yrnrz'] < 0 ) {
-							$r['yrnrz'] = -$r['yrnrz'];
-						}
-					}*/
 			if ($proboi != 0) {
 				$r['bron']['rndold'] = $r['bron']['rnd'];
-				//$r['bron']['rnd'] = floor($r['bron']['rnd']/100*(100-$proboi));
-				//if( $r['bron']['rnd'] < $r['bron'][0] ) {
 				$r['bron']['rnd'] = 0;//$r['bron'][0];
-				//}
-				/*if( round($r['min']*0.45) < $r['bron']['rnd'] ) {
-							$r['bron']['rnd'] = round($r['min']*0.55);
-						}
-						//
-						$r['yrnrz'] = $r['max']-$r['min'];
-						if( $r['yrnrz'] < 0 ) {
-							$r['yrnrz'] = -$r['yrnrz'];
-						}*/
 			}
 
-			//����� ����������� � �����
-			if ($r['bron']['rnd'] > $r['min']) {
-				//	$r['bron']['rnd'] = $r['min'];
-			}
-			//
-
 			$r['Kmin'] -= $r['bron']['rnd'] * 2; //���� �������� �� 2
 			$r['Kmax'] -= $r['bron']['rnd'] * 2; //���� �������� �� 2
 
 			$r['min'] -= $r['bron']['rnd']; //�� ���� ������� �� �� ��.
 			$r['max'] -= $r['bron']['rnd']; //�� ���� ������� �� �� ��.
 
-			if ($proboi != 0) {
-				//   $r['yrnrz']
-				//   $r['bron']['rndold']
-			}
 		}
 
 		//������ ������ (�� ����� 80%)
@@ -8924,20 +7826,6 @@ class battleClass
 			$r['Kmax'] = round($r['Kmax'] / 100 * (100 - $this->zmgo($st2['zm'])));
 		}
 
-		/*if( $r['Kminm'] > $r['Kmin'] ) {
-					$r['Kmin'] = $r['Kminm'];
-				}
-				if( $r['Kmaxm'] > $r['Kmax'] ) {
-					$r['Kmax'] = $r['Kmaxm'];
-				}
-
-				if( $r['minm'] > $r['min'] ) {
-					$r['min'] = $r['minm'];
-				}
-				if( $r['maxm'] > $r['max'] ) {
-					$r['max'] = $r['maxm'];
-				}*/
-
 		$r['min'] = round($r['min']);
 		$r['max'] = round($r['max']);
 		$r['Kmin'] = round($r['Kmin']);
@@ -8945,49 +7833,6 @@ class battleClass
 
 		$min_yrn = 0; //%
 
-		//if( $wp_type == 18 ) {
-		//$min_yrn = 17;
-		//}
-
-		//�������
-		/*if($r['type'] == 1) {
-					$min_yrn += 50;
-				//�������
-				}elseif($r['type'] == 2) {
-					$min_yrn += 40;
-				//��������
-				}elseif($r['type'] == 3) {
-					$min_yrn += 35;
-				//�������
-				}elseif($r['type'] == 4) {
-					$min_yrn += 60;
-				//����������
-				}elseif($r['type'] >= 5){
-
-				}else {
-
-				}
-
-				//
-				if( $p['M'] > 0 ) {
-					//$min_yrn -= $p['M']/100*20;
-				}
-				//
-				if( $p['Mage'] == true && $r['type'] != 1 ) {
-					//$min_yrn += 30;
-				}
-				//
-				if( $r['type'] >= 5 ) {
-					$min_yrn += $zm_proc;
-				}else{
-					$min_yrn += $za_proc;
-				}
-				if($r['type'] < 5){
-					//$min_yrn += 50;
-				}*/
-
-		//$min_yrn = 33;
-
 		if ($u1['clone'] > 0) {
 			$min_yrn = 75;
 		}
@@ -9022,52 +7867,10 @@ class battleClass
 		$r['Kmin_'] -= floor($defd * 2);
 		$r['Kmax_'] -= floor($defd * 2);
 
-		/*
-				if($r['type'] == 4) {
-					$r['Kmin'] -= floor($r['Kmin']/100*10);
-					$r['Kmax'] -= floor($r['Kmax']/100*10);
-					$r['Kmin_'] -= floor($r['Kmin_']/100*10);
-					$r['Kmax_'] -= floor($r['Kmax_']/100*10);
-				}
-				*/
-
 		$r['min'] += $st1['maxAtack'];
 		$r['max'] += $st1['maxAtack'];
 		$r['Kmin'] += $st1['maxAtack'] * 2;
 		$r['Kmin'] += $st1['maxAtack'] * 2;
-
-		/*$r['min_'] += $st1['maxAtack'];
-				$r['max_'] += $st1['maxAtack'];
-				$r['Kmin_'] += $st1['maxAtack']*2;
-				$r['Kmin_'] += $st1['maxAtack']*2;*/
-
-
-		/*
-				if($r['min'] < round($weapom_min/2)) {
-					$r['min'] = round($weapom_min/2);
-				}
-				if($r['max'] < round($weapom_max/2)) {
-					$r['max'] = round($weapom_max/2);
-				}
-				if($r['Kmin'] < round($weapom_min)) {
-					$r['Kmin'] = round($weapom_min);
-				}
-				if($r['Kmax'] < round($weapom_max)) {
-					$r['Kmax'] = round($weapom_max);
-				}
-				if($r['min_'] < round($weapom_min/2)) {
-					$r['min_'] = round($weapom_min/2);
-				}
-				if($r['max_'] < round($weapom_max/2)) {
-					$r['max_'] = round($weapom_max/2);
-				}
-				if($r['Kmin_'] < round($weapom_min)) {
-					$r['Kmin_'] = round($weapom_min);
-				}
-				if($r['Kmax_'] < round($weapom_max)) {
-					$r['Kmax_'] = round($weapom_max);
-				}
-				*/
 		if ($r['min'] < 1) {
 			$r['min'] = 1;
 		}
@@ -9213,30 +8016,19 @@ class battleClass
 	//������ ������
 	public function aPower($za, $za1, $yrn)
 	{
-		$z = 0;
-		/*$z = ($za+$za1)*0.35;
-			$z = round($yrn/$z*100);*/
-
-		$z = (1 - (pow(0.5, (($za + $za1) / 250)))) * 100;
-		return $z;
+		return (1 - (pow(0.5, (($za + $za1) / 250)))) * 100;
 	}
 
 	//������ �����
 	public function bronGo($min, $max)
 	{
-		$v = 0;
-		//$v = ceil(($min+$max)/2,$max);
-		$v = ceil($min, $max);
-		return $v;
+		return ceil($min, $max);
 	}
 
 	//������ ����� (test)
 	public function bronGoTest($min, $max)
 	{
-		$v = 0;
-		//$v = ceil(($min+$max)/2,$max);
-		$v = ceil(round($min, $max));
-		return $v;
+		return ceil(round($min, $max));
 	}
 
 	//��������� ������ �� �������
@@ -9257,17 +8049,13 @@ class battleClass
 	//������ ����������� �������
 	public function mfsgo1($a, $b)
 	{
-
-		$r = $this->form_mf($a, $b);
-		return $r;
+		return $this->form_mf($a, $b);
 	}
 
 	//������ ����������� �����
 	public function mfsgo2($a, $b)
 	{
-
-		$r = $this->form_mf($a, $b);
-		return $r;
+		return $this->form_mf($a, $b);
 	}
 
 	//������ ��. (�����)
@@ -9346,7 +8134,6 @@ class battleClass
 				$r += 65;
 			} else { //> 75
 				$r = 85;
-				//$r = 75 + 0.01 * abs(($mf-1000));
 			}
 		}
 
@@ -9554,12 +8341,6 @@ class battleClass
 					$rval = 1;
 				}
 
-				//$rval = (1-( pow(0.75, ($rval/125) ) ))*100;
-
-				//if( $rval > 60 ) {
-				//	$rval = 60;
-				//}
-
 				break;
 			case 4:
 				$mf = round($mf * 0.6);
@@ -9629,84 +8410,46 @@ class battleClass
 
 	public function get_chanse($percent)
 	{
-		/*$a = 101+$percent;
-			$b = 100-$percent;
-			$i = 1;
-			if(($a-$b)>0){
-				while($i<=$a-$b){
-					$conp[] = rand(1,100);
-					//$conp[] = mt_rand(1,100);
-					if( $i > 100 ) {
-						$i = ($a-$b+1);
-					}
-					$i++;
-				}
-			}
-			$t = count($conp);
-			$prob = round($percent);
-			if(@array_search($prob,$conp)!=false){
-				$critical = true;
-			}else{
-				$critical = false;
-			}*/
-		/*if( rand(0,100) <= $percent ) {
-				$critical = true;
-			}else{
-				$critical = false;
-			}*/
-		if ($percent >= 100) {
-			$percent = 100;
-		} elseif ($percent == 0) {
-			$percent = 0;
-		}
-		$critical = $this->dodge(1, $percent);
-		return $critical;
+		return $this->dodge(1, min($percent, 100));
 	}
 
 	//������ �����
 	public function get_chanse_new($persent)
 	{
-		$mm = 1;
-		if (mt_rand($mm, 100 * $mm) <= $persent * $mm) {
-			return true;
-		} else {
-			return false;
-		}
+		return mt_rand(1, 100) <= $persent;
 	}
 
 	//����� ����������
 	public function smena($uid, $auto = false, $lastdie = false)
 	{
 		global $u;
-		if (($auto == false && $u->info['smena'] > 0) || $auto == true) {
-			if ($this->stats[$this->uids[$u->info['id']]]['hpNow'] >= 1) {
-				if (isset($this->uids[$uid]) && $uid != $u->info['id'] && $this->users[$this->uids[$uid]]['team'] != $this->users[$this->uids[$u->info['id']]]['team']) {
-					if (!isset($this->ga[$u->info['id']][$uid]) || $lastdie == true) {
-						if (ceil($this->stats[$this->uids[$uid]]['hpNow']) >= 1) {
-							//������ ����������
-							if ($auto == false) {
-								$u->info['smena']--;
-							}
-							$upd = mysql_query('UPDATE `stats` SET `enemy` = "' . $uid . '",`smena` = "' . $u->info['smena'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-							$u->info['enemy'] = $uid;
-							$this->users[$this->uids[$uid]]['smena'] = $u->info['smena'];
-							$this->users[$this->uids[$u->info['id']]]['enemy'] = $uid;
-							return 1;
-						} else {
-							return '������ �������, ��������� ��� �����';
-						}
-					} else {
-						return '������ ������� �� ��������� ����!';
-					}
-				} else {
-					return '������ ������� �� ��������� ���� []';
-				}
-			} else {
-				return '��� ��� �������� ��������, �������� ���� �������� ������...';
-			}
-		} else {
+		if (($auto != false || $u->info['smena'] <= 0) && $auto != true) {
 			return '� ��� ����������� ����� ����������';
 		}
+		if ($this->stats[$this->uids[$u->info['id']]]['hpNow'] < 1) {
+			return '��� ��� �������� ��������, �������� ���� �������� ������...';
+		}
+		if (!isset(
+			$this->uids[$uid]) ||
+			$uid == $u->info['id'] ||
+			$this->users[$this->uids[$uid]]['team'] == $this->users[$this->uids[$u->info['id']]]['team']
+		) {
+			return '������ ������� �� ��������� ���� []';
+		}
+		if (isset($this->ga[$u->info['id']][$uid]) && $lastdie != true) {
+			return '������ ������� �� ��������� ����!';
+		}
+		if (ceil($this->stats[$this->uids[$uid]]['hpNow']) < 1) {
+			return '������ �������, ��������� ��� �����';
+		}//������ ����������
+		if ($auto == false) {
+			$u->info['smena']--;
+		}
+			$upd = mysql_query('UPDATE `stats` SET `enemy` = "' . $uid . '",`smena` = "' . $u->info['smena'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+			$u->info['enemy'] = $uid;
+			$this->users[$this->uids[$uid]]['smena'] = $u->info['smena'];
+			$this->users[$this->uids[$u->info['id']]]['enemy'] = $uid;
+			return 1;
 	}
 
 	//����-����� ���������� //��� ��� ������
@@ -9772,73 +8515,14 @@ class battleClass
 			}
 		} else {
 			if ($u->info['enemy'] < 0) {
-				$smnr5 = $this->smena(-($u->info['enemy']), true);
-				/*if( $smnr5 != 1 ) {
-						if( !isset($this->uids[(-($u->info['enemy']))]) ) {
-							$u->info['enemy'] = $ms_all[rand(0,(count($ms_all)-1))];
-							mysql_query('UPDATE `stats` SET `enemy` = "'.$u->info['enemy'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-						}
-					}*/
-				unset($smnr5);
+				$this->smena(-($u->info['enemy']), true);
 			}
 		}
 	}
 
-	//����-����� ���������� new
-	/*public function autoSmena()
-		{
-			global $u;
-			$ms = array();
-			$ms_all = array();
-			$i = 0; $j = 0;
-			while($i<count($this->users))
-			{
-				if(isset($this->users[$i]) && $this->users[$i]['id']!=$u->info['id'] && $this->users[$i]['team']!=$u->info['team'] && $this->stats[$i]['hpNow']>=1 && -($u->info['enemy']) != $this->users[$i]['id'])
-				{
-					if(!isset($this->ga[$u->info['id']][$this->users[$i]['id']]))
-					{
-						$ms[$j] = $this->users[$i]['id'];
-						$j++;
-					}
-					if( !isset($this->uids[(-($u->info['enemy']))]) ) {
-						$ms_all[] = $this->users[$i]['id'];
-					}
-				}
-				$i++;
-			}
-
-			$ms = $ms[rand(0,$j-1)];
-			if($j>0)
-			{
-				$this->smena($ms,true);
-			}else{
-				if( $u->info['enemy'] < 0 ) {
-					$smnr5 = $this->smena(-($u->info['enemy']),true);
-					if( $smnr5 != 1 ) {
-						//$u->info['enemy'] = -($u->info['enemy']);
-						//mysql_query('UPDATE `stats` SET `enemy` = "'.$u->info['enemy'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-						if( !isset($this->uids[(-($u->info['enemy']))]) ) {
-							$u->info['enemy'] = $ms_all[rand(0,(count($ms_all)-1))];
-							mysql_query('UPDATE `stats` SET `enemy` = "'.$u->info['enemy'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-						}
-						//echo '<font color=red><strong>Fatal error: '.$smnr5.' #'.$j.'</strong></font>';
-					}
-					unset($smnr5);
-					//mysql_query('UPDATE `stats` SET `enemy` = "'.$u->info['enemy'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				}
-			}
-		}*/
-
 	//�������� ���� (�����)
 	public function botAtack($uid, $pl, $tp)
 	{
-		/*if (isset($uid['id'])) {$uidt=$uid['id'];} else {$uidt=$uid;}
-			if (isset($pl['id'])) {$plt=$pl['id'];} else {$plt=$pl;}
-			$test_uid = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "'.$uidt.'" AND `hpNow` >= 1 LIMIT 1'));
-			$test_pl = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `id` = "'.$plt.'" AND `hpNow` >= 1 LIMIT 1'));
-			if (isset($test_uid['id']) && isset($test_pl['id']) && $test_uid['id']!=$test_pl['id'])
-			{
-			}*/
 		$test_atack = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_act` WHERE `battle` = "' . $this->info['id'] . '" AND ((
 				`uid1` = "' . $pl . '" AND `uid2` = "' . $uid . '"
 			) OR (
@@ -9886,7 +8570,6 @@ class battleClass
 			}
 		}
 
-		//unset($test_uid,$test_pl,$test_atack);
 	}
 
 	//��������� �����, ������, ������, ������
@@ -9898,15 +8581,11 @@ class battleClass
 		$botA = [];
 		$botR = [];
 		while ($pl = mysql_fetch_array($m)) {
-			//mysql_query('DELETE FROM `battle_act` WHERE `battle` = "'.$this->info['id'].'" AND `uid1` = "'.$pl['uid2'].'" AND `uid2` = "'.$pl['uid1'].'"');
 			$pluids = mysql_fetch_array(mysql_query('SELECT `hpNow` FROM `stats` WHERE (`id` = "' . $pl['uid1'] . '"  AND `hpNow` <= 0) OR (`id` = "' . $pl['uid2'] . '" AND `hpNow` <= 0) LIMIT 1'));
-
 			$pltest = mysql_fetch_array(mysql_query('SELECT * FROM `battle_act`  WHERE `id` = "' . $pl['id'] . '" LIMIT 1'));
 			if (isset($pltest['id'])) {
-
 				if (isset($pluids['hpNow'])) {
 					mysql_query('DELETE FROM `battle_act` WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
-
 				} elseif ($pl['time'] + $this->info['timeout'] > time()) {
 					//���� �� �������� �� �����, ������ ������� ������
 					$this->atacks[$pl['id']] = $pl;
@@ -9924,7 +8603,6 @@ class battleClass
 					}
 				} else {
 					//������� �� �����
-					//mysql_query('UPDATE `battle_act` SET `time`="'.time().'"  WHERE `id` = "'.$pl['id'].'" LIMIT 1');
 					$pl['time'] = time();
 					if ($pl['a1'] == 0 && $pl['a2'] == 0) {
 						//����� 1 ��������� �� �����
@@ -9947,7 +8625,6 @@ class battleClass
 						$this->atacks[$pl['id']] = $pl;
 						$this->startAtack($pl['id']);
 						mysql_query('DELETE FROM `battle_act` WHERE `id` = "' . $pl['id'] . '"');
-						//mysql_query('DELETE FROM `battle_act` WHERE (`uid1` = "'.$pl['uid1'].'" AND `uid2` = "'.$pl['uid2'].'") OR (`uid1` = "'.$pl['uid2'].'" AND `uid2` = "'.$pl['uid1'].'")');
 					}
 				}
 			}
@@ -9975,7 +8652,6 @@ class battleClass
 			$bot = $this->bots[$i];
 			if (isset($bot) && $this->stats[$this->uids[$bot]]['hpNow'] >= 1 && $this->stats[$this->uids[$bot]]['pass'] != 'saintlucia') //��� �������� �� ���� saintlucia
 			{
-				//mysql_query('UPDATE `stats` SET `timeGo` = "'.$tnbot.'" WHERE `id` = "'.$this->users[$this->uids[$bot]]['id'].'" LIMIT 1');
 				$j = 0;
 				while ($j < count($this->users)) {
 					if ($this->info['razdel'] == 0) {
@@ -10077,10 +8753,6 @@ class battleClass
 			} else {
 				$this->hodID = 0;
 			}
-			/*if( $this->hodID > $b['hod'] ) {
-					$b['hod'] = $this->hodID;
-					mysql_query('UPDATE `battle` SET `hod` = "'.$this->hodID.'" WHERE `id` = "'.$b['id'].'" LIMIT 1');
-				}*/
 			return $b;
 		} else {
 			return false;
@@ -10188,10 +8860,6 @@ class battleClass
 							");
 					}
 
-
-					#��� ����� ��������� ������� ����) Ost. Costa
-					#$this->users[$i]['tactic7'] += $this->stats[$i]['s7'];
-					#####
 					// ���� ����� animal_bonus
 					if ($this->users[$i]['animal'] > 0) {
 
@@ -10257,20 +8925,15 @@ class battleClass
 								$mas1['text'] = '{tm1} {u2} ������� �� ���������, � ������� �������� &quot;<strong>' . $tpa3[$a['type']] . ' [' . $a['level'] . ']</strong>&quot; �� {u1}. (' . $ba . ')';
 								$nxtlg[count($nxtlg)] = $mas1;
 								mysql_query('UPDATE `users_animal` SET `eda` = `eda` - 1 WHERE `id` = "' . $a['id'] . '" LIMIT 1');
-								//$this->add_log($mas1);
 								$this->get_comment();
-							} else {
-								//$u->send('',$this->users[$i]['room'],$this->users[$i]['city'],'',$this->users[$i]['login'],'<strong>'.$a['name'].'</strong> ��������� � ���...',time(),6,0,0,0,1);
 							}
 						}
 					}
 
 					mysql_query('UPDATE `stats` SET `last_hp` = "0",`tactic1`="0",`tactic2`="0",`tactic3`="0",`tactic4`="0",`tactic5`="0",`tactic6`="0",`tactic7` = "' . ($this->users[$i]['tactic7']) . '" WHERE `id` = "' . $this->users[$i]['id'] . '" LIMIT 1');
-
 					$rs[$this->users[$i]['team']] .= $u->microLogin($this->users[$i], 2) . ', ';
 				}
 				$up .= '`uid` = "' . $pl['id'] . '" OR';
-				//battle-user (����������, ���������)
 				$mybu = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_users` WHERE `battle` = "' . $this->info['id'] . '" AND `uid` = "' . mysql_real_escape_string($pl['id']) . '" LIMIT 1'));
 				if (!isset($mybu['id'])) {
 					//������ �������� ���������� ��� ������� ��������� �� ������� ���
@@ -10279,66 +8942,7 @@ class battleClass
 				$i++;
 			}
 
-			/*
-				if($i == 0) {
-					$t = mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "'.$this->info['id'].'" AND `st`.`hpNow` > 0');
-					$i = 0; $bi = 0; $up = '';
-					while($pl = mysql_fetch_array($t))
-					{
-						//���������� ������
-						if($pl['login2']=='')
-						{
-							$pl['login2'] = $pl['login'];
-						}
-						$this->users[$i] = $pl;
-						$this->uids[$pl['id']] = $i;
-						if($pl['bot']>0)
-						{
-							$this->bots[$bi] = $pl['id'];
-							$this->iBots[$pl['id']] = $bi;
-							$bi++;
-						}
-						//���������� �����
-						$this->stats[$i] = $u->getStats($pl,0);
-						//������� �����
-						if($this->info['start1']==0)
-						{
-							if(!isset($ts[$this->users[$i]['team']]))
-							{
-								$tsi++;
-								$ts[$this->users[$i]['team']] = $tsi;
-							}
-
-							if($this->users[$i]['level']<=7)
-							{
-								$this->users[$i]['tactic7'] = floor(10/$this->stats[$i]['hpAll']*$this->stats[$i]['hpNow']);
-							}elseif($this->users[$i]['level']==8)
-							{
-								$this->users[$i]['tactic7'] = floor(20/$this->stats[$i]['hpAll']*$this->stats[$i]['hpNow']);
-							}elseif($this->users[$i]['level']==9)
-							{
-								$this->users[$i]['tactic7'] = floor(30/$this->stats[$i]['hpAll']*$this->stats[$i]['hpNow']);
-							}elseif($this->users[$i]['level']>=10)
-							{
-								$this->users[$i]['tactic7'] = floor(40/$this->stats[$i]['hpAll']*$this->stats[$i]['hpNow']);
-							}
-
-							$this->users[$i]['tactic7'] += $this->stats[$i]['s7'];
-
-							mysql_query('UPDATE `stats` SET `tactic1`="0",`tactic2`="0",`tactic3`="0",`tactic4`="0",`tactic5`="0",`tactic6`="0",`tactic7`="0",`tactic7` = "'.($this->users[$i]['tactic7']).'" WHERE `id` = "'.$this->users[$i]['id'].'" LIMIT 1');
-
-							$rs[$tsi] .= $u->microLogin($this->users[$i],2).', ';
-						}
-						$up .= '`uid` = "'.$pl['id'].'" OR';
-						$i++;
-					}
-				}
-				*/
-
 			$up = rtrim($up, ' OR');
-			//mysql_query('UPDATE `eff_users` SET `timeAce` = "0" WHERE ('.$up.') AND `delete` = "0"');
-			//echo '<hr><hr><hr>';
-
 			//������� � ��� ������ ��������
 
 			if ($this->info['start1'] == 0) {
@@ -10545,11 +9149,7 @@ class battleClass
 		while ($i < count($tms)) {
 			$teams[$tms[$i]] = ltrim($teams[$tms[$i]], ', ');
 			if ($teams[$tms[$i]] != '') {
-				//if($u->info['team'] == $tms[$i]) {
-				//	$teams[$tms[$i]] = '<img src=\"https://img.new-combats.com/i/lock3.gif\" style=\"cursor:pointer\" width=\"20\" height=\"15\" onClick=\"top.chat.addto(\'team\',\'private\'); return false;\"> '.$teams[$tms[$i]];
-				//}else{
 				$teams[$tms[$i]] = '<img src=\"https://img.new-combats.com/i/lock3.gif\" style=\"cursor:pointer\" width=\"20\" height=\"15\" onClick=\"top.chat.addto(\'team' . $tms[$i] . '\',\'private\'); return false;\"> ' . $teams[$tms[$i]];
-				//}
 				$ret .= $teams[$tms[$i]];
 				if (count($tms) > $i + 1) {
 					$ret .= ' <span class=\"CSSvs\">&nbsp; ������ &nbsp;</span> ';
@@ -10596,9 +9196,6 @@ class battleClass
 			$img = 'eff_travma4.gif';
 		}
 		$timeEnd = $timeEnd * 3600;
-		//
-		//$timeEnd = $timeEnd/3600;
-		//
 		$ins = mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ("0","' . time() . '","-1","' . $name . '","' . $data . '","' . $uid . '", "4", "' . $img . '","' . $timeEnd . '", "' . $v1 . '")');
 		$ins = mysql_query('INSERT INTO `eff_users` (`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES ("0","' . time() . '","-1","���������: ������ �� �����","add_notravma=1","' . $uid . '", "263", "cure1.gif","21600", "")');
 	}
@@ -10706,5 +9303,4 @@ class battleClass
 
 }
 
-$btl = new battleClass;
-?>
+$btl = new battleClass;
\ No newline at end of file
diff --git a/_incl_data/class/__dungeon.php b/_incl_data/class/__dungeon.php
index d642ea70..87d254dc 100644
--- a/_incl_data/class/__dungeon.php
+++ b/_incl_data/class/__dungeon.php
@@ -798,7 +798,7 @@ $r .= '<script>top.startHpRegen("main",'.($pl['id']+1000000000000).','.(0+$stt['
 							$i = count($a);
 						}
                     } elseif($s[0] == 'repl_ptp') {
-                      include('dnaction/_dungeon_replace.php');
+                      require_once('dnaction/_dungeon_replace.php');
                       die();
                       //header('Location: ../../modules_data/location/_dungeon_replace.php');
 					}elseif($s[0]=='add_eff') {
diff --git a/_incl_data/class/__filter_class.php b/_incl_data/class/__filter_class.php
index 8896a5fd..8dfeeb81 100644
--- a/_incl_data/class/__filter_class.php
+++ b/_incl_data/class/__filter_class.php
@@ -1,294 +1,168 @@
-<?
-if(!defined('GAME'))
+<?php
+if (!defined('GAME')) {
+    die();
+}
+
+class Filter
 {
-	die();
+    public function str_count($str, $col)
+    {
+        if (strlen($str) > $col) {
+            $str = substr($str, 0, $col);
+        }
+        return ($str);
+    }
+    //
+    //��������
+    public $sm = ["laugh" => 1, "fingal" => 1, "eek" => 1, "smoke" => 1, "hi" => 1, "bye" => 1, "king" => 1, "king2" => 1, "boks2" => 1, "boks" => 1, "gent" => 1, "lady" => 1, "tongue" => 1, "smil" => 1, "rotate" => 1, "ponder" => 1, "bow" => 1, "angel" => 1, "angel2" => 1, "hello" => 1, "dont" => 1, "idea" => 1, "mol" => 1, "super" => 1, "beer" => 1, "drink" => 1, "baby" => 1, "tongue2" => 1, "sword" => 1, "agree" => 1, "loveya" => 1, "kiss" => 1, "kiss2" => 1, "kiss3" => 1, "kiss4" => 1, "rose" => 1, "love" => 1, "love2" => 1, "confused" => 1, "yes" => 1, "no" => 1, "shuffle" => 1, "nono" => 1, "maniac" => 1, "privet" => 1, "ok" => 1, "ninja" => 1, "pif" => 1, "smash" => 1, "alien" => 1, "pirate" => 1, "gun" => 1, "trup" => 1, "mdr" => 1, "sneeze" => 1, "mad" => 1, "friday" => 1, "cry" => 1, "grust" => 1, "rupor" => 1, "fie" => 1, "nnn" => 1, "row" => 1, "red" => 1, "lick" => 1, "help" => 1, "wink" => 1, "jeer" => 1, "tease" => 1, "nunu" => 1, "inv" => 1, "duel" => 1, "susel" => 1, "nun" => 1, "kruger" => 1, "flowers" => 1, "horse" => 1, "hug" => 1, "str" => 1, "alch" => 1, "pal" => 1, "mag" => 1, "sniper" => 1, "vamp" => 1, "doc" => 1, "doc2" => 1, "sharp" => 1, "naem" => 1, "naem2" => 1, "naem3" => 1, "invis" => 1, "chtoza" => 1, "beggar" => 1, "sorry" => 1, "sorry2" => 1,
+        "creator" => 1, "grace" => 1, "dustman" => 1, "carreat" => 1, "lordhaos" => 1, "ura" => 1, "elix" => 1, "dedmoroz" => 1, "snegur" => 1, "showng" => 1, "superng" => 1, "podz" => 1, "sten" => 1, "devil" => 1, "cat" => 1, "owl" => 1, "lightfly" => 1, "snowfight" => 1, "rocket" => 1, "ball" => 1, "smile" => 1, "fuck" => 1];
+
+    public function e($t)
+    {
+        mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("#' . date('d.m.Y') . ' %' . date('H:i:s') . ': <b>' . mysql_real_escape_string($t) . '</b>","capitalcity","�������","6","1","-1")');
+    }
+
+    public function setOnline($online, $uid, $afk)
+    {
+        $add = 0;
+
+        if (time() - $online >= 1) {
+            if (time() - $online < 60) {
+                $add += time() - $online;
+            } else {
+                $add += 60;
+            }
+        }
+
+        if ($add > 0) {
+            $on = mysql_fetch_array(mysql_query('SELECT * FROM `online` WHERE `uid` = "' . $uid . '" LIMIT 1'));
+            if (isset($on['id'])) {
+                $mt = 0;
+                $lst = time();
+                if (date('d', $on['lastUp']) != date('d', $lst)) {
+                    $on['time_today'] = $add;
+                } else {
+                    $on['time_today'] += $add;
+                }
+                $add = $on['time_all'] + $add;
+                mysql_query('UPDATE `online` SET `mainTime` = "' . $mt . '",`time_today` = "' . $on['time_today'] . '",`lastUp` = "' . $lst . '",`time_all` = "' . $add . '" WHERE `id` = "' . $on['id'] . '" LIMIT 1');
+            }
+        }
+    }
+
+    public function mystr($string)
+    {
+        $str = strtolower($string);
+        if (strtolower('S') != 's') {
+            $ru = '�����Ũ��������������������������';
+            $ru2 = '��������������������������������';
+            $en = 'QWERTYUIOPASDFGHJKLZXCVBNM';
+            $en2 = 'qwertyuiopasdfghjklzxcvbnm';
+            $i = 0;
+            while ($i < 33) {
+                if (isset($ru[$i])) {
+                    $str = strtr($str, $ru[$i], $ru2[$i]);
+                }
+                if (isset($en[$i])) {
+                    $str = strtr($str, $en[$i], $en2[$i]);
+                }
+                $i++;
+            }
+        }
+        return $str;
+    }
+
+    public function spamFiltr($txt)
+    {
+
+        $txt = str_replace('�', '�', $txt);
+
+        $nospam = 0;
+        $txt = str_replace('&gt;', '', $txt);
+        $txt = str_replace('&lt;', '', $txt);
+        $txt = str_replace('&quot;', '', $txt);
+        $txt = $this->mystr($txt);
+        $i = 0;
+        while ($i <= count($this->sm)) {
+            if (isset($this->sm[$i])) {
+                $txt = preg_replace('/:' . $this->sm[$i] . ':/', "", $txt);
+            }
+            $i++;
+        }
+        /* ������ */
+        $spam = mysql_fetch_array(mysql_query('SELECT * FROM `spam_word` WHERE `id` = 1 LIMIT 1'));
+        $spam = $spam['data'];
+        //
+        $testEN = preg_replace('/[^a-z]*/i', '', $txt);
+        $testEN = preg_replace('/[^A-Z]*/i', '', $txt);
+        $testEN2 = $txt;
+
+        $testEN2 = str_replace('&quot;', '', $testEN2);
+        $testEN2 = str_replace('&nbsp;', '', $testEN2);
+        $testEN2 = str_replace('�', 'a', $testEN2);
+        $testEN2 = str_replace('�', 'b', $testEN2);
+        $testEN2 = str_replace('�', 'c', $testEN2);
+        $testEN2 = str_replace('�', 'b', $testEN2);
+        $testEN2 = str_replace('�', 'e', $testEN2);
+        $testEN2 = str_replace('�', 't', $testEN2);
+        $testEN2 = str_replace('�', 'o', $testEN2);
+        $testEN2 = str_replace('�', 'p', $testEN2);
+        $testEN2 = str_replace('�', 'm', $testEN2);
+        $testEN2 = str_replace('�', 'h', $testEN2);
+        $testEN2 = str_replace('�', 'y', $testEN2);
+        $testEN2 = str_replace('�', 'k', $testEN2);
+        $testEN2 = str_replace('�', 'u', $testEN2);
+        $testEN2 = str_replace('�', 'x', $testEN2);
+        $testEN2 = str_replace('�', '9', $testEN2);
+        $testEN2 = str_replace('()', 'o', $testEN2);
+        $testEN2 = str_replace('0', 'o', $testEN2);
+        $testEN2 = preg_replace('/[^a-z]*/i', '', $testEN2);
+        $testEN2 = preg_replace('/[^A-Z]*/i', '', $testEN2);
+        $testRU = preg_replace('/[^�-�]*/i', '', $txt);
+        $testRU = preg_replace('/[^�-�]*/i', '', $txt);
+
+        $testRU2 = $txt;
+        $testRU2 = str_replace('a', '�', $testRU2);
+        $testRU2 = str_replace('b', '�', $testRU2);
+        $testRU2 = str_replace('c', '�', $testRU2);
+        $testRU2 = str_replace('b', '�', $testRU2);
+        $testRU2 = str_replace('e', '�', $testRU2);
+        $testRU2 = str_replace('t', '�', $testRU2);
+        $testRU2 = str_replace('o', '�', $testRU2);
+        $testRU2 = str_replace('p', '�', $testRU2);
+        $testRU2 = str_replace('m', '�', $testRU2);
+        $testRU2 = str_replace('h', '�', $testRU2);
+        $testRU2 = str_replace('y', '�', $testRU2);
+        $testRU2 = str_replace('k', '�', $testRU2);
+        $testRU2 = str_replace('x', '�', $testRU2);
+        $testRU2 = str_replace('u', '�', $testRU2);
+        $testRU2 = str_replace('()', '�', $testRU2);
+        $testRU2 = str_replace('0', '�', $testRU2);
+        $testRU2 = preg_replace('/[^�-�]*/i', ' ', $testRU2);
+        $testRU2 = preg_replace('/[^�-�]*/i', ' ', $testRU2);
+        $i = 0;
+        $spe = explode('|', $spam);
+        while ($i <= count($spe)) {
+            if (
+                isset($spe[$i]) &&
+                $spe[$i] != '' &&
+                $spe[$i] != 'new-combats.com' &&
+                (
+                    stristr($testEN, $spe[$i]) ||
+                    stristr($testRU, $spe[$i])
+                )
+            ) {
+                $nospam .= '%' . $spe[$i];
+            }
+            $i++;
+        }
+        return $nospam;
+    }
+
+    public function __clone()
+    {
+        trigger_error('������������ �� �����������.', E_USER_ERROR);
+    }
 }
 
-class Filter {
-	//
-	public $spamtxt = 'acreshoperu|club|ly|gd|click|do|mibb|ml|us|cc|ee|gl|vc|bit|cutt|ow|is|ali|Utka|utka|su|Droplr|Bc|mirbk|worldofcombats|shambalru|oldcombats|oldbk2|oldbk|sebkru|oldbknet|welcombats|mycombats|vipbk|goldbk|recombats|legbkcom|febkru|skycombats|cambats|zagadnet|su0ru|suru|kgam|vkcc|acreshoperu|xaasu|googl|warcombatscom|skycombatsru|mycombatsnet|mycombatsru |worldcombatsru|oldcombats|fcitysu|isgd|ebby|greatcombatsru|greatcombats| u�to |cestparla|vbk2com|petitlienfr|scurtime|7pcguma| uto|yyyyt|�����|�cc|warcombatsxcom|wqdnl|qpsru|yahsru|ur1ca|gua|Lyrlfi|ally|hikg|haasu|mubkdoam|karues|0ll0ru|combatszcom|s0eru|bitdo|Clckru|uto|����������������|rkssu|ryru|mtgco|tynee|silverbkcom|hlru|h4lru|�cc|pfinkstenucoznet|5fsru|x0by|bkwarcom|realfight|rcombatsru|bcvc|toly|1likru|nnbb|urlinua|combatsz|cuttus|lly|zipvn|qrurlcc|seosprint|8bkz|kombatfight|warbk|owly|rebk|izipus|wonderlands|oldsbk|hecsu|combatslink|combatz|totc|alnoworld|bkz|bkxo|anberbk|sbkru|my�������|pysme|���2�� |urlidru|legcombats|realcombats|�����|wbtlink|Kombatsfighitru |combatsclubru|legendbattles|darkarmada|obk2com|Cruelbknet|vbk2com|mirozdatel|gggg|rcombats|oldmains|bitly|obkcom|sbk2ru|goodbk|allbk|lastbk|����������|crazycombats|linkac|s3sso|owly|cruelbk|likebk|isgd|fightbk|vbkcom|��������|vgd|hardfight|my-combats|my-combatc|mbk|goo|bkwar|anti|ws|s3s|bakubk|idealbk|bespridel|perbk|adminbk|online|cf|artovik|probk|twar|oyy|krbk|habk|timebk|sbi|s b i|eea|sokbk|inbk|refbk|administratorbk|perfektbk|darkbk|dark|s3s|bk20|analogbk|monstrbk|bk2005|legendabk|awOev|cruelcity|tlgr|vntr|supbk|azhon0p|cu|tn|af|svel|kwn|krati|ohh|gHjq|Narlands|ogw|lur|lmy|idz|hop|eee|bestbk|pixl|ssylka|THEBESTBK|f34r|exelendbk|9tl|9tk|qil|adminbk|2t9|sportbk|NjQ0|net|jq|bishky|getl|ixz|nvm|prok|5char|tdl|pick|jj|FORM|zik|biz|sns|snsh|pnut|Ventus-terra|pb8|short|legendabk|prnt|utf|coombats|Silver|Premium|Account|tiny|�������|���|orD�N��|nbk|orden|acreshoperu|shambalru|oldcombats|oldbk2|oldbk|sebkru|oldbknet|welcombats|mycombats|vipbk|goldbk|recombats|legbkcom|febkru|skycombats|COOMBATS|cambats|zagadnet|.ru|.net|.tk|.ucoz|www|.ua|.tv|.info|.org|.su|.��|.���|.����|. ru|. com|. net|. tk|. ucoz|. ua|. tv|. info|. org|. su|. ��|. ���|. ����|realdeal|������|����|���������|kortr|MIBBK|vip|�����|�p���|neverwords|xcombat|world|death|legendbattles|plu|dbe|kombatz|over|�orl�combt|dek|ci8|��|��|��2|���������|';
-	public $abuse = array(
-		"���","�����","������","�������","���","���","�����","�����","�����","�������","���",'�����','�����',
-		'�����','������','����','�����','�������'
-		,'������', '� � �', '����', '�����', '�����', '�����', '�����', '������', '�������', '������', '������', '���'
-	);
-	//
-	public function str_count($str,$col) 
-	{ 
-		if (strlen($str) > $col) 
-		{ 
-			$str = substr($str,0,$col); 
-		} 
-		return ($str); 
-	}
-	//
-	//��������
-	public $sm = array("laugh"=>1,"fingal"=>1,"eek"=>1,"smoke"=>1,"hi"=>1,"bye"=>1,"king"=>1,"king2"=>1,"boks2"=>1,"boks"=>1,"gent"=>1,"lady"=>1,"tongue"=>1,"smil"=>1,"rotate"=>1,"ponder"=>1,"bow"=>1,"angel"=>1,"angel2"=>1,"hello"=>1,"dont"=>1,"idea"=>1,"mol"=>1,"super"=>1,"beer"=>1,"drink"=>1,"baby"=>1,"tongue2"=>1,"sword"=>1,"agree"=>1,"loveya"=>1,"kiss"=>1,"kiss2"=>1,"kiss3"=>1,"kiss4"=>1,"rose"=>1,"love"=>1,"love2"=>1,"confused"=>1,"yes"=>1,"no"=>1,"shuffle"=>1,"nono"=>1,"maniac"=>1,"privet"=>1,"ok"=>1,"ninja"=>1,"pif"=>1,"smash"=>1,"alien"=>1,"pirate"=>1,"gun"=>1,"trup"=>1,"mdr"=>1,"sneeze"=>1,"mad"=>1,"friday"=>1,"cry"=>1,"grust"=>1,"rupor"=>1,"fie"=>1,"nnn"=>1,"row"=>1,"red"=>1,"lick"=>1,"help"=>1,"wink"=>1,"jeer"=>1,"tease"=>1,"nunu"=>1,"inv"=>1,"duel"=>1,"susel"=>1,"nun"=>1,"kruger"=>1,"flowers"=>1,"horse"=>1,"hug"=>1,"str"=>1,"alch"=>1,"pal"=>1,"mag"=>1,"sniper"=>1,"vamp"=>1,"doc"=>1,"doc2"=>1,"sharp"=>1,"naem"=>1,"naem2"=>1,"naem3"=>1,"invis"=>1,"chtoza"=>1,"beggar"=>1,"sorry"=>1,"sorry2"=>1,
-	"creator"=>1,"grace"=>1,"dustman"=>1,"carreat"=>1,"lordhaos"=>1,"ura"=>1,"elix"=>1,"dedmoroz"=>1,"snegur"=>1,"showng"=>1,"superng"=>1,"podz"=>1,"sten"=>1,"devil"=>1,"cat"=>1,"owl"=>1,"lightfly"=>1,"snowfight"=>1,"rocket"=>1,"ball"=>1,"smile"=>1,"fuck"=>1);
-
-	public function e($t) {
-		mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("#'.date('d.m.Y').' %'.date('H:i:s').': <b>'.mysql_real_escape_string($t).'</b>","capitalcity","�������","6","1","-1")');
-	}
-
-	public function setOnline($online,$uid,$afk)
-	{
-		$add = 0;
-		
-		if(time()-$online>=1)
-		{
-			if(time()-$online < 60) {
-				$add += time()-$online;
-			}else{
-				$add += 60;
-			}
-		}
-		
-		//$this->e('test');
-		
-		$afk = 0;
-		if($add>0)
-		{
-			$on = mysql_fetch_array(mysql_query('SELECT * FROM `online` WHERE `uid` = "'.$uid.'" LIMIT 1'));
-			if(isset($on['id']))
-			{
-				$mt = 0;
-				$lst = time();
-				if(date('d',$on['lastUp'])!=date('d',$lst))
-				{
-					$on['time_today'] = $add;
-				}else{
-					$on['time_today'] += $add;
-				}
-				$add = $on['time_all']+$add;
-				$afkNow = 0;
-				$afkAll = 0;
-				if($afk==1)
-				{
-					$mt = time();
-				}
-				mysql_query('UPDATE `online` SET `mainTime` = "'.$mt.'",`time_today` = "'.$on['time_today'].'",`lastUp` = "'.$lst.'",`time_all` = "'.$add.'" WHERE `id` = "'.$on['id'].'" LIMIT 1');
-			}
-		}
-	}
-
-	public function mystr($string)
-	{
-		$str = strtolower($string);
-		if(strtolower('S')!='s')
-		{
-			$ru  = '�����Ũ��������������������������';
-			$ru2 = '��������������������������������';
-			$en  = 'QWERTYUIOPASDFGHJKLZXCVBNM';
-			$en2 = 'qwertyuiopasdfghjklzxcvbnm';
-			$i = 0;
-			while($i<33)
-			{
-				if(isset($ru[$i]))
-				{
-					$str = strtr($str,$ru[$i],$ru2[$i]);
-				}
-				if(isset($en[$i]))
-				{
-					$str = strtr($str,$en[$i],$en2[$i]);
-				}
-				$i++;
-			}
-		}
-		return $str;
-	}
-	
-	public function reverse_i($str) 
-	{ 
-		/*$newstr = '';
-		for ($i=1; $i<=strlen($str); $i++) 
-		{ 
-			$newstr .= substr($str, -$i, 1); 
-		} */
-		$newstr = $str;
-		return $newstr; 
-	}
-	
-	public function antimat($txt) {
-		global $u;
-		$txt = ' '.$txt.' ';
-		//$vc = iconv( 'windows-1251' , 'UTF-8' , '��');
-		/*if( $u->info['admin'] > 0 ) {
-			$i = 0;
-			while( $i < count( $this->abuse ) ) {
-				$txt = iconv( 'windows-1251' , 'UTF-8' , $txt );
-				//
-				$word = $this->abuse[$i];
-				$word = iconv( 'windows-1251' , 'UTF-8' , $word);
-				//
-				$txt = str_replace(' #'.$word.'#is '," <i><f c=".$word." />&lt;".$vc."&gt;</i> ",$txt);
-				$txt = iconv( 'UTF-8' , 'windows-1251' , $txt );
-				$i++;
-			}
-		}else{*/
-			$i = 0;
-			while( $i < count( $this->abuse ) ) {
-				$txt = str_ireplace(' '.$this->abuse[$i].' ',' <i><f c='.$this->abuse[$i].' />&lt;��&gt;</i> ',$txt);
-				$i++;
-			}
-		//}
-		return $txt;
-	}
-	
-	public function spamFiltr($txt)
-	{
-		
-		$txt = str_replace('�','�',$txt);
-		
-		$nospam = 0;
-		$txt = str_replace('&gt;','',$txt);
-		$txt = str_replace('&lt;','',$txt);
-		$txt = str_replace('&quot;','',$txt);
-		$txt = $this->mystr($txt);
-		$i = 0;
-		$j = 0;
-		while($i <= count($this->sm))
-		{
-			if(isset($this->sm[$i]))
-			{
-				$txt = preg_replace('/:'.$this->sm[$i].':/',"",$txt);
-			}
-			$i++;
-		}
-		/* ������ */
-		//$spam = $this->spamtxt;	
-		$spam = mysql_fetch_array(mysql_query('SELECT * FROM `spam_word` WHERE `id` = 1 LIMIT 1'));
-		$spam = $spam['data'];
-		//	
-		$testEN = preg_replace('/[^a-z]*/i', '', $txt);
-		$testEN = preg_replace('/[^A-Z]*/i', '', $txt);
-		$testEN2 = $txt;
-		
-		$testEN2 = str_replace('&quot;','',$testEN2);
-		$testEN2 = str_replace('&nbsp;','',$testEN2);		
-		$testEN2 = str_replace('�','a',$testEN2);
-		$testEN2 = str_replace('�','b',$testEN2);
-		$testEN2 = str_replace('�','c',$testEN2);
-		$testEN2 = str_replace('�','b',$testEN2);
-		$testEN2 = str_replace('�','e',$testEN2);
-		$testEN2 = str_replace('�','t',$testEN2);
-		$testEN2 = str_replace('�','o',$testEN2);
-		$testEN2 = str_replace('�','p',$testEN2);
-		$testEN2 = str_replace('�','m',$testEN2);
-		$testEN2 = str_replace('�','h',$testEN2);
-		$testEN2 = str_replace('�','y',$testEN2);
-		$testEN2 = str_replace('�','k',$testEN2);
-		$testEN2 = str_replace('�','u',$testEN2);
-		$testEN2 = str_replace('�','x',$testEN2);
-		$testEN2 = str_replace('�','9',$testEN2);
-		$testEN2 = str_replace('()','o',$testEN2);
-		$testEN2 = str_replace('0','o',$testEN2);
-		$testEN2 = preg_replace('/[^a-z]*/i', '', $testEN2);
-		$testEN2 = preg_replace('/[^A-Z]*/i', '', $testEN2);		
-		$testRU = preg_replace('/[^�-�]*/i', '', $txt);
-		$testRU = preg_replace('/[^�-�]*/i', '', $txt);
-		
-		$testRU2 = $txt;
-		$testRU2 = str_replace('a','�',$testRU2);
-		$testRU2 = str_replace('b','�',$testRU2);
-		$testRU2 = str_replace('c','�',$testRU2);
-		$testRU2 = str_replace('b','�',$testRU2);
-		$testRU2 = str_replace('e','�',$testRU2);
-		$testRU2 = str_replace('t','�',$testRU2);
-		$testRU2 = str_replace('o','�',$testRU2);
-		$testRU2 = str_replace('p','�',$testRU2);
-		$testRU2 = str_replace('m','�',$testRU2);
-		$testRU2 = str_replace('h','�',$testRU2);
-		$testRU2 = str_replace('y','�',$testRU2);
-		$testRU2 = str_replace('k','�',$testRU2);
-		$testRU2 = str_replace('x','�',$testRU2);
-		$testRU2 = str_replace('u','�',$testRU2);
-		$testRU2 = str_replace('()','�',$testRU2);
-		$testRU2 = str_replace('0','�',$testRU2);
-		$testRU2 = preg_replace('/[^�-�]*/i', ' ', $testRU2);
-		$testRU2 = preg_replace('/[^�-�]*/i', ' ', $testRU2);
-		$i = 0; $spe = explode('|',$spam);
-		while($i<=count($spe))
-		{
-			if(isset($spe[$i]) && $spe[$i]!='' && $spe[$i] != 'new-combats.com')
-			{
-				if( stristr($testEN,$spe[$i]) == true ) {
-					$nospam .= '%'.$spe[$i];
-				}elseif( stristr($testRU,$spe[$i]) == true ) {
-					$nospam .= '%'.$spe[$i];
-				}
-				/*if(preg_match("/".($spe[$i])."/i",($testEN)))
-				{
-					$nospam .= '%'.$spe[$i];
-				}elseif(preg_match("/".($spe[$i])."/i",($testRU)))
-				{
-					$nospam .= '%'.$spe[$i];
-				}*//*elseif(preg_match("/".($spe[$i])."/i",($testRU2)))
-				{
-					$nospam .= '%'.$spe[$i];
-				}elseif(preg_match("/".($spe[$i])."/i",($testEN2)))
-				{
-					$nospam .= '%'.$spe[$i];
-				}*/
-			}
-			$i++;
-		}
-		return $nospam;
-	}
-	
-	public function getSmiles($txt,$lg)
-	{
-		global $c,$u;
-		$i = 0;
-		$j = 0;
-		$txt = ' '.$txt;
-		$h = explode(':',$txt);
-		$user_sm = array();
-		if($lg!=false)
-		{			
-			$k = 0;
-			$ke = explode(',',$u->info['add_smiles']);
-			while($k<count($ke))
-			{
-					if(isset($ke[$k]) && $ke[$k]!='')
-				{
-					$user_sm[$ke[$k]] = 1;
-				}					
-				$k++;
-			}
-		}
-		while($i <= count($this->sm))
-		{
-			if(isset($h[$i]))
-			{
-				if(isset($this->sm[$h[$i]]) || isset($user_sm[$h[$i]]))
-				{
-					if($j<3)
-					{
-						$clk = 'onClick=\"top.addSm(\''.$h[$i].'\');\" style=\"cursor:pointer;\"';
-						if(isset($user_sm[$h[$i]]))
-						{
-							$clk = 'title=\"������� �������\"';
-						}
-						$h[$i] = '*not_dbl_ponts*<img '.$clk.' src=\"https://img.new-combats.com/i/smile/'.$h[$i].'.gif\">*not_dbl_ponts*';
-						$j++;
-					}
-				}
-			}
-			$i++;
-		}
-		$txt = implode($h,':');
-		$txt = str_replace(':*not_dbl_ponts*','',$txt);
-		$txt = str_replace('*not_dbl_ponts*:','',$txt);
-		$txt = str_replace('*not_dbl_ponts*','',$txt);
-		$txt = trim($txt,' ');
-		return $txt;
-	}
-	
-	public function __clone()
-	{
-		trigger_error('������������ �� �����������.', E_USER_ERROR);
-	}
-}
-
-$filter = new Filter();
-?>
\ No newline at end of file
+$filter = new Filter();
\ No newline at end of file
diff --git a/_incl_data/class/__quest.php b/_incl_data/class/__quest.php
index 4ccaf852..62c1a56e 100644
--- a/_incl_data/class/__quest.php
+++ b/_incl_data/class/__quest.php
@@ -1,1115 +1,1019 @@
 <?
-if(!defined('GAME'))
+if (!defined('GAME')) {
+    die();
+}
+
+class quests
 {
-	die();
-}
-class quests {	
-	public $free_x = 28,$data = array();	
-	
-	/* �������� �� ��������� ���*/	
-	public function bfinuser($uid,$btl,$tmwin)
-	{
-		
-	}
-	
-	/* �������� ����������� ������ */
-	public function testGood($pl)
-	{
-	    global $c,$u;
-	    
-	    if(!is_array($pl)) {
-		$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.$pl.'" LIMIT 1'));
-	    }
-	    
-	    $r = 1; $d1 = 0;
-	    $sp1 = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "'.$u->info['id'].'" LIMIT 100'));
-	    $pl1  = $pl1[0];
-	    //���� ��� ����� 5 ������� �����
-	    if($d1>=$this->free_x)
-	    {
-		$r = 0;
-	    }
-	    unset($d1,$pl1,$sp1);
-	    //���� ����� ��� �����
-	    $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" ORDER BY `id` DESC LIMIT 1'));
-	    if(isset($qlst['id']) && $qlst['vals'] != 'win' && $qlst['vals'] != 'end' && $qlst['vals'] != 'bad') {
-			$r = 0;
-	    }
-	    unset($qlst,$qlst2);
-    
-    $d = $this->expl($pl['tr_date']);
-    //��������� ������ [ 1,2,3,4,5 ...
-	    if(isset($d['tr_endq']))
-	    {
-		$i = 0;
-		$e = explode(',',$d['tr_endq']);
-		while($i<count($e))
-		{
-		    $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$e[$i].'" AND `vals` = "win" ORDER BY `id` DESC LIMIT 1'));
-		    if(!isset($qlst['id']))
-		    {
-			$r = 0;
-		    }
-		    $i++;
-		}
-		unset($qn,$qlst,$qlst2);
-	    }
-    //�������� ����� ����������� ������
-	    if(isset($d['tr_zdr']))
-	    {
-		$qlst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" AND `vals` != "go" ORDER BY `time` DESC LIMIT 1'));
-		if($qlst['time']+($d['tr_zdr']*60*60)-time()>0)
-		{
-		    //$t .= '<small>(��������: '.$u->timeOut($qlst['time']+($d['tr_zdr']*60*60)-time()).' �.)</small>';
-		    $r = 0;
-		}
-		unset($qlst);
-	    }
-    //������������� ������
-	    if(isset($d['tr_tm1']))
-	    {
-		$d['tr_tm1'] = str_replace('d',date('d'),$d['tr_tm1']);
-		$d['tr_tm1'] = str_replace('m',date('m'),$d['tr_tm1']);
-		$d['tr_tm1'] = str_replace('y',date('y'),$d['tr_tm1']);	
-		$d['tr_tm2'] = str_replace('d',date('d'),$d['tr_tm2']);
-		$d['tr_tm2'] = str_replace('m',date('m'),$d['tr_tm2']);
-		$d['tr_tm2'] = str_replace('y',date('y'),$d['tr_tm2']);
-		//�������� ����������
-	    }
-    //������� ��� ����� ������ �����
-	    if(isset($d['tr_raz']))
-	    {
-		$qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" LIMIT '.$d['tr_raz'],2);
-		if($d['tr_raz']>0 && $d['tr_raz']-$qlst[0] <= 0)
-		{
-		    $r = 0;
-		}
-		unset($qlst);
-	    }
-    //������� ������ �����
-	    if(isset($d['tr_raz2']))
-	    {
-		$qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" AND `vals` != "go" AND `vals` != "win"  LIMIT '.$d['tr_raz2'],2);
-		if($d['tr_raz2']-$qlst[0] <= 0)
-		{
-		    $r = 0;
-		}
-		unset($qlst);
-	    }
-	    return $r;
-	}
-	
-	
-	public function onlyOnceQuest($quests, $uid)
-	{ // ��������� ����������� ������
-	    $result = array();
-	    $rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$uid.'" LIMIT 1'));
-	    foreach($quests as $quest){
-		$ok=true;
-		$t = $this->expl($quest['tr_date']);
-		if(isset($t['only_once']) && $t['only_once']=="1" ){
-		    $ins = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) as sum FROM `actions` WHERE `uid` = "'.$uid.'" AND `vars` = "start_quest'.$quest['id'].'" AND (`vals` = "go" OR `vals` = "end")'));
-		} else {
-		    $ins = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) as sum FROM `actions` WHERE `uid` = "'.$uid.'" AND `vars` = "start_quest'.$quest['id'].'" AND `vals` = "go" '));
-		    if($ins['sum']>0) $ins['sum']='delete';
-		}
-		if($ins['sum'] == 'delete'){
-		    $ok=false;
-		}elseif(isset($ins) && $ins['sum'] >= 1 && $rep['rep'.$quest['city']] < 10000) {
-		    $ok=false;
-		}elseif(isset($ins) && $ins['sum'] >= 2 && $rep['rep'.$quest['city']] <= 24999 && $rep['rep'.$quest['city']] >= 10000) {
-		    $ok=false; 
-		} else $result[] = $quest;
-		unset($ins,$t,$ok);
-	    } 
-	    return $result;
-	}
-	/* ����� ����� */
-	public function startq($id, $val=NULL)
-	{
-		global $c,$u;
-		$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE (`city` = "" OR `city` = "'.$u->info['city'].'") AND `delete` = "0" AND `min_lvl` <= '.$u->info['level'].' AND `max_lvl` >= '.$u->info['level'].' AND (`align` = "0" OR `align` = "'.floor($u->info['align']).'") AND `id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
-		if(isset($pl['id']))
-		{
-			$u->addAction(time(),'start_quest'.$pl['id'],'go', NULL, $val);
-			$u->error = '�� ������� �������� ������� &quot;'.$pl['name'].'&quot;';			
-		}else{
-			$u->error = '�� ������� �������� ������ �������';
-		}
-	}
-	
-	/* ����� ����� � ������ */
-	public function startq_dn($id, $val=NULL)
-	{
-		global $c,$u;
-		$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= '.$u->info['level'].' AND `max_lvl` >= '.$u->info['level'].' AND (`align` = "0" OR `align` = "'.floor($u->info['align']).'") AND `id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
-		if(isset($pl['id']))
-		{
-			if($val==NULL)
-			    $u->addAction(time(),'start_quest'.$pl['id'],'go');
-			else 
-			    $u->addAction(time(),'start_quest'.$pl['id'],'go', $u->info['id'], $val);
-			$u->error = '�� ������� �������� ������� &quot;'.$pl['name'].'&quot;';			
-		}else{
-			$u->error = '�� ������� �������� ������ �������';
-		}
-	}
-	
-	/* ���������� �� ������ */
-	public function endq($id,$tp)
-	{
-		global $u,$c;
-		$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= '.$u->info['level'].' AND `max_lvl` >= '.$u->info['level'].' AND (`align` = "0" OR `align` = "'.floor($u->info['align']).'") AND `id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
-		$qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" AND `vals` = "go" ORDER BY `id` DESC LIMIT 1'));
-		if(isset($qlst['id']))
-		{
-			if($tp=='end')
-			{
-				mysql_query('UPDATE `actions` SET `vals` = "end" WHERE `id` = "'.$qlst['id'].'" LIMIT 1');
-				$u->error = '�� ������� ���������� �� ������� &quot;'.$pl['name'].'&quot;';
-			}elseif($tp=='win')
-			{
-				mysql_query('UPDATE `actions` SET `vals` = "win" ,`time` = "'.time().'" WHERE `id` = "'.$qlst['id'].'" LIMIT 1');
-			}
-		}else{
-			$u->error = '�� ������� ���������� �� ������� ';
-		}
-	}
-	
-	/* ���� � ������ � ������� */
-	public function infoDng($pl) {
-		$r = '';
-		global $c,$u;
-		$r = 0; $t = '';
-		$xrz = 0;
-		$qst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" AND `vals` = "go" LIMIT 1'));
-		//������� ������� ������� ������ ������������� ������� ���������������
-			$d = $this->expl($pl['tr_date']);
-			//�������� ������
-			$d = $this->expl($pl['act_date']);
-			
-			//���������� � NPS
-				if(isset($d['dlg_nps'])) {
-					$i7 = 0;
-					$x3 = explode(',',$d['dlg_nps']);
-					while($i7 < count($x3)) {
-						$x4 = explode('=',$x3[$i7]);
-						if($x4[0] > 0) {
-							$r++;
-						}
-						$i7++;
-					}
-					unset($x1,$x3,$x4,$i7);
-				}
-				
-			//����� �������
-				if(isset($d['kill_user']))
-				{
-					$x = 0;
-					$r += $d['kill_user'];
-					unset($x);
-				}
-				
-			//����� �����
-				if(isset($d['kill_bot'])){
-					$x = '';
-					$ex = explode(',',$d['kill_bot']);
-					$i = 0;
-					while($i<count($ex)){
-						$x2 = 0;
-						$ex2 = explode('=',$ex[$i]);					
-						$bot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$ex2[0].'" LIMIT 1'));
-						if(isset($bot2['id'])){
-							if(isset($qst['id'])){
-								$x2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.$qst['time'].' AND `vars` = "win_bot_'.$ex2[0].'" LIMIT '.$ex2[1],2);
-								$x2 = 0+$x2[0];
-								
-							}
-							if(isset($d['all_kill']) && $d['all_kill']>0){
-								$r = $d['all_kill'];
-							} else {
-								$r += $ex2[1];
-							}
-							$xrz += $x2;
-						}
-						$i++;
-					}
-					unset($x,$ex,$x2,$bot2,$ex2);
-				} 
+    public $free_x = 28, $data = [];
 
-			//������� �������
-			if(isset($d['tk_itm'])) {
-				$ex = explode(',',$d['tk_itm']);
-				$i = 0;
-				$x = '';
-				while($i < count($ex)) {
-					$ex2 = explode('=',$ex[$i]);
-					$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-					$x2[0] = (int)$x2[0]; 
-					if( $x2[0] >= $ex2[1] ) {
-						if( $x2[0] <= ($ex2[1] + round($ex2[1]*0.15)) ){
-							$x2[0] = $x2[0];
-						} else {
-							$x2[0] = ($ex2[1] + round($ex2[1]*0.15));
-						}
-					}
-					$r += $ex2[1];
-					$xrz += $x2[0];
-					$i++;
-				}
-			}
+    /* �������� ����������� ������ */
+    public function testGood($pl)
+    {
+        global $u;
 
-			//������� ������
-			if(isset($d['tkill_itm'])) {
-				$ex = explode(',',$d['tkill_itm']);
-				$i = 0;
-				$x = '';
-				while($i < count($ex)) {
-					$ex2 = explode('=',$ex[$i]);
-					$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `maidin` = "'.$pl['city'].'" AND `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-					$x2[0] = (int)$x2[0]; 
-					if( $x2[0] >= $ex2[1] ) {
-						if( $x2[0] <= ($ex2[1] + round($ex2[1]*0.15)) ){
-							$x2[0] = $x2[0];
-						} else {
-							$x2[0] = ($ex2[1] + round($ex2[1]*0.15));
-						}
-					}
-					$bot2 = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($ex2[0]).'" LIMIT 1'));
-					$r += $ex2[1];
-					$xrz += $x2[0];
-					$i++;
-				}
-			}
+        if (!is_array($pl)) {
+            $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . $pl . '" LIMIT 1'));
+        }
 
-		if( $r < 1 ) {
-			$r = '[0/1]';
-		}else{
-			if( $xrz < 0 ) {
-				$xrz = 0;
-			}
-			if( $xrz > $r ) {
-				$xrz = $r;
-			}
-			//$r = '['.$xrz.'/'.$r.']';
-			$r = '<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px">
-  <div style="position:relative;"><div id="vhp-1234500000'.$pl['id'].'" title="���������� �������" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> '.$xrz.'/'.$r.'</div>
+        $r = 1;
+        $d1 = 0;
+        $sp1 = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `actions` WHERE `vars` LIKE "%start_quest%" AND `vals` = "go" AND `uid` = "' . $u->info['id'] . '" LIMIT 100'));
+        $pl1 = $pl1[0];
+        //���� ��� ����� 5 ������� �����
+        if ($d1 >= $this->free_x) {
+            $r = 0;
+        }
+        unset($d1, $pl1, $sp1);
+        //���� ����� ��� �����
+        $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" ORDER BY `id` DESC LIMIT 1'));
+        if (isset($qlst['id']) && $qlst['vals'] != 'win' && $qlst['vals'] != 'end' && $qlst['vals'] != 'bad') {
+            $r = 0;
+        }
+        unset($qlst, $qlst2);
+
+        $d = $this->expl($pl['tr_date']);
+        //��������� ������ [ 1,2,3,4,5 ...
+        if (isset($d['tr_endq'])) {
+            $i = 0;
+            $e = explode(',', $d['tr_endq']);
+            while ($i < count($e)) {
+                $qlst = mysql_fetch_array(mysql_query('SELECT `id`,`vals` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $e[$i] . '" AND `vals` = "win" ORDER BY `id` DESC LIMIT 1'));
+                if (!isset($qlst['id'])) {
+                    $r = 0;
+                }
+                $i++;
+            }
+            unset($qn, $qlst, $qlst2);
+        }
+        //�������� ����� ����������� ������
+        if (isset($d['tr_zdr'])) {
+            $qlst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` != "go" ORDER BY `time` DESC LIMIT 1'));
+            if ($qlst['time'] + ($d['tr_zdr'] * 60 * 60) - time() > 0) {
+                $r = 0;
+            }
+            unset($qlst);
+        }
+        //������������� ������
+        if (isset($d['tr_tm1'])) {
+            $d['tr_tm1'] = str_replace('d', date('d'), $d['tr_tm1']);
+            $d['tr_tm1'] = str_replace('m', date('m'), $d['tr_tm1']);
+            $d['tr_tm1'] = str_replace('y', date('y'), $d['tr_tm1']);
+            $d['tr_tm2'] = str_replace('d', date('d'), $d['tr_tm2']);
+            $d['tr_tm2'] = str_replace('m', date('m'), $d['tr_tm2']);
+            $d['tr_tm2'] = str_replace('y', date('y'), $d['tr_tm2']);
+            //�������� ����������
+        }
+        //������� ��� ����� ������ �����
+        if (isset($d['tr_raz'])) {
+            $qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" LIMIT ' . $d['tr_raz'], 2);
+            if ($d['tr_raz'] > 0 && $d['tr_raz'] - $qlst[0] <= 0) {
+                $r = 0;
+            }
+            unset($qlst);
+        }
+        //������� ������ �����
+        if (isset($d['tr_raz2'])) {
+            $qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` != "go" AND `vals` != "win"  LIMIT ' . $d['tr_raz2'], 2);
+            if ($d['tr_raz2'] - $qlst[0] <= 0) {
+                $r = 0;
+            }
+            unset($qlst);
+        }
+        return $r;
+    }
+
+    public function onlyOnceQuest($quests, $uid)
+    { // ��������� ����������� ������
+        $result = [];
+        $rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "' . $uid));
+        foreach ($quests as $quest) {
+            $ok = true;
+            $t = $this->expl($quest['tr_date']);
+            if (isset($t['only_once']) && $t['only_once'] == "1") {
+                $ins = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) as sum FROM `actions` WHERE `uid` = "' . $uid . '" AND `vars` = "start_quest' . $quest['id'] . '" AND (`vals` = "go" OR `vals` = "end")'));
+            } else {
+                $ins = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) as sum FROM `actions` WHERE `uid` = "' . $uid . '" AND `vars` = "start_quest' . $quest['id'] . '" AND `vals` = "go" '));
+                if ($ins['sum'] > 0) {
+                    $ins['sum'] = 'delete';
+                }
+            }
+            if ($ins['sum'] == 'delete') {
+                $ok = false;
+            } elseif (
+                isset($ins) &&
+                $ins['sum'] >= 1 &&
+                $rep['rep' . $quest['city']] < 10000
+            ) {
+                $ok = false;
+            } elseif (
+                isset($ins) &&
+                $ins['sum'] >= 2 &&
+                $rep['rep' . $quest['city']] <= 24999 &&
+                $rep['rep' . $quest['city']] >= 10000) {
+                $ok = false;
+            } else {
+                $result[] = $quest;
+            }
+            unset($ins, $t, $ok);
+        }
+        return $result;
+    }
+
+    /* ����� ����� */
+    public function startq($id, $val = null)
+    {
+        global $c, $u;
+        $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE (`city` = "" OR `city` = "' . $u->info['city'] . '") AND `delete` = "0" AND `min_lvl` <= ' . $u->info['level'] . ' AND `max_lvl` >= ' . $u->info['level'] . ' AND (`align` = "0" OR `align` = "' . floor($u->info['align']) . '") AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
+        if (isset($pl['id'])) {
+            $u->addAction(time(), 'start_quest' . $pl['id'], 'go', null, $val);
+            $u->error = '�� ������� �������� ������� &quot;' . $pl['name'] . '&quot;';
+        } else {
+            $u->error = '�� ������� �������� ������ �������';
+        }
+    }
+
+    /* ����� ����� � ������ */
+    public function startq_dn($id, $val = null)
+    {
+        global $c, $u;
+        $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= ' . $u->info['level'] . ' AND `max_lvl` >= ' . $u->info['level'] . ' AND (`align` = "0" OR `align` = "' . floor($u->info['align']) . '") AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
+        if (isset($pl['id'])) {
+            if ($val == null)
+                $u->addAction(time(), 'start_quest' . $pl['id'], 'go');
+            else
+                $u->addAction(time(), 'start_quest' . $pl['id'], 'go', $u->info['id'], $val);
+            $u->error = '�� ������� �������� ������� &quot;' . $pl['name'] . '&quot;';
+        } else {
+            $u->error = '�� ������� �������� ������ �������';
+        }
+    }
+
+    /* ���������� �� ������ */
+    public function endq($id, $tp)
+    {
+        global $u;
+        $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `delete` = "0" AND `min_lvl` <= ' . $u->info['level'] . ' AND `max_lvl` >= ' . $u->info['level'] . ' AND (`align` = "0" OR `align` = "' . floor($u->info['align']) . '") AND `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
+        $qlst = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" ORDER BY `id` DESC LIMIT 1'));
+        if (isset($qlst['id'])) {
+            if ($tp == 'end') {
+                mysql_query('UPDATE `actions` SET `vals` = "end" WHERE `id` = "' . $qlst['id'] . '" LIMIT 1');
+                $u->error = '�� ������� ���������� �� ������� &quot;' . $pl['name'] . '&quot;';
+            } elseif ($tp == 'win') {
+                mysql_query('UPDATE `actions` SET `vals` = "win" ,`time` = "' . time() . '" WHERE `id` = "' . $qlst['id'] . '" LIMIT 1');
+            }
+        } else {
+            $u->error = '�� ������� ���������� �� ������� ';
+        }
+    }
+
+    /* ���� � ������ � ������� */
+    public function infoDng($pl)
+    {
+        global $u;
+        $r = 0;
+        $xrz = 0;
+        $qst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
+        //������� ������� ������� ������ ������������� ������� ���������������
+        //$d = $this->expl($pl['tr_date']);
+        //�������� ������
+        $d = $this->expl($pl['act_date']);
+
+        //���������� � NPS
+        if (isset($d['dlg_nps'])) {
+            $i7 = 0;
+            $x3 = explode(',', $d['dlg_nps']);
+            while ($i7 < count($x3)) {
+                $x4 = explode('=', $x3[$i7]);
+                if ($x4[0] > 0) {
+                    $r++;
+                }
+                $i7++;
+            }
+            unset($x1, $x3, $x4, $i7);
+        }
+
+        //����� �������
+        if (isset($d['kill_user'])) {
+            $r += $d['kill_user'];
+        }
+
+        //����� �����
+        if (isset($d['kill_bot'])) {
+            $x = '';
+            $ex = explode(',', $d['kill_bot']);
+            $i = 0;
+            while ($i < count($ex)) {
+                $x2 = 0;
+                $ex2 = explode('=', $ex[$i]);
+                $bot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $ex2[0] . '" LIMIT 1'));
+                if (isset($bot2['id'])) {
+                    if (isset($qst['id'])) {
+                        $x2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` > ' . $qst['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" LIMIT ' . $ex2[1], 2);
+                        $x2 = 0 + $x2[0];
+                    }
+                    if (isset($d['all_kill']) && $d['all_kill'] > 0) {
+                        $r = $d['all_kill'];
+                    } else {
+                        $r += $ex2[1];
+                    }
+                    $xrz += $x2;
+                }
+                $i++;
+            }
+            unset($x, $ex, $x2, $bot2, $ex2);
+        }
+
+        //������� �������
+        if (isset($d['tk_itm'])) {
+            $ex = explode(',', $d['tk_itm']);
+            $i = 0;
+            while ($i < count($ex)) {
+                $ex2 = explode('=', $ex[$i]);
+                $x2 = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id` = "' . mysql_real_escape_string($ex2[0]) . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
+                if ($x2[0] >= $ex2[1]) {
+                    $x2[0] = ($ex2[1] + round($ex2[1] * 0.15));
+                }
+                $r += $ex2[1];
+                $xrz += $x2[0];
+                $i++;
+            }
+        }
+
+        //������� ������
+        if (isset($d['tkill_itm'])) {
+            $ex = explode(',', $d['tkill_itm']);
+            $i = 0;
+            while ($i < count($ex)) {
+                $ex2 = explode('=', $ex[$i]);
+                $x2 = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `maidin` = "' . $pl['city'] . '" AND `item_id` = "' . mysql_real_escape_string($ex2[0]) . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
+                if ($x2[0] >= $ex2[1]) {
+                    $x2[0] = ($ex2[1] + round($ex2[1] * 0.15));
+                }
+                $r += $ex2[1];
+                $xrz += $x2[0];
+                $i++;
+            }
+        }
+
+        if ($r < 1) {
+            $r = '[0/1]';
+        } else {
+            if ($xrz < 0) {
+                $xrz = 0;
+            }
+            if ($xrz > $r) {
+                $xrz = $r;
+            }
+            $r = '<table style="display:inline-block;" border="0" cellspacing="0" cellpadding="0" height="10"><tr><td valign="middle" width="120" style="padding-top:12px">
+  <div style="position:relative;"><div id="vhp-1234500000' . $pl['id'] . '" title="���������� �������" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . $xrz . '/' . $r . '</div>
   <div title="���������� �������" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-  <div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234500000'.$pl['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+  <div class="hp_3 senohp" style="height:9px; width:120px; position:absolute; top:-10px; z-index:11;" id="lhp-1234500000' . $pl['id'] . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
   <div title="���������� �������" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>
-</div></td></tr></table><br><script>top.startHpRegen("main",-1234500000'.$pl['id'].','.$xrz.','.$r.',0,0,0,0,0,0,1);</script>';
-		}
-		return $r;
-	}
-	
-	/* ���������� � ������ */
-	public function info($pl) {
-		global $c,$u;
-		$r = ''; $t = '';
-		$qst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" AND `vals` = "go" LIMIT 1'));
-		//������� ������� ������� ������ ������������� ������� ���������������
-			$d = $this->expl($pl['tr_date']);
-			//��������� ������ [ 1,2,3,4,5 ...
-				if(isset($d['tr_endq']))
-				{
-					$t .= '��������� ������: ';
-					$i = 0;
-					$e = explode(',',$d['tr_endq']);
-					while($i<=count($e))
-					{
-						if($e[$i]>0)
-						{
-							$qn = mysql_fetch_array(mysql_query('SELECT `name` FROM `quests` WHERE `id` = "'.$e[$i].'" LIMIT 1'));
-							if(isset($qn['name']))
-							{
-								$t .= '&quot;'.$qn['name'].'&quot;, ';
-							}
-						}
-						$i++;
-					}
-					$t = trim($t,', ');
-					$t .= '<br>';
-					unset($qn);
-				}
-			//�� ����� ������ �������� [ idbot-itm1=%,itm2=%|
-				if(isset($d['tr_botitm']))
-				{
-					$t .= '�� ����� �������� ��������:<ul>';
-					$e = explode('|',$d['tr_botitm']);
-					$i = 0;
-					while($i<count($e)) {
-						$j = 0;
-						$e2 = explode('-',$e[$i]);
-						//$e2[0] - id ����
-						if($e2[0]>0){
-							$qn = mysql_fetch_array(mysql_query('SELECT `login` FROM `test_bot` WHERE `id` = "'.$e2[0].'" LIMIT 1'));
-							$t .= '&nbsp; &nbsp; &bull; �� &quot;'.$qn['login'].'&quot; ��������: ';
-						}else{
-							$t .= '&nbsp; &nbsp; &bull; �� ����� ����� ��������: ';
-						}
-						//$e2[1] - ��������
-						$j = 0;
-						$e3 = explode(',',$e2[1]);
-						while($j<count($e3))
-						{
-							$e4 = explode('=',$e3[$j]);
-							//$e4[0] - ������� , $e4[1] - ����
-							$qi = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "'.$e4[0].'" LIMIT 1'));
-							$t .= '<img src="https://img.new-combats.com/i/items/'.$qi['img'].'" style="max-height:12px"> <a href="items_info.php?id='.$qi['id'].'" target="_blank">'.$qi['name'].'</a>, ';
-							$j++;
-						}
-						$t = trim($t,', ');
-						$i++;
-					}
-					$t .= '<br>';
-					unset($qn,$qi,$e2,$e3,$e4);
-				}
-			//��� �������� ������ �������� [ type-itm1=%,itm2=%|
-				if(isset($d['tr_winitm']))
-				{
-					$t .= '����� ������ �������� ��������:<br>';
-					$e = explode('|',$d['tr_winitm']);
-					$i = 0;
-					while($i<count($e))
-					{
-						$j = 0;
-						$e2 = explode('-',$e[$i]);
-						$t .= '&nbsp; &nbsp; &bull; ';
-						//$e2[0] - id ����
-						if($e2[0]>0)
-						{
-							$t .= '�� ����� ��������: ';
-						}else{
-							$t .= '�� ����� ��������: ';
-						}
-						//$e2[1] - ��������
-						$j = 0;
-						$e3 = explode(',',$e2[1]);
-						while($j<count($e3))
-						{
-							$e4 = explode('=',$e3[$j]);
-							//$e4[0] - ������� , $e4[1] - ����
-							$qi = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "'.$e4[0].'" LIMIT 1'));
-							$t .= '<img src="https://img.new-combats.com/i/items/'.$qi['img'].'" style="max-height:12px"> <a href="items_info.php?id='.$qi['id'].'" target="_blank">'.$qi['name'].'</a>, ';
-							$j++;
-						}
-						$t = trim($t,', ');
-						$t .= '<br>';
-						$i++;
-					}
-					unset($qn,$qi,$e2,$e3,$e4);
-				}
-			//�������� ����� ����������� ������
-				if(isset($d['tr_zdr']))
-				{
-					$qlst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" AND `vals` != "go" LIMIT 1'));
-					$t .= '�������� ����� ����������� �������: '.$u->timeOut($d['tr_zdr']*60*60);
-					if($qlst['time']+($d['tr_zdr']*60*60)-time()>0)
-					{
-						$t .= '<small>(��������: '.$u->timeOut($qlst['time']+($d['tr_zdr']*60*60)-time()).' �.)</small>';
-					}
-					$t .= '<br>';
-					unset($qlst);
-				}
-			//������������� ������
-				if(isset($d['tr_tm1']))
-				{
-					$d['tr_tm1'] = str_replace('d',date('d'),$d['tr_tm1']);
-					$d['tr_tm1'] = str_replace('m',date('m'),$d['tr_tm1']);
-					$d['tr_tm1'] = str_replace('y',date('y'),$d['tr_tm1']);	
-									
-					$d['tr_tm2'] = str_replace('d',date('d'),$d['tr_tm2']);
-					$d['tr_tm2'] = str_replace('m',date('m'),$d['tr_tm2']);
-					$d['tr_tm2'] = str_replace('y',date('y'),$d['tr_tm2']);
-					
-					$t .= '������ ������: '.$d['tr_tm1'].' - '.$d['tr_tm2'].'<br>';
-				}
-			//������� ��� ����� ������ �����
-				if(isset($d['tr_raz']))
-				{
-					if($d['tr_raz']==-1)
-					{
-						$t .= '������� ��� ��� ����� ��������� �������: <b><small>����������</small></b><br>';
-					}else{
-						$qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" LIMIT '.$d['tr_raz'],2);
-						$t .= '������� ��� ����� ��������� �������: '.($d['tr_raz']-$qlst[0]).'<br>';
-					}
-					unset($qlst);
-				}
-			//������� ������ �����
-				if(isset($d['tr_raz2']))
-				{
-					$qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" AND `vals` != "go" AND `vals` != "win"  LIMIT '.$d['tr_raz2'],2);
-					$t .= '�������� ������� ��������� �������: '.($d['tr_raz2']-$qlst[0]).'<br>';
-					unset($qlst);
-				}
-				
-			if($t!='')
-			{
-				$r .= '<b>������� �������:</b><br>'.$t.'<br>';
-				$t = '';
-			}
-			
-		//������� �� �����
-			$d = $this->expl($pl['win_date']);
-		
-			if(isset($d['add_eff']))
-			{
-				$x5 = '';
-				$x3 = explode(',',$d['add_eff']);
-				$x4 = 0;
-				while($x4 < count($x3)) {
-					$x7 = explode('=',$x3[$x4]);
-					$x6 = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`img` FROM `eff_main` WHERE `id2` = "'.$x7[0].'" LIMIT 1'));
-					if(isset($x6['id2'])) {
-						$x5 .= '<img width="40" height="25" src="https://img.new-combats.com/i/eff/'.$x6['img'].'" title="'.$x6['mname'].'
-����� ��������: '.$u->timeOut($x7[1]).'"> ';
-					}
-					$x4++;
-				}
-				if($x5 != '') {
-					$t .= ''.$x5.'<br>';
-				}
-				unset($x3,$x4,$x5,$x6,$x7);
-			}
-			
-			if(isset($d['add_rep']))
-			{
-				//if($pl['city']!='')
-				//{
-					$t .= '��������� '.$u->city_name[$pl['city']].': '.$d['add_rep'].'<br>';
-				//}
-			}
-			
-			if(isset($d['add_repizlom']))
-			{
-				//if($pl['city']!='')
-				//{
-					$t .= '��������� ����� �����: '.$d['add_repizlom'].'<br>';
-				//}
-			}
-			
-			if(isset($d['add_cr']))
-			{
-				$t .= '������: '.$d['add_cr'].' ��.<br>';
-			}
-		
-			if($t!='')
-			{
-				$r = '<b>�������:</b><br>'.$t.'<br>'.$r;
-				$t = '';
-			}
-			
-		//�������� ������
-			$d = $this->expl($pl['act_date']);
-			//���������� � NPS
-			if(isset($d['dlg_nps'])) {
-				$i7 = 0;
-				$x3 = explode(',',$d['dlg_nps']);
-				while($i7 < count($x3)) {
-					$x4 = explode('=',$x3[$i7]);
-					if($x4[0] > 0) {
-						$x1 = mysql_fetch_array(mysql_query('SELECT `text` FROM `dungeon_dialog` WHERE `id` = "'.$x4[0].'" LIMIT 1'));
-						if(!isset($x1['text'])) {
-							$x1 = '<i>����������</i>';
-						}else{
-							$x1 = $x1['text'];
-						}
-						$x = 0;							
-						$t .= '���������� � <b>'.$x1.'</b>: '.$x.'/1<br>';
-					}
-					$i7++;
-				}
-				unset($x1,$x3,$x4,$i7);
-			}
-				
-			//����� �������
-			if(isset($d['kill_user']))
-			{
-				$x = 0;
-				
-				$t .= '����� �������: '.$x.'/'.$d['kill_user'].'<br>';
-				unset($x);
-			}
-				
-			//����� �����
-			if(isset($d['kill_bot'])){ 
-			    
-				
-				if( isset($d['all_kill']) && (int)$d['all_kill'] > 0 ) {
-					$x = '';
-					$ex = explode(',',$d['kill_bot']); 
-					$i = 0; # ���������� ������ ��� ������� ���� ����.
-					$q='';
-					while( $i < count($ex) ){
-					   $ex2 = explode('=', $ex[$i]);
-					   if($q != '') $q .= ' OR ';
-					   $q .= ' (`uid` = "'.$u->info['id'].'" AND `time` > '.$qst['time'].' AND `vars` = "win_bot_'.$ex2[0].'" )';
-					   $i++;
-					}
-					$x2 = $u->testAction($q, 2); $x2 = $x2[0]; 
-					if($d['all_kill'] < $x2) $x2 = $d['all_kill']; 
-					$bot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$ex2[0].'" LIMIT 1'));
-					$bot2['id'] = $bot2['id'];
-					if(isset($bot2['id'])){
-						$x .= '&nbsp; &nbsp; &bull; <b>'.$bot2['login'].'</b> ['.$x2.'/'.$d['all_kill'].']<br>';
-					} else {
-						$x .= '&nbsp; &nbsp; &bull; <b>'.$pl['name'].'</b> ['.$x2.'/'.$d['all_kill'].']<br>';
-					}
-			    } else {
-					$i = 0;
-					while($i<count($ex)) {
+</div></td></tr></table><br><script>top.startHpRegen("main",-1234500000' . $pl['id'] . ',' . $xrz . ',' . $r . ',0,0,0,0,0,0,1);</script>';
+        }
+        return $r;
+    }
 
-					   $x2 = 0;
-					   $ex2 = explode('=',$ex[$i]);					
-					   $bot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.$ex2[0].'" LIMIT 1'));
-					   if(isset($bot2['id'])){
+    /* ���������� � ������ */
+    public function info($pl)
+    {
+        global $u;
+        $r = '';
+        $t = '';
+        $qst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` = "go" LIMIT 1'));
+        //������� ������� ������� ������ ������������� ������� ���������������
+        $d = $this->expl($pl['tr_date']);
+        //��������� ������ [ 1,2,3,4,5 ...
+        if (isset($d['tr_endq'])) {
+            $t .= '��������� ������: ';
+            $i = 0;
+            $e = explode(',', $d['tr_endq']);
+            while ($i <= count($e)) {
+                if ($e[$i] > 0) {
+                    $qn = mysql_fetch_array(mysql_query('SELECT `name` FROM `quests` WHERE `id` = "' . $e[$i] . '" LIMIT 1'));
+                    if (isset($qn['name'])) {
+                        $t .= '&quot;' . $qn['name'] . '&quot;, ';
+                    }
+                }
+                $i++;
+            }
+            $t = trim($t, ', ');
+            $t .= '<br>';
+            unset($qn);
+        }
+        //�� ����� ������ �������� [ idbot-itm1=%,itm2=%|
+        if (isset($d['tr_botitm'])) {
+            $t .= '�� ����� �������� ��������:<ul>';
+            $e = explode('|', $d['tr_botitm']);
+            $i = 0;
+            while ($i < count($e)) {
+                $j = 0;
+                $e2 = explode('-', $e[$i]);
+                //$e2[0] - id ����
+                if ($e2[0] > 0) {
+                    $qn = mysql_fetch_array(mysql_query('SELECT `login` FROM `test_bot` WHERE `id` = "' . $e2[0] . '" LIMIT 1'));
+                    $t .= '&nbsp; &nbsp; &bull; �� &quot;' . $qn['login'] . '&quot; ��������: ';
+                } else {
+                    $t .= '&nbsp; &nbsp; &bull; �� ����� ����� ��������: ';
+                }
+                //$e2[1] - ��������
+                $e3 = explode(',', $e2[1]);
+                while ($j < count($e3)) {
+                    $e4 = explode('=', $e3[$j]);
+                    //$e4[0] - ������� , $e4[1] - ����
+                    $qi = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "' . $e4[0] . '" LIMIT 1'));
+                    $t .= '<img src="https://img.new-combats.com/i/items/' . $qi['img'] . '" style="max-height:12px"> <a href="items_info.php?id=' . $qi['id'] . '" target="_blank">' . $qi['name'] . '</a>, ';
+                    $j++;
+                }
+                $t = trim($t, ', ');
+                $i++;
+            }
+            $t .= '<br>';
+            unset($qn, $qi, $e2, $e3, $e4);
+        }
+        //��� �������� ������ �������� [ type-itm1=%,itm2=%|
+        if (isset($d['tr_winitm'])) {
+            $t .= '����� ������ �������� ��������:<br>';
+            $e = explode('|', $d['tr_winitm']);
+            $i = 0;
+            while ($i < count($e)) {
+                $e2 = explode('-', $e[$i]);
+                $t .= '&nbsp; &nbsp; &bull; ';
+                //$e2[0] - id ����
+                if ($e2[0] > 0) {
+                    $t .= '�� ����� ��������: ';
+                } else {
+                    $t .= '�� ����� ��������: ';
+                }
+                //$e2[1] - ��������
+                $j = 0;
+                $e3 = explode(',', $e2[1]);
+                while ($j < count($e3)) {
+                    $e4 = explode('=', $e3[$j]);
+                    //$e4[0] - ������� , $e4[1] - ����
+                    $qi = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "' . $e4[0] . '" LIMIT 1'));
+                    $t .= '<img src="https://img.new-combats.com/i/items/' . $qi['img'] . '" style="max-height:12px"> <a href="items_info.php?id=' . $qi['id'] . '" target="_blank">' . $qi['name'] . '</a>, ';
+                    $j++;
+                }
+                $t = trim($t, ', ');
+                $t .= '<br>';
+                $i++;
+            }
+            unset($qn, $qi, $e2, $e3, $e4);
+        }
+        //�������� ����� ����������� ������
+        if (isset($d['tr_zdr'])) {
+            $qlst = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` != "go" LIMIT 1'));
+            $t .= '�������� ����� ����������� �������: ' . $u->timeOut($d['tr_zdr'] * 60 * 60);
+            if ($qlst['time'] + ($d['tr_zdr'] * 60 * 60) - time() > 0) {
+                $t .= '<small>(��������: ' . $u->timeOut($qlst['time'] + ($d['tr_zdr'] * 60 * 60) - time()) . ' �.)</small>';
+            }
+            $t .= '<br>';
+            unset($qlst);
+        }
+        //������������� ������
+        if (isset($d['tr_tm1'])) {
+            $d['tr_tm1'] = str_replace('d', date('d'), $d['tr_tm1']);
+            $d['tr_tm1'] = str_replace('m', date('m'), $d['tr_tm1']);
+            $d['tr_tm1'] = str_replace('y', date('y'), $d['tr_tm1']);
 
-						   if(isset($qst['id'])) {
-						   $x2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.$qst['time'].' AND `vars` = "win_bot_'.$ex2[0].'" LIMIT '.$ex2[1],2);
-						   $x2 = 0+$x2[0];
-						   }
-						   
-						   $x .= '&nbsp; &nbsp; &bull; <b>'.$bot2['login'].'</b> ['.$x2.'/'.$ex2[1].']<br>';
-					   }
-					   $i++;
-			       }
-			    }
-			     
-			    
-			    if($x!='')
-			    {
-				$x = trim($x,', ');
-				$t .= '����� �����: <br>'.$x.'';
-			    }
-			    unset($x,$ex,$x2,$bot2,$ex2);
-			}
-			
-			//������� �������
-				if(isset($d['tk_itm'])) {
-					$ex = explode(',',$d['tk_itm']);
-					$i = 0;
-					$x = '';
-					while($i < count($ex)) {
-						$ex2 = explode('=',$ex[$i]);
-						$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) as count FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-						$x2[0] = (int)$x2[0]; 
-						if( $x2[0] >= $ex2[1] ) {
-							if( $x2[0] <= ($ex2[1] + round($ex2[1]*0.15)) ){
-								$x2[0] = $x2[0];
-							} else {
-								$x2[0] = ($ex2[1] + round($ex2[1]*0.15));
-							}
-						}
-						$bot2 = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($ex2[0]).'" LIMIT 1'));
-						$x .= '&nbsp; &nbsp; &bull; <a target=_blank href=https://new-combats.com/item/'.$bot2['id'].' >'.$bot2['name'].'</a> ['.$x2[0].'/'.$ex2[1].']<br>';
-						$i++;
-					}
-					if($x!='')
-					{
-						$x = trim($x,', ');
-						$t .= '������� �������: <br>'.$x.'';
-					}
-				}
-			
-			//��������� �������
-				if( isset($d['tkill_itm']) ) {
-					$ex = explode(',',$d['tkill_itm']);
-					$i = 0;
-					$x = '';
-					while($i < count($ex)) {
-						$ex2 = explode('=',$ex[$i]);
-						$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `maidin` = "'.$pl['city'].'" AND `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-						$x2[0] = (int)$x2[0]; 
-						if( $x2[0] >= $ex2[1] ) {
-							if( $x2[0] <= ($ex2[1] + round($ex2[1]*0.15)) ){
-								$x2[0] = $x2[0];
-							} else {
-								$x2[0] = ($ex2[1] + round($ex2[1]*0.15));
-							}
-						}
-						$bot2 = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($ex2[0]).'" LIMIT 1'));
-						$x .= '&nbsp; &nbsp; &bull; <a target=_blank href=https://new-combats.com/item/'.$bot2['id'].' >'.$bot2['name'].'</a> ['.$x2[0].'/'.$ex2[1].']<br>';
-						$i++;
-					}
-					if($x!='')
-					{
-						$x = trim($x,', ');
-						$t .= '������� ������: <br>'.$x.'';
-					}
-				}
-					
-			if($t!=''){
-				$r = '<br><b>�������� �������:</b><br>'.$t.'<br>'.$r;
-				$t = '';
-			}
-			
-			
-		if($r==''){
-			$r = '�������������� ���������� �� ������� �����������';
-		}
-		return $r;
-	}
-	
-	public function takeInfo($id)
-	{
-		global $u;
-		$r = '';
-		
-		return $r;
-	}
-	
-	public function testquest(){
-		global $c, $u, $code;
-		if($u->info['battle']==0 && $u->room['name']!='����� ������') {
-			//$time = mysql_fetch_array( mysql_query('SELECT * FROM `dungeon_room` WHERE `dungeon_room` = "'.$u->info['room'].'" LIMIT 1') ); // �������� ������� � ����������!
-			// AND `room` = '.$time['id'].' 
-			$sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
-			
-			while($pl2 = mysql_fetch_array($sp)) {
-				$pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.(str_replace('start_quest','',$pl2['vars'])).'" LIMIT 1'));
-				
-				$g = 1;
-				//�������� ������
-					$d = $this->expl($pl['act_date']);
-					
-				//���������� � NPS
-					if(isset($d['dlg_nps'])){
-						$g = 0;
-						unset($x);
-					}
-					
-				//����� �������
-				    if(isset($d['kill_user'])){
-					    $x = 0;
-					    if( $x < $d['kill_user']) {
-						    $g = 0;
-					    }
-					    //$d['kill_user'] - �������� ����� �����
-					    unset($x);
-				    }
-				//����� �����
-				    if(isset($d['kill_bot'])) {
-						$ex = explode(',',$d['kill_bot']);
-						$ii = 0; // ���������� ������ ��� ������� ���� ����.
-						$q='';
-						while( $ii < count($ex) ) {
-							$ex2 = explode('=', $ex[$ii]);
-							if($q != '') $q .= ' OR ';
-							$q .= ' (`uid` = "'.$u->info['id'].'" AND `time` > '.$pl2['time'].' AND `vars` = "win_bot_'.$ex2[0].'" )';
-							$ii++;
-						}
-						if( isset($d['all_kill']) && $d['all_kill']>0 ) {
-							$x2 = $u->testAction($q.' LIMIT '.$d['all_kill'], 2);
-							if(isset($d['all_kill']) && $x2[0]<$d['all_kill']){
-							$g = 0;
-							}    
-						} else {
-							$x2 = $u->testAction($q.' LIMIT '.$ex2[1],2);
-							if(!isset($d['all_kill']) && $x2[0]<$ex2[1]){
-							$g = 0;
-							}
-						}
-						unset($x,$ex,$x2,$x3,$bot2,$ex2);
-				    }
-				//������� �������
-					if(isset($d['tk_itm'])) {
-					    $ex = explode(',',$d['tk_itm']);
-					    $i = 0;
-					    while($i < count($ex)) {
-							$ex2 = explode('=',$ex[$i]);
-							$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-							if( $x2[0] < $ex2[1] ) {
-								$g = 0;
-							}
-							$i++;
-					    }
-					}
-				//��������� �������
-					if(isset($d['tkill_itm'])) {
-					    $ex = explode(',',$d['tkill_itm']);
-					    $i = 0;
-					    while($i < count($ex)) {
-							$ex2 = explode('=',$ex[$i]);
-							$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-							if( $x2[0] < $ex2[1] ) {
-								$g = 0;
-							}
-							$i++;
-					    }
-					}
-				if($g==1){
-				    $pl['time'] = $pl2['time'];
-				    $this->endq($pl['id'],'win');
-				    $this->winQuest($pl);
-				    echo $pl['name'];
-				}
-			}
-		}
-	}
-	
-	# ������� �������� �� �������� �� ���������� ������� ��� ��������
-	public function questCheckEnd( $pl ) {
-		global $u, $c, $magic; 
-		$quest = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars` = "start_quest'.$pl['id'].'" ORDER BY `time` DESC LIMIT 1'));
-		#��������� �����, �������� = 0 ���, 1 ��.
-		$r = 0; 
-		if($u->info['battle']==0 && $u->room['name']!='����� ������') { 
-			$g = 1;
-			# �������� ������
-			$d = $this->expl($pl['act_date']);
+            $d['tr_tm2'] = str_replace('d', date('d'), $d['tr_tm2']);
+            $d['tr_tm2'] = str_replace('m', date('m'), $d['tr_tm2']);
+            $d['tr_tm2'] = str_replace('y', date('y'), $d['tr_tm2']);
 
-			# ���������� � NPS
-			if( isset($d['dlg_nps']) ) {
-				$g = 0;
-				unset($x);
-			}
+            $t .= '������ ������: ' . $d['tr_tm1'] . ' - ' . $d['tr_tm2'] . '<br>';
+        }
+        //������� ��� ����� ������ �����
+        if (isset($d['tr_raz'])) {
+            if ($d['tr_raz'] == -1) {
+                $t .= '������� ��� ��� ����� ��������� �������: <b><small>����������</small></b><br>';
+            } else {
+                $qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" LIMIT ' . $d['tr_raz'], 2);
+                $t .= '������� ��� ����� ��������� �������: ' . ($d['tr_raz'] - $qlst[0]) . '<br>';
+            }
+            unset($qlst);
+        }
+        //������� ������ �����
+        if (isset($d['tr_raz2'])) {
+            $qlst = $u->testAction('SELECT `id` FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" AND `vals` != "go" AND `vals` != "win"  LIMIT ' . $d['tr_raz2'], 2);
+            $t .= '�������� ������� ��������� �������: ' . ($d['tr_raz2'] - $qlst[0]) . '<br>';
+            unset($qlst);
+        }
 
-			# ����� �������
-			if( isset($d['kill_user']) ) {
-				$x = 0;
-				if( $x < $d['kill_user']) {
-					$g = 0;
-				} 
-				unset($x);
-			}
+        if ($t != '') {
+            $r .= '<b>������� �������:</b><br>' . $t . '<br>';
+            $t = '';
+        }
 
-			# ����� �����
-			if( isset($d['kill_bot']) ) { 
-				$ex = explode(',',$d['kill_bot']); 
-				$i = 0; # ���������� ������ ��� ������� ���� ����.
-				$q=''; 
-				while( $i < count($ex) ){
-				   $ex2 = explode('=', $ex[$i]);
-				   if($q != '') $q .= ' OR ';
-				   $q .= ' (`uid` = "'.$u->info['id'].'" AND `time` > '.$quest['time'].' AND `vars` = "win_bot_'.$ex2[0].'" )';
-				   $i++;
-				} 
-				if( isset($d['all_kill']) && (int)$d['all_kill']>0 ){
-					$x2 = $u->testAction($q, 2);
-					if( (int)$d['all_kill'] <= $x2[0] ) {
-						$x2 = (int)$d['all_kill'];
-					} else {
-						$x2 = $x2[0];
-					}
-					if($x2 < (int)$d['all_kill']){
-						$g = 0;
-					}
-				} else {
-					$x2 = $u->testAction($q.' LIMIT '.$ex2[1],2);
-					if( $ex2[1] < $x2[0] ) {
-						$x2 = $ex2[1];
-					} else {
-						$x2 = $x2[0];
-					}
-					if($x2 < $ex2[1]){
-						$g = 0;
-					}
-				}
-				unset($x,$ex,$x2,$x3,$bot2,$ex2);
-			}
-			# ������� �������
-			if(isset($d['tk_itm'])) {
-				$ex = explode(',',$d['tk_itm']);
-				$i = 0;
-				while( $i < count($ex) ) {
-					$ex2 = explode('=',$ex[$i]);
-					$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) as count FROM `items_users` WHERE `maidin` = "'.$pl['city'].'" AND `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-					$x2['count'] =  (int)$x2['count'];
-					if( $x2['count'] >= $ex2[1] ) {
-						if( $x2['count'] <= ($ex2[1] + round($ex2[1]*0.15)) ) {
-							$ex2[1] = $x2['count']; 
-						} else {
-							$ex2[1] = ($ex2[1] + round($ex2[1]*0.15)); 
-						}
-					}
-					if( $x2[0] < $ex2[1] ) {
-						$g = 0;
-					}
-					$i++;
-				}
-			}
-			# ��������� �������
-			if( isset($d['tkill_itm']) ) {
-				$ex = explode(',',$d['tkill_itm']);
-				$i = 0;
-				while( $i < count($ex) ) {
-					$ex2 = explode('=',$ex[$i]);
-					$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `maidin` = "'.$pl['city'].'" AND `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-					$x2['count'] =  (int)$x2['count'];
-					if( $x2['count'] >= $ex2[1] ) {
-						if( $x2['count'] <= ($ex2[1] + round($ex2[1]*0.15)) ) {
-							$ex2[1] = $x2['count']; 
-						} else {
-							$ex2[1] = ($ex2[1] + round($ex2[1]*0.15)); 
-						}
-					}
-					if( $x2[0] < $ex2[1] ) {
-						$g = 0;
-					}
-					$i++;
-				}
-			}
-			if( $g == 1 ) {
-				$r = 1;
-			} else $r = 0;
-		}
-		return $r;
-	}
-	
-	public function questSuccesEnd( $quest , $action ) {
-		global $u,$c,$magic;
-		$r = '';
-		
-		if( isset($quest['id']) ) {
-			$d = $this->expl($quest['act_date']);
-			$d = array_merge($d, $this->expl($quest['win_date']));
-							
-			// �������� ������� ��� ������
-			if( isset($d['tk_itm']) OR isset($d['tkill_itm']) ) {
-				if( isset($d['tk_itm']) AND isset($d['tkill_itm']) ) {
-					$ex[0] = explode(',',$d['tk_itm']);
-					$ex[1] = explode(',',$d['tkill_itm']); 
-				} elseif( isset($d['tk_itm']) ) {
-					$ex = explode(',',$d['tk_itm']); 
-				} elseif( isset($d['tkill_itm']) ) {
-					$ex = explode(',',$d['tkill_itm']);
-				}
-				
-				$i = 0;
-				while( $i < count($ex) ) {
-					$ex2 = explode('=',$ex[$i]);
-					$x2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) as count  FROM `items_users` WHERE `maidin` = "'.$quest['city'].'" AND `item_id` = "'.mysql_real_escape_string($ex2[0]).'" AND `uid` = "'.$u->info['id'].'" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
-					$x2['count'] = (int)$x2['count']; 
-					if( $x2['count'] >= $ex2[1] ) {
-						if( $x2['count'] <= ($ex2[1] + round($ex2[1]*0.15)) ){
-							$ex2[1] = $x2['count'];
-						} else {
-							$ex2[1] = ($ex2[1] + round($ex2[1]*0.15));
-						}
-					} 
-					$d['add_rep'] = (int)$d['add_rep'] * (int)$ex2[1];
-					$u->deleteItemID($ex2[0], $u->info['id'], $ex2[1]);
-					$i++;
-				}
-			}
-			$t = '';
-			
-			# �������� ��������� �� �����,
-			if( isset($d['add_rep']) ) {
-				# ���� ��� �������� �����.
-			    if( isset($d['kill_bot']) && isset($d['all_kill']) && $d['add_rep'] > 0 ){
-					$ex = explode(',', $d['kill_bot']);
-					$ii = 0;
-					if($quest['kin'] == 0){
-						$d['add_rep'] = 0;
-						while( $ii < count($ex) ) {
-							$i = 0;
-							$ex2 = explode('=',$ex[$i]);
-							while( $i < $d['all_kill'] ) {
-								$x2 = 0;
-								$d['add_rep'] = $d['add_rep'] + $ex2[1];
-								$x2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.$action['time'].' AND `vars` = "win_bot_'.$ex2[0].'" LIMIT '.$d['all_kill'],2);
-								$i++;
-							}
-							$ii++;
-						}
-					} else {
-						$d['add_rep'] = 1;
-					}
-			    } 
-			    
-			    unset($x,$i,$ii,$ex,$x2,$bot2,$ex2);
-			    if( $quest['city'] != '' ) {
-					if( $this->stats['more_awards'] >= 0 ) {
-				$d['add_rep'] += $d['add_rep']/100*50;
-					}
-					$t .= ''.$d['add_rep'].' ��. ��������� '.$u->city_name[$quest['city']].', ';
-					$rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$u->info['id'].'" LIMIT 1'));
-					# �������
-					/*if($rep['rep'.$quest['city']] < 10000 && $rep['rep'.$quest['city']] + $d['add_rep'] >= 10000 && $quest['kin'] != 1) {
-						$rep['rep'.$quest['city']] = 9999;
-					} else*/if($rep['rep'.$quest['city']] < 24999 && $rep['rep'.$quest['city']] + $d['add_rep'] >= 24999 && $quest['kin'] != 2) {
-						$rep['rep'.$quest['city']] = 24999;
-					} else {
-						$rep['rep'.$quest['city']] += $d['add_rep'];
-					}
-					mysql_query('UPDATE `rep` SET `rep'.$quest['city'].'` = "'.$rep['rep'.$quest['city']].'" WHERE `id` = "'.$rep['id'].'" LIMIT 1');
-			    } 
-			} 
-			
-			if( isset($d['add_repizlom']) ) {
-				$t .= ''.$d['add_repizlom'].' ��. ��������� ������ �����, ';
-				$rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$u->info['id'].'" LIMIT 1'));
-				$rep['repizlom'] += $d['add_repizlom'];
-				if($rep['repizlom'] > 24999) {
-					$rep['repizlom'] = 24999;
-				}
-				mysql_query('UPDATE `rep` SET `repizlom` = "'.$rep['repizlom'].'" WHERE `id` = "'.$rep['id'].'" LIMIT 1');
-			}
-			
-			if(isset($d['add_eff'])) {
-				$i = 0; $j = explode('=',$d['add_eff']);
-				while($i < count($j)) {
-					if($j[$i] > 0) {
-						$magic->add_eff($u->info['id'],$j[$i],1);
-					}
-					$i++;
-				}
-			}
-			
-			if(isset($d['add_cr'])) {
-				$t .= ''.$d['add_cr'].' ��., ';
-				mysql_query('UPDATE `users` SET `money` = `money`+'.$d['add_cr'].' WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			}
-			
-			if($t!='') {
-				$t = rtrim($t,', ');
-				$r = '������� <b>'.$quest['name'].'</b> ���� ������� ���������! �� �������� �������: '.$t.'.';
-				unset($t);
-			} else {
-				$r = '������� <b>'.$quest['name'].'</b> ���� ������� ���������!';
-			}
-			
-			$r = '<small>'.$r.'</small>';
-			//���������� ��������� � ���
-			
-			mysql_query('UPDATE `actions` SET `vals` = "win" , `time` = "'.time().'"  WHERE `id` = "'.$action['id'].'" AND `vals` = "go" LIMIT 1');
-			
-			mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','".$u->info['login']."','".$r."','-1','5','0')");
-		}
-		
-		return $r;
-	}
+        //������� �� �����
+        $d = $this->expl($pl['win_date']);
 
-	public function winQuest( $pl ) {
-		global $u,$c,$magic;
-				
-		if( isset($pl['id']) ) { 
-			$d = $this->expl($pl['act_date']);
-			
-			$d = array_merge($d, $this->expl($pl['win_date']));
-				
-			if( $_COOKIE['login'] == 'R' || $_COOKIE['login'] == 'r' ) {
-				echo '<script>alert("';
-				print_r(str_replace("\n",' ',$d));
-				echo '");</script>';
-				die();
-			}
-						
-			// �������� �������
-			if( isset($d['tk_itm']) ) {
-				$ex = explode(',',$d['tk_itm']);
-				$i = 0;
-				while( $i < count($ex) ) {
-					$ex2 = explode('=',$ex[$i]);
-						$ex2 = explode('=',$ex[$i]);					
-						$x2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.$pl2['time'].' AND `vars` = "win_bot_'.$ex2[0].'" LIMIT '.$ex2[1],2);
-					$u->deleteItemID($ex2[0],$u->info['id'],$ex2[1]);
-					$i++;
-				}
-			}
-			// �������� ������
-			if( isset($d['tkill_itm']) ) {
-				$ex = explode(',',$d['tkill_itm']);
-				$i = 0;
-				while( $i < count($ex) ) {
-					$ex2 = explode('=',$ex[$i]);
-						$ex2 = explode('=',$ex[$i]);					
-						$x2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.$pl2['time'].' AND `vars` = "win_bot_'.$ex2[0].'" LIMIT '.$ex2[1],2);
-					$u->deleteItemID($ex2[0],$u->info['id'],$ex2[1]);
-					$i++;
-				}
-			}
-			
-			$t = '';
-			if( isset($d['add_rep']) ) { // �������� ��������� �� �����, ���� ��� �������� �����.
-			    if( isset($d['kill_bot']) && isset($d['all_kill']) && $d['add_rep'] > 0 ){
-					$ex = explode(',', $d['kill_bot']);
-					$ii = 0;
-					$d['add_rep'] = 0;
-					while( $ii < count($ex) ) {
-						$i = 0;
-						$ex2 = explode('=',$ex[$i]);
-						while( $i < $d['all_kill'] ) {
-							$x2 = 0;
-							$d['add_rep'] = $d['add_rep'] + $ex2[1];
-							$x2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` > '.$pl2['time'].' AND `vars` = "win_bot_'.$ex2[0].'" LIMIT '.$d['all_kill'],2);
-							$i++;
-						}
-						$ii++;
-					}
-			    }
-			    unset($x,$i,$ii,$ex,$x2,$bot2,$ex2);
-			    if($pl['city']!=''){
-					$t .= ''.$d['add_rep'].' ��. ��������� '.$u->city_name[$pl['city']].', ';
-					$rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$u->info['id'].'" LIMIT 1'));
-					// �������
-					/*if($rep['rep'.$pl['city']] < 10000 && $rep['rep'.$pl['city']] + $d['add_rep'] >= 10000 && $pl['kin'] != 1) {
-						$rep['rep'.$pl['city']] = 9999;
-					} else*/if($rep['rep'.$pl['city']] < 24999 && $rep['rep'.$pl['city']] + $d['add_rep'] >= 24999 && $pl['kin'] != 2) {
-						$rep['rep'.$pl['city']] = 24999;
-					} else {
-						$rep['rep'.$pl['city']] += $d['add_rep'];
-					}
-					mysql_query('UPDATE `rep` SET `rep'.$pl['city'].'` = "'.$rep['rep'.$pl['city']].'" WHERE `id` = "'.$rep['id'].'" LIMIT 1');
-			    } 
-			}
-			
-			if(isset($d['add_repizlom'])){
-				$t .= ''.$d['add_repizlom'].' ��. ��������� ������ �����, ';
-				$rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$u->info['id'].'" LIMIT 1'));
-				$rep['repizlom'] += $d['add_repizlom'];
-				if($rep['repizlom'] > 24999) {
-					$rep['repizlom'] = 24999;
-				}
-				mysql_query('UPDATE `rep` SET `repizlom` = "'.$rep['repizlom'].'" WHERE `id` = "'.$rep['id'].'" LIMIT 1');
-			}
-			
-			if(isset($d['add_eff'])) {
-				$i = 0; $j = explode('=',$d['add_eff']);
-				while($i < count($j)) {
-					if($j[$i] > 0) {
-						$magic->add_eff($u->info['id'],$j[$i],1);
-					}
-					$i++;
-				}
-			}
-			
-			if(isset($d['add_cr'])) {
-				$t .= ''.$d['add_cr'].' ��., ';
-				mysql_query('UPDATE `users` SET `money` = `money`+'.$d['add_cr'].' WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			}
-			
-			if($t!='') {
-				$t = rtrim($t,', ');
-				$r = '������� <b>'.$pl['name'].'</b> ���� ������� ���������! �� �������� �������: '.$t.'.';
-				unset($t);
-			} else {
-				$r = '������� <b>'.$pl['name'].'</b> ���� ������� ���������!';
-			}
-			$r = '<small>'.$r.'</small>';
-			//���������� ��������� � ���
-			mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','".$u->info['login']."','".$r."','-1','5','0')");
-		}
-	}
-	
-	public function expl($d) {
-		$i = 0;
-		$e = explode(':|:',$d);
-		while($i<count($e))
-		{
-			$t = explode(':=:',$e[$i]);
-			if(isset($t[0]))
-			{
-				$dr[$t[0]] = $t[1];
-			}
-			$i++;
-		}
-		unset($i,$e,$t);
-		return $dr;
-	}
+        if (isset($d['add_eff'])) {
+            $x5 = '';
+            $x3 = explode(',', $d['add_eff']);
+            $x4 = 0;
+            while ($x4 < count($x3)) {
+                $x7 = explode('=', $x3[$x4]);
+                $x6 = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`img` FROM `eff_main` WHERE `id2` = "' . $x7[0] . '" LIMIT 1'));
+                if (isset($x6['id2'])) {
+                    $x5 .= '<img width="40" height="25" src="https://img.new-combats.com/i/eff/' . $x6['img'] . '" title="' . $x6['mname'] . '
+����� ��������: ' . $u->timeOut($x7[1]) . '"> ';
+                }
+                $x4++;
+            }
+            if ($x5 != '') {
+                $t .= $x5 . '<br>';
+            }
+            unset($x3, $x4, $x5, $x6, $x7);
+        }
+
+        if (isset($d['add_rep'])) {
+            $t .= '��������� ' . $u->city_name[$pl['city']] . ': ' . $d['add_rep'] . '<br>';
+        }
+
+        if (isset($d['add_repizlom'])) {
+            $t .= '��������� ����� �����: ' . $d['add_repizlom'] . '<br>';
+        }
+
+        if (isset($d['add_cr'])) {
+            $t .= '������: ' . $d['add_cr'] . ' ��.<br>';
+        }
+
+        if ($t != '') {
+            $r = '<b>�������:</b><br>' . $t . '<br>' . $r;
+            $t = '';
+        }
+
+        //�������� ������
+        $d = $this->expl($pl['act_date']);
+        //���������� � NPS
+        if (isset($d['dlg_nps'])) {
+            $i7 = 0;
+            $x3 = explode(',', $d['dlg_nps']);
+            while ($i7 < count($x3)) {
+                $x4 = explode('=', $x3[$i7]);
+                if ($x4[0] > 0) {
+                    $x1 = mysql_fetch_array(mysql_query('SELECT `text` FROM `dungeon_dialog` WHERE `id` = "' . $x4[0] . '" LIMIT 1'));
+                    if (!isset($x1['text'])) {
+                        $x1 = '<i>����������</i>';
+                    } else {
+                        $x1 = $x1['text'];
+                    }
+                    $x = 0;
+                    $t .= '���������� � <b>' . $x1 . '</b>: ' . $x . '/1<br>';
+                }
+                $i7++;
+            }
+            unset($x1, $x3, $x4, $i7);
+        }
+
+        //����� �������
+        if (isset($d['kill_user'])) {
+            $t .= '����� �������: 0/' . $d['kill_user'] . '<br>';
+        }
+
+        //����� �����
+        if (isset($d['kill_bot'])) {
+
+            if (isset($d['all_kill']) && (int)$d['all_kill'] > 0) {
+                $x = '';
+                $ex = explode(',', $d['kill_bot']);
+                $i = 0; # ���������� ������ ��� ������� ���� ����.
+                $q = '';
+                while ($i < count($ex)) {
+                    $ex2 = explode('=', $ex[$i]);
+                    if ($q != '') {
+                        $q .= ' OR ';
+                    }
+                    $q .= ' (`uid` = "' . $u->info['id'] . '" AND `time` > ' . $qst['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" )';
+                    $i++;
+                }
+                $x2 = $u->testAction($q, 2);
+                $x2 = $x2[0];
+                if ($d['all_kill'] < $x2) {
+                    $x2 = $d['all_kill'];
+                }
+                $bot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $ex2[0] . '" LIMIT 1'));
+                if (isset($bot2['id'])) {
+                    $x .= '&nbsp; &nbsp; &bull; <b>' . $bot2['login'] . '</b> [' . $x2 . '/' . $d['all_kill'] . ']<br>';
+                } else {
+                    $x .= '&nbsp; &nbsp; &bull; <b>' . $pl['name'] . '</b> [' . $x2 . '/' . $d['all_kill'] . ']<br>';
+                }
+            } else {
+                $i = 0;
+                while ($i < count($ex)) {
+                    $x2 = 0;
+                    $ex2 = explode('=', $ex[$i]);
+                    $bot2 = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . $ex2[0] . '" LIMIT 1'));
+                    if (isset($bot2['id'])) {
+                        if (isset($qst['id'])) {
+                            $x2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` > ' . $qst['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" LIMIT ' . $ex2[1], 2);
+                            $x2 = 0 + $x2[0];
+                        }
+                        $x .= '&nbsp; &nbsp; &bull; <b>' . $bot2['login'] . '</b> [' . $x2 . '/' . $ex2[1] . ']<br>';
+                    }
+                    $i++;
+                }
+            }
+
+            if ($x != '') {
+                $x = trim($x, ', ');
+                $t .= '����� �����: <br>' . $x;
+            }
+            unset($x, $ex, $x2, $bot2, $ex2);
+        }
+
+        //������� �������
+        if (isset($d['tk_itm'])) {
+            $ex = explode(',', $d['tk_itm']);
+            $i = 0;
+            $x = '';
+            while ($i < count($ex)) {
+                $ex2 = explode('=', $ex[$i]);
+                $x2 = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id` = "' . mysql_real_escape_string($ex2[0]) . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
+                if ($x2[0] >= $ex2[1]) {
+                    $x2[0] = ($ex2[1] + round($ex2[1] * 0.15));
+                }
+                $bot2 = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($ex2[0]) . '" LIMIT 1'));
+                $x .= '&nbsp; &nbsp; &bull; <a target=_blank href=https://new-combats.com/item/' . $bot2['id'] . ' >' . $bot2['name'] . '</a> [' . $x2[0] . '/' . $ex2[1] . ']<br>';
+                $i++;
+            }
+            if ($x != '') {
+                $x = trim($x, ', ');
+                $t .= '������� �������: <br>' . $x;
+            }
+        }
+
+        //��������� �������
+        if (isset($d['tkill_itm'])) {
+            $ex = explode(',', $d['tkill_itm']);
+            $i = 0;
+            $x = '';
+            while ($i < count($ex)) {
+                $ex2 = explode('=', $ex[$i]);
+                $x2 = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `maidin` = "' . $pl['city'] . '" AND `item_id` = "' . mysql_real_escape_string($ex2[0]) . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
+                if ($x2[0] >= $ex2[1]) {
+                    $x2[0] = ($ex2[1] + round($ex2[1] * 0.15));
+                }
+                $bot2 = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img` FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($ex2[0]) . '" LIMIT 1'));
+                $x .= '&nbsp; &nbsp; &bull; <a target=_blank href=https://new-combats.com/item/' . $bot2['id'] . ' >' . $bot2['name'] . '</a> [' . $x2[0] . '/' . $ex2[1] . ']<br>';
+                $i++;
+            }
+            if ($x != '') {
+                $x = trim($x, ', ');
+                $t .= '������� ������: <br>' . $x;
+            }
+        }
+
+        if ($t != '') {
+            $r = '<br><b>�������� �������:</b><br>' . $t . '<br>' . $r;
+            $t = '';
+        }
+
+        if ($r == '') {
+            $r = '�������������� ���������� �� ������� �����������';
+        }
+        return $r;
+    }
+
+    /** ���������� ������ ������ ������ ���.
+     * PHP Fatal error:  Call to a member function testquest() on a non-object
+     * @return void
+     */
+    public function testquest()
+    {
+        global $u;
+        if ($u->info['battle'] == 0 && $u->room['name'] != '����� ������') {
+            $sp = mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` LIKE "%start_quest%" AND `vals` = "go" LIMIT 100');
+
+            while ($pl2 = mysql_fetch_array($sp)) {
+                $pl = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "' . (str_replace('start_quest', '', $pl2['vars'])) . '" LIMIT 1'));
+
+                $g = 1;
+                //�������� ������
+                $d = $this->expl($pl['act_date']);
+
+                //���������� � NPS
+                if (isset($d['dlg_nps'])) {
+                    $g = 0;
+                    unset($x);
+                }
+
+                //����� �������
+                if (isset($d['kill_user'])) {
+                    $x = 0;
+                    if ($x < $d['kill_user']) {
+                        $g = 0;
+                    }
+                    //$d['kill_user'] - �������� ����� �����
+                    unset($x);
+                }
+                //����� �����
+                if (isset($d['kill_bot'])) {
+                    $ex = explode(',', $d['kill_bot']);
+                    $ii = 0; // ���������� ������ ��� ������� ���� ����.
+                    $q = '';
+                    while ($ii < count($ex)) {
+                        $ex2 = explode('=', $ex[$ii]);
+                        if ($q != '') {
+                            $q .= ' OR ';
+                        }
+                        $q .= ' (`uid` = "' . $u->info['id'] . '" AND `time` > ' . $pl2['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" )';
+                        $ii++;
+                    }
+                    if (isset($d['all_kill']) && $d['all_kill'] > 0) {
+                        $x2 = $u->testAction($q . ' LIMIT ' . $d['all_kill'], 2);
+                        if ($x2[0] < $d['all_kill']) {
+                            $g = 0;
+                        }
+                    } else {
+                        $x2 = $u->testAction($q . ' LIMIT ' . $ex2[1], 2);
+                        if (!isset($d['all_kill']) && $x2[0] < $ex2[1]) {
+                            $g = 0;
+                        }
+                    }
+                    unset($x, $ex, $x2, $x3, $bot2, $ex2);
+                }
+
+                //������� �������
+                if (isset($d['tk_itm'])) {
+                    $g = $this->collect_01(explode(',', $d['tk_itm']), $u);
+                }
+                //��������� �������
+                if (isset($d['tkill_itm'])) {
+                    $g = $this->collect_01(explode(',', $d['tkill_itm']), $u);
+                }
+                if ($g == 1) {
+                    $pl['time'] = $pl2['time'];
+                    $this->endq($pl['id'], 'win');
+                    $this->winQuest($pl);
+                    echo $pl['name'];
+                }
+            }
+        }
+    }
+
+    private function collect_01($arr, $u){ // ������ ������������. ��� ����� ��� ���������, �� ��� �������.
+        $i = 0;
+        while ($i < count($arr)) {
+            $ex2 = explode('=', $arr[$i]);
+            $x2 = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id` = ' . (int)$arr[0] . ' AND `uid` = ' . $u->info['id'] . ' AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
+            if ($x2[0] < $ex2[1]) {
+                return 0;
+            }
+            $i++;
+        }
+        return 1;
+    }
+
+    private function collect_02($ex, $u, $pl) { // ������ ������������. ��� ����� ��� ���������, �� ��� �������.
+        $i = 0;
+        while ($i < count($ex)) {
+            $ex2 = explode('=', $ex[$i]);
+            $x2 = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `maidin` = "' . $pl['city'] . '" AND `item_id` = "' . mysql_real_escape_string($ex2[0]) . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
+            if ($x2[0] >= $ex2[1]) {
+                if ($x2[0] <= ($ex2[1] + round($ex2[1] * 0.15))) {
+                    $ex2[1] = $x2[0];
+                } else {
+                    $ex2[1] = ($ex2[1] + round($ex2[1] * 0.15));
+                }
+            }
+            if ($x2[0] < $ex2[1]) {
+                return 0;
+            }
+            $i++;
+        }
+        return 1;
+    }
+
+    # ������� �������� �� �������� �� ���������� ������� ��� ��������
+    public function questCheckEnd($pl)
+    {
+        global $u;
+        $quest = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `vars` = "start_quest' . $pl['id'] . '" ORDER BY `time` DESC LIMIT 1'));
+        #��������� �����, �������� = 0 ���, 1 ��.
+        $r = 0;
+        if ($u->info['battle'] == 0 && $u->room['name'] != '����� ������') {
+            $g = 1;
+            # �������� ������
+            $d = $this->expl($pl['act_date']);
+
+            # ���������� � NPS
+            if (isset($d['dlg_nps'])) {
+                $g = 0;
+                unset($x);
+            }
+
+            # ����� �������
+            if (isset($d['kill_user'])) {
+                $x = 0;
+                if ($x < $d['kill_user']) {
+                    $g = 0;
+                }
+                unset($x);
+            }
+
+            # ����� �����
+            if (isset($d['kill_bot'])) {
+                $ex = explode(',', $d['kill_bot']);
+                $i = 0; # ���������� ������ ��� ������� ���� ����.
+                $q = '';
+                while ($i < count($ex)) {
+                    $ex2 = explode('=', $ex[$i]);
+                    if ($q != '') {
+                        $q .= ' OR ';
+                    }
+                    $q .= ' (`uid` = "' . $u->info['id'] . '" AND `time` > ' . $quest['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" )';
+                    $i++;
+                }
+                if (isset($d['all_kill']) && (int)$d['all_kill'] > 0) {
+                    $x2 = $u->testAction($q, 2);
+                    if ((int)$d['all_kill'] <= $x2[0]) {
+                        $x2 = (int)$d['all_kill'];
+                    } else {
+                        $x2 = $x2[0];
+                    }
+                    if ($x2 < (int)$d['all_kill']) {
+                        $g = 0;
+                    }
+                } else {
+                    $x2 = $u->testAction($q . ' LIMIT ' . $ex2[1], 2);
+                    $x2 = min($ex2[1], $x2[0]);
+                    if ($x2 < $ex2[1]) {
+                        $g = 0;
+                    }
+                }
+                unset($x, $ex, $x2, $x3, $bot2, $ex2);
+            }
+
+            # ������� �������
+            if (isset($d['tk_itm'])) {
+                $g = $this->collect_02(explode(',', $d['tk_itm']), $u, $pl);
+            }
+            # ��������� �������
+            if (isset($d['tkill_itm'])) {
+                $g = $this->collect_02(explode(',', $d['tkill_itm']), $u, $pl);
+            }
+            $r = $g == 1 ? 1 : 0;
+        }
+        return $r;
+    }
+
+    /** ������ ������ �� ������ */
+    public function questSuccesEnd($quest, $action)
+    {
+        global $u, $c, $magic;
+        $r = '';
+
+        if (!isset($quest['id'])) {
+            return '';
+        }
+        $d = $this->expl($quest['act_date']);
+        $d = array_merge($d, $this->expl($quest['win_date']));
+
+        // �������� ������� ��� ������
+        if (isset($d['tk_itm']) || isset($d['tkill_itm'])) {
+            $ex = [];
+            if (isset($d['tk_itm'])) {
+                $ex[0] = explode(',', $d['tk_itm']);
+            }
+            if (isset($d['tkill_itm'])) {
+                $ex[1] = explode(',', $d['tkill_itm']);
+            }
+
+            $i = 0;
+            while ($i < count($ex)) {
+                $ex2 = explode('=', $ex[$i]);
+                $x2 = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `maidin` = "' . $quest['city'] . '" AND `item_id` = "' . mysql_real_escape_string($ex2[0]) . '" AND `uid` = "' . $u->info['id'] . '" AND (`delete` = 1000 OR `delete` = 0) AND `inTransfer` = 0 AND `inShop` = 0 LIMIT 1'));
+                if ($x2[0] >= $ex2[1]) {
+                    if ($x2[0] <= ($ex2[1] + round($ex2[1] * 0.15))) {
+                        $ex2[1] = $x2[0];
+                    } else {
+                        $ex2[1] = ($ex2[1] + round($ex2[1] * 0.15));
+                    }
+                }
+                $d['add_rep'] = (int)$d['add_rep'] * (int)$ex2[1];
+                $u->deleteItemID($ex2[0], $u->info['id'], $ex2[1]);
+                $i++;
+            }
+        }
+        $t = '';
+
+        # �������� ��������� �� �����,
+        if (isset($d['add_rep'])) {
+            # ���� ��� �������� �����.
+            if (isset($d['kill_bot']) && isset($d['all_kill']) && $d['add_rep'] > 0) {
+                $ex = explode(',', $d['kill_bot']);
+                $ii = 0;
+                if ($quest['kin'] == 0) {
+                    $d['add_rep'] = 0;
+                    while ($ii < count($ex)) {
+                        $i = 0;
+                        $ex2 = explode('=', $ex[$i]);
+                        while ($i < $d['all_kill']) {
+                            $x2 = 0;
+                            $d['add_rep'] = $d['add_rep'] + $ex2[1];
+                            $x2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` > ' . $action['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" LIMIT ' . $d['all_kill'], 2);
+                            $i++;
+                        }
+                        $ii++;
+                    }
+                } else {
+                    $d['add_rep'] = 1;
+                }
+            }
+
+            unset($x, $i, $ii, $ex, $x2, $bot2, $ex2);
+
+            $rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = ' . $u->info['id']));
+
+            if ($quest['city'] != '') {
+                if ($this->stats['more_awards'] >= 0) {
+                    $d['add_rep'] += $d['add_rep'] / 100 * 50;
+                }
+                $t .= '' . $d['add_rep'] . ' ��. ��������� ' . $u->city_name[$quest['city']] . ', ';
+                if (
+                    $rep['rep' . $quest['city']] < 24999 &&
+                    $rep['rep' . $quest['city']] + $d['add_rep'] >= 24999 &&
+                    $quest['kin'] != 2
+                ) {
+                    $rep['rep' . $quest['city']] = 24999;
+                } else {
+                    $rep['rep' . $quest['city']] += $d['add_rep'];
+                }
+
+                mysql_query('UPDATE `rep` SET `rep' . $quest['city'] . '` = "' . $rep['rep' . $quest['city']] . '" WHERE `id` = "' . $rep['id'] . '" LIMIT 1');
+            }
+        }
+        if (isset($d['add_repizlom'])) {
+            $t .= '' . $d['add_repizlom'] . ' ��. ��������� ������ �����, ';
+            $rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'));
+            $rep['repizlom'] += $d['add_repizlom'];
+            if ($rep['repizlom'] > 24999) {
+                $rep['repizlom'] = 24999;
+            }
+            mysql_query('UPDATE `rep` SET `repizlom` = "' . $rep['repizlom'] . '" WHERE `id` = "' . $rep['id'] . '" LIMIT 1');
+        }
+        if (isset($d['add_eff'])) {
+            $i = 0;
+            $j = explode('=', $d['add_eff']);
+            while ($i < count($j)) {
+                if ($j[$i] > 0) {
+                    $magic->add_eff($u->info['id'], $j[$i], 1);
+                }
+                $i++;
+            }
+        }
+        if (isset($d['add_cr'])) {
+            $t .= '' . $d['add_cr'] . ' ��., ';
+            mysql_query('UPDATE `users` SET `money` = `money`+' . $d['add_cr'] . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+        }
+        if ($t != '') {
+            $t = rtrim($t, ', ');
+            $r = '������� <b>' . $quest['name'] . '</b> ���� ������� ���������! �� �������� �������: ' . $t . '.';
+            unset($t);
+        } else {
+            $r = '������� <b>' . $quest['name'] . '</b> ���� ������� ���������!';
+        }
+        $r = '<small>' . $r . '</small>';
+        //���������� ��������� � ���
+        mysql_query('UPDATE `actions` SET `vals` = "win" , `time` = "' . time() . '"  WHERE `id` = "' . $action['id'] . '" AND `vals` = "go" LIMIT 1');
+
+        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $r . "','-1','5','0')");
+
+        return $r;
+    }
+
+    public function winQuest($pl)
+    {
+        global $u, $c, $magic;
+
+        if (isset($pl['id'])) {
+            $d = $this->expl($pl['act_date']);
+
+            $d = array_merge($d, $this->expl($pl['win_date']));
+
+            if ($_COOKIE['login'] == 'R' || $_COOKIE['login'] == 'r') {
+                echo '<script>alert("';
+                print_r(str_replace("\n", ' ', $d));
+                echo '");</script>';
+                die();
+            }
+
+            // �������� �������
+            if (isset($d['tk_itm'])) {
+                $ex = explode(',', $d['tk_itm']);
+                $i = 0;
+                while ($i < count($ex)) {
+                    $ex2 = explode('=', $ex[$i]);
+                    $ex2 = explode('=', $ex[$i]);
+                    $x2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` > ' . $pl2['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" LIMIT ' . $ex2[1], 2);
+                    $u->deleteItemID($ex2[0], $u->info['id'], $ex2[1]);
+                    $i++;
+                }
+            }
+            // �������� ������
+            if (isset($d['tkill_itm'])) {
+                $ex = explode(',', $d['tkill_itm']);
+                $i = 0;
+                while ($i < count($ex)) {
+                    $ex2 = explode('=', $ex[$i]);
+                    $ex2 = explode('=', $ex[$i]);
+                    $x2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` > ' . $pl2['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" LIMIT ' . $ex2[1], 2);
+                    $u->deleteItemID($ex2[0], $u->info['id'], $ex2[1]);
+                    $i++;
+                }
+            }
+
+            $t = '';
+            if (isset($d['add_rep'])) { // �������� ��������� �� �����, ���� ��� �������� �����.
+                if (isset($d['kill_bot']) && isset($d['all_kill']) && $d['add_rep'] > 0) {
+                    $ex = explode(',', $d['kill_bot']);
+                    $ii = 0;
+                    $d['add_rep'] = 0;
+                    while ($ii < count($ex)) {
+                        $i = 0;
+                        $ex2 = explode('=', $ex[$i]);
+                        while ($i < $d['all_kill']) {
+                            $x2 = 0;
+                            $d['add_rep'] = $d['add_rep'] + $ex2[1];
+                            $x2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` > ' . $pl2['time'] . ' AND `vars` = "win_bot_' . $ex2[0] . '" LIMIT ' . $d['all_kill'], 2);
+                            $i++;
+                        }
+                        $ii++;
+                    }
+                }
+                unset($x, $i, $ii, $ex, $x2, $bot2, $ex2);
+                if ($pl['city'] != '') {
+                    $t .= '' . $d['add_rep'] . ' ��. ��������� ' . $u->city_name[$pl['city']] . ', ';
+                    $rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'));
+                    // �������
+                    /*if($rep['rep'.$pl['city']] < 10000 && $rep['rep'.$pl['city']] + $d['add_rep'] >= 10000 && $pl['kin'] != 1) {
+                        $rep['rep'.$pl['city']] = 9999;
+                    } else*/
+                    if ($rep['rep' . $pl['city']] < 24999 && $rep['rep' . $pl['city']] + $d['add_rep'] >= 24999 && $pl['kin'] != 2) {
+                        $rep['rep' . $pl['city']] = 24999;
+                    } else {
+                        $rep['rep' . $pl['city']] += $d['add_rep'];
+                    }
+                    mysql_query('UPDATE `rep` SET `rep' . $pl['city'] . '` = "' . $rep['rep' . $pl['city']] . '" WHERE `id` = "' . $rep['id'] . '" LIMIT 1');
+                }
+            }
+
+            if (isset($d['add_repizlom'])) {
+                $t .= '' . $d['add_repizlom'] . ' ��. ��������� ������ �����, ';
+                $rep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "' . $u->info['id'] . '" LIMIT 1'));
+                $rep['repizlom'] += $d['add_repizlom'];
+                if ($rep['repizlom'] > 24999) {
+                    $rep['repizlom'] = 24999;
+                }
+                mysql_query('UPDATE `rep` SET `repizlom` = "' . $rep['repizlom'] . '" WHERE `id` = "' . $rep['id'] . '" LIMIT 1');
+            }
+
+            if (isset($d['add_eff'])) {
+                $i = 0;
+                $j = explode('=', $d['add_eff']);
+                while ($i < count($j)) {
+                    if ($j[$i] > 0) {
+                        $magic->add_eff($u->info['id'], $j[$i], 1);
+                    }
+                    $i++;
+                }
+            }
+
+            if (isset($d['add_cr'])) {
+                $t .= '' . $d['add_cr'] . ' ��., ';
+                mysql_query('UPDATE `users` SET `money` = `money`+' . $d['add_cr'] . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            }
+
+            if ($t != '') {
+                $t = rtrim($t, ', ');
+                $r = '������� <b>' . $pl['name'] . '</b> ���� ������� ���������! �� �������� �������: ' . $t . '.';
+                unset($t);
+            } else {
+                $r = '������� <b>' . $pl['name'] . '</b> ���� ������� ���������!';
+            }
+            $r = '<small>' . $r . '</small>';
+            //���������� ��������� � ���
+            mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $r . "','-1','5','0')");
+        }
+    }
+
+    private function expl($d)
+    {
+        $i = 0;
+        $dr = [];
+        $e = explode(':|:', $d);
+        while ($i < count($e)) {
+            $t = explode(':=:', $e[$i]);
+            if (isset($t[0])) {
+                $dr[$t[0]] = $t[1];
+            }
+            $i++;
+        }
+        return $dr;
+    }
 }
 
-$q = new quests;
-?>
\ No newline at end of file
+$q = new quests;
\ No newline at end of file
diff --git a/_incl_data/class/__userOLD.php b/_incl_data/class/__userOLD.php
deleted file mode 100644
index 5a5bf0b1..00000000
--- a/_incl_data/class/__userOLD.php
+++ /dev/null
@@ -1,12519 +0,0 @@
-<?php
-if(!defined('GAME')) { die(); }
-
-//system('pkill www-data');
-
-function getdr($s, $v, $d) {
-  global $u;
-  $i = 0;
-  while($i < count($v))	{
-	if(isset($v[$i])) {
-	  $s = str_replace('{'.$v[$i].'}',$d[$i],$s);
-	}
-	$i++;
-  }
-  $s = eval("return (".$s.");");
-  return floor($s);
-}
-
-class user {
-	private static $flag_one;
-	public $pokol = 2; //����������� ��������� ���������
-	public $ekrcast = array(
-		310 => true, //�������� ������� ��������
-		
-		33	=> true, //�������� �������
-		34	=> true, //�������� �������
-		35	=> true, //�������� ������
-		
-		42	=> true, //������������ ������	
-		43	=> true, //������������ �������
-		
-		296	=> true
-		
-	);
-	public $aves = array('now'=>0,'max'=>0),$rep,$tfer,$error2 = '', $room = array(), $bank = array(), $align_nm = array(
-		1	=>	'����',
-		2	=>	'����',
-		3	=>	'����',
-		7	=>	'�����������'
-	), $mod_nm = array(
-						0=>array(0=>''),
-						1=>array('1'=>'����','1.1'=>'������� ����������','1.4'=>'���������� �������','1.5'=>'������� ��������� ������','1.6'=>'����������','1.7'=>'������� �������� ����','1.75'=>'�������-���������','1.9'=>'������� ����','1.91'=>'������� ������� ����','1.92'=>'������� ������','1.99'=>'��������� �������'),
-						3=>array('3'=>'����','3.01'=>'������-���������','3.05'=>'������-�����������','3.06'=>'��������','3.07'=>'������-������','3.075'=>'������-���������','3.09'=>'������-�����','3.091'=>'������-�������','3.092'=>'������� ������','3.99'=>'������ ��������')
-						);
-	public $btl_txt = '',$rgd = array(0=>0,1=>0),$error = '',
-	
-	$city_unid = array(0,'capitalcity','angelscity','abandonedplain','newcapitalcity','demonscity','fallenearth','emeraldscity','dreamscity','suncity'),
-	$city_id = array('capitalcity'=>1,'angelscity'=>2,'abandonedplain'=>3,'newcapitalcity'=>4,'demonscity'=>5,'fallenearth'=>6,'emeraldscity'=>6,'suncity'=>7,'dreamscity'=>8),
-	$city_name = array('emeraldscity' => 'Emeralds city','abandonedplain'=>'Abandoned Plain','capitalcity'=>'Capital city','angelscity'=>'Angels city','newcapitalcity'=>'New Capital city','demonscity'=>'Demons city','fallenearth'=>'Fallen Earth','dreamscity'=>'Dreams City','suncity'=>'Sun City'),
-	$city_name2 = array('emeraldscity' => 'Emeraldscity', 'abandonedplain'=>'Abandonedplain','capitalcity'=>'Capitalcity','angelscity'=>'Angelscity','newcapitalcity'=>'Newcapitalcity','demonscity'=>'Demonscity','fallenearth'=>'FallenEarth','dreamscity'=>'Dreams City','suncity'=>'Sun City'),
-	
-	$stats,$info,$map,$mapUsers,$is = array(
-	'acestar' => '��������� ���� ����� �����������', 'spasenie' => '�������� ����� ������','more_awards' => '��������� ������� %', 'exp' => '���������� ���� (%)', 'align_bs' => '��������� ������',
-	'nopryh' => '������ ���������', 'puti'=>'������ �����������','align'=>'����������','hpAll'=>'<font color=darkgreen><b>������� ����� (HP)</font></b>','mpAll'=>'<font color=blue><b>������� ���� (�P)</font></b>','enAll'=>'������� �������','sex'=>'���','lvl'=>'�������','s1'=>'����','s2'=>'��������','s3'=>'��������','s4'=>'������������','s5'=>'���������','s6'=>'��������','s7'=>'����������','s8'=>'����','s9'=>'������� ����','s10'=>'��������������','s11'=>'�������','m1'=>'��. ������������ ����� (%)','m2'=>'��. ������ ������������ ����� (%)','m3'=>'��. �������� ����. ����� (%)','m4'=>'��. ����������� (%)','m5'=>'��. ������ ����������� (%)','m6'=>'��. ���������� (%)','m7'=>'��. ����������� (%)','m8'=>'��. ����� ����� (%)','m9'=>'��. ����� ������ ����� (%)','m14'=>'��. ���. ������������ ����� (%)','m15'=>'��. ���. ����������� (%)','m16'=>'��. ���. ����������� (%)','m17'=>'��. ���. ���������� (%)','m18'=>'��. ���. ����� ����� (%)','m19'=>'��. ���. ���������� ������ (%)','m20'=>'��. ����� (%)','a1'=>'���������� �������� ������, ���������','a2'=>'���������� �������� ��������, ��������','a3'=>'���������� �������� ��������, ��������','a4'=>'���������� �������� ������','a5'=>'���������� �������� ����������� ��������','a6'=>'���������� �������� ������','a7'=>'���������� �������� ����������','aall'=>'���������� �������� �������','mall'=>'���������� �������� ������ ������','m2all'=>'���������� �������� ������','mg1'=>'���������� �������� ������ ����','mg2'=>'���������� �������� ������ �������','mg3'=>'���������� �������� ������ ����','mg4'=>'���������� �������� ������ �����','mg5'=>'���������� �������� ������ �����','mg6'=>'���������� �������� ������ ����','mg7'=>'���������� �������� ����� ������','tj'=>'������� �����','lh'=>'������ �����','minAtack'=>'����������� ����','maxAtack'=>'������������ ����','m10'=>'��. �������� �����','m11'=>'��. �������� ����� ������','m11a'=>'��. �������� �����','pa1'=>'��. �������� �������� �����','pa2'=>'��. �������� �������� �����','pa3'=>'��. �������� ��������� �����','pa4'=>'��. �������� �������� �����','pm1'=>'��. �������� ����� ����','pm2'=>'��. �������� ����� �������','pm3'=>'��. �������� ����� ����','pm4'=>'��. �������� ����� �����','pm5'=>'��. �������� ����� �����','pm6'=>'��. �������� ����� ����','pm7'=>'��. �������� ����� �����','za'=>'������ �� �����','zm'=>'������ �� ����� ������','zma'=>'������ �� �����','za1'=>'������ �� �������� �����','za2'=>'������ �� �������� �����','za3'=>'������ �� ��������� �����','za4'=>'������ �� �������� �����','zm1'=>'������ �� ����� ����','zm2'=>'������ �� ����� �������','zm3'=>'������ �� ����� ����','zm4'=>'������ �� ����� �����','zm5'=>'������ �� ����� �����','zm6'=>'������ �� ����� ����','zm7'=>'������ �� ����� �����','magic_cast'=>'�������������� ���� �� ���','pza'=>'��������� ������ �� �����','pzm'=>'��������� ������ �� �����','pza1'=>'��������� ������ �� �������� �����','min_heal_proc'=>'������ ������� (%)','notravma'=>'������ �� �����','yron_min'=>'����������� ����','yron_max'=>'������������ ����','zaproc'=>'������ �� ����� (%)','zmproc'=>'������ �� ����� ������ (%)','zm2proc'=>'������ �� ����� ������� (%)','pza2'=>'��������� ������ �� �������� �����','pza3'=>'��������� ������ �� ��������� �����','pza4'=>'��������� ������ �� �������� �����','pzm1'=>'��������� ������ �� ����� ����','pzm2'=>'��������� ������ �� ����� �������','pzm3'=>'��������� ������ �� ����� ����','pzm4'=>'��������� ������ �� ����� �����','pzm5'=>'��������� ������ �� ����� �����','pzm6'=>'��������� ������ �� ����� ����','pzm7'=>'��������� ������ �� ����� �����','speedhp'=>'����������� �������� (%)','speedmp'=>'����������� ���� (%)','tya1'=>'������� �����','tya2'=>'������� �����','tya3'=>'�������� �����','tya4'=>'������� �����','tym1'=>'�������� �����','mg2static_points'=>'������� ������ (������)','tym2'=>'������������� �����','tym3'=>'������� �����','tym4'=>'�������� �����','hpProc'=>'������� ����� (%)','mpProc'=>'������� ���� (%)','tym5'=>'����� �����','tym6'=>'����� ����','tym7'=>'����� �����','min_use_mp'=>'��������� ������ ����','pog'=>'���������� �����','pog2'=>'���������� �����','pog2p'=>'������� ���������� �����','pog2mp'=>'���� ���������� �����','maxves'=>'����������� ������','bonusexp'=>'����������� ���������� ����','speeden'=>'����������� ������� (%)',
-	'antm3' => '��. ������ �������� �����','repair_z' => '���������� ���������� �������','repair_r' => '���������� ���������� ���',
-'yza' => '���������� ����������� ����� (%)','yzm' => '���������� ����� ������ (%)','yzma' => '���������� ����� (%)'
-,'yza1' => '���������� �������� ����� (%)','yza2' => '���������� �������� ����� (%)','yza3' => '���������� ��������� ����� (%)','yza4' => '���������� �������� ����� (%)'
-,'yzm1' => '���������� ����� ���� (%)','yzm2' => '���������� ����� ������� (%)','yzm3' => '���������� ����� ���� (%)','yzm4' => '���������� ����� ����� (%)','yzm5' => '���������� ����� (%)','yzm6' => '���������� ����� (%)','yzm7' => '���������� ����� (%)','rep'=> '��������� ������'
-,'repair_discount' => '������ �� ������ �����','hpVinos' => '����� �����','bronze' => 'Bronze Premium Account','silvers' => 'Silver Premium Account','gold' => 'Gold Premium Account','speed_dungeon' => '�������� ������������ �� �����������'
-);
-	public $items = array(
-					'tr'  => array('sex','align','lvl','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','a1','a2','a3','a4','a5','a6','a7','mg1','mg2','mg3','mg4','mg5','mg6','mg7','mall','m2all','aall','rep', 'align_bs'),
-					'add' => array(
-					'no_vor','antm3','acestar','spasenie','exp','enemy_am1','hod_minmana','yhod','noshock_voda','bronze','silvers','gold','repair_discount',
-					'yza','yzm','yzma','yza1','yza2','yza3','yza4','yzm1','yzm2','yzm3','yzm4','yzm5','yzm6','yzm7','repair_z','repair_r',
-					'notuse_last_pr','yrn_mg_first','antishock','nopryh','speed_dungeon','naemnik','mg2static_points','yrnhealmpprocmg3','nousepriem','notactic','seeAllEff','100proboi1','pog2','pog2p','magic_cast','min_heal_proc','no_yv1','no_krit1','no_krit2','no_contr1','no_contr2','no_bl1','no_pr1','no_yv2','no_bl2','no_pr2','silver','pza','pza1','pza2','pza3','pza4','pzm','pzm1','pzm2','pzm3','pzm4','pzm5','pzm6','pzm7','yron_min','yron_max','notravma','min_zonb','min_zona','nokrit','pog','min_use_mp','za1proc','za2proc','za3proc','za4proc','zaproc','zmproc','zm1proc','zm2proc','zm3proc','zm4proc','shopSale','shopSaleEkr','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','hpVinos','mpVinos','mpAll','enAll','hpProc','mpProc','m1','m2','m3','m4','m5','m6','m7','m8','m9','m14','m15','m16','m17','m18','m19','m20','pa1','pa2','pa3','pa4','pm1','pm2','pm3','pm4','pm5','pm6','pm7','za','za1','za2','za3','za4','zma','zm','zm1','zm2','zm3','zm4','zm5','zm6','zm7','mib1','mab1','mib2','mab2','mib3','mab3','mib4','mab4','speedhp','speedmp','m10','m11','m11a','zona','zonb','maxves','minAtack','maxAtack','bonusexp','speeden'),
-					'sv' => array('pza','pza1','pza2','pza3','pza4','pzm','pzm1','pzm2','pzm3','pzm4','pzm5','pzm6','pzm7','notravma','min_zonb','min_zona','nokrit','pog','min_use_mp','za1proc','za2proc','za3proc','za4proc','zaproc','zmproc','zm1proc','zm2proc','zm3proc','zm4proc','shopSale','shopSaleEkr','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','mpAll','enAll','m1','m2','m3','m4','m5','m6','m7','m8','m9','m14','m15','m16','m17','m18','m19','m20','pa1','pa2','pa3','pa4','pm1','pm2','pm3','pm4','pm5','pm6','pm7','min_use_mp','za','za1','za2','za3','za4','zma','zm','zm1','zm2','zm3','zm4','zm5','zm6','zm7','mib1','mab1','mib2','mab2','mib3','mab3','mib4','mab4','speedhp','speedmp','m10','m11','zona','zonb','maxves','minAtack','maxAtack','speeden')
-					);
-					
-					/*
-						yrnhealmpprocmg3 - ���������������� ���� �� ����� �� ������, � % (����� ����)
-					*/
-
-	public function sys_add($uid,$time,$type,$text,$data,$time_see) {
-		/*if(mysql_query('INSERT INTO `a_system` (`uid`,`time`,`type`,`text`,`data`,`time_see`) VALUES ("'.$uid.'","'.$time.'","'.$type.'","'.$text.'","'.$data.'","'.$time_see.'")')){
-			
-		}else{
-			echo '.';
-		}
-		*/
-	}
-	
-	public function pensia($type) {
-		if( $type == false ) {
-			if( ( $this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] >8) && $this->info['align'] != 2 ) {
-				$r = ($this->info['level']-6) * 0.04;
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = $r.' ���.';
-			}else{
-				$r = $this->info['level'];
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = $r .' ��.';
-			}
-		}else{
-			if( ($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] >8) && $this->info['align'] != 2 ) {
-				$r = ($this->info['level']-6) * 0.04;
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = array(2,$r);
-			}else{
-				$r = $this->info['level'];
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = array(1,$r);
-			}
-		}
-		return $r;
-	}
-	
-	public function testAlign( $an , $uid ) {
-		$r = 1;
-		if( floor($an) > 0 ) {
-			$a = mysql_fetch_array(mysql_query('SELECT * FROM `users_align` WHERE `uid` = "'.$uid.'" AND (`delete` = "0" OR `delete` > "'.time().'") LIMIT 1'));
-			if(isset($a['id'])) {
-				if( floor($a['align']) > 0 ) {
-					if( floor($a['align']) != $an ) {
-						$r = 0;
-					}
-				}
-			}
-		}
-		return $r;
-	}
-	
-	public function abilsRoom($type) {
-		$r = '';
-		//
-		if( $this->info['clan'] > 0 ) {
-			//������ ������������ ���������� � �����
-		}elseif( $type == 'test' ) {
-			if( $this->room['name'] == '��� �����' || $this->room['name'] == '��� ���������' || $this->room['name'] == '��� ����' ) {
-				if(isset($_GET['vhp'])) {
-					$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 1 ORDER BY `time` DESC LIMIT 1'));
-					if( isset($v['id']) && $v['time'] > time() - 60 * 60 ) {
-						//��� �����
-						$this->error = '���������� ��������� ��� '.$this->timeOut( $v['time'] + 60 * 60 - time() );
-					}else{
-						if( $this->stats['hpNow'] < 1 ) { $this->stats['hpNow'] = 0; }
-						$this->error = '�� ������� ������������ '.round($this->stats['hpAll'] - $this->stats['hpNow']).' HP.';
-						mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES (
-							"'.$this->info['id'].'","'.time().'","'.$this->info['room'].'","'.round($this->stats['hpAll'] - $this->stats['hpNow']).'","1"
-						)');
-						$this->stats['hpNow'] = $this->stats['hpAll'];
-						mysql_query('UPDATE `stats` SET `hpNow` = "'.$this->stats['hpNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-				}elseif(isset($_GET['vmp'])) {
-					$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 2 ORDER BY `time` DESC LIMIT 1'));
-					if( isset($v['id']) && $v['time'] > time() - 60 * 60 ) {
-						//��� �����
-						$this->error = '���������� ��������� ��� '.$this->timeOut( $v['time'] + 60 * 60 - time() );
-					}else{
-						if( $this->stats['mpNow'] < 1 ) { $this->stats['mpNow'] = 0; }
-						$this->error = '�� ������� ������������ '.round($this->stats['mpAll'] - $this->stats['mpNow']).' MP.';
-						mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES (
-							"'.$this->info['id'].'","'.time().'","'.$this->info['room'].'","'.round($this->stats['mpAll'] - $this->stats['mpNow']).'","2"
-						)');
-						$this->stats['hpNow'] = $this->stats['hpAll'];
-						mysql_query('UPDATE `stats` SET `mpNow` = "'.$this->stats['mpNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-				}
-			}
-		}elseif( $type == 'look' ) {
-			//
-			if( $this->room['name'] == '��� �����' || $this->room['name'] == '��� ����' || $this->room['name'] == '��� ���������' ) {
-				$vid = 0;
-				//
-				if( $this->room['name'] == '��� �����' ) {
-					$vid = 6;
-				}elseif( $this->room['name'] == '��� ����' ) {
-					$vid = 7;
-				}elseif( $this->room['name'] == '��� ���������' ) {
-					$vid = 10;
-				}
-				//
-				$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 1 ORDER BY `time` DESC LIMIT 1'));
-				if(isset($v['id']) && $v['time'] + 60 * 60 > time() ) {
-					$r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'�������� ��������������� ����� '.$this->timeOut( $v['time'] + 60 * 60 - time() ).'\');" src="https://img.new-combats.com/i/items/healvortex_'.$vid.'.png" width="40" height="25" title="������ HP (��������)"> ';	
-				}else{
-					$r .= '<a href="main.php?vhp"><img src="https://img.new-combats.com/i/items/healvortex_'.$vid.'.png" width="40" height="25" title="������ HP"></a> ';	
-				}				
-				$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 2 ORDER BY `time` DESC LIMIT 1'));
-				if(isset($v['id']) && $v['time'] + 60 * 60 > time() ) {
-					$r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'�������� ��������������� ����� '.$this->timeOut( $v['time'] + 60 * 60 - time() ).'\');" src="https://img.new-combats.com/i/items/manavortex_'.$vid.'.png" width="40" height="25" title="������ MP (��������)"> ';
-				}else{
-					$r .= '<a href="main.php?vmp""><img src="https://img.new-combats.com/i/items/manavortex_'.$vid.'.png" width="40" height="25" title="������ MP"></a> ';
-				}
-			}
-			//
-		}
-		return $r;	
-	}
-	
-	public function insertAlign( $an , $uid ) {
-		if( $an > 0 ) {
-			mysql_query('UPDATE `users_align` SET `delete` = "'.(time()+1).'" WHERE `uid` = "'.mysql_real_escape_string($uid).'" AND `align` = "'.mysql_real_escape_string(floor($an)).'"');
-			mysql_query('INSERT INTO `users_align` (`uid`,`time`,`delete`,`align`) VALUES (
-				"'.mysql_real_escape_string($uid).'","'.time().'","0","'.mysql_real_escape_string(floor($an)).'"
-			) ');
-		}
-	}
-	
-	public function deleteAlign( $an , $uid ) {
-		if( $an > 0 ) {
-			mysql_query('UPDATE `users_align` SET `delete` = "'.(time()+86400*60).'" WHERE `uid` = "'.mysql_real_escape_string($uid).'" AND `align` = "'.mysql_real_escape_string(floor($an)).'"');
-		}
-	}
-	
-	public function shopSaleM( $val, $itm ) {
-		global $c;
-		/*$proc = array(
-			0,0,0,0,0,0,0,0,
-			5,30,30,30,30,30,30,30,30,30,30,30,30,30			
-		);
-		$po = $this->lookStats($itm['data']);
-		$proc = $proc[$po['tr_lvl']];*/
-		$proc = 0;	
-		//
-		$proc = array(
-			0,	//0
-			0,	//1
-			0,	//2
-			0,	//3
-			0,	//4
-			0,	//5
-			0,	//6
-			0,	//7
-			5,30,30,30,30,30,30,30,30,30,30,30,30,30			
-		);
-		$po = $this->lookStats($itm['data']);
-		$proc = $proc[$po['tr_lvl']];
-		//
-		if( $itm['type'] >= 28 ) {
-			$proc = 50;
-		}
-		if($itm['type']==46){
-			$proc = 0;
-		}
-		if( $c['shop_all'] > 0 ) {
-			$proc = 100-$c['shop_all'];
-		}elseif( $c['shop_all_type1'] > 0 && !isset($this->info['inBerezka']) ) {
-			$proc = 100-$c['shop_all_type1'];
-		}elseif( $c['shop_all_type2'] > 0 && isset($this->info['inBerezka'])) {
-			$proc = 100-$c['shop_all_type2'];
-		}
-		$val = round(($val/100*(100-$proc)),2);
-		return $val;
-	}
-	
-	//�������� ������������� ���� ���������
- public function deleteItemID($id, $uid, $coldel) {
-   $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($id).'" AND `uid` = "'.mysql_real_escape_string($uid).'" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT '.$coldel);
-   $delitm = array();
-   while($pl = mysql_fetch_array($sp)) {
-	 if(count($delitm) < $coldel) {
-	   $delitm[] = $pl['id'];
-	 }
-   }
-   $i = 0;
-   while($i < count($delitm)) {
-	 mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$delitm[$i].'" LIMIT 1');
-	 $i++;
-   }		
- }
- 
- public function count_items($id, $uid, $coldel) {
-   $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($id).'" AND `uid` = "'.mysql_real_escape_string($uid).'" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT '.$coldel);
-   $delitm = array();
-   while($pl = mysql_fetch_array($sp)) {
-     if(count($delitm) < $coldel) {
-       $delitm[] = $pl['id'];
-     }
-   }
-   $i = 0;
-   while($i < count($delitm)) {
-     $i++;
-   }
-   return $i;
- }
-	
-	public function repobmen($id,$type)
-	{
-		//echo '�����';
-		$pl = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1;'));
-		$d = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1'));
-		$po = $this->lookStats($pl['data']);
-		//echo $po['dungeon'].' '.$po['tr_lvl'];
-		if((!isset($po['frompisher']) or $po['tr_lvl']<4) and $pl['type']!=31){
-			$e = '�� ������� �������� ������� �� ���������.';
-		}else{
-			$e = '����� �������� "'.$pl['name'].'" �� ��������� �apitalcity ������ ������.';
-			mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-			$this->rep['repcapitalcity'] += 1;
-			mysql_query('UPDATE `rep` SET `repcapitalcity` = "'.$this->rep['repcapitalcity'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');		
-		}
-		return $e;
-	}	
-	
-	public function add_buf($id,$tp,$uid = NULL,$mod = NULL) {
-		/*if($this->info['admin'] > 0) {
-			if($tp == 1) {
-				
-				$cache = ob_get_contents();
-				ob_end_clean ();
-								
-				//��������� �����
-				if($uid != '') {
-					$uid_f = floor($uid/1000);
-				}else{
-					$uid_f = '_m';
-				}
-								
-				//��������� ������������� ������ ����������
-				if(!is_dir($id.'~a/'.$uid_f.'/') ) {
-					//�������
-					mkdir($id.'~a/'.$uid_f.'/', 0700);
-				}
-				
-				//��������� ������������� ������ ����������
-				if(!is_dir($id.'~a/'.$uid_f.'/'.$uid.'/') ) {
-					//�������
-					mkdir($id.'~a/'.$uid_f.'/'.$uid.'/', 0700);
-				}
-				
-				$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-				
-				//������� ���������� ���������
-				if(file_exists($id)) {
-					$this->del_buf($id);
-				}
-				
-				//������� ����
-				$fp = @fopen ($id, "w");
-				@fwrite($fp, $cache);
-				@fclose($fp);
-				
-			}elseif($tp == 0) {
-				ob_start();
-			}
-		}*/
-	}
-	
-	public function del_buf($id,$uid = NULL,$mod = NULL) {
-		/*if($uid != NULL && $mod != NULL) {
-			//���������� ������
-			if((int)$uid > 0 && $uid != '') {
-				$uid_f = floor($uid/1000);
-			}else{
-				$uid_f = '_m_'.$uid;
-			}
-			$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-		}
-		if(file_exists($id)) {			
-			unlink($id);
-		}*/
-	}
-	
-	public function see_buf($id,$uid = NULL,$mod = NULL) {
-		/*if(file_exists($id)) {
-			if($uid != NULL && $mod != NULL) {
-				//���������� ������
-				if($uid != '') {
-					$uid_f = floor($uid/1000);
-				}else{
-					$uid_f = '_m';
-				}
-				$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-			}
-			return file_get_contents($id);
-		}else{
-			return false;
-		}*/
-	}
-	
-	public function sys_see($type) {
-			/*
-			$r = ''; $lid = $this->info['sys'];
-			$sp = mysql_query('SELECT `id`,`uid`,`time`,`type`,`text`,`data`,`time_see` FROM `a_system` WHERE `uid` = "'.$this->info['id'].'" AND `id` > "'.$this->info['sys'].'" ORDER BY `time` DESC LIMIT 20');
-			while($pl = mysql_fetch_array($sp)) {
-				$r .= 'top.tow('.$pl['id'].',"'.$pl['text'].'",'.$pl['time_see'].','.$pl['data'].');';
-				if($pl['id'] > $lid) {
-					$lid = $pl['id'];
-				}
-			}
-			if($lid > $this->info['sys']) {
-				mysql_query('UPDATE `users` SET `sys` = "'.$lid.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			}
-			return $r;
-			*/
-	}
-	
-	public static function start()
-	{
-		if (!isset(self::$flag_one))
-		{
-			$c = __CLASS__;
-			self::$flag_one = new $c();
-		}
-		return self::$flag_one;
-	}
-	
-	public function lookKeys($m,$i)
-	{
-		$e = explode('|',$m);
-		$r = array();
-		while($i<count($e))
-		{
-			$j = explode('=',$e[$i]);
-			$r[$i] = $j[0];
-			$i++;	
-		}
-		return $r;
-	}
-	
-	public function bsfinish($id, $bu, $di) {
-		if($bu == true) {
-			/* � ���� ��� ��������� ������ */
-			$i = 0;
-			while($i < count($bu[$i])) {
-			  if($bu[$i]['lose'] > 0 || $bu[$i]['nich']) {
-					mysql_query('UPDATE `users` SET `lose` = "'.$bu[$i]['lose'].'", `nick` = "'.$bu[$i]['nich'].'" WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1');
-					mysql_query('UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "'.$id['id'].'" LIMIT 1');
-					/* ������� ����� */
-					if($bu['inBot'] == 0) {
-						$pls1 = mysql_fetch_array(mysql_query('SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `finish` = 0 AND `time` = "'.$id['time_start'].'" AND `inBot` = "'.$bu[$i]['id'].'" LIMIT 1'));
-						if(isset($pls1['id'])) {
-							mysql_query('DELETE FROM `users` WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1');
-							mysql_query('DELETE FROM `stats` WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1');
-							
-							//���������� �������� �� �����
-							$spi = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "'.$bu[$i]['id'].'" LIMIT 500');
-							$ins = '';
-							while($pli = mysql_fetch_array($spi))
-							{
-								$ins .= '("'.$di['dn_id'].'","'.$pli['item_id'].'","'.time().'","'.$di['x'].'","'.$di['y'].'"),'; 
-							}
-							
-							$ins = rtrim($ins,',');
-							mysql_query('INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES '.$ins.'');
-							mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pls1['inBot'].'" LIMIT 1');	
-							mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pls1['inBot'].'" LIMIT 1');	
-							mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `id` = "'.$pls1['id'].'" LIMIT 1');
-							mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "'.$pls1['uid'].'" LIMIT 1');	
-						}
-					}
-					$id['users_finish']++;
-				}
-				$i++;
-			}
-		}
-		if($id['users']-$id['users_finish'] < 2) {
-			$win = array();
-			$sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `finish` = "0" AND `time` = "'.$id['time_start'].'" ORDER BY `money` DESC LIMIT 100');	
-			while($pl = mysql_fetch_array($sp))
-			{
-				$ur = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1'));
-				$ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$ur['inUser'].'" LIMIT 1'));
-				if(isset($ur['id']) && isset($ub['id']))
-				{
-					if($ub['lose'] > 0 || $ub['nich'] > 0) {
-						//���������� �� ��
-						
-					}else{
-						$win = $ub;
-						$winr = $ur;
-					}
-				}
-			}
-			
-			/* ��������� �� */
-			if(isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) {
-				//���� ����������
-				$bsep = 0;
-				if($winr['level'] < 6) {
-					$bsep = 2500;
-				}elseif($winr['level'] < 7) {
-					$bsep = 5000;
-				}elseif($winr['level'] < 8) {
-					$bsep = 15000;
-				}elseif($winr['level'] < 9) {
-					$bsep = 25000;
-				}else{
-					$bsep = 50000;
-				}
-				/* ������ ���� */
-				$mn = (round($id['money']/100*85));
-				mysql_query('UPDATE `users` SET `money` = `money` + "'.$mn.'" WHERE `id` = "'.$winr['id'].'" LIMIT 1');
-				mysql_query('UPDATE `stats` SET `exp` = `exp` + "'.$bsep.'" WHERE `id` = "'.$winr['id'].'" LIMIT 1');
-				/* ��� */
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','".$winr['login']."','�����������! �� �������� � ������� &quot;����� ������&quot;! �������� �����: ".$bsep.", ������: ".$mn." ��.','-1','6','0')");
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> ���������� ������ &quot;����� ������&quot;, ���������� �������: <b>".$winr['login']."</b>! �����������!','-1','5','0')");
-				$this->addDelo(1,$uid,'&quot;<font color=#C65F00>WinTournament.'.$this->info['city'].'</font>&quot; (����� ������): �������� &quot;<b>'.$mn.'</b> ��.&quot;',time(),$this->info['city'],'WinTournament.'.$this->info['city'].'',0,0);
-			}else{
-				//��� ����������				
-				//������ ������
-				
-				/* ��� */
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> ���������� ������ &quot;����� ������&quot;, ���������� �������: �����������.','-1','5','0')");
-			}
-			
-			$sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `time` = "'.$id['time_start'].'" ORDER BY `money` DESC LIMIT 100');	
-			while($pl = mysql_fetch_array($sp))
-			{
-				$ur = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1'));
-				$ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$ur['inUser'].'" LIMIT 1'));
-				if(isset($ub['id']))
-				{
-					//del
-					mysql_query('DELETE FROM `users` WHERE `id` = "'.$ub['id'].'" LIMIT 1');
-					mysql_query('DELETE FROM `stats` WHERE `id` = "'.$ub['id'].'" LIMIT 1');	
-					mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$ub['id'].'" LIMIT 500');	
-					mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$ub['id'].'" LIMIT 500');	
-					//upd
-					mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "'.$pl['uid'].'" LIMIT 1');					
-				}
-			}			
-		}
-	}
-	
-	//��� ��������� � �����
-	public function ves($u)
-	{
-		$r = array('now'=>0,'max'=>0);
-		if($u==NULL)
-		{
-			//������� ��������
-			$r['now'] = mysql_fetch_array(mysql_query('SELECT SUM(`im`.`massa`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$this->info['id'].'" AND (`iu`.`delete` = "0" OR (`iu`.`delete` = "1000" AND `iu`.`inGroup` > 0)) AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'));
-			$r['now'] = 0+$r['now'][0];
-			@$r['max'] = 40+($this->stats['os7']*10)+$this->stats['s4']+$this->stats['maxves']+$this->stats['s1']*4;
-			$r['items'] = mysql_fetch_array(mysql_query('SELECT COUNT(`im`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'));
-			$r['items'] = $r['items'][0];
-		}else{
-			
-		}
-		return $r;
-	}
-	
-	//���������� ����� \ ���
-	public function plavka($id, $type)
-	{
-		$e = '';
-		$rn = 0; $rnn = array();
-		$pl = mysql_fetch_array(mysql_query('SELECT		
-`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1;'));
-		$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1'));
-		$po = $this->lookStats($d['data']);
-		$rlvl = 4;
-		if($pl['level'] == 0) {
-			$pl['level'] = 0+$po['tr_lvl'];
-		}
-
-		if($pl['level']==7 || $pl['level']==8){
-			$rlvl = 7;
-		}elseif($pl['level']==9){
-			$rlvl = 9;
-		}elseif($pl['level']>=10){
-			$rlvl = 9;
-		}
-		//����������� ��������� �������
-		if( ( rand(0,100) == 0 ) && $this->rep['rep1'] >= 1000 ) {
-			$rlvl = 1;
-			$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` >= 5024 AND `id` < 6000');
-		}elseif( ( rand(0,100) <= 1 ) && $this->rep['rep1'] >= 10000 ) {
-			$rlvl = 1;
-			$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` >= 5024 AND `id` < 6000');
-		}else{
-			$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` < 5024');
-		}
-		
-		//$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'"');
-		while($rl = mysql_fetch_array($rs))
-		{
-			$nm = explode(' ',$rl['name']);
-			if(($nm[0] && $nm[1] || $rlvl >= 10)) {
-				$rnn[count($rnn)] = $rl['id'];
-			}
-		}
-		$rn = $rnn[rand(0,count($rnn)-1)];
-		
-		$chns = round(50 + ( ( 4 - $po['tr_lvl'] ) * 5 ) ); //���� ������
-		if( $chns > 90 ) {
-			$chns = 90;
-		}elseif( $chns < 50 ) {
-			$chns = 70;
-		}
-		
-		if($po['tr_lvl']<4 && $pl['item_id']!=1035)
-		{
-			$e = '������� ������ ���� 4-�� � ���� ������';
-		}elseif($pl['type']!=1 && $pl['type']!=3 && $pl['type']!=5 && $pl['type']!=6 && $pl['type']!=8 && $pl['type']!=9 && $pl['type']!=10 && $pl['type']!=11 && $pl['type']!=12 && $pl['type']!=14 && $pl['type']!=15 && $pl['type']!=18 && $pl['type']!=19 && $pl['type']!=20 && $pl['type']!=21 && $pl['type']!=22 && $pl['type']!=13 && $pl['item_id']!=1035)
-		{
-			$e = '���� ���, � �� ����! ���� ������� �������? �� �������� ��! ������� ��� ����� ���-�� �������!';
-		}elseif($po['tr_lvl']>=7 && $this->rep['rep1']<100)
-		{
-			$e = '��� ����������� ��������� 7-�� � ������ ������ ��������� ���� ����� ������ ������� �����';
-		}elseif($po['tr_lvl']>=9 && $this->rep['rep1']<1000)
-		{
-			$e = '��� ����������� ��������� 9-�� � ������ ������ ��������� ���� ����� ������ ������� �����';
-		}elseif($po['tr_lvl']>=10 && $this->rep['rep1']<10000)
-		{
-			$e = '��� ����������� ��������� 10-�� � ������ ������ ��������� ���� ����� ������ �������� �����';
-		}elseif($rn>0)
-		{
-			if(isset($pl['id'],$d['id']))
-			{
-				$rnn = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `type` = "31" AND `id` = "'.$rn.'" LIMIT 1'));
-				if(isset($rnn['id'])){
-					$pl['rep'] = 0;
-					if( $po['tr_lvl'] >= 4 && $po['tr_lvl'] <= 6 && $this->rep['rep1'] < 100 ) {
-						$pl['rep'] = 1; //4-6
-					}elseif($this->rep['rep1'] > 99 && $this->rep['rep1'] < 1000){
-						if( $po['tr_lvl'] >= 7 && $po['tr_lvl'] <= 8 ) { //7-8
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						} 
-					}elseif($this->rep['rep1'] > 999){
-						if( $po['tr_lvl'] >= 9 && $po['tr_lvl'] <= 10 ) { //9-10
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						} 
-					}else{
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						} 
-					}
-					//����������� ��������� ����
-					if( $chns <= rand(0,100) && $pl['item_id'] != 1035) {
-						$e = '������� "'.$pl['name'].'" ��� ��������� ��������...';
-						$ld = $this->addDelo(1, $this->info['id'],'&quot;<font color=#C65F00>AddItems.'.$this->info['city'].'</font>&quot;: ������� [<b>'.$pl['name'].'</b>] ��� ���������� ��������.',time(),$this->info['city'],'AddItems.'.$this->info['city'].'',0,0); 
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					}elseif(mysql_query('UPDATE `rep` SET `rep1` = `rep1` + "'.$pl['rep'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1')){
-						
-						$e = '������ ��������� ������� "'.$pl['name'].'". '.( $pl['item_id'] != 1035 ? '�������� ���� "'.$rnn['name'].'".' : '').'. �������� ���������: +'.$pl['rep'].' ��.';
-						if($pl['item_id'] != 1035) {
-							$irunew = $this->addItem($rnn['id'],$this->info['id'], null, null, null, null, $pl['name']);
-							/*if( $rlvl == 1 ) {
-								$irunew = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "'.$irunew.'" LIMIT 1'));
-								if(isset($irunew['id'])) {
-									$irunew['data'] .= '|sudba='.$u->info['login'].'';
-								}
-								mysql_query('UPDATE `items_users` SET `data` = "'.$irunew['data'].'" WHERE `id` = "'.$irunew['id'].'" LIMIT 1');
-								unset($irunew);
-							}*/
-						}
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						$this->rep['rep1'] += $pl['rep'];
-						mysql_query('UPDATE `rep` SET `rep1` = "'.$this->rep['rep1'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');						
-					}else{
-						$e = '�� ������� ���������� �������, ����� ���������� ...';
-					}
-				}else{
-					$e = '�� ������� ���������� ������� ...';
-				}
-			}else{
-				$e = '������� �� ������, ���� �� �������� '.$pl['item_id'].'...';
-			}
-		}else{
-			$e = '�� ������� �����������, ������� ��� ���� �������� ...';
-		}
-		return $e;
-	}
-	
-	//������� ���� ������� ����� ���������������
-	public function info_remont()
-	{
-		$r = '';
-		$sp = mysql_query('SELECT 
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		 FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.((int)$this->info['id']).'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` > "0" AND `iu`.`inOdet` < "18" LIMIT 18');
-		while($pl = mysql_fetch_array($sp))
-		{
-			if($pl['iznosNOW']>ceil($pl['iznosMAX']*0.80))
-			{
-				$r .= '<b>'.$pl['name'].'</b> [<font color="brown">'.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).'</font>] ��������� ������<br>';
-			}
-		}
-		$r = '<div align="left"><small>'.$r.'</small></div>';
-		return $r;
-	}
-	
-	//������ ����� �� ������
-	public function weaponAtc($item,$st,$x)
-	{
-		$tp = 0;
-		if(isset($item['id']))
-		{
-			$itm = $this->lookStats($item['data']);				
-			//�������� ������ �����
-			if(!isset($st['minAtack'])) {		$st['minAtack'] = 0;		}
-			if(!isset($st['maxAtack'])) {		$st['maxAtack'] = 0;		}
-			if(!isset($st['yron_min'])) {		$st['yron_min'] = 0;		}
-			if(!isset($st['yron_max'])) {		$st['yron_max'] = 0;		}
-			if(!isset($itm['yron_min'])) {		$itm['yron_min'] = 0;		}
-			if(!isset($itm['yron_max'])) {		$itm['yron_max'] = 0;		}
-			if(!isset($itm['sv_yron_min'])) {	$itm['sv_yron_min'] = 0;	}
-			if(!isset($itm['sv_yron_max'])) {	$itm['sv_yron_max'] = 0;	}
-			
-			$min = $itm['sv_yron_min']+$st['minAtack']+$itm['yron_min']+$st['yron_min'];
-			$max = $itm['sv_yron_max']+$st['maxAtack']+$itm['yron_max']+$st['yron_max'];
-			
-			//if($x!=0)
-			//{
-				//��� �����: 0 - ��� �����, 1 - �������, 2 - �������, 3 - ��������, 4 - �������, 5 - �����, 6 - ������, 7 - ����, 8 - �����, 9 - ����, 10 - ����, 11 - �����
-				if($item['type'] == 18)
-				{
-					//�������
-					$sss = ceil((($st['s1']*0.45+$st['s2']*0.55)));
-				}elseif($item['type'] == 19)
-				{
-					//�������
-					$sss = ceil(($st['s1']*0.60+$st['s2']*0.25+$st['s3']*0.25));
-				}elseif($item['type'] == 20)
-				{
-					//��������
-					$sss = ceil($st['s1']*0.95);
-				}elseif($item['type'] == 21)
-				{
-					//�������
-					$sss = ceil(($st['s1']*0.45+$st['s3']*0.45));
-				}else{
-					//��� ����������� �����
-					$sss = ceil($st['s1']*0.5);
-				}
-				
-				
-			//������� ����
-				//$p['B'][0] = 5;
-				//$p['B'][1] = 9;
-				
-				$p['B'][0] = ceil($st['s1']*1.4);
-				$p['B'][1] = ceil(0.4+$p['B'][0]/0.9);
-				
-				$p['B'][0] = 2 + $st['level'] + $st['s1'] - round($st['s1']/5);
-				$p['B'][1] = $p['B'][0] + 3;
-				
-				$p['B']['rnd'] = rand($p['B'][0],$p['B'][1]);
-				//���������� ����������� ����
-				$p['W'][0] = $min;
-				$p['W'][1] = $max;				
-				$p['W']['rnd'] = rand($p['W'][0],$p['W'][1]);
-				// ����. ������
-				$p['T'] = 1;
-				//��������
-				$bn = 0;
-				if($item['type'] == 21) {
-					// ���
-					$p['M'] = $st['pa4'];
-					$bn = $st['a4'];
-					//��� $p['M'] = $st['pa'.$x];
-				}elseif($item['type'] == 20) {
-					// ������
-					$p['M'] = $st['pa3'];
-					$bn = $st['a3'];
-				}elseif($item['type'] == 19) {
-					// �����
-					$p['M'] = $st['pa2'];
-					$bn = $st['a2'];
-				}elseif($item['type'] == 18) {
-					// ���
-					$p['M'] = $st['pa1'];
-					$bn = $st['pa1'];
-				}elseif($item['type'] == 22) {
-					// �����
-					$p['M'] = $st['pa'];
-					$bn = $st['a5'];					
-				}
-				//���������
-				//if( $x < 5 ) {
-				//$p['M'] = $st['pa'.$x];
-				//}else{
-				//	$p['M'] = $st['pm'.($x-4)];
-				//}
-				$min  = (($p['B'][0]+$sss+$p['W'][0])*$p['T']*(1+0.005*$bn))*(1+$p['M']/100);
-				$max  = (($p['B'][1]+$sss+$p['W'][1])*$p['T']*(1+0.005*$bn))*(1+$p['M']/100);	
-				//
-				$kmin  = ceil( ( 2 * ( 1 + $st['m3']/100 ) ) * $min);
-				$kmax  = ceil( ( 2 * ( 1 + $st['m3']/100 ) ) * $max);	
-				/*
-				$r['Kmin'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['min']);
-				$r['Kmax'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['max']);
-				*/
-				//
-				//$min = $min*0.8;
-				//$max = $max*0.8;		
-			//}
-			$tp = array(0=>ceil($min),1=>ceil($max),2=>ceil($kmin),3=>ceil($kmax));
-		}
-		return $tp;
-	}
-	
-		public function yronLvl($lvl1,$lvl2) {
-			$r = array(
-				1  => array(0,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				2  => array(0,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				3  => array(0,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				4  => array(0,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				5  => array(0,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				6  => array(0,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200),
-				7  => array(0,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200),
-				8  => array(0,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200),
-				9  => array(0,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200),
-				10 => array(0,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200),
-				11 => array(0,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200),
-				12 => array(0,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600),
-				13 => array(0,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000),
-				14 => array(0,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400),
-				15 => array(0,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800),
-				16 => array(0,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200),
-				17 => array(0,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600),
-				18 => array(0,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000),
-				19 => array(0,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400),
-				20 => array(0,7800,7600,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800),
-				21 => array(0,8200,8000,7800,7600,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200)
-			);
-			$r = floor($r[$lvl1][$lvl2]/100);
-			$r = 0;
-			return $r;
-		}
-		
-	//������ ������
-		public function zago($v) {
-			/*if($v > 1000) {
-				$v = 1000;
-			}
-			$r = (1-( pow(0.5, ($v/250) ) ))*100;		
-			return $r;*/
-			if($v > 1700) {
-				$v = 1700;
-			}
-			$r = round( (1-( pow(0.5, ($v/399.51) ) ))*100 , 2 );
-			return $r;
-		}
-	//������ ������ (�����)
-		public function zmgo($v) {
-			if($v > 1000) {
-				$v = 1000;
-			}
-			$r = (1-( pow(0.5, ($v/250) ) ))*100;		
-			return $r;
-		}
-	
-	public function inform($v)
-
-	{
-		//$this->stats['items'][13] , $this->stats['items'][14]
-		$r = '';
-		if($v=='yrontest' || $v=='yrontest-krit')
-		{
-			$y = array();
-			/* ������ ������ ��� ����� */
-			$w1 = 0;
-			$w2 = 0;
-			$i = 0;
-			while($i<count($this->stats['items']))
-			{
-				if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w1 = $this->stats['items'][$i];
-				}elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w2 = $this->stats['items'][$i];
-				}
-				$i++;
-			}
-			if(isset($w1['id']) && $w1['inOdet']!=14)
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w1['data']);
-				while($i<=4)
-				{
-					if(isset($d['tya'.$i]) && $t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w1,$this->stats,$tp);
-				if($v=='yrontest-krit') {
-					$y[0] = $y[2];
-					$y[1] = $y[3];
-				}
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= '<span title="'.$w1['name'].'">'.$y[0].'-'.$y[1].'</span>';
-			}else{
-				//���� �������
-				$y[0] = ceil( 2 + $this->info['level'] + $this->stats ['s1'] - round($this->stats['s1'] / 5) )+$this->stats['minAtack']+$this->stats['yron_min'];
-				$y[1] = ceil($y[0] + 3)+$this->stats['maxAtack']+$this->stats['yron_max'];
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= $y[0].'-'.$y[1];	
-			}
-			/* ������ ������ */
-			if(isset($w2['id']))
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w2['data']);
-				while($i<=4)
-				{
-					if($t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w2,$this->stats,$tp);
-				if($v=='yrontest-krit') {
-					$y[0] = $y[2];
-					$y[1] = $y[3];
-				}
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= ' / <span title="'.$w2['name'].'">'.$y[0].'-'.$y[1].'</span>';	
-			}		
-			/* --- */
-		}elseif($v=='yron')
-		{
-			$y = array();
-			/* ������ ������ ��� ����� */
-			$w1 = 0;
-			$w2 = 0;
-			$i = 0;
-			while($i<count($this->stats['items']))
-			{
-				if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w1 = $this->stats['items'][$i];
-				}elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w2 = $this->stats['items'][$i];
-				}
-				$i++;
-			}
-			if(isset($w1['id']) && $w1['inOdet']!=14)
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w1['data']);
-				while($i<=4)
-				{
-					if(isset($d['tya'.$i]) && $t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w1,$this->stats,$tp);
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= '<span title="'.$w1['name'].'">'.$y[0].'-'.$y[1].'</span>';
-			}else{
-				//���� �������
-				$y[0] = ceil($this->stats['s1']*1.4)+$this->stats['minAtack']+$this->stats['yron_min'];
-				$y[1] = ceil(0.4+$y[0]/0.9)+$this->stats['maxAtack']+$this->stats['yron_max'];
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= $y[0].'-'.$y[1];	
-			}
-			/* ������ ������ */
-			if(isset($w2['id']))
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w2['data']);
-				while($i<=4)
-				{
-					if($t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w2,$this->stats,$tp);
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= ' / <span title="'.$w2['name'].'">'.$y[0].'-'.$y[1].'</span>';	
-			}
-		}else{
-			//������������
-				$y = array();
-				/* ������ ������ ��� ����� */
-				$w1 = 0;
-				$w2 = 0;
-				$i = 0;
-				$ry = 0;
-				while($i<count($this->stats['items']))
-				{
-					if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-					{
-						$w1 = $this->stats['items'][$i];
-					}elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-					{
-						$w2 = $this->stats['items'][$i];
-					}
-					$i++;
-				}
-				if(isset($w1['id']) && $w1['inOdet']!=14)
-				{
-					$tp = 0;
-					$t = 0;
-					$i = 1;
-					$d = $this->lookStats($w1['data']);
-					$y = 0;
-					if(isset($d['sv_'.$v])) {
-						$y += $d['sv_'.$v];
-					}
-					if(isset($this->stats[$v])) {
-						$y += $this->stats[$v];
-					}
-					$ry = $y;
-					$r .= '<span title="'.$w1['name'].'">'.$y.'</span>';
-				}else{
-					//�������
-					$r .= $this->stats[$v];	
-					$ry = $this->stats[$v];
-				}
-				/* ������ ������ */
-				if(isset($w2['id']))
-				{
-					$tp = 0;
-					$t = 0;
-					$i = 1;
-					$d = $this->lookStats($w2['data']);
-					$y = @$this->stats[$v]+@$d['sv_'.$v];
-					if($y!=$ry)
-					{
-						$r .= ' / <span title="'.$w2['name'].'">'.$y.'</span>';	
-					}else{
-						$r = str_replace('title="'.$w1['name'].'"','',$r);
-					}
-				}
-			//������������
-		}
-		return $r;
-	}
-	
-	public function timeOut($ttm)
-	{
-		 $out = '';
-		$time_still = $ttm;
-		$tmp = floor($time_still/2592000);
-		$id=0;
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." ���. ";}
-			$time_still = $time_still-$tmp*2592000;
-		}
-		$tmp = floor($time_still/86400);
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." ��. ";}
-			$time_still = $time_still-$tmp*86400;
-		}
-		$tmp = floor($time_still/3600);
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." �. ";}
-			$time_still = $time_still-$tmp*3600;
-		}
-		$tmp = floor($time_still/60);
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." ���. ";}
-		}
-		if($out=='')
-		{
-			if($time_still<0)
-			{
-				$time_still = 0;
-			}
-			$out = $time_still.' ���.';
-		}
-		return $out;
-	}
-	
-	public function rep_zv($id,$e)
-	{
-		if($id==1)
-		{
-			//���� ������
-			if($e>9999)
-			{
-				$r = '����������� �������� �����, '.$e.' / ??';
-			}elseif($e>999)
-			{
-				$r = '����������� ������� �����, ' .$e.' / 9999';
-			}elseif($e>99)
-			{
-				$r = '����������� ������� �����, '.$e.' / 999';
-			}else{
-				$r = $e.' / 99';
-			}
-		}elseif($id==2)
-		{
-			//Capital city
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==3)
-		{
-			//Angels city
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==4)
-		{
-			//Demons city
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==5)
-		{
-			//������ �����
-			if($e>99)
-			{
-				$r = '����������� ������� ����� '.$e.' / 999';
-			}else{
-				$r = $e.' / 99';
-			}
-		}elseif($id==6)
-		{
-			//Sand
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==7)
-		{
-			//Sun
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==8)
-		{
-			//Moon
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-	  }elseif($id==9)
-		{
-			//Dreams city
-			if($e>9999)
-			{
-				$r = '����������� �������� �����,  ['.$e.']';
-			}elseif($e>4999)
-			{
-				$r = '����������� ������� �����,'  .$e.' / 9999';
-			}elseif($e>999)
-			{
-				$r = '����������� ������� �����,  '.$e.' / 4999';
-			}else{
-				$r = $e.' / 999';
-			}
-		}elseif($id==10) {
-			//���� �������
-		   if($e>9999)
-			{
-				$r = '����������� ������� �����,['.$e.']';
-			}elseif($e>999)
-			{
-				$r = '����������� ������� �����,  '.$e.' / 4999';
-			}else{
-				$r = $e.' / 999';
-			}
-		}elseif($id==11)
-		{
-			//����� �����
-			if($e>9999)
-			{
-				$r = '������� ������ �����,  ['.$e.']';
-			}elseif($e>4999)
-			{
-				$r = '������� ������ �����,'  .$e.' / 9999';
-			}elseif($e>999)
-			{
-				$r = '������ ������ �����,  '.$e.' / 4999';
-			}else{
-				$r = $e.' / 999';
-			}
-		}
-		
-		return $r;
-	}
-	
-	public function getInfoById($id){
-			$ch = mysql_fetch_array(mysql_query("SELECT `users`.*,`stats`.* FROM `users` INNER JOIN `stats` ON (`stats`.`id`=`users`.`id`) WHERE `users`.`id`='".$id."' OR
-			`users`.`login`= '".mysql_real_escape_string($id)."'"));
-
-
-			return $ch;
-		}
-	
-	public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) {
-		$rt = -1;
-		$i = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp` FROM `items_main` AS `im` WHERE `im`.`id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
-		if(isset($i['id']))
-		{
-			$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));		
-			//����� ����
-			$data = $d['data'];	
-			if($i['ts']>0)
-			{
-				if( $nosudba == NULL ) {
-					$ui = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "'.mysql_real_escape_string($uid).'" LIMIT 1'));
-					$data .= '|sudba='.$ui['login'];
-				}
-			}
-			if($md!=NULL)
-			{
-				  $data .= $md; 
-				  $data = $this->lookStats($data); // ���� � ������� ������� ��� ���������� ��������� SROK?
-				  $data = $this->impStats($data);
-			}
-
-	
-			if($dn!=NULL)
-			{
-				//������� � ����������� �� ����������
-				if($dn['dn_delete']>0)
-				{
-					$i['dn_delete'] = 1;
-				}
-			}
-			if($mxiznos > 0) {
-				$i['iznosMAXi'] = $mxiznos;
-			}
-			if($this->info['dnow'] > 0){
-				$room = $this->room['city'];
-			}else {
-				$room = $this->info['city'];
-			}
-			$ins = mysql_query('INSERT INTO `items_users` (`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`,`dn_delete`) VALUES (
-											"'.$i['overTypei'].'",
-											"'.$i['id'].'",
-											"'.$uid.'",
-											"'.$data.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geni'].'",
-											"'.$i['magic_inci'].'",
-											"'.$room.'",
-											"'.time().'",
-											"'.time().'",
-											"'.$i['dn_delete'].'")');
-			if($ins)
-			{
-				$rt = mysql_insert_id();
-				mysql_query('UPDATE `items_users` SET `dn_delete` = "1" WHERE `id` = "'.$rt.'" AND `data` LIKE "%dn_delete=%" LIMIT 1');
-				if( $uid == $this->info['id'] ) {
-					$this->stack( $rt );
-				}
-				$ads = '';
-				if($plavka != null) {
-				  $ads = '���������� ������� : ['.$plavka.']';
-				}
-				//���������� � ������ ���� ��� ������� �������
-				$ld = $this->addDelo(1,$uid,'&quot;<font color=#C65F00>AddItems.'.$this->info['city'].'</font>&quot;: ������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x1) [#'.$i['iid'].']. '.$ads.'',time(),$this->info['city'],'AddItems.'.$this->info['city'].'',0,0);
-			}else{
-				$rt = 0;	
-			}			
-		}
-		return $rt;
-	}
-	
-	public function getNum($v)
-	{
-		$plid = $v;
-		$pi = iconv_strlen($plid);
-		if($pi<5)
-		{
-			$i = 0;
-			while($i<=5-$pi)
-			{
-				$plid = '0'.$plid;
-				$i++;
-			}
-		}
-		return $plid;
-	}
-	
-	public function microLogin2($bus) {
-		$bus['login_BIG']  = '<b>';
-		if( $bus['align'] > 0 ) {
-			$bus['login_BIG'] .= '<img src=https://img.new-combats.com/i/align/align'.$bus['align'].'.gif width=12 height=15 >';
-		}
-		if( $bus['align2'] > 0 ) {
-			$bus['login_BIG'] .= '<img src=https://img.new-combats.com/i/align/align'.$bus['align2'].'.gif width=12 height=15 >';
-		}
-		if( $bus['clan'] > 0 ) {
-			$bus['login_BIG'] .= '<img src=https://img.new-combats.com/i/clan/'.$bus['clan'].'.gif width=24 height=15 >';
-		}
-		$bus['login_BIG'] .= ''.$bus['login'].'</b>['.$bus['level'].']<a target=_blank href=https://new-combats.com/info/'.$bus['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-		return $bus['login_BIG'];
-	}
-	
-	public function microLogin($id,$t,$nnz = 1)
-	{
-		global $c;
-		if($t==1)
-		{
-			$inf = mysql_fetch_array(mysql_query('SELECT 
-			`u`.`id`,
-			`u`.`align`,`u`.`align2`,
-			`u`.`login`,
-			`u`.`clan`,
-			`u`.`level`,
-			`u`.`city`,
-			`u`.`online`,
-			`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,
-			`u`.`cityreg`,
-			`u`.`palpro`,
-			`u`.`invis`,
-			`st`.`hpNow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($id).'" OR `u`.`login` = "'.mysql_real_escape_string((int)$id).'" LIMIT 1'));
-		}else{
-			$inf = $id;
-			$id = $inf['id'];
-		}
-		$r = '';
-		if(isset($inf['id']) && ( ($inf['invis'] < time() && $inf['invis'] != 1) || ($this->info['id'] == $inf['id'] && $nnz == 1) ))
-		{
-			if($inf['align']>0)
-			{
-				$r .= '<img width="12" height="15" src="https://img.new-combats.com/i/align/align'.$inf['align'].'.gif" />';
-			}
-			if($inf['align2']>0)
-			{
-				$r .= '<img width="12" height="15" src="https://img.new-combats.com/i/align/align'.$inf['align2'].'.gif" />';
-			}
-			if($inf['clan']>0)
-			{
-				$cln = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id` = "'.$inf['clan'].'" LIMIT 1'));
-				if(isset($cln['id']))
-				{
-					$r .= '<img width="24" height="15" src="https://img.new-combats.com/i/clan/'.$cln['name_mini'].'.gif" />';
-				}
-			}
-			if($inf['cityreg'] == '') {
-				$inf['cityreg'] = 'capitalcity';
-			}
-			$r .= ' <b>'.$inf['login'].'</b> ['.$inf['level'].']<a target="_blank" href="https://new-combats.com/info/'.$inf['id'].'"><img src="https://img.new-combats.com/i/inf_'.$inf['cityreg'].'.gif" /></a>';	
-		}else{
-			$r = '<b><i>���������</i></b> [??]<a target="_blank" href="https://new-combats.com/info/0"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" /></a>';	
-		}
-		return $r;
-	}
-	
-	public function testHome()
-	{
-		/*----�������(�����������)----*/
-		$timeforwait = 3600;
-		if(isset($st['os3']) && $st['os3']>0) {
-			$timeforwait = 3600-(($st['os6']*5)*60);
-		}
-		/*----�������(�����������)----*/
-		$hgo = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` >= '.(time()-$timeforwait).' AND `vars` = "go_homeworld" LIMIT 1',1);
-		if($this->info['level']==0 || $this->info['active']!='' || $this->info['inTurnir'] > 0 || $this->info['inTurnirnew'] > 0 || $this->info['zv'] > 0 || $this->info['dnow'] > 0) {
-			$hgo['id'] = true;
-		}
-		if(isset($this->info['noreal']) || $this->info['dnow'] > 0) {
-			$hgo['id'] = true;
-		}
-		if(!isset($hgo['id'])) {
-			$ku = mysql_fetch_array(mysql_query('SELECT `id` FROM `katok_zv` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-			if(isset($ku['id'])) {
-				$hgo['id'] = true;
-			}
-		}
-		return $hgo;
-	}
-	
-	public function telegram($uid,$text,$type = 1,$from = NULL)
-	{
-		if(!(int)$uid)
-		{
-			$uid = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			$uid = $uid['id'];
-		}
-		$r = 0;
-		if($uid>0)
-		{
-			if($from == NULL)
-			{
-				$from = $this->info['login'];
-			}
-			$ins = mysql_query('INSERT INTO `telegram` (`uid`,`from`,`time`,`fromType`,`text`) VALUES ("'.mysql_real_escape_string($uid).'","'.mysql_real_escape_string($from).'","'.time().'","'.mysql_real_escape_string($type).'","'.mysql_real_escape_string(htmlspecialchars($text,NULL,'cp1251')).'")');
-			if($ins)
-			{
-				$r = 1;
-			}else{
-				$r = -2;	
-			}
-		}else{
-			$r = -1;	
-		}
-		return $r;
-	}
-	
-	public function functionThisData() {
-		//���������� ������ �������
-		
-	}
-	
-	private function __construct()
-	{
-		global $c,$code,$magic;
-		
-		$this->info = mysql_fetch_array(mysql_query('SELECT 
-		`u`.`nextBonus`,`u`.`mat`,`u`.`skype`,`u`.`skype_hide`,`u`.`stopexp`,`u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`send`,`u`.`activ`,`u`.`b1`,`u`.`nadmin`,`u`.`fnq`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`,`u`.`ang_g`,
-		`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`,
-		`r`.`noatack` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) LEFT JOIN `room` AS `r` ON (`u`.`room` = `r`.`id`) WHERE `u`.`login`="'.mysql_real_escape_string($_COOKIE['login']).'" AND `u`.`pass`="'.mysql_real_escape_string($_COOKIE['pass']).'" LIMIT 1'));
-
-		
-		if( $c['securetime'] > 0 ) {
-			if(!defined('IP')) {
-				$dip = '';
-				if (!empty($_SERVER['HTTP_CLIENT_IP']))
-					$dip = $_SERVER['HTTP_CLIENT_IP'];
-				else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
-					$dip = $_SERVER['HTTP_X_FORWARDED_FOR'];
-				$dip = $_SERVER['REMOTE_ADDR'];
-				define('IP',$dip);
-			}
-			
-			if( isset($this->info['id']) && ($this->info['ip'] != IP  || $this->info['banned'] > 0) ) {
-				if( $_SERVER['REQUEST_URI'] != '/' ) {
-					unset($this->info, $_COOKIE['login'], $_COOKIE['pass']);
-					die('<script>top.location.href="https://new-combats.com/";</script>');
-				}
-			}
-		}
-		
-		if(isset($this->info['id'])) {
-			if( $this->info['exp'] > 300000 && $this->info['twink'] > 0 ) {
-				$this->info['exp'] = 300000;
-				mysql_query('UPDATE `users` SET `exp` = '.$this->info['exp'].' WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			}
-		}
-				
-		if(isset($this->info['id']) && $this->info['inUser'])
-		{
-			$md = array($this->info['molch1'],$this->info['molch2'],$this->info['molch3'],$this->info['admin'],$this->info['nadmin'],$this->info['banned'],$this->info['activ'],$this->info['align'],$this->info['id'],$this->info['level']);
-			$this->info = mysql_fetch_array(mysql_query('SELECT 
-			`u`.`nextBonus`,`u`.`mat`,`u`.`skype`,`u`.`skype_hide`,`u`.`stopexp`,`u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`activ`,`u`.`nadmin`,`u`.`b1`,`u`.`fnq`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`,
-			`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-			 FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($this->info['inUser']).'" LIMIT 1'));
-			if($this->info['molch1'] < $md[0]) {
-				$this->info['molch1'] = $md[0];
-			}
-			if($this->info['molch2'] < $md[1]) {
-				$this->info['molch2'] = $md[1];
-			}
-			if($this->info['molch3'] < $md[2]) {
-				$this->info['molch3'] = $md[2];
-			}
-			if($this->info['admin'] < $md[3]) {
-				$this->info['admin'] = $md[3];
-			}
-			if($this->info['nadmin'] < $md[4]) {
-				$this->info['nadmin'] = $md[4];
-			}
-			if($this->info['banned'] < $md[5]) {
-				$this->info['banned'] = $md[5];
-			}
-			$this->info['activ'] = $md[6];
-			$this->info['noreal'] = 1;
-			$this->info['align_real'] = $md[7];
-			$this->info['__id'] = $md[8];
-			$this->info['__level'] = $md[9];
-		}
-		if (isset ($_COOKIE['btl']))
-		{
-		if($this->info['battle'] != $_COOKIE['btl']) {
-			setcookie('btl',$this->info['battle'],time()+86400);
-		}
-		}
-		else
-		{setcookie('btl',$this->info['battle'],time()+86400);}
-				
-		//��� �������
-		/*if($this->info['banned'] == 7007001) {
-			$spm_url = mysql_fetch_array(mysql_query('SELECT * FROM `_spamer` WHERE `host` = "'.$this->info['host'].'" LIMIT 1'));
-			if(isset($spm_url['id'])) {
-				die('<meta http-equiv="refresh" content="0; URL=/banned.php?id='.$spm_url['id'].'">');
-			}else{
-				die('<meta http-equiv="refresh" content="0; URL=/banned.php?kill=1">');
-			}
-		}*/
-		
-		if(!isset($this->info['id']))
-		{
-			$this->info = mysql_fetch_array(mysql_query('SELECT 
-			`u`.`nadmin`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`
-			FROM `users` AS `u` WHERE `u`.`login`="'.mysql_real_escape_string($_COOKIE['login']).'" AND `u`.`pass`="'.mysql_real_escape_string($_COOKIE['pass']).'" LIMIT 1'));
-			if($this->info['dateEnter']!=$_SERVER['HTTP_USER_AGENT'])
-			{
-				unset($this->info);
-			}
-			$this->btl_txt = $this->info['battle_text'];
-			if(!isset($this->info['id']))
-			{
-				unset($this->info);
-				setcookie('login','',time()-60*60*24,'',$c['host']);
-				setcookie('pass','',time()-60*60*24,'',$c['host']);
-			}else{
-				echo 'stats is lost.';
-			}
-		}
-			
-		if(isset($this->info['id'])) {
-			if($this->info['invis'] == 1 || $this->info['invis'] > time()) {
-				$this->info['cast_login'] = '<i>���������</i>';
-			}else{
-				$this->info['cast_login'] = $this->info['login'];
-			}
-		}
-			
-		if(isset($this->info['id']) && $this->info['battle'] == 0)
-		{										
-			$sb = mysql_fetch_array(mysql_query('SELECT SUM(`money2`) FROM `bank` WHERE `uid` = "'.$this->info['id'].'" LIMIT 100'));
-			$sb = $sb[0];
-			
-			if($sb-1 > $this->info['catch']-$this->info['frg']) {
-				if($this->info['frg'] == -1) {
-					$sm = $this->testAction('`uid` = "'.$this->info['id'].'" AND `vars` = "frg" LIMIT 1',1);
-				}
-				if(!isset($sm['id']) && $this->info['frg']==-1) {
-					mysql_query('UPDATE `users` SET `catch` = "'.round($sb).'",`frg` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					$this->addAction(time(),'frg','[ '.$this->info['login'].' ] '.date('d.m.Y H:i:s').' [true] , balance: '.$sb.' / '.$this->info['catch'].' / '.$this->info['frg'].' ');
-				}else{
-					mysql_query('UPDATE `users` SET `catch` = "'.round($sb+$this->info['frg']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					if($sb-10 > $this->info['catch']-$this->info['frg']) {
-						$this->addAction(time(),'frgfalse','[ '.$this->info['login'].' ] '.date('d.m.Y H:i:s').' [false] , ['.($sb-($this->info['catch']-$this->info['frg'])).'] , balance: '.$sb.' | '.$this->info['catch'].' | '.$this->info['frg'].' ');
-					}
-				}
-			}
-			
-			if($this->info['login2']!='' && $this->info['battle']==0 && $this->info['zv']==0) {
-				mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->info['login2'] = '';	
-			}
-			
-			$this->rep = mysql_fetch_array(mysql_query('SELECT 
-			`add_slot`,`nu_sandcity`,`n_sandcity`,
-			`dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`,
-			`repdevilscity`,`repmooncity`,`repsuncity`,`repsandcity`,`repemeraldscity`,`repdreamscity`,`repizlom`,
-			`n_capitalcity`,`n_demonscity`,`n_suncity`,`nu_demonscity`,`nu_angelscity`,`nu_abandonedplain`,`nu_emeraldscity`,
-			`nu_capitalcity`,`nu_suncity`,`nu_devilscity`,`nu_dreamscity`,`add_stats`,`add_money`,`add_skills`,`add_skills2`,
-			`rep3`,`rep3_buy`,`repdragonscity`,`n_dragonscity`,`nu_dragonscity`,
-			(`repcapitalcity`+`repdemonscity`+`repangelscity`+`repsuncity`+`repdreamscity`+`repabandonedplain`+`repsandcity`+`repemeraldscity`) as allrep, 
-			(`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`+`nu_emeraldscity`) as allnurep
-			FROM `rep` WHERE `id` = "'.$this->info['id'].'" LIMIT 1'));
-			 
-			
-			if(!isset($this->rep['id'])){
-				mysql_query('INSERT INTO `rep` (`id`) VALUES ('.$this->info['id'].')');
-			}
-			if($this->info['login2'] != '' && $this->info['zv'] == 0 && $this->info['battle'] == 0) {
-				$this->info['login2'] = '';
-				mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			}
-			/* ��������� �����������  */
-			/*$i = $this->testAction('`time` >= "'.(time()-7129).'" AND `vars` = "reclama1" LIMIT 1',1);
-			if(!isset($i['id']))
-			{				
-				$this->addAction(time(),'reclama1','');				
-				//��������� � ���
-				$t6 = array('','');
-				if(date('N') == 1) {
-					//�����������
-					$t6[0] = '� �����';
-				}elseif(date('N') == 2) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 3) {
-					//�����
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �������';
-					}
-				}elseif(date('N') == 4) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 5) {
-					//�������
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �����������';
-					}
-				}elseif(date('N') == 6) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 7) {
-					//�����������
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �����';
-					}
-				}
-				$r = '<font color=red><b>�����������!</b></font> ������ �� ������ ������ ��������� '.$t6[0].' (� 20:00 �� ����������� �������). ����� ��������� ���������� � ��������� <img src=https://img.new-combats.com/i/clan/PokerStars.com.gif width=24 height=15><a href=https://new-combats.com/info/1457199 target=_blank>Alexandr</a> ��� �� ����� ������� <a href=https://events.new-combats.com/?page_id=3&st=323 target=_blank>Events.new-combats.com</a>';				
-				//���������� ��������� � ���
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
-			}
-			*/
-			/*
-			//���� ������� ������������ �� �����
-			mysql_query('LOCK TABLES users,stats,chat,room,test_bot,battle WRITE');
-			$dasc = array('ASC','DESC');
-			$sp = mysql_query('SELECT `u`.`id`,`u`.`bot_room`,`s`.`atack`,`u`.`type_pers`,`s`.`bbexp`,`s`.`timeGo`,`s`.`timeGoL`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`room`,`u`.`level`,`u`.`battle`,`s`.`hpNow`,`s`.`mpNow`,`s`.`team`,`u`.`city` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`type_pers` > 0 AND `s`.`timeGo` < '.time().' AND `s`.`timeGoL` < '.time().' ORDER BY `s`.`timeGoL` '.$dasc[rand(0,1)].' LIMIT 11');
-			while($pl = mysql_fetch_array($sp)) {
-				if($pl['type_pers']>0 && $pl['battle'] == 0) {
-					//��� ������������
-					if($pl['timeGo']<time()) {
-						$rm = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `id` = "'.$pl['room'].'" LIMIT 1'));
-						$rmgo = explode(',',$rm['roomGo']);
-						$rmgo = $rmgo[rand(0,count($rmgo)-1)];
-						$rmgo = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `id` = "'.$rmgo.'" AND `botgo` > 0 AND `close` = 0 AND `destroy` = 0 LIMIT 1'));
-						if(isset($rmgo['id'])) {
-							$pl['room'] = $rmgo['id'];
-							mysql_query('UPDATE `users` SET `room` = "'.$rmgo['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							mysql_query('UPDATE `stats` SET `timeGo` = "'.(time()+rand(60,240)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-					}
-				}
-				if($pl['type_pers']>1 && $pl['battle'] == 0 && $pl['timeGoL']<time()) {
-					//��� �������
-					$ru = array();
-					$rs = array();
-					$spu = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-10).'" AND `u`.`banned` = "0" LIMIT 5');
-					while($plu = mysql_fetch_array($spu)) {
-						if($plu['battle'] == 0) {
-							$ru[count($ru)] = $plu['id'];
-							$rs[$plu['id']] = $plu;
-						}
-					}
-					$ru = $ru[rand(0,count($ru)-1)];
-					if($ru > 0 && rand(0,10000) < 2500) {
-						//�������� �� �����
-						if($pl['timeGoL'] < time()) {
-							//��������
-							$atc = $magic->atackUser($pl['id'],$ru,$rs[$ru]['team'],$rs[$ru]['battle'],$pl['bbexp']);
-							if($atc == 1) {
-								$rs[$ru] = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-60).'" AND `u`.`banned` = "0" AND `u`.`id` = "'.$rs[$ru]['id'].'" LIMIT 1'));
-								$pl['battle'] = $rs[$ru]['battle'];
-								if($rs[$ru]['team'] == 1) {
-									$pl['team'] = 2;
-								}else{
-									$pl['team'] = 1;
-								}
-								mysql_query('UPDATE `users` SET `battle` = "'.$pl['battle'].'",`team` = "'.$pl['team'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <b>".$pl['login']."</b> �������� ��������� �� <b>".$rs[$ru]['login']."</b>...','".time()."','6','0')");
-								$sx = '';
-								if($pl['sex'] == 1) {
-									$sx = '�';
-								}
-								$rtxt = '[img[items/pal_button8.gif]] &quot;<small><font color=grey>!</font></small>'.$pl['login'].'&quot; �����������'.$sx.' ����� ��������� �� ��������� &quot;'.$rs[$ru]['login'].'&quot;.';
-								mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$pl['city']."','','','','".$rtxt."','".time()."','7','0','1','1')");	
-							}else{
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <b>".$pl['login']."</b> �������� �� ������� ��������� �� <b>".$rs[$ru]['login']."</b>...','".time()."','6','0')");
-							}
-						}else{
-							//�������������
-							mysql_query('UPDATE `stats` SET `timeGoL` = "'.(time()+rand(30,520)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-					}
-				}
-				
-				if($pl['type_pers']>2) {
-					if($pl['battle'] > 0) {
-						//��� � ��������
-						$btlu = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `time_over` = 0 AND `id` = "'.$pl['battle'].'" LIMIT 1'));
-						if(!isset($btlu['id'])) {
-							//�������� ��������
-							mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							//mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}else{
-							//�������� ������������
-							if($pl['atack'] < time()) {
-								//mysql_query('UPDATE `stats` SET `atack` = "'.(time()+123456789).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						}
-					}else{
-						//��� �� � ��������
-						if($pl['atack'] > time()) {
-							//mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-						
-						//��� ����������� ��
-						if($pl['hpNow'] < 1) {
-							if($pl['bot_room'] > 0) {
-								//��������� � "����� ������"
-								mysql_query('UPDATE `users` SET `room` = "'.$pl['bot_room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								mysql_query('UPDATE `stats` SET `hpNow` = "1",`mpNow` = "1",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red><b>��������!</b></font> <b>".$pl['login']."</b> ��� �������� � ".$this->city_name[$pl['city']]."...','".time()."','6','0')");
-							}else{
-								//������ ������
-								mysql_query('UPDATE `stats` SET `hpNow` = "1000000000",`mpNow` = "1000000000",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						}elseif($pl['bot_room'] > 0 && $pl['room'] == $pl['bot_room']) {
-							$btst = $this->getStats($pl['id']);
-							if($btst['hpAll'] <= $btst['hpNow'] && $btst['mpAll'] <= $btst['mpNow']) {
-								mysql_query('UPDATE `stats` SET `hpNow` = "'.$btst['hpAll'].'",`mpNow` = "'.$btst['mpAll'].'",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								$nrm = mysql_fetch_array(mysql_query('SELECT `id` FROM `room` WHERE `name` = "����������� �������" AND `city` = "'.$pl['city'].'" LIMIT 1'));
-								mysql_query('UPDATE `users` SET `room` = "'.(0+$nrm['id']).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <b>".$pl['login']."</b> �������� � ������� &quot;����������� �������&quot; � ".$this->city_name[$pl['city']]."...','".time()."','6','0')");
-								unset($nrm);
-							}else{
-								//��������
-								
-							}
-							unset($btst);
-						}
-					}
-				}				
-			}
-			mysql_query('UNLOCK TABLES');
-			unset($pl,$sp,$plu,$spu,$atc,$ru,$rs);
-			/*
-			$upd = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "��������" AND `online` < '.(time()-604800).' LIMIT 1'));
-			if(isset($upd['id']))
-			{
-				mysql_query('UPDATE `users` SET `online` = "'.(time()+600).'" WHERE `id` = "'.$upd['id'].'" LIMIT 1');
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> <b>��������</b> �������� �� ����� Capital City! ������ ���������!','-1','5','0')");
-				unset($upd);
-			}
-			*/
-			
-			if(isset($_GET['homeworld']))
-			{
-				if($this->info['zv']==0 && $this->info['battle']==0 && $this->info['dnow']==0)
-				{
-					$hgo = $this->testHome();
-					if(!isset($hgo['id']) && $this->info['room'] != 274 && $this->info['align']!=2 && $this->info['inTurnir'] == 0)
-					{
-						$this->addAction(time(),'go_homeworld','');
-						$rmt = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `name` = "����������� �������" AND `city` = "'.$this->info['city'].'" LIMIT 1'));
-						if(isset($rmt['id']))
-						{
-							//������� ��� ������ � ��
-							if( $this->room['file'] == 'bsenter' ) {
-								//������� ��� ������ � ��
-								$sp_bs = mysql_query('SELECT `id`,`bsid`,`money` FROM `bs_zv` WHERE `uid` = "'.$this->info['id'].'" AND `inBot` = "0" AND `finish` = "0"');
-								while( $pl_bs = mysql_fetch_array($sp_bs) ) {
-									mysql_query('UPDATE `bs_turnirs` SET `users` = `users` - 1 WHERE `id` = "'.$pl_bs['bsid'].'" LIMIT 1');
-								}
-								unset($sp_bs,$pl_bs);
-								mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `uid` = "'.$this->info['id'].'" AND `inBot` = "0" AND `finish` = "0"');
-							}
-							$this->info['room'] = $rmt['id'];
-							mysql_query('UPDATE `users` SET `room` = "'.$this->info['room'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');	
-
-						}else{
-							$this->error = '� ���� ������ ������ ������������ ������� �������';
-						}
-						unset($rmt);
-					}else{
-						$this->error = '��� ��������� ������������ ������� �������';
-					}
-					unset($hgo);
-				}
-			}
-			
-			//������� �����
-			if(isset($_GET['itmid']) && isset($_GET['addtext'])) {
-				$itm = mysql_fetch_array(mysql_query('SELECT 
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`max_text` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($_GET['itmid']).'" LIMIT 1'));
-				if(isset($itm['id'])) {
-					if($itm['max_text'] > 0 && $itm['max_text']-$itm['use_text'] > 0) {
-						$txt = $_GET['addtext'];
-						$txt = str_replace(' ','',$txt);
-						$txt = str_replace('	','',$txt);
-						if($txt != '') {						
-							$txt = substr($_GET['addtext'],0,$itm['max_text']-$itm['use_text']);
-							$sx = iconv_strlen($txt);
-							$itm['use_text'] += $sx;
-							if($itm['use_text'] > $itm['max_text']) {
-								$itm['use_text'] = $itm['max_text'];
-							}
-							
-							mysql_query('UPDATE `items_users` SET `use_text` = "'.$itm['use_text'].'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("'.$itm['id'].'","'.time().'","'.$this->info['login'].'","'.mysql_real_escape_string(htmlspecialchars($txt,NULL,'cp1251')).'","'.$this->info['city'].'","'.$sx.'")');
-							$this->error = '������ ������� �����������';
-						}else{
-							$this->error = '����� ���-�� ��������...';
-						}
-					}else{
-						$this->error = '������� ��� ������ �� ��������';
-					}
-				}else{
-					$this->error = '������� ��� ������ �� ������';
-				}
-			}
-			
-			//������ ��������
-			if(isset($_POST['trnLogin'],$_GET['transfer']) && $this->info['battle']==0) {
-				if($this->info['level']<4 && $this->info['admin']==0) {
-					$this->error = '���������� �������� ����� ��������� ������ 4-�� ������';
-				} elseif($this->info['align']==2 && $this->info['admin']==0) {
-					$this->error = '�������� �� ����� ���������� �������� ������ ����������';
-				} else {
-					$t = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`login2`,`pass`,`pass2`,`emailconfirmation`,`securetime`,`sys`,`online`,`ip`,`ipreg`,`joinIP`,`admin`,`city`,`room`,`banned`,`auth`,`align`,`mod_zvanie`,`clan`,`nextMsg`,`molch1`,`molch2`,`molch3`,`level`,`money`,`battle`,`cityreg`,`invBlock`,`invBlockCode`,`zag`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`homepage`,`deviz`,`hobby`,`chatColor`,`timereg`,`add_smiles`,`obraz`,`win`,`lose`,`nich`,`cityreg2`,`host`,`info_delete`,`dateEnter`,`afk`,`dnd`,`timeMain`,`clan_prava`,`addpr`,`marry`,`city2`,`invis`,`bot_id`,`haos`,`host_reg`,`inUser`,`jail`,`animal`,`vip`,`catch`,`frg`,`no_ip`,`type_pers`,`bot_room` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['trnLogin']).'" AND `city` = "'.$this->info['city'].'" LIMIT 1'));
-					if(isset($t['id']))
-					{
-					if($this->info['login']==$t['login']) {
-					$this->error = '�� �� ������ �������� ������ ����, �������� '.$this->microLogin($t['id'],1).'';
-					}elseif($t['battle']>0)
-						{
-							$this->error = '�������� ��������� � ���';
-						}elseif($t['level']<4 && $this->info['admin']==0)
-						{
-							$this->error = '�� �� ������ ���������� �������� ���������� ���� 4-�� ������';
-						}elseif($t['align']==2 && $this->info['admin']==0)
-						{
-							$this->error = '�� �� ������ ���������� �������� ���������';
-						}elseif($t['room']!=$this->info['room'])
-						{
-							$this->error = '�� ������ ��������� � ����� ������� � ����������';	
-						}else{
-							//������� ��������
-							$tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$this->info['id'].'" OR `uid2` = "'.$this->info['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'")) ORDER BY `id` DESC LIMIT 1'));
-							if(isset($tt['id']))
-							{
-								$this->error = '�� ��� ���������� � ��������';
-							}else{
-								$tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$t['id'].'" OR `uid2` = "'.$t['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$t['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$t['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$t['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$t['id'].'")) ORDER BY `id` DESC LIMIT 1'));
-								if(isset($tt['id']))
-								{
-									$this->error = '�������� ��� �������� ������';
-								}else{
-									$ins = mysql_query('INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("'.$this->info['id'].'","'.$t['id'].'","'.$this->info['city'].'","'.$this->info['room'].'","'.time().'","'.mysql_real_escape_string(htmlspecialchars($_POST['textarea'],NULL,'cp1251')).'","'.time().'")');
-									if($ins)
-									{
-										$this->addAction(time(),'trasfer_'.$this->info['city'].'_'.$this->info['room'].'_'.$t['id'].'',$this->info['login']);
-									}
-								}
-							}
-						}
-					}else{
-						$this->error = '�������� �� ������ � ���� ������';	
-					}
-				}
-			}
-			
-			//�������� ��������
-			$this->tfer = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$this->info['id'].'" OR `uid2` = "'.$this->info['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'")) ORDER BY `id` DESC LIMIT 1'));
-			if($this->tfer['uid1'] == $this->tfer['uid2']) {
-				$this->tfer = false;
-			}
-			if(isset($this->tfer['id']))
-			{
-				if($this->tfer['cancel1']==0 && $this->tfer['cancel2']==0)
-				{
-					if($this->tfer['uid2']==$this->info['id'] && $this->tfer['start2']==0 && isset($_GET['transfer']))
-					{
-						$this->tfer['start2'] = time();
-						mysql_query('UPDATE `transfers` SET `start2` = "'.$this->tfer['start2'].'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');	
-					}
-					if($this->tfer['uid2']==$this->info['id'] && $this->tfer['start2']==0)
-					{
-						$this->tfer = false;
-					}elseif($this->tfer['time']<time()-1800)
-					{
-						//���� �������� ������ 30 �����, �� ������
-						$upd = mysql_query('UPDATE `transfers` SET `cancel1` = "'.time().'",`cancel2` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');
-						if($upd)
-						{
-							unset($this->tfer,$upd);
-						}
-					}elseif($this->info['room']!=$this->tfer['room'] || $this->info['city']!=$this->tfer['city'] || $this->info['battle']>0)
-					{
-						$upd = mysql_query('UPDATE `transfers` SET `cancel1` = "'.time().'",`cancel2` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');
-						if($upd)
-						{
-							
-							
-							
-							
-							
-							mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "'.$this->tfer['uid1'].'" OR `uid` = "'.$this->tfer['uid2'].'") AND `inTransfer` > 0');
-							unset($this->tfer,$upd);
-						}
-					}elseif(isset($_GET['exit_transfer']))				
-					{
-						$upd = 1;
-						if($this->tfer['uid2']==$this->info['id'])
-						{
-							$upd = 2;
-						}
-						$upd = mysql_query('UPDATE `transfers` SET `cancel'.$upd.'` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');
-						if($upd)
-						{
-							
-							$this->error = '�� ������� ���������� �� ��������.';
-							
-							
-							
-							mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "'.$this->tfer['uid1'].'" OR `uid` = "'.$this->tfer['uid2'].'") AND `inTransfer` > 0');
-							//��������� ��������� � ���
-							if($this->tfer['start2']>0)
-							{
-								
-
-
-
-							}
-							unset($this->tfer,$upd);
-						}
-					}else{
-						if($this->tfer['uid1']==$this->info['id'])
-						{
-							//�������� �������� ������� ������
-							
-						}elseif($this->tfer['uid2']==$this->info['id'])
-						{
-							//��������� �������� �� ������� ������
-							
-						}
-					}
-				}
-			}
-			
-			/*
-			�������������
-			*/
-
-			//���������� ��������� �� �������
-			$stat = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` >= '.strtotime('now 00:00:00').' AND `vars` = "statistic_today" LIMIT 1',1);
-			if(!isset($stat['id']))
-			{
-				$this->addAction(time(),'statistic_today','e='.$this->info['exp'].'|w='.$this->info['win'].'|l='.$this->info['lose'].'|n='.$this->info['nich']);
-			}
-			
-			//������� ������ ��������
-			if(isset($_GET['usec1']) && $this->info['battle']==0)
-			{
-				$cmp = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`type`,`val`,`name`,`time`,`delete` FROM `save_com` WHERE `uid` = "'.$this->info['id'].'" AND `delete` = "0" AND `id` = "'.mysql_real_escape_string($_GET['usec1']).'" LIMIT 1'));
-				if(isset($cmp['id']))
-				{
-					//������� ��� ����
-					mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$this->info['id'].'"');
-					//������� ����, ���� ��� �� �������
-					$cm = $this->lookStats($cmp['val']);
-					$i = 1;
-					while($i<=250)
-					{
-						if(isset($cm[$i]))
-						{
-							mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$this->info['id'].'" AND `inOdet` = "'.$i.'"');
-							mysql_query('UPDATE `items_users` SET `inOdet` = "'.$i.'" WHERE `id` = "'.((int)$cm[$i]).'" AND `uid` = "'.$this->info['id'].'" AND `delete` = "0" AND `inShop` = "0"');
-						}
-						$i++;
-					}
-				}
-				
-				
-				
-				
-				
-				unset($cmp,$cm);
-			}
-			
-			$this->room = mysql_fetch_array(mysql_query('SELECT `id`,`extdlg`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee`,`roomAjax` FROM `room` WHERE `id` = "'.$this->info['room'].'" LIMIT 1'));
-			
-			if(isset($_POST['bankpsw']))
-			{
-				$this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" AND `id` = "'.mysql_real_escape_string((int)$_POST['bank']).'" AND `pass` = "'.mysql_real_escape_string($_POST['bankpsw']).'"  LIMIT 1'));
-				if(isset($this->bank))
-				{
-					mysql_query('UPDATE `bank` SET `useNow` = "'.(time()+24*60*60).'" WHERE `id` = "'.$this->bank['id'].'" LIMIT 1');
-				}else{
-					$this->bank['error'] = '�������� ������ �� �����';
-				}
-			}elseif(!isset($_GET['bank_exit']))
-			{
-				$this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" AND `useNow` > '.time().' ORDER BY `useNow` DESC  LIMIT 1'));
-			}
-			
-			if(isset($_GET['bank_exit']))
-			{
-				mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `uid` = "'.$this->info['id'].'" AND `useNow`!="0" LIMIT 1');
-			}
-			
-			if(!isset($_GET['obt_sel']) && $this->info['battle'] == 0 && $this->info['obraz'] != '0.gif') {
-				//��������� ������� �����
-					$this->stats = $this->getStats($this->info['id'],0);
-					$tr = true;
-					$o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `img` = "'.mysql_real_escape_string($this->info['obraz']).'" AND `sex` = "'.$this->info['sex'].'" AND (`login` = "" OR `login` = "'.$this->info['login'].'") LIMIT 1'));
-					$t = $this->items['tr'];
-					$x = 0;
-					$po = $this->lookStats($o['tr']);
-					if( $o['itm'] > 0 ) {
-						$o['itm'] = explode(',',$o['itm']);
-						$j = 0;
-						while( $j < count($o['itm']) ) {
-							$itm_id = $o['itm'][$j];
-							if( $itm_id > 0 ) {
-								$itm_id = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$itm_id.'" LIMIT 1'));
-								$itm_id_true = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "'.$itm_id['id'].'" AND
-								`delete` = 0 AND `inOdet` > 0 AND `inShop` = 0 AND `uid` = "'.$this->info['id'].'"
-								LIMIT 1'));
-								if(!isset($itm_id_true['id'])) {
-									$tr = false;
-								}
-							}
-							$j++;
-						}
-					}
-					while($x<count($t))	{
-						$n = $t[$x];
-						if(isset($po['tr_'.$n])) {
-							if($po['tr_'.$n] > $this->stats[$n]) {
-								$tr = false;
-							}
-						}
-						$x++;
-					}
-					if( $this->info['clan'] != $o['clan'] && $o['clan'] != 0 ) {
-						$tr = false;
-					}
-					if(!isset($o['id']) || $tr == false) {
-						if( $this->info['obraz'] == $o['img'] ) {
-							$this->info['obraz'] = '0.gif';
-							mysql_query('UPDATE `users` SET `obraz` = "'.$this->info['obraz'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						}
-					}
-
-			}
-						
-			if(isset($_GET['obr_sel']) || isset($_GET['obraz']))
-			{
-				$sm = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` > '.(time()-86400).' AND `vars` = "sel_obraz" LIMIT 1',1);
-				if(!isset($sm['id']))
-				{
-					if(isset($_GET['obr_sel']))
-					{
-						$this->stats = $this->getStats($this->info['id'],0);
-						$tr = true;
-						$o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `id` = "'.((int)$_GET['obr_sel']).'" AND `sex` = "'.$this->info['sex'].'" AND (`login` = "" OR `login` = "'.$this->info['login'].'") LIMIT 1'));
-						$t = $this->items['tr'];
-						$x = 0;
-						$po = $this->lookStats($o['tr']);
-						if( $o['itm'] > 0 ) {
-							$o['itm'] = explode(',',$o['itm']);
-							$j = 0;
-							$tritm = '';
-							while( $j < count($o['itm']) ) {
-								$itm_id = $o['itm'][$j];
-								if( $itm_id > 0 ) {
-									$itm_id = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$itm_id.'" LIMIT 1'));
-									$itm_id_true = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "'.$itm_id['id'].'" AND
-									`delete` = 0 AND `inOdet` > 0 AND `inShop` = 0 AND `uid` = "'.$this->info['id'].'"
-									LIMIT 1'));
-									if(!isset($itm_id_true['id'])) {
-										$tr = false;
-									}
-									if( $j > 0 ) {
-										$tritm .= ', ';
-									}
-									$tritm .= '&quot;'.$itm_id['name'].'&quot;';
-								}
-								$j++;
-							}
-							if( $tritm != '' && $tr == false ) {
-								$this->error = '���������� ��������: '.$tritm.'';
-							}
-						}
-						while($x<count($t))	{
-							$n = $t[$x];
-							if(isset($po['tr_'.$n])) {
-								if($po['tr_'.$n] > $this->stats[$n]) {
-									$tr = false;
-									$this->error = '������������ ������������� ��� ���������� ���������';
-								}
-							}
-							$x++;
-						}
-						if(isset($o['id']) && $tr == true) {
-							if( $this->info['obraz'] != $o['img'] ) {
-								mysql_query('UPDATE `users` SET `obraz` = "'.$o['img'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-								$this->addAction(time(),'sel_obraz','id='.$o['id'].'');
-								$this->info['obraz'] = $o['img'];
-							}
-						}else{
-							if( $this->info['obraz'] == $o['img'] ) {
-								$this->info['obraz'] = '0.gif';
-								mysql_query('UPDATE `users` SET `obraz` = "'.$this->info['obraz'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-							}
-						}
-					}
-				}else{
-					$this->error = '�������� ����� ����� �� ���� ������ ���� � �����, ��������� ����� '.date('d.m.Y H:i',$sm['time']+86400).'';
-					unset($_GET['obr_sel']);
-					$_GET['inv'] = 1;
-				}
-			}
-			
-			if($this->info['zv'] > 0)
-			{
-				$zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `zayvki` WHERE `id` = "'.$this->info['zv'].'" AND `btl_id` = "0" AND `cancel` = "0" LIMIT 1'));
-				if(!isset($zv['id']))
-				{
-					$this->info['zv'] = 0;
-					mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');	
-				}
-			}
-			
-			if($this->info['wipe']!=0)
-			{
-				$this->wipe();
-			}else{
-				//��������� �����
-				
-			}
-						
-			$this->allActionsStart();
-
-		}elseif(isset($this->info['id'])) {
-			$this->room = mysql_fetch_array(mysql_query('SELECT `id`,`extdlg`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee`,`roomAjax` FROM `room` WHERE `id` = "'.$this->info['room'].'" LIMIT 1'));
-		}
-	}
-	
-	public function allActionsStart()
-	{
-		global $magic;
-		if(isset($_GET['use_snowball']))
-		{
-			$this->stats = $this->getStats($this->info,0);
-			//�������� ������ ������ �� ��
-			if(isset($this->stats['items'][$this->stats['wp13id']]['id']) && $this->stats['items'][$this->stats['wp13id']]['item_id']==998)
-			{
-				//������� �����, ��� ��
-				if($this->room['name']!='����������� �������')
-				{
-					$this->error2 = '�������� ���� ����� ������ �� ����������� �������';
-				}else{
-					$smt = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time`>='.(time()-180).' AND `vars` = "create_snowball_cp" LIMIT 1',1);
-					if(isset($smt['id']))
-					{
-						$this->error2 = '������ ������ ��������� ������� ������������ ;)';
-					}else{
-						$smt = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time`>='.strtotime('now 00:00:00').' AND `vars` = "create_snowball_cp" LIMIT 25',2);
-						$smt = $smt[0];
-						if($smt<24)
-						{
-							$this->addAction(time(),'create_snowball_cp',$this->info['city']);
-							$magic->add_eff($this->info['id'],24);
-							$this->error2 = '�������� ������ ������, �������� '.(24-$smt).' ��� �� ������� ...';
-						}else{
-							$this->error2 = '�� ��� ������� 24 ������ �� ������� ...';
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	public function round2($v)
-	{
-		$v = explode('.',$v);
-		$v = doubleval($v[0].'.'.$v[1][0].''.$v[1][1]);
-		$f = explode('.',$v);
-		if(!isset($f[1]))
-		{
-			$v = $v.'.00';
-		}
-		return $v;
-	}
-	
-	public function zuby($v,$t = 0) {
-		$r = '';
-		if( $v < 0 ) {
-			$v = 0;
-		}
-		if($t == 0) {
-			$names[] = ' <img height=7 title=������&nbsp;��� src=https://img.new-combats.com/zub_low1.gif />';
-			$names[] = ' <img height=7 title=����������&nbsp;��� src=https://img.new-combats.com/zub_low2.gif />';
-			$names[] = ' <img height=7 title=�����&nbsp;��� src=https://img.new-combats.com/zub_low3.gif />';
-			$names[] = ' <img height=7 title=�������&nbsp;��� src=https://img.new-combats.com/zub_low4.gif />';
-		}else{
-			$names[] = ' <img style=vertical-align:baseline height=7 title=������&nbsp;��� src=https://img.new-combats.com/zub_low1.gif />';
-			$names[] = ' <img style=vertical-align:baseline height=7 title=����������&nbsp;��� src=https://img.new-combats.com/zub_low2.gif />';
-			$names[] = ' <img style=vertical-align:baseline height=7 title=�����&nbsp;��� src=https://img.new-combats.com/zub_low3.gif />';
-			$names[] = ' <img style=vertical-align:baseline height=7 title=�������&nbsp;��� src=https://img.new-combats.com/zub_low4.gif />';
-		}
-		$int = $v;
-		do{
-		 $mod = $int%10;
-		 $int = floor($int/10);//��� ������� $int = ($int-$mod)/10;
-		 $r = array_shift($names)."".$mod."".$r;
-		 
-		}while($int);
-	
-		$ost = explode('.',$v);
-		$ost = $ost[1];
-		if($ost == '' || $ost == 0) {
-			$ost = '00';
-		}
-		
-		$r .= '.'.$ost;
-	
-		return $r;
-	}
-	
-	public function onlineBonus()
-	{
-		/*if( $this->info['inTurnir'] == 0 ){
-			$ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-			$tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1'));
-			$m = floor(($ts['time_all']-$tf['vals'])/60);
-			$h = floor($m/60);
-				
-			if($h > 0 ) {
-				$ekr_add = round($h*0.45,2);
-				$bnks = mysql_fetch_array(mysql_query('SELECT `id`,`money2` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" ORDER BY `id` DESC LIMIT 1'));
-				if( isset($bnks['id']) ) {
-					$r .= ' �� �������� '.$ekr_add.' ���. (<small>���� �'.$bnks['id'].'</small>) �� '.$h.' �. � �������!';
-					$this->info['catch'] += $ekr_add;
-					$bnks['money2'] += $ekr_add;
-					mysql_query('UPDATE `users` SET `catch` = "'.$this->info['catch'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					mysql_query('UPDATE `bank` SET `money2` = "'.$bnks['money2'].'" WHERE `id` = "'.$bnks['id'].'" LIMIT 1');
-					if(!isset($tf['id'])) {
-						$this->addAction(time(),'online_bonus_time',$ts['time_all']);
-					}elseif($tf['vals'] < $ts['time_all']) {
-						mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1');
-					}
-					mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('2','1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','".time()."','6','0')");
-				}
-			}
-		}
-				/*$ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-				$tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1'));
-				$m = floor(($ts['time_all']-$tf['vals'])/60);
-				$h = floor($m/60);
-			
-				if($m > 0)
-				{
-					$this->stats = $this->getStats($this->info,0);
-					$r = '';
-					if(!isset($tf['id']))
-					{
-						$this->addAction(time(),'online_bonus_time',$ts['time_all']);
-					}elseif($tf['vals'] < $ts['time_all'])
-					{
-						mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1');
-					}
-					
-					//������ $m ��. ��������� ������� �� ������
-					if($m > 0) {
-						$hrg = 1;
-						//$this->addItem(2130,$this->info['id'],'noodet=1|noremont=1');
-						$this->stats['enNow'] = $this->info['enNow'];
-						$enreg = round($m*(@$this->stats['enAll']/(60*$hrg)),7);
-						if($this->info['admin'] > 0) {
-							//
-						}
-						
-						$this->stats['enNow'] += $enreg;
-						if($this->stats['enNow'] > $this->stats['enAll']) {
-							$this->stats['enNow'] = $this->stats['enAll'];
-							$enreg = 0;
-						}
-						$this->info['enNow'] = $this->stats['enNow'];
-						mysql_query('UPDATE `stats` SET `enNow` = "'.$this->stats['enNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-					
-					/*if($this->info['id'] == 285838 || $this->info['admin'] > 0) {
-					$r .= '<b><font color=red>��������!</font></b> ������������� �������: <b>'.$enreg.'</b> ��. ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']';
-					
-					//���������� ��������� � ���
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','-1','5','0')");
-					}*/
-				//}
-			return NULL;
-	}
-	
-	   public function addAction($time,$vars,$vls,$uid = NULL)
-	   {
-		 if($uid==NULL)
-		 {
-		  $uid = $this->info['id'];
-		 }
-		 //mysql_query('LOCK TABLES actions WRITE');
-		 $ins = mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("'.$uid.'","'.$time.'","'.$this->info['city'].'","'.$this->info['room'].'","'.mysql_real_escape_string($vars).'","'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'","'.mysql_real_escape_string($vls).'")');
-		 
-		 //mysql_query('UNLOCK TABLES');
-		 if($ins)
-		 {
-		  return true;
-		 }else{
-		  return false;
-		 }	 
-	   }
-	
-	   public function testAction($filter,$tp)
-	   {
-		 //mysql_query('LOCK TABLES actions WRITE');
-		 if($tp==1)
-		 {
-		  $ins = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`,`val` FROM `actions` WHERE '.$filter.''));
-		 }elseif($tp==2){
-		  $ins = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `actions` WHERE '.$filter.''));
-		 }
-		 //mysql_query('UNLOCK TABLES');
-		 return $ins;
-	   }
-	
-	public function takePersInfo($whr)
-	{
-		$inf = mysql_fetch_array(mysql_query('SELECT 
-		`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`,
-		`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-		FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE '.$whr.' LIMIT 1'));
-		return $inf;
-	}
-	
-	public function addNewbot($id,$botDate,$clon,$logins_bot=NULL,$luser=NULL,$round=NULL)
-	{
-		global $c,$code;
-		if($clon!=NULL)
-		{
-			$r = false;
-			if( is_array($clon) ) { 
-				//��� ����� ����
-			}else{
-				$clon = $this->takePersInfo('`u`.`id` = "'.((int)$clon).'"');
-			}
-			if(isset($clon['id']))
-			{
-				if( !isset($clon['loclon']) ) {
-					$clon['login'] .= ' (����)';
-				}
-				//�������� ������������
-				$ins1 = mysql_query('INSERT INTO `users` (
-				`align`,
-				`login`,
-				`level`,
-				`pass`,
-				`city`,
-				`cityreg`,
-				`name`,
-				`sex`,
-				`deviz`,
-				`hobby`,
-				`timereg`,
-				`obraz`,
-				`bot_id`,
-				`inTurnir`
-				) VALUES (
-				"'.$clon['align'].'",
-				"'.$clon['login'].'",
-				"'.$clon['level'].'",
-				"'.md5('bot_pass_'.$clon['login'].'_').'",
-				"'.$this->info['city'].'",
-				"'.$clon['city_reg'].'",
-				"'.$clon['login'].'",
-				"'.$clon['sex'].'",
-				"",
-				"",
-				"'.$clon['time_reg'].'",
-				"'.$clon['obraz'].'",
-				"'.mysql_real_escape_string($id).'",
-				"'.$clon['inTurnir'].'"
-				)');
-				if($ins1)
-				{
-					if( $round > 0 ) {
-						//�������� ��. � ����� � �� 1 ����� = +10%
-						$statss = $this->lookStats($clon['stats']);
-						//
-						$statss['s1'] = ceil($statss['s1']*(1 + 0.1*($round)));
-						$statss['s2'] = ceil($statss['s2']*(1 + 0.1*($round)));
-						$statss['s3'] = ceil($statss['s3']*(1 + 0.1*($round)));
-						$statss['s4'] = ceil($statss['s4']*(1 + 0.1*($round)));
-						//
-						$statss['hpAll'] = ceil($statss['hpAll']*(1 + 0.1*($round)));
-						$statss['mpAll'] = ceil($statss['mpAll']*(1 + 0.1*($round)));
-						//
-						$statss['m1'] = ceil($statss['m1']*(1 + 0.1*($round)));
-						$statss['m2'] = ceil($statss['m2']*(1 + 0.1*($round)));
-						$statss['m3'] = ceil($statss['m3']*(1 + 0.1*($round)));
-						$statss['m4'] = ceil($statss['m4']*(1 + 0.1*($round)));
-						$statss['m5'] = ceil($statss['m5']*(1 + 0.1*($round)));
-						$statss['za'] = ceil($statss['za']*(1 + 0.1*($round)));
-						$statss['zm'] = ceil($statss['zm']*(1 + 0.1*($round)));
-						$clon['stats'] = $this->impStats($statss);
-						unset($statss);
-					}
-					if($luser == true && $clon['level'] < 8) {
-						//���� ������, ���� � ������
-						$statss = $this->lookStats($clon['stats']);
-						$statss['m1'] = ceil($statss['m1']*0.75);
-						$statss['m2'] = ceil($statss['m2']*0.75);
-						$statss['m3'] = ceil($statss['m3']*0.75);
-						$statss['m4'] = ceil($statss['m4']*0.75);
-						$statss['m5'] = ceil($statss['m5']*0.75);
-						$statss['za']  = ceil($statss['za']*0.25);
-						
-						//$statss['yron_min']  -= $clon['level'] * 7;
-						//$statss['yron_max']  -= $clon['level'] * 12;
-						
-						$clon['stats'] = $this->impStats($statss);
-						unset($statss);
-					}
-					$uid = mysql_insert_id();
-					//�������� �����
-					$ins2 = mysql_query('INSERT INTO `stats` (`clone`,`id`,`stats`,`hpNow`,`upLevel`,`bot`,`priems`) VALUES ("'.$clon['id'].'","'.$uid.'","'.$clon['stats'].'","1000000","'.$clon['upLevel'].'","1","'.$clon['priems'].'")');
-					if($ins2)
-					{							
-						//�������� ��������
-						$sp = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `uid` = "'.$clon['id'].'" AND `inOdet` > 0 AND `delete` = "0" LIMIT 50');
-						while($pl = mysql_fetch_array($sp))
-						{
-							$pl['data'] = str_replace('toclan','to_clan_',$pl['data']);
-							mysql_query('INSERT INTO `items_users` (`uid`,`item_id`,`data`,`inOdet`,`iznosMAX`,`kolvo`) VALUES ("'.$uid.'","'.$pl['item_id'].'","'.$pl['data'].'","'.$pl['inOdet'].'","'.$pl['iznosMAX'].'","'.$pl['kolvo'].'")');
-						}
-						//�������� �������
-						$sp = mysql_query('SELECT `id`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`timeAce`,`user_use`,`delete`,`v1`,`v2`,`img2`,`x`,`hod`,`bj`,`sleeptime`,`no_Ace`,`tr_life_user` FROM `eff_users` WHERE `uid` = "'.$clon['id'].'" AND `delete` = "0" AND `deactiveTime` < "'.time().'" AND `v1` != "priem" LIMIT 50');
-						while($pl = mysql_fetch_array($sp))
-						{
-							mysql_query('INSERT INTO `eff_users` (`uid`,`id_eff`,`data`,`name`,`overType`,`timeUse`,`x`) VALUES ("'.$uid.'","'.$pl['id_eff'].'","'.$pl['data'].'","'.$pl['name'].'","'.$pl['overType'].'","'.$pl['timeUse'].'","'.$pl['x'].'")');
-						}
-						$r = $uid;
-					}
-				}
-			}
-			return $r;
-		}else{
-			if($botDate==NULL){
-				$bot = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`stats`,`obraz`,`level`,`sex`,`name`,`deviz`,`hobby`,`type`,`itemsUse`,`priemUse`,`align`,`clan`,`align_zvanie`,`bonus`,`clan_zvanie`,`time_reg`,`city_reg`,`upLevel`,`active`,`expB`,`p_items`,`agressor`,`priems`,`priems_z`,`award` FROM `test_bot` WHERE `id` = "'.$id.'" LIMIT 1'));
-			}else{
-				$bot = $botDate;
-			}
-			if(isset($bot['id']))
-			{
-				if(isset($logins_bot[$bot['login']]))
-				{				
-					$logins_bot[$bot['login']]++;
-					$bot['login'] = $bot['login'].' ('.$logins_bot[$bot['login']].')';											
-				}else{
-					$logins_bot[$bot['login']] = 1;
-				}
-				$ret = true;
-				if($bot['time_reg']==100)
-				{
-					$bot['time_reg'] = time();
-				}
-				if($bot['city_reg']=='{thiscity}')
-				{
-					$bot['city_reg'] = $this->info['city'];
-				}
-				
-				$ins1 = mysql_query('INSERT INTO `users` (
-				`align`,
-				`login`,
-				`level`,
-				`pass`,
-				`city`,
-				`cityreg`,
-				`name`,
-				`sex`,
-				`deviz`,
-				`hobby`,
-				`timereg`,
-				`obraz`,
-				`bot_id`
-				) VALUES (
-				"'.$bot['align'].'",
-				"'.$bot['login'].'",
-				"'.$bot['level'].'",
-				"'.md5('bot_pass_'.$bot['login'].'_').'",
-				"'.$this->info['city'].'",
-				"'.$bot['city_reg'].'",
-				"'.$bot['name'].'",
-				"'.$bot['sex'].'",
-				"'.$bot['deviz'].'",
-				"'.$bot['hobby'].'",
-				"'.$bot['time_reg'].'",
-				"'.$bot['obraz'].'",
-				"'.mysql_real_escape_string($id).'"
-				)');
-				if($ins1){
-					$uid = mysql_insert_id();
-					if( $round > 0 ) {
-						//�������� ��. � ����� � �� 1 ����� = +20%
-						$statss = $this->lookStats($bot['stats']);
-						//
-						$statss['s1'] = ceil($statss['s1']*(1 + 0.10*($round)));
-						$statss['s2'] = ceil($statss['s2']*(1 + 0.10*($round)));
-						$statss['s3'] = ceil($statss['s3']*(1 + 0.10*($round)));
-						$statss['s4'] = ceil($statss['s4']*(1 + 0.10*($round)));
-						//
-						$statss['hpAll'] = ceil($statss['hpAll']*(1 + 0.10*($round)));
-						$statss['mpAll'] = ceil($statss['mpAll']*(1 + 0.10*($round)));
-						//
-						$statss['m1'] = ceil($statss['m1']*(1 + 0.10*($round)));
-						$statss['m2'] = ceil($statss['m2']*(1 + 0.10*($round)));
-						$statss['m3'] = ceil($statss['m3']*(1 + 0.10*($round)));
-						$statss['m4'] = ceil($statss['m4']*(1 + 0.10*($round)));
-						$statss['m5'] = ceil($statss['m5']*(1 + 0.10*($round)));
-						$statss['za'] = ceil($statss['za']*(1 + 0.10*($round)));
-						$statss['zm'] = ceil($statss['zm']*(1 + 0.10*($round)));
-						$bot['stats'] = $this->impStats($statss);
-						unset($statss);
-					}
-					$ins2 = mysql_query('INSERT INTO `stats` (`id`,`stats`,`hpNow`,`upLevel`,`bot`) VALUES ("'.$uid.'","'.$bot['stats'].'","1000000","'.$bot['upLevel'].'","1")');
-					if($ins2){
-						$bot['id'] = $uid;
-						$bot['logins_bot'] = $logins_bot;
-						$ret = $bot;
-						
-						//������ ��������
-						//$this->addItem($item_id,$uid);
-						$iu = explode(',',$bot['itemsUse']);
-						$i = 0;
-						$w3b = 0;
-						while($i<count($iu)) {
-							if($iu[$i]>0) {
-								$idiu = $this->addItem($iu[$i],$bot['id']);
-								$islot = mysql_fetch_array(mysql_query('SELECT `id`,`inslot` FROM `items_main` WHERE `id` = "'.$iu[$i].'" LIMIT 1'));
-								if(isset($islot['id'])) {
-									if( $islot['inslot'] == 3 ) {
-										if( $w3b == 1 ) {
-											$islot = 14;
-										}else{
-											$islot = 3;
-											$w3b = 1;
-										}
-									}else{
-										$islot = $islot['inslot'];
-									}
-								}else{
-									$islot = 2000;
-								}
-								mysql_query('UPDATE `items_users` SET `inOdet` = "'.$islot.'" WHERE `id` = "'.$idiu.'" LIMIT 1');
-							}
-							$i++;
-						}
-						
-					}else{
-						$ret = false;
-					}
-				}else{
-					$ret = false;
-				}
-				return $ret;
-			}else{
-				return false;
-			}
-		}
-	}
-	
-	/*
-	 	  * $iid ���������� id �������� � ����������� ���� ���
-	 	  * ������� �� �����.
-	 	  */
-	public function buyItem($sid,$itm,$x,$mdata = NULL,$vip = false) {
-	global $c,$code,$sid;
-	// sid 700 - 730 ����������������� �������� ��� ������ � ������ (�� ����� �� 10���)
-	$x = round((int)$x);
-	if($x<1){ $x = 1; }
-	if($x>99){ $x = 99; }
-	$i = mysql_fetch_array(mysql_query('SELECT `im`.*,`ish`.* FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`kolvo` > 0 AND `ish`.`item_id` = "'.mysql_real_escape_string($itm).'" LIMIT 1'));
-	
-	$r = '';
-	$vip = false;
-	if( $vip == true ) {
-		$test = $this->testVipItems($i['type']);
-	}
-	if( $vip == true && $test == false ) {
-		$r = '������ ������� ���������� VIP ���������, ����������� ����� ������� �������';
-	}elseif($this->info['allLock'] > time()) {
-		$r = '��� ��������� ��������� ������� �� '.date('d.m.y H:i',$this->info['allLock']).'';
-	}elseif(isset($i['id'])){
-		if($i['price_4'] <= 0) {
-			$i['price_4'] = $i['price3'];
-		}
-		if($i['price_4'] > 0) {
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($x<1){
-				$x = 1;
-			}
-			$price = $i['price_4']*$x;
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!=''){
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)){
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`price4`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])){
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`4price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $row){
-					if( $this->rep[$row[0]] >= $row[1] ){
-						$need_rep++;
-					}
-				}
-			} else $need_rep = 0;
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-			
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( $need_rep > 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_4']*$x > ($this->rep['rep3']-$this->rep['rep3_buy'])){
-				$r = '� ��� ������������ ��������� (�� ������� '.($price-($this->rep['rep3']-$this->rep['rep3_buy'])).' ���������.)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				$this->rep['rep3_buy'] += $price;
-				$upd = mysql_query('UPDATE `rep` SET `rep3_buy` = "'.mysql_real_escape_string($this->rep['rep3_buy']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type']!=71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-								"1",
-								"1",
-								"'.$i['overType'].'",
-								"'.$i['item_id'].'",
-								"'.$this->info['id'].'",
-								"'.str_replace('sudba=0','',$data).'|sudba='.$this->info['login'].'|icos=WL|fromshop='.$sid.'",
-								"'.$i['iznosMAXi'].'",
-								"'.$i['geniration'].'",
-								"'.$i['magic_inc'].'",
-								"'.$this->info['city'].'",
-								"'.time().'",
-								"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-						$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ���������. '.$trnt.'<br>������� ������� �������� � ���������.';
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-						//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><b>����������� �������!</b></font> �������� <b>".$this->info['login']."</b> �������� ������� &quot;<font color=salmon><b>".$i['name']."</b></font>&quot; , ����������� � ������� ��������!','-1','5','0')");
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ���������.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ���������. <br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ���������. ',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}elseif($i['price_3'] > 0) {
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($x<1){
-				$x = 1;
-			}
-			$price = $i['price_3']*$x;
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!=''){
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)){
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`price4`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])){
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`4price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $row){
-					if( $this->rep[$row[0]] >= $row[1] ){
-						$need_rep++;
-					}
-				}
-			} else $need_rep = 0;
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( $need_rep > 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_3']*$x > $this->info['money3']){
-				$r = '� ��� ������������ ������ (�� ������� '.($price-$this->info['money3']).' $)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				$this->info['money3'] -= $price;
-				$upd = mysql_query('UPDATE `users` SET `money3` = "'.mysql_real_escape_string($this->info['money3']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type']!=71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-								"1",
-								"1",
-								"'.$i['overType'].'",
-								"'.$i['item_id'].'",
-								"'.$this->info['id'].'",
-								"'.str_replace('sudba=0','',$data).'|sudba='.$this->info['login'].'|frombax=1|fromshop='.$sid.'",
-								"'.$i['iznosMAXi'].'",
-								"'.$i['geniration'].'",
-								"'.$i['magic_inc'].'",
-								"'.$this->info['city'].'",
-								"'.time().'",
-								"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-						$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' $. '.$trnt.'<br>������� ������� �������� � ���������.';
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-						//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><b>����������� �������!</b></font> �������� <b>".$this->info['login']."</b> �������� ������� &quot;<font color=salmon><b>".$i['name']."</b></font>&quot; , ����������� � ������� ��������!','-1','5','0')");
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> $',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' $ <br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> $ ',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}elseif($sid==2 || $sid==777) {
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($i['price_2']<=0){
-				$i['price_2'] = $i['price2'];
-			}
-			if($i['price_1']<=0){
-				$i['price_1'] = $i['price1'];
-			}
-			if( $vip == true ) {
-				$i['price_2'] = round($i['price_2']/20,2);
-			}
-			
-			//������ � ��������������� ������� 5%
-			if( $this->stats['silver'] >= 1 ) {
-				if( $sid == 2 ) {
-					$i['price_1'] = round($i['price_1']/100*95 , 2);
-				}
-			}
-			
-			//������ � ������� ������� 5%
-			if( $this->stats['silver'] >= 5 ) {
-				if( $sid == 2 ) {
-					$i['price_2'] = round($i['price_2']/100*95 , 2);
-				}
-			}
-			
-			$price = $i['price_2']*$x;
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������';
-			}elseif($i['price_2']*$x>$this->info['money2']){
-				$r = '� ��� ������������ ����� �� ����� (�� ������� '.($price-$this->info['money2']).' ���.)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				$this->info['money2'] -= $price;
-				$upd = mysql_query('UPDATE `users` SET `money2` = "'.mysql_real_escape_string(round($this->info['money2'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					$this->info['frg'] += $price;
-					mysql_query('UPDATE `users` SET `frg` = "'.floor($this->info['frg']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					$i['time_create'] = time();
-					if( $vip == true ) {
-						$i['time_create'] = $this->stats['slvtm'];
-						$mdata .= '|vip_sale=1|sudba='.$this->info['login'].'';
-						$data = str_replace('sudba=0','',$data);
-						$data = str_replace('sudba=1','',$data);
-					}
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type'] != 71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-											"'.($i['price_1']/2).'",
-											"'.$i['price_2'].'",
-											"'.$i['overType'].'",
-											"'.$i['item_id'].'",
-											"'.$this->info['id'].'",
-											"'.$data.'|fromshop='.$sid.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geniration'].'",
-											"'.$i['magic_inc'].'",
-											"'.$this->info['city'].'",
-											"'.time().'",
-											"'.$i['time_create'].'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ���.<br>������� ������� �������� � ���������.';
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>EkrShop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.',add items '.$gix.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ���.',time(),$this->info['city'],'EkrShop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ���.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>EkrShop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ���.',time(),$this->info['city'],'EkrShop.'.$this->info['city'].'',0,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		} elseif( ($sid >= 700 && $sid <=730 ) /*OR ( $sid >= 800 && $sid <=805 )*/ ) { // nalpva2.php �������� �������, � ���������� � ���� �����, ���� � ������.
-			if( $i['kolvo'] < $x ) $x = $i['kolvo'];
-			if( $x < 1 ) $x = 1;
-			if( $i['price_1'] <= 0 && $i['tr_items']=='' ) $i['price_1'] = $i['price1'];
-			if( $i['price_2'] <= 0 && $i['tr_items']=='' ) $i['price_2'] = $i['price2'];
-
-			$price = $i['price_1']*$x;
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!='') {
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)) {
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])) {
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation'] != '' ) { // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $row){
-					if( $this->rep[$row[0]] >= $row[1] ){
-						$need_rep++;
-					}
-				}
-			} else $need_rep = 0;
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( $need_rep > 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($i['price_1']*$x>$this->info['money4'] && $zuby == 1){
-				$r = '� ��� ������������ �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������<br>�������� ������: '.$i['max_buy'].' ��.';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_1']*$x>$this->info['money'] && $zuby == 0){
-				$r = '� ��� ������������ ����� (�� ������� '.($price-$this->info['money']).' ��.)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				if($zuby == 0) {
-					$this->info['money'] -= $price;
-				}
-				$upd = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money'],2)).'",`money4` = "'.mysql_real_escape_string(round($this->info['money4'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$j=0;
-					$c_itm = 0;
-					$c_itm_data_a = array();
-					while( $j < count($detrn) ) {
-						$itm= mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0") AND `inShop` = "0" ORDER BY `inGroup` DESC LIMIT 1'));
-
-						if ( isset($itm['data']) && $itm['data'] != '' && $c_itm == 0){
-							$po = $this->lookStats($itm['data']);
-							//if(isset($po['complect'])) {
-							//	if(isset($po['complect'])) $c_itm_data_a['complect'] = $po['complect'];
-							//}
-							if(isset($po['sudba'])) {
-								if(isset($po['sudba'])) $c_itm_data_a['sudba'] = $po['sudba'];
-							}
-							if(isset($po['gravi']) && $po['gravi']!='') {
-								if(isset($po['gravi'])) $c_itm_data_a['gravi'] = $po['gravi'];
-								if(isset($po['gravic'])) $c_itm_data_a['gravic'] = $po['gravic'];
-								$c_itm++;
-							}
-							if(isset($po['imposed_id']) && $po['imposed_id']>0) {
-								if(isset($po['imposed'])) $c_itm_data_a['imposed'] = $po['imposed'];
-								if(isset($po['imposed_id'])) $c_itm_data_a['imposed_id'] = $po['imposed_id'];
-								if(isset($po['imposed_name'])) $c_itm_data_a['imposed_name'] = $po['imposed_name'];
-								if(isset($po['imposed_level'])) $c_itm_data_a['imposed_level'] = $po['imposed_level'];
-								if(isset($po['bm_a1'])) $c_itm_data_a['bm_a1'] = $po['bm_a1'];
-								$c_itm++;
-							}
-							if(isset($po['spell_id']) && $po['spell_id']>0) {
-								if(isset($po['spell'])) $c_itm_data_a['spell'] = $po['spell'];
-								if(isset($po['spell_id'])) $c_itm_data_a['spell_id'] = $po['spell_id'];
-								if(isset($po['spell_name'])) $c_itm_data_a['spell_name'] = $po['spell_name'];
-								if(isset($po['spell_lvl'])) $c_itm_data_a['spell_lvl'] = $po['spell_lvl'];
-								if(isset($po['spell_st_name'])) $c_itm_data_a['spell_st_name'] = $po['spell_st_name'];
-								if(isset($po['spell_st_val'])) $c_itm_data_a['spell_st_val'] = $po['spell_st_val'];
-								$c_itm++;
-							}
-							if(isset($po['rune_id']) && $po['rune_id']>0) {
-								if(isset($po['rune'])) $c_itm_data_a['rune'] = $po['rune'];
-								if(isset($po['rune_id'])) $c_itm_data_a['rune_id'] = $po['rune_id'];
-								if(isset($po['rune_name'])) $c_itm_data_a['rune_name'] = $po['rune_name'];
-								if(isset($po['rune_lvl'])) $c_itm_data_a['rune_lvl'] = $po['rune_lvl'];
-								$c_itm++;
-							}
-							if(isset($po['upatack_id']) && $po['upatack_id']>0) {
-								if(isset($po['upatack'])) $c_itm_data_a['upatack'] = $po['upatack'];
-								if(isset($po['upatack_id'])) $c_itm_data_a['upatack_id'] = $po['upatack_id'];
-								if(isset($po['upatack_name'])) $c_itm_data_a['upatack_name'] = $po['upatack_name'];
-								if(isset($po['upatack_lvl'])) $c_itm_data_a['upatack_lvl'] = $po['upatack_lvl'];
-								$c_itm++;
-							}
-						}
-						$j++;
-					}
-					if($c_itm>0){
-						$data = $this->lookStats($data);
-						// �����
-						if( isset($c_itm_data_a['spell_st_name']) && isset($c_itm_data_a['spell_st_val']) && $c_itm_data_a['spell_st_name'] != '' && $c_itm_data_a['spell_st_val'] != '' ){
-							$data['add_'.$c_itm_data_a['spell_st_name']] = (int)( isset($data['add_'.$c_itm_data_a['spell_st_name']]) ? (int)$data['add_'.$c_itm_data_a['spell_st_name']] : 0 ) + (int)$c_itm_data_a['spell_st_val'];
-						}
-						// ����
-						if(isset($c_itm_data_a['rune']) && $c_itm_data_a['rune'] > 0) {
-
-							$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$c_itm_data_a['rune_id'].'" LIMIT 1'));
-							$j = 0;
-							$data_r = $this->lookStats($ritm['data']);
-							while( $j < count($this->items['add']) ) {
-								if( isset($data_r['add_'.$this->items['add'][$j]]) ) {
-									$data['add_'.$this->items['add'][$j]] += $data_r['add_'.$this->items['add'][$j]];
-								}
-								$j++;
-							}
-
-						}
-
-						$data = $this->impStats($data);
-						$c_itm_data = $this->impStats($c_itm_data_a);
-						$data .= '|'.$c_itm_data;
-					}
-
-					$i['gift'] = '';
-
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type'] != 71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							//
-							$i['price_2'] = 0;
-							//
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`gift`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-											"'.$i['price_1'].'",
-											"'.$i['price_2'].'",
-											"'.$i['gift'].'",
-											"'.$i['overType'].'",
-											"'.$i['item_id'].'",
-											"'.$this->info['id'].'",
-											"'.$data.'|fromshop='.$sid.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geniration'].'",
-											"'.$i['magic_inc'].'",
-											"'.$this->info['city'].'",
-											"'.time().'",
-											"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-
-						if($zuby == 0) {
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ��. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}else{
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$this->zuby($price).'. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ��.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		} else { // ����������� ������� ��������
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($x<1){
-				$x = 1;
-			}
-			if($i['price_1']<=0 && $i['tr_items']==''){
-				$i['price_1'] = $i['price1'];
-			}
-			if($i['price_2']<=0 && $i['tr_items']==''){
-				$i['price_2'] = $i['price2'];
-			}
-			
-			//������ � ��������������� ������� 5%
-			if( $this->stats['silver'] >= 1 ) {
-				if( $sid == 1 ) {
-					$i['price_1'] = round($i['price_1']/100*95 , 2);
-				}
-			}
-			
-			//������ � ������� ������� 5%
-			if( $this->stats['silver'] >= 5 ) {
-				if( $sid == 2 ) {
-					$i['price_2'] = round($i['price_2']/100*95 , 2);
-				}
-			}
-			
-			$price = $i['price_1']*$x;
-						
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!='') {
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)){
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])){
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $key=>$val){
-					if( (int)$this->rep[$key] > (int)$val ){
-						$need_rep++;
-					}
-				}
-			} else unset($need_rep);
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			$zuby = 0;
-			if(isset($_GET['zuby']) && $i['level'] < 8 && $c['zuby'] == true) {
-				$zuby = 1;
-			}
-
-			$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-			$po = $this->lookStats($d['data']);
-			
-			if( $zuby == 1 && $po['tr_lvl'] > 7 ) {
-				$r = '������ ������� ������ ���������� �� ����.';
-			}elseif(!isset($this->sid_zuby[$sid]) && $zuby == 1) {
-				$r = '������ ������� ������ ���������� �� ����.';
-			}elseif($zuby == 1 && $i['nozuby'] == 1) {
-				$r = '������ ������� ������ ���������� �� ����.';
-			}elseif($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( isset($need_rep) && $need_rep == 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($zuby == 1 && $this->info['money4'] < $i['price_1']) {
-				$r = '� ��� ������������ �����.';
-			}elseif($i['price_1']*$x>$this->info['money4'] && $zuby == 1){
-				$r = '� ��� ������������ �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������<br>�������� ������: '.$i['max_buy'].' ��.';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_1']*$x > $this->info['money'] && $zuby == 0){
-				$r = '� ��� ������������ ����� (�� ������� '.($price-$this->info['money']).' ��.)';
-			}else{
-				if($zuby == 0) {
-					$this->info['money'] -= $price;
-				}else{
-					$this->info['money4'] -= $price;
-				}
-				$upd = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money'],2)).'",`money4` = "'.mysql_real_escape_string(round($this->info['money4'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					$data = str_replace('sudba=1','sudba='.$this->info['login'],$data);
-
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-
-					$i['gift'] = '';
-					if($zuby == 1) {
-						$i['gift'] = '1';
-						$data .= '|nosale=1|zazuby='.round($price/$x,2).'';
-					}
-					
-					if( $sid == 404 ) {
-						$data .= '|nosale=1|notransfer=1|fromshop=404|sudba=1';
-					}
-					
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type'] != 71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							//
-							$i['price_2'] = 0;
-							//
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`gift`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-											"'.$i['price_1'].'",
-											"'.$i['price_2'].'",
-											"'.$i['gift'].'",
-											"'.$i['overType'].'",
-											"'.$i['item_id'].'",
-											"'.$this->info['id'].'",
-											"'.$data.'|fromshop='.$sid.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geniration'].'",
-											"'.$i['magic_inc'].'",
-											"'.$this->info['city'].'",
-											"'.time().'",
-											"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-
-						if($zuby == 0) {
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ��. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}else{
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$this->zuby($price).'. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}
-
-						$zx = 0; $rs = 0;
-						while($zx < $x) {
-
-							if( ( $sid == 1 || $sid == 5 ) && $i['level'] >= 4 && round($price/$x) > 25 ) {
-								if($this->stats['shopSale'] == 0 && $c['nosanich'] == false) {
-									//������ ��������� ������ � ��� �������� � ������
-									$prmn = 0; //�������������� �����
-									$prmn = (1-( pow(0.5, ($price/$x/200) ) ))*100;
-									$prmn = round(20/100*$prmn);
-									if(rand(0,100) < 20+$prmn && rand(0,100) > 80-$prmn) {
-										//3143 - 3192
-										if(rand(0,100) < 20+$prmn && rand(0,100) > 80-$prmn) {
-											//�������
-											$gitm = rand(3193,3195);
-										}else{
-											$gitm = rand(3143,3192);
-										}
-										if($gitm == 3193) {
-											$gitm = 3194;
-										}
-										if($sid == 5) {
-											//����������� �������
-										}
-										$this->addItem($gitm,$this->info['id']);
-										$rs++;
-									}
-								}
-							}
-							$zx++;
-						}
-
-						if($rs > 1) {
-							if(rand(0,1) == 1) {
-								$r .= ' ������� ��� �������� � �����-�� �������. (x'.$rs.')';
-							}elseif(rand(0,1)){
-								$r .= ' ������� ��� �������� � �������� ������. (x'.$rs.')';
-							}else{
-								$r .= ' � �������� ���� ����������� �����-�� �������. (x'.$rs.')';
-							}
-						}elseif($rs > 0) {
-							if(rand(0,1) == 1) {
-								$r .= ' ������� ��� �������� � �����-�� �������.';
-							}elseif(rand(0,1)){
-								$r .= ' ������� ��� �������� � �������� ������.';
-							}else{
-								$r .= ' � �������� ���� ����������� �����-�� �������.';
-							}
-						}
-
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-
-
-
-
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$zuby_inf = '';
-						if($zuby == 1) {
-							$zuby_inf = ' <font color=red><small>(�� ����)</small></font>';
-						}
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ��.'.$zuby_inf.'',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ��.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}
-	}else{
-		$r = '������� �� ������ �� ��������';
-	}
-	return '<div align="left">'.$r.'</div>';
-}
-	  
-	public function takeBonus() {
-			if(!isset($_GET['getb1w'])) {
-				/*$this->info['money'] += 25;
-				mysql_query('UPDATE `users` SET `money` = "'.$this->info['money'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				mysql_query('INSERT INTO `aaa_bonus` (`uid`,`time`) VALUES (
-					"'.$this->info['id'].'","'.(time()+1*3600).'"
-				)');
-				$this->error = '��� ��������� 25 ��.';*/
-			}else{
-				if( $_GET['getb1w'] == 3 ) {
-					$pensia1 = $this->pensia(false);
-					$pensia2 = $this->pensia(true);
-					if( $this->info['timeMain'] < time() - 15 * 60 ) {
-						$afk = 1;
-					}else{
-						$afk = 0;
-					}
-					if( $pensia2[0] == 1 ) {
-						$this->info['money'] += $pensia2[1];
-						mysql_query('UPDATE `users` SET `money` = `money` + "'.$pensia2[1].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}else{
-						$this->info['money2'] += $pensia2[1];
-						mysql_query('UPDATE `users` SET `money2` = `money2` + "'.$pensia2[1].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-					$this->error = '��� �������� ����� � ������� '.$pensia1.'! ';
-					mysql_query('INSERT INTO `aaa_bonus` (
-						`uid`,`time`,`afk`,`type`,`money`
-					) VALUES (
-						"'.$this->info['id'].'","'.(time()+1*3600).'","'.$afk.'","'.$pensia2[0].'","'.$pensia2[1].'"
-					)');
-					
-				}
-			}
-	}
-	
-	public function addDelo($tp,$uid,$txt,$tm,$ct,$frm,$mo,$mi,$vvv = false)
-	{
-		$inc = mysql_query("INSERT INTO `users_delo` (`dop`,`moneyOut`,`moneyIn`,`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".mysql_real_escape_string($vvv)."','".mysql_real_escape_string($mo)."','".mysql_real_escape_string($mi)."','".mysql_real_escape_string($uid)."','".$_SERVER['HTTP_X_REAL_IP']."','".$ct."','".$tm."','".mysql_real_escape_string($txt)."','".mysql_real_escape_string($frm)."',".$tp.")");	
-		if($inc)
-		{
-			return true;
-		}else{
-			return false;
-		}	
-	}
-	
-	public function newAct($test){
-		$r = true;
-		if($test!=$this->info['nextAct'] && $this->info['nextAct']!='0'){
-			$r = false;
-		}else{
-			$na = md5(time().'_nextAct_'.rand(0,100));
-			$upd = mysql_query('UPDATE `stats` SET `nextAct` = "'.$na.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			if(!$upd){
-				$r = false;
-			}else{
-				$this->info['nextAct'] = $na;
-			}
-		}
-		return $r;
-	}
-
-	public function buyItemCommison($sid, $item, $iid = NULL) {
-		global $sid;
-		$sid = mysql_real_escape_string($sid);
-		$itme = mysql_real_escape_string($item);
-		$iid = mysql_real_escape_string($iid);
-		$i2 = mysql_fetch_array(mysql_query('SELECT `iu`.`uid`, `iu`.`id`, `iu`.`uid`, `iu`.`1price`, `iu`.inGroup, `iu`.`data`, `iu`.`inShop`, `iu`.`item_id`, `u`.`login` as login FROM `items_users` as `iu` LEFT JOIN `users` as `u` ON `u`.id=`iu`.uid WHERE `iu`.`id` = '.$iid.' AND `iu`.`inShop` = 30 LIMIT 1'));
-		$i1 = mysql_fetch_array(mysql_query('SELECT `name`,`price1` FROM `items_main` WHERE `id` = '.$i2['item_id'].' LIMIT 1'));
-		$price = $i2['1price'];
-		if(isset($i2['id']) && isset($iid) && $sid==1 && $i2['inShop']==30){
-			if($price>$this->info['money'])
-				$r = '� ��� ������������ ����� (�� ������� '.($price-$this->info['money']).' ��.)';
-			else{
-				$UpdMoney = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money']-$price,2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($UpdMoney) {
-					$this->info['money'] -= $price;
-					$UpMoney2 = mysql_query('UPDATE `users` SET `money` = `money` + '.$price.' WHERE `id` = '.$i2['uid'].' LIMIT 1');
-					#$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `id` = '.$iid.' and `inShop` = 30 LIMIT 1');
-					
-					$col = $this->itemsX($iid);
-					if($col > 1) {
-						$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `inGroup` = `inGroup`+1000, `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `inShop` = 30 AND `inOdet` = "0"AND `item_id`="'.$i2['item_id'].'" AND `uid`="'.$i2['uid'].'" AND `inGroup` = "'.$i2['inGroup'].'" LIMIT '.$col.'');
-					} else {
-						$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE  `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="'.$i2['uid'].'" LIMIT 1');
-					}
-					//��������� ������� �������� �������� ��������� ��������
-					if($UpItems){
-						//���������� � ������ ���� ��� ������� �������
-						$r = '�� ��������� ������� &quot;'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'&quot; �� '.$price.' ��.<br>������� ������� �������� � ���������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>ComissShop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'</b>&quot; [item:'.$iid.'] � ������������ �������� �� <b>'.$price.'</b> ��. [��������: '.( $i2['login']!='' ? '<a href="https://new-combats.com/info/'.$i2['uid'].'" target="_blank">'.$i2['login'].'</a>' : '('.$i2['uid'].')').']',time(),$this->info['city'],'Shop.'.$this->info['city'].'',$price,0);
-						$u2s = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$i2['uid'].'" LIMIT 1'));
-						$ld = $this->addDelo(1,$u2s['id'],'&quot;<font color=#C65F00>ComissShop.'.$this->info['city'].'</font>&quot;: ������ ������� &quot;<b>'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'</b>&quot; [item:'.$iid.'] ����� ������������ �������� �� <b>'.$price.'</b> ��. [����������: <a href="https://new-combats.com/info/'.$this->info['id'].'" target="_blank">'.$this->info['login'].'</a>]',time(),$this->info['city'],'Shop.'.$this->info['city'].'',0,$price);
-					} else {
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ���.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>EkrShop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i1['iid'].'. � �������: <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld) echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-					}
-				} else {
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}else
-			$r = '������� �� ������ �� ��������';
-		return '<div align="left">'.$r.'</div>';
-	}
-	 	 
-	public function commisonRent($action,$iid,$price=NULL) {
-		if($action=="����� � �������" && isset($iid) && $price >0 ) {
-			$ChImtem = mysql_fetch_array(mysql_query('SELECT `id`, `item_id`, `data`, `inGroup`, `uid` FROM `items_users` WHERE `id` = '.$iid.' LIMIT 1')); 
-			$ChSudba = $this->lookStats($ChImtem['data']);
-			if(isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['sudba']==1 || isset($ChSudba['toclan'])) {
-				continue;
-			} else {
-				if( isset($ChImtem['inGroup']) AND $ChImtem['inGroup'] > 0 ) {
-					$col = $this->itemsX($ChImtem['id']);
-					if($col > 1){
-						mysql_query('UPDATE `items_users` SET `inShop` = 30, `1price` = '.$price.' WHERE `item_id`="'.$ChImtem['item_id'].'" AND `uid`="'.$ChImtem['uid'].'" AND `inGroup` = "'.$ChImtem['inGroup'].'" LIMIT '.$col.'');
-					} else {
-						mysql_query('UPDATE `items_users` SET `inShop` = 30, `1price` = '.$price.' WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" ');
-					}
-				} else {
-					mysql_query('UPDATE `items_users` set `inShop` = 30, `1price` = '.$price.' where `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			}
-		}elseif($action=="�������" && isset($iid)) {
-			$i = mysql_fetch_array(mysql_query('SELECT `im`.`price1`,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.$iid.'" AND `iu`.`inShop` = "30" AND `iu`.`delete` = "0" LIMIT 1'));
-			if( isset($i['inGroup']) AND $i['inGroup'] > 0 ){
-				$col = $this->itemsX($i['id']);
-				if($col > 1){
-					mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = '.$i['price1'].' WHERE `item_id`="'.$i['item_id'].'" AND `inShop` = "30" AND `uid`="'.$i['uid'].'" AND `inGroup` = "'.$i['inGroup'].'" LIMIT '.$col.'');
-				} else {
-					mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = '.$i['price1'].' WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			} else {
-				mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = "'.$i['price1'].'" WHERE `id` = "'.$iid.'" and `inShop` = "30" LIMIT 1');
-			}
-		}
-	}
-
-	public function bronFx($br) {
-		$r = '';
-		if( $br[0] > 0 ) {
-			$r .= $br[0]-1;
-		}else{
-			$r .= 0;
-		}
-		$r .= 'd';
-		if( $br[0] > 0 ) {
-			$r .= $br[1]-$br[0];
-		}else{
-			$r .= 0;
-		}
-		return $r;
-	}
-	 	 
-	/*public function commisionShop($sid,$preview = "full"){	 	 	 	 	 	 	 	    
-		global $c,$code,$sid;
-	 	 	 
-		switch ((int)$_GET['otdel']) {
-	 	 	 	 	 case 1:$typeOtdel = 18; break;
-	 	 	 	 	 case 2:$typeOtdel = 19; break;
-	 	 	 	 	 case 3:$typeOtdel = 20; break;
-	 	 	 	 	 case 4:$typeOtdel = 21; break;
-	 	 	 	 	 case 5:$typeOtdel = 22; break;
-	 	 	 	 	 case 6:$typeOtdel = 15; break;
-	 	 	 	 	 case 7:$typeOtdel = 12; break;
-	 	 	 	 	 case 8:$typeOtdel = 4; break;
-	 	 	 	 	 case 9:$typeOtdel = 5; break;
-	 	 	 	 	 case 10:$typeOtdel = 6; break;
-	 	 	 	 	 case 11:$typeOtdel = 1; break;
-	 	 	 	 	 case 12:$typeOtdel = 3; break;
-	 	 	 	 	 case 13:$typeOtdel = 8; break;
-	 	 	 	 	 case 14:$typeOtdel = 14; break;
-	 	 	 	 	 case 15:$typeOtdel = 13; break;
-	 	 	 	 	 case 16:$typeOtdel = 9; break;
-	 	 	 	 	 case 17:$typeOtdel = 10; break;
-	 	 	 	 	 case 18:$typeOtdel = 11; break;
-	 	 	 	 	 case 19:$typeOtdel = 29; break;
-	 	 	 	 	 case 20:$typeOtdel = 30; break;
-					case 1050:$typeOtdel = 1050; break;
-	 	 	 	 	 default :$typeOtdel = 18;
-		}
-		
-		
-		//
-		
-		if( $typeOtdel == 1050 ) {
-			//�������� �������
-			if($preview == "full") {
-				
-			}else{
-				$sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND
-					`b`.`type` != "18" AND
-					`b`.`type` != "19" AND
-					`b`.`type` != "20" AND
-					`b`.`type` != "21" AND
-					`b`.`type` != "22" AND
-					`b`.`type` != "15" AND
-					`b`.`type` != "12" AND
-					`b`.`type` != "4" AND
-					`b`.`type` != "5" AND
-					`b`.`type` != "6" AND
-					`b`.`type` != "1" AND
-					`b`.`type` != "3" AND
-					`b`.`type` != "8" AND
-					`b`.`type` != "14" AND
-					`b`.`type` != "13" AND
-					`b`.`type` != "9" AND
-					`b`.`type` != "10" AND
-					`b`.`type` != "11" AND
-					`b`.`type` != "29" AND
-					`b`.`type` != "30"
-					
-					GROUP BY `b`.`name`
-					
-					');
-			}
-		}else{
-			//����� ������ ������ ���������
-			if($preview == "full") {
-					
-			}else{
-				$sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND `b`.`type` = "'.mysql_real_escape_string($typeOtdel).'" GROUP BY `b`.`name` ORDER BY `b`.`name` DESC');
-			}
-			//
-		}
-		$cr = 'c8c8c8';
-		$i = 0;
-	 	 $steckCikl = 1;
-		while($pl = mysql_fetch_array($sp)) {
-			//
-			$is1 = '';
-			$is2 = '';
-			//
-			if($preview == "full") {
-				
-			}else{		
-				//����������� � ��������
-				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` ASC LIMIT 1'));
-				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` DESC LIMIT 1'));
-				//
-				$is2 .= '<a target="_blank" href="https://new-combats.com/item/'.$pl['item_id'].'">'.$pl['name'].'</a> &nbsp; (�����: '.$pl['massa'].')';
-				//$is2 .= '<br><b>����: '.$pvr1[0].'-'.$pvr2[0].' ��.</b> <small>(����������: 0)</small>';
-				//
-				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` ASC LIMIT 1'));
-				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` DESC LIMIT 1'));
-				//
-				//$is2 .= '<br>�������������: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).'';
-				//
-				$is1 .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';	
-				$is1 .= '<a href="?toRent=3&otdel='.round($_GET['otdel']).'&itemid='.$pl['item_id'].'">���������</a><br>';			
-			}
-			echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top">'.$is2.'</td></tr>';
-			if( $cr == 'c8c8c8' ) {
-				$cr = 'd4d4d4';
-			}else{
-				$cr = 'c8c8c8';
-			}
-			$i++;
-		}
-		//
-		if( $i == 0 ) {
-			echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
-		}
-		//
-	 	 //*   * * * * * * * * * *  
-	 }*/
-	
-	public function commisionShop($sid,$preview = "full"){
-		global $c,$code,$sid;
-		switch ((int)$_GET['otdel']){
-			case 1:$typeOtdel = 18; break;
-			case 2:$typeOtdel = 19; break;
-			case 3:$typeOtdel = 20; break;
-			case 4:$typeOtdel = 21; break;
-			case 5:$typeOtdel = 22; break;
-			case 6:$typeOtdel = 15; break;
-			case 7:$typeOtdel = 12; break;
-			case 8:$typeOtdel = 4; break;
-			case 9:$typeOtdel = 5; break;
-			case 10:$typeOtdel = 6; break;
-			case 11:$typeOtdel = 1; break;
-			case 12:$typeOtdel = 3; break;
-			case 13:$typeOtdel = 8; break;
-			case 14:$typeOtdel = 14; break;
-			case 15:$typeOtdel = 13; break;
-			case 16:$typeOtdel = 9; break;
-			case 17:$typeOtdel = 10; break;
-			case 18:$typeOtdel = 11; break;
-			case 19:$typeOtdel = 29; break;
-			case 20:$typeOtdel = 30; break;
-			case 1050:$typeOtdel = 1050; break;
-			default :$typeOtdel = 18;
-	 	}
-	 	if($typeOtdel != 1050) {
-			if($preview == "full"){
-				$cl = mysql_query('SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount
-FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`)
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" and `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" GROUP BY `items_users`.`inGroup`, `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup > 0
-UNION ALL SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount
-FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`)
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" and `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" GROUP BY `items_users`.`uid`, `items_users`.`1price` HAVING `items_users`.inGroup = 0 
-ORDER BY `1price`ASC , inGroupCount DESC');	 	 	 	 	 	 	 	 	 
-	 	 	} else {
-				$cl = mysql_query('SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp` FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" GROUP BY `items_users`.`item_id` ORDER BY `items_main`.`id` DESC');
-			}
-		} else {
-			if($preview == "full"){
-	 	 	 	$cl = mysql_query('SELECT 
-`items_users`.`id` as id, `items_users`.`id` AS `idu`,`items_users`.`item_id` as item_id,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,
-`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,
-`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,
-`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,
-`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id` as item_id,`items_main`.`name`,
-`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,
-`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,
-`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,
-`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,
-`items_main`.`lvl_aexp` , count(`items_users`.`id`) as inGroupCount
-FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) 
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0"  AND `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'"
-AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" 
-GROUP BY `items_users`.`inGroup`, `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup > 0
-UNION ALL 
-SELECT `items_users`.`id` as id, `items_users`.`id` AS `idu`,`items_users`.`item_id` as item_id,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,
-`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,
-`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,
-`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,
-`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id` as item_id,`items_main`.`name`,
-`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,
-`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,
-`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,
-`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,
-`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount
-FROM  `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) 
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0"  AND `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'"
-AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" 
-GROUP BY `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup = 0
-ORDER BY `1price`ASC , inGroupCount DESC');	 	 	 	 	 	 	 	 	 
-	 	 	} else {
-				$cl = mysql_query('SELECT `items_users`.`id`, `items_users`.`id` AS `idu`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp` FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" GROUP BY `items_users`.`item_id` ORDER BY `items_main`.`id` DESC');
-			}
-		}
-		$cr = 'c8c8c8';
-		$i = 0;
-	 	$steckCikl = 1;
-		while($pl = mysql_fetch_array($cl)){
-			// ���������� ���������� ��������� � �����
-	 	 	if ( $preview == "preview" ) {
-		 	 	//$steck = mysql_fetch_array(mysql_query('SELECT COUNT(`item_id`) FROM `items_users` WHERE `item_id` = "'.$pl['item_id'].'" AND `inShop` = 30 LIMIT 1'));
-				$steck = array('--' , '--' , '--' , '--');
-			}
-			if($cr=='d4d4d4'){ $cr = 'c8c8c8'; } else { $cr = 'd4d4d4'; }
-			if( $preview == "preview" && ($steck[0]>1 && $steck[0]>$steckCikl )){
-				++$steckCikl;
-				continue;
-			} else {
-				$steckCikl = 1;
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1'));
-				if($steck[0]>1 && $preview == "preview") {
-					$po = $this->lookStats($d['data']);
-				} else {
-					$po = $this->lookStats($pl['data']);
-				}
-				if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27) {
-					//���� ����� +
-					if($pl['inOdet'] != 14) {
-						$po['zonb']++;
-					}
-				}
-				$is2 = '';
-				$is1 = '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				if ($preview == "full"){
-					$is1 .= '<a href="?otdel='.((int)$_GET['otdel']).'&toRent=3&itemid='.(INT)$_GET['itemid'].'&buy='.$pl[0].'&sd4='.$this->info['nextAct'].'&rnd='.$code.' " >������</a> ';	 	 	 	 	 	 	 	 
-				} elseif($preview=="preview") {
-					$is1 .= '<a href="?otdel='.((int)$_GET['otdel']).'&toRent=3&itemid='.$pl['item_id'].' " >�����������</a> ';
-				}
-				//��������
-				
-				$col = $this->itemsX($pl[0]); 
-				if($col>1 && $pl['inGroup']!=0 && $pl['inGroupCount']>1) { 
-					$pl['kolvo'] = $col;
-					$pl['name'] .= ' (x'.$col.')';
-				}
-				$is2 .= '<a href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$pl['name'].'</a> &nbsp; &nbsp;';
-				if($pl['massa']>0 && $preview == "full") {
-					$is2 .= '(�����: '.round($pl['massa'],2).')';
-					if($pl['gift']!=''){
-						$ttl = '';
-						if($pl['gift']==1){
-							$ttl = '�� �� ������ �������� ���� ������� ����-����';
-						}else{
-							$ttl = '���� ������� ������� '.$pl['gift'].'. �� �� ������� �������� ���� ������� ����-���� ���';
-						}
-						$is2 .= ' <img title="'.$ttl.'" src="https://img.new-combats.com/i/podarok.gif">';
-					}
-					if(isset($po['art'])){
-						$is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
-					}
-					if(isset($po['sudba'])){
-						if($po['sudba']=='0'){
-							$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-						}elseif($po['sudba']=='1'){
-							$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-						}else{
-							$is2 .= ' <img title="���� ������� ������ ����� ������� � '.$po['sudba'].'. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
-						}
-					}
-				}
-				//����
-				$is2 .= '<br><b>����: ';	 	 	 	 	 	 	 
-				if($steck[0]>1 && $preview == "preview") {
-						$is2 .= $steck[3].'-'.$steck[4].' ��.</b> ';
-				} else {
-					$is2 .= $pl['1price'].' ��.</b> ';
-				}
-				if($pl['pricerep']>0){
-					$is2 .= ' <small><b>('.round($pl['pricerep'],2).' ��������������)</b></small>';
-				}
-
-				//�������������
-				if($pl['iznosMAX']>0){
-					$izcol = '';
-					if(floor($pl['iznosNOW'])>=(floor($pl['iznosMAX'])-ceil($pl['iznosMAX'])/100*20)){
-						$izcol = 'brown';
-					}
-				} 
-				if ($preview == "preview") {
-					$is2 .= '<br>�������������: <font color="'.$izcol.'">'.floor($steck[1]).'/'.ceil($steck[2]).'</font>';
-				} else {
-					if($pl['iznosMAXi'] == 999999999) {
-						$is2 .= '<br>�������������: <font color="brown">�����������</font>';
-					} else {
-						$is2 .= '<br>�������������: <font color="'.$izcol.'">'.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).'</font>';
-					}
-				}
-				//���� �������� ��������
-				
-				if($po['srok'] > 0){
-					$pl['srok'] = $po['srok'];
-				}
-				if( $pl['srok'] > 0 AND $preview!="preview" ) {
-					if( $pl['time_create']+$pl['srok'] < time() ){
-						$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']).' (��������)';
-					} else {
-						$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']).' (�� '.date('d.m.Y H:i',$pl['time_create']+$pl['srok']).')';
-					}
-				}elseif( $pl['srok'] > 0 ){
-					$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']);
-				}
-				if($pl['magic_chance'] > 0) {
-					$is2 .= '<br>����������� ������������: '.min(array($pl['magic_chance'],100)).'%';
-				}
-
-				//����������������� �������� �����:
-				if((int)$pl['magic_inci'] > 0){
-					$efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1'));
-					if( isset($efi['id2']) && $efi['actionTime'] > 0 ){
-						$is2 .= '<br>����������������� ��������: '.$this->timeOut($efi['actionTime']);
-					}
-				}
-				if ($preview == "full" || $preview == "preview"){
-					//<b>��������� �����������:</b>
-					$tr = '';
-					$t = $this->items['tr'];
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($po['tr_'.$n]) && $po['tr_'.$n] != 0){
-							if($po['tr_'.$n] > $this->stats[$n]){
-								if( $n == 'rep' ) {
-									$temp = explode('::',$po['tr_'.$n]);
-									if( $this->rep['rep'.$temp[1]] < $temp[0] ) { $tr .= '<font color="red">'; $notr++; }
-									unset($temp);
-								} elseif( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-									$tr .= '<font color="red">'; $notr++;
-								}
-							}
-							$tr .= '<br>� ';
-							if( $n == 'rep' ) {
-								$temp = explode('::',$po['tr_'.$n]);
-								$tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0];
-								unset($temp);
-							}elseif( $n != 'align' ) {
-								if( $n == 'sex' ) {
-									if( $po['tr_'.$n] == 1 ) {
-										$tr .= $this->is[$n].': �������';
-									}else{
-										$tr .= $this->is[$n].': �������';
-									}
-								}else{
-									$tr .= $this->is[$n].': '.$po['tr_'.$n];
-								}
-							}else{
-								$tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]];
-							}
-							if($po['tr_'.$n] > $this->stats[$n]){
-								if( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-									$tr .= '</font>';
-								}
-							}
-						}
-						$x++;
-					}
-
-					if($tr!=''){
-						$is2 .= '<br><b>��������� �����������:</b>'.$tr;
-					}
-					//<b>��������� ��:</b>
-					$tr = ''; $t = $this->items['add'];
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($po['add_'.$n],$this->is[$n])){
-							$z = '+';
-							if($po['add_'.$n]<0){
-								$z = '';
-							}
-							$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['add_'.$n];
-						}
-						$x++;
-					}
-					//��������� �� (�����)
-					$i = 1; $bn = array(1=>'������',2=>'�������',3=>'�����',4=>'���');
-					while($i<=4){
-						if(isset($po['add_mab'.$i])){
-							if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1){
-								$z = '+';
-								if($po['add_mab'.$i]<0){
-									$z = '';
-								}
-								$tr .= '<br>� ����� '.$bn[$i].': '.$z.''.$po['add_mab'.$i];
-							}else{
-								$tr .= '<br>� ����� '.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i].' ('.$this->bronFx(array($po['add_mib'.$i],$po['add_mab'.$i])).')';
-							}
-						}
-						$i++;
-					}
-					if($tr!=''){
-						$is2 .= '<br><b>��������� ��:</b>'.$tr;
-					}
-					//<b>�������� ��������:</b>
-					$tr = ''; $t = $this->items['sv'];
-					if(isset($po['sv_yron_min'],$po['sv_yron_max'])){
-						$tr .= '<br>� ����: '.$po['sv_yron_min'].' - '.$po['sv_yron_max'];
-					}
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($po['sv_'.$n])){
-							$z = '+';
-							if($po['sv_'.$n]<0){
-								$z = '';
-							}
-							$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['sv_'.$n];
-						}
-						$x++;
-					}
-					if($pl['2too']==1){
-						$tr .= '<br>� ������ ������';
-					}
-					if($pl['2h']==1){
-						$tr .= '<br>� ��������� ������';
-					}
-					if(isset($po['zonb'])){
-						$tr .= '<br>� ���� ������������: ';
-						if($po['zonb']>0){
-							$x = 1;
-							while($x<=$po['zonb']){
-								$tr .= '+';
-								$x++;
-							}
-						}else{
-							$tr .= '�';
-						}
-					}
-
-					if($tr!=''){
-						$is2 .= '<br><b>�������� ��������:</b>'.$tr;
-					}
-
-					//�����������
-					/*$tr = '';
-					$x = 1;
-					while($x<=4){
-						if($po['tya'.$x]>0){
-							$tyc = '�������� �����';
-							if($po['tya'.$x]>6){
-								$tyc = '�����';
-							}
-							if($po['tya'.$x]>14){
-								$tyc = '����';
-							}
-							if($po['tya'.$x]>34){
-								$tyc = '���������';
-							}
-							if($po['tya'.$x]>79){
-								$tyc = '���������';
-							}
-							if($po['tya'.$x]>89){
-								$tyc = '�����';
-							}
-							if($po['tya'.$x]>=100){
-								$tyc = '������';
-							}
-							$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-						}
-						$x++;
-					}
-					$x = 1;
-					while($x<=7){
-						if($po['tym'.$x]>0){
-							$tyc = '�������� �����';
-							if($po['tym'.$x]>6){
-								$tyc = '�����';
-							}
-							if($po['tym'.$x]>14){
-								$tyc = '����';
-							}
-							if($po['tym'.$x]>34){
-								$tyc = '���������';
-							}
-							if($po['tym'.$x]>79){
-								$tyc = '���������';
-							}
-							if($po['tym'.$x]>89){
-								$tyc = '�����';
-							}
-							if($po['tym'.$x]>=100){
-								$tyc = '������';
-							}
-							$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-						}
-						$x++;
-					}
-					
-					if($tr!=''){
-						$is2 .= '<br><b>�����������:</b>'.$tr;
-					}*/
-					
-				$tr = '';
-					
-				if(isset($po['imposed']) && $po['imposed']>0) {
-					if($po['imposed_lvl'] == 0) {
-						$rnc = 'maroon';
-					}elseif($po['imposed_lvl'] == 1) {
-						$rnc = '#624542';
-					}elseif($po['imposed_lvl'] == 2) {
-						$rnc = '#77090b';
-					}elseif($po['imposed_lvl'] == 3) {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['imposed_name'] = str_replace('���� ','',$po['imposed_name']); 
-					$tr .= '<br>&bull; <font color='.$rnc.'>�������� ��������:</font> '.$po['imposed_name'].' '; 
-					unset($rnc);
-				} 
-				if($tr!='') {
-					$is2 .= '<br><b>��������� ��������:</b>';
-					$is2 .= $tr;
-				}
-					
-					if($notr==0){
-						$d[0] = 1;
-						if($pl['magic_inc']!=''){
-							$d[2] = 1;
-						}
-					}
-					if(isset($po['free_stats']) && $po['free_stats']>0){
-						$is2 .= '<br><b>������������� ������:</b>';
-						$is2 .= '&bull; ��������� �������������: '.$po['free_stats'].'';
-					}
-					if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX'])){
-						$d[0] = 0;
-						$d[2] = 0;
-					}
-					if(isset($po['complect']) || isset($po['complect2'])){
-						$is2 .= '<br><i>�������������� ����������:</i>';
-					}
-					if(isset($po['complect'])){
-						//�� ������������
-						$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-						$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY `x` ASC LIMIT 20');
-						while($plc = mysql_fetch_array($spc)){
-							$com1['name'] = $plc['name'];
-							$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-							//�������� ���������
-							$i1c = 0; $i2c = 0;
-							$i1e = $this->lookStats($plc['data']);
-							while($i1c<count($this->items['add'])){
-								if(isset($i1e[$this->items['add'][$i1c]])){
-									$i3c = $i1e[$this->items['add'][$i1c]];
-									if($i3c>0){
-										$i3c = '+'.$i3c;
-									}
-									if($i2c>0){
-										$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}else{
-										$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}
-									$com1['text'] .= '<br>';
-									$i2c++;
-								}
-								$i1c++;
-							}
-							unset($i1c,$i2c,$i3c);
-							$com1['x']++;
-						}
-						$is2 .= '<br>&bull; ����� ���������: <b>'.$com1['name'].'</b><br><small>';
-						$is2 .= $com1['text'];
-						$is2 .= '</small>';
-					}
-					if(isset($po['complect2'])){
-						//�� ������������
-						$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-						$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect2'].'" ORDER BY `x` ASC LIMIT 20');
-						while($plc = mysql_fetch_array($spc)){
-							$com1['name'] = $plc['name'];
-							$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-							//�������� ���������
-							$i1c = 0; $i2c = 0;
-							$i1e = $this->lookStats($plc['data']);
-							while($i1c<count($this->items['add'])){
-								if(isset($i1e[$this->items['add'][$i1c]])){
-									$i3c = $i1e[$this->items['add'][$i1c]];
-									if($i3c>0){
-										$i3c = '+'.$i3c;
-									}
-									if($i2c>0){
-										$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}else{
-										$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}
-									$com1['text'] .= '<br>';
-									$i2c++;
-								}
-								$i1c++;
-							}
-							unset($i1c,$i2c,$i3c);
-							$com1['x']++;
-						}
-						$is2 .= '<br>&bull; ����� ��������� (��������): <b>'.$com1['name'].'</b><br><small>';
-						$is2 .= $com1['text'];
-						$is2 .= '</small>';
-					}
-
-					$is2 .= '<small style="">';
-					if(isset($po['gravi'])) {
-						$is2 .= '<br>�� ����������� ������������� �������: <b>'.$po['gravi'].'</b>';
-					}
-					if($pl['info']!=''){
-						$is2 .= '<div><b>��������:</b></div><div>'.$pl['info'].'</div>';
-					}
-					if($po['info']!=''){
-						$is2 .= '<div>'.$po['info'].'</div>';	 	 	 	 	 	 	 	 	 
-					}
-					if($pl['max_text']-$pl['use_text'] > 0) {
-						$is2 .= '<div>���������� ��������: '.($pl['max_text']-$pl['use_text']).'</div>';
-					}
-					if($pl['maidin']!=''){
-					//	$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
-					}
-					if(isset($po['noremont'])){
-						$is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
-					}
-					if(isset($po['nosale'])){
-						$is2 .= '<div style="color:brown;">������� ������ �������</div>';
-					}
-					if(isset($po['nomodif'])){
-						$is2 .= '<div style="color:brown;">������� ������ ��������</div>';
-					}
-					if(isset($po['nodelete'])){
-						$is2 .= '<div style="color:brown;">������� ������ ���������</div>';
-					}
-					if(isset($po['frompisher']) && $po['frompisher']>0){
-						$is2 .= '<div style="color:brown;">������� �� ����������</div>';
-					}
-					if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) {
-						$is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
-					}
-					if(isset($po['fromlaba']) && $po['fromlaba']>0){
-						$is2 .= '<div style="color:brown;">������� �� ���������</div>';
-					}
-					if(isset($po['vip_sale']) && $po['vip_sale']>0) {
-						$is2 .= '<div style="color:brown;">������� ������ �� 10% �� ���������</div>';
-					}
-					if($pl['dn_delete']>0){
-						$is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
-					}
-					if( $this->pokol > $pl['geni'] ) {
-						$is2 .= '<div style="color:brown">������� �������</div>';
-					}
-					if(isset($po['zazuby']) && $po['zazuby']>0){
-						$is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
-					}
-					//$is2 .= '<div>������� � '.$this->city_name[$this->info['city']].'</div>';
-					$is2 .= '</small>';
-				}
-				if ($preview == "preview"){
-					$kolvoprint = "<small style=\"float:right; color:grey;\" align=\"right\">����������: <b>$steck[0]</b> ��.</small>";
-				}
-				echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top">'.$kolvoprint.$is2.'</td></tr>';
-				$i++;
-			}
-	 	}
-		if($i==0) echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
-	}
-
-	public $sid_zuby = array(
-	//�������
-		1 => 1, //���
-		9 => 1, //�������
-		8 => 1 //���
-	);
-
-	public function shopItems($sid,$plu = '')
-	{
-		global $c,$code,$sid;
-		
-		$sid_zuby = 0;
-		
-		if(isset($this->sid_zuby[$sid])) {
-			$sid_zuby = 1;
-		}
-		
-		if( $this->info['admin'] > 0 ) {
-			$ishp = mysql_fetch_array(mysql_query('SELECT * FROM `items_shop` WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" AND `kolvo` > 0 LIMIT 1'));
-			if( isset($_GET['itmup']) ) {
-				//mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']+1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']-1).'" LIMIT 1');
-				mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']-1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'"  AND `kolvo` > 0 LIMIT 1');
-			}elseif( isset($_GET['itmdown']) ) {
-				//mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']-1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']+1).'" LIMIT 1');
-				mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']+1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'"  AND `kolvo` > 0 LIMIT 1');
-			}elseif( isset($_GET['itmid']) ) {
-				//mysql_query('UPDATE `items_shop` SET `pos` = "'.mysql_real_escape_string($_GET['itmpos']).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" LIMIT 1');
-			}
-		}
-		
-		
-		
-		
-		$cl = mysql_query('SELECT
-		`ish`.`price_4`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby`
-		FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`r` = "'.mysql_real_escape_string($_GET['otdel']).'" ORDER BY `ish`.`pos` ASC');
-		
-		
-		
-		/*
-		$cl = mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby`
-		FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`r` = "'.mysql_real_escape_string($_GET['otdel']).'" ORDER BY `ish`.`pos` ASC');
-		*/
-		
-		$cr = 'c8c8c8';
-		$i = 0;
-		$jid = 0;
-		while($pl = mysql_fetch_array($cl))
-		{
-			/*if($pl['price_1']==0 && $pl['price1']>0)
-			{
-				mysql_query('UPDATE `items_shop` SET `price_1` = "'.$pl['price1'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-			}
-			if($pl['price_2']==0 && $pl['price2']>0)
-			{
-				mysql_query('UPDATE `items_shop` SET `price_2` = "'.$pl['price2'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-			}*/			
-			
-			if($pl['kolvo']>0)
-			{
-				$jid++;				
-				//if( $pl['pos'] != $jid ) {
-				//	$pl['pos'] = $jid;
-				//	mysql_query('UPDATE `items_shop` SET `pos` = "'.($jid).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.$pl['id'].'" AND `kolvo` > 0 LIMIT 1');
-				//}
-				if($cr=='d4d4d4')
-				{
-					$cr = 'c8c8c8';
-				}else{
-					$cr = 'd4d4d4';
-				}
-				if($pl['price_1']<0.01 && $pl['tr_items']=='')
-				{
-					$pl['price_1'] = $pl['price1'];
-				}
-				if($pl['price_2']<0.01 && $pl['tr_items']=='')
-				{
-					$pl['price_2'] = $pl['price2'];
-				}
-								
-				if($pl['price_1']<0){ $pl['price_1'] = 0; }
-				if($pl['price_2']<0){ $pl['price_2'] = 0; }
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['id'].'" LIMIT 1'));
-				$po = $this->lookStats($d['data']);
-				
-				if( $sid == 609 ) {
-					$po['icos'] = 'WL';
-				}
-				
-				/*
-				if($pl['level']==0 && $po['tr_lvl']>0)
-				{
-					mysql_query('UPDATE `items_shop` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-					mysql_query('UPDATE `items_main` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['id'].'" LIMIT 1');
-				}*/
-				
-				if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27)
-				{
-					//���� ����� +
-					$po['zonb']++;
-				}	
-				
-				$is2 = '';
-				if($pl['type'] == 71) {
-					$is1 = '<img width="80" src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				}else{
-					$is1 = '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				}
-				if( $sid == 609 ) {
-					$is1 .= '<span id="shopPlus'.$pl['id'].'"></span><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\'??\',\' ??.\');">������</a>';
-				}else{
-					//if($this->info['money']>$pl['price'])
-					//{
-					if($sid==2 || $sid==777) {
-						$is1 .= '<span id="shopPlus'.$pl['id'].'"></span><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\''.$pl['price_2'].'\',\' ���.\');">������</a> <a href="javascript:void(0);" onClick="top.payPlus('.$pl['id'].');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="������ ��������� ���������"></a>';
-					}else{
-						$is1 .= '<span id="shopPlus'.$pl['id'].'"></span><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\''.$pl['price_1'].'\',\' ��.\');">������</a> <a href="javascript:void(0);" onClick="top.payPlus('.$pl['id'].');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="������ ��������� ���������"></a>';
-					}
-					//}
-					if( $sid == 777 && $this->stats['silver'] > 1 ) {
-						//$is1 .= '<br><a onClick="if(confirm(\'��������� VIP-�������?\')){ location.href = \'main.php?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy_vip='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'; }" href="javascript:void('.$pl['id'].');">VIP ������� ('.round($pl['price_2']/20,2).' ���.)</a> ';
-					}
-					if($pl['nozuby'] == 0) {
-						if($this->info['level'] > 0 && $this->info['level'] < 8) {
-							if($pl['level'] < 8 && $sid_zuby == 1 && $pl['nozuby'] == 0 && $c['zuby'] == true) {
-								$is1 .= '<br><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&zuby=1&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\''.$pl['price_1'].'\',\' (����)\');">������ �� ����</a>';
-								/*if( $this->info['admin'] > 0 ) {
-									if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
-										mysql_query('UPDATE `items_shop` SET `nozuby` = 1 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-									}
-									$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">��������� ������� �� ����</a>)</small>';
-								}*/
-							}
-						}
-					}/*elseif( $this->info['admin'] > 0 ) {
-						if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
-							mysql_query('UPDATE `items_shop` SET `nozuby` = 0 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-						}
-						$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">��������� ������� �� ����</a>)</small>';
-					}*/
-				}
-				/*
-				if($this->info['admin'] > 0) {
-					$is1 .= '<br><br><small>�������� ��� ��������: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_class=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">����</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">����</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">���������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">���</a></small>';
-				}
-				
-				if($this->info['admin'] > 0) {
-					$is1 .= '<br><small>�������� ��� �������������: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_aclass=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ��������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ���������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� �����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� �����</a></small>';
-					//������� �������������
-					
-				}
-				
-				if($this->info['admin']>0) {
-					if(isset($_GET['add_class']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) {
-						mysql_query('UPDATE `items_main` SET `class` = "'.mysql_real_escape_string($_GET['add_class']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1');
-						$pl['class'] = $_GET['add_class'];
-					}
-					if(isset($_GET['add_aclass']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) {
-						mysql_query('UPDATE `items_main` SET `anti_class` = "'.mysql_real_escape_string($_GET['add_aclass']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1');
-						$pl['anti_class'] = $_GET['add_aclass'];
-					}
-					
-					if($pl['class'] > 0) {
-						$clnm = array('�����������','����','������','����','�������','���������','���');
-						$is1 .= '<br><br><small>������� ��� '.$clnm[$pl['class']].'�</small>';
-						unset($clnm);
-					}
-					
-					if($pl['anti_class'] > 0) {
-						$clnm = array('�����������','����','������','����','�������','���������','���');
-						$is1 .= '<br><small>���������� ��� '.$clnm[$pl['anti_class']].'��</small>';
-						unset($clnm);
-					}
-				}
-				*/
-				//��������
-				
-				if(isset($po['tr_align']) && !isset($po['tr_align_bs'])) {
-					$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
-				} elseif(isset($po['tr_align_bs'])) {
-					if($po['tr_align_bs'] == '1') {
-					  $pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align1.75.gif >';
-					} elseif($po['tr_align_bs'] == '3') {
-					  $pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align3.01.gif >';
-					}
-				}
-				
-				if( isset($po['tr_rep']) && isset($po['tr_dungeon']) ) {
-					//$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
-				}
-				if( isset($po['renameadd']) && $po['renameadd'] != '' ) {
-					$pl['name'] .= ' (�������: '.$po['renameadd'].')';
-				}
-				if( isset($po['icos']) ) {
-					$pl['name'] = '<span class="icos_'.$po['icos'].'">'.$pl['name'].' <span><small>&nbsp;'.$po['icos'].'&nbsp;</small></span></span>';
-				}
-				$is2 .= '<a name="sit_'.$pl['id'].'" href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$pl['name'].'</a> &nbsp; &nbsp;';
-				
-				
-				if($pl['massa']>0)
-				{
-					$is2 .= '(�����: '.round($pl['massa'],2).')';
-				}
-				
-				if(isset($po['art']))
-				{
-					$is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
-				}
-				
-				if(isset($po['sudba']))
-				{
-					if($po['sudba']=='0')
-					{
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}elseif($po['sudba']=='1'){
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}else{
-						$is2 .= ' <img title="���� ������� ������ ����� ������� � '.$po['sudba'].'. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
-					}
-				}
-				
-				//����
-				if( $this->info['admin'] > 0 ) {
-					$is2 .= '<div style="float:right"> <a href="?otdel='.round($_GET['otdel']).'&itmid='.$pl['id'].'&itmup=1&rnd='.microtime().'#itmdown'.$pl['id'].'">&uarr;</a> &nbsp; '.$pl['pos'].' &nbsp; <a name="itmdown'.$pl['id'].'" id="itmdown'.$pl['id'].'" href="?rand='.microtime().'&otdel='.round($_GET['otdel']).'&itmid='.$pl['id'].'&itmdown=1#itmdown'.$pl['id'].'">&darr;</a></div>';
-				}
-				$is2 .= '<br><b>����: ';
-				if( $this->stats['silver'] >= 1 && $sid == 1 ) {
-					$is2 .= '<strike>';
-				}elseif( $this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777) ) {
-					$is2 .= '<strike>';
-				}
-				if( $sid == 609 ) {
-					if($pl['price_4'] > ($this->rep['rep3']-$this->rep['rep3_buy']))
-					{
-						$is2 .= '<font color="red">'.round($pl['price_4']).'</font>';
-					}else{
-						$is2 .= '<font color="green">'.round($pl['price_4']).'</font>';
-					}
-					
-					$is2 .= '</b> <b></b> �������������� ';
-				}elseif($pl['price_3'] > 0) {
-					if($pl['price_3']>$this->info['money3'])
-					{
-						$is2 .= '<font color="red">'.$pl['price_3'].'</font>';
-					}else{
-						$is2 .= $pl['price_3'];
-					}
-					$is2 .= ' $ </b> ';
-				}elseif($sid==2 || $sid==777)
-				{
-					$is .= '<span style="color:#f93737">';
-					if($pl['price_2']>$this->info['money2'])
-					{
-						$is2 .= '<font color="red">'.$pl['price_2'].'</font>';
-					}else{
-						$is2 .= $pl['price_2'];
-					}
-					$is2 .= ' ���.</b></span> ';
-				}else{
-					if($pl['price_1']>$this->info['money'])
-					{
-						$is2 .= '<font color="red">'.$pl['price_1'].'</font>';
-					}else{
-						$is2 .= $pl['price_1'];
-					}
-					$is2 .= ' ��.</b> ';
-				}
-				if( $this->stats['silver'] >= 1 && $sid == 1 ) {
-					$is2 .= '</strike> &nbsp; <b>';
-					if($pl['price_1']>$this->info['money'])
-					{
-						$is2 .= '<font color="red">'.round($pl['price_1']*0.95,2).'</font>';
-					}else{
-						$is2 .= round($pl['price_1']*0.95,2);
-					}
-					$is2 .= ' ��.</b> <sup><small style=color:blue; >������ -5%</small></sup>';
-				}elseif( $this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777) ) {
-					$is2 .= '</strike> &nbsp; <b>';
-					if($pl['price_2']>$this->info['money2'])
-					{
-						$is2 .= '<font color="red">'.round($pl['price_2']*0.95,2).'</font>';
-					}else{
-						$is2 .= round($pl['price_2']*0.95,2);
-					}
-					$is2 .= ' ���.</b> <sup><small style=color:blue; >������ -5%</small></sup>';
-				}
-				
-				if($pl['pricerep']>0)
-				{
-					$is2 .= ' <small><b>('.round($pl['pricerep'],2).' ��������������)</b></small>';
-				}
-				
-				if($pl['kolvo'] < 100000) {
-					$is2 .= ' &nbsp; &nbsp; <small>(����������: <b>'.$pl['kolvo'].'</b>)</small>';
-				}
-				
-				if($pl['nozuby'] == 0 && $sid != 609 && $c['zuby'] == true) {
-					if($this->info['level'] > 0 && $this->info['level'] < 8) {
-						if($pl['level'] < 8 && $sid_zuby == 1) {
-							if( $this->stats['silver'] > 0 && $sid == 1 ) {
-								$is2 .= ' (<small>'.ltrim($this->zuby(round($pl['price_1']*0.95,2)),' ').'</small>)';
-							}else{
-								$is2 .= ' (<small>'.ltrim($this->zuby($pl['price_1']),' ').'</small>)';
-							}
-						}
-					}
-				}
-				
-				if($pl['tr_items']!='')
-				{
-					$ttmm = '';
-					$trn = 1;
-					$tims2 = explode(',',$pl['tr_items']);
-					$j = 0;
-					while($j<count($tims2))
-					{
-						$tims = explode('=',$tims2[$j]);
-						if($tims[0]>0 && $tims[1]>0)
-						{
-							$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-							if(isset($tis['id']))
-							{
-								$num_rows = 0;
-								$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0"');
-								while($p1l = mysql_fetch_array($s1p))
-								{
-									$num_rows++;	
-								}
-								if($num_rows < (int)$tims[1])
-								{
-									$trn = 0;	
-								}
-								$ttmm .= '[<b>'.$tis['name'].'</b>] x'.$tims[1].', ';	
-							}
-						}
-						$j++;	
-					}
-					if( $c['noitembuy'] == true ) {
-						$trn = 1;
-						$ttmm = '';
-					}
-					
-					if($ttmm!='')
-					{
-						$ttmm = '<br>������� �������: '.rtrim($ttmm,', ').' ';	
-						if($trn==0)
-						{
-							$ttmm = '<font color="red">'.$ttmm.'</font>';	
-						}
-					}
-				}
-				
-				$is2 .= $ttmm.' <br>';
-				unset($ttmm);
-				
-				
-				//�������������
-				if( $pl['iznos'] > 0 ) {
-					$pl['iznosMAXi'] = $pl['iznos'];
-				}
-				if($pl['iznosMAXi']>0)
-				{
-	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$is2 .= '�������������: <font color=brown>�����������</font > <br>';
-					}else{
-						$is2 .= '�������������: 0/'.$pl['iznosMAXi'].'<br>';
-					}
-				}
-				
-				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '�������� �������������: '.$this->timeOut($po['battleUseZd']).'<br>';
-				}
-				
-				$is2 = rtrim($is2,'<br>');
-				
-				//���� �������� ��������
-				if($po['srok'] > 0)
-				{
-					$pl['srok'] = $po['srok'];
-				}
-				if($pl['srok'] > 0)
-				{
-					$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']);
-				}
-				if($pl['magic_chance'] > 0) {
-					$is2 .= '<br>����������� ������������: '.min(array($pl['magic_chance'],100)).'%';
-				}
-				
-				//����������������� �������� �����:
-				if((int)$pl['magic_inci'] > 0)
-				{
-					$efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1'));
-					if(isset($efi['id2']) && $efi['actionTime']>0)
-					{
-						$is2 .= '<br>����������������� ��������: '.$this->timeOut($efi['actionTime']);
-					}
-				}
-				
-				//<b>��������� �����������:</b>
-				$tr = ''; $t = $this->items['tr'];
-				$x = 0;
-				while($x<count($t))
-				{
-					$n = $t[$x];
-					if(isset($po['tr_'.$n]) && $po['tr_'.$n] != 0)
-					{
-						if($po['tr_'.$n] > $this->stats[$n])
-						{
-							if( $n == 'rep' ) {
-								$temp = explode('::',$po['tr_'.$n]); 
-								if( $this->rep['rep'.$temp[1]] < $temp[0] ) { $tr .= '<font color="red">'; $notr++; } 
-								unset($temp);
-							} elseif( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-								$tr .= '<font color="red">'; $notr++;
-							}
-						}
-						$tr .= '<br>� ';
-						if( $n == 'rep' ) {
-							$temp = explode('::',$po['tr_'.$n]);
-							$tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0];
-							unset($temp);
-						}elseif( $n != 'align' ) {
-							if( $n == 'sex' ) {
-								if( $po['tr_'.$n] == 1 ) {
-									$tr .= $this->is[$n].': �������';
-								}else{
-									$tr .= $this->is[$n].': �������';
-								}
-							}else{
-								$tr .= $this->is[$n].': '.$po['tr_'.$n];
-							}
-						}else{
-							$tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]];
-						}
-						if($po['tr_'.$n] > $this->stats[$n])
-						{
-							if( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-								$tr .= '</font>';
-							}
-						}
-					}
-					$x++;
-				}
-				if($tr!='')
-				{
-					
-					$is2 .= '<br><b>��������� �����������:</b>'.$tr;
-				}
-				//<b>��������� ��:</b>
-				$tr = ''; $t = $this->items['add'];
-				$x = 0;
-				while($x<count($t))
-				{
-					$n = $t[$x];
-					if(isset($po['add_'.$n],$this->is[$n]))
-					{
-						$z = '+';
-						if($po['add_'.$n]<0)
-						{
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['add_'.$n];
-					}
-					$x++;
-				}
-				//��������� �� (�����)
-				$i = 1; $bn = array(1=>'������',2=>'�������',3=>'�����',4=>'���');
-				while($i<=4)
-				{
-					if(isset($po['add_mab'.$i]))
-					{
-						if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1)
-						{
-							$z = '+';
-							if($po['add_mab'.$i]<0)
-							{
-								$z = '';
-							}
-							$tr .= '<br>� ����� '.$bn[$i].': '.$z.''.$po['add_mab'.$i];
-						}else{
-							$tr .= '<br>� ����� '.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i];
-						}
-					}
-					$i++;
-				}
-				
-				if($tr!='')
-				{
-					$is2 .= '<br><b>��������� ��:</b>'.$tr;
-				}
-				//<b>�������� ��������:</b>
-				$tr = ''; $t = $this->items['sv'];
-				if(isset($po['sv_yron_min'],$po['sv_yron_max']))
-				{
-					$tr .= '<br>� ����: '.$po['sv_yron_min'].' - '.$po['sv_yron_max'];
-				}
-				$x = 0;
-				while($x<count($t))
-				{
-					$n = $t[$x];
-					if(isset($po['sv_'.$n]))
-					{
-						$z = '+';
-						if($po['sv_'.$n]<0)
-						{
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['sv_'.$n];
-					}
-					$x++;
-				}
-				if($pl['2too']==1)
-				{
-					$tr .= '<br>� ������ ������';
-				}
-				if($pl['2h']==1)
-				{
-					$tr .= '<br>� ��������� ������';
-				}
-				if(isset($po['zonb']))
-				{
-					$tr .= '<br>� ���� ������������: ';
-					if($po['zonb']>0)
-					{
-						$x = 1;
-						while($x<=$po['zonb'])
-						{
-							$tr .= '+';
-							$x++;
-						}
-					}else{
-						$tr .= '�';
-					}
-				}
-				if($tr!='')
-				{
-					$is2 .= '<br><b>�������� ��������:</b>'.$tr;
-				}
-				
-				//�����������
-				/*$tr = '';
-				$x = 1;
-				while($x<=4)
-				{
-					if($po['tya'.$x]>0)
-					{
-						$tyc = '�������� �����';
-						if($po['tya'.$x]>6)
-						{
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>14)
-						{
-							$tyc = '����';
-						}
-						if($po['tya'.$x]>34)
-						{
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>79)
-						{
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>89)
-						{
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>=100)
-						{
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-					}
-					$x++;
-				}
-				$x = 1;
-				while($x<=7)
-				{
-					if(@$po['tym'.$x]>0)
-					{
-						$tyc = '�������� �����';
-						if($po['tym'.$x]>6)
-						{
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>14)
-						{
-							$tyc = '����';
-						}
-						if($po['tym'.$x]>34)
-						{
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>79)
-						{
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>89)
-						{
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>=100)
-						{
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-					}
-					$x++;
-				}
-				if($tr!='')
-				{
-					$is2 .= '<br><b>�����������:</b>'.$tr;
-				}*/
-				
-				$tr = '';
-				
-				if(isset($po['imposed']) && $po['imposed']>0) {
-					if($po['imposed_lvl'] == 0) {
-						$rnc = 'maroon';
-					}elseif($po['imposed_lvl'] == 1) {
-						$rnc = '#624542';
-					}elseif($po['imposed_lvl'] == 2) {
-						$rnc = '#77090b';
-					}elseif($po['imposed_lvl'] == 3) {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['imposed_name'] = str_replace('���� ','',$po['imposed_name']); 
-					$tr .= '<br>&bull; <font color='.$rnc.'>�������� ��������:</font> '.$po['imposed_name'].' '; 
-					unset($rnc);
-				} 
-				if($tr!='') {
-					$is2 .= '<br><b>��������� ��������:</b>';
-					$is2 .= $tr;
-				}
-				
-				
-				if($notr==0)
-				{
-					$d[0] = 1;
-					if($pl['magic_inc']!='')
-					{
-						$d[2] = 1;
-					}
-				}
-				
-				if(isset($po['free_stats']) && $po['free_stats']>0)
-				{
-					$is2 .= '<br><b>������������� ������:</b><br>';
-					$is2 .= '&bull; ��������� �������������: +'.$po['free_stats'].' �������������';
-				}
-				
-				//���������� �����
-				if($pl['magic_inci']!='' || $pl['magic_inc']!='') {
-					if($pl['magic_inc'] == '') {
-						$pl['magic_inc'] = $pl['magic_inci'];
-					}
-					$mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$pl['magic_inc'].'" AND `type1` = "12345" LIMIT 1'));
-					if(isset($mgi['id2'])) {
-						$is2 .= '<div> �������� �������� <img height=18 title="'.$mgi['mname'].'" src="https://img.new-combats.com/i/eff/'.$mgi['img'].'"> '.$mgi['minfo'].'</div>';
-					}
-				}
-				
-				if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX']))
-				{
-					$d[0] = 0;
-					$d[2] = 0;
-				}
-				if(isset($po['complect']))
-				{
-					$is2 .= '<br><i>�������������� ����������:</i>';
-				}
-				if(isset($po['complect']))
-				{
-					//�� ������������
-					$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-					$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY  `x` ASC LIMIT 20');
-					while($plc = mysql_fetch_array($spc))
-					{
-						$com1['name'] = $plc['name'];
-						$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-						//�������� ���������
-						$i1c = 0; $i2c = 0;
-						$i1e = $this->lookStats($plc['data']);
-						while($i1c<count($this->items['add']))
-						{
-							if(isset($i1e[$this->items['add'][$i1c]]))
-							{
-								$i3c = $i1e[$this->items['add'][$i1c]];
-								if($i3c>0)
-								{
-									$i3c = '+'.$i3c;
-								}
-								if($i2c>0)
-								{
-									$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}else{
-									$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}								
-								$com1['text'] .= '<br>';
-								$i2c++;
-							}
-							$i1c++;
-						}
-						unset($i1c,$i2c,$i3c);
-						$com1['x']++;
-					}
-					$is2 .= '<br>&bull; ����� ���������: <b>'.$com1['name'].'</b><br><small>';
-					$is2 .= $com1['text'];
-					$is2 .= '</small>';
-				}
-				
-				if($pl['max_text']-$pl['use_text'] > 0) {
-					$is2 .= '<div>���������� ��������: '.($pl['max_text']-$pl['use_text']).'</div>';
-				}
-				
-				$is2 .= '<small style="">';
-				
-				if(isset($po['gravi'])) {
-					$is2 .= '<br>�� ����������� ������������� �������: <b>'.$po['gravi'].'</b>';
-				}
-				
-				if($pl['info']!='')
-				{
-					$is2 .= '<div><b>��������:</b></div><div>'.$pl['info'].'</div>';
-				}
-				
-				if($po['info']!='')
-				{
-					$is2 .= '<div>'.$po['info'].'</div>';
-				}
-								
-				if($pl['maidin']!='')
-				{
-				//	$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
-				}
-				
-				if(isset($po['noremont']))
-				{
-					$is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
-				}
-				
-				if(isset($po['nosale']))
-				{
-					$is2 .= '<div style="color:brown;">������� ������ �������</div>';
-				}
-				
-				if(isset($po['nomodif']))
-				{
-					$is2 .= '<div style="color:brown;">������� ������ ��������</div>';
-				}
-				
-				if(isset($po['nodelete']))
-				{
-					$is2 .= '<div style="color:brown;">������� ������ ���������</div>';
-				}
-				
-				if(isset($po['frompisher']) && $po['frompisher']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� �� ����������</div>';
-				}
-				
-				if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) {
-					$is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
-				}
-				
-				if(isset($po['fromlaba']) && $po['fromlaba']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� �� ���������</div>';
-				}
-				
-				if(isset($po['vip_sale']) && $po['vip_sale']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� ������ �� 10% �� ���������</div>';
-				}
-				
-				if($pl['dn_delete']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
-				}
-				
-				if( $this->pokol > $pl['geni'] ) {
-					$is2 .= '<div style="color:brown">������� �������</div>';
-				}	
-				
-				if(isset($po['zazuby']) && $po['zazuby']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
-				}
-				
-				//$is2 .= '<div>������� � '.$this->city_name[$this->info['city']].'</div>';
-				
-				$is2 .= '</small>';
-				
-				$crd = '';
-				
-				if($this->info['admin'] > 0) {
-					$crd = '<small><a href="javascript:window.open(\'https://new-combats.com/item_edit_data.php?edit_item_data='.$pl['id'].'\',\'winEdi1\',\'width=850,height=400,top=400,left=500,resizable=no,scrollbars=yes,status=no\');" target="_blank">������������� �������</a> &nbsp; <a href="https://new-combats.com/main.php?timeWorld='.microtime().'&otdel='.round((int)$_GET['otdel']).'#itmShop'.$pl['id'].'" name="itmShop'.$pl['id'].'">��������</a></small><br>';
-				}
-				
-				echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top"><span style="float:right">&nbsp;'.$crd.'</span>'.$is2.'</td></tr>';
-				$i++;
-			}
-			
-		}		
-		if($i==0)
-		{
-			echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
-		}
-	}
-	
-	public function price($vl)
-	{
-		if($vl==round($vl))
-		{
-			$vl = $vl.'.00';
-		}
-		$vl = explode('.',$vl);
-		$vl = $vl[0].'.<small>'.$vl[1].'</small>';
-		return $vl;
-	}
-	
-	public function testBagStats()
-	{
-		$st = $this->lookStats($this->info['stats']);
-		$n1 = $this->info['ability'];
-		$i = 1;
-		while($i<=10)
-		{
-			$n1 += $st['s'.$i];
-			$i++;
-		}
-		$n2 = $this->info['skills'];
-		$i = 1;
-		while($i<=7)
-		{
-			$n2 += $st['a'.$i]+$st['mg'.$i];
-			$i++;
-		}
-		
-		$n01 = 12;
-		$n02 = 1; $ll = 0;
-		$lvl = mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel` < "'.$this->info['upLevel'].'"');
-		while($pl = mysql_fetch_array($lvl))
-		{
-			$n01 += $pl['ability'];
-			$n02 += $pl['skills'];
-			if($ll<$pl['nextLevel'])
-			{
-				$n01 += 1; //�����
-				if($this->info['level']>=9)
-				{
-					$n01 += 1;
-				}
-				if($this->info['level']>=10)
-				{
-					$n01 += 2;
-				}
-				if($this->info['level']>=11)
-				{
-					$n01 += 4;
-				}
-				$ll++;
-			}			
-		}
-		
-		if($n1-$n01!=3 || $n2!=$n02)
-		{
-			if($this->info['bagStats']!=$bg)
-			{
-				$bg = '['.$n1.'|'.$n01.'|'.$n2.'|'.$n02.']';
-				mysql_query('UPDATE `stats` SET `bagStats` = "'.$bg.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->info['bagStats'] = $bg;
-			}
-		}else{
-			if($this->info['bagStats']!='0')
-			{
-				mysql_query('UPDATE `stats` SET `bagStats` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->info['bagStats'] = 0;
-			}
-		}
-	}
-	
-	public function wipe()
-	{
-		if($this->info['wipe']>0 && $this->info['battle']==0)
-		{
-			//wipe = 1 , ������ �������� ����� � ������
-			if($this->info['wipe']<4)
-			{
-				$st = $this->lookStats($this->info['stats']);
-				$n1 = $this->info['ability']; //�����������
-				$n2 = $this->info['skills']; //�������� ������ � �������
-				$n3 = $this->info['sskills']; //�����������
-				$n4 = $this->info['nskills']; //???
-				if($this->info['wipe']==1 || $this->info['wipe']==2)
-
-				{
-					$i = 1;
-					while($i<=11)
-					{					
-						if($i<=4)
-						{
-							$n1 += $st['s'.$i]-3;
-							$st['s'.$i] = 3;
-						}else{
-							$n1 += $st['s'.$i];
-							$st['s'.$i] = 0;
-						}
-						$i++;
-					}
-					$n1 -= $this->info['level'];
-					$st['s4'] = 3+$this->info['level'];
-					if($this->info['level']>=9)
-					{
-						$st['s4'] += 1;
-						$n1 -= 1;
-					}
-					if($this->info['level']>=10)
-					{
-						$st['s4'] += 2;
-						$n1 -= 2;
-					}
-					if($this->info['level']>=11)
-					{
-						$st['s4'] += 4;
-						$n1 -= 4;
-					}
-				}
-				
-				if($this->info['wipe']==1 || $this->info['wipe']==3)
-				{
-					$i = 1;
-					while($i<=7)
-					{
-						$n2 += $st['a'.$i];
-						$n2 += $st['mg'.$i];
-						$st['a'.$i]  = 0;
-						$st['mg'.$i] = 0;
-						$i++;
-					}
-				}
-				if($this->info['wipe']==1 || $this->info['wipe']==3.5)#---����� ������������
-				{
-					$i = 1;
-					while($i<=11)
-					{
-					$n3 += $st['os'.$i];
-					$st['os'.$i] = 0;
-					$i++;
-					}
-				}
-				//��������� ������
-				$st = $this->impStats($st);
-				$upd = mysql_query('UPDATE `stats` SET `wipe`="0",`stats`="'.$st.'",`ability`="'.$n1.'",`skills`="'.$n2.'",`sskills`="'.$n3.'",`nskills`="'.$n4.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');		
-				if($upd)
-				{
-					$this->info['stats'] = $st;
-					$this->info['ability'] = $n1;
-					$this->info['skills'] = $n2;
-					$this->info['sskills'] = $n3;
-					$this->info['nskills'] = $n4;
-				}					
-			}
-		}
-	}
-	
-	public function __clone()
-	{
-		trigger_error('������������ �� �����������.', E_USER_ERROR);
-	}
-	
-	//������� ���������� �������� ��� ��� �������������
-	public function trItem($po)
-	{
-		$tr = ''; $t = $this->items['tr'];
-		$x = 0; $notr = 0;
-		while($x<count($t))
-		{
-			$n = $t[$x];
-			if(isset($po['tr_'.$n]))
-			{
-				if( $n == 'sex' ) {
-					if( $this->info['sex'] != $po['tr_'.$n] ) {
-						$notr++;
-					}
-				}elseif($po['tr_'.$n] > $this->stats[$n] && $n != 'align')
-				{
-					$notr++;
-				}
-			}
-			$x++;
-		}
-		return $notr;
-	}
-	
-	public function freeStatsMod($id,$s,$uid)
-	{
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-		if(isset($itm['id']))
-		{
-			$po = $this->lookStats($itm['data']);
-/*
-		mf_stats
-		mf_mod
-		mf_mib
-*/
-			//�����
-			if($_GET['mf'] == 's1' || $_GET['mf'] == 's2' || $_GET['mf'] == 's3' || $_GET['mf'] == 's5') {
-				if(isset($po['mf_stats']) && $po['mf_stats']>0 && isset($po['add_'.$_GET['mf']])) {
-					$po['mf_stats'] = (int)$po['mf_stats'];
-					$po['mf_stats'] -= 1;
-					$po['add_'.$_GET['mf']] += 1;		
-					
-					$po = $this->impStats($po);				
-					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-			}elseif($_GET['mf'] == 'm1' || $_GET['mf'] == 'm2' || $_GET['mf'] == 'm4' || $_GET['mf'] == 'm5') {
-				if(isset($po['mf_mod']) && $po['mf_mod']>0 && isset($po['add_'.$_GET['mf']])) {
-					$po['mf_mod'] = (int)$po['mf_mod'];
-					$po['mf_mod'] -= 1;
-					$po['add_'.$_GET['mf']] += 1;		
-					
-					$po = $this->impStats($po);				
-					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-			}elseif($_GET['mf'] == 'mib1' || $_GET['mf'] == 'mib2' || $_GET['mf'] == 'mib3' || $_GET['mf'] == 'mib4') {
-				$s = $_GET['mf'];
-				$s = str_replace('mib','',$s);
-				$s = (int)$s;
-				if(isset($po['mf_mib']) && $po['mf_mib']>0 && (isset($po['add_mib'.$s]) || isset($po['add_mab'.$s]))) {
-					$po['mf_mib'] = (int)$po['mf_mib'];
-					$po['mf_mib'] -= 1;
-					if(isset($po['add_mab'.$s])) {
-						$po['add_mab'.$s] += 1;	
-					}
-					if(isset($po['add_mib'.$s])) {
-						$po['add_mib'.$s] += 1;	
-					}
-					
-					$po = $this->impStats($po);				
-					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-			}
-			
-		}
-	}
-	
-	public function freeStatsItem($id,$s,$uid)
-	{
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-		if(isset($itm['id']) && ( $s == 1 || $s == 2 || $s == 3 || $s == 5 ) )
-		{
-			$po = $this->lookStats($itm['data']);
-			if(isset($po['free_stats']) && $po['free_stats']>0)
-			{
-				$s = (int)$s;
-				if($s>=1 || $s<=3 || $s==5)
-				{
-					$po['free_stats'] = (int)$po['free_stats'];
-					$po['free_stats'] -= 1;
-					$po['add_s'.$s] += 1;
-				}
-			}
-			$po = $this->impStats($po);
-			
-			mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-		}
-	}
-	
-	public function freeStats2Item($id,$s,$uid,$tp)
-	{
-
-			$itm = mysql_fetch_array(mysql_query('SELECT
-			`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-			`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-			FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-			if(isset($itm['id']))
-			{
-				$po = $this->lookStats($itm['data']);
-				if($itm['so'] > 0)
-				{
-					$s = (int)$s;
-					if($tp == 1) {
-						//�����
-						if($s == 1 || $s == 2 || $s == 3 || $s == 5) {
-							if(10+25*$po['add_s'.$s] <= $itm['so'] && $itm['so'] > 0) {
-								$itm['so'] -= 10+25*$po['add_s'.$s];
-								$po['add_s'.$s]++;
-								$this->error = '�������������� ��������...';
-							}else{
-								$this->error = '�� ������� ����� ��������...';
-							}
-						}
-					}elseif($tp == 2) {
-						//��
-						if($s > 0 && $s < 13) {
-							$s2 = 0;							
-							if($s == 9 || $s == 12) {
-								if($s == 9) {
-									$s = 'm10';
-								}elseif($s == 12) {
-									$s = 'zm';
-								}
-								$s2 = 4+4*$po['add_'.$s];
-							}else{
-								if($s == 1) {
-									$s = 'm1';
-								}elseif($s == 2) {
-									$s = 'm2';
-								}elseif($s == 3) {
-									$s = 'm4';
-								}elseif($s == 4) {
-									$s = 'm5';
-								}elseif($s == 5) {
-									$s = 'mab1';
-								}elseif($s == 6) {
-									$s = 'mab2';
-								}elseif($s == 7) {
-									$s = 'mab3';
-								}elseif($s == 8) {
-									$s = 'mab4';
-								}elseif($s == 10) {
-									$s = 'za';
-								}elseif($s == 11) {
-									$s = 'm11a';
-								}
-								$s2 = 5+5*$po['add_'.$s];
-							}
-							
-							if(4+4*$po['add_'.$s] <= $itm['so'] && $itm['so'] > 0) {
-								$itm['so'] -= $s2;
-								if($s=='mab1') {
-									$po['add_mib1']++;
-								}elseif($s=='mab2') {
-									$po['add_mib2']++;
-								}elseif($s=='mab3') {
-									$po['add_mib3']++;
-								}elseif($s=='mab4') {
-									$po['add_mib4']++;
-								}
-								$po['add_'.$s]++;
-							}else{
-								$this->error = '�� ������� ����� ��������...';
-							}
-						}
-					}
-				}
-				$po = $this->impStats($po);
-				mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`so` = "'.$itm['so'].'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-			}
-	}
-
-	public function obj_addItem($id){
-		$itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1'));
-		if( $this->info['transfers'] < 1 ) {
-			$this->error = '�� ������� ����� ������� ��������.';
-		}elseif(isset($itm['id'])){
-			if( isset($itm['inGroup']) AND $itm['inGroup'] > 0 ) {
-				$col = $this->itemsX($itm['id']);
-				if($col > 1){
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `item_id`="'.$itm['item_id'].'" AND `inShop` != "30" AND `uid`="'.$itm['uid'].'" AND `inGroup` = "'.$itm['inGroup'].'" LIMIT '.$col.'');
-				} else {
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `uid` = "'.$this->info['id'].'" AND `inShop` != "30" AND `id` = "'.$itm['id'].'" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			} else {
-				$upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `uid` = "'.$this->info['id'].'" AND `inShop` != "30" AND `id` = "'.$id.'" AND `inOdet` = "0" AND `delete` = "0" ');
-			} 
-			if($upd) { /*
-				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
-				$this->info['transfers']--;
-				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->error = '������� &quot;'.$itm['name'].''.$col.'&quot; ��������� �� ���������';
-				*/
-			}
-		} else {
-			$this->error = '������� �� ������ � �������';	
-		}
-	}
-	
-	public function obj_takeItem($id){
-		$itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1'));
-		if( $this->info['transfers'] < 1 ) {
-			$this->error = '�� ������� ����� ������� ��������.';
-		}elseif(isset($itm['id'])){
-			if( isset($itm['inGroup']) && $itm['inGroup'] > 0 ) {
-				$col = $this->itemsX($itm['id']);
-				if($col > 1){
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND ( `id` = "'.$itm['id'].'" OR `inGroup` = "'.$itm['inGroup'].'") AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" ');
-				} else {
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$itm['id'].'" AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			} else {
-				$upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$id.'" AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" ');
-			}
-			if($upd){ /*
-				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
-				$this->error = '������� &quot;'.$itm['name'].''.$col.'&quot; ��������� � ���������';
-				$this->info['transfers']--;
-				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				*/
-			}
-		}else{
-			$this->error = '������� �� ������ � �������';	
-		}
-	}
-	
-	public function itemsSmSave($id,$s,$uid){
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-		if(isset($itm['id']))
-		{
-			$s = (int)$s;
-			$po = $this->lookStats($itm['data']);
-			if(!isset($po['sudba']) || $po['sudba']!='0')
-			{
-				if(isset($po['sm_skill']) && $s>100)
-				{
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7)
-					{
-						$mx1 += ($mx3['a'.$mx2]+$mx3['mg'.$mx2])-($po['add_a'.$mx2]+$po['add_mg'.$mx2]);
-						$mx2++;
-					}
-					$mx1 += $this->info['skills'];
-					if($mx1>0)
-					{
-						//������
-						$s = $s - 100;
-						if($s>5 && $s<=12)
-						{
-							//�����
-							$po['add_mg'.($s-5)]++;						
-						}elseif($s>0)
-						{
-							//������
-							$po['add_a'.$s]++;
-						}
-					}
-				}elseif(isset($po['sm_abil']) && $s<11 && $s>0)
-				{
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7)
-					{
-						$mx1 += $mx3['s'.$mx2]-$po['add_s'.$mx2];
-						$mx2++;
-					}
-					$mx1 += $this->info['ability'];
-					if($mx1>0)
-					{
-						$po['add_s'.$s]++;
-					}
-				}
-				
-				$po = $this->impStats($po);
-				mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				
-				unset($mx1,$mx2,$mx3,$po);
-			}
-		}
-	}
-	
-	public function runeItem($id,$name,$ruid) {
-		
-		if($id == NULL) {
-			
-			if($ruid < 1 && isset($_GET['use_rune'])) {
-				$ruid = $_GET['use_rune'];
-				echo "
-				<script language='JavaScript'>
-				var elem = document.getElementById('se-pre-con');
-				elem.parentNode.removeChild(elem);
-				</script>
-				";
-			}
-			$rune = mysql_fetch_array(mysql_query('SELECT 
-			`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-			,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE
-			`i`.`id` = "'.mysql_real_escape_string($ruid).'"			
-			AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
-			
-			$it_type = 0;
-			if(isset($_GET['item_rune'])) {
-				$name = $_GET['item_rune'];
-			}
-			$vi = 0;
-			$vid = '';
-			if( isset($_GET['item_rune_id']) ) {
-				$sp = mysql_query('SELECT
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`type`,`m`.`2h`,`m`.`inslot`,`m`.`name`,`m`.`img` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON (`i`.`item_id` = `m`.`id`)
-					WHERE `i`.`inShop` = "0" AND
-					
-					( (`m`.`inslot` > 0 AND `m`.`inslot` < 18) OR "'.$rune['type'].'" = "37" OR `m`.`inslot` = "51" )
-					
-				AND `i`.`delete` = "0" AND `i`.`inOdet` = "0" AND `i`.`id` = "'.mysql_real_escape_string($_GET['item_rune_id']).'" AND `i`.`uid` = "'.mysql_real_escape_string($this->info['id']).'"');
-				$vi = -1;
-			}else{
-				$sp = mysql_query('SELECT
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`type`,`m`.`2h`,`m`.`inslot`,`m`.`name`,`m`.`img` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON (`i`.`item_id` = `m`.`id`)
-				
-					WHERE	
-							
-				( (`m`.`inslot` > 0 AND `m`.`inslot` < 18) OR "'.$rune['type'].'" = "37" OR `m`.`inslot` = "51" ) AND
-				
-				`i`.`inShop` = "0" AND `i`.`delete` = "0" AND `i`.`inOdet` = "0" AND `m`.`name` LIKE "%'.mysql_real_escape_string(str_replace('"','&quot;',$name)).'%" AND `i`.`uid` = "'.mysql_real_escape_string($this->info['id']).'"');
-			}
-			while($pl = mysql_fetch_array($sp)) {
-				$vibor .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><hr>';
-				if(!isset($id['id'])) {
-					//if($pl['type']!=4 && $pl['type']!=2 && $pl['type']!=7 ) {
-						$dt = $this->lookStats($pl['data']);
-						$id = array();
-						$id = $pl;	
-						$id_type = $pl['type'];
-					//}
-				}
-				if( $vi != -1 ) {
-					$vi++;
-					$vid .= '`iu`.`id` = "'.$pl[0].'" OR';
-				}
-			}
-		}
-		
-		if( $vi > 0 ) {
-			$itm_inv = $this->genInv(80,' '.rtrim($vid,'OR').' ');
-			echo '<button style="float:right" class="btn" type="button" onclick="top.frames[\'main\'].location=\'main.php?inv=1&otdel='.floor($_GET['otdel']).'\'">���������</button><b>�������� ������� ��� ������������� &quot;'.$rune['name'].'&quot;:</b><br><br><table width="100%" border="0" cellspacing="1" align="center" cellpadding="0" bgcolor="#A5A5A5">'.$itm_inv[2].'</table>';
-			die();
-		}else{
-			unset($rune);
-		}
-
-		if($id['id'] > 0) {	
-		
-			if($ruid < 1 && isset($_GET['use_rune'])) {
-				$ruid = $_GET['use_rune'];
-			}
-			
-			$idtrue = false;
-			
-			$rune = mysql_fetch_array(mysql_query('SELECT 
-			`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-			,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($ruid).'" AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
-			if($rune['level'] > $this->info['level'] && $rune['type']==31) {
-				$this->error = '� ��� ������� ��������� ������� ����� ������������ ��� ����';
-			}elseif($rune['type']==31 ) {
-				//���������� ����
-				if( $idt['type'] == 7 ){ $idt['type'] = 6; }
-				if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-				if( $idt['type'] == 4 ){ $idt['type'] = 6; }
-				$data = $this->lookStats($id['data']);
-				$type_rune = array(
-					'��' => 9, //������
-					'��' => 10, //��������
-					'��' => 11, //������
-					'��' => 12, //��������
-					'��' => 14, //������
-					'��' => 15, //�����
-					'��' => 1, //����
-					'��' => 3, //������
-					'��' => 6, //�����
-					'��' => 8  //����
-				);
-				if( $rune['type'] == 5 ) {
-					$type_rune['��'] = 5;
-				}
-				//
-				//$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-				//if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-				//$id['type'] = $idt['type'];
-				//
-				$type_rune = $type_rune[substr($rune['name'], -2, 2)];
-				if( $type_rune != $id['type'] && $type_rune != '' ) {
-					$type_rune2 = array(
-						'��' => '������', //������
-						'��' => '��������', //��������
-						'��' => '������', //������
-						'��' => '��������', //��������
-						'��' => '������', //������
-						'��' => '�����', //�����
-						'��' => '����', //����
-						'��' => '������', //������
-						'��' => '�����', //�����
-						'��' => '����'  //����
-					);
-					$this->error = '�������� ������ ���� �������� ������ � '.$type_rune2[substr($rune['name'], -2, 2)].' (��� ��������: '.$id['type'].'. ��������� ���: '.$type_rune.')';
-				}elseif(isset($data['nomodif'])) {
-					$this->error = '�������� ������ ������� ����������';
-				}elseif(isset($data['art']) && $data['tr_lvl'] < 0) {
-					$this->error = '����������� �������� � ��������� ���� 10-�� ������ ����������';
-				}else{
-					if(isset($data['rune']) && $data['rune'] > 0) {
-						$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['rune_id'].'" LIMIT 1'));
-						$j = 0;
-						$data_r = $this->lookStats($ritm['data']);
-						while($j < count($this->items['add'])) {
-							if(isset($data_r['add_'.$this->items['add'][$j]])) {
-								$data['add_'.$this->items['add'][$j]] -= $data_r['add_'.$this->items['add'][$j]];
-							}
-							$j++;
-						}
-					}
-					$data['rune'] = $rune['id'];
-					$data['rune_id'] = $rune['item_id'];
-					$data['rune_name'] = $rune['name'];
-					$data['rune_lvl'] = $rune['level'];
-					//��������� �������������� ����
-					$add = $this->lookStats($rune['data']);
-					$i = 0;
-					while($i<count($this->items['add'])) {
-						if(isset($add['add_'.$this->items['add'][$i]])) {
-							$data['add_'.$this->items['add'][$i]] += $add['add_'.$this->items['add'][$i]];
-						}
-						$i++;
-					}
-					//if( $rune['level'] > $data['tr_lvl'] ) {
-					//	$data['tr_lvl'] = $rune['level'];
-					//}
-					$data = $this->impStats($data);
-					mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-					mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-					
-					
-					
-					
-					
-					$this->error = '����������� ���� ������ �������';
-				}
-			}else{
-				$rune = mysql_fetch_array(mysql_query('SELECT 
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`name`,`m`.`level`,`m`.`type` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($ruid).'" AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
-				if(!isset($rune['id'])) {
-					$this->error = '�������� ������� �� ������������ �� �������';
-				}elseif($rune['type']==62) {
-					
-					$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-					if( $idt['type'] == 7 ){ $idt['type'] = 6; }
-					if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-					if( $idt['type'] == 4 ){ $idt['type'] = 6; }
-					//$id['type'] = $idt['type'];
-					//���������� ���� 
-					$data = $this->lookStats($id['data']);
-					$add = $this->lookStats($rune['data']);				
-					if(isset($data['nomodif'])) {
-						$this->error = '�������� ������ ������� ����������';
-					}elseif(isset($data['art']) && $data['tr_lvl'] < 0) {
-						$this->error = '����������� �������� � ��������� ���� 10-�� ������ ����������';
-					}elseif(isset($add['onimposed'])) {
-						//���������� �����
-						//����� �����
-						$i = 0; $j = 0;
-						$utp = explode(',',$add['onItemType']);
-						while($i<count($utp)) {
-							if($utp[$i] == $id['type']){
-								$j++;
-							}
-							$i++;
-						}
-						if( $j > 0 ) {
-							
-							unset($data['imposed'],$data['imposed_name'],$data['bm_a1']);
-							
-							$imposed = array(
-								'imposed' => 1,
-								'imposed_name' => $add['onSpellName'],
-								'bm_a1' => $add['onSpellFile']
-							);
-							
-							if(!isset($add['onSpellFile'])) {
-								unset($imposed['bm_a1']);
-								//
-								if(isset($add['onSpell_mpAll'])) {
-									$imposed['addspell_mpAll'] = $add['onSpell_mpAll'];
-									$imposed['add_mpAll'] = $data['add_mpAll'] + $add['onSpell_mpAll'] - $data['addspell_mpAll'];
-								}
-								//
-							}
-							
-							$imposed['sudba'] = 1;
-														
-							$data = array_merge($data, $imposed); 
-							$data = $this->impStats($data);
-			
-							mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							$this->error = '�������� ���� "'.$add['onSpellName'].'" �� ������� &quot;'.$id['name'].'&quot;';
-						}else{
-							$this->error = '������� &quot;'.$id['name'].'&quot; �� �������� ��� ��������.,.';
-						}
-					}else{
-						if(isset($data['spell']) && $data['spell'] > 0) {
-							//�������� ������ �� ������� �����
-							$litm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$id['item_id'].'" LIMIT 1'));
-							
-							$data_l = $this->lookStats($litm['data']);
-							$pvr = array(
-								'i' => 0,
-								'spell' => array(),
-								'rune'	=> array(),
-								'atack'	=> array(),
-								'podgon'=> array()
-							);
-							
-							if( isset($data['podgon']) ) {
-								if($data['tr_lvl'] > $id['level']) {
-									$id['level'] = $data['tr_lvl'];
-								}
-								$pvr['podgon']['hpAll'] = 6*$id['level']+6;
-							}
-							if( isset($data['addspell_hpAll']) ) {
-								$pvr['podgon']['hpAll'] += $data['addspell_hpAll'];
-							}
-							if( isset($data['rune_id']) && $data['rune_id'] > 0 ) {
-								$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['rune_id'].'" LIMIT 1'));
-								$j = 0;
-								$data_r = $this->lookStats($ritm['data']);
-								while($j < count($this->items['add'])) {
-									if(isset($data_r['add_'.$this->items['add'][$j]])) {
-										$pvr['rune'][$this->items['add'][$j]] = $data_r['add_'.$this->items['add'][$j]];
-									}
-									$j++;
-								}
-							}
-							
-							if(isset($data['spell_st_val_hp'])) {
-								$data['add_hpAll'] -= $data['spell_st_val_hp'];
-							}
-							
-							//$i = 0;
-							//while( $i < count($data)) {
-							if( !isset($data['spell_st_name']) ) {
-								$delk = count($this->items['add']);
-								$this->items['add'][] = 'mib1';
-								$this->items['add'][] = 'mib2';
-								$this->items['add'][] = 'mib3';
-								$this->items['add'][] = 'mib4';								
-								$this->items['add'][] = 'mab1';
-								$this->items['add'][] = 'mab2';
-								$this->items['add'][] = 'mab3';
-								$this->items['add'][] = 'mab4';
-								$j = 0;
-								while($j < count($this->items['add'])) {
-									if(isset($data['add_'.$this->items['add'][$j]])) {
-										if( $data_l['add_'.$this->items['add'][$j]] != $data['add_'.$this->items['add'][$j]] - $pvr['rune'][$this->items['add'][$j]] - $pvr['podgon'][$this->items['add'][$j]] ) {									
-											//echo ''.$this->items['add'][$j].' -> '.$data_l['add_'.$this->items['add'][$j]].' / '.$data['add_'.$this->items['add'][$j]].'<br>';
-											if(!isset($data_l['add_'.$this->items['add'][$j]])) {
-												unset($data['add_'.$this->items['add'][$j]]);
-											}else{
-												$data['add_'.$this->items['add'][$j]] = $data_l['add_'.$this->items['add'][$j]];
-											}
-										}
-									}
-									$j++;
-								}
-								$i = 0;
-								while( $i < 8 ) {
-									unset($this->items['add'][$delk+$i]);
-									$i++;
-								}
-								//$i++;
-							//}
-							}							
-						}
-						//����� �����
-						$i = 0;
-						$utp = explode(',',$add['onItemType']);
-						while($i<count($utp)) {
-							if($utp[$i] == $id['type']){
-								// ���������� ������ ��� ������.
-								$itm_twohand = mysql_fetch_array(mysql_query('SELECT `2h` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT 1'));
-								if(isset($itm_twohand['2h']) && $itm_twohand['2h']==1) $tw = '2'; else $tw = '';
-								$j = 0;
-								while($j<count($this->items['add'])) {
-									if(isset($add[$tw.'add'.$utp[$i].'_'.$this->items['add'][$j]])) {									
-										$rnda[count($rnda)] = $this->items['add'][$j];
-									}
-									$j++;
-								}
-
-								if( isset($add['imposed']) && $add['imposed'] != '' ) {
-									$imposed = array(
-										'imposed'=>'1', // �������
-										'imposed_id'=>$rune['id'], // ID ����� ������
-										'imposed_name'=>$rune['name'], // ������������ ���, ������� ������������ �� ��������
-										'imposed_level'=>$rune['level'], // ���� ��������� ���������� ��� �����������. �� ���������: 0;
-										'bm_a1'=>$add['imposed'], // ��� ����� ����������.
-										'sudba'=>$this->info['login'] // ���� ��������� ���������� ��� �����������. �� ���������: 0;
-									);
-									if( isset($add['imposed_name']) ) $imposed['imposed_name']=$add['imposed_name'];
-									if( isset($add['imposed_level']) ) $imposed['imposed_level']=$add['imposed_level'];
-									$rnda[0] = 1;
-								}
-								if( count($rnda) >= 0 ) {
-									$rnda = $rnda[rand(0,count($rnda)-1)];
-									if( $rnda == 'mib1' || $rnda == 'mib2' || $rnda == 'mib3' || $rnda == 'mib4' ) {
-										$rnda = str_replace('mib','mab',$rnda);
-									}
-									
-									if( !isset($this->is[$rnda]) && isset($imposed) ){
-										$data = array_merge($data, $imposed); 
-										$data = $this->impStats($data);
-		
-										mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-										mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-										$this->error = '�������� ���� "'.$imposed['imposed_name'].'" �� ������� &quot;'.$id['name'].'&quot;';
-										
-									} elseif( !isset($this->is[$rnda])
-										&& $rnda != 'mib1' && $rnda != 'mib2' && $rnda != 'mib3' && $rnda != 'mib4'
-										&& $rnda != 'mab1' && $rnda != 'mab2' && $rnda != 'mab3' && $rnda != 'mab4'
-									) {
-										$this->error = '���������� �������� ������� �����. ( '.$rnda.' )';
-									} else {
-										$data['add_'.$rnda] += $add[$tw.'add'.$utp[$i].'_'.$rnda];
-										if( $rnda == 'mab1' || $rnda == 'mab2' || $rnda == 'mab3' || $rnda == 'mab4' ) {
-											$data['add_'.str_replace('mab','mib',$rnda)] += $add[$tw.'add'.$utp[$i].'_'.$rnda];
-										}
-										/*$jkh = 1;
-										while( $jkh <= 4 ) {
-											if($rnda == 'mib'.$jkh) {
-												$data['add_mab'.$jkh] += $add['add'.$utp[$i].'_'.$rnda];
-											}elseif($rnda == 'mab'.$jkh) {
-												$data['add_mib'.$jkh] += $add['add'.$utp[$i].'_'.$rnda];
-											}
-											$jkh++;
-										}*/
-											
-										$data['spell'] = $rune['id'];
-										if( !isset($data['sudba']) ) {
-											$data['sudba'] = '0';
-										}
-											
-										if( isset($data['spell_st_name']) ) {
-											$data['add_' . $data['spell_st_name']] -= $data['spell_st_val'];
-											if( $data['spell_st_name'] == 'mab1' || $data['spell_st_name'] == 'mab2' || $data['spell_st_name'] == 'mab3' || $data['spell_st_name'] == 'mab4' ) {
-												$data['add_'.str_replace('mab','mib',$data['spell_st_name'])] -= $data['spell_st_val'];
-											}
-											/*$jkh = 1;
-											while( $jkh <= 4 ) {
-												if( $data['spell_st_name'] == 'mib'.$jkh ) { 
-													$data['add_' . str_replace('mib','mab',$data['spell_st_name'])] -= $data['spell_st_val'];
-												}elseif( $data['spell_st_name'] == 'mab'.$jkh ) { 
-													$data['add_' . str_replace('mab','mib',$data['spell_st_name'])] -= $data['spell_st_val'];
-												}
-												$jkh++;
-											}*/
-											if( $data['add_' . $data['spell_st_name']] == 0 ) {
-												unset($data['add_' . $data['spell_st_name']]);
-											}
-											//die('������� ��������: '.$data['spell_st_name'].' +'.$data['spell_st_val'].'<br>���������� �����...');
-										}
-											
-										$data['spell_id'] = $rune['item_id'];
-										$data['spell_name'] = $rune['name'];
-										$data['spell_lvl'] = $rune['level'];
-										$data['spell_st_name'] = $rnda;
-										$data['spell_st_val'] = $add[$tw.'add'.$utp[$i].'_'.$rnda];	
-										if(isset($add['addspell_hpAll'])) {
-											$data['spell_st_val_hp'] = $add['addspell_hpAll'];
-											$data['add_hpAll'] += $add['addspell_hpAll'];
-										}else{
-											unset($data['spell_st_val_hp']);
-										}
-										$data = $this->impStats($data);	
-										
-										$this->is['mab1'] = '����� ������';
-										$this->is['mab2'] = '����� �������';
-										$this->is['mab3'] = '����� �����';
-										$this->is['mab4'] = '����� ���';
-										$this->error = '��������� �������������� �������� &quot;'.$id['name'].'&quot;, '.$this->is[$rnda].': +'.$add[$tw.'add'.$utp[$i].'_'.$rnda];
-										
-										//$this->error = '<br/><br/><br/>��������� �������������� �������� &quot;'.$id['name'].'&quot;, '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."<br/><br/>$:".$idt['2h']."<";
-		
-										unset($this->is['mab1'],$this->is['mab2'],$this->is['mab3'],$this->is['mab4']);
-		
-										mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-										mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-									}
-								}else{
-									$this->error = '���-�� �� ���, ���������� ���������� ������ �������';
-								}
-								$i = 100499;
-							}
-							$i++;
-						}
-						if($i < 100500) {
-							$this->error = '������ ������� �� �������� ��� �����������...';
-						}					
-					}
-					
-				} elseif($rune['type']==47) {
-					$add = $this->lookStats($id['data']);
-					$data = $this->lookStats($rune['data']);
-					if($add['art'] ==1) {
-				      if($id['iznosNOW'] > 0) {
-						$id['iznosNOW'] -= $data['repairLevel'];
-						if($id['iznosNOW'] < 0) { $id['iznosNOW'] = 0; }
-						mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$id['iznosNOW'].'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'"  LIMIT 1');
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-						$this->error = '������� '.$id['name'].' ������� ��������������.';
-					  } else {
-						$this->error = '������� �� ���������� � �������...';
-					  }
-					} else {
-					  $this->error = '������ ����������� ������ ���������...';
-					}
-				} elseif($rune['type']==46) {
-					$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-					if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-					$id['type'] = $idt['type'];
-					if($id_type < 18 || $id_type > 24) {
-						$add = $this->lookStats($rune['data']);
-						if( isset($add['uptimeitem']) ) {
-							$data = $this->lookStats($id['data']);
-							if( $data['srok'] > 0 || $id['srok'] > 0 ) {
-								if( !isset($data['srok']) ) {
-									$data['srok'] = $id['srok'];
-								}
-								if( $data['srok'] + $id['time_create'] - time() > 86400 + 30 ) {
-									$this->error = '������ ������������ �� �������� � ������ �������� 30 � ����� ����.';
-								}elseif( $id['inslot'] > 0 && $id['inslot'] < 20 ) {
-									$this->error = '���� �������� �������� &quot;'.$id['name'].'&quot; ������� �� '.$this->timeOut($add['uptimeitem']).'.';
-									
-									if( isset($data['sleep_moroz']) ) {
-										unset($data['sleep_moroz']);
-									}
-									
-									$data = $this->impStats($data);	
-									
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-									mysql_query('UPDATE `items_users` SET `data` = "'.$data.'",`time_create` = `time_create` + '.floor($add['uptimeitem']).' WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-
-								}else{
-									$this->error = '������� ������� ���� ������ ��������...';
-								}
-							}else{
-								$this->error = '��� �������� ������ �� �������� � ������ ��������...';
-							}
-						}else{
-							$this->error = '���������� ����� ������ ������...';
-						}
-					}else{
-						//�������
-						$data = $this->lookStats($id['data']);
-						$add = $this->lookStats($rune['data']);
-						if(isset($data['upatack_id'])) {
-							$this->error = '������� ��� �������, �������� ������� � ��������� ����������.';
-						}elseif(isset($data['nomodif'])) {
-							$this->error = '�������� ������ ������� ����������';
-						}elseif($add['uptype'] != $id_type || $add['uptype'] == 0) {
-							$this->error = '������� �� �������� � ������� ��������...';
-						}else{
-							
-							if(isset($data['upatack_id']) && $data['upatack_id'] > 0) {
-								$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['upatack_id'].'" LIMIT 1'));
-								$data_r = $this->lookStats($ritm['data']);
-								if( $id_type == 22 ) {
-									$data['add_m11'] -= $data_r['upatack']; //*2
-									$data['sv_yron_min'] -= $data_r['upatack'];
-									$data['sv_yron_max'] -= $data_r['upatack'];
-								}elseif( $id['2h'] == 1 ) {
-									$data['sv_yron_min'] -= $data_r['upatack']; //*2
-									$data['sv_yron_max'] -= $data_r['upatack']; //*2
-								}else{
-									$data['sv_yron_min'] -= $data_r['upatack'];
-									$data['sv_yron_max'] -= $data_r['upatack'];
-								}
-							}
-							$data['upatack'] = $rune['id'];
-							$data['upatack_id'] = $rune['item_id'];
-							$data['upatack_name'] = $rune['name'];
-							$data['upatack_lvl'] = $add['upatack'];
-							$data['upatack_lvl'] = $add['upatack'];
-							if(!isset($data['base_price1'])) {
-								//$data['base_price1'] = $id['1price'];
-								//$data['base_price2'] = $id['2price'];
-							}
-
-							//��������� �������������� ����						
-							$i = 0;
-							while($i<count($this->items['add'])) {
-								if(isset($add['add_'.$this->items['add'][$i]])) {
-									$data['add_'.$this->items['add'][$i]] += $add['add_'.$this->items['add'][$i]];
-								}
-								$i++;
-							}
-							
-							if( $id_type == 22 ) {
-								/*if (isset($add['add_m11']))
-								{
-									$data['add_m11'] += $add['add_m11'];
-								}*/
-								$data['sv_yron_min'] += $add['upatack'];
-								$data['sv_yron_max'] += $add['upatack'];
-								//print_r($data);
-								//die('������ �������� �� �������.');
-							}elseif( $id['2h'] == 1 ) {
-								$data['sv_yron_min'] += $add['upatack'];
-								$data['sv_yron_max'] += $add['upatack'];
-							}else{
-								$data['sv_yron_min'] += $add['upatack'];
-								$data['sv_yron_max'] += $add['upatack'];
-							}
-							
-							if( !isset($add['nosale']) && !isset($add['frompisher']) ) {
-								//$id['1price'] = $data['base_price1']+$rune['1price'];	
-								//$id['2price'] = $data['base_price2']+$rune['2price'];
-							}
-							
-							$this->addDelo(2,$this->info['id'],'&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: ������� &quot;'.$data['upatack_name'].'&quot; ���� ������� <b>��������</b> � ������� &quot;'.$id['name'].'&quot; [itm:'.$id['id'].']',time(),$this->info['city'],'System.remont.upatack',0,0);
-					
-							
-							$data = $this->impStats($data);
-													
-							mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `items_users` SET `1price` = "'.$id['1price'].'",`2price` = "'.$id['2price'].'",`data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							$this->error = '������� &quot;'.$id['name'].'&quot; ������ �������';
-						}
-					}
-				}elseif($rune['type']==48) {
-											//�������
-						$data = $this->lookStats($id['data']);
-						$add = $this->lookStats($rune['data']);
-						
-						if($data['tya1']>=90 || $data['tya2']>=90 || $data['tya3']>=90 || $data['tya4']>=90) {
-							$this->error = '������� ��� ����� 90 ������ �������';
-						}elseif(isset($data['nomodif'])) {
-							$this->error = '�������� ������ ������� ����������';
-						}elseif($add['uptype'] != $id_type || $add['uptype'] == 0) {
-							$this->error = '������� �� �������� � ������� ��������...';
-						}else{
-							
-							if ($add['tya1']==1){
-								
-								$data['tya1'] += $add['tya1'];
-								if ($data['tya3']>10){
-									$data['tya3'] -= $add['tya1'];
-								}
-																
-							}elseif ($add['tya2']==1){
-								
-								$data['tya2'] += $add['tya2'];
-								if ($data['tya4']>10){
-									$data['tya4'] -= $add['tya2'];
-								}
-								
-							}elseif ($add['tya3']==1){
-								
-								$data['tya3'] += $add['tya3'];
-								if ($data['tya1']>10){
-									$data['tya1'] -= $add['tya3'];
-								}
-								
-							}elseif ($add['tya4']==1){
-								
-								$data['tya4'] += $add['tya4'];
-								if ($data['tya2']>10){
-									$data['tya2'] -= $add['tya4'];
-								}
-								
-							}
-							
-							
-							$this->addDelo(2,$this->info['id'],'&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: ������� &quot;'.$data['upatack_name'].'&quot; ���� ������� <b>��������</b> � ������� &quot;'.$id['name'].'&quot; [itm:'.$id['id'].']',time(),$this->info['city'],'System.remont.upatack',0,0);
-							$this->error = '������� &quot;'.$id['name'].'&quot; ������ �������! �����:'.$data['tya1'].' ���:'.$data['tya2'].' �����:'.$data['tya3'].' ���:'.$data['tya4'].' ';
-							$data = $this->impStats($data);						
-							mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `items_users` SET `1price` = "'.$id['1price'].'",`2price` = "'.$id['2price'].'",`data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							//$this->error = '������� &quot;'.$id['name'].'&quot; ������ �������! �����:'.$data['tya1'].' ���:'.$data['tya2'].' �����:'.$data['tya3'].' ���:'.$data['tya4'].' ';
-							
-						}
-				}elseif($rune['type']==50) {
-											//��������� ������
-							//$id['data'];
-							//$rune['data'];
-							//$id['item_id']
-							if ( $id['item_id']==3196 || $id['item_id']==3197 || $id['item_id']==3198){
-							
-							
-								if ($id['iznosNOW']>0){
-									$id['iznosNOW']--;
-									$this->error = '�������������� &quot;'.$id['name'].'&quot; ������ �������! ['.round($id['iznosNOW']).'/'.round($id['iznosMAX']).']';
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$id['iznosNOW'].'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-								}else{
-									$this->error = '������� &quot;'.$id['name'].'&quot; ����� ������������ �������� ���������! ['.round($id['iznosNOW']).'/'.round($id['iznosMAX']).']';
-								}
-							}
-							
-							else
-							
-							{
-								$this->error = '������ ������� �� �������� ��� ��������������!!';
-							}
-						
-							
-							
-					
-					
-				}elseif($rune['type']==68) {
-					$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-					if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-					$id['type'] = $idt['type'];
-
-						//���������� ����
-						$data = $this->lookStats($id['data']);
-						$add = $this->lookStats($rune['data']);
-						if(isset($data['nomodif'])) {
-							$this->error = '�������� ������ ������� ����������';
-						}elseif(!isset($data['close']) && $data['close'] != 0) {
-							$this->error = '�� �������� � ������� ��������, �� �� ������...';
-						}else{
-							$data['unopen'] = $rune['id'];
-							$data['unopen_id'] = $rune['item_id'];
-							$data['unopen_name'] = $rune['name'];
-							
-							unset($data['close']);
-							
-							$data['open'] = 1;
-							
-							$data = $this->impStats($data);								
-							
-							mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							$this->error = '�������� &quot;'.$id['name'].'&quot; ������ �������';
-						}
-						
-				}elseif($rune['type']==37) {
-					$idt = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT 1'));
-					if($idt['type'] != 37) {
-						//
-						$data = $this->lookStats($id['data']);
-						$add = $this->lookStats($rune['data']);
-						//
-						if($id['gift'] == '' || $id['gift'] == '0') {
-							if(isset($data['notransfer'])) {
-								$this->error = '������� ������ ����������...';
-							}elseif(isset($data['sudba']) && $data['sudba'] != 0) {
-								$this->error = '������� ������ ����� �������...';
-							}else{
-								if(isset($add['item_inbox']) && $add['item_inbox'] > 0) {
-									$this->error = '� �������� ��� ���-�� ����, �������� ������� �������!';
-								}elseif($id['inTransfer'] > 0 || $id['inShop'] > 0 || $id['inGroup'] > 0) {
-									$this->error = '������ �������� ���� �������, �� � ��������, �� �������� ��� � ������...';
-								}else{
-									//���������� ������� � ��������
-									$add['item_inbox'] = $id['id'];		
-									$add['open'] = 1;
-									$add['nosale'] = 1;									
-									$add = $this->impStats($add);
-									//
-									mysql_query('UPDATE `items_users` SET `inGroup` = 0,`data` = "'.$add.'" WHERE `id` = "'.$rune['id'].'" LIMIT 1');
-									mysql_query('UPDATE `items_users` SET `uid` = -1 WHERE `id` = "'.$id['id'].'" LIMIT 1');
-									//
-									$this->error = '������� &quot;'.$idt['name'].'&quot; �������� � �������.';
-									//
-								}
-							}
-						}else{
-							$this->error = '�������� �� �����...';
-						}
-						//
-					}else{
-						$this->error = '�� �� ������� ��������� ��������...';
-					}						
-				}else{
-					$this->error = '('.$rune['type'].') �������� ������� �� ������������ �� �������...';
-				}
-			}
-		}else{
-			$this->error = '����������� �������� �� �������...';
-		}
-	}
-	
-	public function floordec($zahl,$decimals=2){	 
-		 return floor($zahl*pow(10,$decimals))/pow(10,$decimals);
-	}
-	
-	public function testBattle( $id ) {
-		$r = true;
-		if( $id == 0 ) {
-			$r = false;
-		}else{
-			$btla = mysql_fetch_array(mysql_query('SELECT `id`,`team_win` FROM `battle` WHERE `id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
-			if( isset($btla['id']) ) {
-				if( $btla['team_win'] > -1 ) {
-					$r = false;
-				}
-			}
-		}
-		return $r;
-	}
-	
-	public function testVipItems($slot_new) {
-		$sp = mysql_query('SELECT `i`.`id`,`m`.`type`,`i`.`2price`,`m`.`price2` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`item_id` WHERE `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`data` LIKE "%vip_sale%" LIMIT 20');
-		$itm = array();
-		$slot = array();
-		$j = 0;
-		if( $slot_new > 0 ) {
-			$itm[$j] = array('new');
-			$slot[$slot_new][] = $j;
-			$j++;
-		}
-		$r = true;
-		while( $pl = mysql_fetch_array($sp)) {
-			$itm[$j] = $pl;
-			$slot[$pl['type']][] = $j;
-			$j++;
-		}
-		$l = count($slot[18])+count($slot[19])+count($slot[20])+count($slot[21])+count($slot[22])+count($slot[23])+count($slot[24])+count($slot[25])+count($slot[26])+count($slot[27])+count($slot[28]);
-		$v = count($slot[9])+count($slot[10])+count($slot[11]);
-		$a = count($itm)-$l-$v;
-		if( $this->stats['silver'] == 2 ) {
-			// 3 ��������� (1������ � ��� ����� ��������)
-			if( $j > 3 || $l > 1 || $v > 0 ) {
-				$r = false;
-			}
-		}elseif( $this->stats['silver'] == 3 ) {
-			// 6 ���������� (1 ������, 1 �������� � 4 ���� �� �����) 
-			if( $j > 6 || $l > 1 || $v > 1 ) {
-				$r = false;
-			}
-		}elseif( $this->stats['silver'] == 4 ) {
-			// 9 ���������� (2 ������, 2 �������� � 5 ����� �� �����) 
-			if( $j > 9 || $l > 2 || $v > 2 ) {
-				$r = false;
-			}
-		}elseif( $this->stats['silver'] == 5 ) {
-			// ������� ������			
-		}	
-		return $r;
-	}
-	
-	public function berezCena() {
-		global $c;
-		$r = 0;
-		if( $this->stats['silver'] > 0 ) {
-			$r = 50+(($this->stats['silver']-1)*5);
-			$r = $r/100;
-		}
-		$r = $c['shop_type2'];
-		//$r = 1; //������ 100%
-		$r = round(($r/100),2);
-		return $r;	
-	}
-	
-	public function genInv($type, $sort){
-		global $c,$code;
-		
-		$i = 0; // �������, ������ ��������.
-		$j = 0;  // ����� ��������� while ++
-		$k = 1; // 0 ��� 1
-		$rt = array( 0=>0, 1=>0, 2=>'' ); // ����������? ���������
-		$clr = array( 0=>'c8c8c8', 1=>'d4d4d4' ); // ���� ���� ��� ��������� 
-			$sort = explode('ORDER BY', $sort);
-			if( isset($sort[0],$sort[1])){
-				$where= $sort[0];
-				if($sort[1] !='' )$sort = $sort[1].''; else $sort =''; 
-			} else {
-				$where = $sort[0]; $sort = ' `lastUPD`  DESC';
-			}
-			$cl = mysql_query('SELECT count(`iu`.item_id) as inGroupCount, `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`so`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE  '.$where.' GROUP BY `im`.id,`iu`.item_id, `iu`.inGroup HAVING `iu`.inGroup > 0  UNION ALL SELECT count(`iu`.item_id) as inGroupCount, `im`.`id`,`im`.`name`,`im`.`img`, `im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`, `im`.`iznosMAXi`,`im`.`inRazdel`, `im`.`price1`,`im`.`price2`, `im`.`pricerep`,`im`.`magic_chance`, `im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`, `im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`, `im`.`ts`,`im`.`srok`,`im`.`class`, `im`.`class_point`,`im`.`anti_class`, `im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`, `im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`so`,`iu`.`id`,`iu`.`item_id`, `iu`.`1price`,`iu`.`2price`,`iu`.`uid`, `iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`, `iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`, `iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`, `iu`.`magic_inc`, `iu`.`maidin`,`iu`.`lastUPD`, `iu`.`timeOver`, `iu`.`overType`, `iu`.`secret_id`, `iu`.`time_create`, `iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`, `iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE  `iu`.inGroup=0 AND '.$where.' GROUP BY `iu`.id, `iu`.item_id ORDER BY '.$sort.' 
-');
-		 
-		if($type == 15) {
-			$anm = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1'));
-		} 
-		while($pl = mysql_fetch_array($cl)) {
-	 	 	 if($type==30){
-	 	 	 	 $ChSudba = $this->lookStats($pl['data']);	 	 	 	 	 
-	 	 	 	 if(isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['nosale']==1)
-	 	 	 	    continue;
-	 	 	 }
-			if($pl['1price']>0) {
-				$pl['price1'] = $pl['1price'];
-			}
-			$is1 = '';
-			$is2 = '';
-			$d = array();
-			//����
-			$d[0] = 0;
-			$d[1] = 1;
-			$d[2] = 0;
-			$po = $this->lookStats($pl['data']);
-			
-			$see1 = 1;
-			if($type == 15) { //�������� �����
-				if($anm['type'] == 3 && substr_count($pl['img'],'wisp') == 0) {
-					$see1 = 0; //�������
-				}elseif($anm['type'] == 2 && substr_count($pl['img'],'owl') == 0) {
-					$see1 = 0; //����
-				}elseif($anm['type'] == 1 && substr_count($pl['img'],'cat') == 0) {
-					$see1 = 0; //���
-				}elseif($anm['type'] == 4 && substr_count($pl['img'],'chrt') == 0) {
-					$see1 = 0; //�������
-				}elseif($anm['type'] == 5 && substr_count($pl['img'],'dog') == 0) {
-					$see1 = 0; //������
-				}elseif($anm['type'] == 6 && substr_count($pl['img'],'pig') == 0) {
-					$see1 = 0; //������
-				}elseif($anm['type'] == 7 && substr_count($pl['img'],'dragon') == 0) {
-					$see1 = 0; //������
-				}
-			}elseif(isset($po['nosale']) && $type==2){
-				$see1 = 0;	
-				
-			}elseif(isset($po['noremont']) && $type==4){
-				$see1 = 0;	
-			}elseif($type==5 && $pl['gift']!=''){
-				$see1 = 0;	
-			}elseif(($type==9 || $type==10) && $pl['gift']==''){
-				$see1 = 0;	
-			}elseif($type==5 && isset($po['sudba']) && $po['sudba']!='0'){
-				$see1 = 0;	
-			}elseif($type==5 && $pl['inTransfer']>0){
-				$see1 = 0;
-			}elseif($type==6 && !isset($po['fshop'])){
-				$see1 = 0;
-			} elseif($type == 67 && isset($po['art'])) {
-				$see1 = 0;
-			}elseif($type == 67 && isset($po['sudba'])) {
-				$see1 = 0;
-			} elseif($type == 67 && $pl['gift']!='') {
-				$see1 = 0;
-			}elseif($type==11) { // ���� ������ (������ ���������)
-				if($pl['inTransfer']>0 || ($po['sudba'] != '' && $po['sudba'] != 0 && $po['sudba'] != 1 && $po['sudba'] != $this->info['id']) ){
-					$see1 = 0;
-				}
-				if($pl['type']!=1 && $pl['type']!=3 && $pl['type']!=9 && $pl['type']!=10 && $pl['type']!=11 && $pl['type']!=5 && $pl['type']!=6 && $pl['type']!=8 && $pl['type']!=12 && $pl['type']!=14 && $pl['type']!=15 && $pl['type']!=18 && $pl['type']!=19 && $pl['type']!=20 && $pl['type']!=21 && $pl['type']!=22 && $pl['type']!=13 && $pl['item_id']!=1035){
-					$see1 = 0; 
-				}
-				if($po['tr_lvl']<4 && $pl['item_id']!=1035){
-					$see1 = 0;
-				}
-			}elseif($type==14) { // ���� ������ (������ ���)
-				if($pl['inTransfer'] > 0){
-					$see1 = 0;
-				}
-				if($pl['type'] != 31){
-					$see1 = 0;
-				}
-			}elseif($type==12){
-				if($pl['inslot']!=3 && $pl['inslot']!=14 && $pl['type']!=31){
-					$see1 = 0;
-				}
-				if(!isset($po['frompisher']) && $pl['type']!=31){
-					$see1 = 0;
-				}
-			}elseif($type==56 && ($pl['inslot'] != 5 || isset($po['podgon']))){
-				$see1 = 0;	
-			}elseif(isset($po['musor']) && $po['musor']>0 && $pl['iznosNOW']>=$pl['iznosMAX']){
-				$see1 = 0;
-			}elseif($type==57) {
-				//��������
-				if($pl['type'] < 18 || $pl['type'] > 28 || $pl['type'] == 25) {
-					$see1 = 0;
-				}
-			}elseif($type==58) {
-				//������������ ���
-				if(!isset($po['rune_id'])) {
-					$see1 = 0;
-				}
-			}elseif($type == 65) {
-			  if(isset($po['sudba']) && $po['sudba'] != '0') {
-				$see1 = 0;
-			  }
-			  if(isset($po['toclan'])) {
-				$po['toclan1'] = explode('#',$po['toclan']);
-				$po['toclan1'] = $po['toclan1'][0];
-				if($po['toclan1'] != $this->info['clan']) {
-				  $see1 = 0;
-				}
-			  }
-			}elseif($type == 67) {
-				$po['toclan1'] = explode('#',$po['toclan']);
-				$po['toclan1'] = $po['toclan1'][0];
-				if($po['toclan1'] > 0) {
-					$see1 = 0;
-				}
-				if($this->itemsX($pl['id']) > 1) {
-					#$see1 = 0;
-				}
-				if($po['frompisher'] > 0) {
-					$see1 = 0;
-				}
-				if($pl['gift'] > 0) {
-					$see1 = 0;
-				}
-				if($po['sudba'] > 0) {
-					$see1 = 0;
-				}
-			}elseif($type == 69) {
-				$po['toclan1'] = explode('#',$po['toclan']);
-				$po['toclan1'] = $po['toclan1'][0];
-				if($po['toclan1'] > 0) {
-					$see1 = 0;
-				}
-				if($po['frompisher'] == 0) {
-					$see1 = 0;
-				}
-				if($pl['gift'] > 0) {
-					$see1 = 0;
-				}
-			}
-			
-			if($see1==1){
-				if($k==1){
-					$k = 0;
-				}else{
-					$k = 1;
-				}
-				if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27){ //���� ����� +
-					if(!isset($po['zonb'])) { $po['zonb'] = 0; }
-					$po['zonb']++;
-				}
-				//������ �����
-				$mx = '';
-				if(isset($po['upatack_lvl'])) {
-					$mx .= ' +'.$po['upatack_lvl'];
-				}
-				if(isset($po['modif'])) {
-					$mx .= ' (��)';
-				}
-				$col = $this->itemsX($pl['id']);
-				if($col>1 && $pl['inGroup']!=0 ){ 
-					$pl['kolvo'] = $col;
-					$mx .= ' (x'.$col.')';
-				}
-				if(isset($po['tr_align']) && !isset($po['tr_align_bs'])) {
-					$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
-				} elseif(isset($po['tr_align_bs'])) {
-					if($po['tr_align_bs'] == '1') {
-						$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align1.75.gif >';
-					} elseif($po['tr_align_bs'] == '3') {
-						$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align3.01.gif >';
-					}
-				}
-				if( isset($po['renameadd']) && $po['renameadd'] != '' ) {
-					$pl['name'] .= ' (<small>�������: '.$po['renameadd'].'</small>)';
-				}
-				if( isset($po['icos']) ) {
-					$pl['name'] = '<span class=icos_'.$po['icos'].' >'.$pl['name'].' <span><small>&nbsp;'.$po['icos'].'&nbsp;</small></span></span>';
-				}
-				$is2  = '<a oncontextmenu="top.addTo(\''.$pl['id'].'\',\'item\'); return false;" class="inv_name" href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$pl['name'].''.$mx.'</a>';
-				$is2 .= '&nbsp;&nbsp;';
-				if($pl['massa']>0){
-					$is2 .= ' (�����: '.($pl['massa']*$col).')';
-				}
-				if($pl['gift']!=''){
-					$ttl = '';
-					if($pl['gift']==1){
-						$ttl = '�� �� ������ �������� ���� ������� ����-����';
-					}else{
-						$ttl = '���� ������� ��� ������� '.$pl['gift'].'. �� �� ������� �������� ���� ������� ����-���� ���';
-					}
-					$is2 .= ' <img title="'.$ttl.'" src="https://img.new-combats.com/i/podarok.gif">';
-				}
-				
-				if(isset($po['art'])){
-					$is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
-				}
-				
-				if(isset($po['sudba'])){
-					if($po['sudba']=='0'){
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}elseif($po['sudba']=='1'){
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}else{
-						$is2 .= ' <img title="���� ������� ������ ����� ������� � '.$po['sudba'].'. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
-					}
-				}
-				if($pl['price1']>0){ //����
-					$pex = explode('.',$pl['price1']);
-					if($pex[1]=='00'){
-						$pl['price1'] = $pex[0];
-					}
-					if($_GET['toRent']==2){
-						$is2 .= '<br><b>����: '.($pl['price1']).' ��.</b>';
-					} else{
-						$is2 .= '<br><b>����: '.($pl['price1']*$col).' ��.</b>';
-					}
-				}
-				if($pl['pricerep']>0){
-					$is2 .= ' <small><b>('.round($pl['pricerep']*$col,2).' ��������������)</b></small>';
-				}
-				if($pl['iznosMAX']>0){ //�������������
-					$izcol = '';
-					if(floor($pl['iznosNOW'])>=(floor($pl['iznosMAX'])-ceil($pl['iznosMAX'])/100*20)){
-						$izcol = 'brown';
-					}
-	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$is2 .= '<br>�������������: <font color="brown">�����������</font >';
-					}else{					
-						$is2 .= '<br>�������������: <font color="'.$izcol.'">'.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).'</font>';
-					}
-				}
-				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '<br>�������� �������������: '.$this->timeOut($po['battleUseZd']).'';
-				}
-				if(isset($po['srok']) && $po['srok'] > 0){
-					$pl['srok'] = $po['srok'];
-				}
-				if($pl['srok'] > 0){ //���� �������� ��������
-					$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']).' (�� '.date('d.m.Y H:i',$pl['time_create']+$pl['srok']).')';
-				}
-				if($pl['magic_chance'] > 0) {
-					$is2 .= '<br>����������� ������������: '.min(array($pl['magic_chance'],100)).'%';
-				} 
-				if((int)$pl['magic_inci'] > 0){ //����������������� �������� �����:
-					$efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1'));
-					if(isset($efi['id2']) && $efi['actionTime']>0){
-						$is2 .= '<br>����������������� ��������: '.$this->timeOut($efi['actionTime']);
-					}
-				}
-
-				$notr = 0;
-				if(isset($po['sudba']) && $po['sudba']!='0' && $po['sudba']!=$this->info['login']){
-					$notr++;
-				}
-				//<b>��������� �����������:</b>
-				$tr = ''; $t = $this->items['tr'];
-				$x = 0;
-				while($x < count($t)){
-					$n = $t[$x];
-					if(isset($po['tr_'.$n]) && $po['tr_'.$n] != 0) {
-						if( $n == 'sex' ) {
-							if( $this->info['sex'] != $po['tr_'.$n] ) {
-								$tr .= '<font color="red">'; $notr++;
-							}
-						}elseif($po['tr_'.$n] > $this->stats[$n]) {
-							if($n == 'align_bs' && $this->info['inTurnir'] > 0) {
-							  if($po['tr_align_bs'] == '1') {
-								 if($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2) { $pal = false; } else { $pal = true; }
-	 	 	 	 	 	 	   } elseif($po['tr_align_bs'] == '3') {
-					 	 	 	 if($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4) { $tar = false; } else { $tar = true; }
-	 	 	 	 	 	 	   }
-							}
-	 	 	 	 	 	 	if($n == 'rep') {
-								$temp = explode('::', $po['tr_'.$n]); 
-								if($this->rep['rep'.$temp[1]] < $temp[0]) { $tr .= '<font color="red">'; $notr++; } 
-								unset($temp);
-	 	 	 	 	 	    }elseif($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) {
-	 	 	 	 	 	 	 	 $tr .= '<font color="red">'; $notr++;
-							} elseif($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_'.$n]) {
-								$tr .= '<font color="red">'; $notr++;
-							}
-						}
-						$tr .= '<br />� ';
-						if($n == 'rep') {
-							$temp = explode('::',$po['tr_'.$n]);
-							$tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0];
-							unset($temp);
-						} elseif($n != 'align' && $n != 'align_bs') {
-							if( $n == 'sex' ) {
-								if( $po['tr_'.$n] == 1 ) {
-									$tr .= $this->is[$n].': �������';
-								}else{
-									$tr .= $this->is[$n].': �������';
-								}
-							}else{
-								$tr .= $this->is[$n].': '.$po['tr_'.$n];
-							}
-						} else {
-							$tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]];
-						}
-						if( $n == 'sex' ) {
-							if( $this->info['sex'] != $po['tr_'.$n] ) {
-								$tr .= '</font>';
-							}
-						}elseif($po['tr_'.$n] > $this->stats[$n]) {
-						  if($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) {
-	 	 	 	 	 	 	 	 $tr .= '</font>';
-						  } elseif($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_'.$n]) {
-							$tr .= '</font>';
-						  }
-						}
-					}
-					$x++;
-				}
-				if($tr!=''){
-					$is2 .= '<br><b>��������� �����������:</b>'.$tr;
-				}
-				//<b>��������� ��:</b>
-				$tr = ''; $t = $this->items['add'];
-				if(isset($po['mf_stats']) && $po['mf_stats'] > 0) {
-					$tr .= '<br>��������� ��������������: '.$po['mf_stats'];
-				}
-				if(isset($po['mf_mod']) && $po['mf_mod'] > 0) {
-					$tr .= '<br>��������� ������������: '.$po['mf_mod'];
-				}
-				if(isset($po['mf_mib']) && $po['mf_mib'] > 0) {
-					$tr .= '<br>��������� ��������� �����: '.$po['mf_mib'];
-				}
-				
-				$x = 0;
-				while($x<count($t)){
-					$n = $t[$x];
-					if(isset($po['add_'.$n],$this->is[$n])){
-						$z = '+';
-						if($po['add_'.$n]<0){
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['add_'.$n];
-						if(isset($po['mf_stats']) && $po['mf_stats'] > 0) {
-							if($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5') {
-								$tr .= ' <a href="main.php?inv=1&otdel='.$_GET['otdel'].'&rstv='.$pl['id'].'&mf='.$n.'"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-							}
-						}
-						if(isset($po['mf_mod']) && $po['mf_mod'] > 0) {
-							if($n == 'm1' || $n == 'm2' || $n == 'm4' || $n == 'm5') {
-								$tr .= ' <a href="main.php?inv=1&otdel='.$_GET['otdel'].'&rstv='.$pl['id'].'&mf='.$n.'"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-							}
-						}
-					}
-					$x++;
-				}
-				//��������� �� (�����)
-				$i = 1; $bn = array(1=>'������',2=>'�������',3=>'�����',4=>'���');
-				while($i<=4){
-					if(isset($po['add_mab'.$i])){
-						if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1){
-							$z = '+';
-							if($po['add_mab'.$i]<0){
-								$z = '';
-							}
-							$tr .= '<br>� ����� '.$bn[$i].': '.$z.''.$po['add_mab'.$i];
-						}else{
-							$tr .= '<br>� ����� '.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i];
-						}
-						if(isset($po['mf_mib']) && $po['mf_mib'] > 0) {
-							$tr .= ' <a href="main.php?inv=1&otdel='.$_GET['otdel'].'&rstv='.$pl['id'].'&mf=mib'.$i.'"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-						}
-					}
-					$i++;
-				}
-				
-				if($tr!=''){
-					$is2 .= '<br><b>��������� ��:</b>'.$tr;
-				}
-				//<b>�������� ��������:</b>
-				$tr = ''; $t = $this->items['sv'];
-				if(isset($po['sv_yron_min'],$po['sv_yron_max'])){
-					$tr .= '<br>� ����: '.$po['sv_yron_min'].' - '.$po['sv_yron_max'];
-				}
-				$x = 0;
-				while($x<count($t)){
-					$n = $t[$x];
-					if(isset($po['sv_'.$n])){
-						$z = '+';
-						if($po['sv_'.$n]<0){
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['sv_'.$n];
-					}
-					$x++;
-				}
-				if($pl['2too']==1){
-					$tr .= '<br>� ������ ������';
-				}
-				if($pl['2h']==1){
-					$tr .= '<br>� ��������� ������';
-				}
-				if(isset($po['zonb'])){
-					$tr .= '<br>� ���� ������������: ';
-					if($po['zonb']>0){
-						$x = 1;
-						while($x<=$po['zonb']){
-							$tr .= '+';
-							$x++;
-						}
-					}else{
-						$tr .= '�';
-					}
-				}
-				if($tr!=''){
-					$is2 .= '<br><b>�������� ��������:</b>'.$tr;
-				}
-				
-				//�����������
-				/*$tr = '';
-				$x = 1;
-				while($x<=4){
-					if(isset($po['tya'.$x]) && $po['tya'.$x]>0){
-						$tyc = '�������� �����';
-						if($po['tya'.$x]>6){
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>14){
-							$tyc = '����';
-						}
-						if($po['tya'.$x]>34){
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>79){
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>89){
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>=100){
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-					}
-					$x++;
-				}
-				$x = 1;
-				while($x<=7){
-					if(isset($po['tym'.$x]) && $po['tym'.$x]>0){
-						$tyc = '�������� �����';
-						if($po['tym'.$x]>6){
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>14){
-							$tyc = '����';
-						}
-						if($po['tym'.$x]>34){
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>79){
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>89){
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>=100){
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-					}
-					$x++;
-				}
-				if($tr!=''){
-					$is2 .= '<br><b>�����������:</b>'.$tr;
-				}*/
-				if($notr==0){
-					$d[0] = 1;
-					if($pl['magic_inci']!='' || $pl['magic_inc']!=''){
-						$d[2] = 1;
-					}
-				}
-				
-				$tr = '';
-				
-				if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX'])){
-					$d[0] = 0;
-					$d[2] = 0;
-				}				
-				//�������� �����
-				$tr = '';
-				//���������� �����
-				if($pl['magic_inci']!='' || $pl['magic_inc']!='') {
-					if($pl['magic_inc'] == '') {
-						$pl['magic_inc'] = $pl['magic_inci'];
-					}
-					$mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$pl['magic_inc'].'" AND `type1` = "12345" LIMIT 1'));
-					if(isset($mgi['id2'])) {
-						$is2 .= '<div> �������� �������� <img height=18 title="'.$mgi['mname'].'" src="https://img.new-combats.com/i/eff/'.$mgi['img'].'"> '.$mgi['minfo'].'</div>';
-					}
-				}
-				
-				if(isset($po['rune']) && $po['rune']>0) {
-					$rnc = explode(' ',$po['rune_name']);
-					if($rnc[0] == '�����') {
-						$rnc = '#9b5d40';
-					}elseif($rnc[0] == '����') {
-						$rnc = '#3a2b64';
-					}elseif($rnc[0] == '����') {
-						$rnc = '#20a3b0';
-					}elseif($rnc[0] == '����') {
-						$rnc = '#4c7718';
-					}else{
-						$rnc = '#4c4c4c';
-					}
-					
-					$tr .= '<br>&bull; ���������� ����: <small><font color=green>&bull; <u><b>'.$po['rune_name'].'</b></u></font></small>';
-					unset($rnc);
-				}
-				
-				if(isset($po['spell']) && $po['spell']>0) {
-					$rnc = explode(' ',$po['spell_name']);
-					if($rnc[2] == '[0]') {
-						$rnc = '#282828';
-					}elseif($rnc[2] == '[1]') {
-						$rnc = '#624542';
-					}elseif($rnc[2] == '[2]') {
-						$rnc = '#77090b';
-					}elseif($rnc[2] == '[3]') {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['spell_name'] = str_replace('���������� ','',$po['spell_name']);
-					$this->is['mab1'] = '����� ������';
-					$this->is['mab2'] = '����� �������';
-					$this->is['mab3'] = '����� �����';
-					$this->is['mab4'] = '����� ���';
-					$tr .= '<br>&bull; ��������� �����������: <small><font color='.$rnc.'><u><b>'.$po['spell_name'].'</b></u> ('.$this->is[$po['spell_st_name']].': +'.$po['spell_st_val'].')</font></small>';
-					unset($this->is['mab1'],$this->is['mab2'],$this->is['mab3'],$this->is['mab4']);
-					unset($rnc);
-				}
-				
-				if(isset($po['imposed']) && $po['imposed']>0) {
-					if($po['imposed_lvl'] == 0) {
-						$rnc = 'maroon';
-					}elseif($po['imposed_lvl'] == 1) {
-						$rnc = '#624542';
-					}elseif($po['imposed_lvl'] == 2) {
-						$rnc = '#77090b';
-					}elseif($po['imposed_lvl'] == 3) {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['imposed_name'] = str_replace('���� ','',$po['imposed_name']); 
-					$tr .= '<br>&bull; <font color='.$rnc.'>�������� ��������:</font> '.$po['imposed_name'].' '; 
-					unset($rnc);
-				} 
-				if($tr!='') {
-					$is2 .= '<br><b>��������� ��������:</b>';
-					$is2 .= $tr;
-				}
-				
-				/*
-				if($pl['lvl_itm']>0) {
-					$is2 .= '<br><b>������� ��������</b>: ['.$pl['blvl'].'/100]';
-				}
-				
-				if($pl['so']>0) {
-					$is2 .= '<br>&bull; ���� �������� ��������:';
-										
-					$is2 .= '<div style="margin-left:20px;"><small>
-					
-����: '.(0+$po['add_s1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s1']).' ��</b></small>
-<br>��������: '.$po['add_s2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s2']).' ��</b></small>
-<br>��������: '.$po['add_s3'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s3']).' ��</b></small>
-<br>���������: '.$po['add_s5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s5']).' ��</b></small>
-
-<br>��. ����. �����: '.$po['add_m1'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m1']).' ��</b></small>
-<br>��. ������ ����. �����: '.$po['add_m2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m2']).' ��</b></small>
-<br>��. �����������: '.$po['add_m4'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m4']).' ��</b></small>
-<br>��. ������ �����������: '.$po['add_m5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=4"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m5']).' ��</b></small>
-
-<br>����� ������: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab1']).' ��</b></small>
-<br>����� ������: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=6"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab2']).' ��</b></small>
-<br>����� ������: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=7"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab3']).' ��</b></small>
-<br>����� ������: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=8"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab4']).' ��</b></small>
-
-<br>�������� �����: '.$po['add_m10'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=9"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(4+4*$po['add_m10']).' ��</b></small>
-<br>�������� �����: '.$po['add_m11a'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=11"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_m11a']).' ��</b></small>
-
-<br>������ �� �����: '.$po['add_za'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=10"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_za']).' ��</b></small>
-<br>������ �� �����: '.$po['add_zm'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=12"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(4+4*$po['add_zm']).' ��</b></small>
-
-</small></div>';
-					
-					$is2 .= '&bull; �������� ����� ��������: '.$pl['so'].'';
-				}
-				*/
-					
-				if(isset($po['free_stats']) && $po['free_stats']>0){
-					$is2 .= '<br><b>������������� ������:</b>';
-					$is2 .= '<div style="margin-left:20px;"><small>����: '.$po['add_s1'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>��������: '.$po['add_s2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>��������: '.$po['add_s3'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>���������: '.$po['add_s5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=5"><img src="https://img.new-combats.com/i/plus.gif"></a></small></div>';
-					$is2 .= '&bull; �������� �������������: '.$po['free_stats'].'';
-				}
-				
-				if(isset($po['sm_abil'])) {
-					//�������� ��������� � ������������ �����
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7){
-						$mx1 += $mx3['s'.$mx2]-$po['add_s'.$mx2];
-						$mx2++;
-					}
-					$mx1 += $this->info['ability'];
-					if($mx1>0) {
-						$is2 .= '<br><b>������������� �������������:</b>';
-						if(isset($po['sudba']) && $po['sudba']=='0') {
-							$mx1 = 0;
-							$is2 .= '<div style="margin-left:20px;"><small>&bull; ������������� ������������� ����� �������� ����� ������� ��������</small></div>';
-						}else{
-							$is2 .= '<div style="margin-left:20px;"><small>
-							����: '.(0+$po['add_s1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: '.(0+$po['add_s2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: '.(0+$po['add_s3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							������������: '.(0+$po['add_s4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������: '.(0+$po['add_s5']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: '.(0+$po['add_s6']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							</small></div>';					
-							$is2 .= '�������� �������������: '.$mx1;
-						}
-					}
-					unset($mx1,$mx2,$mx3);
-				}
-				
-				if(isset($po['sm_skill'])){
-					//�������� ��������� � ������������ �����
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7){
-						$mx1 += ($mx3['a'.$mx2]+$mx3['mg'.$mx2])-($po['add_a'.$mx2]+$po['add_mg'.$mx2]);
-						$mx2++;
-					}
-					$mx1 += $this->info['skills'];
-					if($mx1>0){
-						$is2 .= '<br><b>������������� �������� ������� � ������:</b>';
-						if(isset($po['sudba']) && $po['sudba']=='0'){
-							$mx1 = 0;
-							$is2 .= '<div style="margin-left:20px;"><small>&bull; ������������� �������� ����� �������� ����� ������� ��������</small></div>';
-						}else{
-							$is2 .= '<div style="margin-left:20px;"><small>
-							���������� �������� ������: '.(0+$po['add_a1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ��������, ��������: '.(0+$po['add_a2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������, ���������: '.(0+$po['add_a3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ��������, ��������: '.(0+$po['add_a4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ����������� ��������: '.(0+$po['add_a5']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� ����: '.(0+$po['add_mg1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� �������: '.(0+$po['add_mg2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=7"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� ����: '.(0+$po['add_mg3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=8"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� �����: '.(0+$po['add_mg4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=9"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������ �����: '.(0+$po['add_mg5']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=10"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������ ����: '.(0+$po['add_mg6']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=11"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ����� ������: '.(0+$po['add_mg7']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=12"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							</small></div>';					
-							$is2 .= '�������� �������������: '.$mx1;
-						}
-					}
-					unset($mx1,$mx2,$mx3);
-				}
-				
-				if(isset($po['complect']) || isset($po['complect2'])){
-					$is2 .= '<br><i>�������������� ����������:</i>';
-				}
-				if(isset($po['complect'])){
-					//�� ������������
-					$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-					$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY  `x` ASC LIMIT 20');
-					while($plc = mysql_fetch_array($spc)){
-						$com1['name'] = $plc['name'];
-						$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-						//�������� ���������
-						$i1c = 0; $i2c = 0;
-						$i1e = $this->lookStats($plc['data']);
-						while($i1c<count($this->items['add'])){
-							if(isset($i1e[$this->items['add'][$i1c]])){
-								$i3c = $i1e[$this->items['add'][$i1c]];
-								if($i3c>0){
-									$i3c = '+'.$i3c;
-								}
-								if($i2c>0){
-									$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}else{
-									$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}								
-								$com1['text'] .= '<br>';
-								$i2c++;
-							}
-							$i1c++;
-						}
-						unset($i1c,$i2c,$i3c);
-						$com1['x']++;
-					}
-					$is2 .= '<br>&bull; ����� ���������: <b>'.$com1['name'].'</b><br><small>';
-					$is2 .= $com1['text'];
-					$is2 .= '</small>';
-				}
-				if(isset($po['complect2'])){
-					//�� ������������
-					$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-					$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect2'].'" ORDER BY  `x` ASC LIMIT 20');
-					while($plc = mysql_fetch_array($spc)){
-						$com1['name'] = $plc['name'];
-						$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-						//�������� ���������
-						$i1c = 0; $i2c = 0;
-						$i1e = $this->lookStats($plc['data']);
-						while($i1c<count($this->items['add'])){
-							if(isset($i1e[$this->items['add'][$i1c]])){
-								$i3c = $i1e[$this->items['add'][$i1c]];
-								if($i3c>0){
-									$i3c = '+'.$i3c;
-								}
-								if($i2c>0){
-									$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}else{
-									$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}								
-								$com1['text'] .= '<br>';
-								$i2c++;
-							}
-							$i1c++;
-						}
-						unset($i1c,$i2c,$i3c);
-						$com1['x']++;
-					}
-					$is2 .= '<br>&bull; ����� ��������� (��������): <b>'.$com1['name'].'</b><br><small>';
-					$is2 .= $com1['text'];
-					$is2 .= '</small>';
-				}
-				
-				if($pl['max_text'] > 0) {
-					//���������
-					$sm_sp = mysql_query('SELECT `id`,`item_id`,`time`,`login`,`type`,`text`,`city`,`x` FROM `items_text` WHERE `item_id` = "'.$pl['id'].'" ORDER BY `id` ASC  LIMIT 500');
-					$sma = 0; $smt = ''; $ixi = 0;
-					while($sm_pl = mysql_fetch_array($sm_sp)) {
-						if($sm_pl['type']==0) {
-							$smt .= '<font class="date">'.date('d.m.Y H:i',$sm_pl['time']).'</font> <b>'.$sm_pl['login'].'</b>. '.$sm_pl['text'].'<br>';
-						}else{
-							$smt .= $sm_pl['text'].'<br>';
-						}
-						if($ixi == 2) {
-							$smt .= '<div style="display:none" id="close_text_itm'.$pl['id'].'">';
-						}
-						$ixi++;
-						$sma += $sm_pl['x'];
-					}
-					$smt .= '</div>';
-					if($pl['max_text']-$pl['use_text'] > 0) {
-						$is2 .= '<div>���������� ��������: '.($pl['max_text']-$pl['use_text']).'</div>';
-					}
-					if($sma > 0) {
-						$is2 .= '<div>�� �������� ������� �����:<br>
-								<table width="100%" border="0" cellspacing="0" cellpadding="0">
-								  <tr>
-									<td><div style="background-color:#e8e8e8;padding:5px;"><CODE>'.$smt.'</CODE></div></td>
-									<td width="20" align="center" valign="top"><img style="cursor:pointer" onClick="seetext('.$pl['id'].');" src="https://img.new-combats.com/expand.gif" height="35" width="10"></td>
-								  </tr>
-								</table>
-							</div>';
-					}
-					unset($sm_sp,$sma,$sm_pl);
-				}elseif(isset($po['onitm_text'])) {
-					$is2 .= '<div>�� �������� ������� �����:<br>
-						<table width="100%" border="0" cellspacing="0" cellpadding="0">
-							<tr>
-								<td><div style="background-color:#e8e8e8;padding:5px;"><CODE>'.$po['onitm_text'].'</CODE></div></td>
-							</tr>
-						</table>
-					</div>';
-				}
-				
-				if(isset($po['gravi'])) {
-					$is2 .= '<br>�� ����������� ������������� �������: <b>'.$po['gravi'].'</b>';
-				}
-
-				$is2 .= '<small style="">';
-
-				if($pl['info']!=''){
-					$is2 .= '<div><b>��������:</b></div><div>'.$pl['info'].'</div>';
-				}
-
-				if(isset($po['info']) && $po['info']!=''){
-					$is2 .= '<div>'.$po['info'].'</div>';
-				}
-
-				if($pl['maidin']!=''){
-					//$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
-				}
-				
-				if(isset($po['toclan'])) {
-					$po['toclan1'] = explode('#',$po['toclan']);
-					$clpo = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$po['toclan1'][0].'" LIMIT 1'));
-					if(isset($clpo['id'])) {
-						$is2 .= '<div style="color:brown;">������� ����������� ����� <img style="vertical-align:bottom" src="https://img.new-combats.com/i/clan/'.$clpo['name_mini'].'.gif" width="24" height"15"> <b>'.$clpo['name'].'</b>';
-						$plpo = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "'.$po['toclan1'][1].'" LIMIT 1'));
-						if(isset($plpo['id'])) {
-							$is2 .= ' <font color=grey>(��� ������ <b>'.$plpo['login'].'</b><a href="info/'.$plpo['id'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_'.$plpo['cityreg'].'.gif" width="9"></a>)</font>';
-							if( $plpo['login'] == $this->info['login'] ) {
-								if( isset($_GET['backmyitm']) ) {
-									$pl['inOdet'] = 0;
-									$pl['uid'] = $plpo['id'];
-									unset($po['toclan1'],$po['toclan']);
-									$pl['data'] = $this->impStats($po);
-									mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($pl['data']).'",`inOdet` = 0,`uid` = "'.$pl['uid'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								}
-								$is2 .= '<br>(�� �������� ��������: <a href="main.php?clan&deposit&backmyitm='.$pl['id'].'">������� ������� ����</a>)';
-							}
-						}
-						$is2 .= '</div>';
-					}
-				}
-				if(isset($po['noremont'])){
-					$is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
-				}
-				if(isset($po['nosale'])){
-					$is2 .= '<div style="color:brown;">������� ������ �������</div>';
-				}
-				if(isset($po['nomodif'])){
-					$is2 .= '<div style="color:brown;">������� ������ ��������</div>';
-				}
-				if(isset($po['nodelete'])){
-					$is2 .= '<div style="color:brown;">������� ������ ���������</div>';
-				}
-				if(isset($po['frompisher'])){
-					$is2 .= '<div style="color:brown;">������� �� ����������</div>';
-				}
-				if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) {
-					$is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
-				}
-				
-				if(isset($po['fromlaba']) && $po['fromlaba']>0){
-					$is2 .= '<div style="color:brown;">������� �� ���������</div>';
-				}
-				
-				if(isset($po['vip_sale']) && $po['vip_sale']>0){
-					if( $this->stats['slvtm'] > time() && $this->stats['silver'] > 1 ) {
-						if( $pl['time_create'] != $this->stats['slvtm'] ) {
-							$pl['time_create'] = $this->stats['slvtm'];
-							mysql_query('UPDATE `items_users` SET `time_create` = "'.$pl['time_create'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-						$is2 .= '<div style="color:brown;">������� ����� ���������� ����� '.$this->timeOut($pl['time_create']-time()).'</div>';
-						//$is2 .= '<div style="color:brown;">������� �������� ����� '.$this->timeOut($pl['time_create']-time()+86400*30).'</div>';
-					}else{
-						$is2 .= '<div style="color:brown;">������� ����������, ����������� ���������� VIP</div>';
-						if( ($pl['time_create']-time()+86400*30) < 1 ) {
-							$is2 .= '<div style="color:brown;">������� ���������� � ��� �� ������...</div>';
-						}else{
-							$is2 .= '<div style="color:brown;">������� �������� ����� '.$this->timeOut($pl['time_create']-time()+86400*30).'</div>';
-						}
-					}
-				}
-				
-				if($pl['dn_delete']>0){
-					$is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
-				}	
-				
-				if( $this->pokol > $pl['geni'] ) {
-					$is2 .= '<div style="color:brown">������� �������</div>';
-				}
-				
-				if(isset($po['zazuby']) && $po['zazuby']>0){
-					$is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
-				}
-				
-				$is2 .= '</small>';
-				
-				if($col > 1000) {
-					$is1 .= '<table border="0" cellspacing="0" cellpadding="0">
-							  <tr>
-								<td><img src="https://img.new-combats.com/i/items/'.$pl['img'].'"></td>
-							  </tr>
-							  <tr>
-								<td align="right"><span style="position:relative;margin-bottom:5px;"><small style="position:absolute;background-color:grey;padding:1px;bottom:1px;right:1px;background-color:#E0E0E0;"><b>x'.$col.'</b></small></span></td>
-							  </tr>
-							</table>';
-				
-				}else{				
-					$is1 .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin-bottom:5px;">';
-				}
-
-				//$is1 .= '<br><small>(id'.$pl['id'].')</small><br>';
-				
-				$is1 .= '<br>';
-
-				if($type == 81) {
-					$is1 .= '<small><a href="main.php?inv=1&otdel='.floor($_GET['otdel']).'&use_rune='.floor($_GET['use_rune']).'&item_rune=0&item_rune_id='.$pl['id'].'">������� ������ �������</a></small>';
-				}elseif($type == 80) {
-					$is1 .= '<small><a href="main.php?inv=1&otdel='.floor($_GET['otdel']).'&use_rune='.floor($_GET['use_rune']).'&item_rune=0&item_rune_id='.$pl['id'].'">������� ������ �������</a></small>';
-				}elseif($type == 69) {
-					if(!isset($po['hprs'])) {
-						$po['hprs'] = 0.001;
-					}
-					if(!isset($po['hprp'])) {
-						$po['hprp'] = 0.0001;
-					}
-					$prs1 = $this->floordec($po['hprs']*$col,2);
-					$rps1 = $this->floordec($po['hprp']*$col);
-					$is1 .= '<small style="font-size:11px;"><a href="?sale1kr='.$pl['id'].'">�������� �� '.$prs1.' ��.</a><br><a href="?sale1rep='.$pl['id'].'">�������� �� '.$rps1.' ��. ���������</a>';
-					$is1 .= '</small>';
-				}elseif($type == 68) {
-					$is1 .= '<small style="font-size:11px;"><a href="?r=3&itm_take='.$pl['id'].'">�������</a><br><a href="?r=3&itm_cancel='.$pl['id'].'">����������</a>';
-					if($pl['lastUPD'] > 0) {
-						$is1 .= '<br><br>('.$this->timeOut(($pl['lastUPD']+7*24*60*60) - time()).')';
-					}
-					$is1 .= '</small>';
-				}elseif($type == 67) {
-					$is1 .= '<small style="font-size:11px;"><a href="javascript:void(0)" onclick="itmToUser('.$pl['id'].')">�������� �� '.(round(1+$pl['price1']/100*7)*$col).' ��.</a></small>';
-				}elseif($type == 66) {
-					$pos = explode('#', $po['toclan']);
-	 	 	 	 	 $us_1 = $pos[1];
-					if($pl['uid'] < 1) {
-						$is1 .= '<small style=""><a href="?clan&deposit&take_itm='.$pl['id'].'">����� �������</a></small>';
-					}else{
-						$yui = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "'.mysql_real_escape_string($pl['uid']).'" LIMIT 1'));
-						$is1 .= '<small>������� � ������<br><b>'.$yui['login'].'</b><a href="info/'.$yui['id'].'" target="_blank"><img width="10" src="https://img.new-combats.com/i/inf_'.$yui['cityreg'].'.gif"></a></small>';
-						if($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) {
-						  $is1 .= '<br><small style=""><a href="?clan&deposit&ungive_itm='.$pl['id'].'">������ �������</a></small>';
-						}
-					}
-				}elseif($type == 65) {
-					if(!isset($po['toclan'])) {
-						$is1 .= '<small style=""><a href="?clan&deposit&give_itm='.$pl['id'].'">������������</a></small>';	
-					}else{
-						$is1 .= '<small style=""><a href="?clan&deposit&give_itm='.$pl['id'].'">�������</a></small>';	
-					}
-				}elseif($type == 62) {
-					$upgitm = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "'.$pl['item_id'].'" LIMIT 1'));
-					if(!isset($upgitm['id'])) {
-						$is1 .= '<small style="">��������� ����������</small>';
-					}else{
-						$prcup = '';
-						if($upgitm['price1'] > 0) {
-							$prcup .= $upgitm['price1'].' ��.';
-						}
-						if($upgitm['price2'] > 0) {
-							if($prcup!='') {
-								$prcup .= ' � ';
-							}
-							$prcup .= $upgitm['price2'].' ���.';
-						}
-						$is1 .= '<small style=""><a href="?r=8&upgradelvl='.$pl['id'].'">�������� �� '.$prcup.'</a></small>';
-						unset($prcup);
-					}
-				}elseif($type == 63) {
-					$prcup = '';
-					$is1 .= '<small style=""><a href="?r=9&upgradelvlcom='.$pl['id'].'">��������</a></small>';
-					unset($prcup);
-				}elseif($type == 64) {
-					$prcup = '';
-					$is1 .= '<small style=""><a href="?r=9">������� ������ �������</a></small>';
-					unset($prcup);
-				}elseif($type==61) { //��������� ��������
-					if($pl['price1']>$pl['1price']) {
-						$pl['1price'] = $pl['price1'];
-					}
-					$prpod = $pl['1price']/2.37;
-					if($pl['price2']>$pl['2price']) {
-						$pl['2price'] = $pl['price2'];
-					}
-					$prpod2 = 30*($pl['2price']/2.37);
-					if($prpod2 > $prpod) {
-						$prpod = $prpod2;
-					}
-					if(!isset($po['add_s1']) && !isset($po['add_s2']) && !isset($po['add_s3']) && !isset($po['add_s5'])) {
-						$prpod = $prpod/2.37;
-					}
-					$prpod = round($prpod+$prpod/100*(37.795*($po['upgrade']+1)));
-					$is1 .= '<small style=""><a href="?upgrade='.$pl['id'].'&r=6&t=2&rnd='.$code.'">������� �� '.$prpod.' ��.</a></small>';	
-				}elseif($type==60) { //���������������
-					if($pl['price1']>$pl['1price']) {
-						$pl['1price'] = $pl['price1'];
-					}
-					$prpod = $pl['1price']/2;
-					if($pl['price2']>$pl['2price']) {
-						$pl['2price'] = $pl['price2'];
-					}
-					$prpod2 = 30*($pl['2price']/2.37);
-					if($prpod2 > $prpod) {
-						$prpod = $prpod2;
-					}
-					if(!isset($po['add_s1']) && !isset($po['add_s2']) && !isset($po['add_s3']) && !isset($po['add_s5'])) {
-						$prpod = $prpod/2;
-					}
-					$prpod = round($prpod);
-					$is1 .= '<small style=""><a href="?modif='.$pl['id'].'&r=7&t=2&rnd='.$code.'">�������������� �� '.$prpod.' ��.</a></small>';				
-					
-				}elseif($type==59) { //�������������
-					if($po['tr_lvl'] > $pl['level']) {
-						$pl['level'] = $po['tr_lvl'];
-					}
-					//$prpod = $pl['level']*200;
-					$prpod = 250;
-					$prpod_ekr = $pl['level']*0.25;
-					//$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������������� �� '.$prpod.' ��.</a></small>';
-					
-					if($this->stats['repair_z'] >=1) {
-						$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������� �������������</a></small>';
-					}else{
-						$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������������� �� '.$prpod.' ��.</a></small>
-						<!--<br><small style=""><a href="?ubeff_ekr='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������������� �� '.$prpod_ekr.' ���.</a></small>-->';
-					}
-				}elseif($type==58) { //������������ ���
-					if($po['tr_lvl'] > $pl['level']) {
-						$pl['level'] = $po['tr_lvl'];
-					}
-					//$prpod = 50*$pl['level']+200;
-					$prpod = 250;
-					$prpod_ekr = $pl['level']*0.15;
-					if($this->stats['repair_r']>=1){
-						$is1 .= '<small style=""><a href="?unrune='.$pl['id'].'&r=4&t=2&rnd='.$code.'">��������� ������� ����</a></small>';
-					}else{
-						$is1 .= '<small style=""><a href="?unrune='.$pl['id'].'&r=4&t=2&rnd='.$code.'">������� ���� �� '.$prpod.' ��.</a></small><br>
-						<!--<small style=""><a href="?unrune_ekr='.$pl['id'].'&r=4&t=2&rnd='.$code.'">������� ���� �� '.$prpod_ekr.' ���.</a>
-						</small> -->';
-					}
-				} elseif($type == 57) {
-					$prpod = 30;
-					if($pl['type'] == 22) { $prpod = 35; } elseif($pl['type'] == 18) { $prpod = 15; }
-					if(isset($po['gravi'])) {
-			 	 	   $is1 .= '<small style=""><a onclick="top.un_grava(\''.$pl['id'].'\',\''.$pl['name'].'\',\''.$prpod.'.00\',\'data\')" href="javascript:void(0)">�������� ������� �� '.$prpod.' ��.</a></small>';
-					} else {
-					  $is1 .= '<small style=""><a onclick="top.grava(\''.$pl['id'].'\',\''.$pl['name'].'\',\''.$prpod.'.00\',\'data\')" href="javascript:void(0)">������������� ������� �� '.$prpod.' ��.</a></small>';
-					}
-				} elseif($type==56) { //��������
-					if($po['tr_lvl']>$pl['level']) {
-						$pl['level'] = $po['tr_lvl'];
-					}
-					$prpod = 5*$pl['level']+10;
-					$prhp = 6*$pl['level']+6;
-					$is1 .= '<small style=""><a href="?podgon='.$pl['id'].'&r=5&t=2&rnd='.$code.'">��������� �� '.$prpod.' ��.</a></small>';
-				}elseif($type==15) { //�������� �����
-					$is1 .= '<a href="main.php?pet=1&obj_corm='.$pl['id'].'&rnd='.$code.'">�������</a>';
-				}elseif($type==11){
-					$pl['rep'] = 0;
-					if($this->rep['rep1']<100) {
-						if( $po['tr_lvl'] >= 4 && $po['tr_lvl'] <= 6 ) {
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						}
-					}elseif($this->rep['rep1']>99 && $this->rep['rep1']<1000) {
-						if( $po['tr_lvl'] >= 7 && $po['tr_lvl'] <= 8 ) {
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 1;
-						}
-					}elseif($this->rep['rep1']>999) {
-						if( $po['tr_lvl'] >= 9 && $po['tr_lvl'] <= 10 ) {
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 1;
-						}
-					}else{
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						}
-					}
-					$is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\''.$pl['img'].'\','.$pl['id'].','.$pl['rep'].');">�������</a>';
-				}elseif($type==14){
-					$is1 .= '<a href="javascript:void(0);" onclick="massTakeItRun(\''.$pl['img'].'\','.$pl['id'].',0);">�������</a>';
-				}elseif($type==12){
-					$is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\''.$pl['img'].'\','.$pl['id'].',1);">�������</a>';
-				}elseif($type==10){
-					//������ (����������� ��������� � ������ (��� �������))
-					$is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">� ������</a>';
-				}elseif($type==9){
-					//������ (����������� ��������� � ��������� (��� �������))
-					$is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">��� ������</a>';
-				 }elseif($type==8){
-					 //������ (����������� ��������� � ���������)
-					 $is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">� ������</a>';
-				 }elseif($type==7){
-					 //������ (����������� ��������� � ������)
-					 $is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">� ������</a>';
-				 }elseif($type==6){
-					//��������� �������
-					$is1 .= '<a href="main.php?otdel=2&add_item_f='.$pl['id'].'&rnd='.$code.'">��������</a>';
-				}elseif($type==5){
-					//��������
-					$is1 .= '<a onClick="saleitem('.$pl['id'].',1); return false;" href="javascript:void(0)">��������</a><br><a onClick="saleitem('.$pl['id'].',2); return false;" href="#">��������</a><br><small style="font-size:10px">(�����: 1 ��.)</small>';
-				}elseif($type==12){
-					//�������� �����
-					$skcd = round($col*($pl['price1']*0.06-0.01*$this->stats['os1']),2);
-					if($skcd < 0.06) {
-						$skcd = 0.06;
-					}
-					$is1 .= '<a href="main.php?otdel='.$_GET['otdel'].'&setlogin='.$_REQUEST['setlogin'].'&setobject='.$pl['id'].'&room=2&tmp='.$code.'" onclick="return confirm(\'�������� ������� '.$pl['name'].'?\')">��������&nbsp;��&nbsp;'.(1+$skcd).'&nbsp;��.</A>';
-				}elseif($type==13){
-					//�������� ����
-					if($pl['1price']>0){
-					$mess = "���������� �� ��������? ������� ����� ���������!";
-					$pl['name']= '������ '.$pl['1price'].' ��.';
-					}else{
-					$mess = "���������� �� ��������? ������� ����� ��������� �����������";
-					}
-					$date1 = $pl['delete']-time();
-					$is1 .='<BR><NOBR><A href="?room=4&to_box='.$pl['id'].'&tmp='.$code.'">�������</A></NOBR>
-							<BR><NOBR><A onclick="return confirm(\''.$mess.'\')" href="?room=4&del_box='.$pl['id'].'&tmp='.$code.'">����������</A></NOBR><SMALL><BR><BR>('.date("j ��. H �.",$date1).' )</small></TD>';
-				}elseif($type==4){
-					//������
-					$r1 = round($pl['price1']*0.1/100,2);
-					$r2 = round($pl['price1']*0.1/10,2);
-					$r3 = round($pl['price1']*$pl['iznosNOW']*0.10/100,2);
-					
-					if( $this->stats['repair_discount'] >= 1 ) {
-						$r1 = round(($r1/100*25),2);
-						$r2 = round(($r2/100*25),2);
-						$r3 = round(($r3/100*25),2);
-					}
-					
-					if($r1<0.01){ $r1 = 0.01; }
-					if($r2<0.01){ $r2 = 0.01; }
-					if($r3<0.01){ $r3 = 0.01; }
-					$is1 .= '<small style=""><a href="?remon='.$pl['id'].'&t=1&rnd='.$code.'">������ 1 ��. �� '.$r1.' ��.</a><br>';
-					if($pl['iznosNOW']>=10){$is1 .= '<a href="?remon='.$pl['id'].'&t=2&rnd='.$code.'">������ 10 ��. �� '.$r2.' ��.</a><br>';}
-					$is1 .= '<a href="?remon='.$pl['id'].'&t=3&rnd='.$code.'">������ ������ �� '.$r3.' ��.</a></small>';
-					if($c['zuby'] == true) {
-						if( $this->info['level'] < 8 ) {
-							$is1 .= '<hr><small style=""><a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz='.$pl['id'].'&t=1&rnd='.$code.'">������ 1 ��. �� '.$this->zuby($r1).'</a><br>';
-							if($pl['iznosNOW']>=10){$is1 .= '<a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz='.$pl['id'].'&t=2&rnd='.$code.'">������ 10 ��. �� '.$this->zuby($r2).'</a><br>';}
-							$is1 .= '<a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz='.$pl['id'].'&t=3&rnd='.$code.'">������ ������ �� '.$this->zuby($r3).'</a></small>';
-						}
-					}
-				}elseif($type==3){
-					$is1 .= '<input type="button" onClick="document.getElementById(\'itemgift\').value='.$pl['id'].';document.F1.submit();" value="��������" />';
-				}elseif($type==2){
-					global $shopProcent; 
-					$shpCena = $pl['1price'];
-					if( $pl['1price'] == 0 ) {
-						$shpCena = $pl['price1'];
-					}
-					$plmx = 0;
-					if($pl['iznosMAXi']!=$pl['iznosMAX'] && $pl['iznosMAX']!=0){
-						$plmx = $pl['iznosMAX'];
-					}else{
-						$plmx = $pl['iznosMAXi'];
-					}
-					if($pl['iznosNOW']>0){
-						$prc1 = floor($pl['iznosNOW'])/ceil($plmx)*100;
-					}else{
-						$prc1 = 0;
-					}
-					$shpCena = $this->shopSaleM($shpCena,$pl);
-					$shpCena = $shpCena/100*(100-$prc1);
-					if( $pl['iznosMAXi'] < 999999999 ) {
-						if($pl['iznosMAX']>0 && $pl['iznosMAXi']>0 && $pl['iznosMAXi']>ceil($pl['iznosMAX']))
-						{
-							$shpCena = $shpCena/100*(ceil($pl['iznosMAX'])/$pl['iznosMAXi']*100);
-						}
-					}
-					$shpCena = $this->round2($shpCena/100*(100-$shopProcent));
-					if($shpCena<0){
-						$shpCena = 0;
-					} 
-					if($pl['kolvo']>0){
-						$shpCena = $shpCena*$pl['kolvo'];
-					}
-	 	 	 	 	 if(isset($po['toclan'])) {
-						$po['toclan1'] = explode('#',$po['toclan']);
-						$us_1 = $po['toclan1'][1];
-						if($us_1 != $this->info['id']) {
-							$d_s = false;
-						} else {
-							$d_s = true;
-						}
-					} else {
-						$d_s = true;
-					}
-					if($d_s == true) { // ������� �� �� ���
-						$is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'������� ������� &quot;'.$pl['name'].'&quot; �� '.$shpCena.' ��.?\')){ location = \'main.php?sale&sd4='.$this->info['nextAct'].'&item='.$pl['id'].'&rnd='.$code.'\'; }">������� �� '.$shpCena.' ��.</a>';
-						if($pl['pricerep'] > 0) {
-							$is1 .= '<br><a href="javascript:void(0)" onClick="if(confirm(\'�������� ������� &quot;'.$pl['name'].'&quot; �� '.floor($pl['pricerep']*$pl['kolvo']/2).' ��������������?\')){ location = \'main.php?sale&sd4='.$this->info['nextAct'].'&item_rep='.$pl['id'].'&rnd='.$code.'\'; }">�������� �� '.floor($pl['pricerep']*$pl['kolvo']/2).' ����c. </a>';
-						}
-	 	 	 	 	 } else {
-						$is1 .= '��� �� ��� �������.';
-	 	 	 	 	 }
-				}elseif($type==16){
-					$shpCena = $pl['price2'];
-					if($pl['2price'] > 0 ) {
-						$shpCena = $pl['2price'];
-					}
-					$shpCena = $this->shopSaleM($shpCena,$pl);
-					if($pl['kolvo']>0){
-						$shpCena = $shpCena*$pl['kolvo'];
-					}
-					$plmx = 0;
-					if($pl['iznosMAXi']!=$pl['iznosMAX'] && $pl['iznosMAX']!=0){
-						$plmx = $pl['iznosMAX'];
-					}else{
-						$plmx = $pl['iznosMAXi'];
-					}
-					if($pl['iznosNOW']>0){
-						$prc1 = floor($pl['iznosNOW'])/ceil($plmx)*100;
-					}else{
-						$prc1 = 0;
-					}
-					$shpCena = $shpCena/100*(100-$prc1);
-					if($pl['iznosMAX']>0 && $pl['iznosMAXi']>0 && $pl['iznosMAXi']>$pl['iznosMAX']){
-						$shpCena = $shpCena/100*($pl['iznosMAX']/$pl['iznosMAXi']*100);
-					}
-					//$shpCena = $this->round2($shpCena*0.5); // ���� ���������
-					if( isset($po['art']) ) {
-						$shpCena = $this->round2($shpCena*$this->berezCena()); // ���� ����
-					}else{
-						$shpCena = $this->round2($shpCena*$this->berezCena()); // ����
-					}
-					if($shpCena<0){
-						$shpCena = 0;
-					}
-	 	 	 	 	 if(isset($po['toclan'])) {
-						$po['toclan1'] = explode('#',$po['toclan']);
-						$us_1 = $po['toclan1'][1];
-						if($us_1 != $this->info['id']) {
-							$d_s = false;
-						} else {
-							$d_s = true;
-						}
-					} else {
-						$d_s = true;
-					}
-	 	 	 	 	 if($d_s == true) {
-						$is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'������� ������� &quot;'.$pl['name'].'&quot; �� '.$shpCena.' ���.?\')){ location = \'main.php?sale&sd4='.$this->info['nextAct'].'&item='.$pl['id'].'&rnd='.$code.'\'; }">������� �� '.$shpCena.' ���.</a>';
-					 } else {
-						$is1 .= '��� �� ��� �������.';
-					 }
-	 	 	 	 }elseif($type==30){
-					if(isset($po['toclan'])) {
-							$po['toclan1'] = explode('#',$po['toclan']);
-							$us_1 = $po['toclan1'][1];
-							if($us_1 != $this->info['id']) {
-							$d_s = false;
-						} else {
-							$d_s = true;
-						}
-					} else {
-						$d_s = true;
-					}
-	 	 	 	 	 if($d_s == true) {
-	 	 	 	 	   $is1.= '<form method="POST"><input type="hidden" value="'.$pl['id'].'" name="iid"><input type="text" value="" name="summTR"><input type="submit" value="����� � �������" name="PresTR"></form>'; 
-					} else {
-	 	 	 	 	   $is1.= '��� �� ��� �������.';
-	 	 	 	 	}
-	 	 	 	}elseif($type==31){
-					$is1.= '<form method="POST"><input type="hidden" value="'.$pl['id'].'" name="iid"><input type="submit" value="�������" name="PresTR"> </form>';
-				}else{
-					if($d[2]==1) { //����� ������������
-						$inv1 = '';
-						if(isset($_GET['inv'])) {
-							$inv1 = 'inv=1&';
-						}
-						if($pl['item_id']==74){
-							$is1 .= '<a onclick="top.addNewSmile('.$pl['id'].',0); return false;" href="javascript:void(0)" title="������������">���-��</a>';
-						}else{
-							$useUrl = '';
-							if($pl['magic_inc']==''){
-								$pl['magic_inc'] = $pl['magic_inci'];
-							}
-							if($pl['magic_inc'] && $pl['type']==30){
-								//���������� �������
-								$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-								$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');';
-							}elseif($pl['magic_inc'] && $pl['type']==29){ //���������� �������� 
-								if(isset($po['useOnLogin']) && !isset($po['zazuby'])){ //�� ���������
-									$useUrl = 'top.useMagic(\''.$pl['name'].'\','.(0+$pl['id']).',\''.$pl['img'].'\',1,\'main.php?'.$inv1.'otdel='.((int)$_GET['otdel']).'&use_pid='.$pl['id'].'&rnd='.$code.'\');';
-								}else{ //������ ������������� (�� ����, ���� ��� �������� ��������\������)
-									$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-									$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\','.(0+$_GET['otdel']).');';
-								}
-								//�� �������
-							}
-							if($useUrl != '') {
-								$is1 .= '<a href="javascript:void(0)" onClick="'.$useUrl.'" title="������������">���-��</a>';
-							}else{
-								$d[2] = 0;
-							}
-						}
-					}
-					
-					if($pl['max_text'] > 0 && $pl['max_text']-$pl['use_text'] > 0) {
-						$is1 .= '<a onclick="top.addNewText('.$pl['id'].','.($pl['max_text']-$pl['use_text']).','.$pl['inRazdel'].'); return false;" href="javascript:void(0)" title="�������� ����� �� ��������">��������</a><br>';
-					}
-					if($pl['type']==31 || $pl['type']==46 || $pl['type']==48 || $pl['type']==50 || $pl['type']==62 || $pl['type']==68 || $pl['type']==37 || $pl['type']==47){
-						if($d[2]==1){
-							$is1 .= '<br>';
-						}
-						if($pl['type'] != 37 || !isset($po['item_inbox']) || $po['item_inbox'] == 0) {
-							$is1 .= '<a href="javascript:void(0);" onClick="top.useRune('.$pl['id'].',\''.$pl['name'].'\',\''.$pl['img'].'\',\'main.php?inv=1&otdel='.((int)$_GET['otdel']).'&use_rune='.$pl['id'].'&rnd='.$code.'\');return false;" title="������������">���-��</a>';
-						}
-					}
-					
-					if($d[0]==1 && $pl['type']!=30 && $pl['type']!=31 && (($pl['type']!=38 && $pl['type']!=39 && $pl['type']!=37) || $pl['gift']!='')) {//����� �����
-						if(!isset($po['noodet']) && $pl['inslot'] > 0){
-							if($d[2]==1){
-								$is1 .= '<br>';
-							}
-							$is1 .= '<a href="main.php?otdel='.$pl['inRazdel'].'&inv=1&oid='.$pl['id'].'&rnd='.$code.'" title="������">������</a>';
-						}
-					}
-					if(isset($po['open']) && $d[0]==1){
-						if($d[2]==1){
-							$is1 .= '<br>';
-						}
-						$is1 .= '<a href="main.php?otdel='.$pl['inRazdel'].'&inv=1&open=1&oid='.$pl['id'].'&rnd='.$code.'" title="�������">�������</a>';	
-					}
-					if(isset($po['close'])){
-						if($d[2]==1){
-							$is1 .= '<br>';
-						}
-						$is1 .= '<small><b>������� ������</b></small>';	
-					}
-					if($pl['group']>0){
-						$is1 .= '<br>';
-						if($this->itemsX($pl['id']) < $pl['group_max'] ) {
-							$is1 .= '<a href="main.php?inv=1&otdel='.((int)$_GET['otdel']).'&stack='.$pl['id'].'&rnd='.$code.'" title="�������"><img src="https://img.new-combats.com/i/stack.gif" /></a>';
-						}
-						if($this->itemsX($pl['id'])>1 ){ 
-							$is1 .= ' <a
-							onClick="top.unstack('.$pl['id'].',\''.$pl['img'].'\',\''.$pl['name'].'\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td align=\\\'center\\\' rowspan=\\\'2\\\' width=\\\'70px\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></td><td align=\\\'left\\\'>��������� ������� <b>'.$pl['name'].'</b>?</td></tr></table>\',\''.intval($_GET['otdel']).'\'); return false;"
-							href="main.php?inv=1&otdel='.((int)$_GET['otdel']).'&unstack='.$pl['id'].'&rnd='.$code.'" title="���������"><img src="https://img.new-combats.com/i/unstack.gif" /></a>'.$script;
-						}
-					}
-					if(isset($po['toclan'])) {
-						$po['toclan1'] = explode('#',$po['toclan']);
-						$us_1 = $po['toclan1'][1];
-						if($us_1 != $this->info['id']) {
-							$d[1] = 0;
-						}
-	 	 	 	 	}
-					
-					$is1 .= ' <a href="javascript:void(0);" onclick="top.addfastpanel(\''.$pl['id'].'\',\''.$pl['name'].'\',\''.$pl['type'].'\',\''.$pl['1price'].'\',\''.$pl['2price'].'\',\''.$this->city_name[$pl['maidin']].'\',\''.$pl['img'].'\',\''.$pl['item_id'].'\',\''.$pl['iznosNOW'].'\',\''.$pl['iznosMAX'].'\',\''.intval($_GET['otdel']).'\',\''.$d[0].'\',\''.$d[2].'\',\'0\');" title="�������� � ���������"><img width="16" height="15" src="https://img.new-combats.com/add_itm2.gif"></a> ';
-				
-					if($d[1]==1) { //����� ��������
-						if(!isset($po['nodelete'])) {
-							$is1 .= ' <a onClick="top.drop('.$pl['id'].',\''.$pl['img'].'\',\''.$pl['name'].'\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></td><td align=\\\'left\\\'>������� <b>'.$pl['name'].'</b> ����� ������, �� ������� ?</td></tr></table>\',\''.intval($_GET['otdel']).'\'); return false;" href="javascript:void(0);" title="�������� �������"><img src="https://img.new-combats.com/i/clear.gif"></a>';
-						}
-						//$is1 .= ' <img onclick="if (confirm(\'������� &quot;'.$pl['name'].'&quot; ����� ������, �� �������?\')) window.location=\'main.php?inv=1&delete='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'" title="�������� �������" src="https://img.new-combats.com/i/clear.gif" style="cursor:pointer;">';
-					}
-				}
-				
-				//�������� ��� � ���� (:
-				$rt[2] .= '<tr class="item"><td align="center" bgcolor="#'.$clr[$k].'"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="100" align="center" style="border-right:#A5A5A5 1px solid; padding:5px;">'.$is1.'</td><td valign="top" align="left" style="padding-left:3px; padding-bottom:3px; padding-top:7px;"><div align="left">'.$is2.'</div></td></tr></table></td></tr>'; 
-				$rt[1] += $pl['massa'];
-				$i++;
-			}
-			$j++;
-		}
-		$rt[0] = $i;
-		$rt['collich']=$j;
-		return $rt;
-	}
-	
-	public function itemsX($id,$uid = NULL, $item_id=NULL){
-		$item = mysql_fetch_array(mysql_query('SELECT `iu`.`id`,`iu`.`item_id`,`iu`.`uid`,`iu`.`inGroup`,`iu`.`inShop` FROM `items_users` AS `iu` WHERE `iu`.`delete` = "0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1 '));
-		if($item['inGroup'] == 0){
-			$grp = ' LIMIT 1';
-		} else {
-			$grp = ' LIMIT 1000';
-		}
-		//$grp = ' LIMIT 1';
-		$r = mysql_num_rows(mysql_query('SELECT `iu`.`id` FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "'.$item['inShop'].'" AND `iu`.`item_id` = "'.$item['item_id'].'" AND `iu`.`uid` = "'.($item['uid']).'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.($item['inGroup']).'" '.$grp.' '));
-		/*
-		$r = mysql_fetch_array(mysql_query('SELECT COUNT(`iu`.`id`) FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "'.$item['inShop'].'" AND `iu`.`item_id` = "'.$item['item_id'].'" AND `iu`.`uid` = "'.($item['uid']).'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.($item['inGroup']).'" '.$grp.' '));
-		$r = $r[0];
-		*/
-		unset($item);
-		return $r;
-	}
-	
-	 private function stackGroupCheck($uid, $group, $item){ // ������� ���������������� ID ������ ���������.
-		$g = 0;
-		$i = 0; 
-		do {
-			$i++;
-			$gr = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` 
-			WHERE `iu`.`uid`="'.$uid.'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="'.$i.'" AND `iu`.item_id="'.$item.'" 
-			LIMIT 1'));
-			if( empty($gr['inGroup']) ) {
-				$g = 1;
-			} 
-		} while ($g == 0);
-		return $i;
-	 }
-	
-	public function stack($id) {
-		global $c,$code;
-		$where = '';
-		$itm = mysql_fetch_array(mysql_query('SELECT 
-`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`, count(`iuu`.id) as inGroupCount
-		FROM `items_users` AS `iu`
-		LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`)
-		LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id AND `iuu`.inShop = 0)
-		WHERE `iu`.`id` = "'.mysql_real_escape_string((int)$id).'" AND `iu`.`uid` = "'.$this->info['id'].'" AND `iuu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT 1'));
-
-		if(isset($itm['id']) && $itm['iznosNOW']==0 ) { //���������� ������� ��������� �������� � ����
-			// ������� ������
-			if( $itm['inGroup'] == 0 ) { // ���� ������� �� � ������, �������� ��� ������� �������� �� �������.
-				$items= mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="'.$itm['item_id'].'"'));
-				$items = ceil( $items / $itm['group_max'] );
-			} else { // �������� �������� � ������ �� ������� ����������, �� ��������� � inGroup == 0
-				$curG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="'.$itm['inGroup'].'" AND `iu`.item_id="'.$itm['item_id'].'"')); // ������� ���������� ��������� � ��������� ������
-				$curNG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="'.$itm['item_id'].'"')); // ������� ���������� ��������� ������� ��� ������
-				$needG = $itm['group_max']-$curG; // ������ ��������� ���������� ��� ������, ���� ����� ������ 0 � ��������� ���������� ������
-				
-				if( $needG > 0 AND $curNG==0 ) {
-					$curItem = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, count(`iu`.inGroup) as itemsInGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`inGroup`!="'.$itm['inGroup'].'" AND `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.item_id="'.$itm['item_id'].'" GROUP BY `iu`.inGroup HAVING itemsInGroup <= "'.$needG.'" ORDER BY itemsInGroup DESC LIMIT 1'));
-					if(isset($curItem['id']) ){
-						$where = ' `iu`.`inGroup` = "'.$curItem['inGroup'].'" AND '; 
-					}
-					$itm['group_max'] = $needG;
-				} else { 
-					$itm['group_max'] = $needG;
-				} 
-				$items = 1;
-			}
-			$s = 0;
-			do {
-				if( !isset($curG) AND $curNG==0 ) $itm['inGroup'] = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']); 
-				$sp = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE '.$where.' `iu`.`kolvo` = "1" AND `iu`.`item_id` = "'.$itm['item_id'].'" AND `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" ORDER BY `iu`.`inGroup` ASC LIMIT '.$itm['group_max'].'');
-				$i = 0; $j = 0;
-				while($pl = mysql_fetch_array($sp)) {
-					$pl['data'] = $this->lookStats($pl['data']);unset($pl['data']['frompisher']);$pl['data'] = $this->impStats($pl['data']);
-					$itm['data'] = $this->lookStats($itm['data']);unset($itm['data']['frompisher']);$itm['data'] = $this->impStats($itm['data']);
-					if( $pl['data']==$itm['data'] && $pl['name']==$itm['name'] && $itm['iznosMAX']==$pl['iznosMAX'] && $pl['iznosNOW']==0 && ($pl['timeOver']==0 || $pl['timeOver']>time()) && $pl['gift']==$itm['gift'] ){
-						$upd = mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inGroup` = "'.$itm['inGroup'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						if($upd){
-							$j++;
-						}
-						$i++;
-					}
-				}
-				mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				$s++;
-			} while ($s < $items); 
-		}
-	}
-	
-	public function unstack($id,$x = NULL) {
-		$id = (int)$id;
-		$itm = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, `im`.`id` as item_id,`im`.`name`, count(`iuu`.id) as inGroupCount
-FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id )
-WHERE `iuu`.`uid`="'.$this->info['id'].'" AND `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `im`.`group` = "1" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.id='.mysql_real_escape_string((int)$id).'
-ORDER BY `iu`.lastUPD DESC
-LIMIT 1'));
-		if(isset($itm['id']) && $itm['inGroup']>0 && $itm['inGroupCount']>0) {
-			if($x==0 OR $x==NULL) {
-				$x = $this->itemsX($itm['id']); //���-�� �������
-				$inGroup = 0 ;
-			} elseif( $x != 0 ) {  
-				$inGroup = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']);
-			} else {
-				$inGroup = 0 ;
-			}
-			$sp = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.$itm['inGroup'].'" AND `iu`.`item_id` = "'.$itm['item_id'].'" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT '.$x.'');
-			$i = 0; $j = 0;
-			while($pl = mysql_fetch_array($sp)){
-				$upd = mysql_query('UPDATE `items_users` SET `inGroup` = "'.$inGroup.'", `lastUPD` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				if($upd){
-					$j++;	
-				}
-				$i++;
-			}
-			if( $this->itemsX($itm['id']) == 1){
-				mysql_query('UPDATE `items_users` SET `inGroup` = "0", `lastUPD` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-			}
-			if( $this->itemsX($pl['id']) == 1){
-				mysql_query('UPDATE `items_users` SET `inGroup` = "0", `lastUPD` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-			}
-			
-		}
-	}
-	
-	public function lookStats($m)
-	{
-		$ist = array();
-		$di = explode('|',$m);
-		$i = 0; $de = false;
-		while($i<count($di))
-		{
-			$de = explode('=',$di[$i]);
-			if(isset($de[0],$de[1]))
-			{
-				if(!isset($ist[$de[0]])) {
-					$ist[$de[0]] = 0;
-				}
-				$ist[$de[0]] = $de[1];
-			}
-			$i++;
-		}
-		return $ist;
-	}
-	
-	public function testItems($uid, $sn, $dt) {
-		global $c, $code;
-		$st = false; $rt = false;
-		if($uid!=$this->info['id'])
-		{
-			$u = mysql_fetch_array(mysql_query('SELECT `u`.`align`,`u`.`align2`,`u`.`battle`,`u`.`clan`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`,
-			`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-			FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			if($sn==0)
-			{
-				$sn = $this->getStats($uid,$i1);
-			}
-		}else{
-			$u  = $this->info;
-			if(isset($this->stats['hpAll']))
-			{
-				$sn = $this->stats;
-			}elseif($sn!=0)
-			{
-				
-			}else{
-				$sn = $this->getStats($uid,$i1);
-			}
-		}
-		if(isset($u['id']))
-		{
-			$snIt = 0;
-			//��������� ������ ���� � ���� � ������ ��������
-			$cl = mysql_query('SELECT
-			`iu`.`id` AS `iduid`,
-			`iu`.`time_sleep`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-			`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-			FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`iu`.`inOdet`!="0" OR `iu`.`data` LIKE "%srok%" OR `iu`.`data` LIKE "%vip_sale%" OR `iu`.`data` LIKE "%sudba=1%" OR ( `iu`.`data` LIKE "%zazuby=%" AND `iu`.`data` NOT LIKE "%srok=%" ) OR `iu`.`iznosNOW` > 0 OR `im`.`srok` > 0 OR (`iu`.`timeOver`<'.time().' AND `iu`.`timeOver`!="0")) AND `iu`.`uid`="'.$u['id'].'" AND (`iu`.`delete`="0" OR `iu`.`delete`="1000")');
-			while($itm = mysql_fetch_array($cl)) {
-				$po = array();
-				$po = $this->lookStats($itm['data']);
-				$po['lvl'] = $u['level'];
-				//��������� ����������				
-				$t = $this->items['tr'];
-				$x = 0;
-				$notr = 0;
-				$j = 1;
-				while($j<=4){
-					if(!isset($po['tr_s'.$j]) && $itm['type']!=26){
-						$po['tr_s'.$j] = 0;
-					}
-					$j++;
-				}
-				while($x < count($t)) {
-				  $n = $t[$x];
-				  if( isset($po['tr_'.$n]) && $n == 'sex' ) {
-					  if( $po['tr_'.$n] != $this->info['sex'] ) {
-						 $notr++; 
-					  }
-				  }elseif(isset($po['tr_'.$n])) {
-					if($po['tr_'.$n] > $this->stats[$n] && $n != 'align' && $n != 'align_bs') {
-					  $notr++;
-					}
-				  }
-				  $x++;
-				}
-				if($this->info['twink']>0) {
-					//�� ������ 100 ���.
-					if( $itm['price2'] > 1 || $itm['2price'] > 1 ) {
-						$notr++;
-					}
-					//������ ���� + �����
-					if( isset($po['rune']) && $po['rune'] > 0 ) {
-						$notr++;
-					}
-					if( isset($po['spell_id']) && $po['spell_id'] > 0 ) {
-						$notr++;
-					}
-				}
-				if(isset($po['sudba']) && $po['sudba'] == 1 ) {
-					$po['sudba'] = $u['login'];
-					$itm['data'] = $this->impStats($po);
-					mysql_query('UPDATE `items_users` SET `data` = "'.$itm['data'].'" WHERE `id` = "'.$itm['iduid'].'" AND `uid` = "'.$u['id'].'" LIMIT 1');
-				}
-				if(isset($po['zazuby']) && !isset($po['srok']) && ( $itm['type'] == 29 || $itm['type'] == 30 || $itm['type'] == 36 || $itm['type'] == 49 || $itm['type'] == 46 || $itm['type'] == 34 ) ) {
-					//�������� �� ���� �� ������ ��������
-					$po['srok'] = 86400*7;
-					$itm['data'] = $this->impStats($po);
-					mysql_query('UPDATE `items_users` SET `data` = "'.$itm['data'].'" WHERE `id` = "'.$itm['iduid'].'" AND `uid` = "'.$u['id'].'" LIMIT 1');
-				}
-				if(isset($po['srok']) && $po['srok'] > 0){
-					$itm['srok'] = $po['srok'];
-				}
-				if(isset($po['vip_sale'])) {
-					if($sn['silver'] < 2 && ($itm['time_create']-time()) < 0) {
-						if( $itm['item_id'] == 4704 ) {
-							$po['musor2'] = 4708;
-						}
-						$this->isport($itm['id'],$itm['timeOver'],$itm['overType'],$u['id'],(int)$po['musor2'],$itm['type'],$itm['name'],$po['zazuby']);
-						$notr++;
-					}
-				}
-				if($itm['iznosNOW']>=ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999){
-					$notr++;	
-				}
-				if($notr > 0 && $itm['inOdet'] != 0) {
-					//������� �������
-					$this->snatItem($itm['id'],$u['id']);
-					$snIt++;
-				}
-				//��������� ���� ��������
-				if($itm['iznosNOW']>=ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999){
-					//������� ��������
-					if(isset($po['musor'])){
-						if($po['musor']>0){
-							$this->recr($itm['id'],$itm['type'],$u['id'],(int)$po['musor']);
-						}
-					}
-				}
-				if($itm['time_create']+$itm['srok'] <= time() && $itm['srok']>0 && $itm['time_sleep'] == 0){
-					if($itm['inOdet']!=0){
-						$this->snatItem($itm['id'],$u['id']);
-						$snIt++;
-					}
-					//������� �������
-					if( $itm['item_id'] == 4704 ) {
-						$po['musor2'] = 4708;
-					}
-					$this->isport($itm['id'],$itm['timeOver'],$itm['overType'],$u['id'],(int)$po['musor2'],$itm['type'],$itm['name']);
-				}elseif($itm['time_create']+$itm['srok'] <= time() && $itm['srok']>0){
-					echo 'test';
-				}
-			}		
-			
-			if($snIt>0){
-				$this->testItems($uid,$sn,1);
-			}elseif($dt==0){
-				return -2;
-			}
-		}else{
-			return 0;
-		}
-	}
-	
-	public function recr($id,$tp,$uid,$id2){
-		if($id!=0){
-			if($uid!=0){
-				$uid2 = 'AND `uid`="'.$uid.'"';
-			}else{
-				$uid2 = '';
-			}
-			$upd = mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `id` = "'.$id.'" '.$uid2.' LIMIT 1');
-			if($upd){
-				$this->addDelo(2,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: ������� [itm:'.$it.'] ��� <b>������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				if($id2>1){
-					//��������� ������ �������
-					$this->addItem($id2,$uid,'noodet=1|noremont=1');
-				}
-			}
-		}
-	}
-	
-	public function isport($it,$t,$tp,$uid,$id2,$type,$name,$zub){
-		if($id2 == 4708 ) {
-			$tp = 1;	
-		}
-		if($it!=0){
-			if($uid!=0){
-				$uid2 = 'AND `uid`="'.$uid.'"';
-			}else{
-				$uid2 = '';
-			}
-			$upd = mysql_query('UPDATE `items_users` SET `delete`="'.time().'",`timeOver`="1" WHERE `id` = "'.$it.'" '.$uid2.' LIMIT 1');
-			if($upd){
-				$upd = mysql_query('UPDATE `items_users` SET `inGroup`="0",`timeOver`="'.time().'" WHERE `inGroup` = "'.$it.'" '.$uid2.'');
-				$this->addDelo(2,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: ������� <b>'.$name.'</b> [itm:'.$it.'] ��� <b>��������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				if($tp!=0){
-					//��������� ���������� ������� � ���������, � ����������� �� ����
-					$zzba = '';
-					if( $zub > 0 ) {
-						$zzba = '|zazuby=1';
-					}
-					$po = $this->lookStats($this->stats['items'][$i]['data']);
-					if($id2>0){
-						if($id2 == 4708 ) {
-							$this->addItem($id2,$uid,'|notransfer=1|nosale=1'.$zzba);
-						}else{
-							$this->addItem($id2,$uid,'|noodet=1'.$zzba);
-						}
-					}else{
-						if( $type == 30 ) {
-							//����������� �������
-							$this->addItem(4036,$uid,'|renameadd='.$name.'|noodet=1'.$zzba);
-						}
-					}
-				}				
-			}
-		}
-	}
-	
-	public function btlMagicList() {
-		global $c;
-		$i = 1; $sv = array();
-		while($i<=10) {
-			$sv[$i] = '<img class="nopriemuse" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w101.gif" />';
-			$i++;
-		}
-		$i = 0;
-		while($i < count($this->stats['items'])) {
-			if($this->stats['items'][$i]['inslot'] == 40 || $this->stats['items'][$i]['inslot'] == 51) {
-				if($this->stats['items'][$i]['useInBattle']==0 || $this->stats['items'][$i]['btl_zd']>0 || $this->stats['items'][$i]['iznosNOW']>=$this->stats['items'][$i]['iznosMAX'] || $this->stats['items'][$i]['magic_inci']=='' || $this->stats['items'][$i]['magic_inci']=='0') {
-					$vl = ' class="nopriemuse"';
-				}else{
-					$po = $this->lookStats($this->stats['items'][$i]['data']);
-					if($po['useOnLogin']==1) {
-						$useUrl = 'top.useMagicBattle(\''.$this->stats['items'][$i]['name'].'\','.$this->stats['items'][$i]['id'].',\''.$this->stats['items'][$i]['img'].'\',1,1,\'\',\''.$this->stats['items'][$i]['useInBattle'].'\');';
-					}else{
-						$useUrl = 'top.useMagicBattle(\''.$this->stats['items'][$i]['name'].'\','.$this->stats['items'][$i]['id'].',\''.$this->stats['items'][$i]['img'].'\',1,2);';
-					}
-					$vl = 'style="cursor:pointer" onclick="'.$useUrl.'"';
-				}
-				$sv[$this->stats['items'][$i]['inOdet']-39] = '<img '.$vl.' title="�������������: '.floor($this->stats['items'][$i]['iznosNOW']).'/'.floor($this->stats['items'][$i]['iznosMAX']).'" src="https://img.new-combats.com/i/items/'.$this->stats['items'][$i]['img'].'" />';
-			}
-			$i++;
-		}
-		$r = '<table border="0" cellspacing="0" cellpadding="0">'.
-	 	 	 	  '<tr>'.
-	 	 	 	 	 '<td>'.$sv[1].'</td>'.
-	 	 	 	 	 '<td>'.$sv[2].'</td>'.
-	 	 	 	 	 '<td>'.$sv[3].'</td>'.
-	 	 	 	 	 '<td>'.$sv[4].'</td>'.
-	 	 	 	 	 '<td>'.$sv[5].'</td>'.
-	 	 	 	 	 '<td>'.$sv[6].'</td>'.
-	 	 	 	 	 '<td>'.$sv[7].'</td>'.
-	 	 	 	 	 '<td>'.$sv[8].'</td>'.
-	 	 	 	 	 '<td>'.$sv[9].'</td>'.
-	 	 	 	 	 '<td>'.$sv[10].'</td>'.
-					'<td>'.$sv[11].'</td>'.
-					'<td>'.$sv[12].'</td>'.
-	 	 	 	 	 '</tr>'.
-	 	 	 	 '</table>';
-			return str_replace('"','\"',$r);
-	}
-	
-	public function nameItemMf($pl,$po) {
-		$r = $pl['name'];
-		if( isset($po['icos']) ) {
-			$r = '<span class=icos_'.$po['icos'].' >'.$pl['name'].' <span style=font-size:8px>&nbsp;'.$po['icos'].'&nbsp;</span></span>';
-		}
-		//if( $this->info['admin'] > 0 ) {
-			if(isset($po['rune']) && $po['rune']>0) {
-				$rnc = explode(' ',$po['rune_name']);
-				if($rnc[0] == '�����') {
-					$rnc = '#9b5d40';
-				}elseif($rnc[0] == '����') {
-					$rnc = '#3a2b64';
-				}elseif($rnc[0] == '����') {
-					$rnc = '#20a3b0';
-				}elseif($rnc[0] == '����') {
-					$rnc = '#4c7718';
-				}else{
-					$rnc = '#4c4c4c';
-				}
-				$r .= '<br><font color=green>����: <b>'.$po['rune_name'].'</b></font>';
-				unset($rnc);
-			}
-			if( isset($po['spell']) ) {
-				$rnc = explode(' ',$po['spell_name']);
-				if($rnc[2] == '[0]') {
-					$rnc = '#282828';
-				}elseif($rnc[2] == '[1]') {
-					$rnc = '#624542';
-				}elseif($rnc[2] == '[2]') {
-					$rnc = '#77090b';
-				}elseif($rnc[2] == '[3]') {
-					$rnc = '#d99800';
-				}else{
-					$rnc = '#282828';
-				}
-				$r .= '<br><font color='.$rnc.'>'.$po['spell_name'].'</font>';
-				unset($rnc);
-			}
-		return $r;
-	}
-	
-			public function getInfoItemInfo($pl) {
-				$lvar = '';
-				$td = $this->lookStats($pl['data']);
-		
-				/*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$lvar .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['add_mpAll']) && $td['add_mpAll']!=0)
-				{
-					if($td['add_mpAll']>0)
-					{
-						$td['add_mpAll'] = '+'.$td['add_mpAll'];
-					}
-					$lvar .= '<br>������� ����: '.$td['add_mpAll'].'';
-				}*/
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$lvar .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$lvar .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				//
-					$t = $this->items['add'];
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($td['add_'.$n],$this->is[$n])){
-							$z = '+';
-							if($td['add_'.$n]<0){
-								$z = '';
-							}
-							$lvar .= '<br>'.$this->is[$n].': '.$z.''.$td['add_'.$n];
-						}
-						$x++;
-					}
-					//
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($td['sv_'.$n])){
-							$z = '+';
-							if($td['sv_'.$n]<0){
-								$z = '';
-							}
-							if( $n != 'yron_min' && $n != 'yron_max' ) {
-								$lvar .= '<br>'.$this->is[$n].': '.$z.''.$td['sv_'.$n];
-							}
-						}
-						$x++;
-					}
-					if($pl['2h']==1){
-						$lvar .= '<br>� ��������� ������';
-					}
-					if(isset($po['zonb'])){
-						$lvar .= '<br>���� ������������: ';
-						if($lvar['zonb']>0){
-							$x = 1;
-							while($x<=$td['zonb']){
-								$lvar .= '+';
-								$x++;
-							}
-						}else{
-							$lvar .= '�';
-						}
-					}					
-					
-				//
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$lvar .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$lvar .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$lvar .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}				
-				if($pl['iznosMAX']>0)
-				{
-	 	 	 	 	 if($pl['iznosMAXi'] >= 909999999) {
-						//$lvar .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$lvar .= '<br>�������������: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']);
-					}
-				}
-				
-				if( $po['battleUseZd'] > 0 ) {
-					$lvar .= '<br>�������� �������������: '.$this->timeOut($po['battleUseZd']).'';
-				}	
-				
-				if(isset($td['gravi'])) {
-					$lvar .= '<hr><b>&quot;<i>'.$td['gravi'].'</i>&quot;</b>';
-				}
-									
-				return $lvar;
-			}
-
-	
-	public function getInfoPers($uid,$i1,$sn = 0,$ivv = 0){
-		global $c,$code;
-		
-		$st = false; $rt = false; $type_info = 1;
-		if($uid!=$this->info['id']){
-			$u = mysql_fetch_array(mysql_query('SELECT `u`.`inTurnir`,`u`.`allLock`,`u`.`battle`,`u`.`zag`,`u`.`banned`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`,
-			`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-			FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			if($sn==0){
-				$sn = $this->getStats($uid,$i1);
-			}
-		}else{
-			$u  = $this->info;
-			if(isset($this->stats['hpAll'])){
-				$sn = $this->stats;
-			}elseif($sn!=0){
-			}else{
-				$sn = $this->getStats($uid,$i1);
-			}
-		}
-
-		$tp_img = array(
-			1 => 4,
-			2 =>5,
-			14 => 6,
-			3 => 7,
-			5 => 8,
-			7 => 9,
-			17 => 10,
-			16 => 11,
-			13 => 12,
-			10 => 13,
-			9 => 14,
-			8 => 15,
-			11 => 17, //������ 2
-			12 => 18 //������ 3		
-		);
-
-		if(isset($u['id'],$u['stats'])){
-			//if( $u['inTurnir'] > 0 ) {
-			//	$type_info = 2;
-			//}
-			$rt = array(0=>'',1=>array());
-			$st = array();
-			$st['id'] = $u['id'];
-			$st['login'] = $u['login'];
-			$st['lvl'] = $u['level'];
-
-			//�������������� �� ��������� � �� �����������
-			$witm	 = array();
-			$witm[1] =  '<img width="60" height="60" style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w9.gif">';
-			$witm[2] =  '<img width="60" height="40" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w13.gif">';
-			$witm[3] =  '<img width="60" height="60" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w3.gif">';
-			$witm[4] =  '<img width="60" height="80" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w4.gif">';
-			$witm[7] =  '<img width="60" height="40" style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w5.gif">';
-			$witm[8] =  '<img width="60" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w1.gif">';
-			$witm[9] =  '<img width="60" height="20" style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w2.gif">';
-			$witm[10] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-			$witm[11] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-			$witm[12] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-			$witm[13] = '<img width="60" height="40" style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w11.gif">';
-			$witm[14] = '<img width="60" height="60" style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/i/items/w/w10.gif">';
-			$witm[16] = '<img width="60" height="80" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w19.gif">';
-			$witm[17] = '<img width="60" height="40" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w12.gif">';
-			//40-52 ���� ��� �����		
-			$witm[53] = '<img width="40" height="20" style="display:block;" title="������ ���� ������ ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-			$witm[54] = '<img width="40" height="20" style="display:block;" title="������ ���� ����� ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-			$witm[55] = '<img width="40" height="20" style="display:block;" title="������ ���� ����������� ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-			$witm[56] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-			$witm[57] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-			$witm[58] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-			$cl = mysql_query('SELECT 
-			`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-			`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-			FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$u['id'].'" AND `iu`.`delete`="0"');
-			$wj = array(1=>false,2=>false,4=>false,5=>false,6=>false);
-			$b1 = '<br>';
-			
-			while($pl = mysql_fetch_array($cl))
-			{				
-				$td = $this->lookStats($pl['data']);	
-				
-				if(isset($td['modif'])) {
-					$pl['name'] = $pl['name'].' (��)';
-				}
-				
-				if(isset($td['upatack_lvl']))
-				{
-					$pl['name'] = $pl['name'].' +'.$td['upatack_lvl'];
-				}
-								
-				if(isset($td['mod_lvl']))
-				{
-					$pl['name'] = $pl['name'].' '.$mx.' ['.$td['mod_lvl'].']';
-				}
-				
-				if($pl['inOdet']==1 || $pl['inOdet']==52 || ($pl['inOdet']>=4 && $pl['inOdet']<=6))
-				{
-					$wj[$pl['inOdet']] = $pl;
-				}
-				
-				$pl['name'] = $this->nameItemMf($pl,$td);
-												
-				$lvar = '';
-				/*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']!=0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$lvar .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$lvar .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$lvar .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$lvar .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$lvar .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$lvar .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}				
-				if($pl['iznosMAX']>0)
-				{
-	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$lvar .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$lvar .= '<br>�������������: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']);
-					}
-				}
-				
-				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '<br>�������� �������������: '.$this->timeOut($po['battleUseZd']).'';
-				}
-				
-				if(isset($td['gravi'])) {
-					$td['gravitp'] = array(
-						18 => '�������',
-						19 => '������',
-						20 => '������',
-						21 => '������',
-						22 => '������',
-						23 => '����',
-						24 => '��������',
-						26 => '��������',
-						27 => '��������',
-						28 => '��������'
-					);
-					$lvar .= '<br>�� '.$td['gravitp'][$pl['type']].' ������������� �������: '.$td['gravi'].'';
-					unset($td['gravitp']);
-				}*/
-				
-				/*
-				if( $pl['inOdet'] == 3 ) {
-					if( $pl['2h'] == 1 ) {
-						if(@isset($sn['items_img'][$tp_img[14]])) {
-							$uimg2 = 'rimg/r'.$sn['items_img'][$tp_img[14]];
-							$witm[14] = '<img width="60" height="60" style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/'.$uimg2.'">';
-						}else{
-							$uimg2 = 'i/items/'.$pl['img'].'';
-							$witm[14] = '<img width="60" height="60" style="background-image:url(https://img.new-combats.com/i/items/w/w10.gif);display:block;filter:alpha(opacity=37);opacity:0.37;-moz-opacity:0.37;-khtml-opacity:0.37;" title="������ ���� ���" src="https://img.new-combats.com/'.$uimg2.'">';
-						}
-						unset($uimg2);
-					}
-				}
-				*/
-				
-				$lvar = $this->getInfoItemInfo($pl);
-								
-				if(@isset($sn['items_img'][$tp_img[$pl['inOdet']]])) {
-					$uimg = 'rimg/r'.$sn['items_img'][$tp_img[$pl['inOdet']]];
-				}else{
-					$uimg = 'i/items/'.$pl['img'].'';
-				}
-				
-				$witm[$pl['inOdet']]  = '<img style="display:block;" src="https://img.new-combats.com/'.$uimg.'" onMouseOver="top.hi(this,\'<center><b>'.$pl['name'].'</b>'.$lvar.'</center>\',event,3,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-				
-				if($i1==1){
-					$witm[$pl['inOdet']] = '<a href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$witm[$pl['inOdet']].'</a>';
-				}else{
-					if($pl['inOdet']>=40 && $pl['inOdet']<=52 && !isset($_GET['inv'])){
-						$useUrl = '';
-						if($pl['magic_inc']==''){
-							$pl['magic_inc'] = $pl['magic_inci'];
-						}
-						if($pl['magic_inc'] && $pl['type']==30){
-							//���������� �������
-							$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-							$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');';
-						}elseif($pl['magic_inc'] && $pl['type']==29){
-							//���������� ��������
-							//�� ���������
-							if(isset($td['useOnLogin'])){
-								$inv1 = '';
-								if(isset($_GET['inv'])) {
-									$inv1 = 'inv=1&otdel='.((int)$_GET['otdel']).'&';
-								}
-								$useUrl = 'top.useMagic(\''.$pl['name'].'\','.(0+$pl['id']).',\''.$pl['img'].'\',1,\'main.php?'.$inv1.'use_pid='.$pl['id'].'&rnd='.$code.'\');';
-							}else{
-								//������ ������������� (�� ����, ���� ��� �������� ��������\������)
-								$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-								$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');';
-							}				
-						}
-						$witm[$pl['inOdet']] = '<a href="javascript:void(0);" onClick="'.$useUrl.'">'.$witm[$pl['inOdet']].'</a>';
-					}elseif($pl['item_id']==998 && !isset($_GET['inv'])){
-						//�������
-						$witm[$pl['inOdet']] = '<a href="main.php?use_snowball='.$code.'">'.$witm[$pl['inOdet']].'</a>';
-					}else{
-						$witm[$pl['inOdet']] = '<a href="main.php?otdel='.$pl['inRazdel'].'&inv=1&sid='.$pl['id'].'&rnd='.$code.'">'.$witm[$pl['inOdet']].'</a>';
-					}
-				}
-			}
-			//����,�����
-			$wj1i = '';
-			$br  = '<div align=\\\'center\\\' style=\\\'margin:4px;\\\'><img src=\\\'https://img.new-combats.com/1x1.gif\\\' height=\\\'1\\\' width=\\\'111\\\' style=\\\'background-color:black;\\\'></div>';
-			if($wj[1]!=false)
-			{	
-			if($wj[52] != false) { $wj1i .= $br; }
-				$td = array();							
-				$td = $this->lookStats($wj[1]['data']);
-				$wj[1]['name'] = $this->nameItemMf($wj[1],$td);
-				$wj1i .= '<b>'.$wj[1]['name'].'</b>';	
-				$wj1i .= $this->getInfoItemInfo($wj[1]);
-				/*
-				if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj1i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj1i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj1i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj1i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj1i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj1i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[1]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[1]['iznosMAXi'] == 999999999) {
-						$wj1i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj1i .= '<br>�������������: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).'';
-					}
-				}*/
-			}
-			if(isset($wj[52]) && $wj[52]!=false)
-			{
-				$td = $this->lookStats($wj[52]['data']);
-				$wj[52]['name'] = $this->nameItemMf($wj[52],$td);
-				/*$wj1i = $wj1i;
-
-				if($wj[52]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[52]['iznosMAXi'] == 999999999) {
-						$wj1i = '<br>�������������: <font color=brown>�����������</font ><br>'.$wj1i;
-					}else{					
-						$wj1i = '<br>�������������: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i = '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i;
-					}
-				}
-
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i = '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i = '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i = '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj1i = '<br>������� �����: '.$td['add_hpAll'].''.$wj1i;
-				}
-				
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj1i = '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i;
-				}*/
-				
-				
-				$wj1i = '<b>'.$wj[52]['name'].'</b>'.$wj1i;
-				$wj1i .= $this->getInfoItemInfo($wj[52]);
-				$wj[1]['img'] = $wj[52]['img'];
-				$wj[1]['id']  = $wj[52]['id'];
-				$wj[1]['inRazdel'] = $wj[52]['inRazdel'];
-			}
-			//������,�����,����
-			$wj4idd = $wj[5]['item_id'];
-			$wj4i = '';
-			if($wj[6]!=false)
-			{
-				$td = array();	
-				$td = $this->lookStats($wj[6]['data']);
-				$wj[6]['name'] = $this->nameItemMf($wj[6],$td);
-				$wj4i .= '<b>'.$wj[6]['name'].'</b>';				
-				/*if($td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if($td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if($td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if($td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if($td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if($td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[6]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[6]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj4i .= '<br>�������������: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).'';
-					}
-				}*/
-				$wj4i .= $this->getInfoItemInfo($wj[6]);
-				if($wj[5]!=false || $wj[4]!=false)
-				{
-					$wj4i .= $br;
-				}
-			}
-			if($wj[5]!=false)
-			{
-				$td = array();	
-				$td = $this->lookStats($wj[5]['data']);	
-				$wj[5]['name'] = $this->nameItemMf($wj[5],$td);
-				$wj4i .= '<b>'.$wj[5]['name'].'</b>';				
-				/*if($td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[5]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[5]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj4i .= '<br>�������������: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).'';
-					}
-				}
-				*/
-				$wj4i .= $this->getInfoItemInfo($wj[5]);
-				if($wj[4]!=false)
-				{
-					$wj4i .= $br;
-				}
-			}
-			if($wj[4]!=false)
-			{
-				$td = array();	
-				$td = $this->lookStats($wj[4]['data']);
-				$wj[4]['name'] = $this->nameItemMf($wj[4],$td);
-				$wj4i .= '<b>'.$wj[4]['name'].'</b>';					
-				/*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[4]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[4]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj4i .= '<br>�������������: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).'';
-					}
-				}*/
-				$wj4i .= $this->getInfoItemInfo($wj[4]);
-			}
-			/*if($wj[6]!=false)
-			{
-				$wj[4]['img'] = $wj[6]['img'];
-				$wj[4]['id']  = $wj[6]['id'];
-				$wj[4]['inRazdel'] = $wj[6]['inRazdel'];
-			}elseif($wj[5]!=false)
-			{
-				$wj[4]['img'] = $wj[5]['img'];
-				$wj[4]['id']  = $wj[5]['id'];
-				$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-			}elseif($wj[4]!=false)
-			{
-
-			}*/
-			if( /*$i1 == 1 &&*/ (($this->info['noplaw'] == 1 && !isset($_GET['hide_plaw'])) || ($this->info['noplaw'] == 0 && isset($_GET['hide_plaw']))) ) {
-				if($wj[5]!=false)
-				{
-					$wj[4]['img'] = $wj[5]['img'];
-					$wj[4]['id']  = $wj[5]['id'];
-					$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-				}elseif($wj[4]!=false)
-				{
-					
-				}
-			}else{
-				if($wj[6]!=false)
-				{
-					$wj[4]['img'] = $wj[6]['img'];
-					$wj[4]['id']  = $wj[6]['id'];
-					$wj[4]['inRazdel'] = $wj[6]['inRazdel'];
-				}elseif($wj[5]!=false)
-				{
-					$wj[4]['img'] = $wj[5]['img'];
-					$wj[4]['id']  = $wj[5]['id'];
-					$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-				}elseif($wj[4]!=false)
-				{
-					
-				}
-			}
-			if($wj[1]!=false || $wj[2]!=false)
-			{
-				if(isset($sn['items_img'][$tp_img[1]])) {
-					$uimg = 'rimg/r'.$sn['items_img'][$tp_img[1]];
-				}else{
-					$uimg = 'i/items/'.$wj[1]['img'].'';
-				}
-				$witm[1] = '<img style="display:block;" src="https://img.new-combats.com/'.$uimg.'" onMouseOver="top.hi(this,\'<center>'.$wj1i.'</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-				if($i1==1)
-				{
-					$witm[1] = '<a href="https://new-combats.com/item/'.$wj[1]['item_id'].'" target="_blank">'.$witm[1].'</a>';
-				}else{
-					$witm[1] = '<a href="main.php?otdel='.$wj[1]['inRazdel'].'&inv=1&sid='.$wj[1]['id'].'&rnd='.$code.'">'.$witm[1].'</a>';
-				}	
-			}
-			if($wj[4]!=false || $wj[5]!=false || $wj[6]!=false)
-			{
-				if(isset($sn['items_img'][$tp_img[5]])) {
-					$uimg = 'rimg/r'.$sn['items_img'][$tp_img[5]];
-				}else{
-					$uimg = 'i/items/'.$wj[4]['img'].'';
-				}
-				$witm[4] = '<img style="display:block;" src="https://img.new-combats.com/'.$uimg.'" onMouseOver="top.hi(this,\'<center>'.$wj4i.'</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-				if($i1==1)
-				{
-					if( $wj4idd > 0 ) {
-						$wj[4]['item_id'] = $wj4idd;
-					}
-					$witm[4] = '<a href="https://new-combats.com/item/'.$wj[4]['item_id'].'" target="_blank">'.$witm[4].'</a>';
-				}else{
-					$witm[4] = '<a href="main.php?otdel='.$wj[4]['inRazdel'].'&inv=1&sid='.$wj[4]['id'].'&rnd='.$code.'">'.$witm[4].'</a>';
-				}	
-			}
-			/*------------ ���������� ���. � ��������� ---------------*/
-			$nmmsgl1 = 0;
-			if($u['align'] >= 1 && $u['align'] < 2) {
-				$nmmsgl1 = 1;
-			}elseif($u['align'] >= 3 && $u['align'] < 4) {
-				$nmmsgl1 = 3;
-			}elseif($u['align'] >= 7 && $u['align'] < 8) {
-				$nmmsgl1 = 7;
-			}elseif($u['align'] >= 50 && $u['align'] < 50) {
-				$nmmsgl1 = 60;
-			}
-			if($u['admin'] > 0) {
-				$nmmsgl1 = 60;
-			}
-			$anan = array(
-				1 => 'cat',
-				2 => 'owl',
-				3 => 'wisp',
-				4 => 'demon',
-				5 => 'dog',
-				6 => 'pig'
-			);
-			$anan2 = array(
-				1 => '���',
-				2 => '����',
-				3 => '�������',
-				4 => '�������',
-				5 => 'ϸ�',
-				6 => '����'
-			);
-			$anml = '';
-			if($u['animal']>0)
-			{
-				$an = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "'.$u['animal'].'" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1'));
-				if(isset($an['id']))
-				{
-					if($i1 != 1){
-						//$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><a href="main.php?pet"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].'] (���������� �����)"></a></div>';
-					}else{
-						if( $an['eda'] > 0 ) {
-							//$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].']"></div>';
-						}
-					}
-					$petimg = mysql_fetch_array(mysql_query('SELECT `id`,`img` FROM `obraz_pet` WHERE `uid` = "'.$u['id'].'" AND `use` = 1 LIMIT 1'));
-					if(isset($petimg['id'])) {
-						$anml = '<img height="40" width="120" src="https://'.$c['img'].'/pet/'.$petimg['img'].'" onMouseOver="top.hi(this,\'<b>'.$an['name'].'</b> <i>('.$anan2[$an['type']].')</i><br>�������: '.$an['level'].'\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-					}else{
-						$anml = '<img height="40" width="120" src="https://'.$c['img'].'/pet/'.$anan[$an['type']].'.png" onMouseOver="top.hi(this,\'<b>'.$an['name'].'</b><i>('.$anan2[$an['type']].')</i><br>�������: '.$an['level'].'\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-					}
-				}
-			}
-			unset($anan);
-			
-			if(@isset($sn['items_img'][2])) {
-				$msl = '<img width="120" height="40" style="display:block" src="https://img.new-combats.com/rimg/r'.$sn['items_img'][2].'">';
-			}else{
-				if( $anml == '' ) {
-					$msl = '<img width="120" height="40" style="display:block" src="https://img.new-combats.com/i/slot_bottom'.$nmmsgl1.'.gif">';
-				}else{
-					$msl = $anml;
-				}
-			}
-			unset($nmmsgl1);
-			$jf = '';
-			$oi = '';
-			if($i1!=1)
-			{
-				$jf = 'main';
-				$oi = 'onMouseOver="top.hi(this,\''.$u['login'].' (������� � &quot;���������&quot;)\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"';
-				$msl = '<table width="120" border="0" cellspacing="0" cellpadding="0">
-						<tr>
-						  <td width="40" height="20">'.$witm[53].'</td>
-						  <td width="40" height="20">'.$witm[55].'</td>
-						  <td width="40" height="20">'.$witm[54].'</td>
-						</tr>
-						<tr>
-						  <td width="40" height="20">'.$witm[56].'</td>
-						  <td width="40" height="20">'.$witm[57].'</td>
-						  <td width="40" height="20">'.$witm[58].'</td>
-						</tr>
-					  </table>';
-			}
-			$hpmp = '';
-			$eff = '';
-			//-------- ���������� �������
-			$efs = mysql_query('SELECT 
-			`eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`tr_life_user`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`,
-			`em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch`
-			 FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `delete`="0" AND `deactiveTime` < "'.time().'" ORDER BY `deactiveTime` DESC,`timeUse` ASC');
-			while($e = mysql_fetch_array($efs))
-			{
-				$esee = 1;
-				if($e['see']==0 && $i1==1)
-				{
-					$esee = 0;
-				}
-				if($e['see']==2 && ($u['battle']!=$this->info['battle'] || $this->info['battle']==0))
-				{
-					$esee = 0;
-				}
-				if($e['see']==3 && $i1==0)
-				{
-					$esee = 0;
-				}
-				if($e['img'] == '') {
-					$esee = 0;
-				}
-				
-				if(($e['timeUse']+$e['timeAce']+$e['actionTime']>=time() || $e['timeUse']==77) && $esee == 1)
-				{
-					$ei = '<b><u>'.$e['name'].'</u></b>';
-					if($e['type1']>0 && $e['type1']<7)
-					{
-						$ei .= ' (�������)';
-					}elseif(($e['type1']>6 && $e['type1']<11) || $e['type1']==16)
-					{
-						$ei .= ' (��������)';
-					}elseif($e['type1']==14)
-					{
-						$ei .= ' (�����)';
-					}elseif($e['type1']==15)
-					{
-						$ei .= ' (��������)';
-					}elseif($e['type1']==17)
-					{
-						$ei .= ' (���������)';
-					}elseif($e['type1']==18 || $e['type1']==19)
-					{
-						$ei .= ' (������)';
-					}elseif($e['type1']==20)
-					{
-						$ei .= ' (�����������)';
-					}elseif($e['type1']==22)
-					{
-						$ei .= ' (��������)';
-					}else{
-						$ei .= ' (������)';
-					}
-					$ei .= '<br>';
-					
-					if($e['type1']!=13 && $e['timeUse']!=77)
-					{
-						$out = '';
-						$time_still = ($e['timeUse']+$e['timeAce']+$e['actionTime'])-time();
-						$tmp = floor($time_still/2592000);
-						$id=0;
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." ���. ";}
-							$time_still = $time_still-$tmp*2592000;
-						}
-						$tmp = floor($time_still/604800);
-						if ($tmp > 0) { 
-						$id++;
-						if ($id<3) {$out .= $tmp." ���. ";}
-						$time_still = $time_still-$tmp*604800;
-						}
-						$tmp = floor($time_still/86400);
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." ��. ";}
-							$time_still = $time_still-$tmp*86400;
-						}
-						$tmp = floor($time_still/3600);
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." �. ";}
-							$time_still = $time_still-$tmp*3600;
-						}
-						$tmp = floor($time_still/60);
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." ���. ";}
-						}
-						if($out=='')
-						{
-							$out = $time_still.' ���.';
-						}
-						$ei .= '��������: '.$out.'';
-					}
-					
-					//�������� �������
-					$tr = ''; $t = $this->items['add'];
-					$x = 0; $ed = $this->lookStats($e['data']);	
-					while($x<count($t))
-					{
-						$n = $t[$x];
-						if(isset($ed['add_'.$n],$this->is[$n]))
-						{
-							$z = '';
-							if($ed['add_'.$n]>0)
-							{
-								$z = '+';
-							}
-							$tr .= '<br>'.$this->is[$n].': '.$z.''.$ed['add_'.$n];
-						}
-						$x++;
-					}
-					if($tr!='')
-					{
-						$ei .= $tr;
-					}
-					if($e['info']!='')
-					{
-						$ei .= '<br><i>����������:</i><br>'.$e['info'];
-					}
-					if($e['img2']!='' && $e['img']=='icon_none.gif')
-					{
-						$e['img'] = $e['img2'];
-					}
-					if($e['type1']==18 || $e['type1']==19)
-					{
-					$e['img'] = $e['img2'];
-					}
-					$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="https://img.new-combats.com/i/eff/'.$e['img'].'"onMouseOver="top.hi(this,\''.$ei.'\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
-				}elseif($e['timeUse']+$e['timeAce']+$e['actionTime']<time() && $e['timeUse']!=77)
-				{
-					//������� ������
-					$ed = $this->lookStats($e['data']);
-					if(!isset($ed['finish_file']) || $this->info['id'] == $e['uid']) {
-						$this->endEffect($e['id'],$u);
-					}
-				}
-			}
-			
-			if($sn['itmslvl'] == 0) {
-				//$ei = '<b><u>������ ����������</u></b> (������)<br>��������: <i>����������</i>';
-				//$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="https://img.new-combats.com/i/eff/light_armor.gif"onMouseOver="top.hi(this,\''.$ei.'\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
-			}
-			
-			//��������
-			if( $type_info == 1 ) {
-				$hptop = 0;
-				$lh = array(0=>'hp_none',1=>1);
-				$lh[1] = floor((0+$sn['hpNow'])/(0+$sn['hpAll'])*120);
-				if($lh[1]>0){  $lh[0] = 'hp_1'; }
-				if($lh[1]>32){ $lh[0] = 'hp_2'; }
-				if($lh[1]>65){ $lh[0] = 'hp_3'; }
-				if($sn['mpAll']>0)
-				{
-					//����
-					$lm = array(0=>'hp_none',1=>1);
-					$lm[1] = floor($sn['mpNow']/$sn['mpAll']*120);
-					if($lm[1]>0){ $lm[0] = 'hp_mp'; }
-					$hpmp .='<div id="vmp'.$u['id'].'" title="������� ����" align="center" class="seemp" style="position:absolute; top:10px; left:-5px; width:120px; height:10px; z-index:12;">'.floor($sn['mpNow']).'/'.(0+$sn['mpAll']).'</div>
-							 <div title="������� ����" class="hpborder" style="position:absolute; top:10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div class="'.$lm[0].' senohp" style="height:9px; position:absolute; top:10px; width:'.$lm[1].'px; z-index:11;" id="lmp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div title="������� ����" class="hp_none" style="position:absolute; top:10px; width:120px; height:10px; z-index:10;"></div>';
-				}else{
-					$hptop = 5;
-				}
-				$hpmp = '<div id="vhp'.$u['id'].'" title="������� �����" align="center" class="seehp" style="position:absolute; top:'.$hptop.'px;  left:-5px; width:120px; height:10px; z-index:12;">'.floor($sn['hpNow']).'/'.(0+$sn['hpAll']).'</div>
-						 <div title="������� �����" class="hpborder" style="position:absolute; top:'.$hptop.'px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div class="'.$lh[0].' senohp" style="height:9px; width:'.$lh[1].'px; position:absolute; top:'.$hptop.'px; z-index:11;" id="lhp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div title="������� �����" class="hp_none" style="position:absolute; top:'.$hptop.'px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>'.$hpmp;
-				//�������� �� � ��
-				$hpmp = '<div style="position:relative;">'.$hpmp.'</div>';
-			}elseif( $type_info == 2 ) {
-				$hptop = 0;
-				$lh = array(0=>'hp_none',1=>1);
-				$lh[1] = floor((0+$sn['hpNow'])/(0+$sn['hpAll'])*200);
-				if($lh[1]>0){  $lh[0] = 'hp_1'; }
-				if($lh[1]>32){ $lh[0] = 'hp_2'; }
-				if($lh[1]>65){ $lh[0] = 'hp_3'; }
-				if($sn['mpAll']>0)
-				{
-
-					//����
-					$lm = array(0=>'hp_none',1=>1);
-					$lm[1] = floor($sn['mpNow']/$sn['mpAll']*200);
-					if($lm[1]>0){ $lm[0] = 'hp_mp'; }
-					$hpmp .='<div id="vmp'.$u['id'].'" title="������� ����" align="center" class="seemp" style="position:absolute; top:10px; width:200px; height:10px; z-index:12;"> '.floor($sn['mpNow']).'/'.(0+$sn['mpAll']).'</div>
-							 <div title="������� ����" class="hpborder" style="position:absolute; top:10px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div class="'.$lm[0].' senohp" style="height:9px; position:absolute; top:10px; width:'.$lm[1].'px; z-index:11;" id="lmp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div title="������� ����" class="hp_none" style="position:absolute; top:10px; width:200px; height:10px; z-index:10;"></div>';
-				}else{
-					$hptop = 5;
-				}
-				$hpmp = '<div id="vhp'.$u['id'].'" title="������� �����" align="center" class="seehp" style="position:absolute; top:'.$hptop.'px; width:200px; height:10px; z-index:12;"> '.floor($sn['hpNow']).'/'.(0+$sn['hpAll']).'</div>
-						 <div title="������� �����" class="hpborder" style="position:absolute; top:'.$hptop.'px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div class="'.$lh[0].' senohp" style="height:9px; width:'.$lh[1].'px; position:absolute; top:'.$hptop.'px; z-index:11;" id="lhp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div title="������� �����" class="hp_none" style="position:absolute; top:'.$hptop.'px; width:200px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>'.$hpmp;
-				//�������� �� � ��
-				$hpmp = '<div style="position:relative;height:20px;">'.$hpmp.'</div>';
-			}
-			
-			$lgn = '<b>'.$u['login'].'</b> ['.$u['level'].']<a href="/info/'.$u['id'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif"></a>';
-			if($u['clan']!=0)
-			{
-				$pc = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id`="'.$u['clan'].'" LIMIT 1'));
-				$pc['img'] = $pc['name_mini'].'.gif';
-				$lgn = '<img title="'.$pc['name'].'" src="https://img.new-combats.com/i/clan/'.$pc['name_mini'].'.gif">'.$lgn;
-			}
-			if($u['align2']>0)
-			{
-				$lgn = '<img title="'.$this->mod_nm[floor(intval($u['align2']))][$u['align2']].'" src="https://img.new-combats.com/i/align/align'.$u['align2'].'.gif">'.$lgn;
-			}
-			if($u['align']>0)
-			{
-				$lgn = '<img title="'.$this->mod_nm[floor(intval($u['align']))][$u['align']].'" src="https://img.new-combats.com/i/align/align'.$u['align'].'.gif">'.$lgn;
-			}
-			$pb = '';
-			if($u['banned']>0)
-			{
-				$pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><b>�������� ������������</b></font></div>';
-			}
-			if($u['allLock'] > time()) {
-				$pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><b>��������� ������ �������!</b></font></div>';
-			}
-			
-			$swm = 0; //������ �����
-			$l = 40;
-			while($l<=52)
-			{
-				if(isset($witm[$l]))
-				{
-					$swm++;
-				}else{
-					$witm[$l] = '<img title="������ ���� ����������" src="https://img.new-combats.com/i/items/w/w101.gif">';
-				}
-				$l++;
-			}
-			
-			$ssm = 0; //����� �����
-			$l = 59;
-			while($l<=62)
-			{
-				if(isset($witm[$l]))
-				{
-					$ssm++;
-				}else{
-					$witm[$l] = '<img width="60" height="60" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w83.gif">';
-				}
-				$l++;
-			}
-			
-			$witmg = '';
-			
-			if($ssm>0 && $i1==0)
-			{
-				$witmg .= '<table style="padding-top:2px;padding-bottom:2px;" width="240" border="0" cellspacing="0" cellpadding="0">
-  <tr>
-	 <td width="60" height="60">'.$witm[59].'</td>
-	 <td width="60">'.$witm[60].'</td>
-	 <td width="60">'.$witm[61].'</td>
-	 <td width="60">'.$witm[62].'</td>
-  </tr>
-</table>';
-			}
-			
-			if($swm>0 && $i1==0)
-			{
-				$witmg .= '<table width="240" border="0" cellspacing="0" cellpadding="0">
-  <tr>
-	 <td width="40" height="25">'.$witm[40].'</td>
-	 <td width="40">'.$witm[41].'</td>
-	 <td width="40">'.$witm[42].'</td>
-	 <td width="40">'.$witm[43].'</td>
-	 <td width="40">'.$witm[44].'</td>
-	 <td width="40">'.$witm[50].'</td>
-  </tr>
-  <tr>
-	 <td height="25">'.$witm[45].'</td>
-	 <td>'.$witm[46].'</td>
-	 <td>'.$witm[47].'</td>
-	 <td>'.$witm[48].'</td>
-	 <td>'.$witm[49].'</td>
-	 <td>'.$witm[51].'</td>
-  </tr>
-
-</table>';
-			}
-			$zag = '';
-			if($u['zag']!='' && $i1 == 1) {
-				$rt[0] .= '<style> .inf2s { position:relative; filter: alpha(opacity=10); -moz-opacity: 0.10; -khtml-opacity: 0.10; opacity: 0.10; } .inf2s:hover { background-color:#e2e0e0;filter: alpha(opacity=70); -moz-opacity: 0.70; -khtml-opacity: 0.70; opacity: 0.70; } </style>';
-				
-				$zag = '<img width="243" height="283" style="position:absolute;top:-1px;left:-1px;" src="https://img.new-combats.com/i/zag/'.$u['zag'].'">';
-/*
-				$witmn[1] = '<img style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w9.gif">';
-				$witmn[2] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w13.gif">';
-				$witmn[3] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w3.gif">';
-				$witmn[4] = '<img style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w4.gif">';
-				$witmn[7] = '<img style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w5.gif">';
-				$witmn[8] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w1.gif">';
-				$witmn[9] = '<img style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w2.gif">';
-				$witmn[10] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[11] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[12] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[13] = '<img style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w11.gif">';
-				$witmn[14] = '<img style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/i/items/w/w10.gif">';
-				$witmn[16] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w19.gif">';
-				$witmn[17] = '<img style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w12.gif">';
-*/
-				$j2 = 0;
-				while($j2 <= 17) {
-					$witm[$j2] = '<div class="inf2s">'.$witm[$j2].'</div>';
-					$j2++;
-				}
-				
-				$eff = $eff;
-				
-			}
-			//<div style="width:240px; padding:2px; border-bottom:1px solid #666666; border-right:1px solid #666666; border-left:1px solid #FFFFFF; border-top:1px solid #FFFFFF;">
-			if( $type_info == 1 ) {
-				if( $pb != '' ) {
-					$pb = '<div align="center" style="width:246px;"><!-- blocked -->'.$pb.'</div>';
-				}
-				$rt[0] .= '<div id="lgnthm" style="width:246px; padding:0 3px 0 3px;" align="center">'.$lgn.'</div>'.$pb.'
-				<div class="personag" style="width:240px; background-color:#CCC; padding:3px; margin-right:11px; border-bottom:1px solid #666666; border-right:1px solid #666666; border-left:1px solid #FFFFFF; border-top:1px solid #FFFFFF;">
-				<table width="240" border="0" cellspacing="0" cellpadding="0">
-				  <tr>
-					<td width="60" valign="top">
-					<table bgcolor="#e1e1e1" width="60" height="280" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="60"><div style="position:relative">'.$zag.''.$witm[1].'</div></td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[2].'</td>
-					  </tr>
-					  <tr>
-						<td height="60">'.$witm[3].'</td>
-					  </tr>
-					  <tr>
-						<td height="80">'.$witm[4].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[7].'</td>
-					  </tr>
-					</table>
-					</td>
-					<td height="280" valign="top">
-					<table bgcolor="#e1e1e1" width="120" height="280" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="20" bgcolor="#CCC" valign="top">
-						<!-- HP and MP -->
-						'.$hpmp.'
-						<!-- -->
-						</td>
-					  </tr>
-					  <tr>
-						<td valign="top">';
-						if($zag == ''){
-							if($i1 == 0) {
-								if(!isset($_GET['inv'])) {
-									$invg = array(0=>'main.php?inv=1',1=>'������');
-								}else{
-									$invg = array(0=>'main.php?skills=1',1=>'������');	
-								}
-							}else{
-								$o = mysql_fetch_array(mysql_query('SELECT `id` FROM `obraz` WHERE `img` = "'.mysql_real_escape_string($this->info['obraz']).'" AND `sex` = "'.$this->info['sex'].'" LIMIT 1'));
-								$invg = array(0=>'https://new-combats.com/shadow/'.$o['id'].'" target="_blank',1=>'������� �������');
-							}
-							$uobr = 'i/obraz/'.$u['sex'].'/'.$u['obraz'].'';
-							if(isset($sn['items_img'][1])) {
-								$uobr = 'rimg/r'.$sn['items_img'][1];
-							}
-							$rt[0] .= '<div style="position:relative;height:220px;">
-								<!-- ����� -->
-									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="'.$invg[0].'"><img onMouseOver="top.hi(this,\'������� � &quot;<b>'.$invg[1].'</b>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/'.$uobr.'" '.$oi.'></a></div>
-									<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">'.$eff.'</div>'.$anml.'
-							</div>';
-						}else{
-							if($i1 == 0) {
-								if(!isset($_GET['inv'])) {
-									$invg = array(0=>'main.php?inv=1',1=>'������');
-								}else{
-									$invg = array(0=>'main.php?skills=1',1=>'������');	
-								}
-							}else{
-								$invg = array(0=>'https://lib.new-combats.com/obraz.php?namez='.$u['zag'].'" target="_blank',1=>'������� �������');
-							}
-							$rt[0] .= '<div class="inf2s" style="position:relative;height:220px;">
-								<!-- ����� -->
-									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="'.$invg[0].'"><img onMouseOver="top.hi(this,\'������� � &quot;<b>'.$invg[1].'</b>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/1x1.gif" '.$oi.'></a></div>
-									<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">'.$eff.'</div>'.$anml.'
-							</div>';
-						}
-						
-						unset($invg);
-						
-						$rt[0] .= '</td>
-					  </tr>
-					  <tr>
-						<td height="40"><div align="center">'.$msl.'</div></td>
-					  </tr>
-					</table>
-					</td>
-					<td width="60" valign="top">
-					<table bgcolor="#e1e1e1" width="60" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="20">'.$witm[8].'</td>
-					  </tr>
-					  <tr>
-						<td height="20">'.$witm[9].'</td>
-					  </tr>
-					  <tr>
-						<td height="20"><table width="60" border="0" cellspacing="0" cellpadding="0">
-							<tr>
-							  <td width="20" height="20">'.$witm[10].'</td>
-							  <td width="20">'.$witm[11].'</td>
-							  <td width="20">'.$witm[12].'</td>
-							</tr>
-						</table></td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[13].'</td>
-					  </tr>
-					  <tr>
-						<td height="60">'.$witm[14].'</td>
-					  </tr>
-					  <tr>
-						<td height="80">'.$witm[16].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[17].'</td>
-					  </tr>
-					</table>
-					</td>
-				  </tr>
-				</table>'.$witmg.'</div>';
-			}elseif($type_info == 2) {
-				$rt[0] .= '<div style="width:209px; padding:2px;" align="center">'.$lgn.'</div>
-				<div style="width:196px; padding:2px;">
-				<div align="center"><!-- blocked -->'.$pb.'</div>
-				<div align="center">
-				<!-- HP and MP -->
-				'.$hpmp.'
-				<!-- -->
-				</div>
-				<table width="196" border="0" cellspacing="0" cellpadding="0">
-				  <tr>
-					<td width="60" valign="top">
-					<table width="60" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="20"><div style="position:relative">'.$zag.''.$witm[8].'</div></td>
-					  </tr>
-					  <tr>
-						<td height="20">'.$witm[9].'</td>
-					  </tr>
-					  <tr>
-						<td height="20">'.$witm[3].'</td>
-					  </tr>
-					  <tr>
-						<td height="80">'.$witm[4].'</td>
-					  </tr>
-					  <tr>
-						<td height="20"><table width="60" border="0" cellspacing="0" cellpadding="0">
-							<tr>
-							  <td width="20" height="20">'.$witm[10].'</td>
-							  <td width="20">'.$witm[11].'</td>
-							  <td width="20">'.$witm[12].'</td>
-							</tr>
-						</table></td>
-					  </tr>
-					</table>
-					</td>
-					<td valign="top">
-					<table width="76" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td valign="top">';
-						if($zag == ''){
-						if($i1 == 0) {
-							if(!isset($_GET['inv'])) {
-								$invg = array(0=>'main.php?inv=1',1=>'������');
-							}else{
-								$invg = array(0=>'main.php?skills=1',1=>'������');	
-							}
-						}else{
-							$invg = array(0=>'https://lib.new-combats.com/obraz.php?name='.$u['obraz'].'" target="_blank',1=>'������� �������');
-						}
-						$u['obraz'] = '0.gif';
-						$uobr = 'i/obraz/'.$u['sex'].'/old/'.$u['obraz'].'';
-						if(isset($sn['items_img'][1])) {
-							$uobr = 'rimg/r'.$sn['items_img'][1];
-						}
-						$rt[0] .= '<div style="position:relative;height:209px;">
-							<!-- ����� -->
-								<div style="position:absolute; width:76px; height:209px; z-index:1;"><a href="'.$invg[0].'"><img onMouseOver="top.hi(this,\'������� � &quot;<b>'.$invg[1].'</b>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="76" height="209" src="https://img.new-combats.com/'.$uobr.'" '.$oi.'></a></div>
-								<div style="position:absolute; width:76px; height:auto; z-index:3;" align="left">'.$eff.'</div>'.$anml.'
-						</div>';}
-						
-						unset($invg);
-						
-						$rt[0] .= '</td>
-					  </tr>
-					</table>
-					</td>
-					<td width="60" valign="top">
-					<table width="60" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="60">'.$witm[1].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[13].'</td>
-					  </tr>
-					  <tr>
-						<td height="60">'.$witm[14].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[17].'</td>
-					  </tr>
-					</table>
-					</td>
-				  </tr>
-				</table>'.$witmg.'</div>';
-			}
-			
-			if($i1==0 && $u['battle']==0)
-			{
-				$rt[0] .= '<script>top.lafstReg['.$u['id'].'] = 0; top.startHpRegen("main",'.$u['id'].','.(0+$sn['hpNow']).','.(0+$sn['hpAll']).','.(0+$sn['mpNow']).','.(0+$sn['mpAll']).','.(time()-$u['regHP']).','.(time()-$u['regMP']).','.(0+$this->rgd[0]).','.(0+$this->rgd[1]).',1);</script>';
-			}
-			if($ivv==0 && $i1==0)
-			{
-				$rt[0] .= $this->info_remont();
-			}
-		}
-		return $rt;
-	}
-	
-	public function endEffect($id,$u,$test=NULL)
-	{
-		if($test == false) {
-			$test = 0;
-		}
-		
-		$e = mysql_fetch_array(mysql_query('SELECT
-		`eu`.`id`,`eu`.`tr_life_user`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`,
-		`em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch`
-		FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`id`="'.mysql_real_escape_string($id).'" AND `delete`="0" AND `deactiveTime` < "'.time().'"'));
-		
-		if(isset($e['id']))
-		{		
-			$sleep = $this->testAction('`vars` = "sleep" AND `uid` = "'.$e['uid'].'" LIMIT 1', 1);
-			if( $e['id_eff'] == 2 ) {
-				//��������
-				$ev = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_main` WHERE `name` = "'.mysql_real_escape_string(str_replace('��������: ','',$e['name'])).'" LIMIT 1'));
-				$et = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "'.$e['uid'].'" AND `vars` LIKE "%read%" AND `vals` = "'.$ev['id'].'" LIMIT 1'));	
-				if(isset($et['id'])) {
-					if( $et['time'] < time() ) {
-						$et = false;
-					}else{
-						$et = true;
-					}
-				}else{
-					$et = false;
-				}
-			}else{
-				$et = false;
-			}
-			if($et == false && $e['sleeptime'] == 0 && $sleep['vars'] != 'sleep') {
-				$upd = mysql_query('UPDATE `eff_users` SET `delete`="'.time().'" WHERE `id` = "'.$e['id'].'" LIMIT 1');
-				if($upd)
-				{
-					$po = $this->lookStats($e['data']);
-					if(isset($po['finish_file']))
-					{
-						if(file_exists('_incl_data/class/magic/'.$po['finish_file'].'.php'))
-						{
-							require('_incl_data/class/magic/'.$po['finish_file'].'.php');
-
-						}else{
-							$this->error2 = '!File not exists &quot;cgi-bin/magic.pl?use_'.$po['finish_file'].'&quot;.';
-						}
-					}
-					if(isset($u['id']) && ($e['type1']<11 || ($e['type1']>16 && $e['type1']<23)) && $e['noch']==0)
-					{
-						$text = '����������� �������� ������� &quot;<b>'.$e['name'].'</b>&quot;';
-						mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('".$u['city']."','".$u['room']."','','".$u['login']."','".$text."','-1','6','0',1)");
-						if($u['battle']>0) {
-							$lastHOD = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = "'.$u['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-							if(isset($lastHOD['id']))
-							{
-								$id_hod = $lastHOD['id_hod'];
-								if($lastHOD['type']!=6)
-								{
-									$id_hod++;
-								}
-								mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u['battle'].'","'.($id_hod).'","{tm1} '.$text.' � ��������� {u1}.","login1='.$u['login'].'||t1='.$u['team'].'||time1='.time().'","","","","","6")');
-							}
-						}
-					}
-					return 1;
-				}else{
-					return 0;
-				}
-			}else{
-				return 0;
-			}
-		}else{
-			return 0;
-		}
-	}
-	
-	public function snatItem($id,$uid)
-	{
-		if($uid!=0)
-		{
-			$au = 'AND `iu`.`uid`="'.mysql_real_escape_string($uid).'"';
-		}else{
-			$au = '';
-		}
-		$itm = mysql_fetch_array($cl = mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`!="0" '.$au.' AND `iu`.`delete`="0" LIMIT 1 FOR UPDATE'));
-		if(isset($itm['id']))
-		{
-			
-			$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`inOdet`="0" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-			if($upd)
-			{
-				if(isset($_GET['remitem']) || isset($_GET['sid'])) {
-					$this->info['autospell'] = 1;
-					mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				}
-				return 1;
-			}else{
-				return 0;
-			}
-		}else{
-			return 0;
-		}
-	}
-	
-	public function snatItemAll($uid)
-	{
-		$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`inOdet`="0" WHERE `uid`="'.$uid.'" AND `inOdet`!="0" AND `delete`="0" LIMIT 100');
-		if($upd)
-		{
-			return 1;
-		}else{
-			return 0;
-		}
-	}
-	
-	public function impStats($m)
-	{
-		$i = 0;
-		$k = array_keys($m);
-		$d = '';
-		while($i<=count($k))
-		{
-			if($k[$i]!='')
-			{
-				$d .= $k[$i].'='.$m[$k[$i]].'|';
-			}
-			$i++;
-		}
-		$d = rtrim($d,'|');
-		return $d;
-	}
-	
-	public function odetItem($id, $uid) {
-		if($uid != 0) {
-		  $au = 'AND `iu`.`uid` = "'.mysql_real_escape_string($uid).'"';
-		} else {
-		  $au = '';
-		}
-		
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="0" LIMIT 1'));
-		if(isset($itm['id'])) {
-		  if($itm['group'] == 1) {
-			if($this->itemsX($itm['id']) > 1) {
-					$this->unstack($itm['id'],1);
-			  		/*$itm = mysql_fetch_array(mysql_query('SELECT
-					`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-					`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-					FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1'));
-					if(!isset($itm['id'])) {
-						$this->error = '������ ��������� ��������...';
-						$notr++;
-					} else {
-						$itm['delete'] = 0;
-					}*/					
-				}
-			}
-			
-			
-			$tr = $this->lookStats($itm['data']);
-			$notr = $this->trItem($tr);
-			$msb = '';
-			if(isset($tr['maks_itm_one']) && $tr['maks_itm_one']>0) {
-				$test = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$this->info['id'].'" AND `inOdet` > 0 AND `delete` = 0 AND `data` LIKE "%maks_itm_one='.$tr['maks_itm_one'].'%" LIMIT 1'));
-				if(isset($test['id'])) {
-					$this->error = '��������� ������������� �������� ������ ��������!';
-					$notr++;
-				}
-			}
-			if($this->info['twink']>0) {
-				//�� ������ 100 ���.
-				if( $itm['price2'] > 100 || $itm['2price'] > 100 ) {
-					$notr++;
-				}
-				//������ ���� + �����
-				if( isset($tr['rune']) && $tr['rune'] > 0 ) {
-					$notr++;
-				}
-				if( isset($tr['spell_id']) && $tr['spell_id'] > 0 ) {
-					$notr++;
-				}
-			}
-			if(isset($tr['vip_sale'])) {
-				if($this->stats['silver'] < 2) {
-					$notr++;
-				}
-			}
-			if(isset($tr['sudba'])) {
-				if($tr['sudba'] != '0' && $tr['sudba'] != $this->info['login']) {
-					$notr++;
-				} elseif($tr['sudba'] == '0'){
-					$tr['sudba'] = $this->info['login'];
-					$itm['data'] = $this->impStats($tr);
-					$msb = ',`data`="'.$itm['data'].'"';
-				}
-			}
-			if(isset($tr['tr_align_bs']) && $this->info['inTurnir'] > 0) {
-			  if($tr['tr_align_bs'] == '1') {
-				if($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2) { $notr++; } else { $notr = 0; }
-			  } else {
-				if($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4) { $notr++; } else { $notr = 0; }
-			  }
-			}
-			if($notr > 0) {
-				//�� ������� ������������� ��� �� ��������� �������
-				if(isset($tr['open']) && isset($_GET['open'])) {
-					$this->error = '�� �� ������ ������� ������ �������';
-				} else {
-					$this->error = '������ ����� ������ ������ �������� ������� ����';
-				}
-				return 0;
-			}elseif(isset($tr['open']) && isset($_GET['open']) && isset($tr['items_in_file']))
-			{
-				$io = '';
-				if($itm['inGroup'] > 0) {
-					mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-				if(file_exists('_incl_data/class/magic/'.$tr['items_in_file'].'.php')){
-					require('_incl_data/class/magic/'.$tr['items_in_file'].'.php');
-					if(!isset($no_open_itm)) {
-						$this->deleteItem($itm['id'],$this->info['id']);
-						$this->error = '�� ������� ������� &quot;'.$itm['name'].'&quot;:<br>'.$io.'...';
-					}else{
-						unset($no_open_itm);
-					}					
-				}else{
-					$this->error = '������� &quot;'.$itm['name'].'&quot; ���������� �������...';
-				}
-			}elseif(isset($tr['open']) && isset($_GET['open']))
-			{
-				//��������� �������
-				$io = '';
-				$i = 0;
-				$itms = explode(',',$tr['items_in']);
-				
-				
-				if($itm['type']==37) {
-					//������������� ��������
-					$io = '';
-					$itmin = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "'.$tr['item_inbox'].'" LIMIT 1'));
-					$itmmn = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$itmin['item_id'].'" LIMIT 1'));
-					//
-					if($itm['gift'] == '' || $itm['gift'] == '0') {
-						$this->error = '������� ������ ���� �������, ������ ��� ��� ���������!';
-					}elseif(!isset($itmin['id'])) {
-						$this->error = '� �������� ������ ���, ������ ����� ������� ���-�� ������� �� ����...';
-					}else{
-						$io .= $itmmn['name'];
-						if($itmin['item_id'] == 4867) {
-							//�� ��������
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							$this->error = '�� ������� ������� �������. ���������� ���������.';
-						}elseif($itmin['item_id'] == 4868) {
-							//������� ����
-							mysql_query('UPDATE `stats` SET `hpNow` = 1,`mpNow` = 1 WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							$this->error = '�� �������� ��� HP...';
-						}elseif($itmin['item_id'] == 4870) {
-							//������ ��������
-							if( $this->info['molch1'] > time() ) {
-								$this->info['molch1'] += 3600;
-							}else{
-								$this->info['molch1'] = time()+3600;
-							}
-							mysql_query('UPDATE `users` SET `molch1` = "'.$this->info['molch1'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							$this->error = '�� ��������� ��� �������� �������� ��������...';
-						}elseif($itmin['item_id'] == 4873) {
-							//�������� ��
-							$a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							if(isset($a['id'])) {
-								$this->error = '��� ����� &quot;'.$a['name'].'&quot; ������� ���������...';
-								mysql_query('UPDATE `users_animal` SET `eda` = 0, `yad` = "'.(time()+86400*7).'" WHERE `id` = "'.$a['id'].'" LIMIT 1');
-							}else{
-								$this->error = '���-�� ������� �������� ������ �����, �������� � ��� ��� :)';
-							}
-						}elseif($itmin['item_id'] == 4869) {
-							//����������� ������  (������ ������ �� 1 ���)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� � ������������","add_s'.rand(1,3).'=-'.rand(5,15).'","'.$this->info['id'].'",
-								"4", "bad_present_travma1.gif","0", "1"
-							)');					
-							$this->error = '�� ������������. � ��� ����� � ���������...';
-						}elseif($itmin['item_id'] == 4872) {
-							//��������  (������� ������ �� 1 ���)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� � ������������","add_s'.rand(1,3).'=-'.rand(16,25).'","'.$this->info['id'].'",
-								"4", "bad_present_travma2.gif","0", "2"
-							)');
-							$this->error = '�� ������������. � ��� ����� � ���������...';
-						}elseif($itmin['item_id'] == 4876) {
-							//����������  (������� ������ �� 1 ���)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� � ������������","add_s'.rand(1,3).'=-'.rand(26,35).'","'.$this->info['id'].'",
-								"4", "bad_present_travma3.gif","0", "3"
-							)');
-							$this->error = '�� ������������. � ��� ����� � ���������...';
-						}elseif($itmin['item_id'] == 4878) {
-							//������������  (add_puti=7200)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+7200).'","-1",
-								"������������","add_puti=1","'.$this->info['id'].'",
-								"4", "bad_present_chains.gif","0", "3"
-							)');
-							$this->error = '�� �� ������ �������������...';
-						}elseif($itmin['item_id'] == 4874) {
-							//������� ��� ����  �� ���
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� ��� ����","add_s5=-50","'.$this->info['id'].'",
-								"4", "bad_present_dmage.gif","0", "3"
-							)');
-							$this->error = '��� ��������...';
-						}elseif($itmin['item_id'] == 4871) {
-							//������� ��� �����  �� ���
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� ��� �����","add_s1=-50","'.$this->info['id'].'",
-								"4", "bad_present_dfighter.gif","0", "3"
-							)');
-							$this->error = '��� ��������...';
-						}elseif(mysql_query('UPDATE `items_users` SET `uid` = "'.$this->info['id'].'",`lastUPD` = "'.time().'",`gift` = "'.$itm['gift'].'",`gtxt1` = "'.$itm['gtxt1'].'",`gtxt2` = "������� �� ��������. ���� ���������: '.date('d.m.Y H:i:s',$itmin['time_create']).'" WHERE `id` = "'.$itmin['id'].'" LIMIT 1')) {
-							//������� ��������
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->error = '�� ������� ������� &quot;'.$itm['name'].'&quot;, ������ ���� �������:<br>'.$io.'...';
-						}else{
-							$this->error = '��������� ������� �������, ��� �� ���?';
-						}
-						//
-					}
-					//
-				}else{					
-					
-					while($i<count($itms))
-					{
-						if(isset($itms[$i]))
-						{
-							$x = 0;
-							$itms[$i] = explode('*',$itms[$i]);
-							$x += (int)$itms[$i][1];
-							$itms[$i] = $itms[$i][0];
-							$s = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id`="'.((int)$itms[$i]).'" LIMIT 1'));
-							if(isset($s['id']))
-							{
-								$j = 1;
-								while($j<=$x)
-								{
-									$pid = $this->addItem($s['id'],$this->info['id']);
-									if($pid>0)
-									{
-										mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`gift` = "'.$itm['gift'].'" WHERE `id` = "'.$pid.'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-									}
-									$j++;
-								}
-								$io .= ''.$s['name'].' (x'.$x.'), ';	
-							}
-						}
-						$i++;
-					}
-					if($itm['inGroup'] > 0) {
-						mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-					}
-					$this->deleteItem($itm['id'],$this->info['id']);
-					$this->error = '�� ������� ������� &quot;'.$itm['name'].'&quot;, ������ ���� �������:<br>'.$io.'...';
-				}
-			}else{
-				$inSlot = $itm['inslot'];
-				$s = mysql_query('SELECT `iu`.`id`,`iu`.`inOdet` FROM `items_users` AS `iu` WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$uid.'" AND `iu`.`delete`="0"');
-				$d = array();
-				while($p = mysql_fetch_array($s))
-				{
-					$d[$p['inOdet']] = $p['id'];
-				}
-				
-				//���� � ���� ������ � ����� ����� � ����� ����
-				if($itm['2too']==1 && $inSlot==3 && isset($d[3]))
-				{
-					$inSlot = 14;
-				}
-				
-				if($inSlot==3 || $inSlot==14)
-				{
-					//��������� ����-�� ��������� ������
-					 if($this->stats['items'][$this->stats['wp3id']]['2h']==1 || $this->stats['items'][$this->stats['wp14id']]['2h']==1 || $itm['2h']==1)
-					{
-						$this->snatItem($this->stats['items'][$this->stats['wp3id']]['id'],$uid);
-						$this->snatItem($this->stats['items'][$this->stats['wp14id']]['id'],$uid);					
-					}
-				}
-				
-				if(isset($d[$inSlot]))
-				{
-					if($inSlot==10)
-					{
-						if(!isset($d[12]))
-						{
-							$inSlot = 12;
-						}elseif(!isset($d[11]))
-						{
-							$inSlot = 11;	
-						}
-					}elseif($inSlot==40)
-					{
-						$i = 40;
-						while($i<=51)
-						{
-							if(!isset($d[$i]))
-							{
-								$inSlot = $i;
-								$i = 52;
-							}elseif($i==50)
-							{
-								$inSlot = 50;	
-							}
-							$i++;
-						}
-					}elseif($inSlot==53)
-					{
-						if(!isset($d[53]))
-						{
-							$inSlot = 53;
-						}elseif(!isset($d[54]))
-						{
-							$inSlot = 54;	
-						}
-					}elseif($inSlot==56)
-					{
-						if(!isset($d[56]))
-						{
-							$inSlot = 56;
-						}elseif(!isset($d[57]))
-						{
-							$inSlot = 57;	
-						}elseif(!isset($d[58]))
-						{
-							$inSlot = 58;	
-						}else{
-							$inSlot = 58;
-						}
-					}elseif($inSlot==59)
-					{
-						if(!isset($d[59]))
-						{
-							$inSlot = 59;
-						}elseif(!isset($d[60]))
-						{
-							$inSlot = 60;	
-						}elseif(!isset($d[61]))
-						{
-							$inSlot = 61;	
-						}elseif(!isset($d[62]))
-						{
-							$inSlot = 62;	
-						}
-					}
-				}
-				if(isset($d[$inSlot]))
-				{
-					$this->snatItem($d[$inSlot],$uid);
-				}
-				
-				
-				
-				
-				
-				$upd = mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inOdet` = "'.$inSlot.'"'.$msb.' WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				if($itm['inGroup'] > 0) {
-				  mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inGroup` = 0, `delete` = 0 WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-				if($upd) {
-					//���� ������� ������������� ����� ��������
-					//if($itm[''])
-					//{
-					//	
-					//}
-					$this->info['autospell'] = 1;
-					mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					return 1; 
-				} else {
-					$this->error = '(!) ������ ���������� ������';
-					return 0; 
-				}
-			}
-		}else{
-			$this->error = '������� �� ������ � ����� �������';
-			return 0;
-		}
-	}	
-	
-	public function deleteItem($id,$uid,$coldel = 0)
-	{
-		if($uid!=0)
-		{
-			$au = 'AND `iu`.`uid`="'.mysql_real_escape_string($uid).'"';
-		}else{
-			$au = '';
-		}
-		$itm = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.*
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND (`iu`.`delete`="0" OR `iu`.`delete`="1000") LIMIT 1'));
-		if(isset($itm['id']))
-		{
-			
-			if( $coldel == 0 ) {
-				//������� �������
-				$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-				$col = $this->itemsX($itm['id']);
-				if($col > 0) {
-					mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" LIMIT '.$col);
-				}
-			}else{
-				//������� ���������� ���-��
-				$col = $this->itemsX($itm['id']);
-				if( $col > 1 ) {
-					if( $col <= $coldel ) {
-						$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-					}
-					$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" AND `delete` = "1000" LIMIT '.$coldel);
-				}else{
-					//������� �������
-					$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-					$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" AND `delete` = "1000" LIMIT '.$col);
-				}
-			}
-			if($upd)
-			{
-				if(isset($_GET['deleteall7'])) {
-					$st = $this->lookStats($itm['data']);
-					$whr = '';
-					if(isset($st['frompisher'])) {
-						$whr .= 'AND `data` LIKE "%frompisher='.$st['frompisher'].'%"';
-					}
-					$col = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id`="'.$itm['item_id'].'" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "'.$itm['uid'].'" AND `data` NOT LIKE "%nodelete%"'.$whr));
-					$col = $col[0];
-					mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `item_id`="'.$itm['item_id'].'" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "'.$itm['uid'].'" AND `data` NOT LIKE "%nodelete%"'.$whr);
-					$this->error = '�������� "'.$itm['name'].' (x'.($col+1).')" ���������';
-					$this->addDelo(1,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: �������� &quot;<b>'.$itm['name'].' (x'.$col.')</b>&quot; [itm:'.$itm['id'].'='.time().'] ���� <b>���������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				}else{
-					$this->error = '������� "'.$itm['name'].'" ��������';
-					$this->addDelo(1,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: ������� &quot;<b>'.$itm['name'].'</b>&quot; [itm:'.$itm['id'].'] ��� <b>��������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				}
-				return 1;
-			}else{
-				return 0;
-			}
-		}else{
-			$this->error = '������� �� ������ � ����� �������';
-		}
-	}
-	
-	public function return_btn()
-	{
-		return false;
-	}
-		
-	public function get_battle_cache($uid,$battle) {
-		$r = false;
-		if( $uid > 0 && $battle > 0 ) {
-			$r = mysql_fetch_array(mysql_query('SELECT * FROM `battle_cache` WHERE `battle` = "'.mysql_real_escape_string($battle).'" AND `uid` = "'.mysql_real_escape_string($uid).'" ORDER BY `id` DESC LIMIT 1'));
-			if( !isset($r['id']) ) {
-				$r = false;
-			}else{
-				$r = json_decode($r['data'],true);
-			}
-		}
-		return $r;
-	}
-	
-	public function clear_battle_cache($uid) {
-		mysql_query('DELETE FROM `battle_cache` WHERE `uid` = "'.mysql_real_escape_string($uid).'"');
-	}
-	
-	public function getStats($uid,$i1,$res = 0,$reimg = false,$btl_cache = false,$minimal = false)
-	{
-		global $c;
-		if(count($uid)>1)
-		{
-			$u = $uid;
-		}elseif($uid!=$this->info['id'] || $res==1)
-		{
-			if( $minimal == true ) {
-				$u = mysql_fetch_array(mysql_query('SELECT `u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`,
-				`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-				FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			}else{
-				$u = mysql_fetch_array(mysql_query('SELECT `u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`,
-				`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-				FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			}
-		}else{
-			$u = $this->info;
-		}
-		
-		/*if( $btl_cache == true ) {
-			$cache = $this->get_battle_cache( $u['id'],$u['battle'] );
-			if( $cache == false ) {
-				unset($cache);
-			}else{
-				$cache['st'] = $u + $cache['st'];
-			}
-		}*/
-		
-		/*if( $u['battle'] > 0  ) {
-			$cache_items = $this->get_battle_cache( $u['id'],$u['battle'] );
-			if( $cache_items == false ) {
-				unset($cache_items);
-			}else{
-				$cache_items['st']['hpNow'] = $u['hpNow'];
-				$cache_items['st']['mpNow'] = $u['mpNow'];
-			}
-		}*/
-		
-		if(isset($u['id'],$u['stats']) && !isset($cache))
-		{			
-			$st  = array();
-			$s_vi = array();
-			$s_v = array();
-			$u['clanpos'] = 0;
-			if( $u['clan'] > 0 ) {
-				$r1 = mysql_fetch_array(mysql_query('SELECT `pos` FROM `aaa_clan_reting_list` WHERE `clan` = "'.$u['clan'].'" AND `date` = "'.date('dmY').'" LIMIT 1'));
-				if(isset($r1['pos'])) {
-					$st['clanpos'] = $r1['pos'];
-				}
-				unset($r1);
-			}
-						
-			if(!isset($cache_items)) {
-				//
-				//$st = new SplFixedArray(1024000);
-				//
-				$lvl = mysql_fetch_array(mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel` = "'.$u['upLevel'].'" LIMIT 1'));
-				if(isset($lvl['upLevel']))
-				{
-					$st['levels'] = $lvl;
-				}else{
-					$st['levels'] = 'undefined';
-				}
-				$st2 = array();
-				$st['id'] = $u['id'];
-				$st['login'] = $u['login'];
-				$st['lvl'] = $u['level'];
-				$st['hpNow'] = $u['hpNow'];
-				$st['hpAll'] = 0;
-				$st['mpNow'] = $u['mpNow'];
-				$st['mpAll'] = 0;
-				$st['zona'] = 1;
-				$st['zonb'] = 2;
-				$st['items'] = array();
-				$st['effects'] = array();
-				$st['reting'] = 0;
-				$st['irka'] = 0;
-				$sts = explode('|',$u['stats']);
-				$i = 0; $ste = '';
-				//������ ��������������
-				while($i<count($sts))
-				{
-					$ste = explode('=',$sts[$i]);
-					if(isset($ste[1]))
-					{
-						if(!isset($st[$ste[0]])) {
-							$st[$ste[0]] = 0;
-						}
-						$st[$ste[0]]  += intval($ste[1]);
-						
-						if(!isset($st2[$ste[0]])) {
-							$st2[$ste[0]] = 0;
-						}
-						$st2[$ste[0]] += intval($ste[1]);
-					}
-					$i++;
-				}			
-			
-				if($u['admin'] > 0) {
-					mysql_query('UPDATE `stats` SET
-						`tactic1` = 25,
-						`tactic2` = 25,
-						`tactic3` = 25,
-						`tactic4` = 25,
-						`tactic5` = 25,
-						`tactic6` = 25,
-						`tactic7` = 25,
-						`priems_z` = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|"
-					WHERE `id` = "'.$u['id'].'" LIMIT 1
-					');
-				}
-			
-				//��������� ��������
-				if($this->info['id'] == $u['id'] || $reimg != false) {
-					$sp_img = mysql_query('SELECT * FROM `items_img` WHERE `uid` = "'.$u['id'].'" AND `img_id` != "0" LIMIT 16');
-					while($pl_img = mysql_fetch_array($sp_img)) {
-						$pl_img_r = mysql_fetch_array(mysql_query('SELECT * FROM `reimage` WHERE ((`uid` = "'.$u['id'].'" AND `clan` = "0") OR (`clan` = "'.$u['clan'].'" AND '.$u['clan'].' > 0)) AND `good` > 0 AND `bad` = "0" AND `id` = "'.$pl_img['img_id'].'" LIMIT 1'));
-						if(isset($pl_img_r['id'])) {
-							$st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format'];
-						}else{
-							mysql_query('UPDATE `items_img` SET `img_id` = "0" WHERE `id` = "'.$pl_img['id'].'" LIMIT 1');
-						}
-					}
-				}
-			
-				//�������������� �� ��������� //��� tr_lvl
-				$cl = mysql_query('SELECT 
-				`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-				`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-				FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$u['id'].'" AND `iu`.`delete`="0" LIMIT 250');
-				$ia = $this->items['add'];
-				$h = 0;
-				$hnd1 = 0;
-				$hnd2 = 0;
-				$sht1 = 0;
-				$reitm = array();
-				$coms = array(); // ���������
-				$dom = array();
-				$btl_cof = 0;
-				$oza = array(
-					1=>array(0,0),
-					2=>array(0,0),
-					3=>array(0,0),
-					4=>array(0,0)
-				); //����������� ������
-				$ozm = array(
-					1=>array(0,0),
-					2=>array(0,0),
-					3=>array(0,0),
-					4=>array(0,0)
-				); //����������� �����
-	
-				$itmslvl = 0;
-				$itmsCfc = 0;
-				$st['reting'] = 0;
-				while($pl = mysql_fetch_array($cl))
-				{	
-					if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) {
-						if( $pl['1price'] > 0 ) {
-							$st['irka'] += $pl['1price'];	
-						}else{
-							$st['irka'] += $pl['price1'];
-						}
-					}
-					/* ������������� */
-					//$dom[count($dom)] = array($pl['inOdet'],$pl['class'],$pl['class_point'],$pl['anti_class'],$pl['anti_class_point'],$pl['level'],$u['level'],$pl['price2']);
-					
-					
-					if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) {
-						/*if( $pl['2price'] > 0 ) {
-							$st['reting'] += $pl['2price']*12.5;
-						}elseif( $pl['price2'] > 0 ) {
-							$st['reting'] += $pl['price2']*12.5;
-						}elseif( $pl['1price'] > 0 ) {
-							$st['reting'] += $pl['1price'];
-						}elseif( $pl['price1'] > 0 ) {
-							$st['reting'] += $pl['price1'];
-						}*/
-					}
-					
-					
-					$st['wp'.$pl['inOdet'].'id'] = $h; 
-	
-					$st['items'][$h] = $pl;	$h++;
-					if($pl['inOdet']==3 && (($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27 || $pl['type']==28))
-					{
-						$hnd1 = 1;
-					}
-					if($pl['inOdet']==14 && (($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27 || $pl['type']==28))
-					{
-						$hnd2 = 1;
-					}elseif($pl['inOdet']==14 && $pl['type']==13)
-					{
-						$sht1 = 1;
-					}
-					$sts = explode('|',$pl['data']);
-					$i = 0; $ste = ''; $sti = array();
-					while($i<count($sts))
-					{
-						$ste = explode('=',$sts[$i]);
-						if(isset($ste[1]))
-						{
-							if(!isset($sti[$ste[0]])) {
-								$sti[$ste[0]] = 0;
-							}
-							$sti[$ste[0]] += intval($ste[1]);
-						}
-						$i++;
-					}
-					
-					if( !isset($sti['zazuby']) && !isset($sti['frompisher']) ) {
-						if( $pl['inOdet'] < 18 && $pl['inOdet'] > 0 ) {
-							
-							if( $pl['2price'] == 0 && $pl['price2'] == 0 ) {
-								if( $pl['1price'] > 0 ) {
-									$st['prckr'] += $pl['1price'];	
-								}else{
-									$st['prckr'] += $pl['price1'];
-								}
-							} else {
-							  if( $pl['2price'] > 0 ) {
-								  $st['prckr'] += $pl['2price']*200;
-							  	  $st['preckr'] += $pl['2price'];
-							  }else{
-								  $st['prckr'] += $pl['price2']*200;
-							  	  $st['preckr'] += $pl['price2'];
-							  }
-							}
-						}
-					}else{
-						if( $pl['inOdet'] < 18 && $pl['inOdet'] > 0 ) {
-							if( $pl['2price'] == 0 && $pl['price2'] == 0 ) {
-								if( $pl['1price'] > 0 ) {
-									//$st['prckr'] += round($pl['1price']/3);	
-								}else{
-									//$st['prckr'] += round($pl['price1']/3);
-								}
-							}
-						}
-					}
-					
-					if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) {
-
-						$st['reting'] += 1;
-					}
-					
-					if(isset($sti['add_oza'])) {
-	
-					}
-					
-					$ko = 1;
-					while($ko <= 4) {
-						if(isset($sti['add_oza'.$ko])) {
-							if(isset($sti['add_oza'])) {
-								if($sti['add_oza'] == 1) {
-									//������
-									$oza[$ko][0] += 1;
-									$oza[$ko][1] += 9;
-								}elseif($sti['add_oza'] == 2) {
-									//����������
-									$oza[$ko][0] += 20;
-									$oza[$ko][1] += 39;
-								}elseif($sti['add_oza'] == 3) {
-									//�������
-									$oza[$ko][0] += 40;
-									$oza[$ko][1] += 69;
-								}elseif($sti['add_oza'] == 4) {
-									//��������������
-									$oza[$ko][0] += 10;
-									$oza[$ko][1] += 19;
-								}elseif($sti['add_oza'] == 5) {
-									//������������
-									$oza[$ko][0] += 70;
-									$oza[$ko][1] += 89;
-								}
-							}
-							if(isset($sti['add_ozm'])) {
-								if($sti['add_ozm'] == 1) {
-									//������
-									$ozm[$ko][0] += 1;
-									$ozm[$ko][1] += 9;
-								}elseif($sti['add_ozm'] == 2) {
-									//����������
-									$ozm[$ko][0] += 20;
-									$ozm[$ko][1] += 39;
-								}elseif($sti['add_ozm'] == 3) {
-									//�������
-									$ozm[$ko][0] += 40;
-									$ozm[$ko][1] += 69;
-								}elseif($sti['add_ozm'] == 4) {
-									//��������������
-									$ozm[$ko][0] += 10;
-									$ozm[$ko][1] += 19;
-								}elseif($sti['add_ozm'] == 5) {
-									//������������
-									$ozm[$ko][0] += 70;
-									$ozm[$ko][1] += 89;
-								}
-							}
-							else
-							{
-									$ozm[$ko][0] += 1;
-									$ozm[$ko][1] += 9;
-							}
-							if($sti['add_oza'.$ko] == 1) {
-								//������
-								$oza[$ko][0] += 1;
-								$oza[$ko][1] += 9;
-							}elseif($sti['add_oza'.$ko] == 2) {
-								//����������
-								$oza[$ko][0] += 20;
-								$oza[$ko][1] += 39;
-							}elseif($sti['add_oza'.$ko] == 3) {
-								//�������
-								$oza[$ko][0] += 40;
-								$oza[$ko][1] += 69;
-							}elseif($sti['add_oza'.$ko] == 4) {
-								//��������������
-								$oza[$ko][0] += 10;
-								$oza[$ko][1] += 19;
-							}elseif($sti['add_oza'.$ko] == 5) {
-								//������������
-								$oza[$ko][0] += 70;
-								$oza[$ko][1] += 89;
-							}
-							if(isset($sti['add_ozm'.$ko]))
-							{
-							if($sti['add_ozm'.$ko] == 1) {
-								//������
-								$ozm[$ko][0] += 1;
-								$ozm[$ko][1] += 9;
-							}elseif($sti['add_ozm'.$ko] == 2) {
-								//����������
-								$ozm[$ko][0] += 20;
-								$ozm[$ko][1] += 39;
-							}elseif($sti['add_ozm'.$ko] == 3) {
-								//�������
-								$ozm[$ko][0] += 40;
-								$ozm[$ko][1] += 69;
-							}elseif($sti['add_ozm'.$ko] == 4) {
-								//��������������
-								$ozm[$ko][0] += 10;
-								$ozm[$ko][1] += 19;
-							}elseif($sti['add_ozm'.$ko] == 5) {
-								//������������
-								$ozm[$ko][0] += 70;
-								$ozm[$ko][1] += 89;
-							}
-							}
-							else
-							{
-								$ozm[$ko][0] += 1;
-								$ozm[$ko][1] += 9;
-							}
-						
-						}
-						$ko++;
-					}
-					
-					//if( $sti['tr_lvl'] == $u['level'] ) {
-					if( $pl['inOdet'] <= 18 ) {
-						$itmslvl++;
-					}
-					if( $pl['inOdet'] <= 14 && isset($pl['tr_lvl'])) {
-						if( $pl['tr_lvl'] == $u['level'] ) {
-							$itmsCfc += 1;
-						}else{
-							$itmsCfc += ($sti['tr_lvl']/$u['level'])/4;
-						}
-					}
-					//}
-					
-					if(isset($sti['art'])) {
-						if(!isset($st['art'])) {
-							$st['art'] = 0;
-						}
-						$st['art'] += $sti['art'];
-					}
-					if(isset($sti['maks_itm'])) {
-						if(!isset($st['maks_itm'])) {
-							$st['maks_itm'] = 0;
-						}
-						$st['maks_itm'] += $sti['maks_itm'];
-					}
-					if(isset($sti['complect']))
-					{
-						$coms[count($coms)]['id'] = $sti['complect'];
-						if(!isset($coms['com'][$sti['complect']]))
-						{
-							$coms['com'][$sti['complect']] = 0;	
-							if(!isset($coms['new'])) {
-								$coms['new'] = array();
-							}
-							$coms['new'][count($coms['new'])] = $sti['complect'];
-						}
-						$coms['com'][$sti['complect']]++;
-						if($pl['2h'] > 0) {
-							$coms['com'][$sti['complect']]++;
-						}
-					}
-					if(isset($sti['complect2']))
-					{
-						$coms[count($coms)]['id'] = $sti['complect2'];
-						if(!isset($coms['com'][$sti['complect2']]))
-						{
-							$coms['com'][$sti['complect2']] = 0;	
-							if(!isset($coms['new'])) {
-								$coms['new'] = array();
-							}
-							$coms['new'][count($coms['new'])] = $sti['complect2'];
-						}
-						$coms['com'][$sti['complect2']]++;
-						if($pl['2h'] > 0) {
-							$coms['com'][$sti['complect2']]++;
-						}
-					}
-					
-					if(isset($sti['zonb']) && $sti['zonb']!=0)
-					{
-						if(!isset($st['zonb'])) {
-							$st['zonb'] = 0;
-						}
-						$st['zonb'] += $sti['zonb'];
-					}
-					
-					if(isset($sti['zona']) && $sti['zona']!=0)
-					{
-						if(!isset($st['zona'])) {
-							$st['zona'] = 0;
-						}
-						$st['zona'] += $sti['zona'];
-					}
-					
-					//��������� ����� �� ������� ��������
-					if(!isset($sti['restart_stats']))
-					{
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-
-								//��������� �� (��������� ��)
-								if(isset($sti['add_'.$ia[$i]])) {
-									
-									if($ia[$i] != 'zmproc' && $ia[$i] != 'zaproc') {
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] += intval($sti['add_'.$ia[$i]]);
-									}else{
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-										$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]]/100*intval($sti['add_'.$ia[$i]]);
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-									}
-									
-								}
-							}
-							$i++;
-						}
-					}else{
-						$reitm[count($reitm)] = $sti;
-					}
-					$i = 0;
-					while($i<count($ia))
-					{
-						if(isset($ia[$i]))
-						{
-							if(isset($sti['sv_'.$ia[$i]])) {
-								if(!isset($s_v[$ia[$i]])){
-									$s_v[$ia[$i]] = 0;
-									$s_v['z'][$pl['inOdet']][$ia[$i]] = 0;
-								}
-								$s_v[$ia[$i]] += intval($sti['sv_'.$ia[$i]]);
-								$s_v['z'][$pl['inOdet']][$ia[$i]] += intval($sti['sv_'.$ia[$i]]);
-							}
-						}
-						$i++;
-					}			
-				}
-			
-				//����������� ���-�� � ������
-				if(count($reitm)>0)
-				{
-					$i39 = array(0=>0,1=>0,2=>0);
-					$i = 0;
-					while($i<count($reitm))
-					{
-						if(isset($reitm[$i]['sm_skill']) && $i39[0]==0)
-						{
-							//������
-							$i9 = 1; $i39[0] = 1;
-							while($i9<=7)
-							{
-								$st['a'.$i9] = $st['a'.$i9]-$st2['a'.$i9]+$reitm[$i]['add_a'.$i9];
-								$st['mg'.$i9] = $st['mg'.$i9]-$st2['mg'.$i9]+$reitm[$i]['add_mg'.$i9];
-								$i9++;
-							}												
-						}elseif(isset($reitm[$i]['sm_abil']) && $i39[1]==0)
-						{
-							//�����
-							$i9 = 1; $i39[1] = 1;
-							while($i9<=12)
-							{
-								$st['s'.$i9] = $st['s'.$i9]-$st2['s'.$i9]+$reitm[$i]['add_s'.$i9];
-								$i9++;
-							}	
-						}elseif(isset($reitm[$i]['sm_skill2']) && $i39[2]==0)
-						{
-							//������
-							
-							$i39[2] = 1;
-						}
-						$i++;
-					}
-				}
-				
-				//����� �� ������
-				$efs = mysql_query('SELECT * FROM `users_ico` WHERE `uid`="'.mysql_real_escape_string($u['id']).'" AND (`endTime` > "'.time().'" OR `endTime` = 0)');
-				while($e = mysql_fetch_array($efs))
-				{
-						$sts = $this->lookStats($e['bonus']);
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if (!isset($sti[$ia[$i]])){
-								$sti[$ia[$i]] = 0;
-								 }
-								if (!isset($sts['add_'.$ia[$i]])){
-									$sts['add_'.$ia[$i]] =0;
-								}
-	
-								$sti[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-	
-								if(!isset($st[$ia[$i]])){
-									$st[$ia[$i]] = 0;
-								}
-								  //
-								$st[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-							}
-							$i++;
-						}	
-				}
-				/*if( $u['battle'] > 0 ) {
-					//��������
-					$cache_items = array(
-						'st' => $st,
-						'sti' => $sti,
-						's_v' => $s_v,
-						's_vi' => $s_vi
-					);
-					$cache_items = json_encode($cache_items);
-					mysql_query('INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("'.$u['id'].'","'.$u['battle'].'","'.mysql_real_escape_string($cache_items).'","'.time().'")');
-					unset($cache_items);
-				}*/
-			}else{
-				/*$st = $cache_items['st'];
-					unset($cache_items['st']);
-				$sti = $cache_items['sti'];
-					unset($cache_items['sti']);
-				$s_v = $cache_items['s_v'];
-					unset($cache_items['s_v']);
-				$s_vi = $cache_items['s_vi'];
-				unset($cache_items);*/
-			}	
-									
-			//
-			//if( $this->info['id'] != $u['id'] ) {
-				if( $u['battle'] > 0 ) {
-					$test_btl_info = mysql_fetch_array(mysql_query('SELECT `id`,`noeff` FROM `battle` WHERE `id` = "'.$u['battle'].'" LIMIT 1'));
-					$test_noef = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_actions` WHERE `uid` = "'.$u['id'].'" AND `vars` = "noeffectbattle1" AND `btl` = "'.$u['battle'].'" LIMIT 1'));
-				}
-			//}
-			//�������������� �� ��������
-			$h = 0;
-			$nbs = array();
-			$prsu = array();
-			if(!isset($test_noef['id'])) {
-				$efs = mysql_query('SELECT 
-				`eu`.`id`,`eu`.`id_eff`,`eu`.`tr_life_user`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`,
-				`em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch` FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "'.time().'" AND `eu`.`v1`!="priem" ORDER BY `eu`.`id` DESC LIMIT 50');
-				while($e = mysql_fetch_array($efs))
-				{
-					if( $u['dnow'] == 0 ) {
-						if( $u['battle'] == 0 ) {
-							mysql_query('DELETE FROM `eff_users` WHERE `id_eff` = "'.$e['id_eff'].'" AND `uid` = "'.$u['id'].'" AND `id` != "'.$e['id'].'" ORDER BY `id` ASC');
-							//��������� � ������
-							if($e['v1'] != 'priem') {
-								if($e['hod'] != -1) {
-									mysql_query('UPDATE `eff_users` SET `hod` = "-1",`timeUse` = "'.(time()+($e['hod']*$c['effz'])-$e['actionTime']).'" WHERE `id` = "'.$e['id'].'" LIMIT 1');
-								}
-							}
-						}else{
-							if($e['v1'] != 'priem' && $c['effz'] > 0) {
-								if($e['hod'] == -1) {
-									$efzz = round(($e['timeUse']+$e['actionTime']+$e['timeAce'])-time());
-									if( $efzz > 0 ) {
-										mysql_query('UPDATE `eff_users` SET `hod` = "'.($efzz/$c['effz']).'" WHERE `id` = "'.$e['id'].'" LIMIT 1');
-									}
-								}
-							}
-						}
-					}
-					//echo '['.date( 'd.m.Y H:i:s' , time() + round((($e['timeUse']+$e['timeAce']+$e['actionTime'])-time())/$c['effz'])*$c['effz']).']';
-					if(true == false && $test_btl_info['noeff']==1 && isset($this->ekrcast[$e['id_eff']])) {
-						//������� �� ���������
-					}elseif( $e['sleeptime'] != 0 && substr_count($e['v1'],'pgb') > 0 ) {
-						//�� ���������� �������� ����������� �� ����� ���
-					}elseif( ( $e['timeUse']+$e['timeAce']+$e['actionTime']>time() || $e['timeUse']==77 ) )
-					{					
-						if($e['v1'] == 'priem') {
-							$prsu[$e['v2']] = 0+$prsu['x'];
-						}
-						$st['effects'][$h] = $e;	$h++;
-						$sts = $this->lookStats($e['data']);
-						if(isset($sts['itempl']) && $sts['itempl'] > 0) {
-							$nbs[$sts['itempl']] += 1;
-						}
-						if( isset($sts['puti']) ) {
-							$st['puti'] = $sts['puti'];
-						}
-						if( isset($sts['add_silver']) ) {
-							$st['slvtm'] = $e['timeUse']+$e['actionTime'];
-						}
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['add_'.$ia[$i]])) {
-									if(!isset($sti[$ia[$i]])) {
-										$sti[$ia[$i]] = 0;
-									}
-									$sti[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-								}
-								if(isset($sts['add_'.$ia[$i]])) {
-									if($ia[$i] != 'zaproc' && $ia[$i] != 'zmproc') {
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-									}else{
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-										$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]]/100*intval($sts['add_'.$ia[$i]]);
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-									}								
-								}
-							}
-							$i++;
-						}	
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['sv_'.$ia[$i]])) {
-									if(!isset($s_vi[$ia[$i]])) {
-										$s_vi[$ia[$i]] = 0;
-									}
-									$s_vi[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								}
-								if(isset($sts['sv_'.$ia[$i]])) {
-									if(!isset($s_v[$ia[$i]])) {
-										$s_v[$ia[$i]] = 0;
-									}
-									$s_v[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								}
-							}
-							$i++;
-						}	
-					}elseif($e['timeUse']!=77){
-						//������� ������	
-						if( $e['img2'] != 'tz.gif' || $u['id'] == $this->info['id'] ) {				
-							if( $e['sleeptime'] == 0 ) {
-								$this->endEffect($e['id'],$u);
-							}
-							$st['act'] = 1;
-						}
-					}
-				}
-			}else{
-				$st['noeffectbattle1'] = 1;
-			}
-			
-			//�������� �� ��������
-			//$st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format'];
-			if( $nbs[4899] > 0 ) {
-				//������� ��������
-				$st['items_img'][8] = 'robe_illusion4.gif';
-				$st['items_img'][11] = 'leg_illusion4.gif';				
-			}elseif( $nbs[4900] > 0 ) {
-				//������ ��������
-				$st['items_img'][8] = 'robe_illusion5.gif';
-				$st['items_img'][11] = 'leg_illusion5.gif';				
-			}elseif( $nbs[4901] > 0 ) {
-				//������� ��������
-				$st['items_img'][8] = 'robe_illusion3.gif';
-				$st['items_img'][11] = 'leg_illusion3.gif';				
-			}elseif( $nbs[4902] > 0 ) {
-				//����� ��������
-				$st['items_img'][8] = 'robe_illusion6.gif';
-				$st['items_img'][11] = 'leg_illusion6.gif';				
-			}elseif( $nbs[4903] > 0 ) {
-				//������ ��������
-				$st['items_img'][8] = 'robe_illusion8.gif';
-				$st['items_img'][11] = 'leg_illusion8.gif';				
-			}elseif( $nbs[4904] > 0 ) {
-				//��������� ������
-				$st['items_img'][8] = 'robe_illusion7.gif';
-				$st['items_img'][11] = 'leg_illusion7.gif';				
-			}elseif( $nbs[4905] > 0 ) {
-				//��������� ������
-				$st['items_img'][8] = 'robe_illusion9.gif';
-				$st['items_img'][11] = 'leg_illusion9.gif';				
-			}elseif( $nbs[4908] > 0 ) {
-				//����� ������ ������
-				$st['items_img'][8] = 'robe_illusion2.gif';
-				$st['items_img'][11] = 'leg_illusion2.gif';
-				$st['items_img'][10] = 'boots_illusion2.gif';
-				$st['items_img'][9] = 'belt_illusion2.gif';
-				$st['items_img'][5] = 'naruchi_illusion2.gif';	
-				$st['items_img'][4] = 'helmet_illusion2.gif';
-				$st['items_img'][12] = 'perchi_illusion2.gif';				
-			}elseif( $nbs[4906] > 0 ) {
-				//����� ������������� ������
-				$st['items_img'][8] = 'robe_illusion1.gif';
-				$st['items_img'][11] = 'leg_illusion1.gif';
-				$st['items_img'][10] = 'boots_illusion1.gif';
-				$st['items_img'][9] = 'belt_illusion1.gif';
-				$st['items_img'][5] = 'naruchi_illusion1.gif';	
-				$st['items_img'][4] = 'helmet_illusion1.gif';
-				$st['items_img'][12] = 'perchi_illusion1.gif';				
-			}
-			if( $nbs[4909] > 0 ) {
-				//����� ������� ���������
-				$st['items_img'][13] = 'ring_illusion2.gif';
-				$st['items_img'][17] = 'ring_illusion2.gif';
-				$st['items_img'][18] = 'ring_illusion2.gif';
-				$st['items_img'][14] = 'amulet_illusion2.gif';
-				$st['items_img'][15] = 'earrings_illusion2.gif';				
-			}elseif( $nbs[4907] > 0 ) {
-				//����� ������� ���������
-				$st['items_img'][13] = 'ring_illusion1.gif';
-				$st['items_img'][17] = 'ring_illusion1.gif';
-				$st['items_img'][18] = 'ring_illusion1.gif';
-				$st['items_img'][14] = 'amulet_illusion1.gif';
-				$st['items_img'][15] = 'earrings_illusion1.gif';				
-			}
-			
-			if( $itmslvl < 5 ) {
-				//������ ����������
-				$st['itmslvl'] = 0;
-			}else{
-				$st['itmslvl'] = 1;
-			}
-			//
-			$st['itmsCfc'] = $itmsCfc;
-			
-			unset($test_btl_info);
-			
-			if( $u['battle'] > 0 ) {
-				//�������������� �� �������
-				$efs = mysql_query('SELECT `eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`tr_life_user`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace` FROM `eff_users` AS `eu` WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "'.time().'" AND `eu`.`v1` = "priem" ORDER BY `eu`.`id` ASC');
-				$st['set_pog'] = array();
-				$st['set_pog2'] = array();
-				while($e = mysql_fetch_array($efs))
-				{
-					$e['type1'] = 14;
-					$e['img'] = $e['img2'];
-					if($e['tr_life_user'] > 0 ) {
-						$trlu = mysql_fetch_array(mysql_query('SELECT `hpNow` FROM `stats` WHERE `id` = "'.$e['tr_life_user'].'" LIMIT 1'));
-						if( floor($trlu['hpNow']) < 1 ) {
-							$this->endEffect($e['id'],$u);
-							$st['act'] = 1;
-						}
-					}
-					if($e['timeUse']+$e['timeAce']+$e['actionTime']>time() || $e['timeUse']==77)
-					{				
-						if($e['v1'] == 'priem') {
-							$prsu[$e['v2']] = 0+$prsu['x'];
-						}
-						$st['effects'][$h] = $e;	$h++;
-						$sts = $this->lookStats($e['data']);
-						if($e['v2'] == 217) {
-							$st['raztac'] = 1;
-						}
-						if(isset($sts['add_pog']))
-						{
-							$ctt = count($st['set_pog']);
-							$st['set_pog'][$ctt]['id'] = $h;
-							$st['set_pog'][$ctt]['y']  = $sts['add_pog'];
-							unset($ctt);
-						}
-						if(isset($sts['natoe'])) {
-							$st['set_natoe']['id'] = $h;
-							$st['set_natoe']['a'] = 0 + $sts['natoe_end'];
-							$st['set_natoe']['b'] = 0 + $sts['natoe'];
-							$st['set_natoe']['eff_id'] = $e['id'];
-							$st['set_natoe']['t'] = 0 + $sts['natoe_type'];
-							$st['set_natoe']['user_id'] = $e['tr_life_user'];
-						}
-						if(isset($sts['add_pog2']))
-						{
-							$ctt = count($st['set_pog2']);
-							$st['set_pog2'][$ctt]['id'] = $h;
-							$st['set_pog2'][$ctt]['y']  = $sts['add_pog2'];
-							$st['set_pog2'][$ctt]['p']  = $sts['add_pog2p'];
-							$st['set_pog2'][$ctt]['m']  = $sts['add_pog2mp'];
-							unset($ctt);
-						}
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['add_'.$ia[$i]])) 
-								{
-								if($ia[$i] != 'zaproc' && $ia[$i] != 'zmproc') {
-									if(!isset($sti[$ia[$i]])) {
-										$sti[$ia[$i]] = 0;
-									}
-									$sti[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-									if(!isset($st[$ia[$i]])) {
-										$st[$ia[$i]] = 0;
-									}
-									$st[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-								}else{
-									$sti[$ia[$i]] = 100-$sti[$ia[$i]];
-									$sti[$ia[$i]] = $sti[$ia[$i]] - $sti[$ia[$i]]/100*intval($sts['add_'.$ia[$i]]);
-									$sti[$ia[$i]] = 100-$sti[$ia[$i]];	
-																	
-									$st[$ia[$i]] = 100-$st[$ia[$i]];
-									$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]]/100*intval($sts['add_'.$ia[$i]]);
-									$st[$ia[$i]] = 100-$st[$ia[$i]];
-								}
-								}
-							}
-							$i++;
-						}	
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['add_'.$ia[$i]])) 
-								{
-								if(!isset($s_vi[$ia[$i]])) {
-										$s_vi[$ia[$i]] = 0;
-									}
-								$s_vi[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								if(!isset($s_v[$ia[$i]])) {
-										$s_v[$ia[$i]] = 0;
-									}
-								$s_v[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								}
-							}
-							$i++;
-						}	
-					}elseif($e['timeUse']!=77){
-						//������� ������					
-						$this->endEffect($e['id'],$u);
-						$st['act'] = 1;
-					}
-				}
-			}
-				
-			//����� ����������
-			/*$bl = mysql_fetch_array(mysql_query('SELECT `id`,`level` FROM `users_paybonus` WHERE `id` = "'.$u['id'].'" LIMIT 1'));
-			$st['pbe'] = 0+$bl['level'];
-			if( $st['pbe'] > 1000 ) {
-				$st['pbe'] = 1000;
-			}
-			unset($bl);*/
-				
-			//���� ������
-			if( $st['clanpos'] > 0 ) {
-				if( $st['clanpos'] == 1 ) {
-					$st['s1'] += 5;
-					$st['s2'] += 5;
-					$st['s3'] += 5;
-					$st['s4'] += 5;
-					$st['s5'] += 5;
-					$st['s6'] += 5;
-					$st['m10'] += 10;
-					$st['m11'] += 10;
-				}elseif( $st['clanpos'] == 2 ) {
-					$st['s1'] += 3;
-					$st['s2'] += 3;
-					$st['s3'] += 3;
-					$st['s4'] += 3;
-					$st['s5'] += 3;
-					$st['s6'] += 3;
-					$st['m10'] += 5;
-					$st['m11'] += 5;
-				}elseif( $st['clanpos'] == 3 ) {
-					$st['s1'] += 1;
-					$st['s2'] += 1;
-					$st['s3'] += 1;
-					$st['s4'] += 1;
-					$st['s5'] += 1;
-					$st['s6'] += 1;
-					$st['m10'] += 3;
-					$st['m11'] += 3;
-				}
-			}
-				
-			//�������������� �� ������
-			
-			if(!isset($st['hpAll'])) {
-				$st['hpAll'] = 0;
-			}
-			$st['hpAll'] += $st['s4']*6;
-			
-			//$st['enAll'] += 10;
-			//$st['enAll'] += floor($st['s11']*10);
-			//$st['enAll'] += round($st['s4']*0.09);
-			
-			if(!isset($st['mpAll'])) {
-				$st['mpAll'] = 0;
-			}
-			@$st['mpAll'] += @$st['s6']*10;
-			
-			//������
-				if(!isset($st['m1'])) {
-					$st['m1'] = 0;
-				} $st['m1']	 += $st['s3']*5;
-				
-			
-			// ��.����-���� = 2.5
-				if(!isset($st['m2'])) {
-					$st['m2'] = 0;
-				} $st['m2']	 += $st['s3']*5;
-
-			// ��.������ = 2.5
-				if(!isset($st['m4'])) {
-					$st['m4'] = 0;
-				}
-				$st['m4']	 += $st['s2']*5;
-			
-			// ��.����-������ = 2.5
-				if(!isset($st['m5'])) {
-					$st['m5'] = 0;
-				}
-				$st['m5']	 += $st['s2']*5;
-			
-			
-			
-			if(!isset($st['za'])) {
-				$st['za'] = 0;
-			}
-			$st['za']	 += $st['s4']*1.5;	
-			
-			if(!isset($st['zm'])) {
-				$st['zm'] = 0;
-			}		
-			$st['zm']	 += $st['s4']*1.5;
-			
-			//��������
-			//�������� ������ "�������� ����. �����". ����
-				if(!isset($st['antm3'])) {
-    				$st['antm3'] = 0;
-  			 	}
-   				//$st['antm3']  += $st['s4']*1.0;
-			
-		
-			
-			if(!isset($st['m10'])) {
-				$st['m10'] = 0;
-			}
-			$st['m10'] += 0;
-			
-			if(!isset($st['m11'])) {
-				$st['m11'] = 0;
-			}
-			$st['m11'] += 0;
-			
-			if(!isset($st['m11a'])) {
-				$st['m11a'] = 0;
-			}
-			$st['m11a'] += 0;
-			
-			if(!isset($st['m7'])) {
-				$st['m7'] = 0;
-			}
-			$st['m7'] += 0;
-			
-			if(!isset($st['m8'])) {
-				$st['m8'] = 0;
-			}
-			$st['m8'] += 0;
-		
-			//������ ����������
-			$i = 0;
-			while($i<=count(@$coms['new']))
-			{
-				if(@isset($coms['new'][$i]))
-				{
-					//$coms[$i]['id'] - id ���������, $j - ���-�� ��������� ������� ���������
-					$j = @$coms['com'][$coms['new'][$i]];
-					$com = mysql_fetch_array(mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.((int)$coms['new'][$i]).'" AND `x` <= '.((int)$j).' ORDER BY  `x` DESC  LIMIT 1'));					
-					if(isset($com['id']))
-					{						
-						//��������� �������� ���������
-						$ij = 0;
-						$sti = $this->lookStats($com['data']);
-						while($ij<count($ia))
-						{
-							if(isset($ia[$ij]) && isset($sti[$ia[$ij]]))
-							{
-								$st[$ia[$ij]] += $sti[$ia[$ij]];
-							}
-							$ij++;
-						}	
-					}
-				}
-				$i++;
-			}
-		
-			//������ ������
-			//������ �������
-			if($u['autospell'] != '' && $u['autospell'] != 0 && $u['battle'] == 0) {
-				//��������� ������
-				$splink = '';
-				$spi = mysql_query('SELECT `id`,`item_id`,`inOdet` FROM `items_users` WHERE `inOdet` >= 40 AND `inOdet` <= 50 AND `uid` = "'.$u['id'].'" AND `delete` = 0 ORDER BY `item_id` DESC LIMIT 20');
-				while($pli = mysql_fetch_array($spi)) {
-					$splink .= $pli['item_id'].'-'.$pli['inOdet'].',';
-				}
-				$splink = rtrim($splink,',');
-				
-				//���������� ����� �������� �������
-				if( $u['autospell'] == 1 ) {
-					$u['autospell'] = $splink;
-					mysql_query('UPDATE `users` SET `autospell` = "'.$splink.'" WHERE `id` = "'.$u['id'].'" LIMIT 1');
-				}
-				
-				//������ ������ ������, ���� �� ���� � ���������
-				if( $u['autospell'] != $splink ) {
-					$spe1 = explode(',',$splink);
-					$spe2 = explode(',',$u['autospell']);
-					$i = 0;
-					while( $i <= 20 ) {
-						//
-						$spe1a = explode('-',$spe1[$i]);
-						$spe2a = explode('-',$spe2[$i]);
-						//
-						if(isset($spe1a[0])) {
-							$spe1g[$spe1a[1]] = $spe1a[0];
-						}
-						if(isset($spe2a[0])) {
-							$spe2g[$spe2a[1]] = $spe2a[0];
-						}
-						//
-						$i++;
-					}
-					$i = 40;
-					while( $i <= 50 ) {
-						if( $spe1g[$i] != $spe2g[$i] && $spe1g[$i] == 0 ) {
-							//echo '['.$spe2g[$i].'->'.$i.']';
-							$splu = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.$spe2g[$i].'" AND `inOdet` = 0 AND `delete` = 0 AND `inTransfer` = 0 AND `inShop` = 0 AND `uid` = "'.$u['id'].'" AND `inGroup` = 0 LIMIT 1'));
-							if(isset($splu['id'])) {
-								mysql_query('UPDATE `items_users` SET `inOdet` = "'.$i.'" WHERE `id` = "'.$splu['id'].'" LIMIT 1');
-							}
-						}
-						$i++;
-					}
-				}
-			}
-			
-
-			//������ ������
-			//���
-			//����
-			/*if($st['s1']>24 && $st['s1']<50){ $st['m10']  += 5;  }
-			if($st['s1']>49 && $st['s1']<75){ $st['m10']  += 10; }
-			if($st['s1']>74 && $st['s1']<100){ $st['m10']  += 17; }
-			if($st['s1']>99 && $st['s1']<125){ $st['m10']  += 25; }
-			if($st['s1']>124 && $st['s1']<150){ $st['m10'] += 25; $st['minAtack'] += 10; $st['maxAtack'] += 10; }
-			if($st['s1']>149 && $st['s1']<175){ $st['m10'] += 30; $st['minAtack'] += 10; $st['maxAtack'] += 10; }
-			if($st['s1']>174){ $st['m10'] += 30; $st['minAtack'] += 15; $st['maxAtack'] += 15; }*/
-			
-			if($st['s1']>24 && $st['s1']<50){ $st['m2']  += 15; }
-			if($st['s1']>49 && $st['s1']<75){ $st['pa2']  += 2; $st['m2']  += 35; }
-			if($st['s1']>74 && $st['s1']<100){ $st['pa2']  += 5; $st['m2']  += 50; }
-			if($st['s1']>99 && $st['s1']<125){ $st['pa2']  += 8; $st['m2']  += 80; }
-			if($st['s1']>124 && $st['s1']<150){ $st['pa2']  += 12; $st['m2']  += 105; }
-			if($st['s1']>149 && $st['s1']<175){ $st['pa2']  += 17; $st['m7']  += 2; }
-			if($st['s1']>174 && $st['s1']<200){ $st['pa2']  += 23; $st['m7']  += 5; }
-			if($st['s1']>199) { $st['pa2']  += 30; $st['m7']  += 7; }
-			
-			//�������� $st[1]['pa1']  += 2; $st['m7']  += 35;
-			/*if($st['s2']>24 && $st['s2']<50){ $st[1]['pa1']  += 2; }
-			if($st['s2']>49 && $st['s2']<75){ $st['m7']  += 5; $st['m4']  += 35; $st['m2']  += 15; }
-			if($st['s2']>74 && $st['s2']<100){ $st['m7']  += 15; $st['m4']  += 35; $st['m2']  += 15; }
-			if($st['s2']>99 && $st['s2']<125){ $st['m7']  += 15; $st['m4']  += 105; $st['m2']  += 40; }
-			if($st['s2']>124 && $st['s2']<150) { $st['m7']  += 15; $st['m4']  += 105; $st['m2']  += 40; $st['m15'] += 5; }
-			if($st['s2']>149 && $st['s2']<175){ $st['m7']  += 20; $st['m4']  += 115; $st['m2']  += 40; $st['m15'] += 5; }
-			if($st['s2']>174){ $st['m7']  += 20; $st['m4']  += 120; $st['m2']  += 50; $st['m15'] += 7; }*/
-			
-			if($st['s2']>24 && $st['s2']<50){ $st['pa1']  += 2; $st['m4']  += 35; }
-			if($st['s2']>49 && $st['s2']<75){ $st['pa1']  += 5; $st['m2']  += 40; $st['m4']  += 75; }
-			if($st['s2']>74 && $st['s2']<100){ $st['pa1']  += 8; $st['m2']  += 65; $st['m4']  += 90; }
-			if($st['s2']>99 && $st['s2']<125){ $st['pa1']  += 12; $st['m2']  += 75; $st['m4']  += 105; }
-			if($st['s2']>124 && $st['s2']<150){ $st['pa1']  += 17; $st['m2']  += 85; $st['m4']  += 105; $st['m15']  += 3; }
-			if($st['s2']>149 && $st['s2']<175){ $st['pa1']  += 20; $st['m2']  += 110; $st['m4']  += 115; $st['m15']  += 5; }
-			if($st['s2']>174 && $st['s2']<200){ $st['pa1']  += 23; $st['m2']  += 145; $st['m4']  += 145; $st['m15']  += 8; }
-			if($st['s2']>199) { $st['pa1']  += 30; $st['m2']  += 165; $st['m4']  += 165; $st['m15']  += 10;}
-			
-			//��������
-			/*if($st['s3']>24 && $st['s3']<50){ $st['m3'] += 10; }
-			if($st['s3']>49 && $st['s3']<75){ $st['m3'] += 10; $st['m1'] += 35; $st['m5'] += 15; }
-			if($st['s3']>74 && $st['s3']<100){ $st['m3'] += 25; $st['m1'] += 35; $st['m5'] += 15; }
-			if($st['s3']>99 && $st['s3']<125){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; }
-			if($st['s3']>124 && $st['s3']<150){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; }
-			if($st['s3']>149 && $st['s3']<175){ $st['m3'] += 30; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; }
-			if($st['s3']>174){ $st['m3'] += 30; $st['m1'] += 120; $st['m5'] += 45; $st['m14'] += 7; }*/
-			if($st['s3']>24 && $st['s3']<50){ $st['pa4']+=2; $st['m3'] += 2; $st['m1'] += 25;}
-			if($st['s3']>49 && $st['s3']<75){ $st['pa4']+=5; $st['m3'] += 5; $st['m1'] += 55; }
-			if($st['s3']>74 && $st['s3']<100){ $st['pa4']+=8; $st['m3'] += 10; $st['m1'] += 75; $st['m5'] += 25; }
-			if($st['s3']>99 && $st['s3']<125){ $st['pa4']+=12; $st['m3'] += 15; $st['m1'] += 105; $st['m5'] += 35; }
-			if($st['s3']>124 && $st['s3']<150){ $st['pa4']+=17; $st['m3'] += 20; $st['m1'] += 125; $st['m5'] += 45; $st['m14'] += 2; }
-			if($st['s3']>149 && $st['s3']<175){ $st['pa4']+=20; $st['m3'] += 30; $st['m1'] += 145; $st['m5'] += 50; $st['m14'] += 5; }
-			if($st['s3']>174 && $st['s3']<200){ $st['pa4']+=23; $st['m3'] += 35; $st['m1'] += 165; $st['m5'] += 55; $st['m14'] += 7; }
-			if($st['s3']>199){ $st['pa4']+=30; $st['m3'] += 40; $st['m1'] += 185; $st['m5'] += 65; $st['m14'] += 9; }
-			
-			//������������
-			/*if($st['s4']>0){ $st['hpAll']   += 30;  }
-			if($st['s4']>24 && $st['s4']<50){ $st['hpAll']  += 50;  }
-			if($st['s4']>49 && $st['s4']<75){ $st['hpAll']  += 100; }
-			if($st['s4']>74 && $st['s4']<100){ $st['hpAll']  += 175; }
-			if($st['s4']>99 && $st['s4']<125){ $st['hpAll']  += 250; }
-			if($st['s4']>124 && $st['s4']<150){ $st['hpAll'] += 250; $st['za'] += 25; }
-			if($st['s4']>149 && $st['s4']<175){ $st['hpAll'] += 350; $st['za'] += 50; }
-			if($st['s4']>174){ $st['hpAll'] += 400; $st['za'] += 100; }*/
-			if($st['s4']>0){ $st['hpAll']   += 30;  }
-			if($st['s4']>24 && $st['s4']<50){ $st['hpAll']  += 50;  }
-			if($st['s4']>49 && $st['s4']<75){ $st['hpAll']  += 100; }
-			if($st['s4']>74 && $st['s4']<100){ $st['hpAll']  += 175; }
-			if($st['s4']>99 && $st['s4']<125){ $st['hpAll']  += 250; }
-			if($st['s4']>124 && $st['s4']<150){ $st['hpAll'] += 400; $st['za'] += 25; $st['zm'] += 25; }
-			if($st['s4']>149 && $st['s4']<175){ $st['hpAll'] += 450; $st['za'] += 50; $st['zm'] += 50; }
-			if($st['s4']>174 && $st['s4']<200){ $st['hpAll'] += 600; $st['za'] += 100; $st['zm'] += 100; }
-			if($st['s4']>199){ $st['hpAll'] += 850; $st['za'] += 125; $st['zm'] += 125; }
-			//�������� 
-			/*if($st['s5']>24 && $st['s5']<50){ $st['m11'] += 5; }
-			if($st['s5']>49 && $st['s5']<75){ $st['m11'] += 10;  }
-			if($st['s5']>74 && $st['s5']<100){ $st['m11'] += 17; }
-			if($st['s5']>99 && $st['s5']<125){ $st['m11'] += 25; }
-			if($st['s5']>124 && $st['s5']<150){ $st['m11'] += 35;  }
-			if($st['s5']>149 && $st['s5']<175){ $st['m11'] += 45; }
-			if($st['s5']>174){ $st['m11'] += 60; }*/
-			if($st['s5']>24 && $st['s5']<50){ $st['m11'] += 10; }
-			if($st['s5']>49 && $st['s5']<75){ $st['m11'] += 15;  }
-			if($st['s5']>74 && $st['s5']<100){ $st['m11'] += 20; }
-			if($st['s5']>99 && $st['s5']<125){ $st['m11'] += 25; }
-			if($st['s5']>124 && $st['s5']<150){ $st['m11'] += 35;  }
-			if($st['s5']>149 && $st['s5']<175){ $st['m11'] += 50; }
-			if($st['s5']>174){ $st['m11'] += 65; $st['pzm'] += 2;}
-			if($st['s5']>199){ $st['m11'] += 65; $st['pzm'] += 4;}
-			//��������
-			/*if($st['s6']>24 && $st['s6']<50){ $st['mpAll'] += 50; $st['speedmp'] +=100; }
-			if($st['s6']>49 && $st['s6']<75){ $st['mpAll'] += 100; $st['speedmp'] +=200; }
-			if($st['s6']>74 && $st['s6']<100){ $st['mpAll'] += 175; $st['speedmp'] += 350; }
-			if($st['s6']>99 && $st['s6']<125){ $st['mpAll'] += 250; $st['speedmp'] += 500; }
-			if($st['s6']>124 && $st['s6']<150) { $st['mpAll'] += 250; $st['speedmp'] += 500; $st['pzm'] += 3; }
-			if($st['s6']>149 && $st['s6']<175){ $st['mpAll'] += 300; $st['speedmp'] += 600; $st['pzm'] += 3; }
-			if($st['s6']>174){ $st['mpAll'] += 450; $st['speedmp'] += 700; $st['pzm'] += 5; }*/
-			if($st['s6']>24 && $st['s6']<50){ $st['mpAll'] += 150; $st['speedmp'] +=100; }
-			if($st['s6']>49 && $st['s6']<75){ $st['mpAll'] += 200; $st['speedmp'] +=200; }
-			if($st['s6']>74 && $st['s6']<100){ $st['mpAll'] += 250; $st['speedmp'] += 350; }
-			if($st['s6']>99 && $st['s6']<125){ $st['mpAll'] += 350; $st['speedmp'] += 500; }
-			if($st['s6']>124 && $st['s6']<150) { $st['mpAll'] += 500; $st['speedmp'] += 500; $st['pzm'] += 2; }
-			if($st['s6']>149 && $st['s6']<175){ $st['mpAll'] += 700; $st['speedmp'] += 600; $st['pzm'] += 3; }
-			if($st['s6']>174 && $st['s6']<200){ $st['mpAll'] += 900; $st['speedmp'] += 700; $st['pzm'] += 5; }			
-			if($st['s6']>199) { $st['mpAll'] += 900; $st['speedmp'] += 700; $st['pzm'] += 7; }	
-						
-			//���� ������ ������ �����
-			if($hnd2==1 && $hnd1==1)
-			{
-				$st['zona']++;
-			}
-			
-			if($sht1==1)
-			{
-				$st['zonb']++;
-			}
-			
-			//$st['speedhp'] += $st['pbe'];
-			//$st['speedmp'] += $st['pbe'];
-			
-			/* �������� */
-			$i = 1;						
-			while($i<=7)
-			{				
-				if(!isset($st['pm'.$i])) {
-					$st['pm'.$i] = 0;
-				}
-				if(!isset($st['a'.$i])) {
-					$st['a'.$i] = 0;
-				}
-				if(!isset($st['mg'.$i])) {
-					$st['mg'.$i] = 0;
-				}
-				if(!isset($st['zm'.$i])) {
-					$st['zm'.$i] = 0;
-				}
-				if(isset($st['s5'])) {		$st['pm'.$i] += $st['s5']*0.5;	}
-				if(isset($st['m11a'])) {	$st['pm'.$i] += $st['m11a'];	}
-				if(isset($st['aall'])) {	$st['a'.$i] += $st['aall'];		}
-				if(isset($st['m2all'])) {	$st['mg'.$i] += $st['m2all'];	}
-				if(isset($st['zm'])) {		$st['zm'.$i] += $st['zm'];		}
-				if(isset($st['zma'])) {		$st['zm'.$i] += $st['zma'];		}
-				if($i<=4)
-				{					
-					if(!isset($st['mib'.$i])) {
-						$st['mib'.$i] = 0;
-					}
-					if(!isset($st['mab'.$i])) {
-						$st['mab'.$i] = 0;
-					}
-					if(!isset($st['mg'.$i])) {
-						$st['mg'.$i] = 0;
-					}
-					if(!isset($st['pm'.$i])) {
-						$st['pm'.$i] = 0;
-					}
-					if(!isset($st['pa'.$i])) {
-						$st['pa'.$i] = 0;
-					}
-					if(!isset($st['za'.$i])) {
-						$st['za'.$i] = 0;
-					}
-					$st['mib'.$i] += 0;
-					$st['mab'.$i] += 0;
-					if(isset($st['mall'])) {	$st['mg'.$i] += $st['mall'];	}
-					if(isset($st['m11'])) {		$st['pm'.$i] += $st['m11'];		}
-					if(isset($st['m10'])) {		$st['pa'.$i] += $st['m10'];		}
-					if(isset($st['za'])) {		$st['za'.$i] += $st['za'];		}
-				}				
-				$i++;
-			}
-			
-			//���������� ������ � ������
-			
-			$i = 1;
-			while( $i <= 7 ) {
-				@$st['yzm'.$i] += @$st['yzma'];
-				if( $i <= 4 ) {
-					@$st['yzm'.$i] += @$st['yzm'];//��������� ���� ������
-					@$st['yza'.$i] += @$st['yza']; //���� ������
-				}
-				//�������� �� ������ �� �����
-				if( isset($st['yza'.$i]) && $i <= 4 ) {
-					$st['za'.$i] = ($st['za'.$i]/100*(100+($st['yza'.$i])));
-					if( $st['za'.$i] < 0 ) {
-						$st['za'.$i] = 0;
-					}
-				}
-				//�������� �� ������ �� �����
-				if( isset($st['yzm'.$i]) ) {
-					$st['zm'.$i] = ($st['zm'.$i]/100*(100+($st['yzm'.$i])));
-					if( $st['zm'.$i] < 0 ) {
-						$st['zm'.$i] = 0;
-					}
-				}				
-				$i++;
-			}
-			
-			
-			
-			if(isset($st['hpVinos']) && $st['hpVinos'] != 0) {
-				$st['hpAll'] += round($st['hpVinos']*$st['s4']);
-			}
-			
-			if(isset($st['mpVinos']) && $st['mpVinos'] != 0) {
-				$st['mpAll'] += round($st['mpVinos']*$st['s6']);
-			}
-			
-			if(isset($st['hpProc']) && $st['hpProc'] != 0) {
-				$st['hpAll'] += round($st['hpAll']/100*$st['hpProc']);
-			}
-			
-			if(isset($st['mpProc']) && $st['mpProc'] != 0) {
-				$st['mpAll'] += round($st['mpAll']/100*$st['mpProc']);
-			}
-			
-			//�����. - 250 ��.
-			/*if( $u['level'] > 7 ) {
-				$st['speedhp'] -= 240;
-				$st['speedmp'] -= 240;
-			}*/
-			
-			//����� �������
-			if($st['hpNow']<0)	
-			{
-				$st['hpNow'] = 0;
-			}elseif($st['hpNow']>$st['hpAll'])
-			{
-				$st['hpNow'] = $st['hpAll'];
-			}
-			if($st['mpNow']<0)	
-			{
-				$st['mpNow'] = 0;
-			}elseif($st['mpNow']>$st['mpAll'])
-			{
-				$st['mpNow'] = $st['mpAll'];
-			}
-			
-			//���� ����� � �����
-			if($st['zona']<1){ $st['zona'] = 1; }
-			if($st['zona']>5){ $st['zona'] = 5; }
-			if($st['zonb']<1){ $st['zonb'] = 1; }
-			if($st['zonb']>3){ $st['zonb'] = 3; }
-			
-			$st['ozash'] = $oza;
-			$st['ozmsh'] = $ozm;
-			$st['weapon1'] = $hnd1;
-			$st['weapon2'] = $hnd2;
-			$st['sheld1']  = $sht1;
-			$st['sv_']	  = $s_v;
-			$st['sv_i']	 = $s_vi;
-			$st['dom']	  = $dom;		
-			$st['prsu']	 = $prsu;
-			
-			$st['x'] = $u['x'];
-			$st['y'] = $u['y'];
-			$st['s'] = $u['s'];
-			
-			//�������� �������
-			/*$st['reting'] = 0;
-			//
-			$st['reting'] += $st['hpAll'];
-			$st['reting'] += $st['mpAll'];
-			//
-			$st['reting'] += $st['m1'];
-			$st['reting'] += $st['m2'];
-			$st['reting'] += $st['m4'];
-			$st['reting'] += $st['m5'];
-			//
-			$st['reting'] += $st['m6']*10;
-			$st['reting'] += $st['m7']*10;
-			$st['reting'] += $st['m8']*10;
-			$st['reting'] += $st['m9']*10;
-			//
-			$st['reting'] += $st['a1']*7;
-			$st['reting'] += $st['a2']*7;
-			$st['reting'] += $st['a3']*7;
-			$st['reting'] += $st['a4']*7;
-			$st['reting'] += $st['a5']*7;
-			$st['reting'] += $st['a6']*7;
-			$st['reting'] += $st['a7']*7;
-			//
-			$st['reting'] += $st['mg1']*7;
-			$st['reting'] += $st['mg2']*7;
-			$st['reting'] += $st['mg3']*7;
-			$st['reting'] += $st['mg4']*7;
-			$st['reting'] += $st['mg5']*7;
-			$st['reting'] += $st['mg6']*7;
-			$st['reting'] += $st['mg7']*7;
-			//
-			$st['reting'] += $st['m3']*5;
-			$i8 = 1;
-			$st['reting'] += $st['za']*5;
-			$st['reting'] += $st['zm']*5;
-			//
-			$st['reting'] += $st['s5']*5;
-			$st['reting'] += $st['s6']*5;
-			//
-			while( $i8 < 8 ) {
-				$st['reting'] += $st['pa'.$i]*5;
-				$st['reting'] += $st['pm'.$i]*5;
-				//
-				$st['reting'] += $st['za'.$i]*10;
-				$st['reting'] += $st['zm'.$i]*10;
-				$i8++;
-			}
-			//
-			$i8 = 1;
-			while( $i8 < 5 ) {
-				$st['reting'] += $st['mib'.$i];
-				$st['reting'] += $st['mab'.$i];
-				$i8++;
-			}*/
-			
-			$st['reting'] = 1+ceil($st['reting']);
-			$st['reting'] = 1+$st['irka'];
-			
-			if($u['vip'] > 0) {
-				$st['exp'] += 25;
-				$st['speedhp'] += 100;
-				$st['speedmp'] += 100;
-				$st['repair_discount'] +=1;
-				$st['repair_r'] +=1;
-				$st['repair_z'] +=1;
-			}
-			
-			//����� �� �������
-			$rep1 = mysql_fetch_array(@mysql_query('SELECT 
-			`add_slot`,`nu_sandcity`,`n_sandcity`,
-			`dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`,
-			`repdevilscity`,`repmooncity`,`repsuncity`,`repsandcity`,`repemeraldscity`,`repdreamscity`,`repizlom`,
-			`n_capitalcity`,`n_demonscity`,`n_suncity`,`nu_demonscity`,`nu_angelscity`,`nu_abandonedplain`,`nu_emeraldscity`,
-			`nu_capitalcity`,`nu_suncity`,`nu_devilscity`,`nu_dreamscity`,`add_stats`,`add_money`,`add_skills`,`add_skills2`,
-			`rep3`,`rep3_buy`,`repdragonscity`,`n_dragonscity`,`nu_dragonscity`,
-			(`repcapitalcity`+`repdemonscity`+`repangelscity`+`repsuncity`+`repdreamscity`+`repabandonedplain`+`repsandcity`+`repemeraldscity`) as allrep, 
-			(`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`+`nu_emeraldscity`) as allnurep FROM `rep` WHERE `id` = "'.$u['id'].'" LIMIT 1'));
-   //��������
-   if($rep1['repdreamscity'] > 999 && $rep1['repdreamscity'] < 5000 ) {
-	   $st['m1'] += 25;
-	   $st['m4'] += 25;
-   }elseif($rep1['repdreamscity'] > 4999 && $rep1['repdreamscity'] < 10000) {
-	   $st['m1'] += 50;
-	   $st['m2'] += 25;
-	   $st['m4'] += 50;
-	   $st['m5'] += 25;
-   }elseif($rep1['repdreamscity'] > 9999) {
-	   $st['m1'] += 75;
-	   $st['m2'] += 50;
-	   $st['m4'] += 75;
-	   $st['m5'] += 50;
-   }
-   //�����
-   if($rep1['repizlom'] > 999 && $rep1['repizlom'] < 5000) {
-	   $st['speedhp'] += 50;
-	   $st['speedmp'] += 50;
-	   $st['speed_dungeon'] +=10;
-   }elseif($rep1['repizlom'] > 4999 && $rep1['repizlom'] < 10000) {
-	   $st['speedhp'] += 75;
-	   $st['speedmp'] += 75;
-	   $st['speed_dungeon'] +=20;
-   }elseif($rep1['repizlom'] > 9999) {
-	   $st['speedhp'] += 100;
-	   $st['speedmp'] += 100;
-	   $st['speed_dungeon'] += 30;
-   }
-   //������
-   if($rep1['repangelscity'] > 9999 && $rep1['repangelscity'] < 25000) {
-	   $st['exp'] += 5;
-	   /*$st['hpAll'] += 100;
-	   $st['mpAll'] += 100;*/
-   }elseif($rep1['repangelscity'] > 24999) {
-	   $st['exp'] += 10;
-	   /*$st['hpAll'] += 200;
-	   $st['mpAll'] += 200;*/
-   }
-   //���������
-   if($rep1['repdemonscity'] > 9999 && $rep1['repdemonscity'] < 25000) {
-	   $st['m10'] += 5;
-	   $st['zma'] += 50;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['m10'] += 10;
-	   $st['zma'] += 100;
-   }
-    //��������
-   if($rep1['repsuncity'] > 9999 && $rep1['repsuncity'] < 25000) {
-	   $st['m11'] += 5;
-	   $st['za'] += 50;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['m11'] += 10;
-	   $st['za'] += 100;
-   }
-   //������ ������ ���������
-   if($rep1['repcapitalcity'] > 9999 && $rep1['repcapitalcity'] < 25000) {
-	   $st['pza'] += 2;
-	   $st['pzm'] += 2;
-	   $st['mib1'] +=10;
-	   $st['mab1'] +=10;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['pza'] += 4;
-	   $st['pzm'] += 4;
-	   $st['mib1'] += 20;
-	   $st['mab1'] +=20;
-   }
-   //���� �������
-   if($rep1['repabandonedplain'] > 9999 && $rep1['repabandonedplain'] < 25000) {
-	   $st['mib1'] += 5;
-	   $st['mab3'] += 5;
-	   $st['mab4'] +=5;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['mab1'] += 10;
-	   $st['mab3'] += 10;
-	   $st['mab4'] += 10;
-   }
-				
-			
-			//���������� ������ ��� �������
-			$st['maxves'] += 500;
-						
-			if( $st['silver'] >= 5 ) {
-				$st['exp'] += 50;
-			}
-			
-			if( $u['admin'] > 0 ) {
-				$st['speed_dungeon'] += 1000;
-				$st['speedhp'] += 1000000000000000;
-			}
-			/*if( date('H') >= 22 && date('H') <= 24 ) {
-				if($u['room']==9 && $u['room']==323 && $u['room']==1) {
-				$st['exp'] +=150;
-				}
-			}else*/if( date('H') >=22 && date('H') <= 10 ) {
-				$st['exp'] +=25;
-			}
-			
-			//��������� ������� ������
-			$st['reting'] = floor($st['reting']);
-			//if(@$st['btl_cof'] != @$st['reting']) {
-				//$st['btl_cof'] = $st['reting'];
-				//mysql_query('UPDATE `stats` SET `btl_cof` = "'.$st['reting'].'" WHERE `id` = "'.$st['id'].'" LIMIT 1');
-			//}
-			if(@$st['btl_cof'] != @$st['prckr']) {
-				$st['btl_cof'] = $st['prckr'];
-				mysql_query('UPDATE `stats` SET `btl_cof` = "'.$st['prckr'].'" WHERE `id` = "'.$st['id'].'" LIMIT 1');
-			}
-
-			if($st['hpAll'] < 1) {
-				$st['hpAll'] = 1;
-			}
-			
-			if($st['mpAll'] < 0) {
-				$st['mpAll'] = 0;
-			}
-
-			if($u['room'] == 411) {
-				//������, ������ �� ����� -25% ��
-				$shb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u['id'].'" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1'));
-				if(isset($shb['id'])) {
-					$st['hpAll'] = round($st['hpAll']/100*75);
-				}
-			}
-		
-			if( stristr($u['login'], '(����� ') == true || (stristr($u['login'], '�������� �����') && $u['ip'] == '0') ) {
-				$st['this_animal'] = 1;
-			}else{
-				$st['this_animal'] = 0;
-			}
-			
-			$rt = array();
-			if($i1==1)
-			{
-				$rt[0] = $st;
-				$rt[1] = $st2; //������ �����
-			}else{
-				$rt = $st;
-			}
-			
-			if( $u['hpAll'] != $st['hpAll'] || $u['mpAll'] != $st['mpAll'] ) {
-				mysql_query('UPDATE `stats` SET `hpAll` = "'.$st['hpAll'].'",`mpAll` = "'.$st['mpAll'].'" WHERE `id` = "'.$u['id'].'" LIMIT 1');
-			}
-			
-			if( $btl_cache == true && $cache == false ) {
-				$dataca = array(
-					'st' => $st,
-					'st2' => $st2
-				);
-				$dataca = json_encode($dataca);
-				mysql_query('INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("'.$u['id'].'","'.$u['battle'].'","'.mysql_real_escape_string($dataca).'","'.time().'")');
-			}
-		}
-		
-		if( isset($cache) ) {
-			if( $i1 == 1 ) {
-				$rt = array( $cache['st'] , $cache['st2'] );
-			}else{
-				$rt = $cache['st'];
-			}
-		}
-		
-		return $rt;
-	}	
-	
-	public function send($color,$room,$city,$from,$to,$text,$time,$type,$toChat,$spam,$sound,$new = 1,$typeTime = 0,$global = 0)
-	{
-		mysql_query("INSERT INTO `chat` (`global`,`typeTime`,`new`,`sound`,`color`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`spam`) VALUES
-		('".$global."','".$typeTime."','".$new."','".$sound."','".$color."','".$city."','".$room."','".$from."','".$to."','".$text."','".$time."','".$type."','".$toChat."','".$spam."')");
-		$msg_id = mysql_insert_id();
-		return $msg_id;
-	}
-	
-	//�������� �������
-	public function testLevel()
-	{
-		global $c;
-		$rt = 0;
-		if( $this->info['exp'] > $c['expstop'] ) {
-			$this->info['exp'] = $c['expstop'];
-			mysql_query('UPDATE `stats` SET `exp` = "'.$c['expstop'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-		}
-		if(isset($this->stats['levels']['upLevel']))
-		{
-			$telvl = array();
-			$sp = mysql_query('SELECT `upLevel`,`exp` FROM `levels`');
-			while( $pl = mysql_fetch_array($sp) ) {
-				$telvl[$pl['upLevel']] = $pl['exp'];
-			}
-			if( $this->info['exp'] >= $telvl[$this->info['upLevel']] ) {					
-				$lvl  = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.$this->info['upLevel'].'" LIMIT 1'));			
-				$lvln = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.($lvl['upLevel']+1).'" LIMIT 1'));
-				//������� ��������
-				if($this->info['exp']>12499 && $this->info['level']<=5 && $c['infinity5level'] == true)
-				{
-					$itm = mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "1204" AND `delete` = "0" AND `uid` = "'.$this->info['id'].'" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
-					if(!isset($itm['id']) && $this->info['host_reg'] != 'noinfinity5' && $this->info['twink'] == 0)
-					{
-						$this->info['exp'] = 12499;
-						mysql_query('UPDATE `stats` SET `exp` = "12499" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						echo '<script>chat.sendMsg(["new","'.time().'","6","","'.$this->info['login'].'","��� �������� �� 6-�� ������� ��������� &quot;<b>�������� �������� [6]</b>&quot;.","Black","1","1","0"]);</script>';
-					}else{
-						
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-						$text = '������� &quot;<b>�������� �������� [6]</b>&quot; ��� ������� �����������.';
-						echo '<script>chat.sendMsg(["new","'.time().'","6","","'.$this->info['login'].'","'.$text.'","Black","1","1","0"]);</script>';
-						//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1',".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$text."','".time()."','6','0')");
-					}
-	
-				}
-				//****************
-				$i = 0; $ult = 0;
-				//mysql_query('LOCK TABLES users,stats,mults,bank,referal_bous,levels,chat WRITE');
-				while($i!=1)
-				{
-					if($c['nolevel'] == true && $this->info['exp']>=$lvl['exp'] && isset($lvln['upLevel']))
-					{
-						$tlus = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `real` = 1 AND `level` = "'.$this->info['level'].'" LIMIT 1'));
-						//����� ��� ��� �������, $lvln
-						if($tlus[0] < $this->info['level']*5) {
-							//������ �������� ���/���� ���� �� ����� 100 ���������� �������� ������
-							$this->info['exp'] = $lvl['exp']-1;
-							mysql_query('UPDATE `stats` SET `exp` = "'.$this->info['exp'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						}
-					}
-					if($this->info['exp']>=$lvl['exp'] && isset($lvln['upLevel']))
-					{					
-						if($lvl['nextLevel']>$this->info['level'])
-						{
-							//������ �������� ��������
-							/*
-							if($lvl['nextLevel']==8){
-								$text = '��� �������� �� 8 ������� �� ��������� ������� &quot;<b>������ ������ -����-</b>&quot;.';
-								echo '<script>chat.sendMsg(["new","'.time().'","6","","'.$this->info['login'].'","'.$text.'","Black","1","1","0"]);</script>';
-								$this->addItem(1190,$this->info['id'],'|sudba='.$this->info['login']);
-							}
-							*/
-							
-							//�������� ������������ 
-							$a4 = 1;
-							if($lvl['nextLevel']==9)
-							{
-								$a4 = 2;
-							}elseif($lvl['nextLevel']==10)
-							{
-								$a4 = 3;
-							}elseif($lvl['nextLevel']==11)
-							{
-								$a4 = 5;
-							}elseif($lvl['nextLevel']==12)
-							{
-								$a4 = 30;
-							}
-							
-							$this->stats['s4'] += $a4;
-							$sex1 = '';
-							if($this->info['sex']==1)
-							{
-								$sex1 = '��';
-							}
-							
-							$ult = 1;
-	
-							//��������
-							if($this->info['twink'] == 0 && (round($this->info['host_reg']) > 0 && ( $this->info['dieline'] == 0 || $this->info['dieline'] < $lvl['exp'] ))) {
-								$mtest = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`uid2`,`ip` FROM `mults` WHERE (`uid` = "'.$this->info['id'].'" AND `uid2` = "'.((int)$this->info['host_reg']).'") OR (`uid2` = "'.$this->info['id'].'" AND `uid` = "'.((int)$this->info['host_reg']).'") LIMIT 1'));
-								$rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$this->info['host_reg']).'" LIMIT 1'));
-								$rlogs = mysql_fetch_array(mysql_query('SELECT `id`,`ref_data` FROM `stats` WHERE `id` = "'.((int)$this->info['host_reg']).'" LIMIT 1'));								
-								
-								if(!isset($mtest['id']) && isset($rlog['id'])) {
-									$rtg = true;
-								}else{
-									$rtg = mysql_fetch_array(mysql_query('SELECT * FROM `ref_mult` WHERE `uid1` = "'.$rlog['id'].'" LIMIT 1'));
-									if(isset($rtg['id'])) {
-										if( $this->info['id'] == $rtg['uid2'] ) {
-											$rtg = true;
-										}else{
-											$rtg = false;
-										}
-									}else{
-										mysql_query('INSERT INTO `ref_mult` (`uid1`,`uid2`,`time`) VALUES (
-											"'.$rlog['id'].'" , "'.$this->info['id'].'","'.time().'"
-										)');
-										$rtg = true;
-									}
-								}
-								
-								if(($rtg == true || !isset($mtest['id'])) && isset($rlog['id']) && $this->info['activ'] == 0) {
-									$rfs['data'] = explode('|',$rlogs['ref_data']);
-									$ekr = '0.00';
-									$bn = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`level`,`add_bank`,`add_money`,`finish_battle`,`online`,`onlyOne`,`add_crystals` FROM `referal_bous` WHERE `type` = 1 AND `level` = "'.$lvl['nextLevel'].'" LIMIT 1'));
-									if(isset($bn['id']) && ($bn['add_bank'] > 0 || $bn['add_money'] > 0) ) {
-										$ekr = $bn['add_bank'];
-										$kr = $bn['add_money'];
-										$up = mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.mysql_real_escape_string($rlog['id']).'" LIMIT 1');
-										if($up) {
-											
-											//������� 1-�� ������
-											$krtxt = '';
-											if( $kr > 0 ) {
-												$krtxt .= ''.$kr.' ��';
-												if( $ekr > 0 ) {
-													$krtxt .= ', ';
-												}
-											}
-											if( $ekr > 0 ) {
-												$krtxt .= ''.$ekr.' ���';
-											}											
-											$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$lvl['nextLevel'].'! ��� ���������� '.$krtxt,-1,6,0,0,0,1);
-											$rlog['catch'] += $bn['add_bank'];
-											mysql_query('UPDATE `users` SET `catch` = "'.$rlog['catch'].'" WHERE `id` = "'.$rlog['id'].'" LIMIT 1');
-											//
-											if( (int)$rlog['host_reg'] > 0 ) {
-												//������� 2-�� ������
-												$llogin = $rlog['login'];
-												$ekr = round($bn['add_bank']*0.4,2);
-												$kr = round($bn['add_money']*0.4,2);
-												$rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$rlog['host_reg']).'" LIMIT 1'));
-												if( isset($rlog['id']) ) {
-													$krtxt = '';
-													if( $kr > 0 ) {
-														$krtxt .= ''.$kr.' ��';
-														if( $ekr > 0 ) {
-															$krtxt .= ', ';
-														}
-													}
-													if( $ekr > 0 ) {
-														$krtxt .= ''.$ekr.' ���';
-													}											
-													$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> (2-�� ������ �� &quot;'.$llogin.'&quot; ) ������'.$sex1.' ������ '.$lvl['nextLevel'].'! ��� ���������� '.$krtxt,-1,6,0,0,0,1);
-													$rlog['catch'] += $bn['add_bank'];
-													mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.$rlog['id'].'" LIMIT 1');
-													//
-													if( (int)$rlog['host_reg'] > 0 ) {
-														//������� 3-�� ������
-														$llogin2 = $rlog['login'];
-														$ekr = round($bn['add_bank']*0.2,2);
-														$kr = round($bn['add_money']*0.2,2);
-														$rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$rlog['host_reg']).'" LIMIT 1'));
-														if( isset($rlog['id']) ) {
-															$krtxt = '';
-															if( $kr > 0 ) {
-																$krtxt .= ''.$kr.' ��';
-																if( $ekr > 0 ) {
-																	$krtxt .= ', ';
-																}
-															}
-															if( $ekr > 0 ) {
-																$krtxt .= ''.$ekr.' ���';
-															}											
-															$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> (3-�� ������ �� &quot;'.$llogin2.'&quot; (������� '.$llogin.') ) ������'.$sex1.' ������ '.$lvl['nextLevel'].'! ��� ���������� '.$krtxt,-1,6,0,0,0,1);
-															$rlog['catch'] += $bn['add_bank'];
-															mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.$rlog['id'].'" LIMIT 1');
-															//
-														}
-													}
-													//
-												}
-											}
-											
-										}else{
-											$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$lvl['nextLevel'].'! (������ ����������, ���������� � ������������� �������) �� ��� ���������� ���� �'.$bnk.' ���������� '.$ekr.' ��.',-1,6,0,0,0,1);
-										}
-									}
-									//
-									mysql_query("UPDATE `users` SET `referals` = `referals` + 10 WHERE `id` = '".mysql_real_escape_string($rlog['id'])."' LIMIT 1");
-									//
-								}elseif(isset($rlog['id'])){
-									$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$lvl['nextLevel'].'! <small><font color=red>(�������� �� �����������, ���� � ��� ��������� IP! ��������� �� ����� 1 ������ ��������!)</font></small>',-1,6,0,0,0,1);
-								}
-							}
-							
-							
-							
-							/*
-							$tst = $this->lookStats($this->info['stats']);
-							$tst['s4'] += $a4;
-							$tst['s7'] += $lvl['duh'];
-							$this->info['stats'] = $this->impStats($tst);
-							*/
-						}
-						
-						/*if( $this->info['twink'] == 0 ) { 
-							if( $this->info['exp'] >= 300000 ) {
-								$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'�� ���������� ������ ������/����, �� ���������: <b>'.$lvl['money'].' ��.</b>',-1,6,0,0,0,1);
-							}
-						}*/
-						
-						$tst = $this->lookStats($this->info['stats']);
-						$tst['s4'] += $lvl['vinos'];
-						$tst['s7'] += $lvl['duh'];
-						$this->info['stats'] = $this->impStats($tst);
-						
-						$this->info['level'] = $lvl['nextLevel'];
-						$this->stats['levels'] = $lvln;
-						$this->info['ability'] += $lvl['ability'];
-						$this->info['skills'] += $lvl['skills'];
-						$this->info['sskills'] += $lvl['sskills'];
-						$this->info['nskills'] += $lvl['nskills'];
-						if( $this->info['twink'] == 0 ) {
-							//if( $this->info['level'] < 8 ) {
-								//������ �� ���� ���� 0-7 ���
-								//$this->info['money4'] = $lvl['money']+$this->info['money4'];
-							//}else{
-								$this->info['money'] = $lvl['money']+$this->info['money'];
-							//}
-						}
-						$lvl  = $lvln;
-						$lvln = mysql_fetch_array(mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.($lvl['upLevel']+1).'" LIMIT 1'));
-						$this->info['upLevel'] += 1;
-						$rt++;									
-					}else{
-						$i = 1;
-					}							
-				}
-				if($ult == 1) {
-					if( $this->info['level'] == 4 || $this->info['level'] == 8 ) {
-						//������ �������� �� ������
-						mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` LIKE "psh%"');
-						$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'����������� ����������� ������ � �������� � ����� ���������!!!!!!!!!!!!!!!.',-1,6,0,0,0,1);
-					}
-					/*if( $this->info['level'] > 0 && $this->info['level'] <= 5 ) {
-						$this->info['money4'] += 100;
-						mysql_query('UPDATE `users` SET `money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'�� ���������� ������ ������ �� ��������� '.$this->zuby(100,1).'',-1,6,0,0,0,1);
-					}*/
-					//if( isset($itm['id']) || $lvl['nextLevel'] != 6 ) {
-						//
-						/*$txti  = '������';
-						if( $this->info['sex'] == 1 ) {
-							$txti .= '��';
-						}
-						$txti .= ' '.$this->info['level'].' ������!<br>'.date('d.m.Y H:i').'';
-						//
-						mysql_query('INSERT INTO `users_ico` (
-							`uid`,`time`,`text`,`img`,`type`,`x`,`see`
-						) VALUES (
-							"'.$this->info['id'].'","'.time().'","'.$txti.'","pod_lvl'.$this->info['level'].'.gif","2","1","1"
-						)');*/
-						//
-						$this->send('',$this->info['room'],$this->info['city'],'','','<b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$this->info['level'].'!',time(),6,0,0,0,1,2); // ������� ���
-						//}
-				}
-				//mysql_query('UNLOCK TABLES');
-				if($rt > 0) {
-					if( $this->info['level'] >= 10 ) {
-						//$this->info['stopexp'] = 1; //���������� �����
-						$this->info['stopexp'] = 0;
-					}else{
-						$this->info['stopexp'] = 0;
-					}
-					$upd = mysql_query('UPDATE `users` SET `stopexp` = "'.$this->info['stopexp'].'" , `level` = "'.$this->info['level'].'",`money` = "'.$this->info['money'].'",`money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					$upd = mysql_query('UPDATE `users_twink` SET `stopexp` = "'.$this->info['stopexp'].'" WHERE `uid` = "'.$this->info['id'].'" LIMIT 1');
-					if($upd)
-					{
-						mysql_query('UPDATE `stats` SET `ability` = "'.$this->info['ability'].'",`skills` = "'.$this->info['skills'].'",`nskills` = "'.$this->info['nskills'].'",`sskills` = "'.$this->info['sskills'].'",`stats` = "'.$this->info['stats'].'",`upLevel` = "'.$this->info['upLevel'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						$this->info['money'] = $this->r2($this->info['money']);
-					}
-					return 1;
-				}
-				//****************
-			}
-		}
-		/*------------*/
-		if($this->info['animal']>0)
-		{
-			//������� �����
-			$a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
-			if(isset($a['id']) && $a['level'] < 12)
-			{
-				$ea = array(
-					0=>0,
-					1=>110,
-					2=>410,
-					3=>1300,
-					4=>2500,
-					5=>5000,
-					6=>12500,
-					7=>30000,
-					8=>100000,
-					9=>3000000,
-					10=>10000000,
-					11=>50000000,
-					12=>150000000
-				);
-				$mx = array(
-					0=>140,
-					1=>400,
-					2=>500,
-					3=>650,
-					4=>700,
-					5=>1400,
-					6=>3000,
-					7=>6000,
-					8=>10000,
-					9=>16000,
-					10=>24000,
-					11=>40000,
-					12=>60000
-				);
-				$iz = 0;
-				while($iz!=-1)
-				{
-					if($ea[$a['level']+1]<=$a['exp'])
-					{
-						//��������� �������
-						$a['level']++;
-						$a['max_exp'] = $mx[$a['level']];				
-					}else{
-						if($iz>0)
-						{
-							$a['stats'] = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`exp`,`level`,`stats`,`bonus` FROM `levels_animal` WHERE `type` = "'.$a['type'].'" AND `level` = "'.$a['level'].'" LIMIT 1'));
-							$a['stats'] = $a['stats']['stats'];
-							$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'<b>'.$a['name'].'</b> ������ '.$a['level'].' ������!',time(),6,0,0,0,1);
-							mysql_query('UPDATE `users_animal` SET `stats` = "'.$a['stats'].'",`level`="'.$a['level'].'",`max_exp`="'.$a['max_exp'].'" WHERE `id` = "'.$a['id'].'" LIMIT 1');
-						}
-						$iz = -2;
-					}
-					if( $iz > 1000 ) {
-						$iz = -2;
-					}
-					$iz++;
-				}
-			}
-		}
-		/*------------*/
-	}
-	
-	public function r2($v)
-	{
-		$v = number_format($v, 2, '.', ' ');
-		return $v;
-	}
-		
-	public function regen($uid,$st,$i1)
-	{
-		if($uid!=$this->info['id'])
-		{
-			$u = mysql_fetch_array(mysql_query('SELECT `u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`battle`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			if(!isset($st['hpAll']))
-			{
-				$st = $this->getStats($uid,$i1);
-			}
-		}else{
-			$u  = $this->info;
-			if(isset($this->stats['hpAll']))
-			{
-				$st = $this->stats;
-			}elseif($st!=0)
-			{
-				
-			}else{
-				$st = $this->getStats($uid,$i1);
-			}
-		}
-		$btl = 0;
-		if($u['battle']>0)
-		{
-			//$btl = mysql_fetch_array(mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `id` = "'.$u['battle'].'" AND `team_win` = "-1" LIMIT 1'));
-		}
-		if($u['battle']==0 || (isset($btl['id']) && $btl['time_start']>$this->info['timereg']))
-		{
-			$sth = $u['minHP']; //����������� ����� �������������� � ������� HP
-			$stm = $u['minMP']; //����������� ����� �������������� � ������� MP
-			$sh = 0; //�������� ����������� �� � 1 ���.
-			$sm = 0; //�������� ����������� M� � 1 ���.
-			/*---����������(�����������)---*/
-			if(@$st['os9']>0){
-				if(@$st['os9']==5) {
-					@$st['os9']=6;
-				}
-				$sth = floor($u['minHP']-($u['minHP']/100)*($st['os9']*5));
-			}
-			/*---����������(�����������)---*/
-			/*---��������������(�����������)---*/
-			if(@$st['os10']>0){
-				$stm = floor($u['minMP']-($u['minMP']/100)*($st['os10']*5));
-			}
-			/*---��������������(�����������)---*/
-			if($u['battle']>0)
-			{
-				$this->info['timereg'] = $btl['time_start'];
-			}
-			
-			//������� ������ �����
-			//����� ����
-			$st['speedhp'] += 150;
-			$st['speedmp'] += 150;
-			
-			//hp
-			$sh = ($st['hpAll']/(60*$sth));
-			if(!isset($st['speedhp'])) { $st['speedhp'] = 0; }
-			if( (0.0001+$st['speedhp']+$st['levels']['hpRegen']) < 0.00001 ) {
-				$sh += ($sh/100)*0.00001;
-			}else{
-				$sh += ($sh/100)*(0.0001+$st['speedhp']+$st['levels']['hpRegen']);
-			}
-			$st['hpNow'] += $sh*(time()-$u['regHP']);
-			if($st['hpNow']<0)	
-			{
-				$st['hpNow'] = 0;
-			}elseif($st['hpNow']>$st['hpAll'])
-			{
-				$st['hpNow'] = $st['hpAll'];
-			}
-			//mp
-			$sm = ($st['mpAll']/(60*$stm));
-			if(!isset($st['speedmp'])) { $st['speedmp'] = 0; }
-			$sm += ($sm/100)*(1+$st['speedmp']+$st['levels']['mpRegen']);
-			$st['mpNow'] += $sm*(time()-$u['regMP']);
-			if($st['mpNow']<0)	
-			{
-				$st['mpNow'] = 0;
-			}elseif($st['mpNow']>$st['mpAll'])
-			{
-				$st['mpNow'] = $st['mpAll'];
-			}
-			//������� ����� ������ � ����
-			$upd = mysql_query('UPDATE `stats` SET `regHP`="'.time().'",`regMP`="'.time().'",`hpNow`="'.$st['hpNow'].'",`mpNow`="'.$st['mpNow'].'" WHERE `id` = "'.$u['id'].'" LIMIT 1');
-			if(!$upd)
-			{
-				return array(0=>0,1=>0);
-			}else{
-				if($this->info['id']==$u['id'])
-				{
-					$this->stats['regHP'] = time();
-					$this->stats['regMP'] = time();
-					$this->stats['hpNow'] = $st['hpNow'];
-					$this->stats['mpNow'] = $st['mpNow'];
-				}
-				return array(0=>$sh,1=>$sm,'hpNow'=>$st['hpNow'],'mpNow'=>$st['mpNow']);
-			}
-		}
-	}
-	
-	public function send_mime_mail($name_from, // ��� �����������
-	 	 	 	 	    $email_from, // email �����������
-	 	 	 	 	    $name_to, // ��� ����������
-	 	 	 	 	    $email_to, // email ����������
-	 	 	 	 	    $data_charset, // ��������� ���������� ������
-	 	 	 	 	    $send_charset, // ��������� ������
-	 	 	 	 	    $subject, // ���� ������
-	 	 	 	 	    $body // ����� ������
-	 	 	 	 	    )
-	   {
-	  $to = $this->mime_header_encode($name_to, $data_charset, $send_charset)
-					 . ' <' . $email_to . '>';
-	  $subject = $this->mime_header_encode($subject, $data_charset, $send_charset);
-	  $from =  $this->mime_header_encode($name_from, $data_charset, $send_charset)
-						 .' <' . $email_from . '>';
-	  if($data_charset != $send_charset) {
-		$body = iconv($data_charset, $send_charset, $body);
-	  } 
-	  $headers = "From: $from\r\n";
-	  $headers .= "Content-type: text/html; charset=$send_charset\r\n";
-	
-	  return mail($to, $subject, $body, $headers);
-	}
-	
-	public function mime_header_encode($str, $data_charset, $send_charset) {
-	  if($data_charset != $send_charset) {
-		$str = iconv($data_charset, $send_charset, $str);
-	  }
-	  return '=?' . $send_charset . '?B?' . base64_encode($str) . '?=';
-	}
-	
-public function set_cl_item($id, $user, $cl) {
-  $item_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$user['id'].'" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `im`.`inslot` > 0 AND `iu`.`gift` = "" AND `iu`.`data` NOT LIKE "%frompisher=%" AND `iu`.`id` = "'.$id.'" LIMIT 1'));
-  $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1'));
-  if(isset($item_['id'])) {
-	 $po = $this->lookStats($item_['data']);
-	 if(isset($po['toclan'])) {
-	  $po['toclan1'] = explode('#', $po['toclan']);
-	  $po['toclan1'] = $po['toclan1'][0];
-	 }
-	 if(isset($po['sudba']) && $po['sudba'] != '0') {
-	   $r = '<font color="#FF0000"><b>������� ������ � ���� �������</b></font><br>';
-	 } elseif(isset($po['toclan']) && $po['toclan1'] != $user['clan']) {
-	   $r = '<font color="#FF0000"><b>������� � ��� ����������� �����...</b></font><br>';
-	 } elseif($user['inTurnir'] > 0 || $user['inTurnirnew'] > 0) {
-	   $r = '<font color="#FF0000"><b>�� ����� ������� � ������� ��������� ������������ �������� ���������.</b></font><br>';
-	 } else {
-	   if((isset($po['sudba']) && $po['sudba'] != '0') || isset($po['icos']) || isset($po['frompisher']) || isset($po['fromlaba']) || ($item_['gift'] != '' && $item_['gift'] != 0) ) {
-	 	 $r = '�� �������';
-	   } elseif(!isset($po['toclan'])) {
-	 	 $po['toclan'] = $user['clan'].'#'.$user['id'];
-	 	 $item_['data'] = $this->impStats($po);
-	 	 if(mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'", `data` = "'.$item_['data'].'" WHERE `id` = "'.$id.'" LIMIT 1')) {
-		  $r = '<font color="#FF0000"><b>�� ������� ������������ ������� &quot;'.$item_['name'].'&quot; �����</b></font><br />';
-		  $col = $this->itemsX(((int)$id));
-		  $this->addDelo(2, $user['id'],'&quot;<font color="green">System.transfer.MONEY</font>&quot;: ������� &quot;'.$item_['name'].'&quot; (#id : "'.$id.'") (x'.$col.') ��� ����������� ����� &quot;'.$res['name'].'&quot; ('.$res['id'].').', time(), $user['city'], 'System.transfer.clan', 0, 0);
-		  mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "4", "'.$user['login'].'", "'.$item_['name'].' (x'.$col.') �� : ['.$id.']", "'.$user['id'].'")');					
-	 	 } else {
-		  $r = '<font color="#FF0000"><b>�� �������...</b></font><br>';
-		}
-	   } else {
-	 	 if(mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'" WHERE `id` = "'.$id.'" LIMIT 1')) {
-		  $col = $this->itemsX(((int)$id));
-		  mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "3", "'.$user['login'].'", "'.$item_['name'].'" (x'.$col.') �� : ['.$id.'], "'.$user['id'].'")');
-		  $r = '<font color="#FF0000"><b>�� ������� ������� ������� &quot;'.$item_['name'].'&quot; � ��������� �����</b></font><br />';
-		} else {
-		  $r = '<font color="#FF0000"><b>�� �������...</b></font><br>';
-		}
-	   }
-	 }
-  } else {
-	 $r = '<font color="#FF0000"><b>������� �� ������.</b></font><br>';
-  }
-  return $r;
-}
-
-
-public function ungive_itm_cl($id, $user, $cl) {
-  $itm_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` >= 0 AND `iu`.`delete` = 0 AND `iu`.`id` = "'.$id.'" LIMIT 1'));
-  $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1'));
-  $user_itm = mysql_fetch_array(mysql_query('SELECT `id`,`bot`,`clone` FROM `stats` WHERE `id` = "'.$itm_['uid'].'" LIMIT 1'));
-  if( $user_itm['bot'] > 0 || $user_itm['clone'] > 0 || !isset($user_itm['id']) ) {
-	  $r = '<font color="#FF0000"><b>�� �� ������ ������ ������ �������, �� �� ����������� �����</b></font><br />';
-  }elseif(isset($itm_['id'])) {
-	 if($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
-	   if($itm_['inOdet'] != 0) { $o = ', `inOdet` = 0'; } else { $o = ''; }
-	   $r = '<font color="#FF0000"><b>�� ������� ������ ������� &quot;'.$itm_['name'].'&quot;</b></font><br />';
-	   $col = $this->itemsX(((int)$id));
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "6", "'.$user['login'].'", "'.$itm_['name'].' (x'.$col.') �� : ['.$id.'] | � ��������� : ['.$itm_['uid'].']", "'.$user['id'].'")');
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$res['id'].'" '.$o.' WHERE `id` = "'.$id.'" LIMIT 1');
-	 } else {
-	   $r = '<font color="#FF0000"><b>�� ����� ������� � ������� ��������� ������������ �������� ���������.</b></font><br />';
-	 }
-  } else {
-	 $r = '<font color="#FF0000"><b>������� �� ������.</b></font><br />';
-  }
-  return $r;
-}
-
-public function take_itm_cl($id, $user, $cl) {
-  $itm_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "-21'.$user['clan'].'" AND `iu`.`delete` = 0 AND `iu`.`id` = "'.$id.'" LIMIT 1'));
-  $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1'));
-  if(isset($itm_['id'])) {
-	 $po = $this->lookStats($itm_['data']);
-	 if(isset($po['toclan'])) {
-	  $cls = explode('#', $po['toclan']);
-	  $cls = $cls[1];
-	 }
-	 if($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
-	   $col = $this->itemsX(((int)$id));
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "5", "'.$user['login'].'", "'.$itm_['name'].' (x'.$col.') �� : ['.$id.'] ������ : ['.$cls.']", "'.$user['id'].'")');
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "'.$user['id'].'" WHERE `id` = "'.$id.'" LIMIT 1');
-	   $r = '<font color="#FF0000"><b>�� ������� ����� ������� &quot;'.$itm_['name'].'&quot; �� ���������</b></font><br />';
-	 } else {
-	   $r = '<font color="#FF0000"><b>�� ����� ������� � ������� ��������� ������������ �������� ���������.</b></font><br />';
-	 }
-  } else {
-	 $r = '<font color="#FF0000"><b>������� �� ������.</b></font><br />'.$id; 
-  }
-  return $r;
-}
-
-public function rem_itm_cl($user, $cl, $type) {
-  $itms = mysql_query('SELECT * FROM `items_users` WHERE (`uid` = "-21'.$user['clan'].'" OR `data` LIKE "%toclan='.$user['clan'].'#%")');
-  while($pl = mysql_fetch_array($itms)) {
-	 $po = $this->lookStats($pl['data']);
-	 if(isset($po['toclan'])) {
-	  $cls = explode('#', $po['toclan']);
-	  $cls = $cls[1];
-	 }
-	 if($cls == $user['id']) {
-	   if($pl['uid'] != $user['id']) {
-	 	 if($pl['inOdet'] != 0) { mysql_query('UPDATE `items_users` SET `inOdet` = 0 WHERE `id` = "'.$pl['id'].'"'); }
-	   }
-	   unset($po['toclan']);
-	   $pl['data'] = $this->impStats($po);
-	   $col = $this->itemsX(((int)$pl['id']));
-	   $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$pl['item_id'].'"'));
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "'.$user['id'].'", `data` = "'.$pl['data'].'" WHERE `id` = "'.$pl['id'].'"');
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "'.$type.'", "'.$user['login'].'", "'.$it_n['name'].' (x'.$col.') �� : ['.$pl['id'].']", "'.$user['id'].'")');
-	 } elseif($cls != $user['id'] && $pl['uid'] == $user['id']) {
-	   $col = $this->itemsX(((int)$pl['id']));
-	   $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$pl['item_id'].'"'));
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'" WHERE `id` = "'.$pl['id'].'"');
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "9", "'.$user['login'].'", "'.$it_n['name'].' (x'.$col.') �� : ['.$pl['id'].']", "'.$user['id'].'")');
-	 }
-  }
-}
-	
-	public function send_mail($to,$to_name,$from = 'support@new-combats.com',$name = '<b>���������� ����</b> 2',$title,$text) {
-		$this->send_mime_mail($name,
-	 	 	    $from,
-	 	 	    $to_name,
-	 	 	    $to,
-	 	 	    'CP1251',  // ���������, � ������� ��������� ������������ ������
-	 	 	    'KOI8-R', // ���������, � ������� ����� ���������� ������
-	 	 	    $title,
-	 	 	    $text); // \r\n
-	}
-	
-	public function roomInfo($id, $short=false) {
-		if($short==true){
-			$select = ' `id`, `name`, `code`, `city`, `timeGO`, `level`,`roomGo` ';
-		} else {
-			$select = ' * ';
-		}
-		$roomInfo = mysql_fetch_array(mysql_query('SELECT '.$select.' FROM `room` WHERE `id` = "'.$id.'" LIMIT 1'));
-		if($roomInfo['roomGo']) $roomInfo['roomGo'] = explode(',', $roomInfo['roomGo']);
-		if($roomInfo['level']) $roomInfo['level'] = explode('-', $roomInfo['level']);
-		return $roomInfo;
-	}
-	
-public function showAbils() {
-  $r = '';
-  $sp = mysql_fetch_array(mysql_query('SELECT * FROM `abils_user` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-  if(isset($sp['id'])) {
-	$r .= '';
-  } else {
-	mysql_query('INSERT INTO `abils_user` (`uid`) VALUES ("'.$this->info['id'].'")');
-  }
-  return $r;
-}
-	
-}
-
-
-$u = user::start();
-?>
\ No newline at end of file
diff --git a/_incl_data/class/dialog.class.php b/_incl_data/class/dialog.class.php
index d4a92064..4e34c5c1 100644
--- a/_incl_data/class/dialog.class.php
+++ b/_incl_data/class/dialog.class.php
@@ -181,7 +181,7 @@ class dialog
 						$act0 = explode('=',$act[0]);
 						if( $act0[0] == 'fileqst' ) {
 							if(file_exists('_incl_data/class/quest/'.htmlspecialchars($act0[1]).'.php')) {
-								include('_incl_data/class/quest/'.htmlspecialchars($act0[1]).'.php');
+								require_once('_incl_data/class/quest/'.htmlspecialchars($act0[1]).'.php');
 							}else{
 								$txt .= '<br><b><font color=red>����� �� ������ � ������� NPS...</b></font>';
 							}
diff --git a/_incl_data/class/items_info.php b/_incl_data/class/items_info.php
index 663c5fd4..c87e636e 100644
--- a/_incl_data/class/items_info.php
+++ b/_incl_data/class/items_info.php
@@ -1,7 +1,7 @@
 <?php
 define('GAME',time());
 
-include('_incl_data/class/__db_connect.php');
+require_once('_incl_data/class/__db_connect.php');
 if (isset($_COOKIE['login']))
 {
 $u = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_COOKIE['login']).'" AND `pass` = "'.mysql_real_escape_string($_COOKIE['pass']).'" LIMIT 1'));
diff --git a/jx/battle/refresh.php b/jx/battle/refresh.php
index cbd5d3f7..81680b2d 100644
--- a/jx/battle/refresh.php
+++ b/jx/battle/refresh.php
@@ -6,7 +6,7 @@ $tm = explode(' ', $tm);
 $tm = $tm[0] + $tm[1];
 
 if (!isset($CRON_CORE)) {
-    include('../../_incl_data/__config.php');
+    require_once('../../_incl_data/__config.php');
 }
 
 if (isset($_GET['cron_core'])) {
@@ -19,7 +19,7 @@ if (isset($_GET['cron_core'])) {
 
 if (!isset($CRON_CORE)) {
     define('GAME', true);
-    include('../../_incl_data/class/__db_connect.php');
+    require_once('../../_incl_data/class/__db_connect.php');
 }
 
 function e($t)
@@ -62,10 +62,10 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
 
         unset($tm);
         $js = '';
-        include('../../_incl_data/class/__user.php');
-        include('../../_incl_data/class/__magic.php');
-        include('../../_incl_data/class/_cron_.php');
-        include('../../_incl_data/class/__quest.php');
+        require_once('../../_incl_data/class/__user.php');
+        require_once('../../_incl_data/class/__magic.php');
+        require_once('../../_incl_data/class/_cron_.php');
+        require_once('../../_incl_data/class/__quest.php');
 
         if ($u->info['battle'] == 0) {
             $btl_last = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1'));
@@ -98,8 +98,8 @@ if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
             }
         }
 
-        include('../../_incl_data/class/__battle.php');
-        include('log_text.php');
+        require_once('../../_incl_data/class/__battle.php');
+        require_once('log_text.php');
         $btl->is = $u->is;
         $btl->items = $u->items;
         $btl->info = $btl->battleInfo($u->info['battle']);
diff --git a/jx/battle/refresh1.php b/jx/battle/refresh1.php
index 78876531..7f880261 100644
--- a/jx/battle/refresh1.php
+++ b/jx/battle/refresh1.php
@@ -18,22 +18,8 @@
 		$tm = explode(' ',$tm);
 		$tm = $tm[0]+$tm[1];
 		
-		if(!isset($CRON_CORE)) {
-			//include('../../_incl_data/__config.php');
-			/*if($_SESSION['tbr']>$tm)
-			{
-				die('<script>ggcode="'.$code.'";if(t057!=null){clearTimeout(t057);}</script>');
-			}else{
-				$_SESSION['tbr'] = $tm+0.350;
-			}*/
-		}
-		
 		unset($tm);		
 		$js = '';
-		//include('../../_incl_data/class/__user.php');
-		//include('../../_incl_data/class/__magic.php');
-		//include('../../_incl_data/class/_cron_.php');	
-		//include('../../_incl_data/class/__quest.php');
 		
 		if( $u->info['battle'] == 0 ) {
 			$btl_last = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1'));
diff --git a/jx/battle/refresh2.php b/jx/battle/refresh2.php
index d9e93d87..84109247 100644
--- a/jx/battle/refresh2.php
+++ b/jx/battle/refresh2.php
@@ -19,7 +19,7 @@
 		$tm = $tm[0]+$tm[1];
 		
 		if(!isset($CRON_CORE)) {
-			//include('../../_incl_data/__config.php');
+			//require_once('../../_incl_data/__config.php');
 			/*if($_SESSION['tbr']>$tm)
 			{
 				die('<script>ggcode="'.$code.'";if(t057!=null){clearTimeout(t057);}</script>');
@@ -30,10 +30,10 @@
 		
 		unset($tm);		
 		$js = '';
-		//include('../../_incl_data/class/__user.php');
-		//include('../../_incl_data/class/__magic.php');
-		//include('../../_incl_data/class/_cron_.php');	
-		//include('../../_incl_data/class/__quest.php');
+		//require_once('../../_incl_data/class/__user.php');
+		//require_once('../../_incl_data/class/__magic.php');
+		//require_once('../../_incl_data/class/_cron_.php');
+		//require_once('../../_incl_data/class/__quest.php');
 		
 		if( $u->info['battle'] == 0 ) {
 			$btl_last = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1'));
diff --git a/jx/battle/refresh_bot.php b/jx/battle/refresh_bot.php
index bf7072ae..dcd34667 100644
--- a/jx/battle/refresh_bot.php
+++ b/jx/battle/refresh_bot.php
@@ -15,7 +15,7 @@ if(getIPblock() != $_SERVER['SERVER_ADDR'] && getIPblock() != '127.0.0.1' && get
 */
 
 define('GAME',true);
-include('../../_incl_data/class/__db_connect.php');
+require_once('../../_incl_data/class/__db_connect.php');
 
 function e($t) {
 	mysql_query('INSERT INTO `chat` (`text`,`city`,`to`,`type`,`new`,`time`) VALUES ("core #'.date('d.m.Y').' %'.date('H:i:s').' (����������� ������): <b>'.mysql_real_escape_string($t).'</b>","capitalcity","-NIGHTmare-","6","1","-1")');
@@ -67,7 +67,7 @@ if(isset($CRON_CORE))
 		$tm = $tm[0]+$tm[1];
 		
 		if(!isset($CRON_CORE)) {
-			include('../../_incl_data/__config.php');
+			require_once('../../_incl_data/__config.php');
 			if($_SESSION['tbr']>$tm)
 			{
 				die('<script>ggcode="'.$code.'";if(t057!=null){clearTimeout(t057);}</script>');
@@ -78,10 +78,10 @@ if(isset($CRON_CORE))
 		
 		unset($tm);		
 		$js = '';
-		include('../../_incl_data/class/__user.php');
-		include('../../_incl_data/class/__magic.php');
-		include('../../_incl_data/class/_cron_.php');	
-		include('../../_incl_data/class/__quest.php');	
+		require_once('../../_incl_data/class/__user.php');
+		require_once('../../_incl_data/class/__magic.php');
+		require_once('../../_incl_data/class/_cron_.php');
+		require_once('../../_incl_data/class/__quest.php');
 		
 		if(!isset($CRON_CORE)) {
 			if(!isset($u->info['id']) || ($u->info['joinIP']==1 && $u->info['ip']!=$_SERVER['HTTP_X_REAL_IP']))
@@ -98,8 +98,8 @@ if(isset($CRON_CORE))
 				mysql_query("UPDATE `users` SET `online`='".time()."',`timeMain`='".time()."' WHERE `id`='".$u->info['id']."' LIMIT 1");
 			}
 		}
-		include('../../_incl_data/class/__battle.php');
-		include('log_text.php');
+		require_once('../../_incl_data/class/__battle.php');
+		require_once('log_text.php');
 		$btl->is = $u->is;
 		$btl->items = $u->items;
 		$btl->info = $btl->battleInfo($u->info['battle']);
diff --git a/jx/battle/refresh_vip.php b/jx/battle/refresh_vip.php
index 286afd2a..783c12d0 100644
--- a/jx/battle/refresh_vip.php
+++ b/jx/battle/refresh_vip.php
@@ -4,7 +4,7 @@ die();
 
 if(!isset($CRON_CORE)) {
 	define('GAME',true);
-	include('../../_incl_data/class/__db_connect.php');
+	require_once('../../_incl_data/class/__db_connect.php');
 }
 				
 function e($t) {
@@ -58,7 +58,7 @@ if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
 		$tm = $tm[0]+$tm[1];
 		
 		if(!isset($CRON_CORE)) {
-			include('../../_incl_data/__config.php');
+			require_once('../../_incl_data/__config.php');
 			if($_SESSION['tbr']>$tm)
 			{
 				die('<script>ggcode="'.$code.'";if(t057!=null){clearTimeout(t057);}</script>');
@@ -69,10 +69,10 @@ if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
 		
 		unset($tm);		
 		$js = '';
-		include('../../_incl_data/class/__user.php');
-		include('../../_incl_data/class/__magic.php');
-		include('../../_incl_data/class/_cron_.php');	
-		include('../../_incl_data/class/__quest.php');	
+		require_once('../../_incl_data/class/__user.php');
+		require_once('../../_incl_data/class/__magic.php');
+		require_once('../../_incl_data/class/_cron_.php');
+		require_once('../../_incl_data/class/__quest.php');
 		
 		if(!isset($CRON_CORE)) {
 			if(!isset($u->info['id']) || ($u->info['joinIP']==1 && $u->info['ip']!=$_SERVER['HTTP_X_REAL_IP']))
@@ -135,8 +135,8 @@ if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' || isset($CRON_CORE))
 				mysql_query("UPDATE `users` SET `online`='".time()."',`timeMain`='".time()."' WHERE `id`='".$u->info['id']."' LIMIT 1");
 			}
 		}
-		include('../../_incl_data/class/__battle.php');
-		include('log_text.php');
+		require_once('../../_incl_data/class/__battle.php');
+		require_once('log_text.php');
 		$btl->is = $u->is;
 		$btl->items = $u->items;
 		$btl->info = $btl->battleInfo($u->info['battle']);
diff --git a/main.php b/main.php
index 40b0cd51..2ca90308 100644
--- a/main.php
+++ b/main.php
@@ -1,121 +1,56 @@
 <style>
-/* Paste this css to your style sheet file or under head tag */
-/* This only works with JavaScript,
-if it's not present, don't show loader */
-.no-js #loader { display: none;  }
-.js #loader { display: block; position: absolute; left: 100px; top: 0; }
-.se-pre-con {
-	position: fixed;
-	left: 0px;
-	top: 0px;
-	width: 100%;
-	height: 100%;
-	z-index: 9999;
-	background: url(default.gif) center no-repeat #e2e0e1;
-}
+    /* Paste this css to your style sheet file or under head tag */
+    /* This only works with JavaScript,
+    if it's not present, don't show loader */
+    .no-js #loader {
+        display: none;
+    }
+
+    .js #loader {
+        display: block;
+        position: absolute;
+        left: 100px;
+        top: 0;
+    }
+
+    .se-pre-con {
+        position: fixed;
+        left: 0px;
+        top: 0px;
+        width: 100%;
+        height: 100%;
+        z-index: 9999;
+        background: url(default.gif) center no-repeat #e2e0e1;
+    }
 
 </style>
 <div class="se-pre-con" id="se-pre-con"></div>
 
 <?php
 
-
-function GetRealIp(){
-	if (!empty($_SERVER['HTTP_CLIENT_IP']))
-		return $_SERVER['HTTP_CLIENT_IP'];
-	else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
-		return $_SERVER['HTTP_X_FORWARDED_FOR'];
-	return $_SERVER['REMOTE_ADDR'];
+function GetRealIp()
+{
+    if (!empty($_SERVER['HTTP_CLIENT_IP']))
+        return $_SERVER['HTTP_CLIENT_IP'];
+    else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
+        return $_SERVER['HTTP_X_FORWARDED_FOR'];
+    return $_SERVER['REMOTE_ADDR'];
 }
-function var_info($vars, $d = false){
+
+function var_info($vars, $d = false)
+{
     echo "<pre style='border: 1px solid gray;border-radius: 5px;padding: 3px 6px;background: #cecece;color: black;font-family: Arial;font-size: 12px;'>\n";
     var_dump($vars);
     echo "</pre>\n";
     if ($d) exit();
 }
-define('IP',GetRealIp());
+
+define('IP', GetRealIp());
 
 include('_incl_data/__config.php');
-define('GAME',true);
+define('GAME', true);
 include('_incl_data/class/__db_connect.php');
 date_default_timezone_set('Europe/Moscow');
-//header('refresh: 30');
-
-/*mysql_query("LOCK TABLES
-`aaa_monsters` WRITE,
-`actions` WRITE,
-`bank` WRITE,
-
-`battle` WRITE,
-`battle_act` WRITE,
-`battle_actions` WRITE,
-`battle_cache` WRITE,
-`battle_end` WRITE,
-`battle_last` WRITE,
-`battle_logs` WRITE,
-`battle_logs_save` WRITE,
-`battle_stat` WRITE,
-`battle_users` WRITE,
-
-`bs_actions` WRITE,
-`bs_items` WRITE,
-`bs_items_use` WRITE,
-`bs_logs` WRITE,
-`bs_map` WRITE,
-`bs_statistic` WRITE,
-`bs_trap` WRITE,
-`bs_turnirs` WRITE,
-`bs_zv` WRITE,
-
-`clan` WRITE,
-`clan_wars` WRITE,
-
-`dungeon_actions` WRITE,
-`dungeon_bots` WRITE,
-`dungeon_items` WRITE,
-`dungeon_map` WRITE,
-`dungeon_now` WRITE,
-`dungeon_zv` WRITE,
-
-`eff_main` WRITE,
-`eff_users` WRITE,
-
-`items_img` WRITE,
-`items_local` WRITE,
-`items_main` WRITE,
-`items_main_data` WRITE,
-`items_users` WRITE,
-
-`izlom` WRITE,
-`izlom_rating` WRITE,
-
-`laba_act` WRITE,
-`laba_itm` WRITE,
-`laba_map` WRITE,
-`laba_now` WRITE,
-`laba_obj` WRITE,
-
-`levels` WRITE,
-`levels_animal` WRITE,
-
-`online` WRITE,
-
-`priems` WRITE,
-
-`quests` WRITE,
-`reimage` WRITE,
-
-`reg` WRITE,
-
-`stats` WRITE,
-`test_bot` WRITE,
-`turnirs` WRITE,
-`users` WRITE,
-`users_animal` WRITE,
-`user_ico` WRITE,
-`users_twink` WRITE,
-`zayvki` WRITE;");*/
-
 
 
 include('_incl_data/class/__magic.php');
@@ -123,97 +58,53 @@ include('_incl_data/class/__user.php');
 include('_incl_data/class/__filter_class.php');
 include('_incl_data/class/__quest.php');
 
-if($u->info['banned'] > 0) {
-	header('location: /index.php');
-	die();
+if ($u->info['banned'] > 0) {
+    header('location: /index.php');
+    die();
 }
 
 $tjs = '';
 
-if($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) {
-	unset($_GET,$_POST);
+if ($u->info['bithday'] == '01.01.1800' && $u->info['inTurnirnew'] == 0) {
+    unset($_GET, $_POST);
 }
 
-/*if( !eregi("new-combats\.com", $_SERVER['HTTP_REFERER']) ) { 
-	//die('����������� � ����, ������ �������.<br>last_page:%'.$_SERVER['HTTP_REFERER'].'');
-}*/
 error_reporting(E_ALL ^ E_NOTICE);
 ini_set('display_errors', 'Off');
-ini_set( 'max_execution_time', '120' );
+ini_set('max_execution_time', '120');
 #--------��� ������, � ����� ��� �����
-$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "'.$u->info['id'].'" LIMIT 1',1);
-if($u->room['file'] != "room_hostel" && $u->room['file'] != "an/room_hostel" && $sleep['id']>0) {
-    mysql_query('UPDATE `actions` SET `vars` = "unsleep" WHERE `id` = "'.$sleep['id'].'" LIMIT 1');
+$sleep = $u->testAction('`vars` = "sleep" AND `uid` = "' . $u->info['id'] . '" LIMIT 1', 1);
+if ($u->room['file'] != "room_hostel" && $u->room['file'] != "an/room_hostel" && $sleep['id'] > 0) {
+    mysql_query('UPDATE `actions` SET `vars` = "unsleep" WHERE `id` = "' . $sleep['id'] . '" LIMIT 1');
+}
+if ($u->room['file'] == "room_hostel" || $u->room['file'] == "post") {
+    $trololo = 0;
+} else {
+    $trololo = 1;
 }
-if($u->room['file']=="room_hostel" || $u->room['file']=="post"){$trololo=0;}else{$trololo=1;}
 
 #--------��� ������, � ����� ��� �����
-if($u->info['online'] < time()-60 || $u->info['afk'] != ''){
-	$filter->setOnline($u->info['8'],$u->info['id'],0);
-	$u->onlineBonus();	
-	mysql_query("UPDATE `users` SET `online`='".time()."',`timeMain`='".time()."',`afk`='' WHERE `id`='".$u->info['id']."' LIMIT 1");	
-}elseif($u->info['timeMain'] < time()-60 || $u->info['afk'] != ''){
-	mysql_query("UPDATE `users` SET `online`='".time()."',`timeMain`='".time()."',`afk`='' WHERE `id`='".$u->info['id']."' LIMIT 1");	
+if ($u->info['online'] < time() - 60 || $u->info['afk'] != '') {
+    $filter->setOnline($u->info['8'], $u->info['id'], 0);
+    $u->onlineBonus();
+    mysql_query("UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time() . "',`afk`='' WHERE `id`='" . $u->info['id'] . "' LIMIT 1");
+} elseif ($u->info['timeMain'] < time() - 60 || $u->info['afk'] != '') {
+    mysql_query("UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time() . "',`afk`='' WHERE `id`='" . $u->info['id'] . "' LIMIT 1");
 }
 
-if(!isset($u->info['id']) || ($u->info['joinIP']==1 && $u->info['ip']!=$_SERVER['HTTP_X_REAL_IP']) || $u->info['banned']>0){
-	die($c['exit']);
+if (!isset($u->info['id']) || ($u->info['joinIP'] == 1 && $u->info['ip'] != $_SERVER['HTTP_X_REAL_IP']) || $u->info['banned'] > 0) {
+    die($c['exit']);
 }
 
-//mysql_query('START TRANSACTION');
-
-if($u->info['battle_text']!=''){
-	//���������� �������� � ������� ������
-	if($u->info['last_b']>0){		
-		mysql_query('INSERT INTO `battle_last` (`battle_id`,`uid`,`time`,`act`,`level`,`align`,`clan`,`exp`) VALUES ("'.$u->info['last_b'].'","'.$u->info['id'].'","'.time().'","'.$u->info['last_a'].'","'.$u->info['level'].'","'.$u->info['align'].'","'.$u->info['clan'].'","'.$u->info['exp'].'")');
-	}
-	//mysql_query('UPDATE `stats` SET `battle_text` = "",`last_b`="0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+if ($u->info['battle_text'] != '') {
+    //���������� �������� � ������� ������
+    if ($u->info['last_b'] > 0) {
+        mysql_query('INSERT INTO `battle_last` (`battle_id`,`uid`,`time`,`act`,`level`,`align`,`clan`,`exp`) VALUES ("' . $u->info['last_b'] . '","' . $u->info['id'] . '","' . time() . '","' . $u->info['last_a'] . '","' . $u->info['level'] . '","' . $u->info['align'] . '","' . $u->info['clan'] . '","' . $u->info['exp'] . '")');
+    }
 }
 
-/*if(isset($_GET['newclan'])) {
-	$czv = mysql_fetch_array(mysql_query('SELECT * FROM `clan_add` WHERE `uid` = "'.$u->info['id'].'" AND `yes` = 0 AND `no` = 0 AND `id` = "'.mysql_real_escape_string($_GET['newclan']).'" LIMIT 1'));
-	if( isset($czv['id']) ) {
-		$clns = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`align` FROM `clan` WHERE `id` = "'.$czv['clan'].'" LIMIT 1'));
-		$usr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`money` FROM `users` WHERE `id` = "'.$czv['uid_clan'].'" LIMIT 1'));
-		if(isset($_GET['newclan_val'])) {
-			if( $_GET['newclan_val'] == 2 ) {
-				$u->error = '�� ���������� �� ������ �� ���������� � ���� &quot;'.$clns['name'].'&quot;.';
-				mysql_query('UPDATE `clan_add` SET `no` = "'.time().'" WHERE `id` = "'.$czv['id'].'" LIMIT 1');
-			}elseif( $_GET['newclan_val'] == 1 ) {
-				if($u->info['clan'] > 0) {
-					$u->error = '�� ��� ���������� � ����� � �� ������ ������� ������.';
-				}elseif($u->info['align'] == 2) {
-					$u->error = '��������� ������ �������� � ����.';
-				}elseif($u->info['align'] == 50) {
-					$u->error = '��������� ������ �������� � ����.';
-				}elseif(($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4)) {
-					$u->error = '����������� ������ �������� � ����.';
-				}elseif($u->info['banned'] > 0) {
-					$u->error = '��� �������� ������������. ��� �� �� ����� �������?';
-				}elseif($u->info['level'] < 8) {
-					$u->error = '���������� ���� 8-�� ������ ������ �������� � ����.';
-				}elseif($usr['money'] < 100) {
-					$u->error = '� ��������� &quot;'.$usr['login'].'&quot;, ������� ��������� ���, � ���� ������������ �����. ����������: 100 ��.';
-				}else{
-					$usr['money'] -= 100;
-					$u->info['align'] = $clns['align'];
-					$u->info['clan'] = $clns['id'];
-					$u->info['mod_zvanie'] = '������';
-					$u->info['clan_prava'] = '0|0|0|0|0';
-					mysql_query('UPDATE `users` SET `align` = "'.$u->info['align'].'", `clan` = "'.$u->info['clan'].'", `mod_zvanie` = "������", `clan_prava` = "0|0|0|0|0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-					mysql_query('UPDATE `users` SET `money` = "'.$usr['money'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-					mysql_query('UPDATE `clan_add` SET `yes` = "'.time().'" WHERE `id` = "'.$czv['id'].'" LIMIT 1');
-					mysql_query('UPDATE `clan_add` SET `no` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `yes` = 0 AND `no` = 0');
-				}
-			}
-		}
-	}else{
-		$u->error = '��������� ����� ������ #'.(0+$_GET['newclan']).' �� ���������� � ����';
-	}
-}*/
-
-if(!isset($_GET['mAjax']) AND !isset($_GET['ajaxHostel']))
-	echo'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
+if (!isset($_GET['mAjax']) and !isset($_GET['ajaxHostel']))
+    echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
@@ -225,293 +116,151 @@ if(!isset($_GET['mAjax']) AND !isset($_GET['ajaxHostel']))
 <link href="https://img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
 </head>
 <body style="padding-top:0px; margin-top:7px; height:100%; background-color:#e2e0e1;">';
-//dedede
-
-/*if(  !isset($_COOKIE['d1c']) ) {
-	include('_incl_data/class/mobile.php');
-	$detect = new Mobile_Detect;
-	$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
-	$_COOKIE['d1c'] = $deviceType;
-	setcookie('d1c',$deviceType,(time()+864000));
-}else{
-	$deviceType = $_COOKIE['d1c'];
-}*/
-
-/*if( $deviceType == 'tablet' || $deviceType == 'mobile' ) { 
-?>
-<script>
-top.$(top.frames['main'].document.body).bind('touchmove', function(e) { 
-	
-});
-</script>
-<?
-}*/
-
-/*if($u->info['activ'] > 0) {
-		
-	if(isset($_POST['mail_activ'])) {
-		$test_mail = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE (`send` = "'.mysql_real_escape_string($_POST['mail_activ']).'" OR `mail` = "'.mysql_real_escape_string($_POST['mail_activ']).'") AND `activ` = "0" LIMIT 1'));
-		if(isset($test_mail['id'])) {
-			$a_error = '������ <b>e-mail</b> ��� ������������� �����. ���� � ��� �������� �������� � ���������� - ���������� � ���������.';
-		}else{
-			
-			function send_mime_mail($name_from, // ��� �����������
-							   $email_from, // email �����������
-							   $name_to, // ��� ����������
-							   $email_to, // email ����������
-							   $data_charset, // ��������� ���������� ������
-							   $send_charset, // ��������� ������
-							   $subject, // ���� ������
-							   $body // ����� ������
-							   )
-			   {
-			  $to = mime_header_encode($name_to, $data_charset, $send_charset)
-							 . ' <' . $email_to . '>';
-			  $subject = mime_header_encode($subject, $data_charset, $send_charset);
-			  $from =  mime_header_encode($name_from, $data_charset, $send_charset)
-								 .' <' . $email_from . '>';
-			  if($data_charset != $send_charset) {
-				$body = iconv($data_charset, $send_charset, $body);
-			  }
-			  $headers = "From: $from\r\n";
-			  $headers .= "Content-type: text/html; charset=$send_charset\r\n";
-			
-			  return mail($to, $subject, $body, $headers);
-			}
-		
-			function mime_header_encode($str, $data_charset, $send_charset) {
-			  if($data_charset != $send_charset) {
-				$str = iconv($data_charset, $send_charset, $str);
-			  }
-			  return '=?' . $send_charset . '?B?' . base64_encode($str) . '?=';
-			}
-			
-			if( $u->info['activ'] < time() ) {
-				$u->info['send'] = htmlspecialchars($_POST['mail_activ'],NULL,'cp1251');
-				mysql_query('UPDATE `users` SET `activ` = "'.(time()+1*3600).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				//mysql_query('UPDATE `users` SET `activ` = "0" WHERE `id` = "'.$b_pass['id'].'" LIMIT 1');
-				if(
-					send_mime_mail('���������� ����',
-						'support@new-combats.com',
-						' ' . $u->info['login'] . ' ',
-						''.$u->info['send'].'',
-						'CP1251',  // ���������, � ������� ��������� ������������ ������
-						'KOI8-R', // ���������, � ������� ����� ���������� ������
-						'�������� ����������� ���������, ����������� E-mail',
-							'<b>�� ���� �������������� ��� � ����� ������ ������ �������!</b><br>'.
-							'��������� ��������� <b>'.$u->info['login'].'</b><br>'.
-							'��� ��������� ������� ���: ' . md5($u->info['login'].'&[new-combats.com]') . '<br>'.
-							'������ ��� ���������: <a target="_blank" href="https://new-combats.com/active.php?code='.md5($u->info['login'].'&[new-combats.com]').'">���������</a>'.
-							'<br><br>� ���������,<br>������������� ����������� �����'
-					)
-				   
-				   ) {
-					   
-			   }else{
-				  $a_error = '������ �������� ��������� �� �������� ����.';  
-			   }
-			   mysql_query('UPDATE `users` SET `send` = "'.mysql_real_escape_string($u->info['send']).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			}else{
-				$a_error = '������� ������ �� ������ �������� ���� ����� �������� ����� <b>'.$u->timeOut($u->info['activ']-time()).'</b>.';  
-			}
-		}
-	}elseif(isset($_POST['new_real_mail'])) {
-		if($u->info['activ'] > time()) {
-			$a_error = '������ ������ <b>e-mail</b> ���� ������ ���� � ���, ���������� �����.';
-		}else{
-			$u->info['send'] = '0';
-			mysql_query('UPDATE `users` SET `send` = "'.mysql_real_escape_string($u->info['send']).'",`activ` = "'.(time()-60*60).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		}
-	}
-	
-	if($a_error != '') {
-		$a_error = '<br><font color=red>'.$a_error.'</font>';
-	}
-	
-	if($u->info['send'] == '0') {
-		echo '<div style="padding:4px;background-color:#FFEEEE;border:1px solid #EEAAAA;margin:2px;">';
-		echo '<small><form method="post" action="main.php"><b>��� �������� �� �����������</b>. ��� ��������� ��������� ������� e-mail: <input name="mail_activ" style="font-size:10px;width:180px;" type="text" value="'.$u->info['mail'].'"> <input type="submit" value="������� ���������� �� ���������!">'.$a_error.'</form></small>';
-	}else{
-		echo '<div style="padding:4px;background-color:#EEEEFF;border:1px solid #AAAAEE;margin:2px;">';
-		echo '<small><form method="post" action="main.php"><b>��� �������� �� �����������</b>. ���������� ��� ��������� ������� �� e-mail <b>'.$u->info['send'].'</b> <input name="new_real_mail" type="submit" value="������ ������ e-mail">'.$a_error.'</form></small>';
-	}
-	echo '</div>';
-}*/
-
-/*-----------------------*/
-$act = -2; $act2 = 0;
-$u->stats = $u->getStats($u->info['id'],0);
-$u->aves = $u->ves(NULL);
-if(!isset($u->stats['act']))
-{
-	$u->stats['act'] = 0;
+$act = -2;
+$act2 = 0;
+$u->stats = $u->getStats($u->info['id'], 0);
+$u->aves = $u->ves(null);
+if (!isset($u->stats['act'])) {
+    $u->stats['act'] = 0;
 }
-if($u->stats['act']==1)
-{
-	$act = 1;
+if ($u->stats['act'] == 1) {
+    $act = 1;
 }
-$u->rgd = $u->regen($u->info['id'],0,0);
-
-
-/*if( date('d.m.Y') == '05.05.2014' ) {
-	if($u->stats['silver'] < 1) {
-		mysql_query('INSERT INTO `eff_users` (
-			`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`no_Ace`
-		) VALUES (
-			"276","'.$u->info['id'].'","VIP (50) - �������","add_silver=1","30","'.(time()-29*24*60*60).'","1"
-		)');
-		echo '<script>top.chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<u>� ����� � ������������ ��������� � ������ ������� �� ��������� <b>VIP-������</b> �� ���� ����!</u>","Grey","1","1","0"]);</script>';
-	}
-}*/
+$u->rgd = $u->regen($u->info['id'], 0, 0);
 
 //�������� ������
 $ul = $u->testLevel();
 
-if(isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user']!=$u->info['id'] )
-{
-	if($u->room['noatack'] == 0) {
-		$ua = mysql_fetch_array(mysql_query('SELECT `id`,`clan` FROM `users` WHERE`id` = "'.mysql_real_escape_string($_GET['atak_user']).'" LIMIT 1'));
-		$cruw = mysql_fetch_array(mysql_query('SELECT `id`,`type` FROM `clan_wars` WHERE
-		((`clan1` = "'.$ua['clan'].'" AND `clan2` = "'.$u->info['clan'].'") OR (`clan2` = "'.$ua['clan'].'" AND `clan1` = "'.$u->info['clan'].'")) AND
-		`time_finish` > '.time().' LIMIT 1'));
-		unset($ua);
-		if(isset($cruw['id'])) {
-			$cruw = $cruw['type'];
-		}else{
-			$cruw = 0;
-		}
-	
-		$ua = mysql_fetch_array(mysql_query('SELECT `s`.*,`u`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `s`.`id` = `u`.`id` WHERE (`s`.`atack` > "'.time().'" OR `s`.`atack` = 1 OR 1 = '.$cruw.' OR 2 = '.$cruw.') AND `s`.`id` = "'.mysql_real_escape_string($_GET['atak_user']).'" LIMIT 1'));
-		
-		//$check = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars`= "end_trup" AND `time` > "'.(time()-3*60*60).'" ORDER BY `actions`.`time` DESC LIMIT 1;'));
-		$check = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
-		$check2 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 479 AND `uid` = "'.$ua['id'].'" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
-		$test = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_last` WHERE `uid` = "'.$u->info['id'].'" AND `battle_id` = "'.$ua['battle'].'" LIMIT 1'));
-		/*if( $ua['no_ip'] == 'trupojor' && $ua['level'] != $u->info['level'] ) {
-			$u->error = '������ �������� �� ������� ����� ������!';*/
-		if( $ua['no_ip'] == 'trupojor' && $ua['level'] ==9 && $u->info['level']>9 ) {
-			$u->error = '������ �������� �� ������� ����� ������!';
-		}elseif( $ua['no_ip'] == 'trupojor' && $ua['level'] ==10 && $u->info['level']<10 ) {
-			$u->error = '������ �������� �� ������� ����� ������!';
-		}elseif( $ua['no_ip'] != 'trupojor' && $ua['level'] != $u->info['level'] ) { //&& !isset($cruw)
-			$u->error = '�������� ����� �� ���������� ������ ������ ������!';
-		}elseif(isset($test['id'])) {
+if (isset($_GET['atak_user']) && $u->info['battle'] == 0 && $_GET['atak_user'] != $u->info['id']) {
+    if ($u->room['noatack'] == 0) {
+        $ua = mysql_fetch_array(mysql_query('SELECT `id`,`clan` FROM `users` WHERE`id` = "' . mysql_real_escape_string($_GET['atak_user']) . '" LIMIT 1'));
+        $cruw = mysql_fetch_array(mysql_query('SELECT `id`,`type` FROM `clan_wars` WHERE
+		((`clan1` = "' . $ua['clan'] . '" AND `clan2` = "' . $u->info['clan'] . '") OR (`clan2` = "' . $ua['clan'] . '" AND `clan1` = "' . $u->info['clan'] . '")) AND
+		`time_finish` > ' . time() . ' LIMIT 1'));
+        unset($ua);
+        if (isset($cruw['id'])) {
+            $cruw = $cruw['type'];
+        } else {
+            $cruw = 0;
+        }
+
+        $ua = mysql_fetch_array(mysql_query('SELECT `s`.*,`u`.* FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `s`.`id` = `u`.`id` WHERE (`s`.`atack` > "' . time() . '" OR `s`.`atack` = 1 OR 1 = ' . $cruw . ' OR 2 = ' . $cruw . ') AND `s`.`id` = "' . mysql_real_escape_string($_GET['atak_user']) . '" LIMIT 1'));
+        $check = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "' . $u->info['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
+        $check2 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 479 AND `uid` = "' . $ua['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
+        $test = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_last` WHERE `uid` = "' . $u->info['id'] . '" AND `battle_id` = "' . $ua['battle'] . '" LIMIT 1'));
+        if ($ua['no_ip'] == 'trupojor' && $ua['level'] == 9 && $u->info['level'] > 9) {
+            $u->error = '������ �������� �� ������� ����� ������!';
+        } elseif ($ua['no_ip'] == 'trupojor' && $ua['level'] == 10 && $u->info['level'] < 10) {
+            $u->error = '������ �������� �� ������� ����� ������!';
+        } elseif ($ua['no_ip'] != 'trupojor' && $ua['level'] != $u->info['level']) {
+            $u->error = '�������� ����� �� ���������� ������ ������ ������!';
+        } elseif (isset($test['id'])) {
             $u->error = '������ ���������, �� ��� ���� � ���� ��������.';
-		}elseif( $ua['no_ip'] == 'trupojor' && isset($check['id']) ) { //&& $ua['level'] >9
-			$u->error = '������ �������� �� ������� ���� ������ ���� � 3 ����!';
-		}elseif(isset($check2['id'])) { //&& $ua['level'] >9
-			$u->error = '�������� ����� ������ �� ���������!';
-		}elseif(isset($ua['id']) && $ua['online'] > time()-520)
-		{
-			$usta = $u->getStats($ua['id'],0); // ����� ����
-			$minHp = floor($usta['hpAll']/100*33); // ����������� ����� �������� ���� ��� ������� ����� �������
-	
-			if( $ua['battle'] > 0 ) {
-				$uabt = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$ua['battle'].'" AND `team_win` = "-1" LIMIT 1'));
-				if(!isset($uabt['id'])) {
-					$ua['battle'] = 0;
-				}
-			}
-	
-			if( $ua['battle'] == 0 && $minHp > $usta['hpNow'] ) {
-				$u->error = '������ �������, � ���������� �� �������������� ��������';
-			}elseif( isset($uabt['id']) && $uabt['type'] == 500 && $ua['team'] == 1 ) {
-				$u->error = '������ ��������� �� ������� ��������!';
-			}elseif( isset($uabt['id']) && $uabt['invis'] > 0 ) {
-				$u->error = '������ ����������� � ��������� ���!';
-			}elseif( $magic->testTravma( $ua['id'] , 3 ) == true ) {
-				$u->error = '��������� ������ �����������, ������ �������!';
-			}elseif( $magic->testTravma( $u->info['id'] , 2 ) == true ) {
-				$u->error = '�� ������������, ������ �������!';
-			}elseif($ua['room']==$u->info['room'] && ($minHp <= $usta['hpNow'] || $ua['battle'] > 0))
-			{
-				if( $ua['type_pers'] == 0 ) {
-					if( $cruw == 2 ) {
-						$ua['type_pers'] = 99;
-					}else{
-						$ua['type_pers'] = 50;
-					}
-				}
-				if( $ua['no_ip'] == 'trupojor' ) {
-					$ua['type_pers'] = 500;
-				}
-				
-				mysql_query('UPDATE `stats` SET `hpNow` = "'.$usta['hpNow'].'",`mpNow` = "'.$usta['mpNow'].'" WHERE `id` = "'.$usta['id'].'" LIMIT 1');
-				
-				$goodt=$magic->atackUser($u->info['id'],$ua['id'],$ua['team'],$ua['battle'],$ua['bbexp'],$ua['type_pers']);
-				
-				if( $cruw == 2 ) {
-					$rtxt = '[img[items/pal_button9.gif]] &quot;'.$u->info['login'].'&quot; ��������'.$sx.' �������� ��������� �� ����� �� ��������� &quot;'.$ua['login'].'&quot;.';
-				}else{
-					$rtxt = '[img[items/pal_button8.gif]] &quot;'.$u->info['login'].'&quot; ��������'.$sx.' ��������� �� ����� �� ��������� &quot;'.$ua['login'].'&quot;.';
-				}
-				
-				if ($goodt>0)
-				{
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");		
-				}
-				unset($goodt);
-				header('location: main.php');
-				die();
-			}else{
-				if($ua['room']!=$u->info['room']){
-				//�������� � ������ �������
-					$u->error = '�������� ��������� � ������ �������';
-				}else{
-					$u->error = '�������� ����� ������� ����� ������� ������.';
-				}
-			}
-		}else{
-			//�� ��������� ������ �������
-			$u->error = '�������� �� � ����, ���� �� ��� ��� �����';
-		}
-	}else{
-		$u->error = '��� ����������� ��������� ��� ����������...';
-	}
+        } elseif ($ua['no_ip'] == 'trupojor' && isset($check['id'])) {
+            $u->error = '������ �������� �� ������� ���� ������ ���� � 3 ����!';
+        } elseif (isset($check2['id'])) {
+            $u->error = '�������� ����� ������ �� ���������!';
+        } elseif (isset($ua['id']) && $ua['online'] > time() - 520) {
+            $usta = $u->getStats($ua['id'], 0); // ����� ����
+            $minHp = floor($usta['hpAll'] / 100 * 33); // ����������� ����� �������� ���� ��� ������� ����� �������
+
+            if ($ua['battle'] > 0) {
+                $uabt = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $ua['battle'] . '" AND `team_win` = "-1" LIMIT 1'));
+                if (!isset($uabt['id'])) {
+                    $ua['battle'] = 0;
+                }
+            }
+
+            if ($ua['battle'] == 0 && $minHp > $usta['hpNow']) {
+                $u->error = '������ �������, � ���������� �� �������������� ��������';
+            } elseif (isset($uabt['id']) && $uabt['type'] == 500 && $ua['team'] == 1) {
+                $u->error = '������ ��������� �� ������� ��������!';
+            } elseif (isset($uabt['id']) && $uabt['invis'] > 0) {
+                $u->error = '������ ����������� � ��������� ���!';
+            } elseif ($magic->testTravma($ua['id'], 3)) {
+                $u->error = '��������� ������ �����������, ������ �������!';
+            } elseif ($magic->testTravma($u->info['id'], 2)) {
+                $u->error = '�� ������������, ������ �������!';
+            } elseif ($ua['room'] == $u->info['room'] && ($minHp <= $usta['hpNow'] || $ua['battle'] > 0)) {
+                if ($ua['type_pers'] == 0) {
+                    if ($cruw == 2) {
+                        $ua['type_pers'] = 99;
+                    } else {
+                        $ua['type_pers'] = 50;
+                    }
+                }
+                if ($ua['no_ip'] == 'trupojor') {
+                    $ua['type_pers'] = 500;
+                }
+
+                mysql_query('UPDATE `stats` SET `hpNow` = "' . $usta['hpNow'] . '",`mpNow` = "' . $usta['mpNow'] . '" WHERE `id` = "' . $usta['id'] . '" LIMIT 1');
+
+                $goodt = $magic->atackUser($u->info['id'], $ua['id'], $ua['team'], $ua['battle'], $ua['bbexp'], $ua['type_pers']);
+
+                if ($cruw == 2) {
+                    $rtxt = '[img[items/pal_button9.gif]] &quot;' . $u->info['login'] . '&quot; ��������' . $sx . ' �������� ��������� �� ����� �� ��������� &quot;' . $ua['login'] . '&quot;.';
+                } else {
+                    $rtxt = '[img[items/pal_button8.gif]] &quot;' . $u->info['login'] . '&quot; ��������' . $sx . ' ��������� �� ����� �� ��������� &quot;' . $ua['login'] . '&quot;.';
+                }
+
+                if ($goodt > 0) {
+                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+                }
+                unset($goodt);
+                header('location: main.php');
+                die();
+            } else {
+                if ($ua['room'] != $u->info['room']) {
+                    //�������� � ������ �������
+                    $u->error = '�������� ��������� � ������ �������';
+                } else {
+                    $u->error = '�������� ����� ������� ����� ������� ������.';
+                }
+            }
+        } else {
+            //�� ��������� ������ �������
+            $u->error = '�������� �� � ����, ���� �� ��� ��� �����';
+        }
+    } else {
+        $u->error = '��� ����������� ��������� ��� ����������...';
+    }
 }
 
-if($ul==1)
-{
-	$act = 1;
-}	
-if($u->info['repass'] > 0) {
-function GetRealIp()
-{
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) 
- {
-   $ip=$_SERVER['HTTP_CLIENT_IP'];
- }
- elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
- {
-  $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
- }
- else
- {
-   $ip=$_SERVER['REMOTE_ADDR'];
- }
- return $ip;
+if ($ul == 1) {
+    $act = 1;
 }
-define('IP',GetRealIp());
-	if(isset($_POST['renpass']) && $_POST['renpass']==$_POST['renpass2'] && md5($_POST['renpass'])!=$u->info['pass']) {
-		if($u->info['ip']==IP) {
-			$u->info['pass'] = md5($_POST['renpass']);
-			setcookie('pass',$u->info['pass'],time()+30*60*60*24,'','new-combats.com');
-			mysql_query('UPDATE `users` SET `pass` = "'.mysql_real_escape_string($u->info['pass']).'",`repass` = "0",`type_pers` = "0",`bot_room` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			mysql_query('UPDATE `stats` SET `bot` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		}else{
-			die('<font color="red"><b>��������!</b> ����� ������ ��������� � ip %'.$u->info['ip'].'.<br>��� �������������� �������� ������� � ������� IP, ���� ���������� � ������������� ������� ����� ������ ���������. �������� ��������� �� ����������!</font>');
-		}
-	}else{
-		//unlink($lock_file);
-		if(isset($_POST['renpass'])) {
-			if($u->info['pass']==md5($_POST['renpass']))
-			{
-				echo '<font color="red"><b>��������!</b>��� ����� ������ ������ ����������� �� ������.</font>';
-			}elseif($_POST['renpass']!=$_POST['renpass2']) {
-				echo '<font color="red"><b>��������!</b>������ �� ���������.</font>';
-			}
-		}
-		die('<br><br><br><font color="red"><b>������� ���������� ������ �� ���������!</b><br>������ ����� ��������, ���� ������ �� ������� ����� 2 �������.</font><br><br><hr>
+if ($u->info['repass'] > 0) {
+    function GetRealIp()
+    {
+        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
+            $ip = $_SERVER['HTTP_CLIENT_IP'];
+        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+        } else {
+            $ip = $_SERVER['REMOTE_ADDR'];
+        }
+        return $ip;
+    }
+
+    define('IP', GetRealIp());
+    if (isset($_POST['renpass']) && $_POST['renpass'] == $_POST['renpass2'] && md5($_POST['renpass']) != $u->info['pass']) {
+        if ($u->info['ip'] == IP) {
+            $u->info['pass'] = md5($_POST['renpass']);
+            setcookie('pass', $u->info['pass'], time() + 30 * 60 * 60 * 24, '', 'new-combats.com');
+            mysql_query('UPDATE `users` SET `pass` = "' . mysql_real_escape_string($u->info['pass']) . '",`repass` = "0",`type_pers` = "0",`bot_room` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            mysql_query('UPDATE `stats` SET `bot` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+        } else {
+            die('<font color="red"><b>��������!</b> ����� ������ ��������� � ip %' . $u->info['ip'] . '.<br>��� �������������� �������� ������� � ������� IP, ���� ���������� � ������������� ������� ����� ������ ���������. �������� ��������� �� ����������!</font>');
+        }
+    } else {
+        if (isset($_POST['renpass'])) {
+            if ($u->info['pass'] == md5($_POST['renpass'])) {
+                echo '<font color="red"><b>��������!</b>��� ����� ������ ������ ����������� �� ������.</font>';
+            } elseif ($_POST['renpass'] != $_POST['renpass2']) {
+                echo '<font color="red"><b>��������!</b>������ �� ���������.</font>';
+            }
+        }
+        die('<br><br><br><font color="red"><b>������� ���������� ������ �� ���������!</b><br>������ ����� ��������, ���� ������ �� ������� ����� 2 �������.</font><br><br><hr>
 			<form action="main.php" method="post">
 		<fieldset>
 		<legend><b>������� ������</b></legend>
@@ -522,369 +271,322 @@ define('IP',GetRealIp());
 		</table>
 		</fieldset>
 		</font>');
-	}
+    }
 }
 
-
 /*-----------------------*/
-if( $u->info['battle'] == 0 ){
-	$btl_last = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1'));
+if ($u->info['battle'] == 0) {
+    $btl_last = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "' . $u->info['id'] . '" AND `finish` = "0" LIMIT 1'));
 }
-if( isset($btl_last['id']) && $u->info['battle'] == 0 ) {
-	include('modules_data/btl_.php');
-	
-	$u->info['battle_lsto'] = true;
-}elseif($u->info['battle']==0){ 
-	//��������/������ ���������
-	if( !isset($sleep['id']) ) {
-		$act2 = $u->testItems($u->info['id'],$u->stats,0);
-	}
-	if($act2!=-2 && $act==-2){
-		$act = $act2;
-	}
-	
-	if( $u->room['block_all'] != 0 ) {
-		unset($_GET['inv'],$_GET['skills'],$_GET['anketa']);
-	}
-	
-	if(!isset($u->tfer['id']) && $u->room['block_all'] == 0){
-		//�����/����� �������
-		if(isset($_GET['rstv']) && isset($_GET['inv'])) {
-			$act = $u->freeStatsMod($_GET['rstv'],$_GET['mf'],$u->info['id']);
-		} elseif(isset($_GET['ufs2']) && isset($_GET['inv'])){
-			$act = $u->freeStats2Item($_GET['itmid'],$_GET['ufs2'],$u->info['id'],1);
-		} elseif(isset($_GET['ufs2mf']) && isset($_GET['inv'])){
-			$act = $u->freeStats2Item($_GET['itmid'],$_GET['ufs2mf'],$u->info['id'],2);
-		} elseif(isset($_GET['ufsmst']) && isset($_GET['inv'])){
-			$act = $u->itemsSmSave($_GET['itmid'],$_GET['ufsmst'],$u->info['id']);
-		} elseif(isset($_GET['ufsms']) && isset($_GET['inv'])){
-			$act = $u->itemsSmSave($_GET['itmid'],$_GET['ufsms']+100,$u->info['id']);
-		} elseif(isset($_GET['ufs']) && isset($_GET['inv'])){
-			$act = $u->freeStatsItem($_GET['itmid'],$_GET['ufs'],$u->info['id']);
-		} elseif(isset($_GET['sid']) && isset($_GET['inv'])){
-			$act = $u->snatItem($_GET['sid'],$u->info['id']);
-		} elseif(isset($_GET['oid']) && isset($_GET['inv'])){
-			$act = $u->odetItem($_GET['oid'],$u->info['id']);
-		} elseif(isset($_GET['item_rune']) && isset($_GET['inv'])){			
-			$act = $u->runeItem(NULL);			
-		} elseif(isset($_GET['remitem'],$_GET['inv'])){
-			$act = $u->snatItemAll($u->info['id']);
-		} elseif(isset($_GET['delete']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])){
-			if($u->info['allLock'] < time()) {
-				$u->deleteItem(intval($_GET['delete']),$u->info['id']);
-			}else{
-				echo '<script>setTimeout(function(){alert("��� ��������� ������� �������� �� '.date('d.m.y H:i',$u->info['allLock']).'")},250);</script>';
-			}
-		} elseif(isset($_GET['unstack']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])){
-			$u->unstack(intval($_GET['unstack']), intval($_GET['unstackCount']));
-		} elseif(isset($_GET['stack']) && isset($_GET['inv'])){
-			$u->stack($_GET['stack']);
-		} elseif(isset($_GET['end_qst_now'])){
-			$q->endq((int)$_GET['end_qst_now'],'end');
-		}
-		//������������ ������
-		if(isset($_GET['use_pid'])){
-			$magic->useItems((int)$_GET['use_pid']);
-		}
-	}else{
-		if($u->room['block_all'] > 0) {
-			//if(isset($_GET['use_pid'])) {
-				$u->error = '� ������ ������� ��������� ������������ ���-����...';
-			//}
-		}
-	}
+if (isset($btl_last['id']) && $u->info['battle'] == 0) {
+    include('modules_data/btl_.php');
 
-}elseif($u->info['battle_text']!=''){
-	//���������� �������� � ������� ������
-	if($u->info['last_b']>0) {
-		
-	}
-	//mysql_query('UPDATE `stats` SET `battle_text` = "",`last_b`="0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+    $u->info['battle_lsto'] = true;
+} elseif ($u->info['battle'] == 0) {
+    //��������/������ ���������
+    if (!isset($sleep['id'])) {
+        $act2 = $u->testItems($u->info['id'], $u->stats, 0);
+    }
+    if ($act2 != -2 && $act == -2) {
+        $act = $act2;
+    }
+
+    if ($u->room['block_all'] != 0) {
+        unset($_GET['inv'], $_GET['skills'], $_GET['anketa']);
+    }
+
+    if (!isset($u->tfer['id']) && $u->room['block_all'] == 0) {
+        //�����/����� �������
+        if (isset($_GET['rstv']) && isset($_GET['inv'])) {
+            $act = $u->freeStatsMod($_GET['rstv'], $_GET['mf'], $u->info['id']);
+        } elseif (isset($_GET['ufs2']) && isset($_GET['inv'])) {
+            $act = $u->freeStats2Item($_GET['itmid'], $_GET['ufs2'], $u->info['id'], 1);
+        } elseif (isset($_GET['ufs2mf']) && isset($_GET['inv'])) {
+            $act = $u->freeStats2Item($_GET['itmid'], $_GET['ufs2mf'], $u->info['id'], 2);
+        } elseif (isset($_GET['ufsmst']) && isset($_GET['inv'])) {
+            $act = $u->itemsSmSave($_GET['itmid'], $_GET['ufsmst'], $u->info['id']);
+        } elseif (isset($_GET['ufsms']) && isset($_GET['inv'])) {
+            $act = $u->itemsSmSave($_GET['itmid'], $_GET['ufsms'] + 100, $u->info['id']);
+        } elseif (isset($_GET['ufs']) && isset($_GET['inv'])) {
+            $act = $u->freeStatsItem($_GET['itmid'], $_GET['ufs'], $u->info['id']);
+        } elseif (isset($_GET['sid']) && isset($_GET['inv'])) {
+            $act = $u->snatItem($_GET['sid'], $u->info['id']);
+        } elseif (isset($_GET['oid']) && isset($_GET['inv'])) {
+            $act = $u->odetItem($_GET['oid'], $u->info['id']);
+        } elseif (isset($_GET['item_rune']) && isset($_GET['inv'])) {
+            $act = $u->runeItem(null);
+        } elseif (isset($_GET['remitem'], $_GET['inv'])) {
+            $act = $u->snatItemAll($u->info['id']);
+        } elseif (isset($_GET['delete']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])) {
+            if ($u->info['allLock'] < time()) {
+                $u->deleteItem(intval($_GET['delete']), $u->info['id']);
+            } else {
+                echo '<script>setTimeout(function(){alert("��� ��������� ������� �������� �� ' . date('d.m.y H:i', $u->info['allLock']) . '")},250);</script>';
+            }
+        } elseif (isset($_GET['unstack']) && isset($_GET['inv']) && $u->newAct($_GET['sd4'])) {
+            $u->unstack(intval($_GET['unstack']), intval($_GET['unstackCount']));
+        } elseif (isset($_GET['stack']) && isset($_GET['inv'])) {
+            $u->stack($_GET['stack']);
+        } elseif (isset($_GET['end_qst_now'])) {
+            $q->endq((int)$_GET['end_qst_now'], 'end');
+        }
+        //������������ ������
+        if (isset($_GET['use_pid'])) {
+            $magic->useItems((int)$_GET['use_pid']);
+        }
+    } else {
+        if ($u->room['block_all'] > 0) {
+            $u->error = '� ������ ������� ��������� ������������ ���-����...';
+        }
+    }
 }
 
-if($magic->youuse > 0){
-	$act = 1;
+if ($magic->youuse > 0) {
+    $act = 1;
 }
 //��������� ������
-if($act!=-2){
-	$u->stats = $u->getStats($u->info['id'],0,1);
-	$u->aves = $u->ves(NULL);
-	if(!isset($sleep['id'])){
-		$act2 = $u->testItems($u->info['id'],$u->stats,0);
-	}
-	if($act2!=-2 && $act==-2){
-		$act = $act2;
-	}
+if ($act != -2) {
+    $u->stats = $u->getStats($u->info['id'], 0, 1);
+    $u->aves = $u->ves(null);
+    if (!isset($sleep['id'])) {
+        $act2 = $u->testItems($u->info['id'], $u->stats, 0);
+    }
+    if ($act2 != -2 && $act == -2) {
+        $act = $act2;
+    }
 }
 
 /*-----------------------*/
-if( isset($_GET['worklist']) && $u->info['admin'] > 0 ) {
-	include('modules_data/worklist.php');
-}elseif( isset($btl_last['id']) && $u->info['battle'] == 0 ) {
-	//
-}elseif(isset($_GET['security']) && !isset($u->tfer['id']) && $trololo==1){
-	include('modules_data/_changepass.php');
-}elseif(isset($_GET['quests']) && true == false){
-	include('modules_data/_quests.php');
-}elseif($u->info['level']>=0 && isset($_GET['friends']) && !isset($u->tfer['id'])){
-	include('modules_data/_friends.php');
-}elseif(($u->info['admin']>0 || $u->info['level']>7 || $u->info['align'] == 50) && isset($_GET['notepad']) && !isset($u->tfer['id'])){
-	include('modules_data/notepad.php');
-}elseif((($u->info['align']>1 && $u->info['align']<2) || $u->info['admin']>0) && isset($_GET['light']) && !isset($u->tfer['id'])){
-	if( $u->info['id'] == 1000001 ) {
-		$u->info['admin'] = 0;
-		die();
-	}
-	//if( $u->info['admin'] > 0 ) {
-		include('modules_data/_mod.php');
-	//}else{
-	//	include('modules_data/_mod2.php');
-	//}
-}elseif((($u->info['align']>3 && $u->info['align']<4) || $u->info['admin']>0) && isset($_GET['dark']) && !isset($u->tfer['id'])){
-	if( $u->info['id'] == 1000001 ) {
-		$u->info['admin'] = 0;
-		die();
-	}
-	//if( $u->info['admin'] > 0 ) {
-		include('modules_data/_mod.php');
-	//}else{
-	//	include('modules_data/_mod2.php');
-	//}
-}elseif(isset($_GET['bagreport']) && true == false){
-	include('modules_data/_bagreport.php');
-}elseif(isset($_GET['admin']) && $u->info['admin']>0){
-	if( $u->info['id'] == 1000001 ) {
-		$u->info['admin'] = 0;
-		die();
-	}
-	if($u->info['id']==7) {
-	include('modules_data/_light.php');
-	}else{include('modules_data/_mod.php');}
-}elseif(isset($_GET['help']) && true == false){
-	include('modules_data/help.php');
-}elseif(isset($_GET['vip']) && !isset($u->tfer['id'])){
-	include('modules_data/vip.php');
-}elseif((isset($_GET['zayvka']) && $u->info['battle']==0) || (isset($_GET['zayvka']) && ($_GET['r']==6 || $_GET['r']==7 || !isset($_GET['r'])) && $u->info['battle']>0) && !isset($u->tfer['id'])){
-	if($u->room['zvsee'] == 1) {
-		include('modules_data/_zv2.php');
-	}else{
-		include('modules_data/_zv.php');
-	}
-}elseif(isset($_GET['alh']) && $u->info['level']>=0 && !isset($u->tfer['id'])){
-	include('modules_data/_alh.php');
-}elseif($u->info['clan']>0 && isset($_GET['clan']) && !isset($u->tfer['id'])){
-	if( $u->info['id'] == 1000001 ) {
-		$u->info['admin'] = 0;
-		die();
-	}
-	include('modules_data/_clan.php');
-}elseif(isset($_GET['alhp']) && ($u->info['admin']==1 || $u->info['align'] == 50 || $u->info['align2'] == 50) && !isset($u->tfer['id'])){
-	if( $u->info['id'] == 1000001 ) {
-		$u->info['admin'] = 0;
-		die();
-	}
-	include('modules_data/_alhp.php');
+if (isset($_GET['worklist']) && $u->info['admin'] > 0) {
+    include('modules_data/worklist.php');
+} elseif (isset($_GET['security']) && !isset($u->tfer['id']) && $trololo == 1) {
+    include('modules_data/_changepass.php');
+} elseif ($u->info['level'] >= 0 && isset($_GET['friends']) && !isset($u->tfer['id'])) {
+    include('modules_data/_friends.php');
+} elseif (($u->info['admin'] > 0 || $u->info['level'] > 7 || $u->info['align'] == 50) && isset($_GET['notepad']) && !isset($u->tfer['id'])) {
+    include('modules_data/notepad.php');
+} elseif ((($u->info['align'] > 1 && $u->info['align'] < 2) || $u->info['admin'] > 0) && isset($_GET['light']) && !isset($u->tfer['id'])) {
+    if ($u->info['id'] == 1000001) {
+        $u->info['admin'] = 0;
+        die();
+    }
+    include('modules_data/_mod.php');
+} elseif ((($u->info['align'] > 3 && $u->info['align'] < 4) || $u->info['admin'] > 0) && isset($_GET['dark']) && !isset($u->tfer['id'])) {
+    if ($u->info['id'] == 1000001) {
+        $u->info['admin'] = 0;
+        die();
+    }
+    include('modules_data/_mod.php');
+} elseif (isset($_GET['admin']) && $u->info['admin'] > 0) {
+    if ($u->info['id'] == 1000001) {
+        $u->info['admin'] = 0;
+        die();
+    }
+    if ($u->info['id'] == 7) {
+        include('modules_data/_light.php');
+    } else {
+        include('modules_data/_mod.php');
+    }
+} elseif (isset($_GET['vip']) && !isset($u->tfer['id'])) {
+    include('modules_data/vip.php');
+} elseif ((isset($_GET['zayvka']) && $u->info['battle'] == 0) || (isset($_GET['zayvka']) && ($_GET['r'] == 6 || $_GET['r'] == 7 || !isset($_GET['r'])) && $u->info['battle'] > 0) && !isset($u->tfer['id'])) {
+    if ($u->room['zvsee'] == 1) {
+        include('modules_data/_zv2.php');
+    } else {
+        include('modules_data/_zv.php');
+    }
+} elseif (isset($_GET['alh']) && $u->info['level'] >= 0 && !isset($u->tfer['id'])) {
+    include('modules_data/_alh.php');
+} elseif ($u->info['clan'] > 0 && isset($_GET['clan']) && !isset($u->tfer['id'])) {
+    if ($u->info['id'] == 1000001) {
+        $u->info['admin'] = 0;
+        die();
+    }
+    include('modules_data/_clan.php');
+} elseif (isset($_GET['alhp']) && ($u->info['admin'] == 1 || $u->info['align'] == 50 || $u->info['align2'] == 50) && !isset($u->tfer['id'])) {
+    if ($u->info['id'] == 1000001) {
+        $u->info['admin'] = 0;
+        die();
+    }
+    include('modules_data/_alhp.php');
 //������ ���������
-	}elseif( isset($_GET['bukmeker']) && $u->info['level']>0 && !isset($u->tfer['id'])){
-	include('modules_data/_bukmeker.php');
-	//������ ��������
-	}elseif( $u->info['align'] >= 1 && $u->info['align'] < 2 && isset($_GET['1_panel']) && $u->info['level']>3 && !isset($u->tfer['id'])){
-	include('modules_data/1_panel.php');
-	//������ �������
-	}elseif( $u->info['align'] >= 3 && $u->info['align'] < 4 && isset($_GET['3_panel']) && $u->info['level']>3 && !isset($u->tfer['id'])){
-	include('modules_data/3_panel.php');
-	//������ �������
-	}elseif( $u->info['align'] >= 7 && $u->info['align'] < 8 && isset($_GET['7_panel']) && $u->info['level']>3 && !isset($u->tfer['id'])){
-	include('modules_data/7_panel.php');
-    }elseif($u->info['battle']!=0){
-	//��������
-	//if( $u->info['id'] != 1000000 || isset($_GET['back_btl']) ) {
-		if((!isset($btl_last['id']) || $u->info['battle'] > 0) && !isset($u->info['battle_lsto'])) {
-			include('modules_data/btl_.php');
-			echo '<script type="text/javascript" src="js/onlineList.js"></script>';
-			
-		}
-	/*}else{
-		include('modules_data/btl_new.php');
-		echo '<hr><a href="main.php?back_btl">������ ������� ������ �������</a>';
-	}*/
-}else{
-	if(isset($_GET['talk']) && !isset($u->tfer['id'])){
-				echo "
+} elseif (isset($_GET['bukmeker']) && $u->info['level'] > 0 && !isset($u->tfer['id'])) {
+    include('modules_data/_bukmeker.php');
+    //������ ��������
+} elseif ($u->info['align'] >= 1 && $u->info['align'] < 2 && isset($_GET['1_panel']) && $u->info['level'] > 3 && !isset($u->tfer['id'])) {
+    include('modules_data/1_panel.php');
+    //������ �������
+} elseif ($u->info['align'] >= 3 && $u->info['align'] < 4 && isset($_GET['3_panel']) && $u->info['level'] > 3 && !isset($u->tfer['id'])) {
+    include('modules_data/3_panel.php');
+    //������ �������
+} elseif ($u->info['align'] >= 7 && $u->info['align'] < 8 && isset($_GET['7_panel']) && $u->info['level'] > 3 && !isset($u->tfer['id'])) {
+    include('modules_data/7_panel.php');
+} elseif ($u->info['battle'] != 0) {
+    //��������
+    if ((!isset($btl_last['id']) || $u->info['battle'] > 0) && !isset($u->info['battle_lsto'])) {
+        include('modules_data/btl_.php');
+        echo '<script type="text/javascript" src="js/onlineList.js"></script>';
+    }
+
+} else {
+    if (isset($_GET['talk']) && !isset($u->tfer['id'])) {
+        echo "
 				<script language='JavaScript'>
 				var elem = document.getElementById('se-pre-con');
 				elem.parentNode.removeChild(elem);
 				</script>
 				";
-		if($u->info['dnow']>0){
-			include('_incl_data/class/__dungeon.php');
-		}
-		include('modules_data/_dialog.php');
-	//}elseif(isset($_GET['act_sec']) && !isset($u->tfer['id']) && $trololo==1){
-		//include('modules_data/_security.php');
-	}elseif(isset($_GET['inv']) && !isset($u->tfer['id']) && $trololo==1){
-		include('modules_data/_inv.php');	
-		// include('modules_data/_inv-old.php');
-	}elseif(isset($_GET['add_eff']) && !isset($u->tfer['id']) && $trololo==1){
-		include('modules_data/add_eff.php');
-	//}elseif(isset($_GET['cryshop']) && !isset($u->tfer['id']) && $trololo==1  && $u->info['level']>0){
-		//include('modules_data/_cryshop.php');
-	}elseif(isset($_GET['referals']) && $trololo==1 && !isset($u->tfer['id'])){
-		include('modules_data/_ref.php');
-	}elseif(isset($_GET['obraz']) && !isset($u->tfer['id']) && $trololo==1){
-		include('modules_data/_obraz.php');
-	//}elseif(isset($_GET['galery']) && !isset($u->tfer['id']) && $trololo==1){
-		//include('modules_data/_galery.php');
-	}elseif(isset($_GET['skills']) && !isset($u->tfer['id']) && $trololo==1){
-		include('modules_data/_umenie.php');
-	}elseif((isset($_GET['transfer']) || isset($u->tfer['id'])) && $u->info['level']>=$c['level_ransfer'] && $trololo==1 && $u->info['inTurnir'] == 0 && $u->info['inTurnirnew'] == 0){
-		if($u->info['allLock'] > time()) {
-			include('modules_data/_locations.php');
-			echo '<script>setTimeout(function(){alert("��� ��������� �������� �� '.date('d.m.y H:i',$u->info['allLock']).'")},250);</script>';
-		}else{
-			include('modules_data/_transfers.php');
-		}
-	}elseif(isset($_GET['anketa']) && !isset($u->tfer['id']) && $trololo==1){
-		include('settings.php');
-	}elseif(isset($_GET['pet']) && $u->info['animal']>0 && true == false && $trololo==1){
-		include('modules_data/_animal.php');
-	}elseif(isset($_GET['newanimal']) && $trololo==1){
-		include('modules_data/_newanimal.php');
-	}elseif(isset($_GET['act_trf']) && $u->room['block_all']==0){
-		include('modules_data/act_trf.php');
-	}elseif(isset($_GET['titul']) && $u->room['block_all']==0){
-		include('modules_data/titul.php');
-    }elseif(!isset($u->tfer['id'])){
-//		if($u->info['login'] == '��������')
-//			exit(include('modules_data/_NewLocations.php'));
-//		else
-			include('modules_data/_locations.php');
-	}
-}
-
-//mysql_query('COMMIT');
-
-if($u->room['name']=='����� ������' && $u->info['inUser']>0 && $u->info['lost']>0){
-	//mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-	//������ ������
-	//header('location: main.php');
+        if ($u->info['dnow'] > 0) {
+            include('_incl_data/class/__dungeon.php');
+        }
+        include('modules_data/_dialog.php');
+    } elseif (isset($_GET['inv']) && !isset($u->tfer['id']) && $trololo == 1) {
+        include('modules_data/_inv.php');
+    } elseif (isset($_GET['add_eff']) && !isset($u->tfer['id']) && $trololo == 1) {
+        include('modules_data/add_eff.php');
+    } elseif (isset($_GET['referals']) && $trololo == 1 && !isset($u->tfer['id'])) {
+        include('modules_data/_ref.php');
+    } elseif (isset($_GET['obraz']) && !isset($u->tfer['id']) && $trololo == 1) {
+        include('modules_data/_obraz.php');
+    } elseif (isset($_GET['skills']) && !isset($u->tfer['id']) && $trololo == 1) {
+        include('modules_data/_umenie.php');
+    } elseif ((isset($_GET['transfer']) || isset($u->tfer['id'])) && $u->info['level'] >= $c['level_ransfer'] && $trololo == 1 && $u->info['inTurnir'] == 0 && $u->info['inTurnirnew'] == 0) {
+        if ($u->info['allLock'] > time()) {
+            include('modules_data/_locations.php');
+            echo '<script>setTimeout(function(){alert("��� ��������� �������� �� ' . date('d.m.y H:i', $u->info['allLock']) . '")},250);</script>';
+        } else {
+            include('modules_data/_transfers.php');
+        }
+    } elseif (isset($_GET['anketa']) && !isset($u->tfer['id']) && $trololo == 1) {
+        include('settings.php');
+    } elseif (isset($_GET['newanimal']) && $trololo == 1) {
+        include('modules_data/_newanimal.php');
+    } elseif (isset($_GET['act_trf']) && $u->room['block_all'] == 0) {
+        include('modules_data/act_trf.php');
+    } elseif (isset($_GET['titul']) && $u->room['block_all'] == 0) {
+        include('modules_data/titul.php');
+    } elseif (!isset($u->tfer['id'])) {
+        include('modules_data/_locations.php');
+    }
 }
 
+/**
+ * �������� ������ ��� ��� ������� ������ ������ ���.
+ * PHP Fatal error:  Call to a member function testquest() on a non-object
+ * ����������, �� ����. ���. 09.06.22
+ */
 //��������� ������ �� ����������
-$q->testquest();
+if (in_array($u->room['file'], [
+    'dungeon_enter',
+    'dungeon_enter_all',
+    'enterbezdna',
+    'entercat',
+    'enterdrago',
+    'entergrib',
+    'enternizin',
+    'enterptp',
+    'house_belaun',
+    'dungeon'
+])) {
+    $q->testquest();
+}
 
 $iloc = '';
 $iloce = '';
-$sp = mysql_query('SELECT * FROM `items_local` WHERE (`room` = "'.$u->info['room'].'" OR `room` = "-1") AND `delete` = "0" AND `user_take` = "0" AND `tr_login` = "'.$u->info['login'].'"');
-while( $pl = mysql_fetch_array($sp) ) {
-	$itmo = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$pl['item_id'].'" LIMIT 1'));
-	if( isset($itmo['id']) ) {
-		$tk = 1;
-		$glid = 0;
-		//
-		if( $pl['room'] != -1 && $pl['room'] != $u->info['room'] ) {
-			if(isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id'] ) {
-				$iloce = '�� ���������� � ������ �������...';
-			}
-			$tk = 0;
-		}elseif( $pl['tr_login'] != '0' && $pl['tr_login'] != $u->info['login']) {
-			if(isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id'] ) {
-				$iloce = '������ ������� ��� ������� ���������...';
-			}
-			$tk = 0;
-		}elseif( $pl['tr_sex'] != -1 && $pl['tr_sex'] != $u->info['sex'] ) {
-			if(isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id'] ) {
-				$iloce = '������ ������� ��� ���������������� ����...';
-			}
-			$tk = 0;
-		}
-		if($pl['time'] + 86400 < time() ) {
-			//�� ������ �������
-			$glid = 1;
-			mysql_query('UPDATE `items_local` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-		}elseif(isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id'] ) {
-			//
-			if( $u->info['battle'] > 0 && $tk == 1 ) {
-				$iloce = '�� �� ������ ������� �������, ��������� ��������...';
-			}elseif($tk == 1 ) {
-				$iloce = '�� ������� ������� ������� &quot;'.$itmo['name'].'&quot; � ������� &quot;'.$u->room['name'].'&quot;.';
-				mysql_query('UPDATE `items_local` SET `delete` = "'.time().'" , `user_take` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				//������ �������
-				$glid = 1;
-				if( $pl['data'] == '0' ) {					
-					$u->addItem($pl['item_id'],$u->info['id'],'|from_loc_id='.$pl['id'].'|from_loc='.$u->info['room']);
-				}else{
-					$u->addItem($pl['item_id'],$u->info['id'],'|from_loc_id='.$pl['id'].'|from_loc='.$u->info['room'].'|'.$pl['data']);
-				}
-				/*
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES
-				('1','".$u->info['city']."','".$u->info['room']."','','".$u->info['login']."',
-				'�������� <b>".$u->info['login']."</b> ������ ������� <b>".$itmo['name']."</b> � ������� ".$u->room['name'].".','".time()."','6','0')");
-				*/
-			}			
-		}
-		if( $glid == 0 ) {
-			if( $tk == 1 && $pl['tr_login'] == '0' ) {
-				$tk = 2;
-			}
-			$iloc .= '<a class="tolobf'.$tk.'" href="main.php?take_loc_item='.$pl['id'].'" target="main"><div class="outer"><div class="middle"><div class="inner">'.
-			'<img title="������� &quot;'.$itmo['name'].'&quot;';
-			if( $pl['tr_login'] ) {
-				$iloc .= '\n'.'������� ��� ������ &quot;'.$pl['tr_login'].'&quot;';
-			}elseif( $pl['tr_sex'] == 0 ) {
-				$iloc .= '\n'.'������� ��� ������';
-			}elseif( $pl['tr_sex'] == 1 ) {
-				$iloc .= '\n'.'������� ��� ������';
-			}else{
-				$iloc .= '\n'.'������� ����� ��������� ������';
-			}
-			$iloc .= '" src="https://img.new-combats.com/i/items/'.$itmo['img'].'">'.
-			'</div></div></div></a> ';	
-		}
-	}else{
-		echo '[!]';
-	}
-	unset($tk,$itmo);
+$sp = mysql_query('SELECT * FROM `items_local` WHERE (`room` = "' . $u->info['room'] . '" OR `room` = "-1") AND `delete` = "0" AND `user_take` = "0" AND `tr_login` = "' . $u->info['login'] . '"');
+while ($pl = mysql_fetch_array($sp)) {
+    $itmo = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $pl['item_id'] . '" LIMIT 1'));
+    if (isset($itmo['id'])) {
+        $tk = 1;
+        $glid = 0;
+        //
+        if ($pl['room'] != -1 && $pl['room'] != $u->info['room']) {
+            if (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
+                $iloce = '�� ���������� � ������ �������...';
+            }
+            $tk = 0;
+        } elseif ($pl['tr_login'] != '0' && $pl['tr_login'] != $u->info['login']) {
+            if (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
+                $iloce = '������ ������� ��� ������� ���������...';
+            }
+            $tk = 0;
+        } elseif ($pl['tr_sex'] != -1 && $pl['tr_sex'] != $u->info['sex']) {
+            if (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
+                $iloce = '������ ������� ��� ���������������� ����...';
+            }
+            $tk = 0;
+        }
+        if ($pl['time'] + 86400 < time()) {
+            //�� ������ �������
+            $glid = 1;
+            mysql_query('UPDATE `items_local` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+        } elseif (isset($_GET['take_loc_item']) && $_GET['take_loc_item'] == $pl['id']) {
+            //
+            if ($u->info['battle'] > 0 && $tk == 1) {
+                $iloce = '�� �� ������ ������� �������, ��������� ��������...';
+            } elseif ($tk == 1) {
+                $iloce = '�� ������� ������� ������� &quot;' . $itmo['name'] . '&quot; � ������� &quot;' . $u->room['name'] . '&quot;.';
+                mysql_query('UPDATE `items_local` SET `delete` = "' . time() . '" , `user_take` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                //������ �������
+                $glid = 1;
+                if ($pl['data'] == '0') {
+                    $u->addItem($pl['item_id'], $u->info['id'], '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room']);
+                } else {
+                    $u->addItem($pl['item_id'], $u->info['id'], '|from_loc_id=' . $pl['id'] . '|from_loc=' . $u->info['room'] . '|' . $pl['data']);
+                }
+            }
+        }
+        if ($glid == 0) {
+            if ($tk == 1 && $pl['tr_login'] == '0') {
+                $tk = 2;
+            }
+            $iloc .= '<a class="tolobf' . $tk . '" href="main.php?take_loc_item=' . $pl['id'] . '" target="main"><div class="outer"><div class="middle"><div class="inner">' .
+                '<img title="������� &quot;' . $itmo['name'] . '&quot;';
+            if ($pl['tr_login']) {
+                $iloc .= '\n' . '������� ��� ������ &quot;' . $pl['tr_login'] . '&quot;';
+            } elseif ($pl['tr_sex'] == 0) {
+                $iloc .= '\n' . '������� ��� ������';
+            } elseif ($pl['tr_sex'] == 1) {
+                $iloc .= '\n' . '������� ��� ������';
+            } else {
+                $iloc .= '\n' . '������� ����� ��������� ������';
+            }
+            $iloc .= '" src="https://img.new-combats.com/i/items/' . $itmo['img'] . '">' .
+                '</div></div></div></a> ';
+        }
+    } else {
+        echo '[!]';
+    }
+    unset($tk, $itmo);
 }
 
-if( $iloc != '' ) {
-	if( $iloce != '' ) {
-		$iloc = '<div style="padding:10px;"><font color=red>' . $iloce . '</font></div>'.$iloc;
-	}
-	$iloc = '<style>'.
-	'.tolobf0 { display:inline-block; width:80px; height:80px; background-color:#e5e5e5; text-align:center; }.tolobf0:hover { background-color:#d5d5d5; text-align:center; }.tolobf2 { display:inline-block; width:80px; height:80px; background-color:#FFD700; text-align:center; }.tolobf2:hover { background-color:#DAA520; text-align:center; }.tolobf1 { display:inline-block; width:80px; height:80px; background-color:#d5d5e5; text-align:center; }.tolobf1:hover { background-color:#d5d5d5; text-align:center; }.outer {    display: table;    position: absolute;    height: 80px;    width: 80px;}.middle {    display: table-cell;    vertical-align: middle;}.inner {  margin-left: auto; margin-right: auto; width: 80px; }'.
-	'</style>'.
-	'<h3>� ������� ���������� ��������</h3>' . $iloc;
-	$tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'' . $iloc . '\' );';
-}else{
-	$tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'\' );';
+if ($iloc != '') {
+    if ($iloce != '') {
+        $iloc = '<div style="padding:10px;"><font color=red>' . $iloce . '</font></div>' . $iloc;
+    }
+    $iloc = '<style>' .
+        '.tolobf0 { display:inline-block; width:80px; height:80px; background-color:#e5e5e5; text-align:center; }.tolobf0:hover { background-color:#d5d5d5; text-align:center; }.tolobf2 { display:inline-block; width:80px; height:80px; background-color:#FFD700; text-align:center; }.tolobf2:hover { background-color:#DAA520; text-align:center; }.tolobf1 { display:inline-block; width:80px; height:80px; background-color:#d5d5e5; text-align:center; }.tolobf1:hover { background-color:#d5d5d5; text-align:center; }.outer {    display: table;    position: absolute;    height: 80px;    width: 80px;}.middle {    display: table-cell;    vertical-align: middle;}.inner {  margin-left: auto; margin-right: auto; width: 80px; }' .
+        '</style>' .
+        '<h3>� ������� ���������� ��������</h3>' . $iloc;
+    $tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'' . $iloc . '\' );';
+} else {
+    $tjs .= 'top.frames[\'main\'].locitems=1;parent.$(\'#canal1\').html( \'\' );';
 }
 
-unset($iloc,$iloce);
-
-/*if( $u->info['fnq'] < 38 ) {
-	include('_incl_data/class/noob.quests.php');
-	noob::start();
-}*/
-
-
+unset($iloc, $iloce);
 /*-----------------------*/
-$spl = mysql_fetch_array(mysql_query('SELECT `exp` FROM `levels` WHERE `nextLevel` = "'.($u->info['level']+1).'" ORDER BY `exp` ASC LIMIT 1'));
+$spl = mysql_fetch_array(mysql_query('SELECT `exp` FROM `levels` WHERE `nextLevel` = "' . ($u->info['level'] + 1) . '" ORDER BY `exp` ASC LIMIT 1'));
 $spl = $spl['exp'];
-echo '<script>top.myexpLineTop27('.$u->info['exp'].','.$spl.');'.$tjs.'top.ctest("'.$u->info['city'].'");top.sd4key="'.$u->info['nextAct'].'"; var battle = '.(0+$u->info['battle']).'; top.hic();</script></body>
+echo '<script>top.myexpLineTop27(' . $u->info['exp'] . ',' . $spl . ');' . $tjs . 'top.ctest("' . $u->info['city'] . '");top.sd4key="' . $u->info['nextAct'] . '"; var battle = ' . (0 + $u->info['battle']) . '; top.hic();</script></body>
 </html>';
 
-//mysql_query('UNLOCK TABLES');
-
-//unlink($lock_file);
 ?>
 <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.2/modernizr.js"></script>-->
 <script>
-//Loader
-	// Wait for window load
-	$(window).load(function() {
-		// Animate loader off screen
-		$(".se-pre-con").fadeOut(100);;
-	});
-</script>
-<?
+    //Loader
+    // Wait for window load
+    $(window).load(function () {
+        // Animate loader off screen
+        $(".se-pre-con").fadeOut(100);
+    });
+</script>
\ No newline at end of file
diff --git a/modules_data/cp.php1 b/modules_data/cp.php1
index 6fac666d..3f742400 100644
--- a/modules_data/cp.php1
+++ b/modules_data/cp.php1
@@ -29,7 +29,7 @@ if($u->room['file']=='cp')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/_locations.php b/modules_data/location/_locations.php
index 184acc3d..7b83d7da 100644
--- a/modules_data/location/_locations.php
+++ b/modules_data/location/_locations.php
@@ -160,7 +160,7 @@ if(isset($_GET['loc']))
 
 if($u->info['room']==209)
 {
-	include('_incl_data/class/__zv.php');
+	require_once('_incl_data/class/__zv.php');
 }
 
 if($re!=''){ $re = $re.'&nbsp;'; }
diff --git a/modules_data/location/ab/cp.php b/modules_data/location/ab/cp.php
index d3686f5f..19847b7b 100644
--- a/modules_data/location/ab/cp.php
+++ b/modules_data/location/ab/cp.php
@@ -29,7 +29,7 @@ if($u->room['file']=='ab/cp')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/ab/cp2.php b/modules_data/location/ab/cp2.php
index 206d7e0a..353552b5 100644
--- a/modules_data/location/ab/cp2.php
+++ b/modules_data/location/ab/cp2.php
@@ -29,7 +29,7 @@ if($u->room['file']=='ab/cp2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/ab/hram.php b/modules_data/location/ab/hram.php
index 7d76764a..8138fa06 100644
--- a/modules_data/location/ab/hram.php
+++ b/modules_data/location/ab/hram.php
@@ -206,7 +206,7 @@ if (!isset($_GET['r'])) {
                 } else {
                     echo 'information is lost.';
                 } ?></td>
-            <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+            <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
             <td valign="top">
                 <div align="right">
                     <?= !empty($re) ? '<span style="color: red; font-weight: bold">' . $re . '</span>' : '' ?>
diff --git a/modules_data/location/ab/izlom16.php b/modules_data/location/ab/izlom16.php
index 63b8cdc8..6c57c9bc 100644
--- a/modules_data/location/ab/izlom16.php
+++ b/modules_data/location/ab/izlom16.php
@@ -29,7 +29,7 @@ if($u->room['file']=='ab/izlom16')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/ab/izlom2.php b/modules_data/location/ab/izlom2.php
index 01f4fbf8..26617c63 100644
--- a/modules_data/location/ab/izlom2.php
+++ b/modules_data/location/ab/izlom2.php
@@ -17,7 +17,7 @@ if(isset($_POST['level']))
 			if(file_exists('_incl_data/class/__zv.php')) {
 			if(!isset($zv))
 			{
-				include('_incl_data/class/__zv.php');
+				require_once('_incl_data/class/__zv.php');
 			}			
 			$zv->startIzlom(1,((int)$_POST['level']));
 			}else{
diff --git a/modules_data/location/ab/quest.php b/modules_data/location/ab/quest.php
index ef465740..f85361c5 100644
--- a/modules_data/location/ab/quest.php
+++ b/modules_data/location/ab/quest.php
@@ -93,7 +93,7 @@ if($u->room['file']=='ab/quest')
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
       <tr>
         <td width="250" valign="top"><? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?></td>
-        <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+        <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
         <td valign="top"><div align="right">
           <table  border="0" cellpadding="0" cellspacing="0">
             <tr align="right" valign="top">
diff --git a/modules_data/location/an/bk.php b/modules_data/location/an/bk.php
index cf0298ba..0dd1eeea 100644
--- a/modules_data/location/an/bk.php
+++ b/modules_data/location/an/bk.php
@@ -129,7 +129,7 @@ if($u->room['file']=='an/bk'){
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?>
       <table  border="0" cellpadding="0" cellspacing="0">
@@ -141,7 +141,7 @@ if($u->room['file']=='an/bk'){
                     <td id="ViewLocation"><?php
                     if(true == false){
 					?><script><?php
-					include('modules_data/location/fight-club.database.php');
+					require_once('modules_data/location/fight-club.database.php');
 					?>
 					var json = <?php echo json_encode($Response); ?>;
 					var tgo = <?php echo ($tmGo*10); ?>;
diff --git a/modules_data/location/an/bk2.php b/modules_data/location/an/bk2.php
index 5255f269..ed7fa500 100644
--- a/modules_data/location/an/bk2.php
+++ b/modules_data/location/an/bk2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/bk2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?>
       <table  border="0" cellpadding="0" cellspacing="0">
diff --git a/modules_data/location/an/cp1.php b/modules_data/location/an/cp1.php
index f90e5fab..5e064173 100644
--- a/modules_data/location/an/cp1.php
+++ b/modules_data/location/an/cp1.php
@@ -107,7 +107,7 @@ function WeatherBegin() {  // IE main animation function
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/cp2.php b/modules_data/location/an/cp2.php
index 98fb56fc..a860a06c 100644
--- a/modules_data/location/an/cp2.php
+++ b/modules_data/location/an/cp2.php
@@ -107,7 +107,7 @@ function WeatherBegin() {  // IE main animation function
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/kinght.php b/modules_data/location/an/kinght.php
index 1496923d..490762ad 100644
--- a/modules_data/location/an/kinght.php
+++ b/modules_data/location/an/kinght.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/kinght')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/torg.php b/modules_data/location/an/torg.php
index 74259005..5e589ee9 100644
--- a/modules_data/location/an/torg.php
+++ b/modules_data/location/an/torg.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/torg')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/zalu.php b/modules_data/location/an/zalu.php
index 1c3c0249..7db3311e 100644
--- a/modules_data/location/an/zalu.php
+++ b/modules_data/location/an/zalu.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/zalu')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/zalu_pal.php b/modules_data/location/an/zalu_pal.php
index f818c38d..9d0ca05f 100644
--- a/modules_data/location/an/zalu_pal.php
+++ b/modules_data/location/an/zalu_pal.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/zalu_pal')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/zv1.php b/modules_data/location/an/zv1.php
index 95e3aeaf..3d0dc205 100644
--- a/modules_data/location/an/zv1.php
+++ b/modules_data/location/an/zv1.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/zv1')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/zv2.php b/modules_data/location/an/zv2.php
index 895e2304..be68de0b 100644
--- a/modules_data/location/an/zv2.php
+++ b/modules_data/location/an/zv2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/zv2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/zv3.php b/modules_data/location/an/zv3.php
index d966c552..d07935d1 100644
--- a/modules_data/location/an/zv3.php
+++ b/modules_data/location/an/zv3.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/zv3')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/an/zv4.php b/modules_data/location/an/zv4.php
index 307e5f99..8819094f 100644
--- a/modules_data/location/an/zv4.php
+++ b/modules_data/location/an/zv4.php
@@ -12,7 +12,7 @@ if($u->room['file']=='an/zv4')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/bk.php b/modules_data/location/bk.php
index 645c405f..93559634 100644
--- a/modules_data/location/bk.php
+++ b/modules_data/location/bk.php
@@ -11,7 +11,7 @@ if($u->room['file']=='bk'){
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
 	<td valign="top"><div align="right">
       <? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?>
       <table  border="0" cellpadding="0" cellspacing="0">
@@ -23,7 +23,7 @@ if($u->room['file']=='bk'){
                     <td id="ViewLocation"><?php
                     if($u->info['login'] == 'mZer0ne'){
 					?><script><?php
-					include('modules/location/fight-club.database.php');
+					require_once('modules/location/fight-club.database.php');
 					?>
 					var json = <?php echo json_encode($Response); ?>;
 					var tgo = <?php echo ($tmGo*10); ?>;
diff --git a/modules_data/location/bk2.php b/modules_data/location/bk2.php
index 1c0b6ab8..ac869e80 100644
--- a/modules_data/location/bk2.php
+++ b/modules_data/location/bk2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='bk2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?>
       <table  border="0" cellpadding="0" cellspacing="0">
diff --git a/modules_data/location/btl_.php b/modules_data/location/btl_.php
index fd27567c..f2cc203f 100644
--- a/modules_data/location/btl_.php
+++ b/modules_data/location/btl_.php
@@ -10,13 +10,13 @@ $old_battle = true;
 
 if( isset($_COOKIE['newbattle']) ) {
 	$old_battle = false;
-	include('btl_2.php');
+	require_once('btl_2.php');
 	die();
 }
 
 
 
-include('jx/battle/log_text.php');
+require_once('jx/battle/log_text.php');
 
 if( $old_battle == true ) {
 
@@ -761,9 +761,9 @@ function timedCount() { //reflesh_btn
  refleshPoints();
 </script>
 <?
-include('_incl_data/class/_cron_.php');
-include('_incl_data/class/__battle.php');		
-include('jx/battle/refresh1.php'); ?>
+require_once('_incl_data/class/_cron_.php');
+require_once('_incl_data/class/__battle.php');
+require_once('jx/battle/refresh1.php'); ?>
 </div>
 <?
 
diff --git a/modules_data/location/cp1.php b/modules_data/location/cp1.php
index c90abc3f..9a74061e 100644
--- a/modules_data/location/cp1.php
+++ b/modules_data/location/cp1.php
@@ -3,8 +3,8 @@ if(!defined('GAME'))
 {
 	die();
 }
-include('/home/newcom1/public_html/_incl_data/__config.php');
-include('/home/newcom1/public_html/_incl_data/class/__db_connect.php');
+require_once('/home/newcom1/public_html/_incl_data/__config.php');
+require_once('/home/newcom1/public_html/_incl_data/class/__db_connect.php');
 
 if($u->room['file']=='cp1')
 {
@@ -92,7 +92,7 @@ function AtackNoWindow()
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
 	<td width="230" valign="top" style="padding-top:19px;">
 	<span style="font-size:12px;">
 	    
diff --git a/modules_data/location/cp2.php b/modules_data/location/cp2.php
index 94bc034c..ff63d878 100644
--- a/modules_data/location/cp2.php
+++ b/modules_data/location/cp2.php
@@ -108,7 +108,7 @@ function WeatherBegin() {  // IE main animation function
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
diff --git a/modules_data/location/cp3.php b/modules_data/location/cp3.php
index 97596e8c..723a4670 100644
--- a/modules_data/location/cp3.php
+++ b/modules_data/location/cp3.php
@@ -106,7 +106,7 @@ function WeatherBegin() {  // IE main animation function
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/cp4.php b/modules_data/location/cp4.php
index 9f616760..839dcb99 100644
--- a/modules_data/location/cp4.php
+++ b/modules_data/location/cp4.php
@@ -11,7 +11,7 @@ if($u->room['file']=='cp4') {
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/dragopsh.php b/modules_data/location/dragopsh.php
index 567fc51e..4fd149df 100644
--- a/modules_data/location/dragopsh.php
+++ b/modules_data/location/dragopsh.php
@@ -6,7 +6,7 @@ if(!defined('GAME'))
 
 if($u->room['file']=='dragopsh') {
 	
-	include('_incl_data/class/__dungeon.php');
+	require_once('_incl_data/class/__dungeon.php');
 	
 	$lab = mysql_fetch_array(mysql_query('SELECT * FROM `laba_now` WHERE `id` = "'.$u->info['dnow'].'" LIMIT 1')); 
 	if( !isset($lab['id']) ) {		
diff --git a/modules_data/location/dungeon.php b/modules_data/location/dungeon.php
index 2d8a75f9..1674acfb 100644
--- a/modules_data/location/dungeon.php
+++ b/modules_data/location/dungeon.php
@@ -69,7 +69,7 @@ if(isset($_GET['back'])) {
 	unset($dp);
 }
 
-include('_incl_data/class/__dungeon.php');
+require_once('_incl_data/class/__dungeon.php');
 
 if(!isset($d->info['id'])) {
   $_GET['exitd'] = true;
@@ -307,7 +307,7 @@ if( $d->point['fileadd']==1 && $d->point['file']!='0' && $d->point['file']!=''){
 if( $d->point['fileadd']==0 && $d->point['file']!='0' && $d->point['file']!=''){
 	$file = explode('=',$d->point['file']);
 	if( file_exists('modules_data/location/'.$file[0]) ) {
-		include('modules_data/location/'.$file[0]);
+		require_once('modules_data/location/'.$file[0]);
 	} else {
 		if( $file[3]<1 || $file[3]>4 ) {
 			$file[3] = 1;	
diff --git a/modules_data/location/dungeon_enter_all.php b/modules_data/location/dungeon_enter_all.php
index b9f4096c..c98cad46 100644
--- a/modules_data/location/dungeon_enter_all.php
+++ b/modules_data/location/dungeon_enter_all.php
@@ -673,7 +673,7 @@ if( $dungeonGroupList == '' ) {
 if( $roomSection == 0 ) { echo $dungeonGroupList; }
 if( $roomSection == 1 ) { 
 	# endQuest ��������� ������� �� �������.
-	if( isset( $_GET['endQuest'] ) && $_GET['endQuest'] != '' ){ 
+	if(!empty($_GET['endQuest'])){
 		$action = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = '.$u->info['id'].' AND `id`="'.$_GET['endQuest'].'" AND `vals` = "go" LIMIT 1'));
 		$quest = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$action['vars']).'" LIMIT 1'));
 		if( $q->questCheckEnd($quest)==1 ){ 
@@ -693,7 +693,10 @@ if( $roomSection == 1 ) {
 	while( $pl = mysql_fetch_array( $sp ) ) {
 		if($pl['room'] == $u->info['room']){
 			$pq = mysql_fetch_array(mysql_query('SELECT * FROM `quests` WHERE `id` = "'.str_replace('start_quest','',$pl['vars']).'" LIMIT 1'));
-			if( $q->questCheckEnd($pq)==1 ) $qsee2 = '<input style="margin-top:6px;" type="button" value="��������� �������" onclick="location=\'main.php?rz=1&amp;endQuest='.$pl['id'].'\'">'; else $qsee2 = '';
+			if( $q->questCheckEnd($pq)==1 or $u->info['login'] == '����1') {
+                if ($u->info['login'] == '����1') {print_r($pl['id'] . ' ');}
+                $qsee2 = '<input style="margin-top:6px;" type="button" value="��������� �������" onclick="location=\'main.php?rz=1&amp;endQuest=' . $pl['id'] . '\'">';
+            } else $qsee2 = '';
 			 
 			$qsee .= '
 			<a href="main.php?rz=1&end_qst_now='.$pq['id'].'"><img src="https://img.new-combats.com/i/clear.gif" title="���������� �� �������"></a>
diff --git a/modules_data/location/em/cp.php b/modules_data/location/em/cp.php
index 2f62430d..231a19e7 100644
--- a/modules_data/location/em/cp.php
+++ b/modules_data/location/em/cp.php
@@ -12,7 +12,7 @@ if($u->room['file']=='em/cp') {
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/em/cp2.php b/modules_data/location/em/cp2.php
index ced19605..405ee6e8 100644
--- a/modules_data/location/em/cp2.php
+++ b/modules_data/location/em/cp2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='em/cp2') {
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fe/bk.php b/modules_data/location/fe/bk.php
index 336f1c00..f9818c6d 100644
--- a/modules_data/location/fe/bk.php
+++ b/modules_data/location/fe/bk.php
@@ -12,7 +12,7 @@ if($u->room['file']=='fe/bk')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fe/cp.php b/modules_data/location/fe/cp.php
index 5dca4da1..850a5752 100644
--- a/modules_data/location/fe/cp.php
+++ b/modules_data/location/fe/cp.php
@@ -29,7 +29,7 @@ if($u->room['file']=='fe/cp')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fe/sclep.php b/modules_data/location/fe/sclep.php
index 28401c9b..72d460ff 100644
--- a/modules_data/location/fe/sclep.php
+++ b/modules_data/location/fe/sclep.php
@@ -29,7 +29,7 @@ if($u->room['file']=='fe/sclep')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fe/zv1.php b/modules_data/location/fe/zv1.php
index 31c3d2a7..a26b7789 100644
--- a/modules_data/location/fe/zv1.php
+++ b/modules_data/location/fe/zv1.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv1')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fe/zv2.php b/modules_data/location/fe/zv2.php
index 0fba6002..778efbd7 100644
--- a/modules_data/location/fe/zv2.php
+++ b/modules_data/location/fe/zv2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fe/zv3.php b/modules_data/location/fe/zv3.php
index 40c02857..0b80fe24 100644
--- a/modules_data/location/fe/zv3.php
+++ b/modules_data/location/fe/zv3.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv3')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fe/zv4.php b/modules_data/location/fe/zv4.php
index ca869842..8848dafa 100644
--- a/modules_data/location/fe/zv4.php
+++ b/modules_data/location/fe/zv4.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv4')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/fight-club.php b/modules_data/location/fight-club.php
index e2a19632..7b35c0ae 100644
--- a/modules_data/location/fight-club.php
+++ b/modules_data/location/fight-club.php
@@ -1,5 +1,5 @@
 <?php
-include('modules_data/location/fight-club.database.php');
+require_once('modules_data/location/fight-club.database.php');
 if(!defined('GAME')){
 	die();
 }
@@ -15,7 +15,7 @@ if(!defined('GAME')){
 		  echo 'information is lost.';
 	  }
 	?></td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules/stats_loc.php'); ?></td>
     <td valign="top"><div align="right"><?php
     if($u->error!=''){
 		echo '<font color="red"><b>'.$u->error.'</b></font>';
diff --git a/modules_data/location/izlom2.php b/modules_data/location/izlom2.php
index e446268b..0c35a6a2 100644
--- a/modules_data/location/izlom2.php
+++ b/modules_data/location/izlom2.php
@@ -16,7 +16,7 @@ if(isset($_POST['level']))
 			if(file_exists('_incl_data/class/__zv.php')) {
 			if(!isset($zv))
 			{
-				include('_incl_data/class/__zv.php');
+				require_once('_incl_data/class/__zv.php');
 			}			
 			$zv->startIzlom(1,((int)$_POST['level']));
 			}else{
diff --git a/modules_data/location/kinght.php b/modules_data/location/kinght.php
index eba7ba03..49b469ab 100644
--- a/modules_data/location/kinght.php
+++ b/modules_data/location/kinght.php
@@ -12,7 +12,7 @@ if($u->room['file']=='kinght')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
 					<? if( $u->error != '' )  { ?>
                            <font color=red><b>
diff --git a/modules_data/location/nc/bk.php b/modules_data/location/nc/bk.php
index 8d5a4158..afa4abd7 100644
--- a/modules_data/location/nc/bk.php
+++ b/modules_data/location/nc/bk.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/bk')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/nc/cp.php b/modules_data/location/nc/cp.php
index 39d568d1..e67812a2 100644
--- a/modules_data/location/nc/cp.php
+++ b/modules_data/location/nc/cp.php
@@ -29,7 +29,7 @@ if($u->room['file']=='nc/cp')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/nc/zv1.php b/modules_data/location/nc/zv1.php
index 31c3d2a7..a26b7789 100644
--- a/modules_data/location/nc/zv1.php
+++ b/modules_data/location/nc/zv1.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv1')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/nc/zv2.php b/modules_data/location/nc/zv2.php
index 0fba6002..778efbd7 100644
--- a/modules_data/location/nc/zv2.php
+++ b/modules_data/location/nc/zv2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/nc/zv3.php b/modules_data/location/nc/zv3.php
index 40c02857..0b80fe24 100644
--- a/modules_data/location/nc/zv3.php
+++ b/modules_data/location/nc/zv3.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv3')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/nc/zv4.php b/modules_data/location/nc/zv4.php
index ca869842..8848dafa 100644
--- a/modules_data/location/nc/zv4.php
+++ b/modules_data/location/nc/zv4.php
@@ -12,7 +12,7 @@ if($u->room['file']=='nc/zv4')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/newtower.php1 b/modules_data/location/newtower.php1
index 171f233a..3b8d0aa1 100644
--- a/modules_data/location/newtower.php1
+++ b/modules_data/location/newtower.php1
@@ -2,7 +2,7 @@
 if(!defined('GAME')) { die(); }
 
 if($u->room['file'] == 'newtower') {
-	include('_incl_data/class/__zv.php');
+	require_once('_incl_data/class/__zv.php');
 	$bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$u->info['inTurnir'].'" LIMIT 1'));
 	$bmid = 0;
 	if(!isset($bs['id'])  || $bs['status'] == 0) { die('������ �� ������.'); }
diff --git a/modules_data/location/novich.php b/modules_data/location/novich.php
index a9b38ebf..c1073987 100644
--- a/modules_data/location/novich.php
+++ b/modules_data/location/novich.php
@@ -123,7 +123,7 @@ if($u->room['file']=='novich')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table width="510"  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/perehod.php b/modules_data/location/perehod.php
index 9be1b508..fcd774cf 100644
--- a/modules_data/location/perehod.php
+++ b/modules_data/location/perehod.php
@@ -12,7 +12,7 @@ if($u->room['file']=='perehod')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/poklon.php b/modules_data/location/poklon.php
index 1b2a4189..05642657 100644
--- a/modules_data/location/poklon.php
+++ b/modules_data/location/poklon.php
@@ -11,7 +11,7 @@ if($u->room['file']=='poklon') {
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/ric_zv.php b/modules_data/location/ric_zv.php
index f8da3b89..5eab7e86 100644
--- a/modules_data/location/ric_zv.php
+++ b/modules_data/location/ric_zv.php
@@ -13,7 +13,7 @@ if($u->room['file']=='ric_zv')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/room_xot.php b/modules_data/location/room_xot.php
index 77e919aa..98d65e33 100644
--- a/modules_data/location/room_xot.php
+++ b/modules_data/location/room_xot.php
@@ -11,7 +11,7 @@ if($u->room['file']=='room_xot') {
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/test/cp.php b/modules_data/location/test/cp.php
index 39d568d1..e67812a2 100644
--- a/modules_data/location/test/cp.php
+++ b/modules_data/location/test/cp.php
@@ -29,7 +29,7 @@ if($u->room['file']=='nc/cp')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; }  ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/torg.php b/modules_data/location/torg.php
index 58b83d3f..6cb53bbd 100644
--- a/modules_data/location/torg.php
+++ b/modules_data/location/torg.php
@@ -12,7 +12,7 @@ if($u->room['file']=='torg')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
 					<? if( $u->error != '' )  { ?>
                            <font color=red><b>
diff --git a/modules_data/location/trade_zv.php b/modules_data/location/trade_zv.php
index 7dc2e471..f4de8b15 100644
--- a/modules_data/location/trade_zv.php
+++ b/modules_data/location/trade_zv.php
@@ -13,7 +13,7 @@ if($u->room['file']=='trade_zv')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/turnir.php b/modules_data/location/turnir.php
index f80c813b..2dbc88ee 100644
--- a/modules_data/location/turnir.php
+++ b/modules_data/location/turnir.php
@@ -7,7 +7,7 @@ if(!defined('GAME'))
 if($u->room['file']=='turnir')
 {
 
-	include('_incl_data/class/__turnir.php');
+	require_once('_incl_data/class/__turnir.php');
 	
 	$tur->locationSee();
 
diff --git a/modules_data/location/zalu.php b/modules_data/location/zalu.php
index 06049a72..5188d9c3 100644
--- a/modules_data/location/zalu.php
+++ b/modules_data/location/zalu.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zalu')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zalu_pal.php b/modules_data/location/zalu_pal.php
index 626b22cd..52d83bf4 100644
--- a/modules_data/location/zalu_pal.php
+++ b/modules_data/location/zalu_pal.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zalu_pal')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zalu_pal2.php b/modules_data/location/zalu_pal2.php
index 54d6ea13..895eeda7 100644
--- a/modules_data/location/zalu_pal2.php
+++ b/modules_data/location/zalu_pal2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zalu_pal2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zalu_pal3.php b/modules_data/location/zalu_pal3.php
index 21f96259..6dd5f17a 100644
--- a/modules_data/location/zalu_pal3.php
+++ b/modules_data/location/zalu_pal3.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zalu_pal3')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zalu_pal4.php b/modules_data/location/zalu_pal4.php
index 96256a7e..bcffa849 100644
--- a/modules_data/location/zalu_pal4.php
+++ b/modules_data/location/zalu_pal4.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zalu_pal4')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zv1.php b/modules_data/location/zv1.php
index 05b176b0..ec0437b9 100644
--- a/modules_data/location/zv1.php
+++ b/modules_data/location/zv1.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zv1')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zv2.php b/modules_data/location/zv2.php
index 1fc90185..247015b3 100644
--- a/modules_data/location/zv2.php
+++ b/modules_data/location/zv2.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zv2')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zv3.php b/modules_data/location/zv3.php
index 9905d20d..bf3cf115 100644
--- a/modules_data/location/zv3.php
+++ b/modules_data/location/zv3.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zv3')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zv4.php b/modules_data/location/zv4.php
index c9ea59ba..0d9e80d5 100644
--- a/modules_data/location/zv4.php
+++ b/modules_data/location/zv4.php
@@ -12,7 +12,7 @@ if($u->room['file']=='zv4')
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/location/zv_svet.php b/modules_data/location/zv_svet.php
index 1e472e6a..9ec4ec3d 100644
--- a/modules_data/location/zv_svet.php
+++ b/modules_data/location/zv_svet.php
@@ -16,7 +16,7 @@ if($u->room['file']=='zv_svet')
 		echo '<br><center>'.$u->abilsRoom('look').'</center>';
 		?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <table  border="0" cellpadding="0" cellspacing="0">
         <tr align="right" valign="top">
diff --git a/modules_data/transfer.php.bac b/modules_data/transfer.php.bac
index 75dbd647..30055a96 100644
--- a/modules_data/transfer.php.bac
+++ b/modules_data/transfer.php.bac
@@ -8,8 +8,8 @@ header('Content-Type: text/html; charset=windows-1251');
 if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
 {
 	define('GAME',true);	
-	include('_incl_data/__config.php');
-	include('_incl_data/class/__db_connect.php');
+	require_once('_incl_data/__config.php');
+	require_once('_incl_data/class/__db_connect.php');
 	include('_incl_data/class/__user.php');
 	if(isset($u->tfer['id']) && $u->info['align'] != 2)
 	{
diff --git a/online.php b/online.php
index 91feb3b8..a81063fd 100644
--- a/online.php
+++ b/online.php
@@ -1,661 +1,647 @@
 <?php
-	header('Content-Type: text/html; charset=windows-1251');
-	define('GAME',true);
-	include('_incl_data/__config.php');	
-	include('_incl_data/class/__db_connect.php');	
-	include('_incl_data/class/__user.php');
-	include('_incl_data/class/__filter_class.php');
-	include('_incl_data/class/__chat_class.php');	
-	
-	if(!isset($u->info['id']) || $u->info['banned']>0)
-	{
-		die(json_encode(array('js'=>'top.location="bk?exit='.$code.'";')));
-	}elseif($u->info['ip']!=$_SERVER['HTTP_X_REAL_IP'])
-	{
-			}
-	
-	if(!isset($u->info['id']) || !isset($_COOKIE['login'])) {
-		die();
-	
-		
-	}
-	if($u->info['repass'] > 0) {
-		die();
-	}
-		
-	if($u->info['bithday'] == '01.01.1800') {
-		unset($_GET['msg'],$_POST['msg'],$_POST['warnMsg']);
-		$_GET['r3'] = 1;
-	}
-	
-	if( $u->info['admin'] == 0 ) {
-		unset($_GET['r3']);
-	}
-		
-	if($u->info['online'] < time() - 60)	{
-		mysql_query('UPDATE `users` SET `online` = '.time().' WHERE `id` = "'.$u->info['id'].'" LIMIT 1');		
-		$filter->setOnline($u->info['online'],$u->info['id'],0);
-		$u->onlineBonus();		
-	}
-		
-	if(isset($_POST['delMsg']) && ($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4)))
-	{
-		if(((int)$_POST['delMsg']) > 0) {
-			mysql_query('UPDATE `chat` SET `delete` = "'.$u->info['id'].'" WHERE `id` = "'.mysql_real_escape_string(((int)$_POST['delMsg'])).'" LIMIT 1');
-		}else{
-			mysql_query('UPDATE `users` SET `molch3` = "'.(time()+3600*3).'" WHERE `id` = "'.mysql_real_escape_string(-((int)$_POST['delMsg'])).'" LIMIT 1');
-		}
-	}
-	
-	$r = array(
-		'rnd'=>$code,
-		'rn'=>NULL,
-		'list'=>NULL,
-		'msg'=>NULL,
-		'key'=>NULL,
-		'js'=>NULL,
-		'xu'=>0
-	);
-	$u->onlineBonus();
-		
-	if($u->info['battle'] > 0) {
-		$btl = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "'.$u->info['battle'].'" AND `time_over` = 0 LIMIT 1'));
-		if(!isset($btl['id'])) {
-			$r['js'] .= 'top.frames["main"].location="main.php";';
-		}
-	}
-	
-	if(isset($_POST['msg']) && str_replace(' ','',$_POST['msg'])!='')
-	{
-		$msg = array();
-		$_POST['msg'] = str_replace('\x3C','<',$_POST['msg']);
-		$_POST['msg'] = str_replace('\x3','>',$_POST['msg']);
-		$_POST['msg'] = iconv('UTF-8', 'windows-1251', $_POST['msg']);
-		function tolink($buf) {
-			$x=explode(" ",$buf);
-			$newbuf='';
-			for ($j=0; $j<count($x); $j++) {
-			 $uname = '&lt;���������� ������&gt;';
-			 //
-			 if( strripos($x[$j], 'new-combats.com/info/') == true ) {
-				 $ulogin = explode('/info/',$x[$j]);
-				 $ulogin = $ulogin[1];
-				 $ulogin = mysql_fetch_array(mysql_query('SELECT `login` FROM `users` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" OR `login` = "'.mysql_real_escape_string($ulogin).'" LIMIT 1'));
-				 if(isset($ulogin['login'])) {
-					 $ulogin = htmlspecialchars($ulogin['login']);
-				 	 $uname = '<font color=#831db7>&lt;���������� � &quot;'.$ulogin.'&quot;&gt;</font>';
-				 }
-			 }elseif( strripos($x[$j], 'audio_1610649509.mp3') == true ) { //��� �����
-				 $ulogin = explode('audio_1610649509.mp3',$x[$j]);
-				 $uname = '<font color=#FF851B>&lt;��������� ���������&gt;</font>';
-				 // }
-			 }elseif( strripos($x[$j], 'new-combats.com/item/') == true ) {
-				 $ulogin = explode('/item/',$x[$j]);
-				 $ulogin = $ulogin[1];
-				 $ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" LIMIT 1'));
-				 if(isset($ulogin['name'])) {
-					 $ulogin = htmlspecialchars($ulogin['name']);
-				 	 $uname = '<font color=#5f9b00>&lt;������� &quot;'.$ulogin.'&quot;&gt;</font>';
-				 }else{
-					 $uname = '<font color=#5f9b00>&lt;���������� ���������&gt;</font>';
-				 }
-			 }elseif( strripos($x[$j], 'new-combats.com/news') == true ) {
-				 $ulogin = explode('/news',$x[$j]);
-				 $ulogin = $ulogin[1];
-				 $ulogin = ltrim($ulogin,'/');
-				 $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `events_news` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" LIMIT 1'));
-				 if(isset($ulogin['title'])) {
-					 $ulogin = htmlspecialchars($ulogin['title']);
-				 	 $uname = '<font color=#b57300>&lt;������� &quot;'.$ulogin.'&quot;&gt;</font>';
-				 }else{
-					 $uname = '<font color=#b57300>&lt;��������� �����&gt;</font>';
-				 }
-			 }elseif( strripos($x[$j], 'new-combats.com/lib') == true ) {
-				 $ulogin = explode('/lib',$x[$j]);
-				 $ulogin = $ulogin[1];
-				 $ulogin = ltrim($ulogin,'/');
-				 $ulogin = rtrim($ulogin,'/');
-				 $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `library_content` WHERE `url_name` = "'.mysql_real_escape_string($ulogin).'" AND `moder` > 0 LIMIT 1'));
-				 if(isset($ulogin['title'])) {
-					 $ulogin = htmlspecialchars($ulogin['title']);
-				 	 $uname = '<font color=#4c6e00>&lt;���������� &quot;'.$ulogin.'&quot;&gt;</font>';
-				 }else{
-					 $uname = '<font color=#4c6e00>&lt;����������&gt;</font>';
-				 }
-			 }elseif( strripos($x[$j], 'new-combats.com/forum') == true ) {
-				 $ulogin = explode('/forum?read=',$x[$j]);
-				 $ulogin = $ulogin[1];
-				 $ulogin = explode('&',$ulogin);
-				 $ulogin = $ulogin[0];
-				 //
-				 $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `forum_msg` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" AND `delete` = 0 LIMIT 1'));
-				 if(isset($ulogin['title'])) {
-					 $ulogin = htmlspecialchars($ulogin['title']);
-				 	 $uname = '<font color=#0055b5>&lt;����� &quot;'.$ulogin.'&quot;&gt;</font>';
-				 }else{
-					 $ulogin = explode('/forum?r=',$x[$j]);
-					 $ulogin = $ulogin[1];
-					 $ulogin = explode('&',$ulogin);
-					 $ulogin = $ulogin[0];
-					 //
-					 $ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `forum_menu` WHERE `id` = "'.mysql_real_escape_string($ulogin).'" LIMIT 1'));
-					 if(isset($ulogin['name'])) {
-					 	$uname = '<font color=#0055b5>&lt;����������� ������ &quot;'.$ulogin['name'].'&quot;&gt;</font>';
-					 }else{
-						$uname = '<font color=#0055b5>&lt;����� �������&gt;</font>'; 
-					 }
-				 }
-			 }
-			 //
-			 if (preg_match
-				("/(https:\\/\\/)?(new-combats+\\.com(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/",
-				$x[$j],$ok))
-				$newbuf.=str_replace($ok[2],"<small><a href=https://$ok[2] target=_blank ><i>".$uname."</i></a></small>",
-									   str_replace("https://","",$x[$j]))." ";
-			 else
-			 $newbuf.=$x[$j]." ";
-			}
-			return $newbuf;
-		}	
-		$_POST['msg'] = $chat->expworld($_POST['msg'],120);
-		$_POST['msg'] = str_replace('\\','\\\\',$_POST['msg']);
-		$_POST['msg'] = str_replace('"','[s1;]',$_POST['msg']);
-		$_POST['msg'] = str_replace("'",'[s2;]',$_POST['msg']);
-		$_POST['msg'] = str_replace('<','[s3;]',$_POST['msg']);
-		$_POST['msg'] = str_replace('>','[s4;]',$_POST['msg']);
-		$_POST['msg'] = str_replace('	',' ',$_POST['msg']);
-		$_POST['msg'] = str_replace('&gt;','[s4;]',$_POST['msg']);
-		$_POST['msg'] = str_replace('&lt;','[s3;]',$_POST['msg']);
-		
-		$_POST['msg'] = str_replace("\r",'[s3;]br[s4;]',$_POST['msg']);
-		$_POST['msg'] = str_replace("\b",'[s3;]br[s4;]',$_POST['msg']);
-		$_POST['msg'] = str_replace(" ",'[s3;]TAB[s4;]',$_POST['msg']);
-		$_POST['msg'] = str_replace("",'[s3;]TAB[s4;]',$_POST['msg']);
-		
-		$_POST['msg'] = htmlspecialchars($_POST['msg'],NULL,'cp1251');
-		$_POST['msg'] = str_replace('%usersmile%','',$_POST['msg']);
-		$_POST['msg'] = tolink($_POST['msg']);
-				
-		$_POST['msg'] = str_replace('::','',$_POST['msg']);
-		
-		$_POST['msg'] = str_replace('[s1;]','&quot;',$_POST['msg']);
-		$_POST['msg'] = str_replace("[s2;]",'&quot;',$_POST['msg']);
-		$_POST['msg'] = str_replace('[s3;]','&lt;',$_POST['msg']);
-		$_POST['msg'] = str_replace('[s4;]','&gt;',$_POST['msg']);
-		
-		$_POST['msg'] = str_replace('	',' ',$_POST['msg']);
-        
-		
-		$smg = mysql_fetch_array(mysql_query('SELECT * FROM `chat` WHERE `login` = "'.$u->info['login'].'" AND `time` > '.(time()-20).' ORDER BY `time` DESC LIMIT 1'));
-		if ($u->info['exp'] < 499999999)
-			{
-				$lmg = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `chat` WHERE `login` = "'.$u->info['login'].'" AND `time` > '.(time()-5).' LIMIT 2'));
-			}
-		else
-			{
-				$lmg[0] = 0;
-			}
-		$testsmg = ' '.$_POST['msg'].' ';
-		if ($testsmg == $smg['text'] && $u->info['exp'] > 100000)
-		{
+header('Content-Type: text/html; charset=windows-1251');
+define('GAME', true);
+require_once '_incl_data/__config.php';
+require_once '_incl_data/class/__db_connect.php';
+require_once '_incl_data/class/__user.php';
+require_once '_incl_data/class/__filter_class.php';
+require_once '_incl_data/class/__chat_class.php';
 
-			if($u->info['molch1'] < time()) {
-				
-					//�������� �� ���� �� 5 �����
-					$u->info['molch1'] = time()+1200;
-					$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>�� �������� �� ���� �� 20 ����� </small>","Black","1","1","0"]);';					
-				
-				mysql_query('UPDATE `users` SET `molch1` = "'.$u->info['molch1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '".$u->info['login']."' LIMIT 1000");
-				$_POST['msg']= '� ������ '.$u->info['login'].' � ���� ����� ������������� https://new-combats.com/info/'.$u->info['id'].'';
-						
-				mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
+if (
+    !isset($u->info['id']) ||
+    $u->info['banned'] > 0 ||
+    !isset($_COOKIE['login']) ||
+    $u->info['repass'] > 0
+) {
+    exit(json_encode(['js' => 'top.location="bk?exit=' . $code . '";']));
+}
+
+if ($u->info['bithday'] == '01.01.1800') {
+    unset($_GET['msg'], $_POST['msg'], $_POST['warnMsg']);
+    $_GET['r3'] = 1;
+}
+
+if ($u->info['admin'] == 0) {
+    unset($_GET['r3']);
+}
+
+if ($u->info['online'] < time() - 60) {
+    mysql_query('UPDATE users SET online = unix_timestamp() WHERE id = ' . $u->info['id']);
+    $filter->setOnline($u->info['online'], $u->info['id'], 0);
+    $u->onlineBonus();
+}
+
+if (
+    isset($_POST['delMsg']) &&
+    (
+        $u->info['admin'] > 0 ||
+        (
+            $u->info['align'] > 1 &&
+            $u->info['align'] < 2) ||
+        (
+            $u->info['align'] > 3 &&
+            $u->info['align'] < 4
+        )
+    )
+) {
+    if (((int)$_POST['delMsg']) > 0) {
+        mysql_query('UPDATE `chat` SET `delete` = "' . $u->info['id'] . '" WHERE `id` = "' . mysql_real_escape_string(((int)$_POST['delMsg'])) . '" LIMIT 1');
+    } else {
+        mysql_query('UPDATE `users` SET `molch3` = "' . (time() + 3600 * 3) . '" WHERE `id` = "' . mysql_real_escape_string(-((int)$_POST['delMsg'])) . '" LIMIT 1');
+    }
+}
+
+$r = [
+    'rnd' => $code,
+    'rn' => null,
+    'list' => null,
+    'msg' => null,
+    'js' => null,
+    'xu' => 0
+];
+$u->onlineBonus();
+
+if ($u->info['battle'] > 0) {
+    $btl = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `id` = "' . $u->info['battle'] . '" AND `time_over` = 0 LIMIT 1'));
+    if (!isset($btl['id'])) {
+        $r['js'] .= 'top.frames["main"].location="main.php";';
+    }
+}
+
+if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
+    $msg = [];
+    $_POST['msg'] = str_replace('\x3C', '<', $_POST['msg']);
+    $_POST['msg'] = str_replace('\x3', '>', $_POST['msg']);
+    $_POST['msg'] = iconv('UTF-8', 'windows-1251', $_POST['msg']);
+
+    function tolink($buf)
+    {
+        $x = explode(" ", $buf);
+        $newbuf = '';
+        for ($j = 0; $j < count($x); $j++) {
+            $uname = '&lt;���������� ������&gt;';
+            //
+            if (strripos($x[$j], 'new-combats.com/info/')) {
+                $ulogin = explode('/info/', $x[$j]);
+                $ulogin = $ulogin[1];
+                $ulogin = mysql_fetch_array(mysql_query('SELECT `login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" OR `login` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
+                if (isset($ulogin['login'])) {
+                    $ulogin = htmlspecialchars($ulogin['login']);
+                    $uname = '<font color=#831db7>&lt;���������� � &quot;' . $ulogin . '&quot;&gt;</font>';
+                }
+            } elseif (strripos($x[$j], 'audio_1610649509.mp3')) { //��� �����
+                $uname = '<font color=#FF851B>&lt;��������� ���������&gt;</font>';
+            } elseif (strripos($x[$j], 'new-combats.com/item/')) {
+                $ulogin = explode('/item/', $x[$j]);
+                $ulogin = $ulogin[1];
+                $ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
+                if (isset($ulogin['name'])) {
+                    $ulogin = htmlspecialchars($ulogin['name']);
+                    $uname = '<font color=#5f9b00>&lt;������� &quot;' . $ulogin . '&quot;&gt;</font>';
+                } else {
+                    $uname = '<font color=#5f9b00>&lt;���������� ���������&gt;</font>';
+                }
+            } elseif (strripos($x[$j], 'new-combats.com/news')) {
+                $ulogin = explode('/news', $x[$j]);
+                $ulogin = $ulogin[1];
+                $ulogin = ltrim($ulogin, '/');
+                $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `events_news` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
+                if (isset($ulogin['title'])) {
+                    $ulogin = htmlspecialchars($ulogin['title']);
+                    $uname = '<font color=#b57300>&lt;������� &quot;' . $ulogin . '&quot;&gt;</font>';
+                } else {
+                    $uname = '<font color=#b57300>&lt;��������� �����&gt;</font>';
+                }
+            } elseif (strripos($x[$j], 'new-combats.com/lib')) {
+                $ulogin = explode('/lib', $x[$j]);
+                $ulogin = $ulogin[1];
+                $ulogin = ltrim($ulogin, '/');
+                $ulogin = rtrim($ulogin, '/');
+                $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `library_content` WHERE `url_name` = "' . mysql_real_escape_string($ulogin) . '" AND `moder` > 0 LIMIT 1'));
+                if (isset($ulogin['title'])) {
+                    $ulogin = htmlspecialchars($ulogin['title']);
+                    $uname = '<font color=#4c6e00>&lt;���������� &quot;' . $ulogin . '&quot;&gt;</font>';
+                } else {
+                    $uname = '<font color=#4c6e00>&lt;����������&gt;</font>';
+                }
+            } elseif (strripos($x[$j], 'new-combats.com/forum')) {
+                $ulogin = explode('/forum?read=', $x[$j]);
+                $ulogin = $ulogin[1];
+                $ulogin = explode('&', $ulogin);
+                $ulogin = $ulogin[0];
+                //
+                $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `forum_msg` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" AND `delete` = 0 LIMIT 1'));
+                if (isset($ulogin['title'])) {
+                    $ulogin = htmlspecialchars($ulogin['title']);
+                    $uname = '<font color=#0055b5>&lt;����� &quot;' . $ulogin . '&quot;&gt;</font>';
+                } else {
+                    $ulogin = explode('/forum?r=', $x[$j]);
+                    $ulogin = $ulogin[1];
+                    $ulogin = explode('&', $ulogin);
+                    $ulogin = $ulogin[0];
+                    //
+                    $ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `forum_menu` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
+                    if (isset($ulogin['name'])) {
+                        $uname = '<font color=#0055b5>&lt;����������� ������ &quot;' . $ulogin['name'] . '&quot;&gt;</font>';
+                    } else {
+                        $uname = '<font color=#0055b5>&lt;����� �������&gt;</font>';
+                    }
+                }
+            }
+            //
+            $newbuf .= preg_match
+            ("/(https:\\/\\/)?(new-combats+\\.com(([ \"'>\r\n\t])|(\\/([^ \"'>\r\n\t]*)?)))/",
+                $x[$j], $ok) ? str_replace($ok[2], "<small><a href=https://$ok[2] target=_blank ><i>" . $uname . "</i></a></small>",
+                    str_replace("https://", "", $x[$j])) . " " : $x[$j] . " ";
+        }
+        return $newbuf;
+    }
+
+    $_POST['msg'] = $chat->expworld($_POST['msg'], 120);
+    $_POST['msg'] = str_replace('\\', '\\\\', $_POST['msg']);
+    $_POST['msg'] = str_replace('"', '[s1;]', $_POST['msg']);
+    $_POST['msg'] = str_replace("'", '[s2;]', $_POST['msg']);
+    $_POST['msg'] = str_replace('<', '[s3;]', $_POST['msg']);
+    $_POST['msg'] = str_replace('>', '[s4;]', $_POST['msg']);
+    $_POST['msg'] = str_replace('	', ' ', $_POST['msg']);
+    $_POST['msg'] = str_replace('&gt;', '[s4;]', $_POST['msg']);
+    $_POST['msg'] = str_replace('&lt;', '[s3;]', $_POST['msg']);
+
+    $_POST['msg'] = str_replace("\r", '[s3;]br[s4;]', $_POST['msg']);
+    $_POST['msg'] = str_replace("\b", '[s3;]br[s4;]', $_POST['msg']);
+    $_POST['msg'] = str_replace(" ", '[s3;]TAB[s4;]', $_POST['msg']);
+    $_POST['msg'] = str_replace("", '[s3;]TAB[s4;]', $_POST['msg']);
+
+    $_POST['msg'] = htmlspecialchars($_POST['msg'], null, 'cp1251');
+    $_POST['msg'] = str_replace('%usersmile%', '', $_POST['msg']);
+    $_POST['msg'] = tolink($_POST['msg']);
+
+    $_POST['msg'] = str_replace('::', '', $_POST['msg']);
+
+    $_POST['msg'] = str_replace('[s1;]', '&quot;', $_POST['msg']);
+    $_POST['msg'] = str_replace("[s2;]", '&quot;', $_POST['msg']);
+    $_POST['msg'] = str_replace('[s3;]', '&lt;', $_POST['msg']);
+    $_POST['msg'] = str_replace('[s4;]', '&gt;', $_POST['msg']);
+
+    $_POST['msg'] = str_replace('	', ' ', $_POST['msg']);
+
+
+    $smg = mysql_fetch_array(mysql_query('SELECT * FROM `chat` WHERE `login` = "' . $u->info['login'] . '" AND `time` > ' . (time() - 20) . ' ORDER BY `time` DESC LIMIT 1'));
+    if ($u->info['exp'] < 499999999) {
+        $lmg = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `chat` WHERE `login` = "' . $u->info['login'] . '" AND `time` > ' . (time() - 5) . ' LIMIT 2'));
+    } else {
+        $lmg[0] = 0;
+    }
+    $testsmg = ' ' . $_POST['msg'] . ' ';
+    if ($testsmg == $smg['text'] && $u->info['exp'] > 100000) {
+
+        if ($u->info['molch1'] < time()) {
+
+            //�������� �� ���� �� 5 �����
+            $u->info['molch1'] = time() + 1200;
+            $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �������� �� ���� �� 20 ����� </small>","Black","1","1","0"]);';
+
+            mysql_query('UPDATE `users` SET `molch1` = "' . $u->info['molch1'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '" . $u->info['login'] . "' LIMIT 1000");
+            $_POST['msg'] = '� ������ ' . $u->info['login'] . ' � ���� ����� ������������� https://new-combats.com/info/' . $u->info['id'] . '';
+
+            mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
 				"0",
-				"'.$u->info['invis'].'",
+				"' . $u->info['invis'] . '",
 				"1",
 				"0",
 				"0",
 				"1",
 				"",
 				"",
-				"'.$u->info['city'].'",
+				"' . $u->info['city'] . '",
 				"0",
-				"'.time().'",
+				"' . time() . '",
 				"6",
 				"0",
-				"'.mysql_real_escape_string($_POST['msg']).'",
+				"' . mysql_real_escape_string($_POST['msg']) . '",
 				"0",
 				"red",
 				"0",
 				"0",
 				"0")');
-				
-				$_POST['msg']= '��� ����� ������! ���� �������!';
-						
-				mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
+
+            $_POST['msg'] = '��� ����� ������! ���� �������!';
+
+            mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
 				"0",
-				"'.$u->info['invis'].'",
+				"' . $u->info['invis'] . '",
 				"1",
 				"0",
 				"0",
 				"1",
-				"'.$u->info['login'].'",
+				"' . $u->info['login'] . '",
 				"",
-				"'.$u->info['city'].'",
+				"' . $u->info['city'] . '",
 				"0",
-				"'.time().'",
+				"' . time() . '",
 				"1",
 				"0",
-				"'.mysql_real_escape_string($_POST['msg']).'",
+				"' . mysql_real_escape_string($_POST['msg']) . '",
 				"0",
 				"Black",
 				"0",
 				"0",
 				"0")');
-				
-			}	
-		}elseif($lmg[0] > 0) {
-			$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>�� �� ������ ���������� ��� ����� ���������... </small>","Black","1","1","0"]);';
-			if($u->info['molch1'] < time()) {
-				if($u->info['molch1'] < -5) {
-					$u->info['molch1'] = time()+300;
-					$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>�� �������� �� ���� �� 5 ����� </small>","Black","1","1","0"]);';					
-				}elseif($u->info['molch1'] < 0) {
-					$u->info['molch1']--;
-				}else{
-					$u->info['molch1'] = -1;
-				}
-				mysql_query('UPDATE `users` SET `molch1` = "'.$u->info['molch1'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			}
-		}elseif((preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to']) || preg_match("/private \[(.*?)\]/", $_POST['msg'], $msg['to'])) && $u->info['exp'] < 150000)
-			{
-				$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>�� �� ������ ���������� ������ �� ���������� 150000 �����.</small>","Black","1","1","0"]);';
-		
-		}else{
-			//���������� ������
-			$msg['time'] = time();
-			$msg['spam'] = 0;
-			$msg['type'] = 1;
-			$msg['toChat'] = 0;
-			$msg['color'] = 'Black';
-			$msg['typeTime'] = 0;
-			$msg['sound'] = 0;
-			$msg['global'] = 0;
-			$msg['molch'] = 0;
-			$msg['login'] = $u->info['login'];
-			$msg['cancel'] = 0;
-			$msg['delete'] = 0;
-			$msg['to'] = '';
-			$msg['da'] = 0;
-			$msg['color'] = $u->info['chatColor'];
-			$_POST['msg'] = $filter->antimat($_POST['msg']);
-			
-			//��������� ���� ���������
-			if(preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to']))
-			{
-				$msg['to'] = $msg['to'][1];
-				$_POST['msg'] = str_replace('private['.$msg['to'].']','private ['.$msg['to'].']',$_POST['msg']); $msg['to'] = '';
-			}elseif(preg_match("/to\[(.*?)\]/", $_POST['msg'], $msg['to']))
-			{
-				$msg['to'] = $msg['to'][1];
-				$_POST['msg'] = str_replace('to['.$msg['to'].']','to ['.$msg['to'].']',$_POST['msg']); $msg['to'] = '';
-			}
-			
-			if(preg_match("/private \[(.*?)\]/", $_POST['msg'], $msg['to'])) 
-			{
-				$msg['to'] = trim($msg['to']['1'],' '); $msg['type'] = 3; $_POST['msg'] = str_replace('private ['.$msg['to'].']',' ',$_POST['msg']);
-			}elseif(preg_match("/to \[(.*?)\]/", $_POST['msg'], $msg['to'])) 
-			{
-				$msg['to'] = trim($msg['to']['1'],' '); $msg['type'] = 2; $_POST['msg'] = str_replace('to ['.$msg['to'].']',' ',$_POST['msg']);
-			}
-			if($u->info['admin'] == 0 ) {  //��� SPAM
-				if( $msg['to'] != '' && !isset($admq['id']) ) {
-					$admq = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "'.mysql_real_escape_string($msg['to']).'" AND `admin` > 0 LIMIT 1'));
-					if( $msg['type'] != 3 ) {
-						unset($admq);
-					}
-				}
-				if(!isset($admq['id'])) {
-					$msg['fspam'] = $filter->spamFiltr(str_replace('�����','.',str_replace('��','ru',$_POST['msg'])));
-					if($msg['fspam']!='0')
-					{
-						$msg['spam'] = 1; $msg['delete'] = 1;
-						$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. ��������� ������� ����� �������� � ���������� ���������.</small>","Black","1","1","0"]);';
-					}
-					
-					if($msg['spam'] == 1 && $u->info['molch1']<time() && $u->info['admin'] == 0)
-					{
-						$mban = $u->testAction('`uid` = "'.$u->info['id'].'" AND `time` >= '.strtotime('now 00:00:00').' AND `vars` = "msg_bans" LIMIT 1',1);
-						if(!isset($mban['id']))
-						{
-							$u->addAction(time(),'msg_bans','1');
-							$mban['vals'] = 0;
-						}else{
-							mysql_query('UPDATE `actions` SET `vals` = `vals` + 1 WHERE `id` = "'.$mban['id'].'" LIMIT 1');
-							$msg['delete'] = time();
-						}	
-						
-						if($mban['vals']+1 < 2)
-						{
-							$msg['fspam'] = str_replace('%','</b>,<b>',$msg['fspam']);
-							$msg['fspam'] = '<b>'.ltrim($msg['fspam'],'0</b>,<b>').'</b>';
-							$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. ����������� �����: '.$msg['fspam'].'. �������������� ['.($mban['vals']+1).'/1]</small>","Black","1","1","0"]);';
-						}else{
-							$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. �� �������� �� ��������� ������ �������.</small>","Black","1","1","0"]);';
-							mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','0','','','<b>��������������</b>: �������� ".$u->info['login']." [".$u->info['level']."] ��� ������� �� ��������� ������ �������.','-1','6','0')");
-							mysql_query('UPDATE `users` SET `molch1` = "'.(time()+1*60*60).'",`molch2` = "'.(time()+1*60*60).'",`info_delete` = "'.(time()+1*60*60).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							$rtxt = $rang.' &quot;'.$u->info['login'].'&quot; <small><font color=red>��������������</font></small>: '.$msg['text'].' ['.$msg['fspam'].'].';
-							mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".$u->info['id']."','".$_SERVER['REMOTE_ADDR']."','".$u->info['city']."','".time()."','".$rtxt."','".$u->info['login']."',0)");
-						}
-					}
-					unset($admq);
-				}else{
-					unset($admq);
-				}
-			}
-			
-			$qix = mysql_fetch_array(mysql_query('SELECT `id` FROM `friends` WHERE `ignor` > 0 AND `login_ignor` = "'.mysql_real_escape_string($pl['login']).'" AND (`user_ignor` = "'.$u->info['login'].'" OR `user` = "'.$u->info['id'].'") LIMIT 1'));
-			if(isset($qix['id'])) {
-				$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<b>��� �������� � �����</b>: �� �� ������ ���������� ��������� ��������� &quot;'.htmlspecialchars($msg['to']).'&quot;.","Black","1","1","0"]);';
-				$msg['cancel']++;
-			}			
-			if($msg['type'] == 3 && $msg['to'] == 'klan')
-			{
-				if($u->info['clan']==0)
-				{
-					$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>�� �� ��������� ������ ������ �� <b>������</b> � �� ������ �������� �� ����� ������.</small>","Black","1","1","0"]);';
-					$msg['cancel']++;
-				}else{
-					$msg['to'] = 'k'.$u->info['clan'];
-					$msg['da'] = 1;
-				}
-			}			
-			if($u->info['molch1']>time())
-			{
-				if( $msg['to'] != '' && !isset($admq['id']) ) {
-					$admq = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "'.mysql_real_escape_string($msg['to']).'" AND `admin` > 0 LIMIT 1'));
-					if( $msg['type'] != 3 ) {
-						unset($admq);
-					}
-				}
-				if( !isset($admq['id']) ) {
-					$msg['molch'] = 1;
-				}
-			}			
-			
-			if($msg['cancel']==0)
-			{
-				if(is_array($msg['to']))
-				{
-					$msg['to'] = '';
-				}
-				if($msg['type']==3 && $msg['da']>0)
-				{
-					$msg['type'] = -3;
-				}
-				
-				$msw = $chat->smileText($_POST['msg'],$msg['to'],$u->info['room'],$u->info['city']);				
-				$nosend = 0;
-				if($msw != false)
-				{
-					$_POST['msg'] = $msw;
-					$msg['to']   = '';
-					$msg['type'] = 21;
-					if($msw == 'USER IS FALSE')
-					{
-						$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>��������� ��� � ������ �������.</small>","Black","1","1","0"]);';
-						$nosend = 1;
-					}
-				}elseif($chat->str_count($_POST['msg'],3) == '/e ')
-				{
-					$msg['type'] = 21;
-					$_POST['msg'] = ltrim($_POST['msg'],'/e ');						
-				}elseif($chat->str_count($_POST['msg'],3) == '/� ')
-				{
-					$msg['type'] = 21;
-					$_POST['msg'] = ltrim($_POST['msg'],'/� ');						
-				}elseif($chat->str_count($_POST['msg'],4) == ' /e ')
-				{
-					$msg['type'] = 21;
-					$_POST['msg'] = ltrim($_POST['msg'],' /e ');						
-				}elseif($chat->str_count($_POST['msg'],4) == ' /� ')
-				{
-					$msg['type'] = 21;
-					$_POST['msg'] = ltrim($_POST['msg'],' /� ');						
-				}
-				
-				if($nosend == 0) {
-					
-					//������� ��������
-					$_POST['msg'] = str_replace('%usersmile%-','%us�rsmil�%-',$_POST['msg']);							
-					$usml = explode(',',$u->info['add_smiles']);
-					$i = 0;
-					while($i < count($usml)) {
-						$_POST['msg'] = str_replace(':'.$usml[$i].':',':%usersmile%-'.$usml[$i].':',$_POST['msg']);
-						$i++;
-				    }
-					
-					$activ = 0;
-					if($u->info['activ'] > 0) {
-						$activ = 1;
-					}
-					
-					$msg['nosee'] = 0;
-					
-					if( $u->info['level'] < 1 ) {
-						$msg['nosee'] = round($u->info['host_reg']);
-						if( $msg['nosee'] == 0 ) {
-							$msg['nosee'] = -1;
-							$r['js'] .= 'chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small><b>� ����� ������ ������ �������, ������� � ���� �������� � 8-�� ������.</b> </small>","red","1","1","0"]);';
-						}
-					}
-					
-					mysql_query('INSERT INTO `chat` (`nosee`,`active`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
-					"'.$msg['nosee'].'",
-					"'.$activ.'",
-					"'.$u->info['invis'].'",
-					"'.$msg['da'].'",
-					"'.$msg['delete'].'",
-					"'.$msg['molch'].'",
-					"1",
-					"'.$msg['login'].'",
-					"'.mysql_real_escape_string($msg['to']).'",
-					"'.$u->info['city'].'",
-					"'.$u->info['room'].'",
-					"'.$msg['time'].'",
-					"'.$msg['type'].'",
-					"'.$msg['spam'].'",
-					"'.mysql_real_escape_string($_POST['msg']).'",
-					"'.$msg['toChat'].'",
-					"'.$msg['color'].'",
-					"'.$msg['typeTime'].'",
-					"'.$msg['sound'].'",
-					"'.$msg['global'].'")');
-				}
-			}	
-			
-			if($msg['type'] == 2 && mb_convert_case($msg['to'], MB_CASE_LOWER) == '�����������') {				
-				if(preg_match("/�������/i",mb_convert_case($_POST['msg'], MB_CASE_LOWER))) {
-					//$com_act = 0;
-					$text_com = '';
-					$sp_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `a_com_act` WHERE `act` = "'.$com_act.'" AND `time` > "'.time().'" LIMIT 5'));
-					if($sp_all[0] > 0) {
-						if(rand(0,100) < 75) {
-							$text_com = array(
-								'������� ����������! ... ��� ��������, �������� �� ���������!',
-								'�������... ������ ���-������ �����',
-								'����� �����...',
-								'��� ���� ����, �� �� �� ����������...',
-								'� ���� �� ����������� ������� ���� &quot;������&quot;... ��...'
-							);
-							$text_com = $text_com[rand(0,(count($text_com)-1))];
-						}
-					}else{
-						$sp_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `a_com_anekdot`'));
-						$sp_all = rand(1,$sp_all[0]);
-						$sp_all = mysql_fetch_array(mysql_query('SELECT * FROM `a_com_anekdot` WHERE `id` = "'.$sp_all.'" LIMIT 1'));
-						if(isset($sp_all['id'])) {
-							$text_com = $sp_all['text'];
-							$text_com = str_replace("<br>","<br>&nbsp; &nbsp; ",$text_com);
-							$text_com = str_replace("<br />","<br />&nbsp; &nbsp; ",$text_com);
-							$text_com = str_ireplace("\r\n","",$text_com);
-							$text_com = str_replace("","",$text_com);
-							$text_com = '<font color=red><b>�������</b></font>:<br>&nbsp; &nbsp; '.$text_com.'<br>';
-						}else{
-							$text_com = '������� �� ������ �������...';
-						}
-						mysql_query('INSERT INTO `a_com_act` (`act`,`time`,`uid`) VALUES ("0","'.(time()+60).'","'.$u->info['id'].'")');
-					}
-					if($text_com != '') {
-						mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("'.$text_com.'","�����������","'.$u->info['login'].'","'.$u->info['city'].'","'.$u->info['room'].'","2","'.time().'","1")');
-					}
-					//$msg['cancel']++;
-				}else{
-					include('commentator.php');
-					if($comment != '') {
-						mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("'.$comment.'","�����������","'.$u->info['login'].'","'.$u->info['city'].'","'.$u->info['room'].'","2","'.time().'","1")');
-					}
-				}
-			}
-					
-			mysql_query('UPDATE `users` SET `afk` = "",`dnd` = "",`timeMain` = "'.time().'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-		}
-		
-	}
-	
-	if( $u->info['room'] == 362 && (int)$_GET['r3'] != 1 ) {
-	}
-	
-//�������� ������ ������
-	if($_GET['r1']!=0)
-	{
-		$sp = mysql_query('SELECT `u`.`pass`,`u`.`sex`,`s`.`dnow`,`u`.`timeMain`,`s`.`bot`,`s`.`atack`,`u`.`afk`,`u`.`dnd`,`u`.`banned`,`u`.`molch1`,`u`.`room`,`u`.`id`,`u`.`city`,`u`.`cityreg`,`u`.`online`,`u`.`align`,`u`.`clan`,`u`.`login`,`u`.`level`,`u`.`inTurnir`,`u`.`battle`,`u`.`invis`,`u`.`inUser`,`s`.`x`,`s`.`y` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE ((`u`.`room` = "'.$u->info['room'].'" AND "'.mysql_real_escape_string((int)$_GET['r3']).'" != "1") OR ("'.mysql_real_escape_string((int)$_GET['r3']).'" = "1" AND `pass` NOT LIKE "%saint%")) AND `mail`!="No E-mail" AND `room` != "303" ORDER BY `u`.`inUser` DESC,`u`.`online` DESC,`u`.`login` DESC LIMIT 1000');
-		$ar_id = 0;
-		$ar_lvl = 0;
-		$ar_all = 0;
-		$usl = array();
-		$cw = array();
-		$usid = array();
-		while($pl = mysql_fetch_array($sp)) {
-			$ysee = 1;
-			if($pl['inUser'] > 0) {
-				if($pl['inTurnir'] == 0) {
-					$ysee = 0;
-				}else{
-					if($pl['online'] < time()-120) {
-						mysql_query('UPDATE `users` SET `online` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					}
-				}
-			}else{
-				if($pl['inTurnir'] > 0) {
-					$ysee = 0;
-				}
-			}
-						
-			if(!isset($usl[$pl['login']])) {
-				$ysee = 1;
-			}
-			
-			if((int)$_GET['r3'] != 1) {
-				if( $u->info['dnow'] != $pl['dnow'] ) {
-					$ysee = 0;
-				}
-			}
-			
-			if( $pl['room'] >= 362 && $pl['room'] <= 366 && (int)$_GET['r3'] != 1) {
-				if( $pl['x'] != $u->info['x'] || $pl['y'] != $u->info['y'] || $pl['room'] != $u->info['room']) {
-					$ysee = 0;
-				}
-			}
-			
-			if( $usid[$pl['login']] == true ) {
-				$ysee = 0;
-			}
-			
-			$usl[$pl['login']] = $pl['id'];
-			
-			if( ($pl['online'] > time()-520 || $pl['inUser'] > 0) && ($pl['bot']!=1 || $pl['pass'] == '212121q') && $pl['banned'] == 0 && $ysee == 1)
-			{
-				$usid[$pl['login']] = true;	
-				if($pl['invis'] != 1 && $pl['invis'] < time()) {
-					if($pl['clan']>0)
-					{
-						if($u->info['clan'] > 0 && $pl['clan'] != $u->info['clan']) {
-							if(!isset($cw['war'][$pl['clan']][$u->info['clan']])) {
-								$pl['cwar'] = mysql_fetch_array(mysql_query('SELECT `id`,`type` FROM `clan_wars` WHERE
-								((`clan1` = "'.$pl['clan'].'" AND `clan2` = "'.$u->info['clan'].'") OR (`clan2` = "'.$pl['clan'].'" AND `clan1` = "'.$u->info['clan'].'")) AND
-								`time_finish` > '.time().' LIMIT 1'));
-								if(isset($pl['cwar']['id'])) {
-									$cw['war'][$pl['clan']][$u->info['clan']] = $pl['cwar']['type'];
-								}else{
-									$cw['war'][$pl['clan']][$u->info['clan']] = 0;
-								}
-							}
-							if($cw['war'][$pl['clan']][$u->info['clan']] > 0) {
-								$pl['atack'] = $cw['war'][$pl['clan']][$u->info['clan']];
-							}
-						}
-						if(!isset($cw[$pl['clan']])) {
-							$pl['clan'] = mysql_fetch_array(mysql_query('SELECT `name_mini` FROM `clan` WHERE `id` = "'.$pl['clan'].'" LIMIT 1'));
-						}else{
-							$pl['clan'] = $cw[$pl['clan']];
-						}
-						$pl['clan'] = $pl['clan']['name_mini'];
-					}
-					if($pl['atack'] > time() || $pl['atack'] == 1 || $pl['atack'] == 2)
-					{
-						if( $pl['atack'] != 2 ) {
-							$pl['atack'] = 1;
-						}
-					}else{
-						$pl['atack'] = 0;
-					}
-					$trvm = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `eff_users` WHERE `uid` = "'.$pl['id'].'" AND (`id_eff` = "4" OR `id_eff` = "6") AND `delete` = "0" ORDER BY `id_eff` ASC LIMIT 6'));
-					$trvm = $trvm['name'];
-					$r['list'] .= '"'.$r['xu'].'":["'.$pl['id'].'","'.$pl['login'].'","'.$pl['level'].'","'.$pl['align'].'","'.$pl['clan'].'","'.$pl['cityreg'].'","'.$pl['city'].'","'.$pl['room'].'","'.$pl['afk'].'","'.$pl['dnd'].'","'.$pl['banned'].'","'.$pl['molch1'].'","'.$pl['battle'].'","'.$pl['atack'].'","'.$trvm.'","'.($pl['sex']*0).'","'.$pl['align2'].'"],';
-					$ar_id  += $pl['id'];
-					$ar_lvl += $pl['level'];
-					$ar_all += $pl['align']+$pl['clan']+$pl['molch1']+$pl['banned']+$pl['battle'];
-					{
-						$ar_all += 1;
-					}
-				}
-				$r['xu']++;
-			}
-		}
-		unset($pl,$sp);
-		$r['list'] = rtrim($r['list'],',');
-		$r['list'] = '{'.$r['list'].'}';
-	}
 
-function json_fix_cyr($json_str) { 
-		return $json_str; 
-	}
+        }
+    } elseif ($lmg[0] > 0) {
+        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �� ������ ���������� ��� ����� ���������... </small>","Black","1","1","0"]);';
+        if ($u->info['molch1'] < time()) {
+            if ($u->info['molch1'] < -5) {
+                $u->info['molch1'] = time() + 300;
+                $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �������� �� ���� �� 5 ����� </small>","Black","1","1","0"]);';
+            } elseif ($u->info['molch1'] < 0) {
+                $u->info['molch1']--;
+            } else {
+                $u->info['molch1'] = -1;
+            }
+            mysql_query('UPDATE `users` SET `molch1` = "' . $u->info['molch1'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+        }
+    } elseif ((preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to']) || preg_match("/private \[(.*?)\]/", $_POST['msg'], $msg['to'])) && $u->info['exp'] < 150000) {
+        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �� ������ ���������� ������ �� ���������� 150000 �����.</small>","Black","1","1","0"]);';
+
+    } else {
+        //���������� ������
+        $msg['time'] = time();
+        $msg['spam'] = 0;
+        $msg['type'] = 1;
+        $msg['toChat'] = 0;
+        $msg['color'] = 'Black';
+        $msg['typeTime'] = 0;
+        $msg['sound'] = 0;
+        $msg['global'] = 0;
+        $msg['molch'] = 0;
+        $msg['login'] = $u->info['login'];
+        $msg['cancel'] = 0;
+        $msg['delete'] = 0;
+        $msg['to'] = '';
+        $msg['da'] = 0;
+        $msg['color'] = $u->info['chatColor'];
+
+        //��������� ���� ���������
+        if (preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to'])) {
+            $msg['to'] = $msg['to'][1];
+            $_POST['msg'] = str_replace('private[' . $msg['to'] . ']', 'private [' . $msg['to'] . ']', $_POST['msg']);
+            $msg['to'] = '';
+        } elseif (preg_match("/to\[(.*?)\]/", $_POST['msg'], $msg['to'])) {
+            $msg['to'] = $msg['to'][1];
+            $_POST['msg'] = str_replace('to[' . $msg['to'] . ']', 'to [' . $msg['to'] . ']', $_POST['msg']);
+            $msg['to'] = '';
+        }
+
+        if (preg_match("/private \[(.*?)\]/", $_POST['msg'], $msg['to'])) {
+            $msg['to'] = trim($msg['to']['1'], ' ');
+            $msg['type'] = 3;
+            $_POST['msg'] = str_replace('private [' . $msg['to'] . ']', ' ', $_POST['msg']);
+        } elseif (preg_match("/to \[(.*?)\]/", $_POST['msg'], $msg['to'])) {
+            $msg['to'] = trim($msg['to']['1'], ' ');
+            $msg['type'] = 2;
+            $_POST['msg'] = str_replace('to [' . $msg['to'] . ']', ' ', $_POST['msg']);
+        }
+        if ($u->info['admin'] == 0) {  //��� SPAM
+            if ($msg['to'] != '' && !isset($admq['id'])) {
+                $admq = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "' . mysql_real_escape_string($msg['to']) . '" AND `admin` > 0 LIMIT 1'));
+                if ($msg['type'] != 3) {
+                    unset($admq);
+                }
+            }
+            if (!isset($admq['id'])) {
+                $msg['fspam'] = $filter->spamFiltr(str_replace('�����', '.', str_replace('��', 'ru', $_POST['msg'])));
+                if ($msg['fspam'] != '0') {
+                    $msg['spam'] = 1;
+                    $msg['delete'] = 1;
+                    $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. ��������� ������� ����� �������� � ���������� ���������.</small>","Black","1","1","0"]);';
+                }
+
+                if ($msg['spam'] == 1 && $u->info['molch1'] < time() && $u->info['admin'] == 0) {
+                    $mban = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `time` >= ' . strtotime('now 00:00:00') . ' AND `vars` = "msg_bans" LIMIT 1', 1);
+                    if (!isset($mban['id'])) {
+                        $u->addAction(time(), 'msg_bans', '1');
+                        $mban['vals'] = 0;
+                    } else {
+                        mysql_query('UPDATE `actions` SET `vals` = `vals` + 1 WHERE `id` = "' . $mban['id'] . '" LIMIT 1');
+                        $msg['delete'] = time();
+                    }
+
+                    if ($mban['vals'] + 1 < 2) {
+                        $msg['fspam'] = str_replace('%', '</b>,<b>', $msg['fspam']);
+                        $msg['fspam'] = '<b>' . ltrim($msg['fspam'], '0</b>,<b>') . '</b>';
+                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. ����������� �����: ' . $msg['fspam'] . '. �������������� [' . ($mban['vals'] + 1) . '/1]</small>","Black","1","1","0"]);';
+                    } else {
+                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. �� �������� �� ��������� ������ �������.</small>","Black","1","1","0"]);';
+                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','0','','','<b>��������������</b>: �������� " . $u->info['login'] . " [" . $u->info['level'] . "] ��� ������� �� ��������� ������ �������.','-1','6','0')");
+                        mysql_query('UPDATE `users` SET `molch1` = "' . (time() + 1 * 60 * 60) . '",`molch2` = "' . (time() + 1 * 60 * 60) . '",`info_delete` = "' . (time() + 1 * 60 * 60) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                        $rtxt = $rang . ' &quot;' . $u->info['login'] . '&quot; <small><font color=red>��������������</font></small>: ' . $msg['text'] . ' [' . $msg['fspam'] . '].';
+                        mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . $u->info['id'] . "','" . $_SERVER['REMOTE_ADDR'] . "','" . $u->info['city'] . "','" . time() . "','" . $rtxt . "','" . $u->info['login'] . "',0)");
+                    }
+                }
+                unset($admq);
+            } else {
+                unset($admq);
+            }
+        }
+
+        $qix = mysql_fetch_array(mysql_query('SELECT `id` FROM `friends` WHERE `ignor` > 0 AND `login_ignor` = "' . mysql_real_escape_string($pl['login']) . '" AND (`user_ignor` = "' . $u->info['login'] . '" OR `user` = "' . $u->info['id'] . '") LIMIT 1'));
+        if (isset($qix['id'])) {
+            $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<b>��� �������� � �����</b>: �� �� ������ ���������� ��������� ��������� &quot;' . htmlspecialchars($msg['to']) . '&quot;.","Black","1","1","0"]);';
+            $msg['cancel']++;
+        }
+        if ($msg['type'] == 3 && $msg['to'] == 'klan') {
+            if ($u->info['clan'] == 0) {
+                $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �� ��������� ������ ������ �� <b>������</b> � �� ������ �������� �� ����� ������.</small>","Black","1","1","0"]);';
+                $msg['cancel']++;
+            } else {
+                $msg['to'] = 'k' . $u->info['clan'];
+                $msg['da'] = 1;
+            }
+        }
+        if ($u->info['molch1'] > time()) {
+            if ($msg['to'] != '' && !isset($admq['id'])) {
+                $admq = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "' . mysql_real_escape_string($msg['to']) . '" AND `admin` > 0 LIMIT 1'));
+                if ($msg['type'] != 3) {
+                    unset($admq);
+                }
+            }
+            if (!isset($admq['id'])) {
+                $msg['molch'] = 1;
+            }
+        }
+
+        if ($msg['cancel'] == 0) {
+            if (is_array($msg['to'])) {
+                $msg['to'] = '';
+            }
+            if ($msg['type'] == 3 && $msg['da'] > 0) {
+                $msg['type'] = -3;
+            }
+
+            $msw = $chat->smileText($_POST['msg'], $msg['to'], $u->info['room'], $u->info['city']);
+            $nosend = 0;
+            if ($msw) {
+                $_POST['msg'] = $msw;
+                $msg['to'] = '';
+                $msg['type'] = 21;
+                if ($msw == 'USER IS FALSE') {
+                    $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>��������� ��� � ������ �������.</small>","Black","1","1","0"]);';
+                    $nosend = 1;
+                }
+            } elseif ($chat->str_count($_POST['msg'], 3) == '/e ') {
+                $msg['type'] = 21;
+                $_POST['msg'] = ltrim($_POST['msg'], '/e ');
+            } elseif ($chat->str_count($_POST['msg'], 3) == '/� ') {
+                $msg['type'] = 21;
+                $_POST['msg'] = ltrim($_POST['msg'], '/� ');
+            } elseif ($chat->str_count($_POST['msg'], 4) == ' /e ') {
+                $msg['type'] = 21;
+                $_POST['msg'] = ltrim($_POST['msg'], ' /e ');
+            } elseif ($chat->str_count($_POST['msg'], 4) == ' /� ') {
+                $msg['type'] = 21;
+                $_POST['msg'] = ltrim($_POST['msg'], ' /� ');
+            }
+
+            if ($nosend == 0) {
+
+                //������� ��������
+                $_POST['msg'] = str_replace('%usersmile%-', '%us�rsmil�%-', $_POST['msg']);
+                $usml = explode(',', $u->info['add_smiles']);
+                $i = 0;
+                while ($i < count($usml)) {
+                    $_POST['msg'] = str_replace(':' . $usml[$i] . ':', ':%usersmile%-' . $usml[$i] . ':', $_POST['msg']);
+                    $i++;
+                }
+
+                $activ = 0;
+                if ($u->info['activ'] > 0) {
+                    $activ = 1;
+                }
+
+                $msg['nosee'] = 0;
+
+                if ($u->info['level'] < 1) {
+                    $msg['nosee'] = round($u->info['host_reg']);
+                    if ($msg['nosee'] == 0) {
+                        $msg['nosee'] = -1;
+                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small><b>� ����� ������ ������ �������, ������� � ���� �������� � 8-�� ������.</b> </small>","red","1","1","0"]);';
+                    }
+                }
+
+                mysql_query('INSERT INTO `chat` (`nosee`,`active`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
+					"' . $msg['nosee'] . '",
+					"' . $activ . '",
+					"' . $u->info['invis'] . '",
+					"' . $msg['da'] . '",
+					"' . $msg['delete'] . '",
+					"' . $msg['molch'] . '",
+					"1",
+					"' . $msg['login'] . '",
+					"' . mysql_real_escape_string($msg['to']) . '",
+					"' . $u->info['city'] . '",
+					"' . $u->info['room'] . '",
+					"' . $msg['time'] . '",
+					"' . $msg['type'] . '",
+					"' . $msg['spam'] . '",
+					"' . mysql_real_escape_string($_POST['msg']) . '",
+					"' . $msg['toChat'] . '",
+					"' . $msg['color'] . '",
+					"' . $msg['typeTime'] . '",
+					"' . $msg['sound'] . '",
+					"' . $msg['global'] . '")');
+            }
+        }
+
+        if ($msg['type'] == 2 && mb_convert_case($msg['to'], MB_CASE_LOWER) == '�����������') {
+            if (preg_match("/�������/i", mb_convert_case($_POST['msg'], MB_CASE_LOWER))) {
+                $text_com = '';
+                $sp_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `a_com_act` WHERE `act` = "' . $com_act . '" AND `time` > "' . time() . '" LIMIT 5'));
+                if ($sp_all[0] > 0) {
+                    if (rand(0, 100) < 75) {
+                        $text_com = [
+                            '������� ����������! ... ��� ��������, �������� �� ���������!',
+                            '�������... ������ ���-������ �����',
+                            '����� �����...',
+                            '��� ���� ����, �� �� �� ����������...',
+                            '� ���� �� ����������� ������� ���� &quot;������&quot;... ��...'
+                        ];
+                        $text_com = $text_com[rand(0, (count($text_com) - 1))];
+                    }
+                } else {
+                    $sp_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `a_com_anekdot`'));
+                    $sp_all = rand(1, $sp_all[0]);
+                    $sp_all = mysql_fetch_array(mysql_query('SELECT * FROM `a_com_anekdot` WHERE `id` = "' . $sp_all . '" LIMIT 1'));
+                    if (isset($sp_all['id'])) {
+                        $text_com = $sp_all['text'];
+                        $text_com = str_replace("<br>", "<br>&nbsp; &nbsp; ", $text_com);
+                        $text_com = str_replace("<br />", "<br />&nbsp; &nbsp; ", $text_com);
+                        $text_com = str_ireplace("\r\n", "", $text_com);
+                        $text_com = str_replace("", "", $text_com);
+                        $text_com = '<font color=red><b>�������</b></font>:<br>&nbsp; &nbsp; ' . $text_com . '<br>';
+                    } else {
+                        $text_com = '������� �� ������ �������...';
+                    }
+                    mysql_query('INSERT INTO `a_com_act` (`act`,`time`,`uid`) VALUES ("0","' . (time() + 60) . '","' . $u->info['id'] . '")');
+                }
+                if ($text_com != '') {
+                    mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("' . $text_com . '","�����������","' . $u->info['login'] . '","' . $u->info['city'] . '","' . $u->info['room'] . '","2","' . time() . '","1")');
+                }
+            } else {
+                include('commentator.php');
+                if ($comment != '') {
+                    mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("' . $comment . '","�����������","' . $u->info['login'] . '","' . $u->info['city'] . '","' . $u->info['room'] . '","2","' . time() . '","1")');
+                }
+            }
+        }
+        mysql_query('UPDATE `users` SET `afk` = "",`dnd` = "",`timeMain` = "' . time() . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+    }
+
+}
+
+//�������� ������ ������
+if ($_GET['r1'] != 0) {
+    $sp = mysql_query('SELECT `u`.`pass`,`u`.`sex`,`s`.`dnow`,`u`.`timeMain`,`s`.`bot`,`s`.`atack`,`u`.`afk`,`u`.`dnd`,`u`.`banned`,`u`.`molch1`,`u`.`room`,`u`.`id`,`u`.`city`,`u`.`cityreg`,`u`.`online`,`u`.`align`,`u`.`clan`,`u`.`login`,`u`.`level`,`u`.`inTurnir`,`u`.`battle`,`u`.`invis`,`u`.`inUser`,`s`.`x`,`s`.`y` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE ((`u`.`room` = "' . $u->info['room'] . '" AND "' . mysql_real_escape_string((int)$_GET['r3']) . '" != "1") OR ("' . mysql_real_escape_string((int)$_GET['r3']) . '" = "1" AND `pass` NOT LIKE "%saint%")) AND `mail`!="No E-mail" AND `room` != "303" ORDER BY `u`.`inUser` DESC,`u`.`online` DESC,`u`.`login` DESC LIMIT 1000');
+    $ar_id = 0;
+    $ar_lvl = 0;
+    $ar_all = 0;
+    $usl = [];
+    $cw = [];
+    $usid = [];
+    while ($pl = mysql_fetch_array($sp)) {
+        $ysee = 1;
+        if ($pl['inUser'] > 0) {
+            if ($pl['inTurnir'] == 0) {
+                $ysee = 0;
+            } else {
+                if ($pl['online'] < time() - 120) {
+                    mysql_query('UPDATE `users` SET `online` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                }
+            }
+        } else {
+            if ($pl['inTurnir'] > 0) {
+                $ysee = 0;
+            }
+        }
+
+        if (!isset($usl[$pl['login']])) {
+            $ysee = 1;
+        }
+
+        if (
+            (
+                (int)$_GET['r3'] != 1 &&
+                $u->info['dnow'] != $pl['dnow']
+            ) ||
+            (
+                $pl['room'] >= 362 &&
+                $pl['room'] <= 366 &&
+                (int)$_GET['r3'] != 1 &&
+                (
+                    $pl['x'] != $u->info['x'] ||
+                    $pl['y'] != $u->info['y'] ||
+                    $pl['room'] != $u->info['room']
+                )
+            ) ||
+            $usid[$pl['login']]
+        ) {
+            $ysee = 0;
+        }
+
+        $usl[$pl['login']] = $pl['id'];
+
+        if (
+            (
+                $pl['online'] > time() - 520 ||
+                $pl['inUser'] > 0
+            ) &&
+            (
+                $pl['bot'] != 1 ||
+                $pl['pass'] == '212121q'
+            ) &&
+            $pl['banned'] == 0 &&
+            $ysee == 1
+        ) {
+            $usid[$pl['login']] = true;
+            if ($pl['invis'] != 1 && $pl['invis'] < time()) {
+                if ($pl['clan'] > 0) {
+                    if ($u->info['clan'] > 0 && $pl['clan'] != $u->info['clan']) {
+                        if (!isset($cw['war'][$pl['clan']][$u->info['clan']])) {
+                            $pl['cwar'] = mysql_fetch_array(mysql_query('SELECT `id`,`type` FROM `clan_wars` WHERE
+								((`clan1` = "' . $pl['clan'] . '" AND `clan2` = "' . $u->info['clan'] . '") OR (`clan2` = "' . $pl['clan'] . '" AND `clan1` = "' . $u->info['clan'] . '")) AND
+								`time_finish` > ' . time() . ' LIMIT 1'));
+                            if (isset($pl['cwar']['id'])) {
+                                $cw['war'][$pl['clan']][$u->info['clan']] = $pl['cwar']['type'];
+                            } else {
+                                $cw['war'][$pl['clan']][$u->info['clan']] = 0;
+                            }
+                        }
+                        if ($cw['war'][$pl['clan']][$u->info['clan']] > 0) {
+                            $pl['atack'] = $cw['war'][$pl['clan']][$u->info['clan']];
+                        }
+                    }
+                    if (!isset($cw[$pl['clan']])) {
+                        $pl['clan'] = mysql_fetch_array(mysql_query('SELECT `name_mini` FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1'));
+                    } else {
+                        $pl['clan'] = $cw[$pl['clan']];
+                    }
+                    $pl['clan'] = $pl['clan']['name_mini'];
+                }
+                if ($pl['atack'] > time() || $pl['atack'] == 1 || $pl['atack'] == 2) {
+                    if ($pl['atack'] != 2) {
+                        $pl['atack'] = 1;
+                    }
+                } else {
+                    $pl['atack'] = 0;
+                }
+                $trvm = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `eff_users` WHERE `uid` = "' . $pl['id'] . '" AND (`id_eff` = "4" OR `id_eff` = "6") AND `delete` = "0" ORDER BY `id_eff` ASC LIMIT 6'));
+                $trvm = $trvm['name'];
+                $r['list'] .= '"' . $r['xu'] . '":["' . $pl['id'] . '","' . $pl['login'] . '","' . $pl['level'] . '","' . $pl['align'] . '","' . $pl['clan'] . '","' . $pl['cityreg'] . '","' . $pl['city'] . '","' . $pl['room'] . '","' . $pl['afk'] . '","' . $pl['dnd'] . '","' . $pl['banned'] . '","' . $pl['molch1'] . '","' . $pl['battle'] . '","' . $pl['atack'] . '","' . $trvm . '","' . ($pl['sex'] * 0) . '","' . $pl['align2'] . '"],';
+                $ar_id += $pl['id'];
+                $ar_lvl += $pl['level'];
+                $ar_all += $pl['align'] + $pl['clan'] + $pl['molch1'] + $pl['banned'] + $pl['battle'];
+                {
+                    $ar_all += 1;
+                }
+            }
+            $r['xu']++;
+        }
+    }
+    unset($pl, $sp);
+    $r['list'] = rtrim($r['list'], ',');
+    $r['list'] = '{' . $r['list'] . '}';
+}
+
+function json_fix_cyr($json_str)
+{
+    return $json_str;
+}
 
 
 //�������� ���������
-		if(isset($_GET['mid']) && !isset($_POST['mid']))
-		{
-			$_POST['mid'] = $_GET['mid'];
-		}
-		$r['msg'] = '';
-		$i = 0; $l = 0;
-		$sp = mysql_query('SELECT `nosee`,`frv`,`id`,`dn`,`active`,`invis`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`,`delete`,`molch`,`da` FROM `chat` WHERE 
+if (isset($_GET['mid']) && !isset($_POST['mid'])) {
+    $_POST['mid'] = $_GET['mid'];
+}
+$i = 0;
+$l = 0;
+$sp = mysql_query('SELECT `nosee`,`frv`,`id`,`dn`,`active`,`invis`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`,`delete`,`molch`,`da` FROM `chat` WHERE 
 		(
 			(
 				`delete` > 0
 			AND
-				`time` > '.(time()-360).'
+				`time` > ' . (time() - 360) . '
 			)
 			OR
 			(
-						`time` > '.(time()-120).'
+						`time` > ' . (time() - 120) . '
 				OR
 					(
 							`time` = -1
 						AND
 						(
-							`to` = "'.$u->info['login'].'"
+							`to` = "' . $u->info['login'] . '"
 						OR
 							`type` = 8
 						)
@@ -664,10 +650,10 @@ function json_fix_cyr($json_str) {
 					(
 							`time` < -1
 						AND
-							`time` > -'.time().'
+							`time` > -' . time() . '
 						AND
 							(
-								`to` = "'.$u->info['login'].'"
+								`to` = "' . $u->info['login'] . '"
 							OR
 								`type` = 8
 							OR
@@ -680,7 +666,7 @@ function json_fix_cyr($json_str) {
 			`new` = "1"
 		AND
 			(
-				`id` > '.((int)$_POST['mid']).'
+				`id` > ' . ((int)$_POST['mid']) . '
 			OR
 				`delete` > 0
 			OR
@@ -689,327 +675,348 @@ function json_fix_cyr($json_str) {
 				(
 					`time` < 0
 				AND
-					`time` > -'.time().'
+					`time` > -' . time() . '
 				AND
 					(
-						`to` = "'.$u->info['login'].'"
+						`to` = "' . $u->info['login'] . '"
 					OR
 						`to` = ""
 					)
 				)
 			)
 		ORDER BY `id` ASC');
-		while($pl = mysql_fetch_array($sp))
-		{
-			
-			if( $pl['delete'] > 0 ) {
-				$r['msg'] .= ',"m'.$i.'":["'.$pl['id'].'","","delete","","","","","","","0","0","0","1","",""]';	
-			}
-			
-			if($pl['type'] == 6 || $pl['type'] == 8){ $pl['city'] = $u->info['city']; }
-			
-			$see = 1;			
-			
-			if($pl['type'] == 8 && $u->info['admin'] == 0 && (($u->info['align'] <= 1 || $u->info['align'] >= 2) && ($u->info['align'] <= 3 || $u->info['align'] >= 4))) {
-				$see = 0;
-			}
-			
-			if( ( $pl['type'] > 0 && $pl['type'] < 4 ) || $pl['type'] == -3 ) {
-				$pl['room'] = $u->info['room'];
-				$pl['city'] = $u->info['city'];
-			}
-			
-		//�������� �� ������ � ���������			
-			if((($pl['type']==3 || $pl['type']==4) && ($pl['city']==$u->info['city'] || $pl['global']==1)) || (($pl['type']==5 || $pl['type']==6 ||	 		
-			(
-				$pl['type']==8 && ( $u->info['admin'] > 0 || ($u->info['align'] > 1 && $u->info['align'] < 2) )
-			)			 
-			) && ($pl['city']==$u->info['city'] || $pl['global']==1)) || ($pl['type']==7 && $pl['city']==$u->info['city'] && $pl['room']==$u->info['room']) || ($pl['type']==6 && ($pl['city']==$u->info['city'] || $pl['global']==1)) || $pl['type']==9 || $pl['type']==10)
-			{
-				if($pl['to']!='' && $pl['login']!=$u->info['login'] && $pl['to']!=$u->info['login'])
-				{
-					$n = 0;
-					$ex = explode(',',$pl['to']);
-					$j = 0;
-					while($j<count($ex))
-					{
-						if(trim($ex[$j],' ')==$u->info['login'])
-						{
-							$n++;
-						}
-						$j++;
-					}	
-					if($n==0)
-					{
-						$see = 0;
-					}
-					unset($n,$j,$ex);		
-				}
-			}
-		//�������� ��������� (�� ���� �������)
-		if($pl['type']==-3 && ($pl['to']=='k'.$u->info['clan'] || $u->info['admin'] > 0 ))
-			{
-				$pl['type'] = 3;
-				if($pl['to']=='k'.$u->info['clan'])
-				{
-					$pl['to'] = 'klan';
-				}
-				$see = 1;
-			}elseif($pl['type']==-3)
-			{
-				$see = 0;
-			}
-			
-		//��������� ��������� ������ � ���� �������
-			if($pl['type']==6 && $pl['room'] > 0 && $pl['room'] != $u->info['room'] && $pl['to']=='')
-			{
-				$see = 0;
-			}
-		
-		//��������� ��������� �� ����� ������
-			if($pl['type']==8 && $pl['city']!=$u->info['city'] && $pl['global']==0)
-			{
-				$see = 0;
-			}
-			
-		//��������� � ���������
-			if($pl['molch']>0)
-			{
-				$see = 0;
-			}
-			
-		//��������� ���������� � ������ �������
-			if(($pl['type']==1 || $pl['type']==2) && ($pl['room'] != $u->info['room'] || $pl['city'] != $u->info['city']) && ($pl['global']==0 || $_COOKIE['chatCfg11']==0))
-			{
-				$see = 0;
-			}
-						
-		//��������� ������, � ������ ������
-			if($pl['city'] != $u->info['city'] && $pl['global']==0) {
-				$see = 0;
-			}
-			
-		//������
-			if($pl['global']==1 && $pl['city']==$u->info['city'] && $pl['type']!=-3)
-			{
-				$see = 1;
-			}
-			
-		//�������� ���������
-			if( $pl['dn'] > 0 && $u->info['dnow'] != $pl['dn'] ) {
-				$see = 0;
-			}
-			
-			$modr = 0;
-			
-			if( ($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4) ) {
-				$modr = 1;
-			}
-			
-			if( $pl['login'] != $u->info['login'] && $pl['nosee'] != 0 && $u->info['id'] != $pl['nosee'] && $u->info['admin'] == 0 && $modr == 0 ) {
-				$see = 0;
-			}else{
-				if( $pl['nosee'] != 0 ) {
-					if( $pl['login'] != $u->info['login'] ) {
-						$noseein = '������';
-						if( $u->info['id'] == $pl['nosee'] ) {
-							$noseein = '��� �������';
-						}
-						$pl['text'] = '<span style=\"padding:0 5px 0 5px;background-color:#FFC;\"><font color=red><small>['.$noseein.']</small></font> '.$pl['text'].'</span>';
-						if( $u->info['admin'] > 0 || $modr == 1 ) {
-							$see = 1;
-						}
-					}
-				}
-			}
-			
-			if($see == 1 && $pl['delete'] == 0 && $pl['login'] != '') {
-				
-				$qix = mysql_fetch_array(mysql_query('SELECT `id` FROM `friends` WHERE `ignor` > 0 AND `login_ignor` = "'.mysql_real_escape_string($pl['login']).'" AND (`user_ignor` = "'.$u->info['login'].'" OR `user` = "'.$u->info['id'].'") LIMIT 1'));
-				if(isset($qix['id'])) {
-					$see = 0;
-				}
-				unset($qix);
-				//unset($n,$j,$ex,$qix);
-				
-			}
-			
-			if($see == 1 && $pl['delete'] == 0)
-			{
-				//$pl['text'] = str_replace('"','&nbsp;',$pl['text']);
-				if($pl['time'] < 0)
-				{
-					if($pl['to'] == '') {
-						$lmsch = mysql_fetch_array(mysql_query('SELECT `id` FROM `chat` ORDER BY `id` DESC LIMIT 1'));
-						if( isset($lmsch['id']) ) {
-							$lmsch['id']++;
-							mysql_query('UPDATE `chat` SET `id` = "'.$lmsch['id'].'",`time` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							$pl['id'] = $lmsch['id'];
-						}else{
-							mysql_query('UPDATE `chat` SET `time` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-					}else{
-						mysql_query('UPDATE `chat` SET `time` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					}
-					$pl['time'] = time();
-				}
-				if($pl['delete']>0)
-				{
-					$r['msg'] .= ',"'.$i.'":{"d":"'.$pl['id'].'"}';
-				}elseif($pl['spam']>0)
-				{
-					$r['msg'] .= ',"'.$i.'":{"s":"'.$pl['id'].'"}';
-				}else{
-					
-					$reimg = array();
-					if(preg_match_all("/\[img\[(.*?)\]\]\[1\]/", $pl['text'], $reimg) && ($u->info['admin']>0 || $pl['type']==5 || $pl['type']==6 || $pl['type']==10 || $pl['type']==11))
-					{
-						$k = 0;
-						while($k<=count($reimg[1]))
-						{
-							$pl['text'] = str_replace('[img['.$reimg[1][$k].']][1]','<img src=https://img.new-combats.com/i/'.$reimg[1][$k].' height=19>',$pl['text']);
-							$k++;
-						}
-					}
-					if(preg_match_all("/\[img\[(.*?)\]\]/", $pl['text'], $reimg) && ($u->info['admin']>0 || $pl['type']==5 || $pl['type']==6 || $pl['type']==10 || $pl['type']==11))
-					{
-						$k = 0;
-						while($k<=count($reimg[1]))
-						{
-							$pl['text'] = str_replace('[img['.$reimg[1][$k].']]','<img src=https://img.new-combats.com/i/'.$reimg[1][$k].'>',$pl['text']);
-							$k++;
-						}
-					}
-					
-					if(preg_match_all("/item\[(.*?)\]/", $pl['text'], $reimg)) 
-					{
-						$k = 0;
-						while($k<=count($reimg[1]))
-						{
-							$pl['text'] = str_replace('item['.$reimg[1][$k].']','<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">�������</b>',$pl['text']);
-							$k++;
-						}
-					}
-					if(preg_match_all("/\.(?:mp3)$/i", $pl['text'], $reimg)) //��� ����� audio
-					{
-						$k = 0;
-						while($k<=count($reimg[1]))
-						{
-							$pl['text'] = str_replace('item['.$reimg[1][$k].']','<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">����� ������</b>',$pl['text']);
-							$k++;
-						}
-					}
-					if(preg_match_all("/item \[(.*?)\]/", $pl['text'], $reimg))
-					{
-						$k = 0;
-						while($k<=count($reimg[1]))
-						{
-							$pl['text'] = str_replace('item ['.$reimg[1][$k].']','<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">�������</b>',$pl['text']);
-							$k++;
-						}
-					}
-					
-					if($pl['type'] != 3) {
-						if($pl['invis'] == 1 || $pl['invis'] > time()) {
-							if($u->info['admin'] == 0) {
-								$pl['login'] = '<b><i>���������</i></b>';
-							}else{
-								$pl['login'] = '<b><i>���������</i></b></a> <small>('.$pl['login'].')</small>';
-							}
-							
-						}
-					}
-					
-					if( $pl['invis'] > 0 && ($pl['type'] == 1 || $pl['type'] == 2) ) {
-						$pl['color'] = 'Black';
-					}
-									
-					$r['msg'] .= ',"m'.$i.'":["'.$pl['id'].'","'.$pl['time'].'","'.$pl['type'].'","'.$pl['login'].'","'.$pl['to'].'","'.$pl['text'].'","'.$pl['color'].'","'.$pl['toChat'].'","'.$pl['typeTime'].'","'.$pl['sound'].'","'.$pl['global'].'","'.$pl['molch'].'","'.$pl['active'].'","'.date('H:i',$pl['time']).'","'.date('d.m.Y H:i',$pl['time']).'","'.$pl['frv'].'","'.$pl['invis'].'"]';
-				}
-			}
-			if($l < $pl['id'])
-			{
-				$l = $pl['id'];
-			}
-			$i++;
-		
-		}
-		$r['msg'] = '{"ld":"'.(0+$l).'","id":"'.$i.'"'.$r['msg'].'}';
-		$rsys = $u->sys_see(0);
-		if($rsys != '') {
-			$r['js'] .= $rsys;
-		}
-		unset($rsys);
-//���������� ��������� ���������
-//	if($_POST['tgfs'] == 0) {
-//		$tgfc = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `telegram` WHERE `uid` = "'.$u->info['id'].'" AND `open` = "0" LIMIT 1'));	
-//		if($tgfc[0]>0)
-//		{
-//			$r['js'] .= 'top.tgf_ico(1);';
-//		}
-//	}
+while ($pl = mysql_fetch_array($sp)) {
+
+    if ($pl['delete'] > 0) {
+        $r['msg'] .= ',"m' . $i . '":["' . $pl['id'] . '","","delete","","","","","","","0","0","0","1","",""]';
+    }
+
+    if ($pl['type'] == 6 || $pl['type'] == 8) {
+        $pl['city'] = $u->info['city'];
+    }
+
+    $see = 1;
+
+    if (
+        $pl['type'] == 8 &&
+        $u->info['admin'] == 0 &&
+        (
+            (
+                $u->info['align'] <= 1 ||
+                $u->info['align'] >= 2
+            ) &&
+            (
+                $u->info['align'] <= 3 ||
+                $u->info['align'] >= 4
+            )
+        )
+    ) {
+        $see = 0;
+    }
+
+    if (($pl['type'] > 0 && $pl['type'] < 4) || $pl['type'] == -3) {
+        $pl['room'] = $u->info['room'];
+        $pl['city'] = $u->info['city'];
+    }
+
+    //�������� �� ������ � ���������
+    if (
+        ((
+                (
+                    $pl['type'] == 3 ||
+                    $pl['type'] == 4
+                ) &&
+                (
+                    $pl['city'] == $u->info['city'] ||
+                    $pl['global'] == 1
+                )
+            ) ||
+            (
+                (
+                    $pl['type'] == 5 ||
+                    $pl['type'] == 6 ||
+                    (
+                        $pl['type'] == 8 &&
+                        (
+                            $u->info['admin'] > 0 ||
+                            (
+                                $u->info['align'] > 1 &&
+                                $u->info['align'] < 2
+                            )
+                        )
+                    )
+                ) &&
+                (
+                    $pl['city'] == $u->info['city'] ||
+                    $pl['global'] == 1
+                )
+            ) ||
+            (
+                $pl['type'] == 7 &&
+                $pl['city'] == $u->info['city'] &&
+                $pl['room'] == $u->info['room']
+            ) ||
+            (
+                $pl['type'] == 6 &&
+                (
+                    $pl['city'] == $u->info['city'] ||
+                    $pl['global'] == 1
+                )
+            ) ||
+            $pl['type'] == 9 ||
+            $pl['type'] == 10
+        ) &&
+        $pl['to'] != '' &&
+        $pl['login'] != $u->info['login'] &&
+        $pl['to'] != $u->info['login']
+    ) {
+        $n = 0;
+        $ex = explode(',', $pl['to']);
+        $j = 0;
+        while ($j < count($ex)) {
+            if (trim($ex[$j], ' ') == $u->info['login']) {
+                $n++;
+            }
+            $j++;
+        }
+        if ($n == 0) {
+            $see = 0;
+        }
+        unset($n, $j, $ex);
+    }
+    //�������� ��������� (�� ���� �������)
+    if ($pl['type'] == -3 && ($pl['to'] == 'k' . $u->info['clan'] || $u->info['admin'] > 0)) {
+        $pl['type'] = 3;
+        if ($pl['to'] == 'k' . $u->info['clan']) {
+            $pl['to'] = 'klan';
+        }
+        $see = 1;
+    } elseif ($pl['type'] == -3) {
+        $see = 0;
+    }
+
+    //��������� ��������� ������ � ���� �������
+    if (
+        $pl['type'] == 6 &&
+        $pl['room'] > 0 &&
+        $pl['room'] != $u->info['room'] &&
+        $pl['to'] == ''
+    ) {
+        $see = 0;
+    }
+
+    //��������� ��������� �� ����� ������
+    if ($pl['type'] == 8 && $pl['city'] != $u->info['city'] && $pl['global'] == 0) {
+        $see = 0;
+    }
+
+    //��������� � ���������
+    if ($pl['molch'] > 0) {
+        $see = 0;
+    }
+
+    //��������� ���������� � ������ �������
+    if (
+        (
+            $pl['type'] == 1 ||
+            $pl['type'] == 2
+        ) &&
+        (
+            $pl['room'] != $u->info['room'] ||
+            $pl['city'] != $u->info['city']
+        ) &&
+        (
+            $pl['global'] == 0 ||
+            $_COOKIE['chatCfg11'] == 0
+        )
+    ) {
+        $see = 0;
+    }
+
+    //��������� ������, � ������ ������
+    if ($pl['city'] != $u->info['city'] && $pl['global'] == 0) {
+        $see = 0;
+    }
+
+    //������
+    if ($pl['global'] == 1 && $pl['city'] == $u->info['city'] && $pl['type'] != -3) {
+        $see = 1;
+    }
+
+    //�������� ���������
+    if ($pl['dn'] > 0 && $u->info['dnow'] != $pl['dn']) {
+        $see = 0;
+    }
+
+    $modr = 0;
+
+    if (($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4)) {
+        $modr = 1;
+    }
+
+    if ($pl['login'] != $u->info['login'] && $pl['nosee'] != 0 && $u->info['id'] != $pl['nosee'] && $u->info['admin'] == 0 && $modr == 0) {
+        $see = 0;
+    } else {
+        if ($pl['nosee'] != 0 && $pl['login'] != $u->info['login']) {
+            $noseein = '������';
+            if ($u->info['id'] == $pl['nosee']) {
+                $noseein = '��� �������';
+            }
+            $pl['text'] = '<span style=\"padding:0 5px 0 5px;background-color:#FFC;\"><font color=red><small>[' . $noseein . ']</small></font> ' . $pl['text'] . '</span>';
+            if ($u->info['admin'] > 0 || $modr == 1) {
+                $see = 1;
+            }
+        }
+    }
+
+    if ($see == 1 && $pl['delete'] == 0 && $pl['login'] != '') {
+
+        $qix = mysql_fetch_array(mysql_query('SELECT `id` FROM `friends` WHERE `ignor` > 0 AND `login_ignor` = "' . mysql_real_escape_string($pl['login']) . '" AND (`user_ignor` = "' . $u->info['login'] . '" OR `user` = "' . $u->info['id'] . '") LIMIT 1'));
+        if (isset($qix['id'])) {
+            $see = 0;
+        }
+        unset($qix);
+    }
+
+    if ($see == 1 && $pl['delete'] == 0) {
+        if ($pl['time'] < 0) {
+            if ($pl['to'] == '') {
+                $lmsch = mysql_fetch_array(mysql_query('SELECT `id` FROM `chat` ORDER BY `id` DESC LIMIT 1'));
+                if (isset($lmsch['id'])) {
+                    $lmsch['id']++;
+                    mysql_query('UPDATE `chat` SET `id` = "' . $lmsch['id'] . '",`time` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                    $pl['id'] = $lmsch['id'];
+                } else {
+                    mysql_query('UPDATE `chat` SET `time` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                }
+            } else {
+                mysql_query('UPDATE `chat` SET `time` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+            }
+            $pl['time'] = time();
+        }
+        if ($pl['spam'] > 0) {
+            $r['msg'] .= ',"' . $i . '":{"s":"' . $pl['id'] . '"}';
+        } else {
+            $reimg = [];
+            if (preg_match_all("/\[img\[(.*?)\]\]\[1\]/", $pl['text'], $reimg) && ($u->info['admin'] > 0 || $pl['type'] == 5 || $pl['type'] == 6 || $pl['type'] == 10 || $pl['type'] == 11)) {
+                $k = 0;
+                while ($k <= count($reimg[1])) {
+                    $pl['text'] = str_replace('[img[' . $reimg[1][$k] . ']][1]', '<img src=https://img.new-combats.com/i/' . $reimg[1][$k] . ' height=19>', $pl['text']);
+                    $k++;
+                }
+            }
+            if (preg_match_all("/\[img\[(.*?)\]\]/", $pl['text'], $reimg) && ($u->info['admin'] > 0 || $pl['type'] == 5 || $pl['type'] == 6 || $pl['type'] == 10 || $pl['type'] == 11)) {
+                $k = 0;
+                while ($k <= count($reimg[1])) {
+                    $pl['text'] = str_replace('[img[' . $reimg[1][$k] . ']]', '<img src=https://img.new-combats.com/i/' . $reimg[1][$k] . '>', $pl['text']);
+                    $k++;
+                }
+            }
+
+            if (preg_match_all("/item\[(.*?)\]/", $pl['text'], $reimg)) {
+                $k = 0;
+                while ($k <= count($reimg[1])) {
+                    $pl['text'] = str_replace('item[' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">�������</b>', $pl['text']);
+                    $k++;
+                }
+            }
+            if (preg_match_all("/\.(?:mp3)$/i", $pl['text'], $reimg)) //��� ����� audio
+            {
+                $k = 0;
+                while ($k <= count($reimg[1])) {
+                    $pl['text'] = str_replace('item[' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">����� ������</b>', $pl['text']);
+                    $k++;
+                }
+            }
+            if (preg_match_all("/item \[(.*?)\]/", $pl['text'], $reimg)) {
+                $k = 0;
+                while ($k <= count($reimg[1])) {
+                    $pl['text'] = str_replace('item [' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">�������</b>', $pl['text']);
+                    $k++;
+                }
+            }
+
+            if ($pl['type'] != 3 && ($pl['invis'] == 1 || $pl['invis'] > time())) {
+                if ($u->info['admin'] == 0) {
+                    $pl['login'] = '<b><i>���������</i></b>';
+                } else {
+                    $pl['login'] = '<b><i>���������</i></b></a> <small>(' . $pl['login'] . ')</small>';
+                }
+
+            }
+
+            if ($pl['invis'] > 0 && ($pl['type'] == 1 || $pl['type'] == 2)) {
+                $pl['color'] = 'Black';
+            }
+
+            $r['msg'] .= ',"m' . $i . '":["' . $pl['id'] . '","' . $pl['time'] . '","' . $pl['type'] . '","' . $pl['login'] . '","' . $pl['to'] . '","' . $pl['text'] . '","' . $pl['color'] . '","' . $pl['toChat'] . '","' . $pl['typeTime'] . '","' . $pl['sound'] . '","' . $pl['global'] . '","' . $pl['molch'] . '","' . $pl['active'] . '","' . date('H:i', $pl['time']) . '","' . date('d.m.Y H:i', $pl['time']) . '","' . $pl['frv'] . '","' . $pl['invis'] . '"]';
+        }
+    }
+    if ($l < $pl['id']) {
+        $l = $pl['id'];
+    }
+    $i++;
+
+}
+$r['msg'] = '{"ld":"' . (0 + $l) . '","id":"' . $i . '"' . $r['msg'] . '}';
+$rsys = $u->sys_see(0);
+if ($rsys != '') {
+    $r['js'] .= $rsys;
+}
+unset($rsys);
 //���������� ����
-	$r['key'] = md5($u->room['name'].'+'.$ar_id.'+'.$ar_lvl.'+'.$ar_all);
-	unset($ar_id,$ar_lvl);
-	if($_COOKIE['chatCfg12']==0)
-	{
-		$_GET['key'] = time();
-	}
-	if($r['key']==$_GET['key'])
-	{
-	//������ ������ �������� ����������
-		unset($r['rn'],$r['list'],$r['key'],$r['xu']);
-	}elseif($_GET['r1']!=0)
-	{
-		$r['rn'] = iconv('cp1251','utf-8',$u->room['name']);
-		$r['list'] = iconv('cp1251','utf-8',$r['list']);
-	}
-	
-	$posts = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` AS `iu` WHERE `iu`.`uid` = "-51'.$u->info['id'].'" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `iu`.`lastUPD` < '.time().' LIMIT 1'));
-	$posts = $posts[0];
-	
-	if($posts > 0) {
-		$r['js'] .= ' $("#postdiv").show();';
-	}else{
-		$r['js'] .= ' $("#postdiv").hide();';
-	}
-	
+$r['key'] = md5($u->room['name'] . '+' . $ar_id . '+' . $ar_lvl . '+' . $ar_all);
+unset($ar_id, $ar_lvl);
+if ($_COOKIE['chatCfg12'] == 0) {
+    $_GET['key'] = time();
+}
+if ($r['key'] == $_GET['key']) {
+    //������ ������ �������� ����������
+    unset($r['rn'], $r['list'], $r['key'], $r['xu']);
+} elseif ($_GET['r1'] != 0) {
+    $r['rn'] = iconv('cp1251', 'utf-8', $u->room['name']);
+    $r['list'] = iconv('cp1251', 'utf-8', $r['list']);
+}
+
+$posts = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` AS `iu` WHERE `iu`.`uid` = "-51' . $u->info['id'] . '" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `iu`.`lastUPD` < ' . time() . ' LIMIT 1'));
+$posts = $posts[0];
+
+if ($posts > 0) {
+    $r['js'] .= ' $("#postdiv").show();';
+} else {
+    $r['js'] .= ' $("#postdiv").hide();';
+}
+
 //����������� �������� � ����
-	$sp = mysql_query('SELECT * FROM `clan_add` WHERE `uid` = "'.$u->info['id'].'" AND `yes` = 0 AND `no` = 0');
-	while( $pl = mysql_fetch_array($sp) ) {
-		$clns = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`align` FROM `clan` WHERE `id` = "'.$pl['clan'].'" LIMIT 1'));
-		$usr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level` FROM `users` WHERE `id` = "'.$pl['uid_clan'].'" LIMIT 1'));
-		$r['js'] .= 'top.inclanNew('.$pl['id'].',"'.$clns['align'].'","'.$clns['id'].'","'.$clns['name'].'","'.$usr['login'].'</b>['.$usr['level'].']<b>");';
-	}
-	unset($clns);
-	
+$sp = mysql_query('SELECT * FROM `clan_add` WHERE `uid` = "' . $u->info['id'] . '" AND `yes` = 0 AND `no` = 0');
+while ($pl = mysql_fetch_array($sp)) {
+    $clns = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`align` FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1'));
+    $usr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level` FROM `users` WHERE `id` = "' . $pl['uid_clan'] . '" LIMIT 1'));
+    $r['js'] .= 'top.inclanNew(' . $pl['id'] . ',"' . $clns['align'] . '","' . $clns['id'] . '","' . $clns['name'] . '","' . $usr['login'] . '</b>[' . $usr['level'] . ']<b>");';
+}
+unset($clns);
+
 //����������� �� �����
-	$trf = mysql_fetch_array(mysql_query('SELECT * FROM `transfers` WHERE `uid2` = "'.$u->info['id'].'" AND `start2` = 0 AND `cancel1` = 0 AND `cancel2` = 0 LIMIT 1'));
-	if(isset($trf['id'])) {
-		$utf = mysql_fetch_array(mysql_query('SELECT `login` FROM `users` WHERE `id` = "'.$trf['uid1'].'" LIMIT 1'));
-		if(isset($utf['login']) && $u->info['battle'] == 0) {
-			$r['js'] .= 'top.intransferNew('.$trf['id'].',"'.$utf['login'].'");';
-		}else{
-			mysql_query('UPDATE `transfers` SET `cancel2` = "'.time().'" WHERE `id` = "'.$trf['id'].'" LIMIT 1');
-		}
-	}
-	
+$trf = mysql_fetch_array(mysql_query('SELECT * FROM `transfers` WHERE `uid2` = "' . $u->info['id'] . '" AND `start2` = 0 AND `cancel1` = 0 AND `cancel2` = 0 LIMIT 1'));
+if (isset($trf['id'])) {
+    $utf = mysql_fetch_array(mysql_query('SELECT `login` FROM `users` WHERE `id` = "' . $trf['uid1'] . '" LIMIT 1'));
+    if (isset($utf['login']) && $u->info['battle'] == 0) {
+        $r['js'] .= 'top.intransferNew(' . $trf['id'] . ',"' . $utf['login'] . '");';
+    } else {
+        mysql_query('UPDATE `transfers` SET `cancel2` = "' . time() . '" WHERE `id` = "' . $trf['id'] . '" LIMIT 1');
+    }
+}
+
 //������������ ������
-	if($r['js']!=NULL)
-	{
-		$r['js'] = iconv('cp1251','utf-8',$r['js']);
-	}else{
-		unset($r['js']);
-	}
-	if($r['msg']!=NULL)
-	{
-		$r['msg'] = iconv('cp1251','utf-8',$r['msg']);
-	}else{
-		unset($r['msg']);
-	}
-	unset($c,$u,$db);
-	$r = json_encode($r);
-	//$r = json_fix_cyr($r);
-	echo $r;
-	unset($r);
-?>
+if ($r['js'] != null) {
+    $r['js'] = iconv('cp1251', 'utf-8', $r['js']);
+} else {
+    unset($r['js']);
+}
+if ($r['msg'] != null) {
+    $r['msg'] = iconv('cp1251', 'utf-8', $r['msg']);
+} else {
+    unset($r['msg']);
+}
+unset($c, $u, $db);
+echo json_encode($r);
\ No newline at end of file
diff --git a/rating_script/index.php b/rating_script/index.php
index 8bb0b4e8..720d6b1a 100644
--- a/rating_script/index.php
+++ b/rating_script/index.php
@@ -1,8 +1,8 @@
 <?
 
 define('GAME',true);
-include('../_incl_data/__config.php');
-include('../_incl_data/class/__db_connect.php');
+require_once('../_incl_data/__config.php');
+require_once('../_incl_data/class/__db_connect.php');
 
 $p = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`sex`,`clan`,`align`,`city`,`cityreg` FROM `users` WHERE `id` = "'.mysql_real_escape_string($_GET['user']).'" LIMIT 1'));
 
-- 
2.45.2


From be3f7a3645fdd01890d0f19da4798ca451bce377 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sat, 25 Jun 2022 21:09:50 +0300
Subject: [PATCH 03/12] =?UTF-8?q?=D0=91=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=87?=
 =?UTF-8?q?=D0=B5=D0=BB=D0=BE=D0=B2=D0=B5=D1=87=D0=B5=D1=81=D0=BA=D0=BE?=
 =?UTF-8?q?=D0=B5=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?=
 =?UTF-8?q?=D0=B8=D0=B5=20=D0=B2=D1=81=D0=B5=D1=85=20=D0=B4=D0=BE=D1=81?=
 =?UTF-8?q?=D1=82=D0=B8=D0=B6=D0=B5=D0=BD=D0=B8=D0=B9.=20=D0=92=20=D0=BE?=
 =?UTF-8?q?=D1=80=D0=B8=D0=B3=D0=B8=D0=BD=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE?=
 =?UTF-8?q?=D0=B5=20=D1=87=D1=82=D0=BE-=D1=82=D0=BE=20=D0=B4=D0=BE=D0=B1?=
 =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=B1=D1=8B=D0=BB=D0=BE=20?=
 =?UTF-8?q?=D0=BD=D0=B5=D0=BF=D1=80=D0=BE=D1=81=D1=82=D0=BE.=20#12?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 modules_data/titul.php | 761 ++++++++++-------------------------------
 1 file changed, 186 insertions(+), 575 deletions(-)

diff --git a/modules_data/titul.php b/modules_data/titul.php
index d7e866fd..e2171e70 100644
--- a/modules_data/titul.php
+++ b/modules_data/titul.php
@@ -7,11 +7,123 @@
 if (!defined('GAME')) {
     die();
 }
-$sunduk1 = "i/titul/nagr1.gif";
-$sunduk2 = "i/titul/nagr2.gif";
-$sunduk3 = "i/titul/nagr3.gif";
-$sunduk4 = "i/titul/nagr4.gif";
-$sunduk5 = "i/titul/nagr5.gif";
+
+const TIERS = 'Ранги';
+const PRIZE = 'Награда';
+
+$achievement_data = [
+    'zb' => [
+        'quest' => 'Выполнить задания бабки.',
+        'check' => ['Заданий', 5, 25, 50, 100, 250],
+        'prize' => array_map(function ($int) {
+            return 'Жетон <br>успеха <br>' . $int;
+        }, [5, 20, 40, 60, 100]),
+        'startlink' => 11
+    ],
+    'vx' => [
+        'quest' => 'Победить в хаотических боях.',
+        'check' => ['Побед', 50, 300, 400, 500, 1000],
+        'prize' => array_map(function ($int) {
+            return $int . 'екр.';
+        }, [25, 50, 75, 100, 200]),
+        'startlink' => 21
+    ],
+    'snt' => [
+        'quest' => 'Открыть сундук трупожора.',
+        'check' => ['Открытий', 5, 25, 50, 100, 250],
+        'prize' => array_map(function ($int) {
+            return $int . 'екр.';
+        }, [10, 25, 50, 75, 200]),
+        'startlink' => 31
+    ],
+    'rp' => [
+        'quest' => 'Получить руну при плавке плохих заготовок. [S]',
+        'check' => ['Рун', 5, 10, 25, 50, 100],
+        'prize' => array_map(function ($int) {
+            return 'Плохие <br> заготовки <br>' . $int;
+        }, [5, 7, 10, 12, 15]),
+        'startlink' => 41
+    ],
+    'rn' => [
+        'quest' => 'Получить руну при плавке нормальных заготовок. [M]',
+        'check' => ['Рун', 5, 10, 15, 25, 50],
+        'prize' => array_map(function ($int) {
+            return 'Нормальные <br> заготовки <br>' . $int;
+        }, [5, 7, 9, 12, 15]),
+        'startlink' => 51
+    ],
+    'rb' => [
+        'quest' => 'Получить руну при плавке идеальных заготовок. [L]',
+        'check' => ['Рун', 2, 5, 8, 11, 15],
+        'prize' => array_map(function ($int) {
+            return 'Идеальные <br> заготовки <br>' . $int;
+        }, [2, 4, 6, 10, 15]),
+        'startlink' => 61
+    ],
+    'pg' => [
+        'quest' => 'Поучаствовать в героическом сражении.',
+        'check' => ['Участий', 100, 200, 400, 600, 1000],
+        'prize' => array_map(function ($int) {
+            return 'Жетон <br>успеха <br>' . $int;
+        }, [10, 20, 40, 60, 80]),
+        'startlink' => 71
+    ],
+    'bv' => [
+        'quest' => 'Продать бабушке найденные вещи в пещере.',
+        'check' => ['Продаж', 5, 25, 50, 100, 250],
+        'prize' => array_map(function ($int) {
+            return $int . 'кр.';
+        }, [500, 1000, 2000, 4000, 5000]),
+        'startlink' => 81
+    ],
+    'kw' => [
+        'quest' => 'Победить в клановой войне.',
+        'check' => ['Побед', 5, 10, 15, 20, 25],
+        'prize' => array_map(function ($int) {
+            return 'Свиток <br> кланового<br> опыта ' . $int;
+        }, [1, 2, 5, 10, 15]),
+        'startlink' => 91
+    ],
+    'pa' => [ # not implemented!
+        'quest' => 'Получить покровительство Ангела.',
+        'check' => ['Получено', 5, 25, 50, 100, 250],
+        'prize' => null,
+        'startlink' => null
+    ],
+    'bs' => [
+        'quest' => 'Победы в башне смерти.',
+        'check' => ['Побед', 1, 5, 10, 50, 500],
+        'prize' => array_map(function ($int) {
+            return $int . 'екр.';
+        }, [1, 5, 10, 50, 200]),
+        'startlink' => 101
+    ],
+    'trn' => [ # not implemented!
+        'quest' => 'Победы в турнирах.',
+        'check' => ['Побед', 25, 50, 100, 200, 500],
+        'prize' => array_map(function ($int) {
+            return $int . 'екр.';
+        }, [25, 25, 25, 25, 50]),
+        'startlink' => null
+    ],
+];
+
+function table($rows, $class = '', $fill = false)
+{
+    $c = '';
+    $max_rows = sizeof(max($rows));
+
+    foreach ($rows as $row) {
+        if ($fill && sizeof($row) < $max_rows) {
+            $row = array_merge($row, array_fill(0, $max_rows - sizeof($row), ''));
+        }
+
+        $c .= '<tr><td>' . implode('</td><td>', $row) . '</td></tr>';
+    }
+
+    return (!empty($class) ? "<table class='$class'>" : '<table>') . $c . '</table>' . PHP_EOL;
+}
+
 $ai = $u->achivInf($u->info['id'], 1);
 if (isset($_GET['nagr'])) {
     if ( //Это надо переписать полностью. Эта проверка - сраный костыль.
@@ -435,580 +547,79 @@ if (isset($_GET['nagr'])) {
     //-------------
     mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $nagrtxt . "','-1','6','0')");
 }
+function drawSunduk($nagr, $whatInside, $tier)
+{
+    echo vsprintf('<img onclick="%s" onmouseover="%s" onmouseout="%s" onmousedown="%s" class="cp" src="%s" alt="Сундук">',
+        [
+            "location.href='\main.php?titul&nagr=$nagr'",
+            "top.hi(this, '<b>Сундук $tier ранга<hr>Содержит:<hr> $whatInside</b>', event, 2, 0, 1, 1, 'max-width:307px')",
+            "top.hic();",
+            "top.hic();",
+            "https://img.new-combats.com/i/titul/nagr$tier.gif"
+        ]);
+}
 
 ?>
 
-<P align=right><INPUT class="btn" TYPE=button value="Подсказка"
-                      onclick="window.open('/encicl/help/titul.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')">
-    <INPUT TYPE="button" class="btn" onClick="top.frames['main'].location = 'main.php';" value="Вернуться" name=edit>
-</P>
+<style>
+    /* for table() function */
+    table.prizelist {
+        border-spacing: 1px;
+        border-collapse: separate;
+        min-width: 500px;
+    }
+
+    table.prizelist tr {
+        background-color: #C7C7C7;
+    }
+
+    table.prizelist td {
+        padding: 3px;
+        text-align: center;
+    }
+
+    table.prizelist td:first-child {
+        width: 100px;
+    }
+
+    table.prizelist tr:first-child,
+    table.prizelist td:first-child {
+        background-color: #a5a5a5;
+    }
+</style>
+
+<div style="text-align: right;">
+    <input class="btn" type="button" value="Подсказка"
+           onclick="window.open('/encicl/help/titul.html', 'help', 'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')">
+    <input class="btn" type="button" value="Вернуться" onClick="top.frames['main'].location = 'main.php';" name=edit>
+</div>
+
 <H3>Достижения</H3>
 
-<? $zd = 'zb'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Выполнить задания бабки.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Выполнить задания бабки.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Заданий</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">25</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">100</td>
-        <td style="text-align: center;">250</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">Жетон <br>успеха <br>5</td>
-        <td style="text-align: center;">Жетон <br>успеха <br>20</td>
-        <td style="text-align: center;">Жетон <br>успеха <br>40</td>
-        <td style="text-align: center;">Жетон <br>успеха <br>60</td>
-        <td style="text-align: center;">Жетон <br>успеха <br>100</td>
-    </tr>
-</table>
-</body>
-
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Бабка задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=11\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>жетоны успеха: 1</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=12\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>жетоны успеха: 2</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=13\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>жетоны успеха: 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=14\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>жетоны успеха: 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=15\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>жетоны успеха: 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
+<?php
+foreach ($achievement_data as $key => $value) {
+    echo '<h4>' . $ai['name' . $key] . '</h4>';
+    echo '<strong>' . $value[$key]['quest'] . '</strong>';
+    echo 'Сейчас у Вас Ранг: <strong>' . $ai['klas' . $key] . '</strong>';
+    echo 'Количество выполнений: <strong>' . $ai[$key] . ' =' . $ai['klasP' . $key] . '%</strong>';
+    echo table([
+        [TIERS, 1, 2, 3, 4, 5],
+        $value[$key]['check'],
+        array_merge([PRIZE], $value[$key]['prize'])
+    ], 'prizelist', true);
+    # If has new tier, AND only first 5 tiers AND prize is set.
+    if (
+        $ai['klas' . $key] > $ai[$key . '_n'] &&
+        in_array($ai[$key . '_n'], [0, 1, 2, 3, 4]) &&
+        !empty($value[$key]['prize']) &&
+        !empty($value[$key]['startlink'])
+    ) {
+        echo '<br>' . PRIZE . ':<br>';
+        drawSunduk(
+            $ai[$key . '_n'] + $value[$key]['startlink'],
+            $value[$key]['prize'][$ai[$key . '_n']],
+            $ai[$key . '_n'] + $value[$key]['startlink']
+        );
     }
+    echo '<hr>';
 }
-?>
-<hr>
-<? $zd = 'vx'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Победить в хаотических боях.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Победить в хаотических боях.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">300</td>
-        <td style="text-align: center;">400</td>
-        <td style="text-align: center;">500</td>
-        <td style="text-align: center;">1000</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">25 екр.</td>
-        <td style="text-align: center;">50 екр.</td>
-        <td style="text-align: center;">75 екр.</td>
-        <td style="text-align: center;">100 екр.</td>
-        <td style="text-align: center;">200 екр.</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Хаот задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=21\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>25 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=22\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>50 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=23\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>75 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=24\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>100 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=25\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>200 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'snt'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Открыть сундук трупожора.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Открыть сундук трупожора.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Открытий</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">25</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">100</td>
-        <td style="text-align: center;">250</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">10 екр.</td>
-        <td style="text-align: center;">25 екр.</td>
-        <td style="text-align: center;">50 екр.</td>
-        <td style="text-align: center;">75 екр.</td>
-        <td style="text-align: center;">200 екр.</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Сундук задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=31\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>10 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=32\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>25 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=33\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>50 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=34\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>75 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=35\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>200 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'rp'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Получить руну при плавке плохих заготовок. ( S руну )</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Получить руну при плавке плохих заготовок. ( S руну )</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Рун</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">10</td>
-        <td style="text-align: center;">25</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">100</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">Плохие <br> заготовки <br> 5</td>
-        <td style="text-align: center;">Плохие <br> заготовки <br> 7</td>
-        <td style="text-align: center;">Плохие <br> заготовки <br> 10</td>
-        <td style="text-align: center;">Плохие <br> заготовки <br> 12</td>
-        <td style="text-align: center;">Плохие <br> заготовки <br> 15</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //S задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=41\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Плохие заготовки 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=42\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Плохие заготовки 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=43\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Плохие заготовки 15</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=44\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Плохие заготовки 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=45\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Плохие заготовки 25</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'rn'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Получить руну при плавке нормальных заготовок. ( M руну )</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Получить руну при плавке нормальных заготовок. ( M руну )</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Рун</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">10</td>
-        <td style="text-align: center;">15</td>
-        <td style="text-align: center;">25</td>
-        <td style="text-align: center;">50</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">Нормальные <br> заготовки <br> 5</td>
-        <td style="text-align: center;">Нормальные <br> заготовки <br> 7</td>
-        <td style="text-align: center;">Нормальные <br> заготовки <br> 9</td>
-        <td style="text-align: center;">Нормальные <br> заготовки <br> 12</td>
-        <td style="text-align: center;">Нормальные <br> заготовки <br> 15</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //M задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=51\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Нормальные заготовки 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=52\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Нормальные заготовки 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=53\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Нормальные заготовки 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=54\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Нормальные заготовки 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=55\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Нормальные заготовки 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'rb'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Получить руну при плавке идеальных заготовок. ( L руну )</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Получить руну при плавке идеальных заготовок. ( L руну )</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Рун</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">8</td>
-        <td style="text-align: center;">11</td>
-        <td style="text-align: center;">15</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">Идеальные <br> заготовки <br> 2</td>
-        <td style="text-align: center;">Идеальные <br> заготовки <br> 4</td>
-        <td style="text-align: center;">Идеальные <br> заготовки <br> 6</td>
-        <td style="text-align: center;">Идеальные <br> заготовки <br> 10</td>
-        <td style="text-align: center;">Идеальные <br> заготовки <br> 15</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //L задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=61\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Идеальные заготовки 5</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=62\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Идеальные заготовки 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=63\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Идеальные заготовки 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=64\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Идеальные заготовки 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=65\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Идеальные заготовки 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'pg'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Поучаствовать в героическом сражении.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Поучаствовать в героическом сражении.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Участий</td>
-        <td style="text-align: center;">100</td>
-        <td style="text-align: center;">200</td>
-        <td style="text-align: center;">400</td>
-        <td style="text-align: center;">600</td>
-        <td style="text-align: center;">1000</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">Жетон <br> Успеха <br> 10</td>
-        <td style="text-align: center;">Жетон <br> Успеха <br> 20</td>
-        <td style="text-align: center;">Жетон <br> Успеха <br> 40</td>
-        <td style="text-align: center;">Жетон <br> Успеха <br> 60</td>
-        <td style="text-align: center;">Жетон <br> Успеха <br> 80</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Героик задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=71\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Жетон Успеха 10</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=72\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Жетон Успеха 20</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=73\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Жетон Успеха 40</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=74\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Жетон Успеха 60</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=75\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Жетон Успеха 80</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'bv'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Продать бабушке найденные вещи в пещере.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Продать бабушке найденные вещи в пещере.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Продаж</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">25</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">100</td>
-        <td style="text-align: center;">250</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">500кр.</td>
-        <td style="text-align: center;">1000кр.</td>
-        <td style="text-align: center;">2000кр.</td>
-        <td style="text-align: center;">4000кр.</td>
-        <td style="text-align: center;">5000кр.</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Героик задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=81\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>500кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=82\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>1000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=83\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>2000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=84\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>4000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=85\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>5000кр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'kw'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Победить в клановой войне.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Победить в клановой войне.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">25</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">100</td>
-        <td style="text-align: center;">250</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;">Свиток <br> кланового<br> опыта 1</td>
-        <td style="text-align: center;">Свиток <br> кланового<br> опыта 2</td>
-        <td style="text-align: center;">Свиток <br> кланового<br> опыта 5</td>
-        <td style="text-align: center;">Свиток <br> кланового<br> опыта 10</td>
-        <td style="text-align: center;">Свиток <br> кланового<br> опыта 15</td>
-    </tr>
-</table>
-</body>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Клан вар задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=91\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 1.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=92\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 2.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=93\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 5.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=94\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 10.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=95\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>Свиток <br> кланового<br> опыта 15.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-<? $zd = 'pa'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Получить покровительство Ангела.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Получить покровительство Ангела.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">25</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">100</td>
-        <td style="text-align: center;">250</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;"> -</td>
-        <td style="text-align: center;"> -</td>
-        <td style="text-align: center;"> -</td>
-        <td style="text-align: center;"> -</td>
-        <td style="text-align: center;"> -</td>
-    </tr>
-</table>
-</body>
-<hr>
-<? $zd = 'bs'; ?>
-<H4><? echo $ai['name' . $zd]; ?></H4>
-<b>Победы в башне смерти.</b><br>
-Сейчас у Вас Ранг: <b><? echo $ai['klas' . $zd]; ?></b>. Количество выполнений: <b><? echo $ai[$zd]; ?>
-    =<? echo $ai['klasP' . $zd]; ?>%</b><br>
-<title>Получить покровительство Ангела.</title>
-</head>
-<body>
-<table border="0" cellpadding="3" cellspacing="1">
-    <tr bgcolor="#A5A5A5">
-        <td style="text-align: center;">Ранги</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">2</td>
-        <td style="text-align: center;">3</td>
-        <td style="text-align: center;">4</td>
-        <td style="text-align: center;">5</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Побед</td>
-        <td style="text-align: center;">1</td>
-        <td style="text-align: center;">5</td>
-        <td style="text-align: center;">10</td>
-        <td style="text-align: center;">50</td>
-        <td style="text-align: center;">500</td>
-    </tr>
-    <tr bgcolor="#C7C7C7">
-        <td bgcolor="#A5A5A5" style="text-align: center;">Награда</td>
-        <td style="text-align: center;"> 1 Екр.</td>
-        <td style="text-align: center;"> 5 Екр.</td>
-        <td style="text-align: center;"> 10 Екр.</td>
-        <td style="text-align: center;"> 50 Екр.</td>
-        <td style="text-align: center;"> 200 Екр.</td>
-    </tr>
-</table>
-<?
-if ($ai['klas' . $zd] > $ai[$zd . '_n']) //Хаот задание
-{
-    echo '<br>Награда:<br>';
-    if ($ai[$zd . '_n'] == 0) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=101\';" onMouseOver="top.hi(this,\'<b>Сундук 1 Ранга<hr>Содержит:<hr>1 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk1 . '">';
-    } elseif ($ai[$zd . '_n'] == 1) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=102\';" onMouseOver="top.hi(this,\'<b>Сундук 2 Ранга<hr>Содержит:<hr>5 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk2 . '">';
-    } elseif ($ai[$zd . '_n'] == 2) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=103\';" onMouseOver="top.hi(this,\'<b>Сундук 3 Ранга<hr>Содержит:<hr>10 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk3 . '">';
-    } elseif ($ai[$zd . '_n'] == 3) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=104\';" onMouseOver="top.hi(this,\'<b>Сундук 4 Ранга<hr>Содержит:<hr>50 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk4 . '">';
-    } elseif ($ai[$zd . '_n'] == 4) {
-        echo '<img onclick="location.href=\'/main.php?titul&nagr=105\';" onMouseOver="top.hi(this,\'<b>Сундук 5 Ранга<hr>Содержит:<hr>200 екр.</b>\',event,2,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();" class="cp" src="https://img.new-combats.com/' . $sunduk5 . '">';
-    }
-}
-?>
-<hr>
-
-<?= '<br>' . $red ?>
\ No newline at end of file
-- 
2.45.2


From 88e00b1e81c0b31bfa346bbc7a18ca21e0cf33c6 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sat, 25 Jun 2022 23:20:46 +0300
Subject: [PATCH 04/12] =?UTF-8?q?=D0=91=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=87?=
 =?UTF-8?q?=D0=B5=D0=BB=D0=BE=D0=B2=D0=B5=D1=87=D0=B5=D1=81=D0=BA=D0=B8?=
 =?UTF-8?q?=D0=B5=20=D0=B2=D1=8B=D0=B4=D1=8B=D1=87=D0=B8=20=D0=BD=D0=B0?=
 =?UTF-8?q?=D0=B3=D1=80=D0=B0=D0=B4.=20#12?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 modules_data/titul.php | 651 +++++++++++------------------------------
 1 file changed, 175 insertions(+), 476 deletions(-)

diff --git a/modules_data/titul.php b/modules_data/titul.php
index e2171e70..fa5d3914 100644
--- a/modules_data/titul.php
+++ b/modules_data/titul.php
@@ -1,9 +1,12 @@
-<script language='JavaScript'>
-    var elem = document.getElementById('se-pre-con');
+<script>
+    let elem = document.getElementById('se-pre-con');
     elem.parentNode.removeChild(elem);
 </script>
 
 <?php
+
+use Insallah\Db;
+
 if (!defined('GAME')) {
     die();
 }
@@ -15,73 +18,55 @@ $achievement_data = [
     'zb' => [
         'quest' => 'Выполнить задания бабки.',
         'check' => ['Заданий', 5, 25, 50, 100, 250],
-        'prize' => array_map(function ($int) {
-            return 'Жетон <br>успеха <br>' . $int;
-        }, [5, 20, 40, 60, 100]),
+        'prize' => ['Жетон <br>успеха <br>', 5, 20, 40, 60, 100],
         'startlink' => 11
     ],
     'vx' => [
         'quest' => 'Победить в хаотических боях.',
         'check' => ['Побед', 50, 300, 400, 500, 1000],
-        'prize' => array_map(function ($int) {
-            return $int . 'екр.';
-        }, [25, 50, 75, 100, 200]),
+        'prize' => ['екр.', 25, 50, 75, 100, 200],
         'startlink' => 21
     ],
     'snt' => [
         'quest' => 'Открыть сундук трупожора.',
         'check' => ['Открытий', 5, 25, 50, 100, 250],
-        'prize' => array_map(function ($int) {
-            return $int . 'екр.';
-        }, [10, 25, 50, 75, 200]),
+        'prize' => ['екр.', 10, 25, 50, 75, 200],
         'startlink' => 31
     ],
     'rp' => [
         'quest' => 'Получить руну при плавке плохих заготовок. [S]',
         'check' => ['Рун', 5, 10, 25, 50, 100],
-        'prize' => array_map(function ($int) {
-            return 'Плохие <br> заготовки <br>' . $int;
-        }, [5, 7, 10, 12, 15]),
+        'prize' => ['Плохие <br> заготовки <br>', 5, 7, 10, 12, 15],
         'startlink' => 41
     ],
     'rn' => [
         'quest' => 'Получить руну при плавке нормальных заготовок. [M]',
         'check' => ['Рун', 5, 10, 15, 25, 50],
-        'prize' => array_map(function ($int) {
-            return 'Нормальные <br> заготовки <br>' . $int;
-        }, [5, 7, 9, 12, 15]),
+        'prize' => ['Нормальные <br> заготовки <br>', 5, 7, 9, 12, 15],
         'startlink' => 51
     ],
     'rb' => [
         'quest' => 'Получить руну при плавке идеальных заготовок. [L]',
         'check' => ['Рун', 2, 5, 8, 11, 15],
-        'prize' => array_map(function ($int) {
-            return 'Идеальные <br> заготовки <br>' . $int;
-        }, [2, 4, 6, 10, 15]),
+        'prize' => ['Идеальные <br> заготовки <br>', 2, 4, 6, 10, 15],
         'startlink' => 61
     ],
     'pg' => [
         'quest' => 'Поучаствовать в героическом сражении.',
         'check' => ['Участий', 100, 200, 400, 600, 1000],
-        'prize' => array_map(function ($int) {
-            return 'Жетон <br>успеха <br>' . $int;
-        }, [10, 20, 40, 60, 80]),
+        'prize' => ['Жетон <br>успеха <br>', 10, 20, 40, 60, 80],
         'startlink' => 71
     ],
     'bv' => [
         'quest' => 'Продать бабушке найденные вещи в пещере.',
         'check' => ['Продаж', 5, 25, 50, 100, 250],
-        'prize' => array_map(function ($int) {
-            return $int . 'кр.';
-        }, [500, 1000, 2000, 4000, 5000]),
+        'prize' => ['кр.', 500, 1000, 2000, 4000, 5000],
         'startlink' => 81
     ],
     'kw' => [
         'quest' => 'Победить в клановой войне.',
         'check' => ['Побед', 5, 10, 15, 20, 25],
-        'prize' => array_map(function ($int) {
-            return 'Свиток <br> кланового<br> опыта ' . $int;
-        }, [1, 2, 5, 10, 15]),
+        'prize' => ['Свиток <br> кланового<br> опыта ', 1, 2, 5, 10, 15],
         'startlink' => 91
     ],
     'pa' => [ # not implemented!
@@ -93,17 +78,13 @@ $achievement_data = [
     'bs' => [
         'quest' => 'Победы в башне смерти.',
         'check' => ['Побед', 1, 5, 10, 50, 500],
-        'prize' => array_map(function ($int) {
-            return $int . 'екр.';
-        }, [1, 5, 10, 50, 200]),
+        'prize' => ['екр.', 1, 5, 10, 50, 200],
         'startlink' => 101
     ],
     'trn' => [ # not implemented!
         'quest' => 'Победы в турнирах.',
         'check' => ['Побед', 25, 50, 100, 200, 500],
-        'prize' => array_map(function ($int) {
-            return $int . 'екр.';
-        }, [25, 25, 25, 25, 50]),
+        'prize' => ['екр.', 25, 25, 25, 25, 50],
         'startlink' => null
     ],
 ];
@@ -126,430 +107,139 @@ function table($rows, $class = '', $fill = false)
 
 $ai = $u->achivInf($u->info['id'], 1);
 if (isset($_GET['nagr'])) {
-    if ( //Это надо переписать полностью. Эта проверка - сраный костыль.
+    $nagrtxt = 'За выполненное достижение Вы получили ';
+    if (
         in_array($_GET['nagr'], [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]) &&
         $u->info['level'] < 9
     ) {
         $nagrtxt = 'Вы не можете получить эту награду на этом уровне!';
-    } else
-
-        //бабка задание zb
-        if ($_GET['nagr'] == 11 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'zb');
-            $ai['zb_n'] = 1;
-            $i = 0;
-            $colvo = 5;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 12 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'zb');
-            $ai['zb_n'] = 2;
-            $i = 0;
-            $colvo = 20;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 13 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'zb');
-            $ai['zb_n'] = 3;
-            $i = 0;
-            $colvo = 40;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 14 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'zb');
-            $ai['zb_n'] = 4;
-            $i = 0;
-            $colvo = 60;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 15 && $ai['klaszb'] > $ai['zb_n'] && $ai['zb_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'zb');
-            $ai['zb_n'] = 5;
-            $i = 0;
-            $colvo = 100;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон успеха X' . $colvo;
-        } //Хаот задание vx
-        elseif ($_GET['nagr'] == 21 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'vx');
-            $ai['vx_n'] = 1;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 25) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 25 екр.';
-        } elseif ($_GET['nagr'] == 22 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'vx');
-            $ai['vx_n'] = 2;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 50 екр.';
-        } elseif ($_GET['nagr'] == 23 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'vx');
-            $ai['vx_n'] = 3;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 75) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 75 екр.';
-        } elseif ($_GET['nagr'] == 24 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'vx');
-            $ai['vx_n'] = 4;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 100) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 100 екр.';
-        } elseif ($_GET['nagr'] == 25 && $ai['klasvx'] > $ai['vx_n'] && $ai['vx_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'vx');
-            $ai['vx_n'] = 5;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 200 екр.';
-        } //Сундуки трупожора snt 10/15/20/25/50
-        elseif ($_GET['nagr'] == 31 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'snt');
-            $ai['snt_n'] = 1;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 10) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 10 екр.';
-        } elseif ($_GET['nagr'] == 32 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'snt');
-            $ai['snt_n'] = 2;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 25) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 25 екр.';
-        } elseif ($_GET['nagr'] == 33 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'snt');
-            $ai['snt_n'] = 3;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 50 екр.';
-        } elseif ($_GET['nagr'] == 34 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'snt');
-            $ai['snt_n'] = 4;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 75) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 75 екр.';
-        } elseif ($_GET['nagr'] == 35 && $ai['klassnt'] > $ai['snt_n'] && $ai['snt_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'snt');
-            $ai['snt_n'] = 5;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 200екр.';
-        } //Руны 8 лвл. rp 5/10/15/20/25
-        elseif ($_GET['nagr'] == 41 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'rp');
-            $ai['rp_n'] = 1;
-            $i = 0;
-            $colvo = 5;
-            while ($i < $colvo) {
-                $u->addItem(10038, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 42 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'rp');
-            $ai['rp_n'] = 2;
-            $i = 0;
-            $colvo = 7;
-            while ($i < $colvo) {
-                $u->addItem(10038, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 43 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'rp');
-            $ai['rp_n'] = 3;
-            $i = 0;
-            $colvo = 10;
-            while ($i < $colvo) {
-                $u->addItem(10038, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 44 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'rp');
-            $ai['rp_n'] = 4;
-            $i = 0;
-            $colvo = 12;
-            while ($i < $colvo) {
-                $u->addItem(10038, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 45 && $ai['klasrp'] > $ai['rp_n'] && $ai['rp_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'rp');
-            $ai['rp_n'] = 5;
-            $i = 0;
-            $colvo = 15;
-            while ($i < $colvo) {
-                $u->addItem(10038, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Плохие Заготовки X' . $colvo;
-        } //Руны 9 лвл. rn 5/10/20/40/60
-        elseif ($_GET['nagr'] == 51 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'rn');
-            $ai['rn_n'] = 1;
-            $i = 0;
-            $colvo = 5;
-            while ($i < $colvo) {
-                $u->addItem(10039, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 52 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'rn');
-            $ai['rn_n'] = 2;
-            $i = 0;
-            $colvo = 7;
-            while ($i < $colvo) {
-                $u->addItem(10039, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 53 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'rn');
-            $ai['rn_n'] = 3;
-            $i = 0;
-            $colvo = 9;
-            while ($i < $colvo) {
-                $u->addItem(10039, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 54 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'rn');
-            $ai['rn_n'] = 4;
-            $i = 0;
-            $colvo = 12;
-            while ($i < $colvo) {
-                $u->addItem(10039, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 55 && $ai['klasrn'] > $ai['rn_n'] && $ai['rn_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'rn');
-            $ai['rn_n'] = 5;
-            $i = 0;
-            $colvo = 15;
-            while ($i < $colvo) {
-                $u->addItem(10039, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Нормальные заготовки X' . $colvo;
-        } //Руны 10 лвл. rb 2/4/6/10/15
-        elseif ($_GET['nagr'] == 61 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'rb');
-            $ai['rb_n'] = 1;
-            $i = 0;
-            $colvo = 2;
-            while ($i < $colvo) {
-                $u->addItem(10040, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 62 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'rb');
-            $ai['rb_n'] = 2;
-            $i = 0;
-            $colvo = 4;
-            while ($i < $colvo) {
-                $u->addItem(10040, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 63 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'rb');
-            $ai['rb_n'] = 3;
-            $i = 0;
-            $colvo = 6;
-            while ($i < $colvo) {
-                $u->addItem(10040, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 64 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'rb');
-            $ai['rb_n'] = 4;
-            $i = 0;
-            $colvo = 10;
-            while ($i < $colvo) {
-                $u->addItem(10040, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
-        } elseif ($_GET['nagr'] == 65 && $ai['klasrb'] > $ai['rb_n'] && $ai['rb_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'rb');
-            $ai['rb_n'] = 5;
-            $i = 0;
-            $colvo = 15;
-            while ($i < $colvo) {
-                $u->addItem(10040, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Идеальные заготовки X' . $colvo;
-        } //Героик  pg 10/20/40/60/80
-        elseif ($_GET['nagr'] == 71 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'pg');
-            $ai['pg_n'] = 1;
-            $i = 0;
-            $colvo = 10;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 72 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'pg');
-            $ai['pg_n'] = 2;
-            $i = 0;
-            $colvo = 20;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 73 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'pg');
-            $ai['pg_n'] = 3;
-            $i = 0;
-            $colvo = 40;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 74 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'pg');
-            $ai['pg_n'] = 4;
-            $i = 0;
-            $colvo = 60;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
-        } elseif ($_GET['nagr'] == 75 && $ai['klaspg'] > $ai['pg_n'] && $ai['pg_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'pg');
-            $ai['pg_n'] = 5;
-            $i = 0;
-            $colvo = 80;
-            while ($i < $colvo) {
-                $u->addItem(10020, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Жетон Успеха X' . $colvo;
-        } //Продать бабушке найденные вещи в пещере bv 500/1000/2000/4000/5000
-        elseif ($_GET['nagr'] == 81 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'bv');
-            $ai['bv_n'] = 1;
-            mysql_query('UPDATE `users` SET `money` = (`money` + 500) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 500 кр.';
-        } elseif ($_GET['nagr'] == 82 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'bv');
-            $ai['bv_n'] = 2;
-            mysql_query('UPDATE `users` SET `money` = (`money` + 1000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 1000 кр.';
-        } elseif ($_GET['nagr'] == 83 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'bv');
-            $ai['bv_n'] = 3;
-            mysql_query('UPDATE `users` SET `money` = (`money` + 2000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 2000 кр.';
-        } elseif ($_GET['nagr'] == 84 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'bv');
-            $ai['bv_n'] = 4;
-            mysql_query('UPDATE `users` SET `money` = (`money` + 4000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 4000 кр.';
-        } elseif ($_GET['nagr'] == 85 && $ai['klasbv'] > $ai['bv_n'] && $ai['bv_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'bv');
-            $ai['bv_n'] = 5;
-            mysql_query('UPDATE `users` SET `money` = (`money` + 5000) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 5000 кр.';
-        } //Клан вар  kw 4917
-        elseif ($_GET['nagr'] == 91 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'kw');
-            $ai['kw_n'] = 1;
-            $i = 0;
-            $colvo = 1;
-            while ($i < $colvo) {
-                $u->addItem(4917, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
-        } elseif ($_GET['nagr'] == 92 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'kw');
-            $ai['kw_n'] = 2;
-            $i = 0;
-            $colvo = 2;
-            while ($i < $colvo) {
-                $u->addItem(4917, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
-        } elseif ($_GET['nagr'] == 93 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'kw');
-            $ai['kw_n'] = 3;
-            $i = 0;
-            $colvo = 5;
-            while ($i < $colvo) {
-                $u->addItem(4917, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
-        } elseif ($_GET['nagr'] == 94 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'kw');
-            $ai['kw_n'] = 4;
-            $i = 0;
-            $colvo = 10;
-            while ($i < $colvo) {
-                $u->addItem(4917, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
-        } elseif ($_GET['nagr'] == 95 && $ai['klaskw'] > $ai['kw_n'] && $ai['kw_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'kw');
-            $ai['kw_n'] = 5;
-            $i = 0;
-            $colvo = 15;
-            while ($i < $colvo) {
-                $u->addItem(4917, $u->info['id'], '');
-                $i++;
-            }
-            $nagrtxt = 'За выполненное достижение, Вы получили Клановый опыт +50000 X' . $colvo;
-        } //Башня смерти задание bs
-        elseif ($_GET['nagr'] == 101 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 0) {
-            $u->rangup($u->info['id'], 1, 'bs');
-            $ai['bs_n'] = 1;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 1) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 1 екр.';
-        } elseif ($_GET['nagr'] == 102 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 1) {
-            $u->rangup($u->info['id'], 2, 'bs');
-            $ai['bs_n'] = 2;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 5) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 5 екр.';
-        } elseif ($_GET['nagr'] == 103 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 2) {
-            $u->rangup($u->info['id'], 3, 'bs');
-            $ai['bs_n'] = 3;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 10) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 10 екр.';
-        } elseif ($_GET['nagr'] == 104 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 3) {
-            $u->rangup($u->info['id'], 4, 'bs');
-            $ai['bs_n'] = 4;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 50) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 50 екр.';
-        } elseif ($_GET['nagr'] == 105 && $ai['klasbs'] > $ai['bs_n'] && $ai['bs_n'] == 4) {
-            $u->rangup($u->info['id'], 5, 'bs');
-            $ai['bs_n'] = 5;
-            mysql_query('UPDATE `users` SET `money2` = (`money2` + 200) WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-            $nagrtxt = 'За выполненное достижение, Вы получили 200 екр.';
+    } elseif ( //бабка задание zb
+        in_array($_GET['nagr'], [11, 12, 13, 14, 15]) &&
+        in_array($ai['zb_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klaszb'] > $ai['zb_n']
+    ) {
+        $ai['zb_n'] += 1;
+        $u->rangup($u->info['id'], $ai['zb_n'], 'zb');
+        $i = 0;
+        while ($i < $achievement_data['zb']['prize'][$ai['zb_n']]) {
+            $u->addItem(10020, $u->info['id'], '');
+            $i++;
         }
+        $nagrtxt .= 'Жетон успеха X' . $achievement_data['zb']['prize'][$ai['zb_n']];
+    } elseif ( //Хаот задание vx
+        in_array($_GET['nagr'], [21, 22, 23, 24, 25]) &&
+        in_array($ai['vx_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klasvx'] > $ai['vx_n']
+    ) {
+        $ai['vx_n'] += 1;
+        $u->rangup($u->info['id'], $ai['vx_n'], 'vx');
+        Db::sql('update users set money2 = money2 + ? where id = ?',
+            [$achievement_data['vx']['prize'][$ai['vx_n']], $u->info['id']]);
+        $nagrtxt .= $achievement_data['vx']['prize'][$ai['vx_n']] . $achievement_data['vx']['prize'][0];
+    } elseif ( //Сундуки трупожора snt
+        in_array($_GET['nagr'], [31, 32, 33, 34, 35]) &&
+        in_array($ai['snt_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klassnt'] > $ai['snt_n']
+    ) {
+        $ai['snt_n'] += 1;
+        $u->rangup($u->info['id'], $ai['snt_n'], 'snt');
+        Db::sql('update users set money2 = money2 + ? where id = ?',
+            [$achievement_data['snt']['prize'][$ai['snt_n']], $u->info['id']]);
+        $nagrtxt .= $achievement_data['snt']['prize'][$ai['snt_n']] . $achievement_data['snt']['prize'][0];
+    } elseif ( //Руны 8 лвл. rp
+        in_array($_GET['nagr'], [41, 42, 43, 44, 45]) &&
+        in_array($ai['rp_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klasrp'] > $ai['rp_n']
+    ) {
+        $ai['rp_n'] += 1;
+        $u->rangup($u->info['id'], $ai['rp_n'], 'rp');
+        $i = 0;
+        while ($i < $achievement_data['rp']['prize'][$ai['rp_n']]) {
+            $u->addItem(10038, $u->info['id'], '');
+            $i++;
+        }
+        $nagrtxt .= 'Плохие Заготовки X' . $achievement_data['rp']['prize'][$ai['rp_n']];
+    } elseif ( //Руны 9 лвл. rn
+        in_array($_GET['nagr'], [51, 52, 53, 54, 55]) &&
+        in_array($ai['rn_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klasrn'] > $ai['rn_n']
+    ) {
+        $ai['rn_n'] += 1;
+        $u->rangup($u->info['id'], $ai['rn_n'], 'rn');
+        $i = 0;
+        while ($i < $achievement_data['rn']['prize'][$ai['rn_n']]) {
+            $u->addItem(10039, $u->info['id'], '');
+            $i++;
+        }
+        $nagrtxt .= 'Нормальные Заготовки X' . $achievement_data['rn']['prize'][$ai['rn_n']];
+    } elseif ( //Руны 10 лвл. rb
+        in_array($_GET['nagr'], [61, 62, 63, 64, 65]) &&
+        in_array($ai['rb_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klasrb'] > $ai['rb_n']
+    ) {
+        $ai['rb_n'] += 1;
+        $u->rangup($u->info['id'], $ai['rb_n'], 'rb');
+        $i = 0;
+        while ($i < $achievement_data['rb']['prize'][$ai['rb_n']]) {
+            $u->addItem(10040, $u->info['id'], '');
+            $i++;
+        }
+        $nagrtxt .= 'Идеальные Заготовки X' . $achievement_data['rb']['prize'][$ai['rb_n']];
+    } elseif ( //Героик pg
+        in_array($_GET['nagr'], [71, 72, 73, 74, 75]) &&
+        in_array($ai['pg_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klaspg'] > $ai['pg_n']
+    ) {
+        $ai['pg_n'] += 1;
+        $u->rangup($u->info['id'], $ai['pg_n'], 'pg');
+        $i = 0;
+        while ($i < $achievement_data['pg']['prize'][$ai['pg_n']]) {
+            $u->addItem(10020, $u->info['id'], '');
+            $i++;
+        }
+        $nagrtxt .= 'Жетон Успеха X' . $achievement_data['pg']['prize'][$ai['pg_n']];
+    } elseif ( //Продать бабушке найденные вещи в пещере bv
+        in_array($_GET['nagr'], [81, 82, 83, 84, 85]) &&
+        in_array($ai['bv_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klasbv'] > $ai['bv_n']
+    ) {
+        $ai['bv_n'] += 1;
+        $u->rangup($u->info['id'], $ai['bv_n'], 'bv');
+        Db::sql('update users set money = money + ? where id = ?',
+            [$achievement_data['bv']['prize'][$ai['bv_n']], $u->info['id']]);
+        $nagrtxt .= $achievement_data['bv']['prize'][$ai['bv_n']] . $achievement_data['bv']['prize'][0];
+    } elseif ( //Клан вар kw
+        in_array($_GET['nagr'], [91, 92, 93, 94, 95]) &&
+        in_array($ai['kw_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klaskw'] > $ai['kw_n']
+    ) {
+        $ai['kw_n'] += 1;
+        $u->rangup($u->info['id'], $ai['kw_n'], 'kw');
+        $i = 0;
+        while ($i < $achievement_data['kw']['prize'][$ai['kw_n']]) {
+            $u->addItem(4917, $u->info['id'], '');
+            $i++;
+        }
+        $nagrtxt .= 'Клановый опыт +50000 X' . $achievement_data['kw']['prize'][$ai['kw_n']];
+    } elseif ( //Башня смерти задание bs
+        in_array($_GET['nagr'], [101, 102, 103, 104, 105]) &&
+        in_array($ai['bs_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klasbs'] > $ai['bs_n']
+    ) {
+        $ai['bs_n'] += 1;
+        $u->rangup($u->info['id'], $ai['bs_n'], 'bs');
+        Db::sql('update users set money2 = money2 + ? where id = ?',
+            [$achievement_data['bs']['prize'][$ai['bs_n']], $u->info['id']]);
+        $nagrtxt .= $achievement_data['bs']['prize'][$ai['bs_n']] . $achievement_data['bs']['prize'][0];
+    }
+
+    Db::sql('insert into chat (new, city, room, login, `to`, `text`, `time`, type, toChat) values (?,?,?,?,?,?,?,?,?)',
+        [1, $u->info['city'], $u->info['room'], $u->info['login'], $nagrtxt, -1, 6, 0]);
     //-------------
-    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','" . $u->info['login'] . "','" . $nagrtxt . "','-1','6','0')");
 }
 function drawSunduk($nagr, $whatInside, $tier)
 {
-    echo vsprintf('<img onclick="%s" onmouseover="%s" onmouseout="%s" onmousedown="%s" class="cp" src="%s" alt="Сундук">',
+    return vsprintf('<img onclick="%s" onmouseover="%s" onmouseout="%s" onmousedown="%s" class="cp" src="%s" alt="Сундук">',
         [
             "location.href='\main.php?titul&nagr=$nagr'",
             "top.hi(this, '<b>Сундук $tier ранга<hr>Содержит:<hr> $whatInside</b>', event, 2, 0, 1, 1, 'max-width:307px')",
@@ -559,6 +249,39 @@ function drawSunduk($nagr, $whatInside, $tier)
         ]);
 }
 
+$data = null;
+foreach ($achievement_data as $key => $value) {
+    $data .= '<h4>' . $ai['name' . $key] . '</h4>';
+    $data .= '<strong>' . $value[$key]['quest'] . '</strong>';
+    $data .= 'Сейчас у Вас Ранг: <strong>' . $ai['klas' . $key] . '</strong>';
+    $data .= 'Количество выполнений: <strong>' . $ai[$key] . ' =' . $ai['klasP' . $key] . '%</strong>';
+    $data .= table([
+        [TIERS, 1, 2, 3, 4, 5],
+        $value[$key]['check'],
+        array_merge([PRIZE], $value[$key]['prize'])
+    ], 'prizelist', true);
+    # If has new tier, AND only first 5 tiers AND prize is set.
+    if (
+        $ai['klas' . $key] > $ai[$key . '_n'] &&
+        in_array($ai[$key . '_n'], [0, 1, 2, 3, 4]) &&
+        !empty($value[$key]['prize']) &&
+        !empty($value[$key]['startlink'])
+    ) {
+        $data .= '<br>' . PRIZE . ':<br>';
+        if (in_array($value[$key]['prize'][0], ['екр.', 'кр.'])) {
+            $sundukName = $value[$key]['prize'][$ai[$key . '_n'] + 1] . $value[$key]['prize'][0];
+        } else {
+            $sundukName = $value[$key]['prize'][0] . $value[$key]['prize'][$ai[$key . '_n'] + 1];
+        }
+
+        $data .= drawSunduk(
+            $ai[$key . '_n'] + $value[$key]['startlink'],
+            $sundukName,
+            $ai[$key . '_n'] + $value[$key]['startlink']
+        );
+    }
+    $data .= '<hr>';
+}
 ?>
 
 <style>
@@ -597,29 +320,5 @@ function drawSunduk($nagr, $whatInside, $tier)
 <H3>Достижения</H3>
 
 <?php
-foreach ($achievement_data as $key => $value) {
-    echo '<h4>' . $ai['name' . $key] . '</h4>';
-    echo '<strong>' . $value[$key]['quest'] . '</strong>';
-    echo 'Сейчас у Вас Ранг: <strong>' . $ai['klas' . $key] . '</strong>';
-    echo 'Количество выполнений: <strong>' . $ai[$key] . ' =' . $ai['klasP' . $key] . '%</strong>';
-    echo table([
-        [TIERS, 1, 2, 3, 4, 5],
-        $value[$key]['check'],
-        array_merge([PRIZE], $value[$key]['prize'])
-    ], 'prizelist', true);
-    # If has new tier, AND only first 5 tiers AND prize is set.
-    if (
-        $ai['klas' . $key] > $ai[$key . '_n'] &&
-        in_array($ai[$key . '_n'], [0, 1, 2, 3, 4]) &&
-        !empty($value[$key]['prize']) &&
-        !empty($value[$key]['startlink'])
-    ) {
-        echo '<br>' . PRIZE . ':<br>';
-        drawSunduk(
-            $ai[$key . '_n'] + $value[$key]['startlink'],
-            $value[$key]['prize'][$ai[$key . '_n']],
-            $ai[$key . '_n'] + $value[$key]['startlink']
-        );
-    }
-    echo '<hr>';
-}
+echo $data;
+unset($data);
\ No newline at end of file
-- 
2.45.2


From 1655ea11fcd7ca449670ceea0d53d7f83af084fc Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sat, 25 Jun 2022 23:43:18 +0300
Subject: [PATCH 05/12] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?=
 =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D1=8B=D0=B4=D0=B0=D1=87=D0=B0=20?=
 =?UTF-8?q?=D0=BD=D0=B0=D0=B3=D1=80=D0=B0=D0=B4=20=D0=B7=D0=B0=20=D1=82?=
 =?UTF-8?q?=D1=83=D1=80=D0=BD=D0=B8=D1=80=D1=8B.=20#12?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 modules_data/titul.php | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/modules_data/titul.php b/modules_data/titul.php
index fa5d3914..0d418e82 100644
--- a/modules_data/titul.php
+++ b/modules_data/titul.php
@@ -85,7 +85,7 @@ $achievement_data = [
         'quest' => 'Победы в турнирах.',
         'check' => ['Побед', 25, 50, 100, 200, 500],
         'prize' => ['екр.', 25, 25, 25, 25, 50],
-        'startlink' => null
+        'startlink' => 111
     ],
 ];
 
@@ -231,6 +231,16 @@ if (isset($_GET['nagr'])) {
         Db::sql('update users set money2 = money2 + ? where id = ?',
             [$achievement_data['bs']['prize'][$ai['bs_n']], $u->info['id']]);
         $nagrtxt .= $achievement_data['bs']['prize'][$ai['bs_n']] . $achievement_data['bs']['prize'][0];
+    } elseif ( //Турниры победы trn
+        in_array($_GET['nagr'], [111, 112, 113, 114, 115]) &&
+        in_array($ai['trn_n'], [0, 1, 2, 3, 4]) &&
+        $ai['klastrn'] > $ai['trn_n']
+    ) {
+        $ai['trn_n'] += 1;
+        $u->rangup($u->info['id'], $ai['trn_n'], 'trn');
+        Db::sql('update users set money2 = money2 + ? where id = ?',
+            [$achievement_data['trn']['prize'][$ai['trn_n']], $u->info['id']]);
+        $nagrtxt .= $achievement_data['trn']['prize'][$ai['trn_n']] . $achievement_data['trn']['prize'][0];
     }
 
     Db::sql('insert into chat (new, city, room, login, `to`, `text`, `time`, type, toChat) values (?,?,?,?,?,?,?,?,?)',
@@ -319,6 +329,5 @@ foreach ($achievement_data as $key => $value) {
 
 <H3>Достижения</H3>
 
-<?php
-echo $data;
+<?= $data;
 unset($data);
\ No newline at end of file
-- 
2.45.2


From 19407c04fad22b33218d405eb3803a66b5bce958 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sun, 26 Jun 2022 19:59:31 +0300
Subject: [PATCH 06/12] =?UTF-8?q?=D0=A1=D0=BA=D0=B0=D0=B6=D0=B5=D0=BC=20?=
 =?UTF-8?q?=D1=81=D0=BF=D0=B0=D1=81=D0=B8=D0=B1=D0=BE=20inf.php=20=D1=80?=
 =?UTF-8?q?=D0=B0=D0=B4=D0=B8=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D0=BE=D0=B3?=
 =?UTF-8?q?=D0=BE=20=D0=BF=D1=80=D0=B8=D1=88=D0=BB=D0=BE=D1=81=D1=8C=20?=
 =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D1=8B=D0=B2=D0=B0?=
 =?UTF-8?q?=D1=82=D1=8C=20=D0=B2=D1=81=D1=91!=20#12?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 _incl_data/class/Achievements.php        |   226 +
 _incl_data/class/Insallah/Core/Math.php  |    17 +
 _incl_data/class/Insallah/Core/Table.php |    22 +
 _incl_data/class/__user.php              |  3565 +++---
 inf.php                                  |   913 +-
 modules_data/__user.php                  | 12567 ---------------------
 modules_data/titul.php                   |   264 +-
 7 files changed, 2225 insertions(+), 15349 deletions(-)
 create mode 100644 _incl_data/class/Achievements.php
 create mode 100644 _incl_data/class/Insallah/Core/Math.php
 create mode 100644 _incl_data/class/Insallah/Core/Table.php
 delete mode 100644 modules_data/__user.php

diff --git a/_incl_data/class/Achievements.php b/_incl_data/class/Achievements.php
new file mode 100644
index 00000000..71102dd4
--- /dev/null
+++ b/_incl_data/class/Achievements.php
@@ -0,0 +1,226 @@
+<?php
+
+use Insallah\Db;
+use Insallah\Math;
+use Insallah\Table;
+
+class Achievements
+{
+    private $user;
+    private $info;
+    private $data = [
+        'zb' => [
+            'questname' => 'Ежедн.Задания',
+            'quest' => 'Выполнить задания бабки.',
+            'check' => ['Заданий', 5, 25, 50, 100, 250],
+            'prize' => ['Жетон <br>успеха <br>', 5, 20, 40, 60, 100],
+            'startlink' => 11
+        ],
+        'vx' => [
+            'questname' => 'Хаотические бои',
+            'quest' => 'Победить в хаотических боях.',
+            'check' => ['Побед', 50, 300, 400, 500, 1000],
+            'prize' => ['екр.', 25, 50, 75, 100, 200],
+            'startlink' => 21
+        ],
+        'snt' => [
+            'questname' => 'Сундук трупожора',
+            'quest' => 'Открыть сундук трупожора.',
+            'check' => ['Открытий', 5, 25, 50, 100, 250],
+            'prize' => ['екр.', 10, 25, 50, 75, 200],
+            'startlink' => 31
+        ],
+        'rp' => [
+            'questname' => 'Руны 8 лвл.',
+            'quest' => 'Получить руну при плавке плохих заготовок. [S]',
+            'check' => ['Рун', 5, 10, 25, 50, 100],
+            'prize' => ['Плохие <br> заготовки <br>', 5, 7, 10, 12, 15],
+            'startlink' => 41
+        ],
+        'rn' => [
+            'questname' => 'Руны 9 лвл.',
+            'quest' => 'Получить руну при плавке нормальных заготовок. [M]',
+            'check' => ['Рун', 5, 10, 15, 25, 50],
+            'prize' => ['Нормальные <br> заготовки <br>', 5, 7, 9, 12, 15],
+            'startlink' => 51
+        ],
+        'rb' => [
+            'questname' => 'Руны 10 лвл.',
+            'quest' => 'Получить руну при плавке идеальных заготовок. [L]',
+            'check' => ['Рун', 2, 5, 8, 11, 15],
+            'prize' => ['Идеальные <br> заготовки <br>', 2, 4, 6, 10, 15],
+            'startlink' => 61
+        ],
+        'pg' => [
+            'questname' => 'Героич. Сражения',
+            'quest' => 'Поучаствовать в героическом сражении.',
+            'check' => ['Участий', 100, 200, 400, 600, 1000],
+            'prize' => ['Жетон <br>успеха <br>', 10, 20, 40, 60, 80],
+            'startlink' => 71
+        ],
+        'bv' => [
+            'questname' => 'Продажи Бабушке',
+            'quest' => 'Продать бабушке найденные вещи в пещере.',
+            'check' => ['Продаж', 5, 25, 50, 100, 250],
+            'prize' => ['кр.', 500, 1000, 2000, 4000, 5000],
+            'startlink' => 81
+        ],
+        'kw' => [
+            'questname' => 'Клан Поединки',
+            'quest' => 'Победить в клановой войне.',
+            'check' => ['Побед', 5, 10, 15, 20, 25],
+            'prize' => ['Свиток <br> кланового<br> опыта ', 1, 2, 5, 10, 15],
+            'startlink' => 91
+        ],
+        'pa' => [ # not implemented!
+            'questname' => 'Покровительство',
+            'quest' => 'Получить покровительство Ангела.',
+            'check' => ['Получено', 5, 25, 50, 100, 250],
+            'prize' => null,
+            'startlink' => null
+        ],
+        'bs' => [
+            'questname' => 'Башня смерти',
+            'quest' => 'Победы в башне смерти.',
+            'check' => ['Побед', 1, 5, 10, 50, 500],
+            'prize' => ['екр.', 1, 5, 10, 50, 200],
+            'startlink' => 101
+        ],
+        'trn' => [ # not implemented!
+            'questname' => null,
+            'quest' => 'Победы в турнирах.',
+            'check' => ['Побед', 25, 50, 100, 200, 500],
+            'prize' => ['екр.', 25, 25, 25, 25, 50],
+            'startlink' => 111
+        ],
+    ];
+
+    public function __construct(user $user)
+    {
+        $this->user = $user;
+        $this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]);
+    }
+
+    private function prizeName($int, $string)
+    {
+        return in_array($string, ['екр.', 'кр.']) ? $int . ' ' . $string : $string . ' ' . $int;
+    }
+
+    private function drawSunduk($nagr, $whatInside, $tier)
+    {
+        return vsprintf('<img onclick="%s" onmouseover="%s" onmouseout="%s" onmousedown="%s" class="cp" src="%s" alt="Сундук">',
+            [
+                "location.href='\main.php?titul&nagr=$nagr'",
+                "top.hi(this, '<b>Сундук $tier ранга<hr>Содержит:<hr> $whatInside</b>', event, 2, 0, 1, 1, 'max-width:307px')",
+                "top.hic();",
+                "top.hic();",
+                "https://img.new-combats.com/i/titul/nagr$tier.gif"
+            ]);
+    }
+
+    public function getList()
+    {
+        $string = '';
+        $this->calculateCurrent(1);
+
+        foreach ($this->data as $key => $value) {
+            //Бля, какую херню приходится городить!
+            //Первое число = требование следующего тира минус требование текущего тира (надо набрать)
+            //Второе число = количество достижений минус требование текущего тира (набрал)
+            //Требования текущего тира отнимаются чтобы каждый тир начинал считать процент с 0.
+            //Пизды дать тому, кто так уебански называет переменные, что нужно полдня въезжать что происходит.
+            //И хер поменяешь - всё сломается. FFUUUUUUUUUUUUUU!!! Ins.
+            $percentToSuccess = Math::get100Percentage(
+                $value['check'][$this->info['klas' . $key] + 1] - $value['check'][$this->info['klas' . $key]],
+                $this->info[$key] - $value['check'][$this->info['klas' . $key]]
+            );
+            //klas$name динамически рассчитыватся исходя из $name в базе
+            $string .= '<h4>' . empty($value['questname']) ? $value['quest'] : $value['questname'] . '</h4>';
+            $string .= '<strong>' . $value['quest'] . '</strong><br>';
+            $string .= 'Текущий Ранг: <strong>' . $this->info['klas' . $key] . '</strong> ';
+            $string .= 'Количество ' . mb_strtolower($value['check'][0]) . ': <strong>' . $this->info[$key] . ' =' . $percentToSuccess . '%</strong>';
+
+            $string .= Table::get([
+                ['Ранги', 1, 2, 3, 4, 5],
+                $value['check'],
+                [
+                    'Награда',
+                    $this->prizeName($value['prize'][1], $value['prize'][0]),
+                    $this->prizeName($value['prize'][2], $value['prize'][0]),
+                    $this->prizeName($value['prize'][3], $value['prize'][0]),
+                    $this->prizeName($value['prize'][4], $value['prize'][0]),
+                    $this->prizeName($value['prize'][5], $value['prize'][0])
+                ]
+            ], 'prizelist', true);
+            # If has new tier, AND only first 5 tiers AND prize is set.
+            if (
+                $this->info['klas' . $key] > $this->info[$key . '_n'] &&
+                in_array($this->info[$key . '_n'], [0, 1, 2, 3, 4]) &&
+                !empty($value['prize']) &&
+                !empty($value['startlink'])
+            ) {
+                $string .= '<br>Награда:<br>';
+                $string .= $this->drawSunduk(
+                    $this->info[$key . '_n'] + $value['startlink'],
+                    $this->prizeName($value['prize'][$this->info[$key . '_n'] + 1], $value['prize'][0]),
+                    $this->info[$key . '_n'] + 1
+                );
+            }
+            $string .= '<hr>';
+        }
+        return $string;
+    }
+
+    private function calculateCurrent($check = null)
+    {
+        $this->info['bs'] = $this->user->info['win_bs'];
+        foreach ($this->info as $k => $v) {
+            if (empty($this->info[$k]) && is_null($check)) {
+                continue;
+            }
+            $this->info["klas$k"] = 0;
+            for ($i = 1; $i <= 5; $i++) {
+                if ($this->info[$k] >= $this->data[$k]['check'][$i]) {
+                    $this->info["klas$k"] = $i;
+                }
+            }
+        }
+    }
+
+    public function getInfo()
+    {
+        $this->calculateCurrent();
+        return $this->info;
+    }
+
+    public function getCheckedInfo()
+    {
+        $this->calculateCurrent(1);
+        return $this->info;
+    }
+
+    public function updateTier($name)
+    {
+        Db::sql("update users_achiv set $name = $name + 1 where id = ?", [$this->user->info['id']]);
+    }
+
+    /**
+     * @return array[]
+     */
+    public function getData()
+    {
+        return $this->data;
+    }
+
+    public function hasNoTier4Access($nagr)
+    {
+        return $this->user->info['level'] < 9 && in_array($nagr, [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]);
+    }
+
+    public function givePrizeItems($itemId, $aType)
+    {
+        for ($i = 1; $i <= $this->data[$aType]['prize'][$this->info[$aType . '_n'] + 1]; $i++) {
+            $this->user->addItem($itemId, $this->user->info['id']);
+        }
+    }
+}
\ No newline at end of file
diff --git a/_incl_data/class/Insallah/Core/Math.php b/_incl_data/class/Insallah/Core/Math.php
new file mode 100644
index 00000000..f9279129
--- /dev/null
+++ b/_incl_data/class/Insallah/Core/Math.php
@@ -0,0 +1,17 @@
+<?php
+
+namespace Insallah;
+
+/** All raw mathematics in one place. */
+class Math
+{
+    public static function getPercentage($total, $number)
+    {
+        return $total > 0 ? round(($number * 100) / $total, 2) : 0;
+    }
+
+    public static function get100Percentage($total, $number)
+    {
+        return min(self::getPercentage($total, $number), 100);
+    }
+}
\ No newline at end of file
diff --git a/_incl_data/class/Insallah/Core/Table.php b/_incl_data/class/Insallah/Core/Table.php
new file mode 100644
index 00000000..b704f81a
--- /dev/null
+++ b/_incl_data/class/Insallah/Core/Table.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Insallah;
+
+class Table
+{
+    public static function get($rows, $class = '', $fill = false)
+    {
+        $c = '';
+        $max_rows = sizeof(max($rows));
+
+
+        foreach ($rows as $row) {
+            if ($fill && sizeof($row) < $max_rows) {
+                $row = array_merge($row, array_fill(0, $max_rows - sizeof($row), ''));
+            }
+            $c .= '<tr><td>' . implode('</td><td>', $row) . '</td></tr>';
+        }
+
+        return (!empty($class) ? "<table class='$class'>" : '<table>') . $c . '</table>' . PHP_EOL;
+    }
+}
\ No newline at end of file
diff --git a/_incl_data/class/__user.php b/_incl_data/class/__user.php
index d47c9e83..3f7e0ea8 100644
--- a/_incl_data/class/__user.php
+++ b/_incl_data/class/__user.php
@@ -1,4 +1,7 @@
 <?php
+
+use Insallah\Db;
+
 if (!defined('GAME')) {
     die();
 }
@@ -22,29 +25,29 @@ function getdr($s, $v, $d)
 class user
 {
     private static $flag_one;
-    public $pokol = 2; //����������� ��������� ���������
+    public $pokol = 2; //Акктуальное поколение предметов
     public $ekrcast = [
-        310 => true, //�������� ������� ��������
+        310 => true, //Снадобье Забытых Мастеров
 
-        33 => true, //�������� �������
-        34 => true, //�������� �������
-        35 => true, //�������� ������
+        33 => true, //Звездная Энергия
+        34 => true, //Звездная Тяжесть
+        35 => true, //Звездная Сияние
 
-        42 => true, //������������ ������
-        43 => true, //������������ �������
+        42 => true, //Неуязвимость Оружию
+        43 => true, //Неуязвимость Стихиям
 
         296 => true
 
     ];
     public $aves = ['now' => 0, 'max' => 0], $rep, $tfer, $error2 = '', $room = [], $bank = [], $align_nm = [
-        1 => '����',
-        2 => '����',
-        3 => '����',
-        7 => '�����������'
+        1 => 'Свет',
+        2 => 'Хаос',
+        3 => 'Тьма',
+        7 => 'Нейтралитет'
     ], $mod_nm = [
         0 => [0 => ''],
-        1 => ['1' => '����', '1.1' => '������� ����������', '1.4' => '���������� �������', '1.5' => '������� ��������� ������', '1.6' => '����������', '1.7' => '������� �������� ����', '1.75' => '�������-���������', '1.9' => '������� ����', '1.91' => '������� ������� ����', '1.92' => '������� ������', '1.99' => '��������� �������'],
-        3 => ['3' => '����', '3.01' => '������-���������', '3.05' => '������-�����������', '3.06' => '��������', '3.07' => '������-������', '3.075' => '������-���������', '3.09' => '������-�����', '3.091' => '������-�������', '3.092' => '������� ������', '3.99' => '������ ��������']
+        1 => ['1' => 'Свет', '1.1' => 'Паладин Поднебесья', '1.4' => 'Таможенный Паладин', '1.5' => 'Паладин Солнечной Улыбки', '1.6' => 'Инквизитор', '1.7' => 'Паладин Огненной Зари', '1.75' => 'Паладин-Хранитель', '1.9' => 'Паладин Неба', '1.91' => 'Старший Паладин Неба', '1.92' => 'Ветеран Ордена', '1.99' => 'Верховный Паладин'],
+        3 => ['3' => 'Тьма', '3.01' => 'Тарман-Служитель', '3.05' => 'Тарман-Надсмотрщик', '3.06' => 'Каратель', '3.07' => 'Тарман-Убийца', '3.075' => 'Тарман-Хранитель', '3.09' => 'Тарман-Палач', '3.091' => 'Тарман-Владыка', '3.092' => 'Ветеран Армады', '3.99' => 'Тарман Патриарх']
     ];
     public $btl_txt = '', $rgd = [0 => 0, 1 => 0], $error = '',
 
@@ -54,13 +57,13 @@ class user
         $city_name2 = ['emeraldscity' => 'Emeraldscity', 'abandonedplain' => 'Abandonedplain', 'capitalcity' => 'Capitalcity', 'angelscity' => 'Angelscity', 'newcapitalcity' => 'Newcapitalcity', 'demonscity' => 'Demonscity', 'fallenearth' => 'FallenEarth', 'dreamscity' => 'Dreams City', 'suncity' => 'Sun City', 'devilscity' => 'Devils City'],
 
         $stats, $info, $map, $mapUsers, $is = [
-        'acestar' => '��������� ���� ����� �����������', 'spasenie' => '�������� ����� ������', 'more_awards' => '��������� ������� %', 'exp' => '���������� ���� (%)', 'align_bs' => '��������� ������',
-        'nopryh' => '������ ���������', 'puti' => '������ �����������', 'align' => '����������', 'hpAll' => '<font color=darkgreen><strong>������� ����� (HP)</font></strong>', 'mpAll' => '<font color=blue><strong>������� ���� (�P)</font></strong>', 'enAll' => '������� �������', 'sex' => '���', 'lvl' => '�������', 's1' => '����', 's2' => '��������', 's3' => '��������', 's4' => '������������', 's5' => '���������', 's6' => '��������', 's7' => '����������', 's8' => '����', 's9' => '������� ����', 's10' => '��������������', 's11' => '�������', 'm1' => '��. ������������ ����� (%)', 'm2' => '��. ������ ������������ ����� (%)', 'm3' => '��. �������� ����. ����� (%)', 'm21' => '��. ���. ��������� (%)', 'm4' => '��. ����������� (%)', 'm5' => '��. ������ ����������� (%)', 'm6' => '��. ���������� (%)', 'm7' => '��. ����������� (%)', 'm8' => '��. ����� ����� (%)', 'm9' => '��. ����� ������ ����� (%)', 'm14' => '��. ���. ������������ ����� (%)', 'm15' => '��. ���. ����������� (%)', 'm16' => '��. ���. ����������� (%)', 'm17' => '��. ���. ���������� (%)', 'm18' => '��. ���. ����� ����� (%)', 'm19' => '��. ���. ���������� ������ (%)', 'm20' => '��. ����� (%)', 'a1' => '���������� �������� ������, ���������', 'a2' => '���������� �������� ��������, ��������', 'a3' => '���������� �������� ��������, ��������', 'a4' => '���������� �������� ������', 'a5' => '���������� �������� ����������� ��������', 'a6' => '���������� �������� ������', 'a7' => '���������� �������� ����������', 'aall' => '���������� �������� �������', 'mall' => '���������� �������� ������ ������', 'm2all' => '���������� �������� ������', 'mg1' => '���������� �������� ������ ����', 'mg2' => '���������� �������� ������ �������', 'mg3' => '���������� �������� ������ ����', 'mg4' => '���������� �������� ������ �����', 'mg5' => '���������� �������� ������ �����', 'mg6' => '���������� �������� ������ ����', 'mg7' => '���������� �������� ����� ������', 'tj' => '������� �����', 'lh' => '������ �����', 'minAtack' => '����������� ����', 'maxAtack' => '������������ ����', 'm10' => '��. �������� �����', 'm11' => '��. �������� ����� ������', 'm11a' => '��. �������� �����', 'pa1' => '��. �������� �������� �����', 'pa2' => '��. �������� �������� �����', 'pa3' => '��. �������� ��������� �����', 'pa4' => '��. �������� �������� �����', 'pm1' => '��. �������� ����� ����', 'pm2' => '��. �������� ����� �������', 'pm3' => '��. �������� ����� ����', 'pm4' => '��. �������� ����� �����', 'pm5' => '��. �������� ����� �����', 'pm6' => '��. �������� ����� ����', 'pm7' => '��. �������� ����� �����', 'za' => '������ �� �����', 'zm' => '������ �� ����� ������', 'zma' => '������ �� �����', 'za1' => '������ �� �������� �����', 'za2' => '������ �� �������� �����', 'za3' => '������ �� ��������� �����', 'za4' => '������ �� �������� �����', 'zm1' => '������ �� ����� ����', 'zm2' => '������ �� ����� �������', 'zm3' => '������ �� ����� ����', 'zm4' => '������ �� ����� �����', 'zm5' => '������ �� ����� �����', 'zm6' => '������ �� ����� ����', 'zm7' => '������ �� ����� �����', 'magic_cast' => '�������������� ���� �� ���', 'pza' => '��������� ������ �� �����', 'pzm' => '��������� ������ �� �����', 'pza1' => '��������� ������ �� �������� �����', 'min_heal_proc' => '������ ������� (%)', 'notravma' => '������ �� �����', 'yron_min' => '����������� ����', 'yron_max' => '������������ ����', 'zaproc' => '���������� ����������� ����� (%)', 'zmproc' => '���������� ����������� ����� (%)', 'zm2proc' => '������ �� ����� ������� (%)', 'pza2' => '��������� ������ �� �������� �����', 'pza3' => '��������� ������ �� ��������� �����', 'pza4' => '��������� ������ �� �������� �����', 'pzm1' => '��������� ������ �� ����� ����', 'pzm2' => '��������� ������ �� ����� �������', 'pzm3' => '��������� ������ �� ����� ����', 'pzm4' => '��������� ������ �� ����� �����', 'pzm5' => '��������� ������ �� ����� �����', 'pzm6' => '��������� ������ �� ����� ����', 'pzm7' => '��������� ������ �� ����� �����', 'speedhp' => '����������� �������� (%)', 'speedmp' => '����������� ���� (%)', 'tya1' => '������� �����', 'tya2' => '������� �����', 'tya3' => '�������� �����', 'tya4' => '������� �����', 'tym1' => '�������� �����', 'mg2static_points' => '������� ������ (������)', 'tym2' => '������������� �����', 'tym3' => '������� �����', 'tym4' => '�������� �����', 'hpProc' => '������� ����� (%)', 'mpProc' => '������� ���� (%)', 'tym5' => '����� �����', 'tym6' => '����� ����', 'tym7' => '����� �����', 'min_use_mp' => '��������� ������ ����', 'pog' => '���������� �����', 'pog2' => '���������� �����', 'pog2p' => '������� ���������� �����', 'pog2mp' => '���� ���������� �����', 'maxves' => '����������� ������', 'bonusexp' => '����������� ���������� ����', 'speeden' => '����������� ������� (%)',
-        'antm3' => '��. ������ �������� �����', 'repair_z' => '���������� ���������� �������', 'repair_r' => '���������� ���������� ���',
-        'yza' => '���������� ����������� ����� (%)', 'yzm' => '���������� ����� ������ (%)', 'yzma' => '���������� ����� (%)'
-        , 'yza1' => '���������� �������� ����� (%)', 'yza2' => '���������� �������� ����� (%)', 'yza3' => '���������� ��������� ����� (%)', 'yza4' => '���������� �������� ����� (%)'
-        , 'yzm1' => '���������� ����� ���� (%)', 'yzm2' => '���������� ����� ������� (%)', 'yzm3' => '���������� ����� ���� (%)', 'yzm4' => '���������� ����� ����� (%)', 'yzm5' => '���������� ����� (%)', 'yzm6' => '���������� ����� (%)', 'yzm7' => '���������� ����� (%)', 'rep' => '��������� ������'
-        , 'repair_discount' => '������ �� ������ �����', 'hpVinos' => '����� �����', 'bronze' => 'Bronze Premium Account', 'silvers' => 'Silver Premium Account', 'gold' => '��������� ������', 'speed_dungeon' => '�������� ������������ �� �����������', 'zona' => '�������������� ���� �����'
+        'acestar' => 'Следующий каст будет критическим', 'spasenie' => 'Спасение после смерти', 'more_awards' => 'Повышеная награда %', 'exp' => 'Получаемый опыт (%)', 'align_bs' => 'Служитель закона',
+        'nopryh' => 'Прямое поподание', 'puti' => 'Запрет перемещения', 'align' => 'Склонность', 'hpAll' => '<font color=darkgreen><strong>Уровень жизни (HP)</font></strong>', 'mpAll' => '<font color=blue><strong>Уровень маны (МP)</font></strong>', 'enAll' => 'Уровень энергии', 'sex' => 'Пол', 'lvl' => 'Уровень', 's1' => 'Сила', 's2' => 'Ловкость', 's3' => 'Интуиция', 's4' => 'Выносливость', 's5' => 'Интеллект', 's6' => 'Мудрость', 's7' => 'Духовность', 's8' => 'Воля', 's9' => 'Свобода духа', 's10' => 'Божественность', 's11' => 'Энергия', 'm1' => 'Мф. критического удара (%)', 'm2' => 'Мф. против критического удара (%)', 'm3' => 'Мф. мощности крит. удара (%)', 'm21' => 'Мф. абс. попадания (%)', 'm4' => 'Мф. увертывания (%)', 'm5' => 'Мф. против увертывания (%)', 'm6' => 'Мф. контрудара (%)', 'm7' => 'Мф. парирования (%)', 'm8' => 'Мф. блока щитом (%)', 'm9' => 'Мф. удара сквозь броню (%)', 'm14' => 'Мф. абс. критического удара (%)', 'm15' => 'Мф. абс. увертывания (%)', 'm16' => 'Мф. абс. парирования (%)', 'm17' => 'Мф. абс. контрудара (%)', 'm18' => 'Мф. абс. блока щитом (%)', 'm19' => 'Мф. абс. магический промах (%)', 'm20' => 'Мф. удача (%)', 'a1' => 'Мастерство владения ножами, кинжалами', 'a2' => 'Мастерство владения топорами, секирами', 'a3' => 'Мастерство владения дубинами, молотами', 'a4' => 'Мастерство владения мечами', 'a5' => 'Мастерство владения магическими посохами', 'a6' => 'Мастерство владения луками', 'a7' => 'Мастерство владения арбалетами', 'aall' => 'Мастерство владения оружием', 'mall' => 'Мастерство владения магией стихий', 'm2all' => 'Мастерство владения магией', 'mg1' => 'Мастерство владения магией огня', 'mg2' => 'Мастерство владения магией воздуха', 'mg3' => 'Мастерство владения магией воды', 'mg4' => 'Мастерство владения магией земли', 'mg5' => 'Мастерство владения магией Света', 'mg6' => 'Мастерство владения магией Тьмы', 'mg7' => 'Мастерство владения серой магией', 'tj' => 'Тяжелая броня', 'lh' => 'Легкая броня', 'minAtack' => 'Минимальный урон', 'maxAtack' => 'Максимальный урон', 'm10' => 'Мф. мощности урона', 'm11' => 'Мф. мощности магии стихий', 'm11a' => 'Мф. мощности магии', 'pa1' => 'Мф. мощности колющего урона', 'pa2' => 'Мф. мощности рубящего урона', 'pa3' => 'Мф. мощности дробящего урона', 'pa4' => 'Мф. мощности режущего урона', 'pm1' => 'Мф. мощности магии огня', 'pm2' => 'Мф. мощности магии воздуха', 'pm3' => 'Мф. мощности магии воды', 'pm4' => 'Мф. мощности магии земли', 'pm5' => 'Мф. мощности магии Света', 'pm6' => 'Мф. мощности магии Тьмы', 'pm7' => 'Мф. мощности серой магии', 'za' => 'Защита от урона', 'zm' => 'Защита от магии стихий', 'zma' => 'Защита от магии', 'za1' => 'Защита от колющего урона', 'za2' => 'Защита от рубящего урона', 'za3' => 'Защита от дробящего урона', 'za4' => 'Защита от режущего урона', 'zm1' => 'Защита от магии огня', 'zm2' => 'Защита от магии воздуха', 'zm3' => 'Защита от магии воды', 'zm4' => 'Защита от магии земли', 'zm5' => 'Защита от магии Света', 'zm6' => 'Защита от магии Тьмы', 'zm7' => 'Защита от серой магии', 'magic_cast' => 'Дополнительный каст за ход', 'pza' => 'Понижение защиты от урона', 'pzm' => 'Понижение защиты от магии', 'pza1' => 'Понижение защиты от колющего урона', 'min_heal_proc' => 'Эффект лечения (%)', 'notravma' => 'Защита от травм', 'yron_min' => 'Минимальный урон', 'yron_max' => 'Максимальный урон', 'zaproc' => 'Блокировка Физического Урона (%)', 'zmproc' => 'Блокировка Магического Урона (%)', 'zm2proc' => 'Защита от магии Воздуха (%)', 'pza2' => 'Понижение защиты от рубящего урона', 'pza3' => 'Понижение защиты от дробящего урона', 'pza4' => 'Понижение защиты от режущего урона', 'pzm1' => 'Понижение защиты от магии огня', 'pzm2' => 'Понижение защиты от магии воздуха', 'pzm3' => 'Понижение защиты от магии воды', 'pzm4' => 'Понижение защиты от магии земли', 'pzm5' => 'Понижение защиты от магии Света', 'pzm6' => 'Понижение защиты от магии Тьмы', 'pzm7' => 'Понижение защиты от серой магии', 'speedhp' => 'Регенерация здоровья (%)', 'speedmp' => 'Регенерация маны (%)', 'tya1' => 'Колющие атаки', 'tya2' => 'Рубящие атаки', 'tya3' => 'Дробящие атаки', 'tya4' => 'Режущие атаки', 'tym1' => 'Огненные атаки', 'mg2static_points' => 'Уровень заряда (Воздух)', 'tym2' => 'Электрические атаки', 'tym3' => 'Ледяные атаки', 'tym4' => 'Земляные атаки', 'hpProc' => 'Уровень жизни (%)', 'mpProc' => 'Уровень маны (%)', 'tym5' => 'Атаки Света', 'tym6' => 'Атаки Тьмы', 'tym7' => 'Серые атаки', 'min_use_mp' => 'Уменьшает расход маны', 'pog' => 'Поглощение урона', 'pog2' => 'Поглощение урона', 'pog2p' => 'Процент поглощение урона', 'pog2mp' => 'Цена поглощение урона', 'maxves' => 'Увеличивает рюкзак', 'bonusexp' => 'Увеличивает получаемый опыт', 'speeden' => 'Регенерация энергии (%)',
+        'antm3' => 'Мф. против мощности крита', 'repair_z' => 'Бесплатное извлечение заточек', 'repair_r' => 'Бесплатное извлечение рун',
+        'yza' => 'Уязвимость физическому урона (%)', 'yzm' => 'Уязвимость магии стихий (%)', 'yzma' => 'Уязвимость магии (%)'
+        , 'yza1' => 'Уязвимость колющему урона (%)', 'yza2' => 'Уязвимость рубящему урона (%)', 'yza3' => 'Уязвимость дробящему урона (%)', 'yza4' => 'Уязвимость режущему урона (%)'
+        , 'yzm1' => 'Уязвимость магии огня (%)', 'yzm2' => 'Уязвимость магии воздуха (%)', 'yzm3' => 'Уязвимость магии воды (%)', 'yzm4' => 'Уязвимость магии земли (%)', 'yzm5' => 'Уязвимость магии (%)', 'yzm6' => 'Уязвимость магии (%)', 'yzm7' => 'Уязвимость магии (%)', 'rep' => 'Репутация Рыцаря'
+        , 'repair_discount' => 'Скидка на ремонт вещей', 'hpVinos' => 'Бонус жизни', 'bronze' => 'Bronze Premium Account', 'silvers' => 'Silver Premium Account', 'gold' => 'Благодать Ангела', 'speed_dungeon' => 'Скорость передвижения по подземельям', 'zona' => 'Дополнительная зона атаки'
     ];
     public $items = [
         'tr' => ['sex', 'align', 'lvl', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 's11', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'mg1', 'mg2', 'mg3', 'mg4', 'mg5', 'mg6', 'mg7', 'mall', 'm2all', 'aall', 'rep', 'align_bs'],
@@ -72,7 +75,7 @@ class user
     ];
 
     /*
-						yrnhealmpprocmg3 - ���������������� ���� �� ����� �� ������, � % (����� ����)
+						yrnhealmpprocmg3 - восставнавливает ману от урона по игроку, в % (магия воды)
 					*/
 
     public function sys_add($uid, $time, $type, $text, $data, $time_see)
@@ -95,20 +98,20 @@ class user
 
         $test = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "' . $id . '" AND `vars`= "day_quest" LIMIT 1'));
         $q = [
-            '1' => '�������� ����������',
-            '2' => '������ � ����������� ����',
-            '3' => '����� � ����������',
-            '4' => '������� � ����������� ��������� 100 000 �����',
-            '5' => '������� ������ ���������',
-            '6' => '�������� ����� �����',
-            '7' => '����� 3 ������� � �������',
-            '8' => '������������� � ����� ������'
+            '1' => 'Убийство Трупожоров',
+            '2' => 'Победы в хаотических боях',
+            '3' => 'Спуск в Подземелия',
+            '4' => 'Набрать в хаотических поединках 100 000 Опыта',
+            '5' => 'Открыть Сундук Трупожора',
+            '6' => 'Посетить Излом Хаоса',
+            '7' => 'Сдача 3 заданий в пещерах',
+            '8' => 'Поучаствовать в Башне Смерти'
         ];
 
         if (!isset($test['id'])) {
-            $n = "<a href='main.php?getq=1'><b style='color:green'>�������� �������</b></a>";
+            $n = "<a href='main.php?getq=1'><b style='color:green'>Получить задание</b></a>";
         } else {
-            $n = "<a href='main.php?putq=1'><b style='color:green'>����� �������</b></a>";
+            $n = "<a href='main.php?putq=1'><b style='color:green'>Сдать задание</b></a>";
             $n = $n . "<br><b style='color:green'>" . $q[$test['vals']] . "</b>";
         }
 
@@ -125,7 +128,7 @@ class user
                 } elseif (date('w') == 0 || date('w') == 6) {
                     $r = round($r * 2, 2);
                 }
-                $r = $r . ' ���.';
+                $r = $r . ' ЕКР.';
             } else {
                 $r = $this->info['level'];
                 if (date('m') >= 6 || date('m') <= 8) {
@@ -133,7 +136,7 @@ class user
                 } elseif (date('w') == 0 || date('w') == 6) {
                     $r = round($r * 2, 2);
                 }
-                $r = $r . ' ��.';
+                $r = $r . ' КР.';
             }
         } else {
             if (($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] > 12) && $this->info['align'] != 2) {
@@ -178,19 +181,19 @@ class user
         $r = '';
         //
         if ($this->info['clan'] > 0) {
-            //������ ������������ ���������� � �����
+            //Нельзя использовать персонажам в клане
         } elseif ($type == 'test') {
-            if ($this->room['name'] == '��� �����' || $this->room['name'] == '��� ���������' || $this->room['name'] == '��� ����') {
+            if ($this->room['name'] == 'Зал Света' || $this->room['name'] == 'Зал Нейтралов' || $this->room['name'] == 'Зал Тьмы') {
                 if (isset($_GET['vhp'])) {
                     $v = mysql_fetch_array(mysql_query('SELECT * FROM "vortex" WHERE "uid" = "' . $this->info['id'] . '" AND "type" = 1 ORDER BY "time" DESC LIMIT 1'));
                     if (isset($v['id']) && $v['time'] > time() - 60 * 60) {
-                        //��� �����
-                        $this->error = '���������� ��������� ��� ' . $this->timeOut($v['time'] + 60 * 60 - time());
+                        //Уже юзали
+                        $this->error = 'Необходимо подождать еще ' . $this->timeOut($v['time'] + 60 * 60 - time());
                     } else {
                         if ($this->stats['hpNow'] < 1) {
                             $this->stats['hpNow'] = 0;
                         }
-                        $this->error = '�� ������� ������������ ' . round($this->stats['hpAll'] - $this->stats['hpNow']) . ' HP.';
+                        $this->error = 'Вы успешно восстановили ' . round($this->stats['hpAll'] - $this->stats['hpNow']) . ' HP.';
                         mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES (
 							"' . $this->info['id'] . '","' . time() . '","' . $this->info['room'] . '","' . round($this->stats['hpAll'] - $this->stats['hpNow']) . '","1"
 						)');
@@ -200,13 +203,13 @@ class user
                 } elseif (isset($_GET['vmp'])) {
                     $v = mysql_fetch_array(mysql_query('SELECT * FROM "vortex" WHERE "uid" = "' . $this->info['id'] . '" AND "type" = 2 ORDER BY "time" DESC LIMIT 1'));
                     if (isset($v['id']) && $v['time'] > time() - 60 * 60) {
-                        //��� �����
-                        $this->error = '���������� ��������� ��� ' . $this->timeOut($v['time'] + 60 * 60 - time());
+                        //Уже юзали
+                        $this->error = 'Необходимо подождать еще ' . $this->timeOut($v['time'] + 60 * 60 - time());
                     } else {
                         if ($this->stats['mpNow'] < 1) {
                             $this->stats['mpNow'] = 0;
                         }
-                        $this->error = '�� ������� ������������ ' . round($this->stats['mpAll'] - $this->stats['mpNow']) . ' MP.';
+                        $this->error = 'Вы успешно восстановили ' . round($this->stats['mpAll'] - $this->stats['mpNow']) . ' MP.';
                         mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES (
 							"' . $this->info['id'] . '","' . time() . '","' . $this->info['room'] . '","' . round($this->stats['mpAll'] - $this->stats['mpNow']) . '","2"
 						)');
@@ -217,28 +220,28 @@ class user
             }
         } elseif ($type == 'look') {
             //
-            if ($this->room['name'] == '��� �����' || $this->room['name'] == '��� ����' || $this->room['name'] == '��� ���������') {
+            if ($this->room['name'] == 'Зал Света' || $this->room['name'] == 'Зал Тьмы' || $this->room['name'] == 'Зал Нейтралов') {
                 $vid = 0;
                 //
-                if ($this->room['name'] == '��� �����') {
+                if ($this->room['name'] == 'Зал Света') {
                     $vid = 6;
-                } elseif ($this->room['name'] == '��� ����') {
+                } elseif ($this->room['name'] == 'Зал Тьмы') {
                     $vid = 7;
-                } elseif ($this->room['name'] == '��� ���������') {
+                } elseif ($this->room['name'] == 'Зал Нейтралов') {
                     $vid = 10;
                 }
                 //
                 $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "' . $this->info['id'] . '" AND `type` = 1 ORDER BY `time` DESC LIMIT 1'));
                 if (isset($v['id']) && $v['time'] + 60 * 60 > time()) {
-                    $r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'�������� ��������������� ����� ' . $this->timeOut($v['time'] + 60 * 60 - time()) . '\');" src="https://img.new-combats.com/i/items/healvortex_' . $vid . '.png" width="40" height="25" title="������ HP (��������)"> ';
+                    $r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'Возможно воспользоваться через ' . $this->timeOut($v['time'] + 60 * 60 - time()) . '\');" src="https://img.new-combats.com/i/items/healvortex_' . $vid . '.png" width="40" height="25" title="Клодец HP (Задержка)"> ';
                 } else {
-                    $r .= '<a href="main.php?vhp"><img src="https://img.new-combats.com/i/items/healvortex_' . $vid . '.png" width="40" height="25" title="������ HP"></a> ';
+                    $r .= '<a href="main.php?vhp"><img src="https://img.new-combats.com/i/items/healvortex_' . $vid . '.png" width="40" height="25" title="Клодец HP"></a> ';
                 }
                 $v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "' . $this->info['id'] . '" AND `type` = 2 ORDER BY `time` DESC LIMIT 1'));
                 if (isset($v['id']) && $v['time'] + 60 * 60 > time()) {
-                    $r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'�������� ��������������� ����� ' . $this->timeOut($v['time'] + 60 * 60 - time()) . '\');" src="https://img.new-combats.com/i/items/manavortex_' . $vid . '.png" width="40" height="25" title="������ MP (��������)"> ';
+                    $r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'Возможно воспользоваться через ' . $this->timeOut($v['time'] + 60 * 60 - time()) . '\');" src="https://img.new-combats.com/i/items/manavortex_' . $vid . '.png" width="40" height="25" title="Клодец MP (Задержка)"> ';
                 } else {
-                    $r .= '<a href="main.php?vmp""><img src="https://img.new-combats.com/i/items/manavortex_' . $vid . '.png" width="40" height="25" title="������ MP"></a> ';
+                    $r .= '<a href="main.php?vmp""><img src="https://img.new-combats.com/i/items/manavortex_' . $vid . '.png" width="40" height="25" title="Клодец MP"></a> ';
                 }
             }
             //
@@ -305,7 +308,7 @@ class user
         return $val;
     }
 
-    //�������� ������������� ���� ���������
+    //Удаление определенного типа предметов
     public function deleteItemID($id, $uid, $coldel)
     {
         $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "' . mysql_real_escape_string($id) . '" AND `uid` = "' . mysql_real_escape_string($uid) . '" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT ' . $coldel);
@@ -340,15 +343,15 @@ class user
 
     public function repobmen($id, $type)
     {
-        //echo '�����';
+        //echo 'обмен';
         $pl = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . ((int)$id) . '" LIMIT 1;'));
         $d = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $pl['item_id'] . '" LIMIT 1'));
         $po = $this->lookStats($pl['data']);
         //echo $po['dungeon'].' '.$po['tr_lvl'];
         if ((!isset($po['frompisher']) or $po['tr_lvl'] < 4) and $pl['type'] != 31) {
-            $e = '�� ������� �������� ������� �� ���������.';
+            $e = 'Не удалось обменять предмет на репутацию.';
         } else {
-            $e = '����� �������� "' . $pl['name'] . '" �� ��������� �apitalcity ������ ������.';
+            $e = 'Обмен предмета "' . $pl['name'] . '" на репутацию Сapitalcity прошел удачно.';
             mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
             $this->rep['repcapitalcity'] += 1;
             mysql_query('UPDATE `rep` SET `repcapitalcity` = "' . $this->rep['repcapitalcity'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
@@ -364,33 +367,33 @@ class user
 				$cache = ob_get_contents();
 				ob_end_clean ();
 
-				//��������� �����
+				//Добавляем новый
 				if($uid != '') {
 					$uid_f = floor($uid/1000);
 				}else{
 					$uid_f = '_m';
 				}
 
-				//��������� ������������� ������ ����������
+				//Проверяем существование первой директории
 				if(!is_dir($id.'~a/'.$uid_f.'/') ) {
-					//�������
+					//создаем
 					mkdir($id.'~a/'.$uid_f.'/', 0700);
 				}
 
-				//��������� ������������� ������ ����������
+				//Проверяем существование второй директории
 				if(!is_dir($id.'~a/'.$uid_f.'/'.$uid.'/') ) {
-					//�������
+					//создаем
 					mkdir($id.'~a/'.$uid_f.'/'.$uid.'/', 0700);
 				}
 
 				$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
 
-				//������� ���������� ���������
+				//Удаляем предыдущий экземпляр
 				if(file_exists($id)) {
 					$this->del_buf($id);
 				}
 
-				//������� ����
+				//Создаем файл
 				$fp = @fopen ($id, "w");
 				@fwrite($fp, $cache);
 				@fclose($fp);
@@ -404,7 +407,7 @@ class user
     public function del_buf($id, $uid = null, $mod = null)
     {
         /*if($uid != NULL && $mod != NULL) {
-			//���������� ������
+			//генерируем ссылку
 			if((int)$uid > 0 && $uid != '') {
 				$uid_f = floor($uid/1000);
 			}else{
@@ -421,7 +424,7 @@ class user
     {
         /*if(file_exists($id)) {
 			if($uid != NULL && $mod != NULL) {
-				//���������� ������
+				//генерируем ссылку
 				if($uid != '') {
 					$uid_f = floor($uid/1000);
 				}else{
@@ -477,20 +480,20 @@ class user
     public function bsfinish($id, $bu, $di)
     {
         if ($bu == true) {
-            /* � ���� ��� ��������� ������ */
+            /* в этом бою проверяем юзеров */
             $i = 0;
             while ($i < count($bu[$i])) {
                 if ($bu[$i]['lose'] > 0 || $bu[$i]['nich']) {
                     mysql_query('UPDATE `users` SET `lose` = "' . $bu[$i]['lose'] . '", `nick` = "' . $bu[$i]['nich'] . '" WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1');
                     mysql_query('UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "' . $id['id'] . '" LIMIT 1');
-                    /* ������� ����� */
+                    /* удаляем юзера */
                     if ($bu['inBot'] == 0) {
                         $pls1 = mysql_fetch_array(mysql_query('SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `finish` = 0 AND `time` = "' . $id['time_start'] . '" AND `inBot` = "' . $bu[$i]['id'] . '" LIMIT 1'));
                         if (isset($pls1['id'])) {
                             mysql_query('DELETE FROM `users` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1');
                             mysql_query('DELETE FROM `stats` WHERE `id` = "' . $bu[$i]['id'] . '" LIMIT 1');
 
-                            //���������� �������� �� �����
+                            //выкидываем предметы на землю
                             $spi = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "' . $bu[$i]['id'] . '" LIMIT 500');
                             $ins = '';
                             while ($pli = mysql_fetch_array($spi)) {
@@ -518,7 +521,7 @@ class user
                 $ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1'));
                 if (isset($ur['id']) && isset($ub['id'])) {
                     if ($ub['lose'] > 0 || $ub['nich'] > 0) {
-                        //���������� �� ��
+                        //выкидываем из БС
 
                     } else {
                         $win = $ub;
@@ -527,9 +530,9 @@ class user
                 }
             }
 
-            /* ��������� �� */
+            /* завершаем БС */
             if (isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) {
-                //���� ����������
+                //есть победитель
                 $bsep = 0;
                 if ($winr['level'] < 6) {
                     $bsep = 2500;
@@ -542,20 +545,20 @@ class user
                 } else {
                     $bsep = 50000;
                 }
-                /* ������ ���� */
+                /* Выдаем приз */
                 $mn = (round($id['money'] / 100 * 85));
                 mysql_query('UPDATE `users` SET `money` = `money` + "' . $mn . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1');
                 mysql_query('UPDATE `stats` SET `exp` = `exp` + "' . $bsep . '" WHERE `id` = "' . $winr['id'] . '" LIMIT 1');
-                /* ��� */
-                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','" . $winr['login'] . "','�����������! �� �������� � ������� &quot;����� ������&quot;! �������� �����: " . $bsep . ", ������: " . $mn . " ��.','-1','6','0')");
-                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> ���������� ������ &quot;����� ������&quot;, ���������� �������: <strong>" . $winr['login'] . "</strong>! �����������!','-1','5','0')");
-                $this->addDelo(1, $uid, '&quot;<font color=#C65F00>WinTournament.' . $this->info['city'] . '</font>&quot; (����� ������): �������� &quot;<strong>' . $mn . '</strong> ��.&quot;', time(), $this->info['city'], 'WinTournament.' . $this->info['city'] . '', 0, 0);
+                /* чат */
+                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','" . $winr['login'] . "','Поздравляем! Вы победили в турнире &quot;Башня Смерти&quot;! Получено опыта: " . $bsep . ", деньги: " . $mn . " кр.','-1','6','0')");
+                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>Внимание!</font> Завершился турнир &quot;Башня Смерти&quot;, победитель турнира: <strong>" . $winr['login'] . "</strong>! Поздравляем!','-1','5','0')");
+                $this->addDelo(1, $uid, '&quot;<font color=#C65F00>WinTournament.' . $this->info['city'] . '</font>&quot; (Башня Смерти): Получено &quot;<strong>' . $mn . '</strong> кр.&quot;', time(), $this->info['city'], 'WinTournament.' . $this->info['city'] . '', 0, 0);
             } else {
-                //��� ����������
-                //������ ������
+                //нет победителя
+                //Выдаем травму
 
-                /* ��� */
-                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> ���������� ������ &quot;����� ������&quot;, ���������� �������: �����������.','-1','5','0')");
+                /* чат */
+                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>Внимание!</font> Завершился турнир &quot;Башня Смерти&quot;, победитель турнира: отсутствует.','-1','5','0')");
             }
 
             $sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "' . $id['id'] . '" AND `time` = "' . $id['time_start'] . '" ORDER BY `money` DESC LIMIT 100');
@@ -576,24 +579,22 @@ class user
         }
     }
 
-    //��� ��������� � �����
+    //вес предметов у юзера
     public function ves($u)
     {
         $r = ['now' => 0, 'max' => 0];
         if ($u == null) {
-            //������� ��������
+            //текущий персонаж
             $r['now'] = mysql_fetch_array(mysql_query('SELECT SUM(`im`.`massa`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND (`iu`.`delete` = "0" OR (`iu`.`delete` = "1000" AND `iu`.`inGroup` > 0)) AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'));
             $r['now'] = 0 + $r['now'][0];
             @$r['max'] = 40 + ($this->stats['os7'] * 10) + $this->stats['s4'] + $this->stats['maxves'] + $this->stats['s1'] * 4;
             $r['items'] = mysql_fetch_array(mysql_query('SELECT COUNT(`im`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $this->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'));
             $r['items'] = $r['items'][0];
-        } else {
-
         }
         return $r;
     }
 
-    //���������� ����� \ ���
+    //Переплавка вещей \ рун
     public function plavka($id, $type)
     {
         $e = '';
@@ -610,38 +611,38 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
 
         if ($po['tr_lvl'] < 4 && $pl['item_id'] != 1035) {
-            $e = '������� ������ ���� 4-�� � ���� ������';
+            $e = 'Предмет должен быть 4-го и выше уровня';
         } elseif ($pl['type'] != 1 && $pl['type'] != 3 && $pl['type'] != 5 && $pl['type'] != 6 && $pl['type'] != 8 && $pl['type'] != 9 && $pl['type'] != 10 && $pl['type'] != 11 && $pl['type'] != 12 && $pl['type'] != 14 && $pl['type'] != 15 && $pl['type'] != 18 && $pl['type'] != 19 && $pl['type'] != 20 && $pl['type'] != 21 && $pl['type'] != 22 && $pl['type'] != 13 && $pl['item_id'] != 1035) {
-            $e = '���� ���, � �� ����! ���� ������� �������? �� �������� ��! ������� ��� ����� ���-�� �������!';
+            $e = 'Хрен вам, а не руны! Куда кидаешь предмет? Не подходит он! Приходи как будет что-то стоющее!';
         } elseif ($po['tr_lvl'] >= 7 && $this->rep['rep1'] < 0)//100
         {
-            $e = '��� ����������� ��������� 7-�� � ������ ������ ��������� ���� ����� ������ ������� �����';
+            $e = 'Для растворения предметов 7-го и старше уровня требуется знак Храма Знаний первого круга';
         } elseif ($po['tr_lvl'] >= 9 && $this->rep['rep1'] < 1000) {
-            $e = '��� ����������� ��������� 9-�� � ������ ������ ��������� ���� ����� ������ ������� �����';
+            $e = 'Для растворения предметов 9-го и старше уровня требуется знак Храма Знаний второго круга';
         } elseif ($po['tr_lvl'] >= 10 && $this->rep['rep1'] < 10000) {
-            $e = '��� ����������� ��������� 10-�� � ������ ������ ��������� ���� ����� ������ �������� �����';
+            $e = 'Для растворения предметов 10-го и старше уровня требуется знак Храма Знаний третьего круга';
         } elseif ($rn > 0) {
             if (isset($pl['id'], $d['id'])) {
                 $pl['rep'] = 1;
-                //����������� ��������� ����
+                //вероятность выпадения руны
                 // mysql_query('UPDATE `rep` SET `rep1` = `rep1` + "'.$pl['rep'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1'));
 
-                $e = '������ ��������� ������� "' . $pl['name'] . '"! �������� ���������: +' . $pl['rep'] . ' ��.';
+                $e = 'Удачно растворен предмет "' . $pl['name'] . '"! Получено репутации: +' . $pl['rep'] . ' ед.';
                 mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
                 $this->rep['rep1'] += $pl['rep'];
                 mysql_query('UPDATE `rep` SET `rep1` = "' . $this->rep['rep1'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
 
 
             } else {
-                $e = '������� �� ������, ���� �� �������� ' . $pl['item_id'] . '...';
+                $e = 'Предмет не найден, либо не подходит ' . $pl['item_id'] . '...';
             }
         } else {
-            $e = '�� ������� �����������, ������� ��� ���� �������� ...';
+            $e = 'Не удалось переплавить, рецепты рун были потеряны ...';
         }
         return $e;
     }
 
-    //������� ���� ������� ����� ���������������
+    //Выводим вещи котоыре нужно отремонтировать
     public function info_remont()
     {
         $r = '';
@@ -651,20 +652,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 		 FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "' . ((int)$this->info['id']) . '" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` > "0" AND `iu`.`inOdet` < "18" LIMIT 18');
         while ($pl = mysql_fetch_array($sp)) {
             if ($pl['iznosNOW'] > ceil($pl['iznosMAX'] * 0.80)) {
-                $r .= '<strong>' . $pl['name'] . '</strong> [<font color="brown">' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . '</font>] ��������� ������<br>';
+                $r .= '<strong>' . $pl['name'] . '</strong> [<font color="brown">' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . '</font>] требуется ремонт<br>';
             }
         }
         $r = '<div align="left"><small>' . $r . '</small></div>';
         return $r;
     }
 
-    //������ ����� �� ������
+    //Расчет урона от оружия
     public function weaponAtc($item, $st, $x)
     {
         $tp = 0;
         if (isset($item['id'])) {
             $itm = $this->lookStats($item['data']);
-            //�������� ������ �����
+            //начинаем расчет урона
             if (!isset($st['minAtack'])) {
                 $st['minAtack'] = 0;
             }
@@ -695,26 +696,26 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
             //if($x!=0)
             //{
-            //��� �����: 0 - ��� �����, 1 - �������, 2 - �������, 3 - ��������, 4 - �������, 5 - �����, 6 - ������, 7 - ����, 8 - �����, 9 - ����, 10 - ����, 11 - �����
+            //Тип урона: 0 - нет урона, 1 - колющий, 2 - рубящий, 3 - дробящий, 4 - режущий, 5 - огонь, 6 - воздух, 7 - вода, 8 - земля, 9 - свет, 10 - тьма, 11 - серая
             if ($item['type'] == 18) {
-                //�������
+                //колющий
                 $sss = ceil($st['s2'] * 0.75);
             } elseif ($item['type'] == 19) {
-                //�������
+                //рубящий
                 $sss = ceil($st['s1'] * 0.75);
             } elseif ($item['type'] == 20) {
-                //��������
+                //дробящий
                 $sss = ceil($st['s4'] * 1.5);
             } elseif ($item['type'] == 21) {
-                //�������
+                //режущий
                 $sss = ceil($st['s3'] * 1);
             } else {
-                //��� ����������� �����
+                //без профильного урона
                 $sss = ceil($st['s1'] * 0.1);
             }
 
 
-            //������� ����
+            //Обычный урон
             //$p['B'][0] = 5;
             //$p['B'][1] = 9;
 
@@ -725,37 +726,37 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             $p['B'][1] = $p['B'][0] + 3;
 
             $p['B']['rnd'] = rand($p['B'][0], $p['B'][1]);
-            //���������� ����������� ����
+            //Добавочный минимальный урон
             $p['W'][0] = $min;
             $p['W'][1] = $max;
             $p['W']['rnd'] = rand($p['W'][0], $p['W'][1]);
-            // ����. ������
+            // Коэф. оружия
             $p['T'] = 1;
-            //��������
+            //Владения
             $bn = 0;
             if ($item['type'] == 21) {
-                // ���
+                // меч
                 $p['M'] = $st['pa4'];
                 $bn = $st['a4'];
-                //��� $p['M'] = $st['pa'.$x];
+                //ТУТ $p['M'] = $st['pa'.$x];
             } elseif ($item['type'] == 20) {
-                // ������
+                // дубина
                 $p['M'] = $st['pa3'];
                 $bn = $st['a3'];
             } elseif ($item['type'] == 19) {
-                // �����
+                // топор
                 $p['M'] = $st['pa2'];
                 $bn = $st['a2'];
             } elseif ($item['type'] == 18) {
-                // ���
+                // нож
                 $p['M'] = $st['pa1'];
                 $bn = $st['pa1'];
             } elseif ($item['type'] == 22) {
-                // �����
+                // посох
                 $p['M'] = $st['pa3'];
                 $bn = $st['a5'];
             }
-            //���������
+            //Мощнность
             //if( $x < 5 ) {
             //$p['M'] = $st['pa'.$x];
             //}else{
@@ -779,52 +780,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         return $tp;
     }
 
-    public function yronLvl($lvl1, $lvl2)
-    {
-        $r = [
-            1 => [0, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
-            2 => [0, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
-            3 => [0, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
-            4 => [0, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
-            5 => [0, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
-            6 => [0, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200],
-            7 => [0, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200, 200, 200],
-            8 => [0, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200, 200, 200],
-            9 => [0, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200, 200, 200],
-            10 => [0, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200, 200, 200],
-            11 => [0, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600, 400, 200],
-            12 => [0, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000, 800, 600],
-            13 => [0, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400, 1200, 1000],
-            14 => [0, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800, 1600, 1400],
-            15 => [0, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200, 2000, 1800],
-            16 => [0, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600, 2400, 2200],
-            17 => [0, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000, 2800, 2600],
-            18 => [0, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400, 3200, 3000],
-            19 => [0, 7400, 7200, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800, 3600, 3400],
-            20 => [0, 7800, 7600, 7400, 7200, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200, 4000, 3800],
-            21 => [0, 8200, 8000, 7800, 7600, 7400, 7200, 7000, 6800, 6600, 6400, 6200, 6000, 5800, 5600, 5400, 5200, 5000, 4800, 4600, 4400, 4200]
-        ];
-        $r = floor($r[$lvl1][$lvl2] / 100);
-        $r = 0;
-        return $r;
-    }
-
-    //������ ������
+    //Расчет защиты
     public function zago($v)
     {
-        /*if($v > 1000) {
-				$v = 1000;
-			}
-			$r = (1-( pow(0.5, ($v/250) ) ))*100;
-			return $r;*/
         if ($v > 1700) {
             $v = 1700;
         }
-        $r = round((1 - (pow(0.5, ($v / 399.51)))) * 100, 2);
-        return $r;
+        return round((1 - (pow(0.5, ($v / 399.51)))) * 100, 2);
     }
 
-    //������ ������ (�����)
+    //Расчет защиты (магия)
     public function zmgo($v)
     {
         if ($v > 1000) {
@@ -841,7 +806,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         $r = '';
         if ($v == 'yrontest' || $v == 'yrontest-krit') {
             $y = [];
-            /* ������ ������ ��� ����� */
+            /* первое оружие или кулак */
             $w1 = 0;
             $w2 = 0;
             $i = 0;
@@ -878,7 +843,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
                 $r .= '<span title="' . $w1['name'] . '">' . $y[0] . '-' . $y[1] . '</span>';
             } else {
-                //���� �������
+                //урон кулаком
                 $y[0] = ceil(2 + $this->info['level'] + $this->stats ['s1'] - round($this->stats['s1'] / 5)) + $this->stats['minAtack'] + $this->stats['yron_min'];
                 $y[1] = ceil($y[0] + 3) + $this->stats['maxAtack'] + $this->stats['yron_max'];
                 if ($y[0] < 1) {
@@ -889,7 +854,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
                 $r .= $y[0] . '-' . $y[1];
             }
-            /* ������ ������ */
+            /* второе оружие */
             if (isset($w2['id'])) {
                 $tp = 0;
                 $t = 0;
@@ -918,7 +883,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             /* --- */
         } elseif ($v == 'yron') {
             $y = [];
-            /* ������ ������ ��� ����� */
+            /* первое оружие или кулак */
             $w1 = 0;
             $w2 = 0;
             $i = 0;
@@ -951,7 +916,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
                 $r .= '<span title="' . $w1['name'] . '">' . $y[0] . '-' . $y[1] . '</span>';
             } else {
-                //���� �������
+                //урон кулаком
                 $y[0] = ceil($this->stats['s1'] * 1.4) + $this->stats['minAtack'] + $this->stats['yron_min'];
                 $y[1] = ceil(0.4 + $y[0] / 0.9) + $this->stats['maxAtack'] + $this->stats['yron_max'];
                 if ($y[0] < 1) {
@@ -962,7 +927,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
                 $r .= $y[0] . '-' . $y[1];
             }
-            /* ������ ������ */
+            /* второе оружие */
             if (isset($w2['id'])) {
                 $tp = 0;
                 $t = 0;
@@ -985,9 +950,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $r .= ' / <span title="' . $w2['name'] . '">' . $y[0] . '-' . $y[1] . '</span>';
             }
         } else {
-            //������������
+            //модификаторы
             $y = [];
-            /* ������ ������ ��� ����� */
+            /* первое оружие или кулак */
             $w1 = 0;
             $w2 = 0;
             $i = 0;
@@ -1015,11 +980,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $ry = $y;
                 $r .= '<span title="' . $w1['name'] . '">' . $y . '</span>';
             } else {
-                //�������
+                //кулаком
                 $r .= $this->stats[$v];
                 $ry = $this->stats[$v];
             }
-            /* ������ ������ */
+            /* второе оружие */
             if (isset($w2['id'])) {
                 $tp = 0;
                 $t = 0;
@@ -1032,7 +997,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $r = str_replace('title="' . $w1['name'] . '"', '', $r);
                 }
             }
-            //������������
+            //модификаторы
         }
         return $r;
     }
@@ -1046,7 +1011,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         if ($tmp > 0) {
             $id++;
             if ($id < 3) {
-                $out .= $tmp . " ���. ";
+                $out .= $tmp . " мес. ";
             }
             $time_still = $time_still - $tmp * 2592000;
         }
@@ -1054,7 +1019,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         if ($tmp > 0) {
             $id++;
             if ($id < 3) {
-                $out .= $tmp . " ��. ";
+                $out .= $tmp . " дн. ";
             }
             $time_still = $time_still - $tmp * 86400;
         }
@@ -1062,7 +1027,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         if ($tmp > 0) {
             $id++;
             if ($id < 3) {
-                $out .= $tmp . " �. ";
+                $out .= $tmp . " ч. ";
             }
             $time_still = $time_still - $tmp * 3600;
         }
@@ -1070,14 +1035,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         if ($tmp > 0) {
             $id++;
             if ($id < 3) {
-                $out .= $tmp . " ���. ";
+                $out .= $tmp . " мин. ";
             }
         }
         if ($out == '') {
             if ($time_still < 0) {
                 $time_still = 0;
             }
-            $out = $time_still . ' ���.';
+            $out = $time_still . ' сек.';
         }
         return $out;
     }
@@ -1085,105 +1050,105 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
     public function rep_zv($id, $e)
     {
         if ($id == 1) {
-            //���� ������
+            //Храм знаний
             if ($e > 9999) {
-                $r = '����������� �������� �����, ' . $e . ' / ??';
+                $r = 'Посвященный третьего круга, ' . $e . ' / ??';
             } elseif ($e > 999) {
-                $r = '����������� ������� �����, ' . $e . ' / 9999';
+                $r = 'Посвященный второго круга, ' . $e . ' / 9999';
             } elseif ($e > 99) {
-                $r = '����������� ������� �����, ' . $e . ' / 999';
+                $r = 'Посвященный первого круга, ' . $e . ' / 999';
             } else {
                 $r = $e . ' / 99';
             }
         } elseif ($id == 2) {
             //Capital city
             if ($e > 24999) {
-                $r = '������ ������� �����, ' . $e . ' / ??';
+                $r = 'Рыцарь второго круга, ' . $e . ' / ??';
             } elseif ($e > 9999) {
-                $r = '������ ������� �����, ' . $e . ' / 24999';
+                $r = 'Рыцарь первого круга, ' . $e . ' / 24999';
             } else {
                 $r = $e . ' / 10000';
             }
         } elseif ($id == 3) {
             //Angels city
             if ($e > 24999) {
-                $r = '������ ������� �����, ' . $e . ' / ??';
+                $r = 'Рыцарь второго круга, ' . $e . ' / ??';
             } elseif ($e > 9999) {
-                $r = '������ ������� �����, ' . $e . ' / 24999';
+                $r = 'Рыцарь первого круга, ' . $e . ' / 24999';
             } else {
                 $r = $e . ' / 10000';
             }
         } elseif ($id == 4) {
             //Demons city
             if ($e > 24999) {
-                $r = '������ ������� �����, ' . $e . ' / ??';
+                $r = 'Рыцарь второго круга, ' . $e . ' / ??';
             } elseif ($e > 9999) {
-                $r = '������ ������� �����, ' . $e . ' / 24999';
+                $r = 'Рыцарь первого круга, ' . $e . ' / 24999';
             } else {
                 $r = $e . ' / 10000';
             }
         } elseif ($id == 5) {
-            //������ �����
+            //Алтарь Крови
             if ($e > 99) {
-                $r = '����������� ������� ����� ' . $e . ' / 999';
+                $r = 'Посвященный первого круга ' . $e . ' / 999';
             } else {
                 $r = $e . ' / 99';
             }
         } elseif ($id == 6) {
             //Sand
             if ($e > 24999) {
-                $r = '������ ������� �����, ' . $e . ' / ??';
+                $r = 'Рыцарь второго круга, ' . $e . ' / ??';
             } elseif ($e > 9999) {
-                $r = '������ ������� �����, ' . $e . ' / 24999';
+                $r = 'Рыцарь первого круга, ' . $e . ' / 24999';
             } else {
                 $r = $e . ' / 10000';
             }
         } elseif ($id == 7) {
             //Sun
             if ($e > 24999) {
-                $r = '������ ������� �����, ' . $e . ' / ??';
+                $r = 'Рыцарь второго круга, ' . $e . ' / ??';
             } elseif ($e > 9999) {
-                $r = '������ ������� �����, ' . $e . ' / 24999';
+                $r = 'Рыцарь первого круга, ' . $e . ' / 24999';
             } else {
                 $r = $e . ' / 10000';
             }
         } elseif ($id == 8) {
             //Moon
             if ($e > 24999) {
-                $r = '������ ������� �����, ' . $e . ' / ??';
+                $r = 'Рыцарь второго круга, ' . $e . ' / ??';
             } elseif ($e > 9999) {
-                $r = '������ ������� �����, ' . $e . ' / 24999';
+                $r = 'Рыцарь первого круга, ' . $e . ' / 24999';
             } else {
                 $r = $e . ' / 10000';
             }
         } elseif ($id == 9) {
             //Dreams city
             if ($e > 9999) {
-                $r = '����������� �������� �����,  [' . $e . ']';
+                $r = 'Посвященный третьего круга,  [' . $e . ']';
             } elseif ($e > 4999) {
-                $r = '����������� ������� �����,' . $e . ' / 9999';
+                $r = 'Посвященный второго круга,' . $e . ' / 9999';
             } elseif ($e > 999) {
-                $r = '����������� ������� �����,  ' . $e . ' / 4999';
+                $r = 'Посвященный первого круга,  ' . $e . ' / 4999';
             } else {
                 $r = $e . ' / 999';
             }
         } elseif ($id == 10) {
-            //���� �������
+            //Гора легиона
             if ($e > 9999) {
-                $r = '����������� ������� �����,[' . $e . ']';
+                $r = 'Посвященный второго круга,[' . $e . ']';
             } elseif ($e > 999) {
-                $r = '����������� ������� �����,  ' . $e . ' / 4999';
+                $r = 'Посвященный первого круга,  ' . $e . ' / 4999';
             } else {
                 $r = $e . ' / 999';
             }
         } elseif ($id == 11) {
-            //����� �����
+            //Излом Хаоса
             if ($e > 9999) {
-                $r = '������� ������ �����,  [' . $e . ']';
+                $r = 'Легенда Излома Хаоса,  [' . $e . ']';
             } elseif ($e > 4999) {
-                $r = '������� ������ �����,' . $e . ' / 9999';
+                $r = 'Чемпион Излома Хаоса,' . $e . ' / 9999';
             } elseif ($e > 999) {
-                $r = '������ ������ �����,  ' . $e . ' / 4999';
+                $r = 'Знаток Излома Хаоса,  ' . $e . ' / 4999';
             } else {
                 $r = $e . ' / 999';
             }
@@ -1207,7 +1172,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         $i = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp` FROM `items_main` AS `im` WHERE `im`.`id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
         if (isset($i['id'])) {
             $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1'));
-            //����� ����
+            //новая дата
             $data = $d['data'];
             if ($i['ts'] > 0) {
                 if ($nosudba == null) {
@@ -1217,13 +1182,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             }
             if ($md != null) {
                 $data .= $md;
-                $data = $this->lookStats($data); // ���� � ������� ������� ��� ���������� ��������� SROK?
+                $data = $this->lookStats($data); // Если в функции имеются две одинаковых константы SROK?
                 $data = $this->impStats($data);
             }
 
 
             if ($dn != null) {
-                //������� � ����������� �� ����������
+                //предмет с настройками из подземелья
                 if ($dn['dn_delete'] > 0) {
                     $i['dn_delete'] = 1;
                 }
@@ -1256,10 +1221,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
                 $ads = '';
                 if ($plavka != null) {
-                    $ads = '���������� ������� : [' . $plavka . ']';
+                    $ads = 'Расплавлен предмет : [' . $plavka . ']';
                 }
-                //���������� � ������ ���� ��� ������� �������
-                $ld = $this->addDelo(1, $uid, '&quot;<font color=#C65F00>AddItems.' . $this->info['city'] . '</font>&quot;: ������� ������� &quot;<strong>' . $i['name'] . '</strong>&quot; (x1) [#' . $i['iid'] . ']. ' . $ads . '', time(), $this->info['city'], 'AddItems.' . $this->info['city'] . '', 0, 0);
+                //Записываем в личное дело что предмет получен
+                $ld = $this->addDelo(1, $uid, '&quot;<font color=#C65F00>AddItems.' . $this->info['city'] . '</font>&quot;: Получен предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x1) [#' . $i['iid'] . ']. ' . $ads . '', time(), $this->info['city'], 'AddItems.' . $this->info['city'] . '', 0, 0);
             } else {
                 $rt = 0;
             }
@@ -1337,19 +1302,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             }
             $r .= ' <strong>' . $inf['login'] . '</strong> [' . $inf['level'] . ']<a target="_blank" href="https://new-combats.com/info/' . $inf['id'] . '"><img src="https://img.new-combats.com/i/inf_' . $inf['cityreg'] . '.gif" /></a>';
         } else {
-            $r = '<strong><i>���������</i></strong> [??]<a target="_blank" href="https://new-combats.com/info/0"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" /></a>';
+            $r = '<strong><i>Невидимка</i></strong> [??]<a target="_blank" href="https://new-combats.com/info/0"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" /></a>';
         }
         return $r;
     }
 
     public function testHome()
     {
-        /*----�������(�����������)----*/
+        /*----Быстрый(Особенность)----*/
         $timeforwait = 3600;
         if (isset($st['os3']) && $st['os3'] > 0) {
             $timeforwait = 3600 - (($st['os6'] * 5) * 60);
         }
-        /*----�������(�����������)----*/
+        /*----Быстрый(Особенность)----*/
         $hgo = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time` >= ' . (time() - $timeforwait) . ' AND `vars` = "go_homeworld" LIMIT 1', 1);
         if ($this->info['level'] == 0 || $this->info['active'] != '' || $this->info['inTurnir'] > 0 || $this->info['inTurnirnew'] > 0 || $this->info['zv'] > 0 || $this->info['dnow'] > 0) {
             $hgo['id'] = true;
@@ -1389,307 +1354,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         return $r;
     }
 
-    public function functionThisData()
+    public function addKr($amount)
     {
-        //���������� ������ �������
-
+        Db::sql('update users set money = money + ? where id = ?', [$amount, $this->info['id']]);
     }
 
-    public function rangup($id, $rang, $name)
+    public function addEkr($amount)
     {
-        mysql_query('UPDATE `users_achiv` SET `' . $name . '_n` = "' . $rang . '" WHERE `id` = "' . $id . '" LIMIT 1');
-        unset ($name, $rang);
-    }
-
-    public function achivInf($id, $check = null)
-    {
-        $ai = mysql_fetch_array(mysql_query('SELECT * FROM `users_achiv` WHERE `id`="' . $id . '" LIMIT 1'));
-        if ($ai['zb'] > 0 || $check != null) {
-            $ai['namezb'] = '�����.�������';
-            //5/25/50/100/250
-            if ($ai['zb'] >= 250) {
-                $ai['klaszb'] = 5;
-                $ai['klasPzb'] = 100;
-
-            } elseif ($ai['zb'] >= 100) {
-                $ai['klaszb'] = 4;
-                $ai['klasPzb'] = ceil(($ai['zb'] - 100) / 150 * 100);
-
-            } elseif ($ai['zb'] >= 50) {
-                $ai['klaszb'] = 3;
-                $ai['klasPzb'] = ceil(($ai['zb'] - 50) / 50 * 100);
-            } elseif ($ai['zb'] >= 25) {
-                $ai['klaszb'] = 2;
-                $ai['klasPzb'] = ceil(($ai['zb'] - 25) / 25 * 100);
-            } elseif ($ai['zb'] >= 5) {
-                $ai['klaszb'] = 1;
-                $ai['klasPzb'] = ceil(($ai['zb'] - 5) / 20 * 100);
-            } else {
-                $ai['klaszb'] = 0;
-                $ai['klasPzb'] = ceil($ai['zb'] / 5 * 100);
-            }
-        }
-        if ($ai['vx'] > 0 || $check != null) {
-            $ai['namevx'] = '����������� ���';
-            if ($ai['vx'] >= 1000) {
-                $ai['klasvx'] = 5;
-                $ai['klasPvx'] = 100;
-
-            } elseif ($ai['vx'] >= 500) {
-                $ai['klasvx'] = 4;
-                $ai['klasPvx'] = ceil(($ai['vx'] - 500) / 500 * 100);
-
-            } elseif ($ai['vx'] >= 400) {
-                $ai['klasvx'] = 3;
-                $ai['klasPvx'] = ceil(($ai['vx'] - 400) / 100 * 100);
-            } elseif ($ai['vx'] >= 300) {
-                $ai['klasvx'] = 2;
-                $ai['klasPvx'] = ceil(($ai['vx'] - 300) / 100 * 100);
-            } elseif ($ai['vx'] >= 50) {
-                $ai['klasvx'] = 1;
-                $ai['klasPvx'] = ceil(($ai['vx'] - 50) / 250 * 100);
-            } else {
-                $ai['klasvx'] = 0;
-                $ai['klasPvx'] = ceil($ai['vx'] / 50 * 100);
-            }
-        }
-        if ($ai['snt'] > 0 || $check != null) {
-            $ai['namesnt'] = '������ ���������';
-            if ($ai['snt'] >= 250) {
-                $ai['klassnt'] = 5;
-                $ai['klasPsnt'] = 100;
-
-            } elseif ($ai['snt'] >= 100) {
-                $ai['klassnt'] = 4;
-                $ai['klasPsnt'] = ceil(($ai['snt'] - 100) / 150 * 100);
-
-            } elseif ($ai['snt'] >= 50) {
-                $ai['klassnt'] = 3;
-                $ai['klasPsnt'] = ceil(($ai['snt'] - 50) / 50 * 100);
-            } elseif ($ai['snt'] >= 25) {
-                $ai['klassnt'] = 2;
-                $ai['klasPsnt'] = ceil(($ai['snt'] - 25) / 25 * 100);
-            } elseif ($ai['snt'] >= 5) {
-                $ai['klassnt'] = 1;
-                $ai['klasPsnt'] = ceil(($ai['snt'] - 5) / 20 * 100);
-            } else {
-                $ai['klassnt'] = 0;
-                $ai['klasPsnt'] = ceil($ai['snt'] / 5 * 100);
-            }
-        }
-        if ($ai['rp'] > 0 || $check != null) {
-            $ai['namerp'] = '���� 8 ���.';
-            if ($ai['rp'] >= 100) {
-                $ai['klasrp'] = 5;
-                $ai['klasPrp'] = 100;
-
-            } elseif ($ai['rp'] >= 50) {
-                $ai['klasrp'] = 4;
-                $ai['klasPrp'] = ceil(($ai['rp'] - 50) / 50 * 100);
-
-            } elseif ($ai['rp'] >= 25) {
-                $ai['klasrp'] = 3;
-                $ai['klasPrp'] = ceil(($ai['rp'] - 25) / 25 * 100);
-            } elseif ($ai['rp'] >= 10) {
-                $ai['klasrp'] = 2;
-                $ai['klasPrp'] = ceil(($ai['rp'] - 10) / 15 * 100);
-            } elseif ($ai['rp'] >= 5) {
-                $ai['klasrp'] = 1;
-                $ai['klasPrp'] = ceil(($ai['rp'] - 5) / 5 * 100);
-            } else {
-                $ai['klasrp'] = 0;
-                $ai['klasPrp'] = ceil($ai['rp'] / 5 * 100);
-            }
-        }
-        if ($ai['rn'] > 0 || $check != null) {
-            $ai['namern'] = '���� 9 ���.';
-            if ($ai['rn'] >= 50) {
-                $ai['klasrn'] = 5;
-                $ai['klasPrn'] = 100;
-
-            } elseif ($ai['rn'] >= 25) {
-                $ai['klasrn'] = 4;
-                $ai['klasPrn'] = ceil(($ai['rn'] - 25) / 10 * 100);
-
-            } elseif ($ai['rn'] >= 15) {
-                $ai['klasrn'] = 3;
-                $ai['klasPrn'] = ceil(($ai['rn'] - 15) / 5 * 100);
-            } elseif ($ai['rn'] >= 10) {
-                $ai['klasrn'] = 2;
-                $ai['klasPrn'] = ceil(($ai['rn'] - 10) / 5 * 100);
-            } elseif ($ai['rn'] >= 5) {
-                $ai['klasrn'] = 1;
-                $ai['klasPrn'] = ceil(($ai['rn'] - 5) / 5 * 100);
-            } else {
-                $ai['klasrn'] = 0;
-                $ai['klasPrn'] = ceil($ai['rn'] / 5 * 100);
-            }
-        }
-        if ($ai['rb'] > 0 || $check != null) {
-            $ai['namerb'] = '���� 10 ���';
-            if ($ai['rb'] >= 15) {
-                $ai['klasrb'] = 5;
-                $ai['klasPrb'] = 100;
-
-            } elseif ($ai['rb'] >= 11) {
-                $ai['klasrb'] = 4;
-                $ai['klasPrb'] = ceil(($ai['rb'] - 11) / 4 * 100);
-
-            } elseif ($ai['rb'] >= 8) {
-                $ai['klasrb'] = 3;
-                $ai['klasPrb'] = ceil(($ai['rb'] - 8) / 3 * 100);
-            } elseif ($ai['rb'] >= 5) {
-                $ai['klasrb'] = 2;
-                $ai['klasPrb'] = ceil(($ai['rb'] - 5) / 3 * 100);
-            } elseif ($ai['rb'] >= 2) {
-                $ai['klasrb'] = 1;
-                $ai['klasPrb'] = ceil(($ai['rb'] - 2) / 3 * 100);
-            } else {
-                $ai['klasrb'] = 0;
-                $ai['klasPrb'] = ceil($ai['rb'] / 2 * 100);
-            }
-        }
-        if ($ai['pg'] > 0 || $check != null) //100/200/400/600/1000
-        {
-            $ai['namepg'] = '������. ��������';
-            if ($ai['pg'] >= 1000) {
-                $ai['klaspg'] = 5;
-                $ai['klasPpg'] = 100;
-
-            } elseif ($ai['pg'] >= 600) {
-                $ai['klaspg'] = 4;
-                $ai['klasPpg'] = ceil(($ai['pg'] - 600) / 400 * 100);
-
-            } elseif ($ai['pg'] >= 400) {
-                $ai['klaspg'] = 3;
-                $ai['klasPpg'] = ceil(($ai['pg'] - 400) / 200 * 100);
-            } elseif ($ai['pg'] >= 200) {
-                $ai['klaspg'] = 2;
-                $ai['klasPpg'] = ceil(($ai['pg'] - 200) / 200 * 100);
-            } elseif ($ai['pg'] >= 100) {
-                $ai['klaspg'] = 1;
-                $ai['klasPpg'] = ceil(($ai['pg'] - 100) / 100 * 100);
-            } else {
-                $ai['klaspg'] = 0;
-                $ai['klasPpg'] = ceil($ai['pg'] / 100 * 100);
-            }
-        }
-        if ($ai['bv'] > 0 || $check != null) {
-            $ai['namebv'] = '������� �������';
-            if ($ai['bv'] >= 250) {
-                $ai['klasbv'] = 5;
-                $ai['klasPbv'] = 100;
-
-            } elseif ($ai['bv'] >= 100) {
-                $ai['klasbv'] = 4;
-                $ai['klasPbv'] = ceil(($ai['bv'] - 100) / 150 * 100);
-
-            } elseif ($ai['bv'] >= 50) {
-                $ai['klasbv'] = 3;
-                $ai['klasPbv'] = ceil(($ai['bv'] - 50) / 50 * 100);
-            } elseif ($ai['bv'] >= 25) {
-                $ai['klasbv'] = 2;
-                $ai['klasPbv'] = ceil(($ai['bv'] - 25) / 25 * 100);
-            } elseif ($ai['bv'] >= 5) {
-                $ai['klasbv'] = 1;
-                $ai['klasPbv'] = ceil(($ai['bv'] - 5) / 20 * 100);
-            } else {
-                $ai['klasbv'] = 0;
-                $ai['klasPbv'] = ceil($ai['bv'] / 5 * 100);
-            }
-        }
-        if ($ai['kw'] > 0 || $check != null) {
-            $ai['namekw'] = '���� ��������';
-            if ($ai['kw'] >= 250) {
-                $ai['klaskw'] = 5;
-                $ai['klasPkw'] = 100;
-
-            } elseif ($ai['kw'] >= 100) {
-                $ai['klaskw'] = 4;
-                $ai['klasPkw'] = ceil(($ai['kw'] - 100) / 150 * 100);
-
-            } elseif ($ai['kw'] >= 50) {
-                $ai['klaskw'] = 3;
-                $ai['klasPkw'] = ceil(($ai['kw'] - 50) / 50 * 100);
-            } elseif ($ai['kw'] >= 25) {
-                $ai['klaskw'] = 2;
-                $ai['klasPkw'] = ceil(($ai['kw'] - 25) / 25 * 100);
-            } elseif ($ai['kw'] >= 5) {
-                $ai['klaskw'] = 1;
-                $ai['klasPkw'] = ceil(($ai['kw'] - 5) / 20 * 100);
-            } else {
-                $ai['klaskw'] = 0;
-                $ai['klasPkw'] = ceil($ai['kw'] / 5 * 100);
-            }
-        }
-        if ($ai['pa'] > 0 || $check != null) {
-            $ai['namepa'] = '���������������';
-            if ($ai['pa'] >= 250) {
-                $ai['klaspa'] = 5;
-                $ai['klasPpa'] = 100;
-
-            } elseif ($ai['pa'] >= 100) {
-                $ai['klaspa'] = 4;
-                $ai['klasPpa'] = ceil(($ai['pa'] - 100) / 150 * 100);
-
-            } elseif ($ai['pa'] >= 50) {
-                $ai['klaspa'] = 3;
-                $ai['klasPpa'] = ceil(($ai['pa'] - 50) / 50 * 100);
-            } elseif ($ai['pa'] >= 25) {
-                $ai['klaspa'] = 2;
-                $ai['klasPpa'] = ceil(($ai['pa'] - 25) / 25 * 100);
-            } elseif ($ai['pa'] >= 5) {
-                $ai['klaspa'] = 1;
-                $ai['klasPpa'] = ceil(($ai['pa'] - 5) / 20 * 100);
-            } else {
-                $ai['klaspa'] = 0;
-                $ai['klasPbs'] = 0;
-            }
-        }
-
-        $aii = mysql_fetch_array(mysql_query('SELECT `win_bs` AS `bs` FROM `users` WHERE `id`="' . $id . '" LIMIT 1'));
-        $ai['bs'] = $aii['bs'];//
-        if ($ai['bs'] > 0 || $check != null) {
-            $ai['namebs'] = '����� ������';
-            if ($ai['bs'] >= 500) {
-                $ai['klasbs'] = 5;
-                $ai['klasPbs'] = 100;
-
-            } elseif ($ai['bs'] >= 50) {
-                $ai['klasbs'] = 4;
-                $ai['klasPbs'] = ceil(($ai['bs'] - 50) / 450 * 100);
-                if ($ai['klasPbs'] == 100) {
-                    $ai['klasPbs'] = 99;
-                }
-
-            } elseif ($ai['bs'] >= 10) {
-                $ai['klasbs'] = 3;
-                $ai['klasPbs'] = ceil(($ai['bs'] - 10) / 40 * 100);
-            } elseif ($ai['bs'] >= 5) {
-                $ai['klasbs'] = 2;
-                $ai['klasPbs'] = ceil(($ai['bs'] - 5) / 5 * 100);
-            } elseif ($ai['bs'] >= 1) {
-                $ai['klasbs'] = 1;
-                $ai['klasPbs'] = ceil(($ai['bs'] - 1) / 4 * 100);
-            } else {
-                $ai['klasbs'] = 0;
-                $ai['klasPbs'] = 0;
-            }
-        }
-        /*
-		1.������� �����.
-		2.����������� ���. 100/250/500/1000/5000
-		3.������ ���������. 10/50/100/250
-		4.S ���� 5/10/25/50/100
-		5.M ���� 5/10/15/25/50
-		6.L ���� 3/5/8/10/15
-		7.����������� ��������. 10/25/50/100/150
-		8.������� �������. 5/10/25/50/100
-		9.�������� �����. 10/25/50/75/100
-		10.������������� ������. 50/100/250/500/1000
-		11. ����� ������.
-		*/
-        return $ai;
+        Db::sql('update users set money2 = money2 + ? where id = ?', [$amount, $this->info['id']]);
     }
 
     private function __construct()
@@ -1709,11 +1381,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
         if ($c['securetime'] > 0) {
             if (!defined('IP')) {
-                $dip = '';
-                if (!empty($_SERVER['HTTP_CLIENT_IP']))
-                    $dip = $_SERVER['HTTP_CLIENT_IP'];
-                else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
-                    $dip = $_SERVER['HTTP_X_FORWARDED_FOR'];
                 $dip = $_SERVER['REMOTE_ADDR'];
                 define('IP', $dip);
             }
@@ -1771,16 +1438,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             setcookie('btl', $this->info['battle'], time() + 86400);
         }
 
-        //��� �������
-        /*if($this->info['banned'] == 7007001) {
-			$spm_url = mysql_fetch_array(mysql_query('SELECT * FROM `_spamer` WHERE `host` = "'.$this->info['host'].'" LIMIT 1'));
-			if(isset($spm_url['id'])) {
-				die('<meta http-equiv="refresh" content="0; URL=/banned.php?id='.$spm_url['id'].'">');
-			}else{
-				die('<meta http-equiv="refresh" content="0; URL=/banned.php?kill=1">');
-			}
-		}*/
-
         if (!isset($this->info['id'])) {
             $this->info = mysql_fetch_array(mysql_query('SELECT 
 			`u`.`nadmin`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`win_bs`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`
@@ -1800,7 +1457,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
         if (isset($this->info['id'])) {
             if ($this->info['invis'] == 1 || $this->info['invis'] > time()) {
-                $this->info['cast_login'] = '<i>���������</i>';
+                $this->info['cast_login'] = '<i>Невидимка</i>';
             } else {
                 $this->info['cast_login'] = $this->info['login'];
             }
@@ -1849,185 +1506,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $this->info['login2'] = '';
                 mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
             }
-            /* ��������� �����������  */
-            /*$i = $this->testAction('`time` >= "'.(time()-7129).'" AND `vars` = "reclama1" LIMIT 1',1);
-			if(!isset($i['id']))
-			{
-				$this->addAction(time(),'reclama1','');
-				//��������� � ���
-				$t6 = array('','');
-				if(date('N') == 1) {
-					//�����������
-					$t6[0] = '� �����';
-				}elseif(date('N') == 2) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 3) {
-					//�����
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �������';
-					}
-				}elseif(date('N') == 4) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 5) {
-					//�������
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �����������';
-					}
-				}elseif(date('N') == 6) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 7) {
-					//�����������
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �����';
-					}
-				}
-				$r = '<font color=red><strong>�����������!</strong></font> ������ �� ������ ������ ��������� '.$t6[0].' (� 20:00 �� ����������� �������). ����� ��������� ���������� � ��������� <img src=https://img.new-combats.com/i/clan/PokerStars.com.gif width=24 height=15><a href=https://new-combats.com/info/1457199 target=_blank>Alexandr</a> ��� �� ����� ������� <a href=https://events.new-combats.com/?page_id=3&st=323 target=_blank>Events.new-combats.com</a>';
-				//���������� ��������� � ���
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
-			}
-			*/
-            /*
-			//���� ������� ������������ �� �����
-			mysql_query('LOCK TABLES users,stats,chat,room,test_bot,battle WRITE');
-			$dasc = array('ASC','DESC');
-			$sp = mysql_query('SELECT `u`.`id`,`u`.`bot_room`,`s`.`atack`,`u`.`type_pers`,`s`.`bbexp`,`s`.`timeGo`,`s`.`timeGoL`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`room`,`u`.`level`,`u`.`battle`,`s`.`hpNow`,`s`.`mpNow`,`s`.`team`,`u`.`city` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`type_pers` > 0 AND `s`.`timeGo` < '.time().' AND `s`.`timeGoL` < '.time().' ORDER BY `s`.`timeGoL` '.$dasc[rand(0,1)].' LIMIT 11');
-			while($pl = mysql_fetch_array($sp)) {
-				if($pl['type_pers']>0 && $pl['battle'] == 0) {
-					//��� ������������
-					if($pl['timeGo']<time()) {
-						$rm = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `id` = "'.$pl['room'].'" LIMIT 1'));
-						$rmgo = explode(',',$rm['roomGo']);
-						$rmgo = $rmgo[rand(0,count($rmgo)-1)];
-						$rmgo = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `id` = "'.$rmgo.'" AND `botgo` > 0 AND `close` = 0 AND `destroy` = 0 LIMIT 1'));
-						if(isset($rmgo['id'])) {
-							$pl['room'] = $rmgo['id'];
-							mysql_query('UPDATE `users` SET `room` = "'.$rmgo['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							mysql_query('UPDATE `stats` SET `timeGo` = "'.(time()+rand(60,240)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-					}
-				}
-				if($pl['type_pers']>1 && $pl['battle'] == 0 && $pl['timeGoL']<time()) {
-					//��� �������
-					$ru = array();
-					$rs = array();
-					$spu = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-10).'" AND `u`.`banned` = "0" LIMIT 5');
-					while($plu = mysql_fetch_array($spu)) {
-						if($plu['battle'] == 0) {
-							$ru[count($ru)] = $plu['id'];
-							$rs[$plu['id']] = $plu;
-						}
-					}
-					$ru = $ru[rand(0,count($ru)-1)];
-					if($ru > 0 && rand(0,10000) < 2500) {
-						//�������� �� �����
-						if($pl['timeGoL'] < time()) {
-							//��������
-							$atc = $magic->atackUser($pl['id'],$ru,$rs[$ru]['team'],$rs[$ru]['battle'],$pl['bbexp']);
-							if($atc == 1) {
-								$rs[$ru] = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-60).'" AND `u`.`banned` = "0" AND `u`.`id` = "'.$rs[$ru]['id'].'" LIMIT 1'));
-								$pl['battle'] = $rs[$ru]['battle'];
-								if($rs[$ru]['team'] == 1) {
-									$pl['team'] = 2;
-								}else{
-									$pl['team'] = 1;
-								}
-								mysql_query('UPDATE `users` SET `battle` = "'.$pl['battle'].'",`team` = "'.$pl['team'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <strong>".$pl['login']."</strong> �������� ��������� �� <strong>".$rs[$ru]['login']."</strong>...','".time()."','6','0')");
-								$sx = '';
-								if($pl['sex'] == 1) {
-									$sx = '�';
-								}
-								$rtxt = '[img[items/pal_button8.gif]] &quot;<small><font color=grey>!</font></small>'.$pl['login'].'&quot; �����������'.$sx.' ����� ��������� �� ��������� &quot;'.$rs[$ru]['login'].'&quot;.';
-								mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$pl['city']."','','','','".$rtxt."','".time()."','7','0','1','1')");
-							}else{
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <strong>".$pl['login']."</strong> �������� �� ������� ��������� �� <strong>".$rs[$ru]['login']."</strong>...','".time()."','6','0')");
-							}
-						}else{
-							//�������������
-							mysql_query('UPDATE `stats` SET `timeGoL` = "'.(time()+rand(30,520)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-					}
-				}
-
-				if($pl['type_pers']>2) {
-					if($pl['battle'] > 0) {
-						//��� � ��������
-						$btlu = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `time_over` = 0 AND `id` = "'.$pl['battle'].'" LIMIT 1'));
-						if(!isset($btlu['id'])) {
-							//�������� ��������
-							mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							//mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}else{
-							//�������� ������������
-							if($pl['atack'] < time()) {
-								//mysql_query('UPDATE `stats` SET `atack` = "'.(time()+123456789).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						}
-					}else{
-						//��� �� � ��������
-						if($pl['atack'] > time()) {
-							//mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-
-						//��� ����������� ��
-						if($pl['hpNow'] < 1) {
-							if($pl['bot_room'] > 0) {
-								//��������� � "����� ������"
-								mysql_query('UPDATE `users` SET `room` = "'.$pl['bot_room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								mysql_query('UPDATE `stats` SET `hpNow` = "1",`mpNow` = "1",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red><strong>��������!</strong></font> <strong>".$pl['login']."</strong> ��� �������� � ".$this->city_name[$pl['city']]."...','".time()."','6','0')");
-							}else{
-								//������ ������
-								mysql_query('UPDATE `stats` SET `hpNow` = "1000000000",`mpNow` = "1000000000",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						}elseif($pl['bot_room'] > 0 && $pl['room'] == $pl['bot_room']) {
-							$btst = $this->getStats($pl['id']);
-							if($btst['hpAll'] <= $btst['hpNow'] && $btst['mpAll'] <= $btst['mpNow']) {
-								mysql_query('UPDATE `stats` SET `hpNow` = "'.$btst['hpAll'].'",`mpNow` = "'.$btst['mpAll'].'",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								$nrm = mysql_fetch_array(mysql_query('SELECT `id` FROM `room` WHERE `name` = "����������� �������" AND `city` = "'.$pl['city'].'" LIMIT 1'));
-								mysql_query('UPDATE `users` SET `room` = "'.(0+$nrm['id']).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <strong>".$pl['login']."</strong> �������� � ������� &quot;����������� �������&quot; � ".$this->city_name[$pl['city']]."...','".time()."','6','0')");
-								unset($nrm);
-							}else{
-								//��������
-
-							}
-							unset($btst);
-						}
-					}
-				}
-			}
-			mysql_query('UNLOCK TABLES');
-			unset($pl,$sp,$plu,$spu,$atc,$ru,$rs);
-			/*
-			$upd = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "��������" AND `online` < '.(time()-604800).' LIMIT 1'));
-			if(isset($upd['id']))
-			{
-				mysql_query('UPDATE `users` SET `online` = "'.(time()+600).'" WHERE `id` = "'.$upd['id'].'" LIMIT 1');
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> <strong>��������</strong> �������� �� ����� Capital City! ������ ���������!','-1','5','0')");
-				unset($upd);
-			}
-			*/
 
             if (isset($_GET['homeworld'])) {
                 if ($this->info['zv'] == 0 && $this->info['battle'] == 0 && $this->info['dnow'] == 0) {
                     $hgo = $this->testHome();
                     if (!isset($hgo['id']) && $this->info['room'] != 274 && $this->info['align'] != 2 && $this->info['inTurnir'] == 0) {
                         $this->addAction(time(), 'go_homeworld', '');
-                        $rmt = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `name` = "����������� �������" AND `city` = "' . $this->info['city'] . '" LIMIT 1'));
+                        $rmt = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `name` = "Центральная площадь" AND `city` = "' . $this->info['city'] . '" LIMIT 1'));
                         if (isset($rmt['id'])) {
-                            //������� ��� ������ � ��
+                            //Удаляем все ставки в БС
                             if ($this->room['file'] == 'bsenter') {
-                                //������� ��� ������ � ��
+                                //Удаляем все ставки в БС
                                 $sp_bs = mysql_query('SELECT `id`,`bsid`,`money` FROM `bs_zv` WHERE `uid` = "' . $this->info['id'] . '" AND `inBot` = "0" AND `finish` = "0"');
                                 while ($pl_bs = mysql_fetch_array($sp_bs)) {
                                     mysql_query('UPDATE `bs_turnirs` SET `users` = `users` - 1 WHERE `id` = "' . $pl_bs['bsid'] . '" LIMIT 1');
@@ -2039,17 +1528,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             mysql_query('UPDATE `users` SET `room` = "' . $this->info['room'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
 
                         } else {
-                            $this->error = '� ���� ������ ������ ������������ ������� �������';
+                            $this->error = 'В этом городе нельзя пользоваться кнопкой возрата';
                         }
                         unset($rmt);
                     } else {
-                        $this->error = '��� ��������� ������������ ������� �������';
+                        $this->error = 'Вам запрещено пользоваться кнопкой возрата';
                     }
                     unset($hgo);
                 }
             }
 
-            //������� �����
+            //Заносим текст
             if (isset($_GET['itmid']) && isset($_GET['addtext'])) {
                 $itm = mysql_fetch_array(mysql_query('SELECT 
 				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
@@ -2069,46 +1558,46 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                             mysql_query('UPDATE `items_users` SET `use_text` = "' . $itm['use_text'] . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                             mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("' . $itm['id'] . '","' . time() . '","' . $this->info['login'] . '","' . mysql_real_escape_string(htmlspecialchars($txt, null, 'cp1251')) . '","' . $this->info['city'] . '","' . $sx . '")');
-                            $this->error = '������ ������� �����������';
+                            $this->error = 'Запись успешно произведена';
                         } else {
-                            $this->error = '����� ���-�� ��������...';
+                            $this->error = 'Нужно что-то написать...';
                         }
                     } else {
-                        $this->error = '������� ��� ������ �� ��������';
+                        $this->error = 'Предмет для записи не подходит';
                     }
                 } else {
-                    $this->error = '������� ��� ������ �� ������';
+                    $this->error = 'Предмет для записи не найден';
                 }
             }
 
-            //������ ��������
+            //Кидаем передачу
             if (isset($_POST['trnLogin'], $_GET['transfer']) && $this->info['battle'] == 0) {
                 if ($this->info['level'] < 4 && $this->info['admin'] == 0) {
-                    $this->error = '���������� �������� ����� ��������� ������ 4-�� ������';
+                    $this->error = 'Передавать предметы могут персонажи старше 4-го уровня';
                 } elseif ($this->info['align'] == 2 && $this->info['admin'] == 0) {
-                    $this->error = '�������� �� ����� ���������� �������� ������ ����������';
+                    $this->error = 'Хаосники не могут передавать предметы другим персонажам';
                 } else {
                     $t = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`login2`,`pass`,`pass2`,`emailconfirmation`,`securetime`,`sys`,`online`,`ip`,`ipreg`,`joinIP`,`admin`,`city`,`room`,`banned`,`auth`,`align`,`mod_zvanie`,`clan`,`nextMsg`,`molch1`,`molch2`,`molch3`,`level`,`money`,`battle`,`cityreg`,`invBlock`,`invBlockCode`,`zag`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`homepage`,`deviz`,`hobby`,`chatColor`,`timereg`,`add_smiles`,`obraz`,`win`,`lose`,`nich`,`cityreg2`,`host`,`info_delete`,`dateEnter`,`afk`,`dnd`,`timeMain`,`clan_prava`,`addpr`,`marry`,`city2`,`invis`,`bot_id`,`haos`,`host_reg`,`inUser`,`jail`,`animal`,`vip`,`catch`,`frg`,`no_ip`,`type_pers`,`bot_room` FROM `users` WHERE `login` = "' . mysql_real_escape_string($_POST['trnLogin']) . '" AND `city` = "' . $this->info['city'] . '" LIMIT 1'));
                     if (isset($t['id'])) {
                         if ($this->info['login'] == $t['login']) {
-                            $this->error = '�� �� ������ �������� ������ ����, �������� ' . $this->microLogin($t['id'], 1) . '';
+                            $this->error = 'Вы не можете передать самому себе, персонаж ' . $this->microLogin($t['id'], 1) . '';
                         } elseif ($t['battle'] > 0) {
-                            $this->error = '�������� ��������� � ���';
+                            $this->error = 'Персонаж находится в бою';
                         } elseif ($t['level'] < 4 && $this->info['admin'] == 0) {
-                            $this->error = '�� �� ������ ���������� �������� ���������� ���� 4-�� ������';
+                            $this->error = 'Вы не можете передавать предметы персонажам ниже 4-го уровня';
                         } elseif ($t['align'] == 2 && $this->info['admin'] == 0) {
-                            $this->error = '�� �� ������ ���������� �������� ���������';
+                            $this->error = 'Вы не можете передавать предметы хаосникам';
                         } elseif ($t['room'] != $this->info['room']) {
-                            $this->error = '�� ������ ��������� � ����� ������� � ����������';
+                            $this->error = 'Вы должны находится в одной комнате с персонажем';
                         } else {
-                            //������� ��������
+                            //создаем передачу
                             $tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "' . $this->info['id'] . '" OR `uid2` = "' . $this->info['id'] . '") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '") OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '") OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '")) ORDER BY `id` DESC LIMIT 1'));
                             if (isset($tt['id'])) {
-                                $this->error = '�� ��� ���������� � ��������';
+                                $this->error = 'Вы уже находитесь в передаче';
                             } else {
                                 $tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "' . $t['id'] . '" OR `uid2` = "' . $t['id'] . '") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "' . $t['id'] . '") OR (`finish2` > 0 AND `uid2` = "' . $t['id'] . '")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "' . $t['id'] . '") OR (`finish1` > 0 AND `uid1` = "' . $t['id'] . '")) ORDER BY `id` DESC LIMIT 1'));
                                 if (isset($tt['id'])) {
-                                    $this->error = '�������� ��� �������� ������';
+                                    $this->error = 'Персонаж уже проводит сделку';
                                 } else {
                                     $ins = mysql_query('INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("' . $this->info['id'] . '","' . $t['id'] . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . time() . '","' . mysql_real_escape_string(htmlspecialchars($_POST['textarea'], null, 'cp1251')) . '","' . time() . '")');
                                     if ($ins) {
@@ -2118,12 +1607,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             }
                         }
                     } else {
-                        $this->error = '�������� �� ������ � ���� ������';
+                        $this->error = 'Персонаж не найден в этом городе';
                     }
                 }
             }
 
-            //�������� ��������
+            //Выделяем передачи
             $this->tfer = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "' . $this->info['id'] . '" OR `uid2` = "' . $this->info['id'] . '") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '") OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "' . $this->info['id'] . '") OR (`finish1` > 0 AND `uid1` = "' . $this->info['id'] . '")) ORDER BY `id` DESC LIMIT 1'));
             if ($this->tfer['uid1'] == $this->tfer['uid2']) {
                 $this->tfer = false;
@@ -2137,7 +1626,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     if ($this->tfer['uid2'] == $this->info['id'] && $this->tfer['start2'] == 0) {
                         $this->tfer = false;
                     } elseif ($this->tfer['time'] < time() - 1800) {
-                        //���� �������� ������ 30 �����, �� ������
+                        //если передача дольше 30 минут, то отмена
                         $upd = mysql_query('UPDATE `transfers` SET `cancel1` = "' . time() . '",`cancel2` = "' . time() . '" WHERE `id` = "' . $this->tfer['id'] . '" LIMIT 1');
                         if ($upd) {
                             unset($this->tfer, $upd);
@@ -2158,11 +1647,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $upd = mysql_query('UPDATE `transfers` SET `cancel' . $upd . '` = "' . time() . '" WHERE `id` = "' . $this->tfer['id'] . '" LIMIT 1');
                         if ($upd) {
 
-                            $this->error = '�� ������� ���������� �� ��������.';
+                            $this->error = 'Вы успешно отказались от передачи.';
 
 
                             mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "' . $this->tfer['uid1'] . '" OR `uid` = "' . $this->tfer['uid2'] . '") AND `inTransfer` > 0');
-                            //��������� ��������� � ���
+                            //Добавляем сообщение в чат
                             if ($this->tfer['start2'] > 0) {
 
 
@@ -2171,10 +1660,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         }
                     } else {
                         if ($this->tfer['uid1'] == $this->info['id']) {
-                            //�������� �������� ������� ������
+                            //Передаем предметы другому игроку
 
                         } elseif ($this->tfer['uid2'] == $this->info['id']) {
-                            //��������� �������� �� ������� ������
+                            //Принимаем передачу от другого игрока
 
                         }
                     }
@@ -2182,22 +1671,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             }
 
             /*
-			�������������
+			автофлудераст
 			*/
 
-            //���������� ��������� �� �������
+            //Статистика персонажа на сегодня
             $stat = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time` >= ' . strtotime('now 00:00:00') . ' AND `vars` = "statistic_today" LIMIT 1', 1);
             if (!isset($stat['id'])) {
                 $this->addAction(time(), 'statistic_today', 'e=' . $this->info['exp'] . '|w=' . $this->info['win'] . '|l=' . $this->info['lose'] . '|n=' . $this->info['nich']);
             }
 
-            //������� ������ ��������
+            //Одеваем боевой комплект
             if (isset($_GET['usec1']) && $this->info['battle'] == 0) {
                 $cmp = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`type`,`val`,`name`,`time`,`delete` FROM `save_com` WHERE `uid` = "' . $this->info['id'] . '" AND `delete` = "0" AND `id` = "' . mysql_real_escape_string($_GET['usec1']) . '" LIMIT 1'));
                 if (isset($cmp['id'])) {
-                    //������� ��� ����
+                    //снимаем все вещи
                     mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "' . $this->info['id'] . '"');
-                    //������� ����, ���� ��� �� �������
+                    //одеваем вещи, если они не удалены
                     $cm = $this->lookStats($cmp['val']);
                     $i = 1;
                     while ($i <= 250) {
@@ -2220,7 +1709,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 if (isset($this->bank)) {
                     mysql_query('UPDATE `bank` SET `useNow` = "' . (time() + 24 * 60 * 60) . '" WHERE `id` = "' . $this->bank['id'] . '" LIMIT 1');
                 } else {
-                    $this->bank['error'] = '�������� ������ �� �����';
+                    $this->bank['error'] = 'Неверный пароль от счета';
                 }
             } elseif (!isset($_GET['bank_exit'])) {
                 $this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "' . $this->info['id'] . '" AND `block` = "0" AND `useNow` > ' . time() . ' ORDER BY `useNow` DESC  LIMIT 1'));
@@ -2231,7 +1720,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             }
 
             if (!isset($_GET['obt_sel']) && $this->info['battle'] == 0 && $this->info['obraz'] != '0.gif') {
-                //��������� ������� �����
+                //Проверяем текущий образ
                 $this->stats = $this->getStats($this->info['id'], 0);
                 $tr = true;
                 $o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `img` = "' . mysql_real_escape_string($this->info['obraz']) . '" AND `sex` = "' . $this->info['sex'] . '" AND (`login` = "" OR `login` = "' . $this->info['login'] . '") LIMIT 1'));
@@ -2308,7 +1797,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 $j++;
                             }
                             if ($tritm != '' && $tr == false) {
-                                $this->error = '���������� ��������: ' . $tritm . '';
+                                $this->error = 'Необходимы предметы: ' . $tritm . '';
                             }
                         }
                         while ($x < count($t)) {
@@ -2316,7 +1805,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             if (isset($po['tr_' . $n])) {
                                 if ($po['tr_' . $n] > $this->stats[$n]) {
                                     $tr = false;
-                                    $this->error = '������������ ������������� ��� ���������� ���������';
+                                    $this->error = 'Недостаточно характеристик или параметров персонажа';
                                 }
                             }
                             $x++;
@@ -2335,7 +1824,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         }
                     }
                 } else {
-                    $this->error = '�������� ����� ����� �� ���� ������ ���� � �����, ��������� ����� ' . date('d.m.Y H:i', $sm['time'] + 86400) . '';
+                    $this->error = 'Выбирать образ можно не чаще одного раза в сутки, следующая смена ' . date('d.m.Y H:i', $sm['time'] + 86400) . '';
                     unset($_GET['obr_sel']);
                     $_GET['inv'] = 1;
                 }
@@ -2352,7 +1841,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             if ($this->info['wipe'] != 0) {
                 $this->wipe();
             } else {
-                //��������� �����
+                //проверяем статы
 
             }
 
@@ -2368,24 +1857,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         global $magic;
         if (isset($_GET['use_snowball'])) {
             $this->stats = $this->getStats($this->info, 0);
-            //�������� ������ ������ �� ��
+            //Начинаем лепить снежок на ЦП
             if (isset($this->stats['items'][$this->stats['wp13id']]['id']) && $this->stats['items'][$this->stats['wp13id']]['item_id'] == 998) {
-                //������� �����, ��� ��
-                if ($this->room['name'] != '����������� �������') {
-                    $this->error2 = '�������� ���� ����� ������ �� ����������� �������';
+                //варежки одеты, все ок
+                if ($this->room['name'] != 'Центральная площадь') {
+                    $this->error2 = 'Собирать снег можно только на Центральной площади';
                 } else {
                     $smt = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time`>=' . (time() - 120) . ' AND `vars` = "create_snowball_cp" LIMIT 1', 1);
                     if (isset($smt['id'])) {
-                        $this->error2 = '������ ������ ��������� ������� ������������ ;)';
+                        $this->error2 = 'Нельзя лепить несколько снежков одновременно ;)';
                     } else {
                         $smt = $this->testAction('`uid` = "' . $this->info['id'] . '" AND `time`>=' . strtotime('now 00:00:00') . ' AND `vars` = "create_snowball_cp" LIMIT 25', 2);
                         $smt = $smt[0];
                         if ($smt < 10) {
                             $this->addAction(time(), 'create_snowball_cp', $this->info['city']);
                             $magic->add_eff($this->info['id'], 24);
-                            $this->error2 = '�������� ������ ������, �������� ' . (10 - $smt) . ' ��� �� ������� ...';
+                            $this->error2 = 'Начинаем лепить снежок, осталось ' . (10 - $smt) . ' раз на сегодня ...';
                         } else {
-                            $this->error2 = '�� ��� ������� 10 ������ �� ������� ...';
+                            $this->error2 = 'Вы уже слепили 10 снежка за сегодня ...';
                         }
                     }
                 }
@@ -2411,20 +1900,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             $v = 0;
         }
         if ($t == 0) {
-            $names[] = ' <img height=7 title=������&nbsp;��� src=https://img.new-combats.com/zub_low1.gif />';
-            $names[] = ' <img height=7 title=����������&nbsp;��� src=https://img.new-combats.com/zub_low2.gif />';
-            $names[] = ' <img height=7 title=�����&nbsp;��� src=https://img.new-combats.com/zub_low3.gif />';
-            $names[] = ' <img height=7 title=�������&nbsp;��� src=https://img.new-combats.com/zub_low4.gif />';
+            $names[] = ' <img height=7 title=Гнилой&nbsp;Зуб src=https://img.new-combats.com/zub_low1.gif />';
+            $names[] = ' <img height=7 title=Нормальный&nbsp;Зуб src=https://img.new-combats.com/zub_low2.gif />';
+            $names[] = ' <img height=7 title=Белый&nbsp;Зуб src=https://img.new-combats.com/zub_low3.gif />';
+            $names[] = ' <img height=7 title=Золотой&nbsp;Зуб src=https://img.new-combats.com/zub_low4.gif />';
         } else {
-            $names[] = ' <img style=vertical-align:baseline height=7 title=������&nbsp;��� src=https://img.new-combats.com/zub_low1.gif />';
-            $names[] = ' <img style=vertical-align:baseline height=7 title=����������&nbsp;��� src=https://img.new-combats.com/zub_low2.gif />';
-            $names[] = ' <img style=vertical-align:baseline height=7 title=�����&nbsp;��� src=https://img.new-combats.com/zub_low3.gif />';
-            $names[] = ' <img style=vertical-align:baseline height=7 title=�������&nbsp;��� src=https://img.new-combats.com/zub_low4.gif />';
+            $names[] = ' <img style=vertical-align:baseline height=7 title=Гнилой&nbsp;Зуб src=https://img.new-combats.com/zub_low1.gif />';
+            $names[] = ' <img style=vertical-align:baseline height=7 title=Нормальный&nbsp;Зуб src=https://img.new-combats.com/zub_low2.gif />';
+            $names[] = ' <img style=vertical-align:baseline height=7 title=Белый&nbsp;Зуб src=https://img.new-combats.com/zub_low3.gif />';
+            $names[] = ' <img style=vertical-align:baseline height=7 title=Золотой&nbsp;Зуб src=https://img.new-combats.com/zub_low4.gif />';
         }
         $int = $v;
         do {
             $mod = $int % 10;
-            $int = floor($int / 10);//��� ������� $int = ($int-$mod)/10;
+            $int = floor($int / 10);//или быстрее $int = ($int-$mod)/10;
             $r = array_shift($names) . "" . $mod . "" . $r;
 
         } while ($int);
@@ -2452,7 +1941,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 				$ekr_add = round($h*0.45,2);
 				$bnks = mysql_fetch_array(mysql_query('SELECT `id`,`money2` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" ORDER BY `id` DESC LIMIT 1'));
 				if( isset($bnks['id']) ) {
-					$r .= ' �� �������� '.$ekr_add.' ���. (<small>���� �'.$bnks['id'].'</small>) �� '.$h.' �. � �������!';
+					$r .= ' Вы получили '.$ekr_add.' екр. (<small>Банк №'.$bnks['id'].'</small>) за '.$h.' ч. в онлайне!';
 					$this->info['catch'] += $ekr_add;
 					$bnks['money2'] += $ekr_add;
 					mysql_query('UPDATE `users` SET `catch` = "'.$this->info['catch'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
@@ -2483,7 +1972,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 						mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1');
 					}
 
-					//������ $m ��. ��������� ������� �� ������
+					//Выдаем $m шт. предметов награды за онлайн
 					if($m > 0) {
 						$hrg = 1;
 						//$this->addItem(2130,$this->info['id'],'noodet=1|noremont=1');
@@ -2503,9 +1992,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 					}
 
 					/*if($this->info['id'] == 285838 || $this->info['admin'] > 0) {
-					$r .= '<strong><font color=red>��������!</font></strong> ������������� �������: <strong>'.$enreg.'</strong> ��. ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']';
+					$r .= '<strong><font color=red>Внимание!</font></strong> восстановлено энергии: <strong>'.$enreg.'</strong> ед. ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']';
 
-					//���������� ��������� � ���
+					//Отправляем сообщение в чат
 					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','-1','5','0')");
 					}*/
         //}
@@ -2555,15 +2044,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         if ($clon != null) {
             $r = false;
             if (is_array($clon)) {
-                //��� ����� ����
+                //уже взяли инфу
             } else {
                 $clon = $this->takePersInfo('`u`.`id` = "' . ((int)$clon) . '"');
             }
             if (isset($clon['id'])) {
                 if (!isset($clon['loclon'])) {
-                    $clon['login'] .= ' (����)';
+                    $clon['login'] .= ' (Клон)';
                 }
-                //�������� ������������
+                //копируем пользователя
                 $ins1 = mysql_query('INSERT INTO `users` (
 				`align`,
 				`login`,
@@ -2597,7 +2086,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 				)');
                 if ($ins1) {
                     if ($round > 0) {
-                        //�������� ��. � ����� � �� 1 ����� = +10%
+                        //Улучшаем мф. и статы и НР 1 раунд = +10%
                         $statss = $this->lookStats($clon['stats']);
                         //
                         $statss['s1'] = ceil($statss['s1'] * (1 + 0.1 * ($round)));
@@ -2619,7 +2108,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         unset($statss);
                     }
                     if ($luser == true && $clon['level'] < 8) {
-                        //���� ������, ���� � ������
+                        //Хуже уворот, крит и защита
                         $statss = $this->lookStats($clon['stats']);
                         $statss['m1'] = ceil($statss['m1'] * 0.75);
                         $statss['m2'] = ceil($statss['m2'] * 0.75);
@@ -2635,16 +2124,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         unset($statss);
                     }
                     $uid = mysql_insert_id();
-                    //�������� �����
+                    //копируем статы
                     $ins2 = mysql_query('INSERT INTO `stats` (`clone`,`id`,`stats`,`hpNow`,`upLevel`,`bot`,`priems`) VALUES ("' . $clon['id'] . '","' . $uid . '","' . $clon['stats'] . '","1000000","' . $clon['upLevel'] . '","1","' . $clon['priems'] . '")');
                     if ($ins2) {
-                        //�������� ��������
+                        //копируем предметы
                         $sp = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `uid` = "' . $clon['id'] . '" AND `inOdet` > 0 AND `delete` = "0" LIMIT 50');
                         while ($pl = mysql_fetch_array($sp)) {
                             $pl['data'] = str_replace('toclan', 'to_clan_', $pl['data']);
                             mysql_query('INSERT INTO `items_users` (`uid`,`item_id`,`data`,`inOdet`,`iznosMAX`,`kolvo`) VALUES ("' . $uid . '","' . $pl['item_id'] . '","' . $pl['data'] . '","' . $pl['inOdet'] . '","' . $pl['iznosMAX'] . '","' . $pl['kolvo'] . '")');
                         }
-                        //�������� �������
+                        //копируем эффекты
                         $sp = mysql_query('SELECT `id`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`timeAce`,`user_use`,`delete`,`v1`,`v2`,`img2`,`x`,`hod`,`bj`,`sleeptime`,`no_Ace`,`tr_life_user` FROM `eff_users` WHERE `uid` = "' . $clon['id'] . '" AND `delete` = "0" AND `deactiveTime` < "' . time() . '" AND `v1` != "priem" LIMIT 50');
                         while ($pl = mysql_fetch_array($sp)) {
                             mysql_query('INSERT INTO `eff_users` (`uid`,`id_eff`,`data`,`name`,`overType`,`timeUse`,`x`) VALUES ("' . $uid . '","' . $pl['id_eff'] . '","' . $pl['data'] . '","' . $pl['name'] . '","' . $pl['overType'] . '","' . $pl['timeUse'] . '","' . $pl['x'] . '")');
@@ -2707,7 +2196,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 if ($ins1) {
                     $uid = mysql_insert_id();
                     if ($round > 0) {
-                        //�������� ��. � ����� � �� 1 ����� = +20%
+                        //Улучшаем мф. и статы и НР 1 раунд = +20%
                         $statss = $this->lookStats($bot['stats']);
                         //
                         $statss['s1'] = ceil($statss['s1'] * (1 + 0.20 * ($round)));
@@ -2734,7 +2223,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $bot['logins_bot'] = $logins_bot;
                         $ret = $bot;
 
-                        //������ ��������
+                        //Выдаем предметы
                         //$this->addItem($item_id,$uid);
                         $iu = explode(',', $bot['itemsUse']);
                         $i = 0;
@@ -2776,13 +2265,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
     }
 
     /*
-	 	  * $iid ���������� id �������� � ����������� ���� ���
-	 	  * ������� �� �����.
+	 	  * $iid Уникальный id прдемета и одновремено флаг что
+	 	  * покупка из комка.
 	 	  */
     public function buyItem($sid, $itm, $x, $mdata = null, $vip = false)
     {
         global $c, $code, $sid;
-        // sid 700 - 730 ����������������� �������� ��� ������ � ������ (�� ����� �� 10���)
+        // sid 700 - 730 зарезервированный диапазон для кузниц в пещере (АП вешей до 10лвл)
         $x = round((int)$x);
         if ($x < 1) {
             $x = 1;
@@ -2798,9 +2287,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             $test = $this->testVipItems($i['type']);
         }
         if ($vip == true && $test == false) {
-            $r = '������ ������� ���������� VIP ���������, ����������� ����� ������� �������';
+            $r = 'Данная покупка ограничена VIP аккаунтом, приобретите более дорогой аккаунт';
         } elseif ($this->info['allLock'] > time()) {
-            $r = '��� ��������� ��������� ������� �� ' . date('d.m.y H:i', $this->info['allLock']) . '';
+            $r = 'Вам запрещено совершать покупки до ' . date('d.m.y H:i', $this->info['allLock']) . '';
         } elseif (isset($i['id'])) {
             if ($i['price_4'] <= 0) {
                 $i['price_4'] = $i['price3'];
@@ -2846,7 +2335,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $trn = 1;
                 }
 
-                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // ��������� ��������� ��� �������
+                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки
                     $need_rep = 0;
                     $tr_rep = $this->lookStats($i['tr_reputation']);
                     foreach ($tr_rep as $row) {
@@ -2865,21 +2354,21 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 if ($i['max_buy'] < $x && $i['max_buy'] > 0) {
-                    $r = '��� ������� �������� ' . $i['max_buy'] . ' ��.';
+                    $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.';
                 } elseif ($need_rep > 0) {
-                    $r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
+                    $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.';
                 } elseif ($mxby == -1) {
-                    $r = '������������ ���������� ������� ��� ������� �������� ���������';
+                    $r = 'Максимальное количество покупок для данного предмета исчерпана';
                 } elseif ($trn == 0 && $this->info['admin'] == 0) {
-                    $r = '� ��� ������������ ��������� ��������� (�� ������� ' . $trnt . ')';
+                    $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')';
                 } elseif ($i['price_4'] * $x > ($this->rep['rep3'] - $this->rep['rep3_buy'])) {
-                    $r = '� ��� ������������ ��������� (�� ������� ' . ($price - ($this->rep['rep3'] - $this->rep['rep3_buy'])) . ' ���������.)';
+                    $r = 'У вас недостаточно репутации (не хватает ' . ($price - ($this->rep['rep3'] - $this->rep['rep3_buy'])) . ' репутации.)';
                 } else {
                     $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1'));
                     $this->rep['rep3_buy'] += $price;
                     $upd = mysql_query('UPDATE `rep` SET `rep3_buy` = "' . mysql_real_escape_string($this->rep['rep3_buy']) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                     if ($upd) {
-                        //����� ����
+                        //новая дата
                         $data = '';
                         $data .= $d['data'];
                         if ($mdata != null) {
@@ -2915,36 +2404,36 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $ix++;
                         }
                         if ($ins) {
-                            //���������� � ������ ���� ��� ������� �������
+                            //Записываем в личное дело что предмет получен
                             if ($trnt != '' && $i['tr_items'] != '') {
                                 $trnt = ', ' . $trnt;
                             }
-                            $r = '�� ��������� ������� &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') �� ' . $price . ' ���������. ' . $trnt . '<br>������� ������� �������� � ���������.';
+                            $r = 'Вы приобрели предмет &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') за ' . $price . ' репутации. ' . $trnt . '<br>Предмет успешно добавлен в инвентарь.';
 
                             $j = 0;
                             while ($j < count($detrn)) {
                                 $ost = ((int)$detrn[$j][1]);
                                 $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . '');
                                 while ($itm = mysql_fetch_array($s4)) {
-                                    //������� �������
+                                    //удаляем предмет
                                     mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                                 }
                                 $j++;
                             }
 
-                            //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><strong>����������� �������!</strong></font> �������� <strong>".$this->info['login']."</strong> �������� ������� &quot;<font color=salmon><strong>".$i['name']."</strong></font>&quot; , ����������� � ������� ��������!','-1','5','0')");
+                            //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><strong>Артефактный магазин!</strong></font> Персонаж <strong>".$this->info['login']."</strong> приобрел предмет &quot;<font color=salmon><strong>".$i['name']."</strong></font>&quot; , Поздравляем с удачной покупкой!','-1','5','0')");
                             mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1');
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �������� ������� &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] �� <strong>' . $price . '</strong> ���������.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: Приобрел предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] за <strong>' . $price . '</strong> репутации.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                         } else {
-                            //���������� � ������ ���� ��� ������� �� �������
-                            $r = '��� �� ������� ���������� &quot;' . $i['name'] . '&quot;. ������������� �������� � &quot;' . $this->city_name[$this->info['city']] . '&quot; ������ ��� ' . $price . ' ���������. <br>�������� ���� ��������� �� ����������.';
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �� ������� ���������� ������� #' . $i['iid'] . '. � �������: <strong>' . $price . '</strong> ���������. ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            //Записываем в личное дело что предмет не получен
+                            $r = 'Вам не удалось приобрести &quot;' . $i['name'] . '&quot;. Администрация магазина в &quot;' . $this->city_name[$this->info['city']] . '&quot; должна Вам ' . $price . ' репутации. <br>Приносим свои извинения за неудобства.';
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: не удалось приобрести предмет #' . $i['iid'] . '. К возрату: <strong>' . $price . '</strong> репутации. ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                             if (!$ld) {
-                                echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
+                                echo '<div>Ошибка, невозможно добавить запись в /db/usersDelo/!</div>';
                             }
                         }
                     } else {
-                        $r = '��� �� ������� ���������� �������...';
+                        $r = 'Вам не удалось приобрести предмет...';
                     }
                 }
             } elseif ($i['price_3'] > 0) {
@@ -2987,7 +2476,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $trn = 1;
                 }
 
-                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // ��������� ��������� ��� �������
+                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки
                     $need_rep = 0;
                     $tr_rep = $this->lookStats($i['tr_reputation']);
                     foreach ($tr_rep as $row) {
@@ -3006,21 +2495,21 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 if ($i['max_buy'] < $x && $i['max_buy'] > 0) {
-                    $r = '��� ������� �������� ' . $i['max_buy'] . ' ��.';
+                    $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.';
                 } elseif ($need_rep > 0) {
-                    $r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
+                    $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.';
                 } elseif ($mxby == -1) {
-                    $r = '������������ ���������� ������� ��� ������� �������� ���������';
+                    $r = 'Максимальное количество покупок для данного предмета исчерпана';
                 } elseif ($trn == 0 && $this->info['admin'] == 0) {
-                    $r = '� ��� ������������ ��������� ��������� (�� ������� ' . $trnt . ')';
+                    $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')';
                 } elseif ($i['price_3'] * $x > $this->info['money3']) {
-                    $r = '� ��� ������������ ������ (�� ������� ' . ($price - $this->info['money3']) . ' $)';
+                    $r = 'У вас недостаточно валюты (не хватает ' . ($price - $this->info['money3']) . ' $)';
                 } else {
                     $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1'));
                     $this->info['money3'] -= $price;
                     $upd = mysql_query('UPDATE `users` SET `money3` = "' . mysql_real_escape_string($this->info['money3']) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                     if ($upd) {
-                        //����� ����
+                        //новая дата
                         $data = '';
                         $data .= $d['data'];
                         if ($mdata != null) {
@@ -3056,36 +2545,36 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $ix++;
                         }
                         if ($ins) {
-                            //���������� � ������ ���� ��� ������� �������
+                            //Записываем в личное дело что предмет получен
                             if ($trnt != '' && $i['tr_items'] != '') {
                                 $trnt = ', ' . $trnt;
                             }
-                            $r = '�� ��������� ������� &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') �� ' . $price . ' $. ' . $trnt . '<br>������� ������� �������� � ���������.';
+                            $r = 'Вы приобрели предмет &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') за ' . $price . ' $. ' . $trnt . '<br>Предмет успешно добавлен в инвентарь.';
 
                             $j = 0;
                             while ($j < count($detrn)) {
                                 $ost = ((int)$detrn[$j][1]);
                                 $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . '');
                                 while ($itm = mysql_fetch_array($s4)) {
-                                    //������� �������
+                                    //удаляем предмет
                                     mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                                 }
                                 $j++;
                             }
 
-                            //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><strong>����������� �������!</strong></font> �������� <strong>".$this->info['login']."</strong> �������� ������� &quot;<font color=salmon><strong>".$i['name']."</strong></font>&quot; , ����������� � ������� ��������!','-1','5','0')");
+                            //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><strong>Артефактный магазин!</strong></font> Персонаж <strong>".$this->info['login']."</strong> приобрел предмет &quot;<font color=salmon><strong>".$i['name']."</strong></font>&quot; , Поздравляем с удачной покупкой!','-1','5','0')");
                             mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1');
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �������� ������� &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] �� <strong>' . $price . '</strong> $', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: Приобрел предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] за <strong>' . $price . '</strong> $', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                         } else {
-                            //���������� � ������ ���� ��� ������� �� �������
-                            $r = '��� �� ������� ���������� &quot;' . $i['name'] . '&quot;. ������������� �������� � &quot;' . $this->city_name[$this->info['city']] . '&quot; ������ ��� ' . $price . ' $ <br>�������� ���� ��������� �� ����������.';
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �� ������� ���������� ������� #' . $i['iid'] . '. � �������: <strong>' . $price . '</strong> $ ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            //Записываем в личное дело что предмет не получен
+                            $r = 'Вам не удалось приобрести &quot;' . $i['name'] . '&quot;. Администрация магазина в &quot;' . $this->city_name[$this->info['city']] . '&quot; должна Вам ' . $price . ' $ <br>Приносим свои извинения за неудобства.';
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: не удалось приобрести предмет #' . $i['iid'] . '. К возрату: <strong>' . $price . '</strong> $ ', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                             if (!$ld) {
-                                echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
+                                echo '<div>Ошибка, невозможно добавить запись в /db/usersDelo/!</div>';
                             }
                         }
                     } else {
-                        $r = '��� �� ������� ���������� �������...';
+                        $r = 'Вам не удалось приобрести предмет...';
                     }
                 }
             } elseif ($sid == 2 || $sid == 777) {
@@ -3102,14 +2591,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $i['price_2'] = round($i['price_2'] / 20, 2);
                 }
 
-                //������ � ��������������� ������� 5%
+                //Скидка в государственный магазин 5%
                 if ($this->stats['silver'] >= 1) {
                     if ($sid == 2) {
                         $i['price_1'] = round($i['price_1'] / 100 * 95, 2);
                     }
                 }
 
-                //������ � ������� ������� 5%
+                //Скидка в березку магазин 5%
                 if ($this->stats['silver'] >= 5) {
                     if ($sid == 2) {
                         $i['price_2'] = round($i['price_2'] / 100 * 95, 2);
@@ -3126,11 +2615,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 if ($i['max_buy'] < $x && $i['max_buy'] > 0) {
-                    $r = '��� ������� �������� ' . $i['max_buy'] . ' ��.';
+                    $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.';
                 } elseif ($mxby == -1) {
-                    $r = '������������ ���������� ������� ��� ������� �������� ���������';
+                    $r = 'Максимальное количество покупок для данного предмета исчерпана';
                 } elseif ($i['price_2'] * $x > $this->info['money2']) {
-                    $r = '� ��� ������������ ����� �� ����� (�� ������� ' . ($price - $this->info['money2']) . ' ���.)';
+                    $r = 'У вас недостаточно денег на счете (не хватает ' . ($price - $this->info['money2']) . ' екр.)';
                 } else {
                     $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1'));
                     $this->info['money2'] -= $price;
@@ -3138,7 +2627,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     if ($upd) {
                         $this->info['frg'] += $price;
                         mysql_query('UPDATE `users` SET `frg` = "' . floor($this->info['frg']) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
-                        //����� ����
+                        //новая дата
                         $data = '';
                         $data .= $d['data'];
                         $i['time_create'] = time();
@@ -3181,23 +2670,23 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $ix++;
                         }
                         if ($ins) {
-                            //���������� � ������ ���� ��� ������� �������
-                            $r = '�� ��������� ������� &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') �� ' . $price . ' ���.<br>������� ������� �������� � ���������.';
+                            //Записываем в личное дело что предмет получен
+                            $r = 'Вы приобрели предмет &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') за ' . $price . ' екр.<br>Предмет успешно добавлен в инвентарь.';
                             mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1');
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>EkrShop.' . $this->info['city'] . '</font>&quot;: �������� ������� &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ',add items ' . $gix . ') [#' . $i['iid'] . '] �� <strong>' . $price . '</strong> ���.', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', (int)$price, 0);
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>EkrShop.' . $this->info['city'] . '</font>&quot;: Приобрел предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ',add items ' . $gix . ') [#' . $i['iid'] . '] за <strong>' . $price . '</strong> екр.', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', (int)$price, 0);
                         } else {
-                            //���������� � ������ ���� ��� ������� �� �������
-                            $r = '��� �� ������� ���������� &quot;' . $i['name'] . '&quot;. ������������� �������� � &quot;' . $this->city_name[$this->info['city']] . '&quot; ������ ��� ' . $price . ' ���.<br>�������� ���� ��������� �� ����������.';
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>EkrShop.' . $this->info['city'] . '</font>&quot;: �� ������� ���������� ������� #' . $i['iid'] . '. � �������: <strong>' . $price . '</strong> ���.', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', 0, 0);
+                            //Записываем в личное дело что предмет не получен
+                            $r = 'Вам не удалось приобрести &quot;' . $i['name'] . '&quot;. Администрация магазина в &quot;' . $this->city_name[$this->info['city']] . '&quot; должна Вам ' . $price . ' екр.<br>Приносим свои извинения за неудобства.';
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>EkrShop.' . $this->info['city'] . '</font>&quot;: не удалось приобрести предмет #' . $i['iid'] . '. К возрату: <strong>' . $price . '</strong> екр.', time(), $this->info['city'], 'EkrShop.' . $this->info['city'] . '', 0, 0);
                             if (!$ld) {
-                                echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
+                                echo '<div>Ошибка, невозможно добавить запись в /db/usersDelo/!</div>';
                             }
                         }
                     } else {
-                        $r = '��� �� ������� ���������� �������...';
+                        $r = 'Вам не удалось приобрести предмет...';
                     }
                 }
-            } elseif (($sid >= 700 && $sid <= 730) /*OR ( $sid >= 800 && $sid <=805 )*/) { // nalpva2.php �������� �������, � ���������� � ���� �����, ���� � ������.
+            } elseif (($sid >= 700 && $sid <= 730) /*OR ( $sid >= 800 && $sid <=805 )*/) { // nalpva2.php Покупаем предмет, и перемещаем в него Чарку, Руну и прочее.
                 if ($i['kolvo'] < $x) $x = $i['kolvo'];
                 if ($x < 1) $x = 1;
                 if ($i['price_1'] <= 0 && $i['tr_items'] == '') $i['price_1'] = $i['price1'];
@@ -3236,7 +2725,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $trn = 1;
                 }
 
-                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // ��������� ��������� ��� �������
+                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки
                     $need_rep = 0;
                     $tr_rep = $this->lookStats($i['tr_reputation']);
                     foreach ($tr_rep as $row) {
@@ -3255,17 +2744,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 if ($i['max_buy'] < $x && $i['max_buy'] > 0) {
-                    $r = '��� ������� �������� ' . $i['max_buy'] . ' ��.';
+                    $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.';
                 } elseif ($need_rep > 0) {
-                    $r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
+                    $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.';
                 } elseif ($i['price_1'] * $x > $this->info['money4'] && $zuby == 1) {
-                    $r = '� ��� ������������ �����.';
+                    $r = 'У вас недостаточно денег.';
                 } elseif ($mxby == -1) {
-                    $r = '������������ ���������� ������� ��� ������� �������� ���������<br>�������� ������: ' . $i['max_buy'] . ' ��.';
+                    $r = 'Максимальное количество покупок для данного предмета исчерпана<br>Возможно купить: ' . $i['max_buy'] . ' шт.';
                 } elseif ($trn == 0 && $this->info['admin'] == 0) {
-                    $r = '� ��� ������������ ��������� ��������� (�� ������� ' . $trnt . ')';
+                    $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')';
                 } elseif ($i['price_1'] * $x > $this->info['money'] && $zuby == 0) {
-                    $r = '� ��� ������������ ����� (�� ������� ' . ($price - $this->info['money']) . ' ��.)';
+                    $r = 'У вас недостаточно денег (не хватает ' . ($price - $this->info['money']) . ' кр.)';
                 } else {
                     $d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "' . $i['id'] . '" LIMIT 1'));
                     if ($zuby == 0) {
@@ -3273,7 +2762,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string(round($this->info['money'], 2)) . '",`money4` = "' . mysql_real_escape_string(round($this->info['money4'], 2)) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                     if ($upd) {
-                        //����� ����
+                        //новая дата
                         $data = '';
                         $data .= $d['data'];
                         if ($mdata != null) {
@@ -3334,11 +2823,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         }
                         if ($c_itm > 0) {
                             $data = $this->lookStats($data);
-                            // �����
+                            // Чарка
                             if (isset($c_itm_data_a['spell_st_name']) && isset($c_itm_data_a['spell_st_val']) && $c_itm_data_a['spell_st_name'] != '' && $c_itm_data_a['spell_st_val'] != '') {
                                 $data['add_' . $c_itm_data_a['spell_st_name']] = (int)(isset($data['add_' . $c_itm_data_a['spell_st_name']]) ? (int)$data['add_' . $c_itm_data_a['spell_st_name']] : 0) + (int)$c_itm_data_a['spell_st_val'];
                             }
-                            // ����
+                            // Руна
                             if (isset($c_itm_data_a['rune']) && $c_itm_data_a['rune'] > 0) {
 
                                 $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $c_itm_data_a['rune_id'] . '" LIMIT 1'));
@@ -3394,15 +2883,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $ix++;
                         }
                         if ($ins) {
-                            //���������� � ������ ���� ��� ������� �������
+                            //Записываем в личное дело что предмет получен
                             if ($trnt != '' && $i['tr_items'] != '') {
                                 $trnt = ', ' . $trnt;
                             }
 
                             if ($zuby == 0) {
-                                $r = '�� ��������� ������� &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') �� ' . $price . ' ��. ' . $trnt . '<br>������� ������� �������� � ���������.';
+                                $r = 'Вы приобрели предмет &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') за ' . $price . ' кр. ' . $trnt . '<br>Предмет успешно добавлен в инвентарь.';
                             } else {
-                                $r = '�� ��������� ������� &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') �� ' . $this->zuby($price) . '. ' . $trnt . '<br>������� ������� �������� � ���������.';
+                                $r = 'Вы приобрели предмет &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') за ' . $this->zuby($price) . '. ' . $trnt . '<br>Предмет успешно добавлен в инвентарь.';
                             }
 
                             $j = 0;
@@ -3410,27 +2899,27 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 $ost = ((int)$detrn[$j][1]);
                                 $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . '');
                                 while ($itm = mysql_fetch_array($s4)) {
-                                    //������� �������
+                                    //удаляем предмет
                                     mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                                 }
                                 $j++;
                             }
 
                             mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1');
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �������� ������� &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] �� <strong>' . $price . '</strong> ��.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: Приобрел предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] за <strong>' . $price . '</strong> кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                         } else {
-                            //���������� � ������ ���� ��� ������� �� �������
-                            $r = '��� �� ������� ���������� &quot;' . $i['name'] . '&quot;. ������������� �������� � &quot;' . $this->city_name[$this->info['city']] . '&quot; ������ ��� ' . $price . ' ��.<br>�������� ���� ��������� �� ����������.';
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �� ������� ���������� ������� #' . $i['iid'] . '. � �������: <strong>' . $price . '</strong> ��.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            //Записываем в личное дело что предмет не получен
+                            $r = 'Вам не удалось приобрести &quot;' . $i['name'] . '&quot;. Администрация магазина в &quot;' . $this->city_name[$this->info['city']] . '&quot; должна Вам ' . $price . ' кр.<br>Приносим свои извинения за неудобства.';
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: не удалось приобрести предмет #' . $i['iid'] . '. К возрату: <strong>' . $price . '</strong> кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                             if (!$ld) {
-                                echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
+                                echo '<div>Ошибка, невозможно добавить запись в /db/usersDelo/!</div>';
                             }
                         }
                     } else {
-                        $r = '��� �� ������� ���������� �������...';
+                        $r = 'Вам не удалось приобрести предмет...';
                     }
                 }
-            } else { // ����������� ������� ��������
+            } else { // Стандартная покупка предмета
                 if ($i['kolvo'] < $x) {
                     $x = $i['kolvo'];
                 }
@@ -3444,14 +2933,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $i['price_2'] = $i['price2'];
                 }
 
-                //������ � ��������������� ������� 5%
+                //Скидка в государственный магазин 5%
                 if ($this->stats['silver'] >= 1) {
                     if ($sid == 1) {
                         $i['price_1'] = round($i['price_1'] / 100 * 95, 2);
                     }
                 }
 
-                //������ � ������� ������� 5%
+                //Скидка в березку магазин 5%
                 if ($this->stats['silver'] >= 5) {
                     if ($sid == 2) {
                         $i['price_2'] = round($i['price_2'] / 100 * 95, 2);
@@ -3492,7 +2981,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $trn = 1;
                 }
 
-                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // ��������� ��������� ��� �������
+                if (isset($i['tr_reputation']) && $i['tr_reputation'] != '') { // Требуемая репутация для покупки
                     $need_rep = 0;
                     $tr_rep = $this->lookStats($i['tr_reputation']);
                     foreach ($tr_rep as $key => $val) {
@@ -3519,25 +3008,25 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $po = $this->lookStats($d['data']);
 
                 if ($zuby == 1 && $po['tr_lvl'] > 7) {
-                    $r = '������ ������� ������ ���������� �� ����.';
+                    $r = 'Данный предмет нельзя приобрести за зубы.';
                 } elseif (!isset($this->sid_zuby[$sid]) && $zuby == 1) {
-                    $r = '������ ������� ������ ���������� �� ����.';
+                    $r = 'Данный предмет нельзя приобрести за зубы.';
                 } elseif ($zuby == 1 && $i['nozuby'] == 1) {
-                    $r = '������ ������� ������ ���������� �� ����.';
+                    $r = 'Данный предмет нельзя приобрести за зубы.';
                 } elseif ($i['max_buy'] < $x && $i['max_buy'] > 0) {
-                    $r = '��� ������� �������� ' . $i['max_buy'] . ' ��.';
+                    $r = 'Для покупки доступно ' . $i['max_buy'] . ' шт.';
                 } elseif (isset($need_rep) && $need_rep == 0) {
-                    $r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
+                    $r = 'Вы не заслужили нашего доверия, мы не продадим вам этот товар.';
                 } elseif ($zuby == 1 && $this->info['money4'] < $i['price_1']) {
-                    $r = '� ��� ������������ �����.';
+                    $r = 'У вас недостаточно зубов.';
                 } elseif ($i['price_1'] * $x > $this->info['money4'] && $zuby == 1) {
-                    $r = '� ��� ������������ �����.';
+                    $r = 'У вас недостаточно денег.';
                 } elseif ($mxby == -1) {
-                    $r = '������������ ���������� ������� ��� ������� �������� ���������<br>�������� ������: ' . $i['max_buy'] . ' ��.';
+                    $r = 'Максимальное количество покупок для данного предмета исчерпана<br>Возможно купить: ' . $i['max_buy'] . ' шт.';
                 } elseif ($trn == 0 && $this->info['admin'] == 0) {
-                    $r = '� ��� ������������ ��������� ��������� (�� ������� ' . $trnt . ')';
+                    $r = 'У вас недостаточно требуемых предметов (не хватает ' . $trnt . ')';
                 } elseif ($i['price_1'] * $x > $this->info['money'] && $zuby == 0) {
-                    $r = '� ��� ������������ ����� (�� ������� ' . ($price - $this->info['money']) . ' ��.)';
+                    $r = 'У вас недостаточно денег (не хватает ' . ($price - $this->info['money']) . ' кр.)';
                 } else {
                     if ($zuby == 0) {
                         $this->info['money'] -= $price;
@@ -3546,7 +3035,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string(round($this->info['money'], 2)) . '",`money4` = "' . mysql_real_escape_string(round($this->info['money4'], 2)) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                     if ($upd) {
-                        //����� ����
+                        //новая дата
                         $data = '';
                         $data .= $d['data'];
                         $data = str_replace('sudba=1', 'sudba=' . $this->info['login'], $data);
@@ -3599,15 +3088,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $ix++;
                         }
                         if ($ins) {
-                            //���������� � ������ ���� ��� ������� �������
+                            //Записываем в личное дело что предмет получен
                             if ($trnt != '' && $i['tr_items'] != '') {
                                 $trnt = ', ' . $trnt;
                             }
 
                             if ($zuby == 0) {
-                                $r = '�� ��������� ������� &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') �� ' . $price . ' ��. ' . $trnt . '<br>������� ������� �������� � ���������.';
+                                $r = 'Вы приобрели предмет &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') за ' . $price . ' кр. ' . $trnt . '<br>Предмет успешно добавлен в инвентарь.';
                             } else {
-                                $r = '�� ��������� ������� &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') �� ' . $this->zuby($price) . '. ' . $trnt . '<br>������� ������� �������� � ���������.';
+                                $r = 'Вы приобрели предмет &quot;' . $i['name'] . '&quot; (x' . $x . ' / ' . $gix . ') за ' . $this->zuby($price) . '. ' . $trnt . '<br>Предмет успешно добавлен в инвентарь.';
                             }
 
                             $zx = 0;
@@ -3616,14 +3105,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                                 if (($sid == 1 || $sid == 5) && $i['level'] >= 4 && round($price / $x) > 25) {
                                     if ($this->stats['shopSale'] == 0 && $c['nosanich'] == false) {
-                                        //������ ��������� ������ � ��� �������� � ������
-                                        $prmn = 0; //�������������� �����
+                                        //Выдаем странички Саныча в гос магазине и канаве
+                                        $prmn = 0; //дополнительный бонус
                                         $prmn = (1 - (pow(0.5, ($price / $x / 200)))) * 100;
                                         $prmn = round(20 / 100 * $prmn);
                                         if (rand(0, 100) < 20 + $prmn && rand(0, 100) > 80 - $prmn) {
                                             //3143 - 3192
                                             if (rand(0, 100) < 20 + $prmn && rand(0, 100) > 80 - $prmn) {
-                                                //�������
+                                                //обложка
                                                 $gitm = rand(3193, 3195);
                                             } else {
                                                 $gitm = rand(3143, 3192);
@@ -3632,7 +3121,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                                 $gitm = 3194;
                                             }
                                             if ($sid == 5) {
-                                                //����������� �������
+                                                //привязываем судьбой
                                             }
                                             $this->addItem($gitm, $this->info['id']);
                                             $rs++;
@@ -3644,19 +3133,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                             if ($rs > 1) {
                                 if (rand(0, 1) == 1) {
-                                    $r .= ' ������� ��� �������� � �����-�� �������. (x' . $rs . ')';
+                                    $r .= ' Предмет был завернут в какую-то бумажку. (x' . $rs . ')';
                                 } elseif (rand(0, 1)) {
-                                    $r .= ' ������� ��� �������� � �������� ������. (x' . $rs . ')';
+                                    $r .= ' Предмет был завернут в странный свиток. (x' . $rs . ')';
                                 } else {
-                                    $r .= ' � �������� ���� ����������� �����-�� �������. (x' . $rs . ')';
+                                    $r .= ' К предмету была прикреплена какая-та бумажка. (x' . $rs . ')';
                                 }
                             } elseif ($rs > 0) {
                                 if (rand(0, 1) == 1) {
-                                    $r .= ' ������� ��� �������� � �����-�� �������.';
+                                    $r .= ' Предмет был завернут в какую-то бумажку.';
                                 } elseif (rand(0, 1)) {
-                                    $r .= ' ������� ��� �������� � �������� ������.';
+                                    $r .= ' Предмет был завернут в странный свиток.';
                                 } else {
-                                    $r .= ' � �������� ���� ����������� �����-�� �������.';
+                                    $r .= ' К предмету была прикреплена какая-та бумажка.';
                                 }
                             }
 
@@ -3666,7 +3155,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 $ost = ((int)$detrn[$j][1]);
                                 $s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "' . ((int)$detrn[$j][0]) . '" AND `uid` = "' . $this->info['id'] . '" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT ' . ((int)$detrn[$j][1]) . '');
                                 while ($itm = mysql_fetch_array($s4)) {
-                                    //������� �������
+                                    //удаляем предмет
                                     mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                                 }
                                 $j++;
@@ -3676,24 +3165,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             mysql_query('UPDATE `items_shop` SET `kolvo` = "' . ($i['kolvo'] - $x) . '" WHERE `iid` = "' . $i['iid'] . '" LIMIT 1');
                             $zuby_inf = '';
                             if ($zuby == 1) {
-                                $zuby_inf = ' <font color=red><small>(�� ����)</small></font>';
+                                $zuby_inf = ' <font color=red><small>(За зубы)</small></font>';
                             }
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �������� ������� &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] �� <strong>' . $price . '</strong> ��.' . $zuby_inf . '', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: Приобрел предмет &quot;<strong>' . $i['name'] . '</strong>&quot; (x' . $x . ') [#' . $i['iid'] . '] за <strong>' . $price . '</strong> кр.' . $zuby_inf . '', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                         } else {
-                            //���������� � ������ ���� ��� ������� �� �������
-                            $r = '��� �� ������� ���������� &quot;' . $i['name'] . '&quot;. ������������� �������� � &quot;' . $this->city_name[$this->info['city']] . '&quot; ������ ��� ' . $price . ' ��.<br>�������� ���� ��������� �� ����������.';
-                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: �� ������� ���������� ������� #' . $i['iid'] . '. � �������: <strong>' . $price . '</strong> ��.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                            //Записываем в личное дело что предмет не получен
+                            $r = 'Вам не удалось приобрести &quot;' . $i['name'] . '&quot;. Администрация магазина в &quot;' . $this->city_name[$this->info['city']] . '&quot; должна Вам ' . $price . ' кр.<br>Приносим свои извинения за неудобства.';
+                            $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=green>Shop.' . $this->info['city'] . '</font>&quot;: не удалось приобрести предмет #' . $i['iid'] . '. К возрату: <strong>' . $price . '</strong> кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
                             if (!$ld) {
-                                echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
+                                echo '<div>Ошибка, невозможно добавить запись в /db/usersDelo/!</div>';
                             }
                         }
                     } else {
-                        $r = '��� �� ������� ���������� �������...';
+                        $r = 'Вам не удалось приобрести предмет...';
                     }
                 }
             }
         } else {
-            $r = '������� �� ������ �� ��������';
+            $r = 'Предмет не найден на прилавке';
         }
         return '<div align="left">' . $r . '</div>';
     }
@@ -3706,7 +3195,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 				mysql_query('INSERT INTO `aaa_bonus` (`uid`,`time`) VALUES (
 					"'.$this->info['id'].'","'.(time()+1*3600).'"
 				)');
-				$this->error = '��� ��������� 25 ��.';*/
+				$this->error = 'Вам зачислено 25 кр.';*/
         } else {
             if ($_GET['getb1w'] == 3) {
                 $pensia1 = $this->pensia(false);
@@ -3723,7 +3212,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $this->info['money2'] += $pensia2[1];
                     mysql_query('UPDATE `users` SET `money2` = `money2` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                 }
-                $this->error = '��� �������� ����� � ������� ' . $pensia1 . '! ';
+                $this->error = 'Вам начислен бонус в размере ' . $pensia1 . '! ';
                 mysql_query('INSERT INTO `aaa_bonus` (
 						`uid`,`time`,`afk`,`type`,`money`
 					) VALUES (
@@ -3772,7 +3261,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         $price = $i2['1price'];
         if (isset($i2['id']) && isset($iid) && $sid == 1 && $i2['inShop'] == 30) {
             if ($price > $this->info['money'])
-                $r = '� ��� ������������ ����� (�� ������� ' . ($price - $this->info['money']) . ' ��.)';
+                $r = 'У вас недостаточно денег (не хватает ' . ($price - $this->info['money']) . ' кр.)';
             else {
                 $UpdMoney = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string(round($this->info['money'] - $price, 2)) . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                 if ($UpdMoney) {
@@ -3786,31 +3275,31 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     } else {
                         $UpItems = mysql_query('UPDATE `items_users` SET `uid` = ' . $this->info['id'] . ', `1price` = "' . $i1['price1'] . '", `lastUPD` = "' . time() . '", `inShop` = 0 WHERE  `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="' . $i2['uid'] . '" LIMIT 1');
                     }
-                    //��������� ������� �������� �������� ��������� ��������
+                    //Вставляем функцию передачи кредитов владельцу предмета
                     if ($UpItems) {
-                        //���������� � ������ ���� ��� ������� �������
-                        $r = '�� ��������� ������� &quot;' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '&quot; �� ' . $price . ' ��.<br>������� ������� �������� � ���������.';
-                        $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>ComissShop.' . $this->info['city'] . '</font>&quot;: �������� ������� &quot;<strong>' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '</strong>&quot; [item:' . $iid . '] � ������������ �������� �� <strong>' . $price . '</strong> ��. [��������: ' . ($i2['login'] != '' ? '<a href="https://new-combats.com/info/' . $i2['uid'] . '" target="_blank">' . $i2['login'] . '</a>' : '(' . $i2['uid'] . ')') . ']', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', $price, 0);
+                        //Записываем в личное дело что предмет получен
+                        $r = 'Вы приобрели предмет &quot;' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '&quot; за ' . $price . ' кр.<br>Предмет успешно добавлен в инвентарь.';
+                        $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>ComissShop.' . $this->info['city'] . '</font>&quot;: Приобрел предмет &quot;<strong>' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '</strong>&quot; [item:' . $iid . '] в коммисионном магазине за <strong>' . $price . '</strong> кр. [Продавец: ' . ($i2['login'] != '' ? '<a href="https://new-combats.com/info/' . $i2['uid'] . '" target="_blank">' . $i2['login'] . '</a>' : '(' . $i2['uid'] . ')') . ']', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', $price, 0);
                         $u2s = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "' . $i2['uid'] . '" LIMIT 1'));
-                        $ld = $this->addDelo(1, $u2s['id'], '&quot;<font color=#C65F00>ComissShop.' . $this->info['city'] . '</font>&quot;: ������ ������� &quot;<strong>' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '</strong>&quot; [item:' . $iid . '] ����� ������������ �������� �� <strong>' . $price . '</strong> ��. [����������: <a href="https://new-combats.com/info/' . $this->info['id'] . '" target="_blank">' . $this->info['login'] . '</a>]', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', 0, $price);
+                        $ld = $this->addDelo(1, $u2s['id'], '&quot;<font color=#C65F00>ComissShop.' . $this->info['city'] . '</font>&quot;: Продал предмет &quot;<strong>' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '</strong>&quot; [item:' . $iid . '] через коммисионный магазине за <strong>' . $price . '</strong> кр. [Покупатель: <a href="https://new-combats.com/info/' . $this->info['id'] . '" target="_blank">' . $this->info['login'] . '</a>]', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', 0, $price);
                     } else {
-                        //���������� � ������ ���� ��� ������� �� �������
-                        $r = '��� �� ������� ���������� &quot;' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '&quot;. ������������� �������� � &quot;' . $this->city_name[$this->info['city']] . '&quot; ������ ��� ' . $price . ' ���.<br>�������� ���� ��������� �� ����������.';
-                        $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>EkrShop.' . $this->info['city'] . '</font>&quot;: �� ������� ���������� ������� #' . $i1['iid'] . '. � �������: <strong>' . $price . '</strong> ��.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
-                        if (!$ld) echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
+                        //Записываем в личное дело что предмет не получен
+                        $r = 'Вам не удалось приобрести &quot;' . $i1['name'] . ($col > 1 ? ' (x' . $col . ')' : '') . '&quot;. Администрация магазина в &quot;' . $this->city_name[$this->info['city']] . '&quot; должна Вам ' . $price . ' екр.<br>Приносим свои извинения за неудобства.';
+                        $ld = $this->addDelo(1, $this->info['id'], '&quot;<font color=#C65F00>EkrShop.' . $this->info['city'] . '</font>&quot;: не удалось приобрести предмет #' . $i1['iid'] . '. К возрату: <strong>' . $price . '</strong> кр.', time(), $this->info['city'], 'Shop.' . $this->info['city'] . '', (int)$price, 0);
+                        if (!$ld) echo '<div>Ошибка, невозможно добавить запись в /db/usersDelo/!</div>';
                     }
                 } else {
-                    $r = '��� �� ������� ���������� �������...';
+                    $r = 'Вам не удалось приобрести предмет...';
                 }
             }
         } else
-            $r = '������� �� ������ �� ��������';
+            $r = 'Предмет не найден на прилавке';
         return '<div align="left">' . $r . '</div>';
     }
 
     public function commisonRent($action, $iid, $price = null)
     {
-        if ($action == "����� � �������" && isset($iid) && $price > 0) {
+        if ($action == "Сдать в магазин" && isset($iid) && $price > 0) {
             $ChImtem = mysql_fetch_array(mysql_query('SELECT `id`, `item_id`, `data`, `inGroup`, `uid` FROM `items_users` WHERE `id` = ' . $iid . ' LIMIT 1'));
             $ChSudba = $this->lookStats($ChImtem['data']);
             if (isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['sudba'] == 1 || isset($ChSudba['toclan'])) {
@@ -3827,7 +3316,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     mysql_query('UPDATE `items_users` set `inShop` = 30, `1price` = ' . $price . ' where `uid` = "' . $this->info['id'] . '" AND `id` = "' . $iid . '" AND `inOdet` = "0" AND `delete` = "0" ');
                 }
             }
-        } elseif ($action == "�������" && isset($iid)) {
+        } elseif ($action == "Забрать" && isset($iid)) {
             $i = mysql_fetch_array(mysql_query('SELECT `im`.`price1`,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "' . $iid . '" AND `iu`.`inShop` = "30" AND `iu`.`delete` = "0" LIMIT 1'));
             if (isset($i['inGroup']) and $i['inGroup'] > 0) {
                 $col = $this->itemsX($i['id']);
@@ -3891,7 +3380,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 		//
 
 		if( $typeOtdel == 1050 ) {
-			//�������� �������
+			//Просмотр прочего
 			if($preview == "full") {
 
 			}else{
@@ -3922,7 +3411,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 					');
 			}
 		}else{
-			//����� ������ ������ ���������
+			//Вывод общего списка предметов
 			if($preview == "full") {
 
 			}else{
@@ -3941,20 +3430,20 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 			if($preview == "full") {
 
 			}else{
-				//����������� � ��������
+				//Отоюражение в разделах
 				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` ASC LIMIT 1'));
 				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` DESC LIMIT 1'));
 				//
-				$is2 .= '<a target="_blank" href="https://new-combats.com/item/'.$pl['item_id'].'">'.$pl['name'].'</a> &nbsp; (�����: '.$pl['massa'].')';
-				//$is2 .= '<br><strong>����: '.$pvr1[0].'-'.$pvr2[0].' ��.</strong> <small>(����������: 0)</small>';
+				$is2 .= '<a target="_blank" href="https://new-combats.com/item/'.$pl['item_id'].'">'.$pl['name'].'</a> &nbsp; (Масса: '.$pl['massa'].')';
+				//$is2 .= '<br><strong>Цена: '.$pvr1[0].'-'.$pvr2[0].' кр.</strong> <small>(количество: 0)</small>';
 				//
 				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` ASC LIMIT 1'));
 				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` DESC LIMIT 1'));
 				//
-				//$is2 .= '<br>�������������: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).'';
+				//$is2 .= '<br>Долговечность: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).'';
 				//
 				$is1 .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				$is1 .= '<a href="?toRent=3&otdel='.round($_GET['otdel']).'&itemid='.$pl['item_id'].'">���������</a><br>';
+				$is1 .= '<a href="?toRent=3&otdel='.round($_GET['otdel']).'&itemid='.$pl['item_id'].'">подробнее</a><br>';
 			}
 			echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top">'.$is2.'</td></tr>';
 			if( $cr == 'c8c8c8' ) {
@@ -3966,7 +3455,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 		}
 		//
 		if( $i == 0 ) {
-			echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
+			echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">Прилавок магазина пуст</td></tr>';
 		}
 		//
 	 	 //*   * * * * * * * * * *
@@ -4095,7 +3584,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
         $i = 0;
         $steckCikl = 1;
         while ($pl = mysql_fetch_array($cl)) {
-            // ���������� ���������� ��������� � �����
+            // количетсво одинаковых предметов в комке
             if ($preview == "preview") {
                 //$steck = mysql_fetch_array(mysql_query('SELECT COUNT(`item_id`) FROM `items_users` WHERE `item_id` = "'.$pl['item_id'].'" AND `inShop` = 30 LIMIT 1'));
                 $steck = ['--', '--', '--', '--'];
@@ -4117,7 +3606,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     $po = $this->lookStats($pl['data']);
                 }
                 if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) {
-                    //���� ����� +
+                    //Зоны блока +
                     if ($pl['inOdet'] != 14) {
                         $po['zonb']++;
                     }
@@ -4125,11 +3614,11 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                 $is2 = '';
                 $is1 = '<img src="https://img.new-combats.com/i/items/' . $pl['img'] . '"><br>';
                 if ($preview == "full") {
-                    $is1 .= '<a href="?otdel=' . ((int)$_GET['otdel']) . '&toRent=3&itemid=' . (int)$_GET['itemid'] . '&buy=' . $pl[0] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . ' " >������</a> ';
+                    $is1 .= '<a href="?otdel=' . ((int)$_GET['otdel']) . '&toRent=3&itemid=' . (int)$_GET['itemid'] . '&buy=' . $pl[0] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . ' " >купить</a> ';
                 } elseif ($preview == "preview") {
-                    $is1 .= '<a href="?otdel=' . ((int)$_GET['otdel']) . '&toRent=3&itemid=' . $pl['item_id'] . ' " >�����������</a> ';
+                    $is1 .= '<a href="?otdel=' . ((int)$_GET['otdel']) . '&toRent=3&itemid=' . $pl['item_id'] . ' " >Просмотреть</a> ';
                 }
-                //��������
+                //название
 
                 $col = $this->itemsX($pl[0]);
                 if ($col > 1 && $pl['inGroup'] != 0 && $pl['inGroupCount'] > 1) {
@@ -4138,41 +3627,41 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                 }
                 $is2 .= '<a href="https://new-combats.com/item/' . $pl['item_id'] . '" target="_blank">' . $pl['name'] . '</a> &nbsp; &nbsp;';
                 if ($pl['massa'] > 0 && $preview == "full") {
-                    $is2 .= '(�����: ' . round($pl['massa'], 2) . ')';
+                    $is2 .= '(Масса: ' . round($pl['massa'], 2) . ')';
                     if ($pl['gift'] != '') {
                         $ttl = '';
                         if ($pl['gift'] == 1) {
-                            $ttl = '�� �� ������ �������� ���� ������� ����-����';
+                            $ttl = 'Вы не можете передать этот предмет кому-либо';
                         } else {
-                            $ttl = '���� ������� ������� ' . $pl['gift'] . '. �� �� ������� �������� ���� ������� ����-���� ���';
+                            $ttl = 'Этот предмет подарил ' . $pl['gift'] . '. Вы не сможете передать этот предмет кому-либо еще';
                         }
                         $is2 .= ' <img title="' . $ttl . '" src="https://img.new-combats.com/i/podarok.gif">';
                     }
                     if (isset($po['art'])) {
-                        $is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
+                        $is2 .= ' <img title="Артефакт" src="https://img.new-combats.com/i/artefact.gif">';
                     }
                     if (isset($po['sudba'])) {
                         if ($po['sudba'] == '0') {
-                            $is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
+                            $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто наденет его. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/destiny0.gif">';
                         } elseif ($po['sudba'] == '1') {
-                            $is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
+                            $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто возьмет предмет. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/destiny0.gif">';
                         } else {
-                            $is2 .= ' <img title="���� ������� ������ ����� ������� � ' . $po['sudba'] . '. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
+                            $is2 .= ' <img title="Этот предмет связан общей судьбой с ' . $po['sudba'] . '. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/desteny.gif">';
                         }
                     }
                 }
-                //����
-                $is2 .= '<br><strong>����: ';
+                //цена
+                $is2 .= '<br><strong>Цена: ';
                 if ($steck[0] > 1 && $preview == "preview") {
-                    $is2 .= $steck[3] . '-' . $steck[4] . ' ��.</strong> ';
+                    $is2 .= $steck[3] . '-' . $steck[4] . ' кр.</strong> ';
                 } else {
-                    $is2 .= $pl['1price'] . ' ��.</strong> ';
+                    $is2 .= $pl['1price'] . ' кр.</strong> ';
                 }
                 if ($pl['pricerep'] > 0) {
-                    $is2 .= ' <small><strong>(' . round($pl['pricerep'], 2) . ' ��������������)</strong></small>';
+                    $is2 .= ' <small><strong>(' . round($pl['pricerep'], 2) . ' Воинственности)</strong></small>';
                 }
 
-                //�������������
+                //долговечность
                 if ($pl['iznosMAX'] > 0) {
                     $izcol = '';
                     if (floor($pl['iznosNOW']) >= (floor($pl['iznosMAX']) - ceil($pl['iznosMAX']) / 100 * 20)) {
@@ -4180,41 +3669,41 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     }
                 }
                 if ($preview == "preview") {
-                    $is2 .= '<br>�������������: <font color="' . $izcol . '">' . floor($steck[1]) . '/' . ceil($steck[2]) . '</font>';
+                    $is2 .= '<br>Долговечность: <font color="' . $izcol . '">' . floor($steck[1]) . '/' . ceil($steck[2]) . '</font>';
                 } else {
                     if ($pl['iznosMAXi'] == 999999999) {
-                        $is2 .= '<br>�������������: <font color="brown">�����������</font>';
+                        $is2 .= '<br>Долговечность: <font color="brown">неразрушимо</font>';
                     } else {
-                        $is2 .= '<br>�������������: <font color="' . $izcol . '">' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . '</font>';
+                        $is2 .= '<br>Долговечность: <font color="' . $izcol . '">' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . '</font>';
                     }
                 }
-                //���� �������� ��������
+                //Срок годности предмета
 
                 if ($po['srok'] > 0) {
                     $pl['srok'] = $po['srok'];
                 }
                 if ($pl['srok'] > 0 and $preview != "preview") {
                     if ($pl['time_create'] + $pl['srok'] < time()) {
-                        $is2 .= '<br>���� ��������: ' . $this->timeOut($pl['srok']) . ' (��������)';
+                        $is2 .= '<br>Срок годности: ' . $this->timeOut($pl['srok']) . ' (испорчен)';
                     } else {
-                        $is2 .= '<br>���� ��������: ' . $this->timeOut($pl['srok']) . ' (�� ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')';
+                        $is2 .= '<br>Срок годности: ' . $this->timeOut($pl['srok']) . ' (до ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')';
                     }
                 } elseif ($pl['srok'] > 0) {
-                    $is2 .= '<br>���� ��������: ' . $this->timeOut($pl['srok']);
+                    $is2 .= '<br>Срок годности: ' . $this->timeOut($pl['srok']);
                 }
                 if ($pl['magic_chance'] > 0) {
-                    $is2 .= '<br>����������� ������������: ' . min([$pl['magic_chance'], 100]) . '%';
+                    $is2 .= '<br>Вероятность срабатывания: ' . min([$pl['magic_chance'], 100]) . '%';
                 }
 
-                //����������������� �������� �����:
+                //Продолжительность действия магии:
                 if ((int)$pl['magic_inci'] > 0) {
                     $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "' . ((int)$pl['magic_inci']) . '" LIMIT 1'));
                     if (isset($efi['id2']) && $efi['actionTime'] > 0) {
-                        $is2 .= '<br>����������������� ��������: ' . $this->timeOut($efi['actionTime']);
+                        $is2 .= '<br>Продолжительность действия: ' . $this->timeOut($efi['actionTime']);
                     }
                 }
                 if ($preview == "full" || $preview == "preview") {
-                    //<strong>��������� �����������:</strong>
+                    //<strong>Требуется минимальное:</strong>
                     $tr = '';
                     $t = $this->items['tr'];
                     $x = 0;
@@ -4234,7 +3723,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                                     $notr++;
                                 }
                             }
-                            $tr .= '<br>� ';
+                            $tr .= '<br>• ';
                             if ($n == 'rep') {
                                 $temp = explode('::', $po['tr_' . $n]);
                                 $tr .= $this->is[$n] . ' ' . ucfirst(str_replace('city', ' city', $temp[1])) . ': ' . $temp[0];
@@ -4242,9 +3731,9 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             } elseif ($n != 'align') {
                                 if ($n == 'sex') {
                                     if ($po['tr_' . $n] == 1) {
-                                        $tr .= $this->is[$n] . ': �������';
+                                        $tr .= $this->is[$n] . ': Женский';
                                     } else {
-                                        $tr .= $this->is[$n] . ': �������';
+                                        $tr .= $this->is[$n] . ': Мужской';
                                     }
                                 } else {
                                     $tr .= $this->is[$n] . ': ' . $po['tr_' . $n];
@@ -4262,9 +3751,9 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     }
 
                     if ($tr != '') {
-                        $is2 .= '<br><strong>��������� �����������:</strong>' . $tr;
+                        $is2 .= '<br><strong>Требуется минимальное:</strong>' . $tr;
                     }
-                    //<strong>��������� ��:</strong>
+                    //<strong>Действует на:</strong>
                     $tr = '';
                     $t = $this->items['add'];
                     $x = 0;
@@ -4275,13 +3764,13 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             if ($po['add_' . $n] < 0) {
                                 $z = '';
                             }
-                            $tr .= '<br>� ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n];
+                            $tr .= '<br>• ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n];
                         }
                         $x++;
                     }
-                    //��������� �� (�����)
+                    //действует на (броня)
                     $i = 1;
-                    $bn = [1 => '������', 2 => '�������', 3 => '�����', 4 => '���'];
+                    $bn = [1 => 'головы', 2 => 'корпуса', 3 => 'пояса', 4 => 'ног'];
                     while ($i <= 4) {
                         if (isset($po['add_mab' . $i])) {
                             if ($po['add_mab' . $i] == $po['add_mib' . $i] && $pl['geniration'] == 1) {
@@ -4289,21 +3778,21 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                                 if ($po['add_mab' . $i] < 0) {
                                     $z = '';
                                 }
-                                $tr .= '<br>� ����� ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i];
+                                $tr .= '<br>• Броня ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i];
                             } else {
-                                $tr .= '<br>� ����� ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i] . ' (' . $this->bronFx([$po['add_mib' . $i], $po['add_mab' . $i]]) . ')';
+                                $tr .= '<br>• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i] . ' (' . $this->bronFx([$po['add_mib' . $i], $po['add_mab' . $i]]) . ')';
                             }
                         }
                         $i++;
                     }
                     if ($tr != '') {
-                        $is2 .= '<br><strong>��������� ��:</strong>' . $tr;
+                        $is2 .= '<br><strong>Действует на:</strong>' . $tr;
                     }
-                    //<strong>�������� ��������:</strong>
+                    //<strong>Свойства предмета:</strong>
                     $tr = '';
                     $t = $this->items['sv'];
                     if (isset($po['sv_yron_min'], $po['sv_yron_max'])) {
-                        $tr .= '<br>� ����: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max'];
+                        $tr .= '<br>• Урон: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max'];
                     }
                     $x = 0;
                     while ($x < count($t)) {
@@ -4313,18 +3802,18 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             if ($po['sv_' . $n] < 0) {
                                 $z = '';
                             }
-                            $tr .= '<br>� ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n];
+                            $tr .= '<br>• ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n];
                         }
                         $x++;
                     }
                     if ($pl['2too'] == 1) {
-                        $tr .= '<br>� ������ ������';
+                        $tr .= '<br>• Второе оружие';
                     }
                     if ($pl['2h'] == 1) {
-                        $tr .= '<br>� ��������� ������';
+                        $tr .= '<br>• Двуручное оружие';
                     }
                     if (isset($po['zonb'])) {
-                        $tr .= '<br>� ���� ������������: ';
+                        $tr .= '<br>• Зоны блокирования: ';
                         if ($po['zonb'] > 0) {
                             $x = 1;
                             while ($x <= $po['zonb']) {
@@ -4332,72 +3821,72 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                                 $x++;
                             }
                         } else {
-                            $tr .= '�';
+                            $tr .= '—';
                         }
                     }
 
                     if ($tr != '') {
-                        $is2 .= '<br><strong>�������� ��������:</strong>' . $tr;
+                        $is2 .= '<br><strong>Свойства предмета:</strong>' . $tr;
                     }
 
-                    //�����������
+                    //Особенности
                     /*
 					$tr = '';
 					$x = 1;
 					while($x<=4){
 						if($po['tya'.$x]>0){
-							$tyc = '�������� �����';
+							$tyc = 'Ничтожно редки';
 							if($po['tya'.$x]>6){
-								$tyc = '�����';
+								$tyc = 'Редки';
 							}
 							if($po['tya'.$x]>14){
-								$tyc = '����';
+								$tyc = 'Малы';
 							}
 							if($po['tya'.$x]>34){
-								$tyc = '���������';
+								$tyc = 'Временами';
 							}
 							if($po['tya'.$x]>79){
-								$tyc = '���������';
+								$tyc = 'Регулярны';
 							}
 							if($po['tya'.$x]>89){
-								$tyc = '�����';
+								$tyc = 'Часты';
 							}
 							if($po['tya'.$x]>=100){
-								$tyc = '������';
+								$tyc = 'Всегда';
 							}
-							$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
+							$tr .= '<br>• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
 						}
 						$x++;
 					}
 					$x = 1;
 					while($x<=7){
 						if($po['tym'.$x]>0){
-							$tyc = '�������� �����';
+							$tyc = 'Ничтожно редки';
 							if($po['tym'.$x]>6){
-								$tyc = '�����';
+								$tyc = 'Редки';
 							}
 							if($po['tym'.$x]>14){
-								$tyc = '����';
+								$tyc = 'Малы';
 							}
 							if($po['tym'.$x]>34){
-								$tyc = '���������';
+								$tyc = 'Временами';
 							}
 							if($po['tym'.$x]>79){
-								$tyc = '���������';
+								$tyc = 'Регулярны';
 							}
 							if($po['tym'.$x]>89){
-								$tyc = '�����';
+								$tyc = 'Часты';
 							}
 							if($po['tym'.$x]>=100){
-								$tyc = '������';
+								$tyc = 'Всегда';
 							}
-							$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
+							$tr .= '<br>• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
 						}
 						$x++;
 					}
 
 					if($tr!=''){
-						$is2 .= '<br><strong>�����������:</strong>'.$tr;
+						$is2 .= '<br><strong>Особенности:</strong>'.$tr;
 					}
 					*/
 
@@ -4415,12 +3904,12 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         } else {
                             $rnc = '#282828';
                         }
-                        $po['imposed_name'] = str_replace('���� ', '', $po['imposed_name']);
-                        $tr .= '<br>&bull; <font color=' . $rnc . '>�������� ��������:</font> ' . $po['imposed_name'] . ' ';
+                        $po['imposed_name'] = str_replace('Чары ', '', $po['imposed_name']);
+                        $tr .= '<br>&bull; <font color=' . $rnc . '>Наложены заклятия:</font> ' . $po['imposed_name'] . ' ';
                         unset($rnc);
                     }
                     if ($tr != '') {
-                        $is2 .= '<br><strong>��������� ��������:</strong>';
+                        $is2 .= '<br><strong>Улучшения предмета:</strong>';
                         $is2 .= $tr;
                     }
 
@@ -4431,24 +3920,24 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         }
                     }
                     if (isset($po['free_stats']) && $po['free_stats'] > 0) {
-                        $is2 .= '<br><strong>������������� ������:</strong>';
-                        $is2 .= '&bull; ��������� �������������: ' . $po['free_stats'] . '';
+                        $is2 .= '<br><strong>Распределение статов:</strong>';
+                        $is2 .= '&bull; Возможных распределений: ' . $po['free_stats'] . '';
                     }
                     if (floor($pl['iznosNOW']) >= ceil($pl['iznosMAX'])) {
                         $d[0] = 0;
                         $d[2] = 0;
                     }
                     if (isset($po['complect']) || isset($po['complect2'])) {
-                        $is2 .= '<br><i>�������������� ����������:</i>';
+                        $is2 .= '<br><i>Дополнительная информация:</i>';
                     }
                     if (isset($po['complect'])) {
-                        //�� ������������
-                        $com1 = ['name' => '����������� ��������', 'x' => 0, 'text' => ''];
+                        //не отображается
+                        $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => ''];
                         $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect'] . '" ORDER BY `x` ASC LIMIT 20');
                         while ($plc = mysql_fetch_array($spc)) {
                             $com1['name'] = $plc['name'];
                             $com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">' . $plc['x'] . '</font>: ';
-                            //�������� ���������
+                            //действие комплекта
                             $i1c = 0;
                             $i2c = 0;
                             $i1e = $this->lookStats($plc['data']);
@@ -4471,18 +3960,18 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             unset($i1c, $i2c, $i3c);
                             $com1['x']++;
                         }
-                        $is2 .= '<br>&bull; ����� ���������: <strong>' . $com1['name'] . '</strong><br><small>';
+                        $is2 .= '<br>&bull; Часть комплекта: <strong>' . $com1['name'] . '</strong><br><small>';
                         $is2 .= $com1['text'];
                         $is2 .= '</small>';
                     }
                     if (isset($po['complect2'])) {
-                        //�� ������������
-                        $com1 = ['name' => '����������� ��������', 'x' => 0, 'text' => ''];
+                        //не отображается
+                        $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => ''];
                         $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect2'] . '" ORDER BY `x` ASC LIMIT 20');
                         while ($plc = mysql_fetch_array($spc)) {
                             $com1['name'] = $plc['name'];
                             $com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">' . $plc['x'] . '</font>: ';
-                            //�������� ���������
+                            //действие комплекта
                             $i1c = 0;
                             $i2c = 0;
                             $i1e = $this->lookStats($plc['data']);
@@ -4505,78 +3994,78 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             unset($i1c, $i2c, $i3c);
                             $com1['x']++;
                         }
-                        $is2 .= '<br>&bull; ����� ��������� (��������): <strong>' . $com1['name'] . '</strong><br><small>';
+                        $is2 .= '<br>&bull; Часть комплекта (подгонка): <strong>' . $com1['name'] . '</strong><br><small>';
                         $is2 .= $com1['text'];
                         $is2 .= '</small>';
                     }
 
                     $is2 .= '<small style="">';
                     if (isset($po['gravi'])) {
-                        $is2 .= '<br>�� ����������� ������������� �������: <strong>' . $po['gravi'] . '</strong>';
+                        $is2 .= '<br>На поверхности выгравирована надпись: <strong>' . $po['gravi'] . '</strong>';
                     }
                     if ($pl['info'] != '') {
-                        $is2 .= '<div><strong>������������:</strong></div><div>' . $pl['info'] . '</div>';
+                        $is2 .= '<div><strong>Рекомендации:</strong></div><div>' . $pl['info'] . '</div>';
                     }
                     if ($po['info'] != '') {
                         $is2 .= '<div>' . $po['info'] . '</div>';
                     }
                     if ($pl['max_text'] - $pl['use_text'] > 0) {
-                        $is2 .= '<div>���������� ��������: ' . ($pl['max_text'] - $pl['use_text']) . '</div>';
+                        $is2 .= '<div>Количество символов: ' . ($pl['max_text'] - $pl['use_text']) . '</div>';
                     }
                     if ($pl['maidin'] != '') {
-                        //	$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
+                        //	$is2 .= '<div>Сделано в '.$this->city_name[$pl['maidin']].'</div>';
                     }
                     if (isset($po['noremont'])) {
-                        $is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет не подлежит ремонту</div>';
                     }
                     if (isset($po['nosale'])) {
-                        $is2 .= '<div style="color:brown;">������� ������ �������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет нельзя продать</div>';
                     }
                     if (isset($po['nomodif'])) {
-                        $is2 .= '<div style="color:brown;">������� ������ ��������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет нельзя улучшать</div>';
                     }
                     if (isset($po['nodelete'])) {
-                        $is2 .= '<div style="color:brown;">������� ������ ���������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет нельзя выбросить</div>';
                     }
                     if (isset($po['frompisher']) && $po['frompisher'] > 0) {
-                        $is2 .= '<div style="color:brown;">������� �� ����������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет из подземелья</div>';
                     }
                     if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) {
-                        $is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
+                        $is2 .= '<div style="color:brown;">Предмет не портится во время сна</div>';
                     }
                     if (isset($po['fromlaba']) && $po['fromlaba'] > 0) {
-                        $is2 .= '<div style="color:brown;">������� �� ���������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет из лабиринта</div>';
                     }
                     if (isset($po['vip_sale']) && $po['vip_sale'] > 0) {
-                        $is2 .= '<div style="color:brown;">������� ������ �� 10% �� ���������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет куплен за 10% от стоимости</div>';
                     }
                     if ($pl['dn_delete'] > 0) {
-                        $is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
+                        $is2 .= '<div style="color:brown;">Предмет будет удален при выходе из подземелья</div>';
                     }
                     if ($this->pokol > $pl['geni']) {
-                        $is2 .= '<div style="color:brown">������� �������</div>';
+                        $is2 .= '<div style="color:brown">Предмет устарел</div>';
                     }
                     if (isset($po['zazuby']) && $po['zazuby'] > 0) {
-                        $is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
+                        $is2 .= '<div style="color:brown;">Предмет куплен за зубы</div>';
                     }
-                    //$is2 .= '<div>������� � '.$this->city_name[$this->info['city']].'</div>';
+                    //$is2 .= '<div>Сделано в '.$this->city_name[$this->info['city']].'</div>';
                     $is2 .= '</small>';
                 }
                 if ($preview == "preview") {
-                    $kolvoprint = "<small style=\"float:right; color:grey;\" align=\"right\">����������: <strong>$steck[0]</strong> ��.</small>";
+                    $kolvoprint = "<small style=\"float:right; color:grey;\" align=\"right\">Количество: <strong>$steck[0]</strong> шт.</small>";
                 }
                 echo '<tr style="background-color:#' . $cr . ';"><td width="100" style="padding:7px;" valign="middle" align="center">' . $is1 . '</td><td style="padding:7px;" valign="top">' . $kolvoprint . $is2 . '</td></tr>';
                 $i++;
             }
         }
-        if ($i == 0) echo '<tr style="background-color:#' . $cr . ';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
+        if ($i == 0) echo '<tr style="background-color:#' . $cr . ';"><td style="padding:7px;" align="center" valign="top">Прилавок магазина пуст</td></tr>';
     }
 
     public $sid_zuby = [
-        //�������
-        1 => 1, //���
-        9 => 1, //�������
-        8 => 1 //���
+        //Кэпитал
+        1 => 1, //гос
+        9 => 1, //таверна
+        8 => 1 //зоо
     ];
 
     public function shopItems($sid, $plu = '')
@@ -4668,7 +4157,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 				}*/
 
                 if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) {
-                    //���� ����� +
+                    //Зоны блока +
                     $po['zonb']++;
                 }
 
@@ -4679,28 +4168,28 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     $is1 = '<img src="https://img.new-combats.com/i/items/' . $pl['img'] . '"><br>';
                 }
                 if ($sid == 609) {
-                    $is1 .= '<span id="shopPlus' . $pl['id'] . '"></span><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'??\',\' ??.\');">������</a>';
+                    $is1 .= '<span id="shopPlus' . $pl['id'] . '"></span><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'??\',\' ??.\');">купить</a>';
                 } else {
                     //if($this->info['money']>$pl['price'])
                     //{
                     if ($sid == 2 || $sid == 777) {
-                        $is1 .= '<span id="shopPlus' . $pl['id'] . '"></span><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_2'] . '\',\' ���.\');">������</a> <a href="javascript:void(0);" onClick="top.payPlus(' . $pl['id'] . ');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="������ ��������� ���������"></a>';
+                        $is1 .= '<span id="shopPlus' . $pl['id'] . '"></span><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_2'] . '\',\' екр.\');">купить</a> <a href="javascript:void(0);" onClick="top.payPlus(' . $pl['id'] . ');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="Купить несколько предметов"></a>';
                     } else {
-                        $is1 .= '<span id="shopPlus' . $pl['id'] . '"></span><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_1'] . '\',\' ��.\');">������</a> <a href="javascript:void(0);" onClick="top.payPlus(' . $pl['id'] . ');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="������ ��������� ���������"></a>';
+                        $is1 .= '<span id="shopPlus' . $pl['id'] . '"></span><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_1'] . '\',\' кр.\');">купить</a> <a href="javascript:void(0);" onClick="top.payPlus(' . $pl['id'] . ');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="Купить несколько предметов"></a>';
                     }
                     //}
                     if ($sid == 777 && $this->stats['silver'] > 1) {
-                        //$is1 .= '<br><a onClick="if(confirm(\'��������� VIP-�������?\')){ location.href = \'main.php?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy_vip='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'; }" href="javascript:void('.$pl['id'].');">VIP ������� ('.round($pl['price_2']/20,2).' ���.)</a> ';
+                        //$is1 .= '<br><a onClick="if(confirm(\'Совершить VIP-покупку?\')){ location.href = \'main.php?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy_vip='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'; }" href="javascript:void('.$pl['id'].');">VIP покупка ('.round($pl['price_2']/20,2).' екр.)</a> ';
                     }
                     if ($pl['nozuby'] == 0) {
                         if ($this->info['level'] > 0 && $this->info['level'] < 8) {
                             if ($pl['level'] < 8 && $sid_zuby == 1 && $pl['nozuby'] == 0 && $c['zuby'] == true) {
-                                $is1 .= '<br><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&zuby=1&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_1'] . '\',\' (����)\');">������ �� ����</a>';
+                                $is1 .= '<br><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&zuby=1&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_1'] . '\',\' (Зубы)\');">купить за зубы</a>';
                                 /*if( $this->info['admin'] > 0 ) {
 									if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
 										mysql_query('UPDATE `items_shop` SET `nozuby` = 1 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
 									}
-									$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">��������� ������� �� ����</a>)</small>';
+									$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">Запретить продажу за зубы</a>)</small>';
 								}*/
                             }
                         }
@@ -4708,31 +4197,31 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 						if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
 							mysql_query('UPDATE `items_shop` SET `nozuby` = 0 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
 						}
-						$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">��������� ������� �� ����</a>)</small>';
+						$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">Разрешить продажу за зубы</a>)</small>';
 					}*/
                 }
                 /*
 				if($this->info['admin'] > 0) {
-					$is1 .= '<br><br><small>�������� ��� ��������: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_class=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">����</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">����</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">���������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">���</a></small>';
+					$is1 .= '<br><br><small>Выберите тип предмета: <br>'.
+					'  <a href="?otdel='.$_GET['otdel'].'&add_class=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Отсутствует</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_class=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Танк</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_class=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Уворот</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_class=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Крит</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_class=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Силовик</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_class=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Универсал</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_class=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Маг</a></small>';
 				}
 
 				if($this->info['admin'] > 0) {
-					$is1 .= '<br><small>�������� ��� �������������: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_aclass=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ��������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ���������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� �����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� �����</a></small>';
-					//������� �������������
+					$is1 .= '<br><small>Выберите тип доминирования: <br>'.
+					'  <a href="?otdel='.$_GET['otdel'].'&add_aclass=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Отсутствует</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Танком</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Уворотом</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Критом</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Силовиком</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Универсалом</a>'.
+					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Магом</a></small>';
+					//уровень доминирования
 
 				}
 
@@ -4747,19 +4236,19 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 					}
 
 					if($pl['class'] > 0) {
-						$clnm = array('�����������','����','������','����','�������','���������','���');
-						$is1 .= '<br><br><small>������� ��� '.$clnm[$pl['class']].'�</small>';
+						$clnm = array('Отсутствует','Танк','Уворот','Крит','Силовик','Универсал','Маг');
+						$is1 .= '<br><br><small>Предмет для '.$clnm[$pl['class']].'а</small>';
 						unset($clnm);
 					}
 
 					if($pl['anti_class'] > 0) {
-						$clnm = array('�����������','����','������','����','�������','���������','���');
-						$is1 .= '<br><small>���������� ��� '.$clnm[$pl['anti_class']].'��</small>';
+						$clnm = array('Отсутствует','Танк','Уворот','Крит','Силовик','Универсал','Маг');
+						$is1 .= '<br><small>Доминирует над '.$clnm[$pl['anti_class']].'ом</small>';
 						unset($clnm);
 					}
 				}
 				*/
-                //��������
+                //название
 
                 if (isset($po['tr_align']) && !isset($po['tr_align_bs'])) {
                     $pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align' . $po['tr_align'] . '.gif >';
@@ -4775,7 +4264,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     //$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
                 }
                 if (isset($po['renameadd']) && $po['renameadd'] != '') {
-                    $pl['name'] .= ' (�������: ' . $po['renameadd'] . ')';
+                    $pl['name'] .= ' (Предмет: ' . $po['renameadd'] . ')';
                 }
                 if (isset($po['icos'])) {
                     $pl['name'] = '<span class="icos_' . $po['icos'] . '">' . $pl['name'] . ' <span><small>&nbsp;' . $po['icos'] . '&nbsp;</small></span></span>';
@@ -4784,28 +4273,28 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 
 
                 if ($pl['massa'] > 0) {
-                    $is2 .= '(�����: ' . round($pl['massa'], 2) . ')';
+                    $is2 .= '(Масса: ' . round($pl['massa'], 2) . ')';
                 }
 
                 if (isset($po['art'])) {
-                    $is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
+                    $is2 .= ' <img title="Артефакт" src="https://img.new-combats.com/i/artefact.gif">';
                 }
 
                 if (isset($po['sudba'])) {
                     if ($po['sudba'] == '0') {
-                        $is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
+                        $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто наденет его. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/destiny0.gif">';
                     } elseif ($po['sudba'] == '1') {
-                        $is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
+                        $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто возьмет предмет. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/destiny0.gif">';
                     } else {
-                        $is2 .= ' <img title="���� ������� ������ ����� ������� � ' . $po['sudba'] . '. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
+                        $is2 .= ' <img title="Этот предмет связан общей судьбой с ' . $po['sudba'] . '. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/desteny.gif">';
                     }
                 }
 
-                //����
+                //цена
                 if ($this->info['admin'] > 0) {
                     $is2 .= '<div style="float:right"> <a href="?otdel=' . round($_GET['otdel']) . '&itmid=' . $pl['id'] . '&itmup=1&rnd=' . microtime() . '#itmdown' . $pl['id'] . '">&uarr;</a> &nbsp; ' . $pl['pos'] . ' &nbsp; <a name="itmdown' . $pl['id'] . '" id="itmdown' . $pl['id'] . '" href="?rand=' . microtime() . '&otdel=' . round($_GET['otdel']) . '&itmid=' . $pl['id'] . '&itmdown=1#itmdown' . $pl['id'] . '">&darr;</a></div>';
                 }
-                $is2 .= '<br><strong>����: ';
+                $is2 .= '<br><strong>Цена: ';
                 if ($this->stats['silver'] >= 1 && $sid == 1) {
                     $is2 .= '<strike>';
                 } elseif ($this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777)) {
@@ -4818,7 +4307,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         $is2 .= '<font color="green">' . round($pl['price_4']) . '</font>';
                     }
 
-                    $is2 .= '</strong> <strong></strong> �������������� ';
+                    $is2 .= '</strong> <strong></strong> Воинственности ';
                 } elseif ($pl['price_3'] > 0) {
                     if ($pl['price_3'] > $this->info['money3']) {
                         $is2 .= '<font color="red">' . $pl['price_3'] . '</font>';
@@ -4833,14 +4322,14 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     } else {
                         $is2 .= $pl['price_2'];
                     }
-                    $is2 .= ' ���.</strong></span> ';
+                    $is2 .= ' екр.</strong></span> ';
                 } else {
                     if ($pl['price_1'] > $this->info['money']) {
                         $is2 .= '<font color="red">' . $pl['price_1'] . '</font>';
                     } else {
                         $is2 .= $pl['price_1'];
                     }
-                    $is2 .= ' ��.</strong> ';
+                    $is2 .= ' кр.</strong> ';
                 }
                 if ($this->stats['silver'] >= 1 && $sid == 1) {
                     $is2 .= '</strike> &nbsp; <strong>';
@@ -4849,7 +4338,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     } else {
                         $is2 .= round($pl['price_1'] * 0.95, 2);
                     }
-                    $is2 .= ' ��.</strong> <sup><small style=color:blue; >������ -5%</small></sup>';
+                    $is2 .= ' кр.</strong> <sup><small style=color:blue; >Скидка -5%</small></sup>';
                 } elseif ($this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777)) {
                     $is2 .= '</strike> &nbsp; <strong>';
                     if ($pl['price_2'] > $this->info['money2']) {
@@ -4857,15 +4346,15 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     } else {
                         $is2 .= round($pl['price_2'] * 0.95, 2);
                     }
-                    $is2 .= ' ���.</strong> <sup><small style=color:blue; >������ -5%</small></sup>';
+                    $is2 .= ' екр.</strong> <sup><small style=color:blue; >Скидка -5%</small></sup>';
                 }
 
                 if ($pl['pricerep'] > 0) {
-                    $is2 .= ' <small><strong>(' . round($pl['pricerep'], 2) . ' ��������������)</strong></small>';
+                    $is2 .= ' <small><strong>(' . round($pl['pricerep'], 2) . ' Воинственности)</strong></small>';
                 }
 
                 if ($pl['kolvo'] < 100000) {
-                    $is2 .= ' &nbsp; &nbsp; <small>(����������: <strong>' . $pl['kolvo'] . '</strong>)</small>';
+                    $is2 .= ' &nbsp; &nbsp; <small>(количество: <strong>' . $pl['kolvo'] . '</strong>)</small>';
                 }
 
                 if ($pl['nozuby'] == 0 && $sid != 609 && $c['zuby'] == true) {
@@ -4909,7 +4398,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     }
 
                     if ($ttmm != '') {
-                        $ttmm = '<br>������� �������: ' . rtrim($ttmm, ', ') . ' ';
+                        $ttmm = '<br>Требует предмет: ' . rtrim($ttmm, ', ') . ' ';
                         if ($trn == 0) {
                             $ttmm = '<font color="red">' . $ttmm . '</font>';
                         }
@@ -4920,44 +4409,44 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                 unset($ttmm);
 
 
-                //�������������
+                //долговечность
                 if ($pl['iznos'] > 0) {
                     $pl['iznosMAXi'] = $pl['iznos'];
                 }
                 if ($pl['iznosMAXi'] > 0) {
                     if ($pl['iznosMAXi'] == 999999999) {
-                        $is2 .= '�������������: <font color=brown>�����������</font > <br>';
+                        $is2 .= 'Долговечность: <font color=brown>неразрушимо</font > <br>';
                     } else {
-                        $is2 .= '�������������: 0/' . $pl['iznosMAXi'] . '<br>';
+                        $is2 .= 'Долговечность: 0/' . $pl['iznosMAXi'] . '<br>';
                     }
                 }
 
                 if ($po['battleUseZd'] > 0) {
-                    $is2 .= '�������� �������������: ' . $this->timeOut($po['battleUseZd']) . '<br>';
+                    $is2 .= 'Задержка использования: ' . $this->timeOut($po['battleUseZd']) . '<br>';
                 }
 
                 $is2 = rtrim($is2, '<br>');
 
-                //���� �������� ��������
+                //Срок годности предмета
                 if ($po['srok'] > 0) {
                     $pl['srok'] = $po['srok'];
                 }
                 if ($pl['srok'] > 0) {
-                    $is2 .= '<br>���� ��������: ' . $this->timeOut($pl['srok']);
+                    $is2 .= '<br>Срок годности: ' . $this->timeOut($pl['srok']);
                 }
                 if ($pl['magic_chance'] > 0) {
-                    $is2 .= '<br>����������� ������������: ' . min([$pl['magic_chance'], 100]) . '%';
+                    $is2 .= '<br>Вероятность срабатывания: ' . min([$pl['magic_chance'], 100]) . '%';
                 }
 
-                //����������������� �������� �����:
+                //Продолжительность действия магии:
                 if ((int)$pl['magic_inci'] > 0) {
                     $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "' . ((int)$pl['magic_inci']) . '" LIMIT 1'));
                     if (isset($efi['id2']) && $efi['actionTime'] > 0) {
-                        $is2 .= '<br>����������������� ��������: ' . $this->timeOut($efi['actionTime']);
+                        $is2 .= '<br>Продолжительность действия: ' . $this->timeOut($efi['actionTime']);
                     }
                 }
 
-                //<strong>��������� �����������:</strong>
+                //<strong>Требуется минимальное:</strong>
                 $tr = '';
                 $t = $this->items['tr'];
                 $x = 0;
@@ -4977,7 +4466,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                                 $notr++;
                             }
                         }
-                        $tr .= '<br>� ';
+                        $tr .= '<br>• ';
                         if ($n == 'rep') {
                             $temp = explode('::', $po['tr_' . $n]);
                             $tr .= $this->is[$n] . ' ' . ucfirst(str_replace('city', ' city', $temp[1])) . ': ' . $temp[0];
@@ -4985,9 +4474,9 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         } elseif ($n != 'align') {
                             if ($n == 'sex') {
                                 if ($po['tr_' . $n] == 1) {
-                                    $tr .= $this->is[$n] . ': �������';
+                                    $tr .= $this->is[$n] . ': Женский';
                                 } else {
-                                    $tr .= $this->is[$n] . ': �������';
+                                    $tr .= $this->is[$n] . ': Мужской';
                                 }
                             } else {
                                 $tr .= $this->is[$n] . ': ' . $po['tr_' . $n];
@@ -5005,9 +4494,9 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                 }
                 if ($tr != '') {
 
-                    $is2 .= '<br><strong>��������� �����������:</strong>' . $tr;
+                    $is2 .= '<br><strong>Требуется минимальное:</strong>' . $tr;
                 }
-                //<strong>��������� ��:</strong>
+                //<strong>Действует на:</strong>
                 $tr = '';
                 $t = $this->items['add'];
                 $x = 0;
@@ -5018,13 +4507,13 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         if ($po['add_' . $n] < 0) {
                             $z = '';
                         }
-                        $tr .= '<br>� ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n];
+                        $tr .= '<br>• ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n];
                     }
                     $x++;
                 }
-                //��������� �� (�����)
+                //действует на (броня)
                 $i = 1;
-                $bn = [1 => '������', 2 => '�������', 3 => '�����', 4 => '���'];
+                $bn = [1 => 'головы', 2 => 'корпуса', 3 => 'пояса', 4 => 'ног'];
                 while ($i <= 4) {
                     if (isset($po['add_mab' . $i])) {
                         if ($po['add_mab' . $i] == $po['add_mib' . $i] && $pl['geniration'] == 1) {
@@ -5032,22 +4521,22 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             if ($po['add_mab' . $i] < 0) {
                                 $z = '';
                             }
-                            $tr .= '<br>� ����� ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i];
+                            $tr .= '<br>• Броня ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i];
                         } else {
-                            $tr .= '<br>� ����� ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i];
+                            $tr .= '<br>• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i];
                         }
                     }
                     $i++;
                 }
 
                 if ($tr != '') {
-                    $is2 .= '<br><strong>��������� ��:</strong>' . $tr;
+                    $is2 .= '<br><strong>Действует на:</strong>' . $tr;
                 }
-                //<strong>�������� ��������:</strong>
+                //<strong>Свойства предмета:</strong>
                 $tr = '';
                 $t = $this->items['sv'];
                 if (isset($po['sv_yron_min'], $po['sv_yron_max'])) {
-                    $tr .= '<br>� ����: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max'];
+                    $tr .= '<br>• Урон: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max'];
                 }
                 $x = 0;
                 while ($x < count($t)) {
@@ -5057,18 +4546,18 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         if ($po['sv_' . $n] < 0) {
                             $z = '';
                         }
-                        $tr .= '<br>� ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n];
+                        $tr .= '<br>• ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n];
                     }
                     $x++;
                 }
                 if ($pl['2too'] == 1) {
-                    $tr .= '<br>� ������ ������';
+                    $tr .= '<br>• Второе оружие';
                 }
                 if ($pl['2h'] == 1) {
-                    $tr .= '<br>� ��������� ������';
+                    $tr .= '<br>• Двуручное оружие';
                 }
                 if (isset($po['zonb'])) {
-                    $tr .= '<br>� ���� ������������: ';
+                    $tr .= '<br>• Зоны блокирования: ';
                     if ($po['zonb'] > 0) {
                         $x = 1;
                         while ($x <= $po['zonb']) {
@@ -5076,46 +4565,46 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             $x++;
                         }
                     } else {
-                        $tr .= '�';
+                        $tr .= '—';
                     }
                 }
                 if ($tr != '') {
-                    $is2 .= '<br><strong>�������� ��������:</strong>' . $tr;
+                    $is2 .= '<br><strong>Свойства предмета:</strong>' . $tr;
                 }
 
-                //�����������
+                //Особенности
                 /*$tr = '';
 				$x = 1;
 				while($x<=4)
 				{
 					if($po['tya'.$x]>0)
 					{
-						$tyc = '�������� �����';
+						$tyc = 'Ничтожно редки';
 						if($po['tya'.$x]>6)
 						{
-							$tyc = '�����';
+							$tyc = 'Редки';
 						}
 						if($po['tya'.$x]>14)
 						{
-							$tyc = '����';
+							$tyc = 'Малы';
 						}
 						if($po['tya'.$x]>34)
 						{
-							$tyc = '���������';
+							$tyc = 'Временами';
 						}
 						if($po['tya'.$x]>79)
 						{
-							$tyc = '���������';
+							$tyc = 'Регулярны';
 						}
 						if($po['tya'.$x]>89)
 						{
-							$tyc = '�����';
+							$tyc = 'Часты';
 						}
 						if($po['tya'.$x]>=100)
 						{
-							$tyc = '������';
+							$tyc = 'Всегда';
 						}
-						$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
+						$tr .= '<br>• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
 					}
 					$x++;
 				}
@@ -5124,38 +4613,38 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 				{
 					if(@$po['tym'.$x]>0)
 					{
-						$tyc = '�������� �����';
+						$tyc = 'Ничтожно редки';
 						if($po['tym'.$x]>6)
 						{
-							$tyc = '�����';
+							$tyc = 'Редки';
 						}
 						if($po['tym'.$x]>14)
 						{
-							$tyc = '����';
+							$tyc = 'Малы';
 						}
 						if($po['tym'.$x]>34)
 						{
-							$tyc = '���������';
+							$tyc = 'Временами';
 						}
 						if($po['tym'.$x]>79)
 						{
-							$tyc = '���������';
+							$tyc = 'Регулярны';
 						}
 						if($po['tym'.$x]>89)
 						{
-							$tyc = '�����';
+							$tyc = 'Часты';
 						}
 						if($po['tym'.$x]>=100)
 						{
-							$tyc = '������';
+							$tyc = 'Всегда';
 						}
-						$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
+						$tr .= '<br>• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
 					}
 					$x++;
 				}
 				if($tr!='')
 				{
-					$is2 .= '<br><strong>�����������:</strong>'.$tr;
+					$is2 .= '<br><strong>Особенности:</strong>'.$tr;
 				}*/
 
                 $tr = '';
@@ -5172,12 +4661,12 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     } else {
                         $rnc = '#282828';
                     }
-                    $po['imposed_name'] = str_replace('���� ', '', $po['imposed_name']);
-                    $tr .= '<br>&bull; <font color=' . $rnc . '>�������� ��������:</font> ' . $po['imposed_name'] . ' ';
+                    $po['imposed_name'] = str_replace('Чары ', '', $po['imposed_name']);
+                    $tr .= '<br>&bull; <font color=' . $rnc . '>Наложены заклятия:</font> ' . $po['imposed_name'] . ' ';
                     unset($rnc);
                 }
                 if ($tr != '') {
-                    $is2 .= '<br><strong>��������� ��������:</strong>';
+                    $is2 .= '<br><strong>Улучшения предмета:</strong>';
                     $is2 .= $tr;
                 }
 
@@ -5190,18 +4679,18 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                 }
 
                 if (isset($po['free_stats']) && $po['free_stats'] > 0) {
-                    $is2 .= '<br><strong>������������� ������:</strong><br>';
-                    $is2 .= '&bull; ��������� �������������: +' . $po['free_stats'] . ' �������������';
+                    $is2 .= '<br><strong>Распределение статов:</strong><br>';
+                    $is2 .= '&bull; Возможных распределений: +' . $po['free_stats'] . ' характеристик';
                 }
 
-                //���������� �����
+                //Встроенная магия
                 if ($pl['magic_inci'] != '' || $pl['magic_inc'] != '') {
                     if ($pl['magic_inc'] == '') {
                         $pl['magic_inc'] = $pl['magic_inci'];
                     }
                     $mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $pl['magic_inc'] . '" AND `type1` = "12345" LIMIT 1'));
                     if (isset($mgi['id2'])) {
-                        $is2 .= '<div> �������� �������� <img height=18 title="' . $mgi['mname'] . '" src="https://img.new-combats.com/i/eff/' . $mgi['img'] . '"> ' . $mgi['minfo'] . '</div>';
+                        $is2 .= '<div> Встроено заклятие <img height=18 title="' . $mgi['mname'] . '" src="https://img.new-combats.com/i/eff/' . $mgi['img'] . '"> ' . $mgi['minfo'] . '</div>';
                     }
                 }
 
@@ -5210,16 +4699,16 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     $d[2] = 0;
                 }
                 if (isset($po['complect'])) {
-                    $is2 .= '<br><i>�������������� ����������:</i>';
+                    $is2 .= '<br><i>Дополнительная информация:</i>';
                 }
                 if (isset($po['complect'])) {
-                    //�� ������������
-                    $com1 = ['name' => '����������� ��������', 'x' => 0, 'text' => ''];
+                    //не отображается
+                    $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => ''];
                     $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect'] . '" ORDER BY  `x` ASC LIMIT 20');
                     while ($plc = mysql_fetch_array($spc)) {
                         $com1['name'] = $plc['name'];
                         $com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">' . $plc['x'] . '</font>: ';
-                        //�������� ���������
+                        //действие комплекта
                         $i1c = 0;
                         $i2c = 0;
                         $i1e = $this->lookStats($plc['data']);
@@ -5242,23 +4731,23 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         unset($i1c, $i2c, $i3c);
                         $com1['x']++;
                     }
-                    $is2 .= '<br>&bull; ����� ���������: <strong>' . $com1['name'] . '</strong><br><small>';
+                    $is2 .= '<br>&bull; Часть комплекта: <strong>' . $com1['name'] . '</strong><br><small>';
                     $is2 .= $com1['text'];
                     $is2 .= '</small>';
                 }
 
                 if ($pl['max_text'] - $pl['use_text'] > 0) {
-                    $is2 .= '<div>���������� ��������: ' . ($pl['max_text'] - $pl['use_text']) . '</div>';
+                    $is2 .= '<div>Количество символов: ' . ($pl['max_text'] - $pl['use_text']) . '</div>';
                 }
 
                 $is2 .= '<small style="">';
 
                 if (isset($po['gravi'])) {
-                    $is2 .= '<br>�� ����������� ������������� �������: <strong>' . $po['gravi'] . '</strong>';
+                    $is2 .= '<br>На поверхности выгравирована надпись: <strong>' . $po['gravi'] . '</strong>';
                 }
 
                 if ($pl['info'] != '') {
-                    $is2 .= '<div><strong>������������:</strong></div><div>' . $pl['info'] . '</div>';
+                    $is2 .= '<div><strong>Рекомендации:</strong></div><div>' . $pl['info'] . '</div>';
                 }
 
                 if ($po['info'] != '') {
@@ -5266,61 +4755,61 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                 }
 
                 if ($pl['maidin'] != '') {
-                    //	$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
+                    //	$is2 .= '<div>Сделано в '.$this->city_name[$pl['maidin']].'</div>';
                 }
 
                 if (isset($po['noremont'])) {
-                    $is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет не подлежит ремонту</div>';
                 }
 
                 if (isset($po['nosale'])) {
-                    $is2 .= '<div style="color:brown;">������� ������ �������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет нельзя продать</div>';
                 }
 
                 if (isset($po['nomodif'])) {
-                    $is2 .= '<div style="color:brown;">������� ������ ��������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет нельзя улучшать</div>';
                 }
 
                 if (isset($po['nodelete'])) {
-                    $is2 .= '<div style="color:brown;">������� ������ ���������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет нельзя выбросить</div>';
                 }
 
                 if (isset($po['frompisher']) && $po['frompisher'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� �� ����������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет из подземелья</div>';
                 }
 
                 if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
+                    $is2 .= '<div style="color:brown;">Предмет не портится во время сна</div>';
                 }
 
                 if (isset($po['fromlaba']) && $po['fromlaba'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� �� ���������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет из лабиринта</div>';
                 }
 
                 if (isset($po['vip_sale']) && $po['vip_sale'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� ������ �� 10% �� ���������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет куплен за 10% от стоимости</div>';
                 }
 
                 if ($pl['dn_delete'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет будет удален при выходе из подземелья</div>';
                 }
 
                 if ($this->pokol > $pl['geni']) {
-                    $is2 .= '<div style="color:brown">������� �������</div>';
+                    $is2 .= '<div style="color:brown">Предмет устарел</div>';
                 }
 
                 if (isset($po['zazuby']) && $po['zazuby'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
+                    $is2 .= '<div style="color:brown;">Предмет куплен за зубы</div>';
                 }
 
-                //$is2 .= '<div>������� � '.$this->city_name[$this->info['city']].'</div>';
+                //$is2 .= '<div>Сделано в '.$this->city_name[$this->info['city']].'</div>';
 
                 $is2 .= '</small>';
 
                 $crd = '';
 
                 if ($this->info['admin'] > 0) {
-                    $crd = '<small><a href="javascript:window.open(\'https://new-combats.com/item_edit_data.php?edit_item_data=' . $pl['id'] . '\',\'winEdi1\',\'width=850,height=400,top=400,left=500,resizable=no,scrollbars=yes,status=no\');" target="_blank">������������� �������</a> &nbsp; <a href="https://new-combats.com/main.php?timeWorld=' . microtime() . '&otdel=' . round((int)$_GET['otdel']) . '#itmShop' . $pl['id'] . '" name="itmShop' . $pl['id'] . '">��������</a></small><br>';
+                    $crd = '<small><a href="javascript:window.open(\'https://new-combats.com/item_edit_data.php?edit_item_data=' . $pl['id'] . '\',\'winEdi1\',\'width=850,height=400,top=400,left=500,resizable=no,scrollbars=yes,status=no\');" target="_blank">Редактировать предмет</a> &nbsp; <a href="https://new-combats.com/main.php?timeWorld=' . microtime() . '&otdel=' . round((int)$_GET['otdel']) . '#itmShop' . $pl['id'] . '" name="itmShop' . $pl['id'] . '">обновить</a></small><br>';
                 }
 
                 echo '<tr style="background-color:#' . $cr . ';"><td width="100" style="padding:7px;" valign="middle" align="center">' . $is1 . '</td><td style="padding:7px;" valign="top"><span style="float:right">&nbsp;' . $crd . '</span>' . $is2 . '</td></tr>';
@@ -5329,7 +4818,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 
         }
         if ($i == 0) {
-            echo '<tr style="background-color:#' . $cr . ';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
+            echo '<tr style="background-color:#' . $cr . ';"><td style="padding:7px;" align="center" valign="top">Прилавок магазина пуст</td></tr>';
         }
     }
 
@@ -5367,7 +4856,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
             $n01 += $pl['ability'];
             $n02 += $pl['skills'];
             if ($ll < $pl['nextLevel']) {
-                $n01 += 1; //�����
+                $n01 += 1; //вынос
                 if ($this->info['level'] >= 9) {
                     $n01 += 1;
                 }
@@ -5398,12 +4887,12 @@ ORDER BY `1price`ASC , inGroupCount DESC');
     public function wipe()
     {
         if ($this->info['wipe'] > 0 && $this->info['battle'] == 0) {
-            //wipe = 1 , ������ �������� ����� � ������
+            //wipe = 1 , значит обнуляем статы и умения
             if ($this->info['wipe'] < 4) {
                 $st = $this->lookStats($this->info['stats']);
-                $n1 = $this->info['ability']; //�����������
-                $n2 = $this->info['skills']; //�������� ������ � �������
-                $n3 = $this->info['sskills']; //�����������
+                $n1 = $this->info['ability']; //способности
+                $n2 = $this->info['skills']; //владение магией и оружием
+                $n3 = $this->info['sskills']; //особенности
                 $n4 = $this->info['nskills']; //???
                 if ($this->info['wipe'] == 1 || $this->info['wipe'] == 2) {
                     $i = 1;
@@ -5443,7 +4932,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         $i++;
                     }
                 }
-                if ($this->info['wipe'] == 1 || $this->info['wipe'] == 3.5)#---����� ������������
+                if ($this->info['wipe'] == 1 || $this->info['wipe'] == 3.5)#---Сброс особенностей
                 {
                     $i = 1;
                     while ($i <= 11) {
@@ -5452,7 +4941,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         $i++;
                     }
                 }
-                //��������� ������
+                //сохраняем данные
                 $st = $this->impStats($st);
                 $upd = mysql_query('UPDATE `stats` SET `wipe`="0",`stats`="' . $st . '",`ability`="' . $n1 . '",`skills`="' . $n2 . '",`sskills`="' . $n3 . '",`nskills`="' . $n4 . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                 if ($upd) {
@@ -5468,10 +4957,10 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 
     public function __clone()
     {
-        trigger_error('������������ �� �����������.', E_USER_ERROR);
+        trigger_error('Дублирование не допускается.', E_USER_ERROR);
     }
 
-    //������� ���������� �������� ��� ��� �������������
+    //Сверяем требования предмета для его использования
     public function trItem($po)
     {
         $tr = '';
@@ -5507,7 +4996,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 		mf_mod
 		mf_mib
 */
-            //�����
+            //статы
             if ($_GET['mf'] == 's1' || $_GET['mf'] == 's2' || $_GET['mf'] == 's3' || $_GET['mf'] == 's5') {
                 if (isset($po['mf_stats']) && $po['mf_stats'] > 0 && isset($po['add_' . $_GET['mf']])) {
                     $po['mf_stats'] = (int)$po['mf_stats'];
@@ -5582,18 +5071,18 @@ ORDER BY `1price`ASC , inGroupCount DESC');
             if ($itm['so'] > 0) {
                 $s = (int)$s;
                 if ($tp == 1) {
-                    //�����
+                    //статы
                     if ($s == 1 || $s == 2 || $s == 3 || $s == 5) {
                         if (10 + 25 * $po['add_s' . $s] <= $itm['so'] && $itm['so'] > 0) {
                             $itm['so'] -= 10 + 25 * $po['add_s' . $s];
                             $po['add_s' . $s]++;
-                            $this->error = '�������������� ��������...';
+                            $this->error = 'Характеристика улучшена...';
                         } else {
-                            $this->error = '�� ������� ����� ��������...';
+                            $this->error = 'Не хватает очков развития...';
                         }
                     }
                 } elseif ($tp == 2) {
-                    //��
+                    //мф
                     if ($s > 0 && $s < 13) {
                         $s2 = 0;
                         if ($s == 9 || $s == 12) {
@@ -5641,7 +5130,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                             }
                             $po['add_' . $s]++;
                         } else {
-                            $this->error = '�� ������� ����� ��������...';
+                            $this->error = 'Не хватает очков развития...';
                         }
                     }
                 }
@@ -5655,7 +5144,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
     {
         $itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "' . ((int)$id) . '" LIMIT 1'));
         if ($this->info['transfers'] < 1) {
-            $this->error = '�� ������� ����� ������� ��������.';
+            $this->error = 'На сегодня лимит передач исчерпан.';
         } elseif (isset($itm['id'])) {
             if (isset($itm['inGroup']) and $itm['inGroup'] > 0) {
                 $col = $this->itemsX($itm['id']);
@@ -5671,11 +5160,11 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
 				$this->info['transfers']--;
 				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->error = '������� &quot;'.$itm['name'].''.$col.'&quot; ��������� �� ���������';
+				$this->error = 'Предмет &quot;'.$itm['name'].''.$col.'&quot; перенесен из инвентаря';
 				*/
             }
         } else {
-            $this->error = '������� �� ������ � �������';
+            $this->error = 'Предмет не найден в рюкзаке';
         }
     }
 
@@ -5684,7 +5173,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
         $itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
 FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" AND `iu`.`id` = "' . ((int)$id) . '" LIMIT 1'));
         if ($this->info['transfers'] < 1) {
-            $this->error = '�� ������� ����� ������� ��������.';
+            $this->error = 'На сегодня лимит передач исчерпан.';
         } elseif (isset($itm['id'])) {
             if (isset($itm['inGroup']) && $itm['inGroup'] > 0) {
                 $col = $this->itemsX($itm['id']);
@@ -5698,13 +5187,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             }
             if ($upd) { /*
 				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
-				$this->error = '������� &quot;'.$itm['name'].''.$col.'&quot; ��������� � ���������';
+				$this->error = 'Предмет &quot;'.$itm['name'].''.$col.'&quot; перенесен в инвентаря';
 				$this->info['transfers']--;
 				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
 				*/
             }
         } else {
-            $this->error = '������� �� ������ � �������';
+            $this->error = 'Предмет не найден в сундуке';
         }
     }
 
@@ -5728,13 +5217,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $mx1 += $this->info['skills'];
                     if ($mx1 > 0) {
-                        //������
+                        //умения
                         $s = $s - 100;
                         if ($s > 5 && $s <= 12) {
-                            //�����
+                            //магия
                             $po['add_mg' . ($s - 5)]++;
                         } elseif ($s > 0) {
-                            //������
+                            //оружие
                             $po['add_a' . $s]++;
                         }
                     }
@@ -5826,7 +5315,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
         if ($vi > 0) {
             $itm_inv = $this->genInv(80, ' ' . rtrim($vid, 'OR') . ' ');
-            echo '<button style="float:right" class="btn" type="button" onclick="top.frames[\'main\'].location=\'main.php?inv=1&otdel=' . floor($_GET['otdel']) . '\'">���������</button><strong>�������� ������� ��� ������������� &quot;' . $rune['name'] . '&quot;:</strong><br><br><table width="100%" border="0" cellspacing="1" align="center" cellpadding="0" bgcolor="#A5A5A5">' . $itm_inv[2] . '</table>';
+            echo '<button style="float:right" class="btn" type="button" onclick="top.frames[\'main\'].location=\'main.php?inv=1&otdel=' . floor($_GET['otdel']) . '\'">Вернуться</button><strong>Выберите предмет для использования &quot;' . $rune['name'] . '&quot;:</strong><br><br><table width="100%" border="0" cellspacing="1" align="center" cellpadding="0" bgcolor="#A5A5A5">' . $itm_inv[2] . '</table>';
             die();
         } else {
             unset($rune);
@@ -5844,9 +5333,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 			`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
 			,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "' . mysql_real_escape_string($ruid) . '" AND `i`.`uid` = "' . $this->info['id'] . '" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
             if ($rune['level'] > $this->info['level'] && $rune['type'] == 31) {
-                $this->error = '� ��� ������� ��������� ������� ����� ������������ ��� ����';
+                $this->error = 'У вас слишком маленький уровень чтобы использовать эту руну';
             } elseif ($rune['type'] == 31) {
-                //���������� ����
+                //Встраиваем руну
                 if ($idt['type'] == 7) {
                     $idt['type'] = 6;
                 }
@@ -5858,19 +5347,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
                 $data = $this->lookStats($id['data']);
                 $type_rune = [
-                    '��' => 9, //������
-                    '��' => 10, //��������
-                    '��' => 11, //������
-                    '��' => 12, //��������
-                    '��' => 14, //������
-                    '��' => 15, //�����
-                    '��' => 1, //����
-                    '��' => 3, //������
-                    '��' => 6, //�����
-                    '��' => 8  //����
+                    'хи' => 9, //Серьги
+                    'хэ' => 10, //Ожерелье
+                    'ви' => 11, //Кольцо
+                    'во' => 12, //Перчатки
+                    'кэ' => 14, //Поножи
+                    'ки' => 15, //Обувь
+                    'ми' => 1, //Шлем
+                    'си' => 3, //Наручи
+                    'мо' => 6, //Броня
+                    'со' => 8  //Пояс
                 ];
                 if ($rune['type'] == 5) {
-                    $type_rune['��'] = 5;
+                    $type_rune['мо'] = 5;
                 }
                 //
                 //$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
@@ -5880,22 +5369,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $type_rune = $type_rune[substr($rune['name'], -2, 2)];
                 if ($type_rune != $id['type'] && $type_rune != '') {
                     $type_rune2 = [
-                        '��' => '������', //������
-                        '��' => '��������', //��������
-                        '��' => '������', //������
-                        '��' => '��������', //��������
-                        '��' => '������', //������
-                        '��' => '�����', //�����
-                        '��' => '����', //����
-                        '��' => '������', //������
-                        '��' => '�����', //�����
-                        '��' => '����'  //����
+                        'хи' => 'серьги', //Серьги
+                        'хэ' => 'ожерелья', //Ожерелье
+                        'ви' => 'кольцо', //Кольцо
+                        'во' => 'перчатки', //Перчатки
+                        'кэ' => 'поножи', //Поножи
+                        'ки' => 'обувь', //Обувь
+                        'ми' => 'шлем', //Шлем
+                        'си' => 'наручи', //Наручи
+                        'мо' => 'броню', //Броня
+                        'со' => 'пояс'  //Пояс
                     ];
-                    $this->error = '�������� ������ ���� �������� ������ � ' . $type_rune2[substr($rune['name'], -2, 2)] . ' (��� ��������: ' . $id['type'] . '. ��������� ���: ' . $type_rune . ')';
+                    $this->error = 'Встроить данную руну возможно только в ' . $type_rune2[substr($rune['name'], -2, 2)] . ' (Тип предмета: ' . $id['type'] . '. Требуемый тип: ' . $type_rune . ')';
                 } elseif (isset($data['nomodif'])) {
-                    $this->error = '�������� ������ ������� ����������';
+                    $this->error = 'Улучшить данный предмет невозможно';
                 } elseif (isset($data['art']) && $data['tr_lvl'] < 0) {
-                    $this->error = '����������� �������� � ��������� ���� 10-�� ������ ����������';
+                    $this->error = 'Встраивание усилений в артефакты ниже 10-го уровня недоступно';
                 } else {
                     if (isset($data['rune']) && $data['rune'] > 0) {
                         $ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $data['rune_id'] . '" LIMIT 1'));
@@ -5912,7 +5401,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $data['rune_id'] = $rune['item_id'];
                     $data['rune_name'] = $rune['name'];
                     $data['rune_lvl'] = $rune['level'];
-                    //��������� �������������� ����
+                    //Добавляем характеристики руны
                     $add = $this->lookStats($rune['data']);
                     $i = 0;
                     while ($i < count($this->items['add'])) {
@@ -5929,14 +5418,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
 
 
-                    $this->error = '����������� ���� ������ �������';
+                    $this->error = 'Встраивание руны прошло успешно';
                 }
             } else {
                 $rune = mysql_fetch_array(mysql_query('SELECT 
 				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
 				,`m`.`name`,`m`.`level`,`m`.`type` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "' . mysql_real_escape_string($ruid) . '" AND `i`.`uid` = "' . $this->info['id'] . '" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
                 if (!isset($rune['id'])) {
-                    $this->error = '�������� ������� �� ������������ �� �������';
+                    $this->error = 'Усиление которое вы использовали не найдено';
                 } elseif ($rune['type'] == 62 && $rune['item_id'] == 6167) {
                     //-----------------------------------------------
                     $idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "' . $id['item_id'] . '" LIMIT` 1'));
@@ -5944,9 +5433,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $data = $this->lookStats($id['data']);
                     $add = $this->lookStats($rune['data']);
                     if (isset($data['nomodif'])) {
-                        $this->error = '�������� ������ ������� ����������';
+                        $this->error = 'Улучшить данный предмет невозможно';
                     } elseif (isset($data['art']) && $data['tr_lvl'] < 0) {
-                        $this->error = '����������� �������� � ��������� ���� 10-�� ������ ����������';
+                        $this->error = 'Встраивание усилений в артефакты ниже 10-го уровня недоступно';
                     } else {
                         if (isset($data['spell']) && $data['spell'] > 0) {
 
@@ -5982,7 +5471,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             }
 
                         }
-                        //����� �����
+                        //Новая чарка
 
                         $srune = mysql_query('SELECT * FROM `new_charov` WHERE 1');
                         $irun = 0;
@@ -6003,7 +5492,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         if (!isset($data['sudba'])) {
                             $data['sudba'] = '0';
                         }
-                        $data['spell_name'] = '�����������'; //$info
+                        $data['spell_name'] = 'Зачарованно'; //$info
                         $data['spell_st_name'] = $addrune['gname'];
                         $data['spell_st_val'] = $addrunes;
                         $data['spell_id'] = $rune['item_id'];
@@ -6016,9 +5505,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $tid = mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                         mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                         if (isset($tid)) {
-                            $this->error = '��������� ������ �������!';
+                            $this->error = 'Чарование прошло успешно!';
                         } else {
-                            $this->error = '��� �� ����� �� ���!';
+                            $this->error = 'Что то пошло не так!';
                         }
                         unset($tid);
                     }
@@ -6037,18 +5526,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $idt['type'] = 6;
                     }
                     //$id['type'] = $idt['type'];
-                    //���������� ����
+                    //Встраиваем руну
                     $data = $this->lookStats($id['data']);
                     $add = $this->lookStats($rune['data']);
                     if (isset($data['nomodif'])) {
-                        $this->error = '�������� ������ ������� ����������';
+                        $this->error = 'Улучшить данный предмет невозможно';
                     } elseif (isset($data['art']) && $data['tr_lvl'] < 0) {
-                        $this->error = '����������� �������� � ��������� ���� 10-�� ������ ����������';
+                        $this->error = 'Встраивание усилений в артефакты ниже 10-го уровня недоступно';
                         /*}elseif(isset($data['spell_id']) && $data['spell_id'] == 6167) {
-						$this->error = '��� ����� ������������ ������';*/
+						$this->error = 'Эту чарку использовать нелязя';*/
                     } elseif (isset($add['onimposed'])) {
-                        //���������� �����
-                        //����� �����
+                        //Встраиваем магию
+                        //Новая чарка
                         $i = 0;
                         $j = 0;
                         $utp = explode(',', $add['onItemType']);
@@ -6085,13 +5574,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                             mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                             mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
-                            $this->error = '�������� ���� "' . $add['onSpellName'] . '" �� ������� &quot;' . $id['name'] . '&quot;';
+                            $this->error = 'Наложены чары "' . $add['onSpellName'] . '" на предмет &quot;' . $id['name'] . '&quot;';
                         } else {
-                            $this->error = '������� &quot;' . $id['name'] . '&quot; �� �������� ��� ��������.,.';
+                            $this->error = 'Предмет &quot;' . $id['name'] . '&quot; не подходит для усиления.,.';
                         }
                     } else {
                         if (isset($data['spell']) && $data['spell'] > 0) {
-                            //�������� ������ �� ������� �����
+                            //Отнимаем эффект от прошлых чарок
                             $litm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "' . $id['item_id'] . '" LIMIT 1'));
 
                             $data_l = $this->lookStats($litm['data']);
@@ -6163,12 +5652,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 //}
                             }
                         }
-                        //����� �����
+                        //Новая чарка
                         $i = 0;
                         $utp = explode(',', $add['onItemType']);
                         while ($i < count($utp)) {
                             if ($utp[$i] == $id['type']) {
-                                // ���������� ������ ��� ������.
+                                // Определили нужный тип оружия.
                                 $itm_twohand = mysql_fetch_array(mysql_query('SELECT `2h` FROM `items_main` WHERE `id` = "' . $id['item_id'] . '" LIMIT 1'));
                                 if (isset($itm_twohand['2h']) && $itm_twohand['2h'] == 1) $tw = '2'; else $tw = '';
                                 $j = 0;
@@ -6181,12 +5670,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                                 if (isset($add['imposed']) && $add['imposed'] != '') {
                                     $imposed = [
-                                        'imposed' => '1', // �������
-                                        'imposed_id' => $rune['id'], // ID ����� ������
-                                        'imposed_name' => $rune['name'], // ������������ ���, ������� ������������ �� ��������
-                                        'imposed_level' => $rune['level'], // ���� ��������� ���������� ��� �����������. �� ���������: 0;
-                                        'bm_a1' => $add['imposed'], // ��� ����� ����������.
-                                        'sudba' => $this->info['login'] // ���� ��������� ���������� ��� �����������. �� ���������: 0;
+                                        'imposed' => '1', // Активно
+                                        'imposed_id' => $rune['id'], // ID чарки свитка
+                                        'imposed_name' => $rune['name'], // Наименование чар, которое отображается на предмете
+                                        'imposed_level' => $rune['level'], // Цвет подсветки заклинания при отображении. По умолчанию: 0;
+                                        'bm_a1' => $add['imposed'], // Имя файла заклинания.
+                                        'sudba' => $this->info['login'] // Цвет подсветки заклинания при отображении. По умолчанию: 0;
                                     ];
                                     if (isset($add['imposed_name'])) $imposed['imposed_name'] = $add['imposed_name'];
                                     if (isset($add['imposed_level'])) $imposed['imposed_level'] = $add['imposed_level'];
@@ -6204,13 +5693,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                                         mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                                         mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
-                                        $this->error = '�������� ���� "' . $imposed['imposed_name'] . '" �� ������� &quot;' . $id['name'] . '&quot;';
+                                        $this->error = 'Наложены чары "' . $imposed['imposed_name'] . '" на предмет &quot;' . $id['name'] . '&quot;';
 
                                     } elseif (!isset($this->is[$rnda])
                                         && $rnda != 'mib1' && $rnda != 'mib2' && $rnda != 'mib3' && $rnda != 'mib4'
                                         && $rnda != 'mab1' && $rnda != 'mab2' && $rnda != 'mab3' && $rnda != 'mab4'
                                     ) {
-                                        $this->error = '���������� �������� ������� �����. ( ' . $rnda . ' )';
+                                        $this->error = 'Попробуйте зачарить предмет снова. ( ' . $rnda . ' )';
                                     } else {
                                         $data['add_' . $rnda] += $add[$tw . 'add' . $utp[$i] . '_' . $rnda];
                                         if ($rnda == 'mab1' || $rnda == 'mab2' || $rnda == 'mab3' || $rnda == 'mab4') {
@@ -6248,7 +5737,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                             if ($data['add_' . $data['spell_st_name']] == 0) {
                                                 unset($data['add_' . $data['spell_st_name']]);
                                             }
-                                            //die('������� ��������: '.$data['spell_st_name'].' +'.$data['spell_st_val'].'<br>���������� �����...');
+                                            //die('Прошлое усиление: '.$data['spell_st_name'].' +'.$data['spell_st_val'].'<br>Попробуйте позже...');
                                         }
 
                                         $data['spell_id'] = $rune['item_id'];
@@ -6264,13 +5753,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                         }
                                         $data = $this->impStats($data);
 
-                                        $this->is['mab1'] = '����� ������';
-                                        $this->is['mab2'] = '����� �������';
-                                        $this->is['mab3'] = '����� �����';
-                                        $this->is['mab4'] = '����� ���';
-                                        $this->error = '��������� �������������� �������� &quot;' . $id['name'] . '&quot;, ' . $this->is[$rnda] . ': +' . $add[$tw . 'add' . $utp[$i] . '_' . $rnda];
+                                        $this->is['mab1'] = 'Броня головы';
+                                        $this->is['mab2'] = 'Броня корпуса';
+                                        $this->is['mab3'] = 'Броня пояса';
+                                        $this->is['mab4'] = 'Броня ног';
+                                        $this->error = 'Увеличина характеристика предмета &quot;' . $id['name'] . '&quot;, ' . $this->is[$rnda] . ': +' . $add[$tw . 'add' . $utp[$i] . '_' . $rnda];
 
-                                        //$this->error = '<br/><br/><br/>��������� �������������� �������� &quot;'.$id['name'].'&quot;, '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."<br/><br/>$:".$idt['2h']."<";
+                                        //$this->error = '<br/><br/><br/>Увеличина характеристика предмета &quot;'.$id['name'].'&quot;, '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."<br/><br/>$:".$idt['2h']."<";
 
                                         unset($this->is['mab1'], $this->is['mab2'], $this->is['mab3'], $this->is['mab4']);
 
@@ -6278,14 +5767,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                         mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                                     }
                                 } else {
-                                    $this->error = '���-�� �� ���, ���������� ���������� ������ �������';
+                                    $this->error = 'Что-то не так, невозможно зачаровать данным свитком';
                                 }
                                 $i = 100499;
                             }
                             $i++;
                         }
                         if ($i < 100500) {
-                            $this->error = '������ ������� �� �������� ��� �����������...';
+                            $this->error = 'Данный предмет не подходит для зачарования...';
                         }
                     }
 
@@ -6300,12 +5789,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             }
                             mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $id['iznosNOW'] . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '"  LIMIT 1');
                             mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
-                            $this->error = '������� ' . $id['name'] . ' ������� ��������������.';
+                            $this->error = 'Предмет ' . $id['name'] . ' успешно отремонтирован.';
                         } else {
-                            $this->error = '������� �� ���������� � �������...';
+                            $this->error = 'Предмет не нуждаеться в ремонте...';
                         }
                     } else {
-                        $this->error = '������ ����������� ������ ���������...';
+                        $this->error = 'Свиток ремонтирует только артефакты...';
                     }
                 } elseif ($rune['type'] == 46) {
                     $idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "' . $id['item_id'] . '" LIMIT` 1'));
@@ -6322,9 +5811,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                     $data['srok'] = $id['srok'];
                                 }
                                 if ($data['srok'] + $id['time_create'] - time() > 86400 + 30) {
-                                    $this->error = '������ ������������ �� �������� � ������ �������� 30 � ����� ����.';
+                                    $this->error = 'Нельзя использовать на предметы с сроком годности 30 и более дней.';
                                 } elseif ($id['inslot'] > 0 && $id['inslot'] < 20) {
-                                    $this->error = '���� �������� �������� &quot;' . $id['name'] . '&quot; ������� �� ' . $this->timeOut($add['uptimeitem']) . '.';
+                                    $this->error = 'Срок годности предмета &quot;' . $id['name'] . '&quot; продлен на ' . $this->timeOut($add['uptimeitem']) . '.';
 
                                     if (isset($data['sleep_moroz'])) {
                                         unset($data['sleep_moroz']);
@@ -6336,24 +5825,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                     mysql_query('UPDATE `items_users` SET `data` = "' . $data . '",`time_create` = `time_create` + ' . floor($add['uptimeitem']) . ' WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
 
                                 } else {
-                                    $this->error = '������� ������� ���� ������ ��������...';
+                                    $this->error = 'Предмет данного типа нельзя продлить...';
                                 }
                             } else {
-                                $this->error = '��� �������� ������ �� �������� � ������ ��������...';
+                                $this->error = 'Это работает только на предметы с сроком годности...';
                             }
                         } else {
-                            $this->error = '���������� ����� ������ ������...';
+                            $this->error = 'Затачивать можно только оружие...';
                         }
                     } else {
-                        //�������
+                        //Заточка
                         $data = $this->lookStats($id['data']);
                         $add = $this->lookStats($rune['data']);
                         if (isset($data['upatack_id'])) {
-                            $this->error = '������� ��� �������, �������� ������� � ��������� ����������.';
+                            $this->error = 'Предмет уже заточен, вытащите заточку в Ремонтной мастерской.';
                         } elseif (isset($data['nomodif'])) {
-                            $this->error = '�������� ������ ������� ����������';
+                            $this->error = 'Улучшить данный предмет невозможно';
                         } elseif ($add['uptype'] != $id_type || $add['uptype'] == 0) {
-                            $this->error = '������� �� �������� � ������� ��������...';
+                            $this->error = 'Заточка не подходит к данному предмету...';
                         } else {
 
                             if (isset($data['upatack_id']) && $data['upatack_id'] > 0) {
@@ -6381,7 +5870,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 //$data['base_price2'] = $id['2price'];
                             }
 
-                            //��������� �������������� ����
+                            //Добавляем характеристики руны
                             $i = 0;
                             while ($i < count($this->items['add'])) {
                                 if (isset($add['add_' . $this->items['add'][$i]])) {
@@ -6398,7 +5887,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 $data['sv_yron_min'] += $add['upatack'];
                                 $data['sv_yron_max'] += $add['upatack'];
                                 //print_r($data);
-                                //die('������ �������� �� �������.');
+                                //die('Посохи временно не точатся.');
                             } elseif ($id['2h'] == 1) {
                                 $data['sv_yron_min'] += $add['upatack'];
                                 $data['sv_yron_max'] += $add['upatack'];
@@ -6412,27 +5901,27 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 //$id['2price'] = $data['base_price2']+$rune['2price'];
                             }
 
-                            $this->addDelo(2, $this->info['id'], '&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: ������� &quot;' . $data['upatack_name'] . '&quot; ���� ������� <strong>��������</strong> � ������� &quot;' . $id['name'] . '&quot; [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0);
+                            $this->addDelo(2, $this->info['id'], '&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: Заточка &quot;' . $data['upatack_name'] . '&quot; была успешно <strong>встроена</strong> в предмет &quot;' . $id['name'] . '&quot; [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0);
 
 
                             $data = $this->impStats($data);
 
                             mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                             mysql_query('UPDATE `items_users` SET `1price` = "' . $id['1price'] . '",`2price` = "' . $id['2price'] . '",`data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
-                            $this->error = '������� &quot;' . $id['name'] . '&quot; ������ �������';
+                            $this->error = 'Заточка &quot;' . $id['name'] . '&quot; прошла успешно';
                         }
                     }
                 } elseif ($rune['type'] == 48) {
-                    //�������
+                    //Профиль
                     $data = $this->lookStats($id['data']);
                     $add = $this->lookStats($rune['data']);
 
                     if ($data['tya1'] >= 90 || $data['tya2'] >= 90 || $data['tya3'] >= 90 || $data['tya4'] >= 90) {
-                        $this->error = '������� ��� ����� 90 ������ �������';
+                        $this->error = 'Предмет уже имеет 90 своего профиля';
                     } elseif (isset($data['nomodif'])) {
-                        $this->error = '�������� ������ ������� ����������';
+                        $this->error = 'Улучшить данный предмет невозможно';
                     } elseif ($add['uptype'] != $id_type || $add['uptype'] == 0) {
-                        $this->error = '������� �� �������� � ������� ��������...';
+                        $this->error = 'Заточка не подходит к данному предмету...';
                     } else {
 
                         if ($add['tya1'] == 1) {
@@ -6466,16 +5955,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         }
 
 
-                        $this->addDelo(2, $this->info['id'], '&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: ������� &quot;' . $data['upatack_name'] . '&quot; ���� ������� <strong>��������</strong> � ������� &quot;' . $id['name'] . '&quot; [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0);
-                        $this->error = '������� &quot;' . $id['name'] . '&quot; ������ �������! �����:' . $data['tya1'] . ' ���:' . $data['tya2'] . ' �����:' . $data['tya3'] . ' ���:' . $data['tya4'] . ' ';
+                        $this->addDelo(2, $this->info['id'], '&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: Заточка &quot;' . $data['upatack_name'] . '&quot; была успешно <strong>встроена</strong> в предмет &quot;' . $id['name'] . '&quot; [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0);
+                        $this->error = 'Заточка &quot;' . $id['name'] . '&quot; прошла успешно! Колка:' . $data['tya1'] . ' Руб:' . $data['tya2'] . ' Дробь:' . $data['tya3'] . ' Реж:' . $data['tya4'] . ' ';
                         $data = $this->impStats($data);
                         mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                         mysql_query('UPDATE `items_users` SET `1price` = "' . $id['1price'] . '",`2price` = "' . $id['2price'] . '",`data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
-                        //$this->error = '������� &quot;'.$id['name'].'&quot; ������ �������! �����:'.$data['tya1'].' ���:'.$data['tya2'].' �����:'.$data['tya3'].' ���:'.$data['tya4'].' ';
+                        //$this->error = 'Заточка &quot;'.$id['name'].'&quot; прошла успешно! Колка:'.$data['tya1'].' Руб:'.$data['tya2'].' Дробь:'.$data['tya3'].' Реж:'.$data['tya4'].' ';
 
                     }
                 } elseif ($rune['type'] == 50) {
-                    //��������� ������
+                    //Страничка саныча
                     //$id['data'];
                     //$rune['data'];
                     //$id['item_id']
@@ -6484,14 +5973,14 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                         if ($id['iznosNOW'] > 0) {
                             $id['iznosNOW']--;
-                            $this->error = '�������������� &quot;' . $id['name'] . '&quot; ������ �������! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']';
+                            $this->error = 'Восстановление &quot;' . $id['name'] . '&quot; прошла успешно! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']';
                             mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                             mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $id['iznosNOW'] . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                         } else {
-                            $this->error = '������� &quot;' . $id['name'] . '&quot; ����� ������������ �������� ���������! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']';
+                            $this->error = 'Предмет &quot;' . $id['name'] . '&quot; имеет макисмальное значение прочности! [' . round($id['iznosNOW']) . '/' . round($id['iznosMAX']) . ']';
                         }
                     } else {
-                        $this->error = '������ ������� �� �������� ��� ��������������!!';
+                        $this->error = 'Данный предмет не подходит для восстановления!!';
                     }
 
 
@@ -6502,13 +5991,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $id['type'] = $idt['type'];
 
-                    //���������� ����
+                    //Встраиваем руну
                     $data = $this->lookStats($id['data']);
                     $add = $this->lookStats($rune['data']);
                     if (isset($data['nomodif'])) {
-                        $this->error = '�������� ������ ������� ����������';
+                        $this->error = 'Улучшить данный предмет невозможно';
                     } elseif (!isset($data['close']) && $data['close'] != 0) {
-                        $this->error = '�� �������� � ������� ��������, �� �� ������...';
+                        $this->error = 'Не подходит к данному предмету, он не закрыт...';
                     } else {
                         $data['unopen'] = $rune['id'];
                         $data['unopen_id'] = $rune['item_id'];
@@ -6522,7 +6011,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                         mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                         mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
-                        $this->error = '�������� &quot;' . $id['name'] . '&quot; ������ �������';
+                        $this->error = 'Открытие &quot;' . $id['name'] . '&quot; прошло успешно';
                     }
 
                 } elseif ($rune['type'] == 37) {
@@ -6534,16 +6023,16 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         //
                         if ($id['gift'] == '' || $id['gift'] == '0') {
                             if (isset($data['notransfer'])) {
-                                $this->error = '������� ������ ����������...';
+                                $this->error = 'Предмет нельзя передавать...';
                             } elseif (isset($data['sudba']) && $data['sudba'] != 0) {
-                                $this->error = '������� ������ ����� �������...';
+                                $this->error = 'Предмет связан общей судьбой...';
                             } else {
                                 if (isset($add['item_inbox']) && $add['item_inbox'] > 0) {
-                                    $this->error = '� �������� ��� ���-�� ����, �������� ������� �������!';
+                                    $this->error = 'В упаковке уже что-то есть, осталось сделать подарок!';
                                 } elseif ($id['inTransfer'] > 0 || $id['inShop'] > 0 || $id['inGroup'] > 0) {
-                                    $this->error = '������ �������� ���� �������, �� � ��������, �� �������� ��� � ������...';
+                                    $this->error = 'Нельзя передать этот предмет, он в передаче, на прилавке или в группе...';
                                 } else {
-                                    //���������� ������� � ��������
+                                    //Закидываем предмет в упаковку
                                     $add['item_inbox'] = $id['id'];
                                     $add['open'] = 1;
                                     $add['nosale'] = 1;
@@ -6552,23 +6041,23 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                     mysql_query('UPDATE `items_users` SET `inGroup` = 0,`data` = "' . $add . '" WHERE `id` = "' . $rune['id'] . '" LIMIT 1');
                                     mysql_query('UPDATE `items_users` SET `uid` = -1 WHERE `id` = "' . $id['id'] . '" LIMIT 1');
                                     //
-                                    $this->error = '������� &quot;' . $idt['name'] . '&quot; �������� � �������.';
+                                    $this->error = 'Предмет &quot;' . $idt['name'] . '&quot; упакован в коробку.';
                                     //
                                 }
                             }
                         } else {
-                            $this->error = '�������� �� �����...';
+                            $this->error = 'Даренное не дарят...';
                         }
                         //
                     } else {
-                        $this->error = '�� �� ������� ��������� ��������...';
+                        $this->error = 'Вы не сможете упаковать упаковку...';
                     }
                 } else {
-                    $this->error = '(' . $rune['type'] . ') �������� ������� �� ������������ �� �������...';
+                    $this->error = '(' . $rune['type'] . ') Усиление которое вы использовали не найдено...';
                 }
             }
         } else {
-            $this->error = '����������� �������� �� �������...';
+            $this->error = 'Подходящего предмета не нашлось...';
         }
     }
 
@@ -6614,22 +6103,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         $v = count($slot[9]) + count($slot[10]) + count($slot[11]);
         $a = count($itm) - $l - $v;
         if ($this->stats['silver'] == 2) {
-            // 3 ��������� (1������ � ��� ����� ��������)
+            // 3 Артефакта (1оружие и все кроме ювелирки)
             if ($j > 3 || $l > 1 || $v > 0) {
                 $r = false;
             }
         } elseif ($this->stats['silver'] == 3) {
-            // 6 ���������� (1 ������, 1 �������� � 4 ���� �� �����)
+            // 6 Артефактов (1 оружие, 1 ювелирка и 4 вещи на выбор)
             if ($j > 6 || $l > 1 || $v > 1) {
                 $r = false;
             }
         } elseif ($this->stats['silver'] == 4) {
-            // 9 ���������� (2 ������, 2 �������� � 5 ����� �� �����)
+            // 9 Артефактов (2 оружия, 2 ювелирки и 5 вещей на выбор)
             if ($j > 9 || $l > 2 || $v > 2) {
                 $r = false;
             }
         } elseif ($this->stats['silver'] == 5) {
-            // ������� ������
+            // сколько угодно
         }
         return $r;
     }
@@ -6643,7 +6132,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             $r = $r / 100;
         }
         $r = $c['shop_type2'];
-        //$r = 1; //������ 100%
+        //$r = 1; //скупка 100%
         $r = round(($r / 100), 2);
         return $r;
     }
@@ -6652,11 +6141,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
     {
         global $c, $code;
 
-        $i = 0; // �������, ������ ��������.
-        $j = 0;  // ����� ��������� while ++
-        $k = 1; // 0 ��� 1
-        $rt = [0 => 0, 1 => 0, 2 => '']; // ����������? ���������
-        $clr = [0 => 'c8c8c8', 1 => 'd4d4d4']; // ���� ���� ��� ���������
+        $i = 0; // счетчик, просто обнуняем.
+        $j = 0;  // Всего предметов while ++
+        $k = 1; // 0 или 1
+        $rt = [0 => 0, 1 => 0, 2 => '']; // Количество? Непонятно
+        $clr = [0 => 'c8c8c8', 1 => 'd4d4d4']; // Цвет фона для предметов
         $sort = explode('ORDER BY', $sort);
         if (isset($sort[0], $sort[1])) {
             $where = $sort[0];
@@ -6683,28 +6172,28 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             $is1 = '';
             $is2 = '';
             $d = [];
-            //����
+            //тест
             $d[0] = 0;
             $d[1] = 1;
             $d[2] = 0;
             $po = $this->lookStats($pl['data']);
 
             $see1 = 1;
-            if ($type == 15) { //�������� �����
+            if ($type == 15) { //кормушка зверя
                 if ($anm['type'] == 3 && substr_count($pl['img'], 'wisp') == 0) {
-                    $see1 = 0; //�������
+                    $see1 = 0; //светляк
                 } elseif ($anm['type'] == 2 && substr_count($pl['img'], 'owl') == 0) {
-                    $see1 = 0; //����
+                    $see1 = 0; //сова
                 } elseif ($anm['type'] == 1 && substr_count($pl['img'], 'cat') == 0) {
-                    $see1 = 0; //���
+                    $see1 = 0; //кот
                 } elseif ($anm['type'] == 4 && substr_count($pl['img'], 'chrt') == 0) {
-                    $see1 = 0; //�������
+                    $see1 = 0; //чертяка
                 } elseif ($anm['type'] == 5 && substr_count($pl['img'], 'dog') == 0) {
-                    $see1 = 0; //������
+                    $see1 = 0; //собака
                 } elseif ($anm['type'] == 6 && substr_count($pl['img'], 'pig') == 0) {
-                    $see1 = 0; //������
+                    $see1 = 0; //свинья
                 } elseif ($anm['type'] == 7 && substr_count($pl['img'], 'dragon') == 0) {
-                    $see1 = 0; //������
+                    $see1 = 0; //дракон
                 }
             } elseif (isset($po['nosale']) && $type == 2) {
                 $see1 = 0;
@@ -6727,7 +6216,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $see1 = 0;
             } elseif ($type == 67 && $pl['gift'] != '') {
                 $see1 = 0;
-            } elseif ($type == 11) { // ���� ������ (������ ���������)
+            } elseif ($type == 11) { // Храм Знаний (плавка предметов)
                 if (
                     $pl['inTransfer'] > 0 ||
                     (!empty($po['sudba']) && $po['sudba'] != $this->info['login']) ||
@@ -6736,8 +6225,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 ) {
                     $see1 = 0;
                 }
-            } elseif ($type == 14) { // ���� ������ (������ ���)
-                if ($pl['inTransfer'] > 0 || !in_array($pl['type'], [31, 6001, 6002, 6003]) {
+            } elseif ($type == 14) { // Храм Знаний (плавка рун)
+                if ($pl['inTransfer'] > 0 || !in_array($pl['type'], [31, 6001, 6002, 6003])) {
                     $see1 = 0;
                 }
             } elseif ($type == 12) {
@@ -6752,12 +6241,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             } elseif (isset($po['musor']) && $po['musor'] > 0 && $pl['iznosNOW'] >= $pl['iznosMAX']) {
                 $see1 = 0;
             } elseif ($type == 57) {
-                //��������
+                //Подгонка
                 if ($pl['type'] < 18 || $pl['type'] > 28 || $pl['type'] == 25) {
                     $see1 = 0;
                 }
             } elseif ($type == 58) {
-                //������������ ���
+                //Вытаскивание рун
                 if (!isset($po['rune_id'])) {
                     $see1 = 0;
                 }
@@ -6810,19 +6299,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 } else {
                     $k = 1;
                 }
-                if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) { //���� ����� +
+                if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) { //Зоны блока +
                     if (!isset($po['zonb'])) {
                         $po['zonb'] = 0;
                     }
                     $po['zonb']++;
                 }
-                //������ �����
+                //правая часть
                 $mx = '';
                 if (isset($po['upatack_lvl'])) {
                     $mx .= ' +' . $po['upatack_lvl'];
                 }
                 if (isset($po['modif'])) {
-                    $mx .= ' (��)';
+                    $mx .= ' (мф)';
                 }
                 $col = $this->itemsX($pl['id']);
                 if ($col > 1 && $pl['inGroup'] != 0) {
@@ -6839,7 +6328,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                 }
                 if (isset($po['renameadd']) && $po['renameadd'] != '') {
-                    $pl['name'] .= ' (<small>�������: ' . $po['renameadd'] . '</small>)';
+                    $pl['name'] .= ' (<small>Предмет: ' . $po['renameadd'] . '</small>)';
                 }
                 if (isset($po['icos'])) {
                     $pl['name'] = '<span class=icos_' . $po['icos'] . ' >' . $pl['name'] . ' <span><small>&nbsp;' . $po['icos'] . '&nbsp;</small></span></span>';
@@ -6847,72 +6336,72 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $is2 = '<a oncontextmenu="top.addTo(\'' . $pl['id'] . '\',\'item\'); return false;" class="inv_name" href="https://new-combats.com/item/' . $pl['item_id'] . '" target="_blank">' . $pl['name'] . '' . $mx . '</a>';
                 $is2 .= '&nbsp;&nbsp;';
                 if ($pl['massa'] > 0) {
-                    $is2 .= ' (�����: ' . ($pl['massa'] * $col) . ')';
+                    $is2 .= ' (Масса: ' . ($pl['massa'] * $col) . ')';
                 }
                 if ($pl['gift'] != '') {
                     $ttl = '';
                     if ($pl['gift'] == 1) {
-                        $ttl = '�� �� ������ �������� ���� ������� ����-����';
+                        $ttl = 'Вы не можете передать этот предмет кому-либо';
                     } else {
-                        $ttl = '���� ������� ��� ������� ' . $pl['gift'] . '. �� �� ������� �������� ���� ������� ����-���� ���';
+                        $ttl = 'Этот предмет вам подарил ' . $pl['gift'] . '. Вы не сможете передать этот предмет кому-либо еще';
                     }
                     $is2 .= ' <img title="' . $ttl . '" src="https://img.new-combats.com/i/podarok.gif">';
                 }
 
                 if (isset($po['art'])) {
-                    $is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
+                    $is2 .= ' <img title="Артефакт" src="https://img.new-combats.com/i/artefact.gif">';
                 }
 
                 if (isset($po['sudba'])) {
                     if ($po['sudba'] == '0') {
-                        $is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
+                        $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто наденет его. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/destiny0.gif">';
                     } elseif ($po['sudba'] == '1') {
-                        $is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
+                        $is2 .= ' <img title="Этот предмет будет связан общей судьбой с первым, кто возьмет предмет. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/destiny0.gif">';
                     } else {
-                        $is2 .= ' <img title="���� ������� ������ ����� ������� � ' . $po['sudba'] . '. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
+                        $is2 .= ' <img title="Этот предмет связан общей судьбой с ' . $po['sudba'] . '. Никто другой не сможет его использовать." src="https://img.new-combats.com/i/desteny.gif">';
                     }
                 }
-                if ($pl['price1'] > 0) { //����
+                if ($pl['price1'] > 0) { //цена
                     $pex = explode('.', $pl['price1']);
                     if ($pex[1] == '00') {
                         $pl['price1'] = $pex[0];
                     }
                     if ($_GET['toRent'] == 2) {
-                        $is2 .= '<br><strong>����: ' . ($pl['price1']) . ' ��.</strong>';
+                        $is2 .= '<br><strong>Цена: ' . ($pl['price1']) . ' кр.</strong>';
                     } else {
-                        $is2 .= '<br><strong>����: ' . ($pl['price1'] * $col) . ' ��.</strong>';
+                        $is2 .= '<br><strong>Цена: ' . ($pl['price1'] * $col) . ' кр.</strong>';
                     }
                 }
                 if ($pl['pricerep'] > 0) {
-                    $is2 .= ' <small><strong>(' . round($pl['pricerep'] * $col, 2) . ' ��������������)</strong></small>';
+                    $is2 .= ' <small><strong>(' . round($pl['pricerep'] * $col, 2) . ' Воинственности)</strong></small>';
                 }
-                if ($pl['iznosMAX'] > 0) { //�������������
+                if ($pl['iznosMAX'] > 0) { //долговечность
                     $izcol = '';
                     if (floor($pl['iznosNOW']) >= (floor($pl['iznosMAX']) - ceil($pl['iznosMAX']) / 100 * 20)) {
                         $izcol = 'brown';
                     }
                     if ($pl['iznosMAXi'] == 999999999) {
-                        $is2 .= '<br>�������������: <font color="brown">�����������</font >';
+                        $is2 .= '<br>Долговечность: <font color="brown">неразрушимо</font >';
                     } else {
-                        $is2 .= '<br>�������������: <font color="' . $izcol . '">' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . '</font>';
+                        $is2 .= '<br>Долговечность: <font color="' . $izcol . '">' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']) . '</font>';
                     }
                 }
                 if ($po['battleUseZd'] > 0) {
-                    $is2 .= '<br>�������� �������������: ' . $this->timeOut($po['battleUseZd']) . '';
+                    $is2 .= '<br>Задержка использования: ' . $this->timeOut($po['battleUseZd']) . '';
                 }
                 if (isset($po['srok']) && $po['srok'] > 0) {
                     $pl['srok'] = $po['srok'];
                 }
-                if ($pl['srok'] > 0) { //���� �������� ��������
-                    $is2 .= '<br>���� ��������: ' . $this->timeOut($pl['srok']) . ' (�� ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')';
+                if ($pl['srok'] > 0) { //Срок годности предмета
+                    $is2 .= '<br>Срок годности: ' . $this->timeOut($pl['srok']) . ' (до ' . date('d.m.Y H:i', $pl['time_create'] + $pl['srok']) . ')';
                 }
                 if ($pl['magic_chance'] > 0) {
-                    $is2 .= '<br>����������� ������������: ' . min([$pl['magic_chance'], 100]) . '%';
+                    $is2 .= '<br>Вероятность срабатывания: ' . min([$pl['magic_chance'], 100]) . '%';
                 }
-                if ((int)$pl['magic_inci'] > 0) { //����������������� �������� �����:
+                if ((int)$pl['magic_inci'] > 0) { //Продолжительность действия магии:
                     $efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "' . ((int)$pl['magic_inci']) . '" LIMIT 1'));
                     if (isset($efi['id2']) && $efi['actionTime'] > 0) {
-                        $is2 .= '<br>����������������� ��������: ' . $this->timeOut($efi['actionTime']);
+                        $is2 .= '<br>Продолжительность действия: ' . $this->timeOut($efi['actionTime']);
                     }
                 }
 
@@ -6920,7 +6409,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 if (isset($po['sudba']) && $po['sudba'] != '0' && $po['sudba'] != $this->info['login']) {
                     $notr++;
                 }
-                //<strong>��������� �����������:</strong>
+                //<strong>Требуется минимальное:</strong>
                 $tr = '';
                 $t = $this->items['tr'];
                 $x = 0;
@@ -6963,7 +6452,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 $notr++;
                             }
                         }
-                        $tr .= '<br />� ';
+                        $tr .= '<br />• ';
                         if ($n == 'rep') {
                             $temp = explode('::', $po['tr_' . $n]);
                             $tr .= $this->is[$n] . ' ' . ucfirst(str_replace('city', ' city', $temp[1])) . ': ' . $temp[0];
@@ -6971,9 +6460,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         } elseif ($n != 'align' && $n != 'align_bs') {
                             if ($n == 'sex') {
                                 if ($po['tr_' . $n] == 1) {
-                                    $tr .= $this->is[$n] . ': �������';
+                                    $tr .= $this->is[$n] . ': Женский';
                                 } else {
-                                    $tr .= $this->is[$n] . ': �������';
+                                    $tr .= $this->is[$n] . ': Мужской';
                                 }
                             } else {
                                 $tr .= $this->is[$n] . ': ' . $po['tr_' . $n];
@@ -6996,19 +6485,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $x++;
                 }
                 if ($tr != '') {
-                    $is2 .= '<br><strong>��������� �����������:</strong>' . $tr;
+                    $is2 .= '<br><strong>Требуется минимальное:</strong>' . $tr;
                 }
-                //<strong>��������� ��:</strong>
+                //<strong>Действует на:</strong>
                 $tr = '';
                 $t = $this->items['add'];
                 if (isset($po['mf_stats']) && $po['mf_stats'] > 0) {
-                    $tr .= '<br>��������� ��������������: ' . $po['mf_stats'];
+                    $tr .= '<br>Свободные характеристики: ' . $po['mf_stats'];
                 }
                 if (isset($po['mf_mod']) && $po['mf_mod'] > 0) {
-                    $tr .= '<br>��������� ������������: ' . $po['mf_mod'];
+                    $tr .= '<br>Свободные модификаторы: ' . $po['mf_mod'];
                 }
                 if (isset($po['mf_mib']) && $po['mf_mib'] > 0) {
-                    $tr .= '<br>��������� ��������� �����: ' . $po['mf_mib'];
+                    $tr .= '<br>Свободные улучшения брони: ' . $po['mf_mib'];
                 }
 
                 $x = 0;
@@ -7019,7 +6508,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         if ($po['add_' . $n] < 0) {
                             $z = '';
                         }
-                        $tr .= '<br>� ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n];
+                        $tr .= '<br>• ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n];
                         if (isset($po['mf_stats']) && $po['mf_stats'] > 0) {
                             if ($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5') {
                                 $tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=' . $n . '"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
@@ -7033,9 +6522,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $x++;
                 }
-                //��������� �� (�����)
+                //действует на (броня)
                 $i = 1;
-                $bn = [1 => '������', 2 => '�������', 3 => '�����', 4 => '���'];
+                $bn = [1 => 'головы', 2 => 'корпуса', 3 => 'пояса', 4 => 'ног'];
                 while ($i <= 4) {
                     if (isset($po['add_mab' . $i])) {
                         if ($po['add_mab' . $i] == $po['add_mib' . $i] && $pl['geniration'] == 1) {
@@ -7043,9 +6532,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             if ($po['add_mab' . $i] < 0) {
                                 $z = '';
                             }
-                            $tr .= '<br>� ����� ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i];
+                            $tr .= '<br>• Броня ' . $bn[$i] . ': ' . $z . '' . $po['add_mab' . $i];
                         } else {
-                            $tr .= '<br>� ����� ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i];
+                            $tr .= '<br>• Броня ' . $bn[$i] . ': ' . $po['add_mib' . $i] . '-' . $po['add_mab' . $i];
                         }
                         if (isset($po['mf_mib']) && $po['mf_mib'] > 0) {
                             $tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=mib' . $i . '"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
@@ -7055,13 +6544,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 if ($tr != '') {
-                    $is2 .= '<br><strong>��������� ��:</strong>' . $tr;
+                    $is2 .= '<br><strong>Действует на:</strong>' . $tr;
                 }
-                //<strong>�������� ��������:</strong>
+                //<strong>Свойства предмета:</strong>
                 $tr = '';
                 $t = $this->items['sv'];
                 if (isset($po['sv_yron_min'], $po['sv_yron_max'])) {
-                    $tr .= '<br>� ����: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max'];
+                    $tr .= '<br>• Урон: ' . $po['sv_yron_min'] . ' - ' . $po['sv_yron_max'];
                 }
                 $x = 0;
                 while ($x < count($t)) {
@@ -7071,18 +6560,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         if ($po['sv_' . $n] < 0) {
                             $z = '';
                         }
-                        $tr .= '<br>� ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n];
+                        $tr .= '<br>• ' . $this->is[$n] . ': ' . $z . '' . $po['sv_' . $n];
                     }
                     $x++;
                 }
                 if ($pl['2too'] == 1) {
-                    $tr .= '<br>� ������ ������';
+                    $tr .= '<br>• Второе оружие';
                 }
                 if ($pl['2h'] == 1) {
-                    $tr .= '<br>� ��������� ������';
+                    $tr .= '<br>• Двуручное оружие';
                 }
                 if (isset($po['zonb'])) {
-                    $tr .= '<br>� ���� ������������: ';
+                    $tr .= '<br>• Зоны блокирования: ';
                     if ($po['zonb'] > 0) {
                         $x = 1;
                         while ($x <= $po['zonb']) {
@@ -7090,69 +6579,69 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $x++;
                         }
                     } else {
-                        $tr .= '�';
+                        $tr .= '—';
                     }
                 }
                 if ($tr != '') {
-                    $is2 .= '<br><strong>�������� ��������:</strong>' . $tr;
+                    $is2 .= '<br><strong>Свойства предмета:</strong>' . $tr;
                 }
 
-                //�����������
+                //Особенности
                 /*$tr = '';
 				$x = 1;
 				while($x<=4){
 					if(isset($po['tya'.$x]) && $po['tya'.$x]>0){
-						$tyc = '�������� �����';
+						$tyc = 'Ничтожно редки';
 						if($po['tya'.$x]>6){
-							$tyc = '�����';
+							$tyc = 'Редки';
 						}
 						if($po['tya'.$x]>14){
-							$tyc = '����';
+							$tyc = 'Малы';
 						}
 						if($po['tya'.$x]>34){
-							$tyc = '���������';
+							$tyc = 'Временами';
 						}
 						if($po['tya'.$x]>79){
-							$tyc = '���������';
+							$tyc = 'Регулярны';
 						}
 						if($po['tya'.$x]>89){
-							$tyc = '�����';
+							$tyc = 'Часты';
 						}
 						if($po['tya'.$x]>=100){
-							$tyc = '������';
+							$tyc = 'Всегда';
 						}
-						$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
+						$tr .= '<br>• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
 					}
 					$x++;
 				}
 				$x = 1;
 				while($x<=7){
 					if(isset($po['tym'.$x]) && $po['tym'.$x]>0){
-						$tyc = '�������� �����';
+						$tyc = 'Ничтожно редки';
 						if($po['tym'.$x]>6){
-							$tyc = '�����';
+							$tyc = 'Редки';
 						}
 						if($po['tym'.$x]>14){
-							$tyc = '����';
+							$tyc = 'Малы';
 						}
 						if($po['tym'.$x]>34){
-							$tyc = '���������';
+							$tyc = 'Временами';
 						}
 						if($po['tym'.$x]>79){
-							$tyc = '���������';
+							$tyc = 'Регулярны';
 						}
 						if($po['tym'.$x]>89){
-							$tyc = '�����';
+							$tyc = 'Часты';
 						}
 						if($po['tym'.$x]>=100){
-							$tyc = '������';
+							$tyc = 'Всегда';
 						}
-						$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
+						$tr .= '<br>• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
 					}
 					$x++;
 				}
 				if($tr!=''){
-					$is2 .= '<br><strong>�����������:</strong>'.$tr;
+					$is2 .= '<br><strong>Особенности:</strong>'.$tr;
 				}*/
                 if ($notr == 0) {
                     $d[0] = 1;
@@ -7167,34 +6656,34 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $d[0] = 0;
                     $d[2] = 0;
                 }
-                //�������� �����
+                //Апгрейды вещей
                 $tr = '';
-                //���������� �����
+                //Встроенная магия
                 if ($pl['magic_inci'] != '' || $pl['magic_inc'] != '') {
                     if ($pl['magic_inc'] == '') {
                         $pl['magic_inc'] = $pl['magic_inci'];
                     }
                     $mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $pl['magic_inc'] . '" AND `type1` = "12345" LIMIT 1'));
                     if (isset($mgi['id2'])) {
-                        $is2 .= '<div> �������� �������� <img height=18 title="' . $mgi['mname'] . '" src="https://img.new-combats.com/i/eff/' . $mgi['img'] . '"> ' . $mgi['minfo'] . '</div>';
+                        $is2 .= '<div> Встроено заклятие <img height=18 title="' . $mgi['mname'] . '" src="https://img.new-combats.com/i/eff/' . $mgi['img'] . '"> ' . $mgi['minfo'] . '</div>';
                     }
                 }
 
                 if (isset($po['rune']) && $po['rune'] > 0) {
                     $rnc = explode(' ', $po['rune_name']);
-                    if ($rnc[0] == '�����') {
+                    if ($rnc[0] == 'Игнис') {
                         $rnc = '#9b5d40';
-                    } elseif ($rnc[0] == '����') {
+                    } elseif ($rnc[0] == 'Аква') {
                         $rnc = '#3a2b64';
-                    } elseif ($rnc[0] == '����') {
+                    } elseif ($rnc[0] == 'Аура') {
                         $rnc = '#20a3b0';
-                    } elseif ($rnc[0] == '����') {
+                    } elseif ($rnc[0] == 'Тера') {
                         $rnc = '#4c7718';
                     } else {
                         $rnc = '#4c4c4c';
                     }
 
-                    $tr .= '<br>&bull; ���������� ����: <small><font color=green>&bull; <u><strong>' . $po['rune_name'] . '</strong></u></font></small>';
+                    $tr .= '<br>&bull; Встроенная руна: <small><font color=green>&bull; <u><strong>' . $po['rune_name'] . '</strong></u></font></small>';
                     unset($rnc);
                 }
 
@@ -7211,12 +6700,12 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     } else {
                         $rnc = '#d99800';
                     }
-                    $po['spell_name'] = str_replace('���������� ', '', $po['spell_name']);
-                    $this->is['mab1'] = '����� ������';
-                    $this->is['mab2'] = '����� �������';
-                    $this->is['mab3'] = '����� �����';
-                    $this->is['mab4'] = '����� ���';
-                    $tr .= '<br>&bull; ��������� �����������: <small><font color=' . $rnc . '><u><strong>' . $po['spell_name'] . '</strong></u> (' . $this->is[$po['spell_st_name']] . ': +' . $po['spell_st_val'] . ')</font></small>';
+                    $po['spell_name'] = str_replace('Зачаровать ', '', $po['spell_name']);
+                    $this->is['mab1'] = 'Броня головы';
+                    $this->is['mab2'] = 'Броня корпуса';
+                    $this->is['mab3'] = 'Броня пояса';
+                    $this->is['mab4'] = 'Броня ног';
+                    $tr .= '<br>&bull; Встроенно зачарование: <small><font color=' . $rnc . '><u><strong>' . $po['spell_name'] . '</strong></u> (' . $this->is[$po['spell_st_name']] . ': +' . $po['spell_st_val'] . ')</font></small>';
                     unset($this->is['mab1'], $this->is['mab2'], $this->is['mab3'], $this->is['mab4']);
                     unset($rnc);
                 }
@@ -7233,60 +6722,60 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     } else {
                         $rnc = '#282828';
                     }
-                    $po['imposed_name'] = str_replace('���� ', '', $po['imposed_name']);
-                    $tr .= '<br>&bull; <font color=' . $rnc . '>�������� ��������:</font> ' . $po['imposed_name'] . ' ';
+                    $po['imposed_name'] = str_replace('Чары ', '', $po['imposed_name']);
+                    $tr .= '<br>&bull; <font color=' . $rnc . '>Наложены заклятия:</font> ' . $po['imposed_name'] . ' ';
                     unset($rnc);
                 }
                 if ($tr != '') {
-                    $is2 .= '<br><strong>��������� ��������:</strong>';
+                    $is2 .= '<br><strong>Улучшения предмета:</strong>';
                     $is2 .= $tr;
                 }
 
                 /*
 				if($pl['lvl_itm']>0) {
-					$is2 .= '<br><strong>������� ��������</strong>: ['.$pl['blvl'].'/100]';
+					$is2 .= '<br><strong>Уровень развития</strong>: ['.$pl['blvl'].'/100]';
 				}
 
 				if($pl['so']>0) {
-					$is2 .= '<br>&bull; ���� �������� ��������:';
+					$is2 .= '<br>&bull; Очки развития предмета:';
 
 					$is2 .= '<div style="margin-left:20px;"><small>
 
-����: '.(0+$po['add_s1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s1']).' ��</strong></small>
-<br>��������: '.$po['add_s2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s2']).' ��</strong></small>
-<br>��������: '.$po['add_s3'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s3']).' ��</strong></small>
-<br>���������: '.$po['add_s5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s5']).' ��</strong></small>
+Сила: '.(0+$po['add_s1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s1']).' ОР</strong></small>
+<br>Ловкость: '.$po['add_s2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s2']).' ОР</strong></small>
+<br>Интуиция: '.$po['add_s3'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s3']).' ОР</strong></small>
+<br>Интеллект: '.$po['add_s5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s5']).' ОР</strong></small>
 
-<br>��. ����. �����: '.$po['add_m1'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m1']).' ��</strong></small>
-<br>��. ������ ����. �����: '.$po['add_m2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m2']).' ��</strong></small>
-<br>��. �����������: '.$po['add_m4'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m4']).' ��</strong></small>
-<br>��. ������ �����������: '.$po['add_m5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=4"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m5']).' ��</strong></small>
+<br>Мф. крит. удара: '.$po['add_m1'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m1']).' ОР</strong></small>
+<br>Мф. против крит. удара: '.$po['add_m2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m2']).' ОР</strong></small>
+<br>Мф. увертывания: '.$po['add_m4'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m4']).' ОР</strong></small>
+<br>Мф. против увертывания: '.$po['add_m5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=4"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m5']).' ОР</strong></small>
 
-<br>����� ������: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab1']).' ��</strong></small>
-<br>����� ������: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=6"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab2']).' ��</strong></small>
-<br>����� ������: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=7"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab3']).' ��</strong></small>
-<br>����� ������: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=8"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab4']).' ��</strong></small>
+<br>Броня головы: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab1']).' ОР</strong></small>
+<br>Броня головы: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=6"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab2']).' ОР</strong></small>
+<br>Броня головы: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=7"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab3']).' ОР</strong></small>
+<br>Броня головы: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=8"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab4']).' ОР</strong></small>
 
-<br>�������� �����: '.$po['add_m10'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=9"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(4+4*$po['add_m10']).' ��</strong></small>
-<br>�������� �����: '.$po['add_m11a'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=11"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_m11a']).' ��</strong></small>
+<br>Мощность урона: '.$po['add_m10'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=9"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(4+4*$po['add_m10']).' ОР</strong></small>
+<br>Мощность магии: '.$po['add_m11a'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=11"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_m11a']).' ОР</strong></small>
 
-<br>������ �� �����: '.$po['add_za'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=10"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_za']).' ��</strong></small>
-<br>������ �� �����: '.$po['add_zm'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=12"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(4+4*$po['add_zm']).' ��</strong></small>
+<br>Защита от урона: '.$po['add_za'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=10"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_za']).' ОР</strong></small>
+<br>Защита от магии: '.$po['add_zm'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=12"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(4+4*$po['add_zm']).' ОР</strong></small>
 
 </small></div>';
 
-					$is2 .= '&bull; �������� ����� ��������: '.$pl['so'].'';
+					$is2 .= '&bull; Осталось очков развития: '.$pl['so'].'';
 				}
 				*/
 
                 if (isset($po['free_stats']) && $po['free_stats'] > 0) {
-                    $is2 .= '<br><strong>������������� ������:</strong>';
-                    $is2 .= '<div style="margin-left:20px;"><small>����: ' . $po['add_s1'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>��������: ' . $po['add_s2'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>��������: ' . $po['add_s3'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>���������: ' . $po['add_s5'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=5"><img src="https://img.new-combats.com/i/plus.gif"></a></small></div>';
-                    $is2 .= '&bull; �������� �������������: ' . $po['free_stats'] . '';
+                    $is2 .= '<br><strong>Распределение статов:</strong>';
+                    $is2 .= '<div style="margin-left:20px;"><small>Сила: ' . $po['add_s1'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>Ловкость: ' . $po['add_s2'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>Интуиция: ' . $po['add_s3'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>Интеллект: ' . $po['add_s5'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=5"><img src="https://img.new-combats.com/i/plus.gif"></a></small></div>';
+                    $is2 .= '&bull; Осталось распределений: ' . $po['free_stats'] . '';
                 }
 
                 if (isset($po['sm_abil'])) {
-                    //�������� ��������� � ������������ �����
+                    //Возможно сохранять и распределять скилы
                     $mx2 = 1;
                     $mx1 = 0;
                     $mx3 = $this->lookStats($this->info['stats']);
@@ -7296,27 +6785,27 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $mx1 += $this->info['ability'];
                     if ($mx1 > 0) {
-                        $is2 .= '<br><strong>������������� �������������:</strong>';
+                        $is2 .= '<br><strong>Распределение характеристик:</strong>';
                         if (isset($po['sudba']) && $po['sudba'] == '0') {
                             $mx1 = 0;
-                            $is2 .= '<div style="margin-left:20px;"><small>&bull; ������������� ������������� ����� �������� ����� ������� ��������</small></div>';
+                            $is2 .= '<div style="margin-left:20px;"><small>&bull; Распределение характеристик будет доступно после первого одевания</small></div>';
                         } else {
                             $is2 .= '<div style="margin-left:20px;"><small>
-							����: ' . (0 + $po['add_s1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: ' . (0 + $po['add_s2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: ' . (0 + $po['add_s3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							������������: ' . (0 + $po['add_s4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������: ' . (0 + $po['add_s5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: ' . (0 + $po['add_s6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Сила: ' . (0 + $po['add_s1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Ловкость: ' . (0 + $po['add_s2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Интуиция: ' . (0 + $po['add_s3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Выносливость: ' . (0 + $po['add_s4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Интеллект: ' . (0 + $po['add_s5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мудрость: ' . (0 + $po['add_s6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsmst=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
 							</small></div>';
-                            $is2 .= '�������� �������������: ' . $mx1;
+                            $is2 .= 'Осталось распределений: ' . $mx1;
                         }
                     }
                     unset($mx1, $mx2, $mx3);
                 }
 
                 if (isset($po['sm_skill'])) {
-                    //�������� ��������� � ������������ �����
+                    //Возможно сохранять и распределять скилы
                     $mx2 = 1;
                     $mx1 = 0;
                     $mx3 = $this->lookStats($this->info['stats']);
@@ -7326,42 +6815,42 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $mx1 += $this->info['skills'];
                     if ($mx1 > 0) {
-                        $is2 .= '<br><strong>������������� �������� ������� � ������:</strong>';
+                        $is2 .= '<br><strong>Распределение владений оружием и магией:</strong>';
                         if (isset($po['sudba']) && $po['sudba'] == '0') {
                             $mx1 = 0;
-                            $is2 .= '<div style="margin-left:20px;"><small>&bull; ������������� �������� ����� �������� ����� ������� ��������</small></div>';
+                            $is2 .= '<div style="margin-left:20px;"><small>&bull; Распределение владений будет доступно после первого одевания</small></div>';
                         } else {
                             $is2 .= '<div style="margin-left:20px;"><small>
-							���������� �������� ������: ' . (0 + $po['add_a1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ��������, ��������: ' . (0 + $po['add_a2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������, ���������: ' . (0 + $po['add_a3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ��������, ��������: ' . (0 + $po['add_a4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ����������� ��������: ' . (0 + $po['add_a5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� ����: ' . (0 + $po['add_mg1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� �������: ' . (0 + $po['add_mg2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=7"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� ����: ' . (0 + $po['add_mg3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=8"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� �����: ' . (0 + $po['add_mg4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=9"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������ �����: ' . (0 + $po['add_mg5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=10"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������ ����: ' . (0 + $po['add_mg6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=11"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ����� ������: ' . (0 + $po['add_mg7']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=12"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения мечами: ' . (0 + $po['add_a1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения дубинами, булавами: ' . (0 + $po['add_a2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения ножами, кастетами: ' . (0 + $po['add_a3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения топорами, секирами: ' . (0 + $po['add_a4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения магическими посохами: ' . (0 + $po['add_a5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения стихией Огня: ' . (0 + $po['add_mg1']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения стихией Воздуха: ' . (0 + $po['add_mg2']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=7"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения стихией Воды: ' . (0 + $po['add_mg3']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=8"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения стихией Земли: ' . (0 + $po['add_mg4']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=9"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения магией Света: ' . (0 + $po['add_mg5']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=10"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения магией Тьмы: ' . (0 + $po['add_mg6']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=11"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
+							Мастерство владения серой магией: ' . (0 + $po['add_mg7']) . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufsms=12"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
 							</small></div>';
-                            $is2 .= '�������� �������������: ' . $mx1;
+                            $is2 .= 'Осталось распределений: ' . $mx1;
                         }
                     }
                     unset($mx1, $mx2, $mx3);
                 }
 
                 if (isset($po['complect']) || isset($po['complect2'])) {
-                    $is2 .= '<br><i>�������������� ����������:</i>';
+                    $is2 .= '<br><i>Дополнительная информация:</i>';
                 }
                 if (isset($po['complect'])) {
-                    //�� ������������
-                    $com1 = ['name' => '����������� ��������', 'x' => 0, 'text' => ''];
+                    //не отображается
+                    $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => ''];
                     $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect'] . '" ORDER BY  `x` ASC LIMIT 20');
                     while ($plc = mysql_fetch_array($spc)) {
                         $com1['name'] = $plc['name'];
                         $com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">' . $plc['x'] . '</font>: ';
-                        //�������� ���������
+                        //действие комплекта
                         $i1c = 0;
                         $i2c = 0;
                         $i1e = $this->lookStats($plc['data']);
@@ -7384,18 +6873,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         unset($i1c, $i2c, $i3c);
                         $com1['x']++;
                     }
-                    $is2 .= '<br>&bull; ����� ���������: <strong>' . $com1['name'] . '</strong><br><small>';
+                    $is2 .= '<br>&bull; Часть комплекта: <strong>' . $com1['name'] . '</strong><br><small>';
                     $is2 .= $com1['text'];
                     $is2 .= '</small>';
                 }
                 if (isset($po['complect2'])) {
-                    //�� ������������
-                    $com1 = ['name' => '����������� ��������', 'x' => 0, 'text' => ''];
+                    //не отображается
+                    $com1 = ['name' => 'Неизвестный Комплект', 'x' => 0, 'text' => ''];
                     $spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . $po['complect2'] . '" ORDER BY  `x` ASC LIMIT 20');
                     while ($plc = mysql_fetch_array($spc)) {
                         $com1['name'] = $plc['name'];
                         $com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">' . $plc['x'] . '</font>: ';
-                        //�������� ���������
+                        //действие комплекта
                         $i1c = 0;
                         $i2c = 0;
                         $i1e = $this->lookStats($plc['data']);
@@ -7418,13 +6907,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         unset($i1c, $i2c, $i3c);
                         $com1['x']++;
                     }
-                    $is2 .= '<br>&bull; ����� ��������� (��������): <strong>' . $com1['name'] . '</strong><br><small>';
+                    $is2 .= '<br>&bull; Часть комплекта (подгонка): <strong>' . $com1['name'] . '</strong><br><small>';
                     $is2 .= $com1['text'];
                     $is2 .= '</small>';
                 }
 
                 if ($pl['max_text'] > 0) {
-                    //���������
+                    //Инвентарь
                     $sm_sp = mysql_query('SELECT `id`,`item_id`,`time`,`login`,`type`,`text`,`city`,`x` FROM `items_text` WHERE `item_id` = "' . $pl['id'] . '" ORDER BY `id` ASC  LIMIT 500');
                     $sma = 0;
                     $smt = '';
@@ -7443,10 +6932,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $smt .= '</div>';
                     if ($pl['max_text'] - $pl['use_text'] > 0) {
-                        $is2 .= '<div>���������� ��������: ' . ($pl['max_text'] - $pl['use_text']) . '</div>';
+                        $is2 .= '<div>Количество символов: ' . ($pl['max_text'] - $pl['use_text']) . '</div>';
                     }
                     if ($sma > 0) {
-                        $is2 .= '<div>�� �������� ������� �����:<br>
+                        $is2 .= '<div>На предмете записан текст:<br>
 								<table width="100%" border="0" cellspacing="0" cellpadding="0">
 								  <tr>
 									<td><div style="background-color:#e8e8e8;padding:5px;"><CODE>' . $smt . '</CODE></div></td>
@@ -7457,7 +6946,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     unset($sm_sp, $sma, $sm_pl);
                 } elseif (isset($po['onitm_text'])) {
-                    $is2 .= '<div>�� �������� ������� �����:<br>
+                    $is2 .= '<div>На предмете записан текст:<br>
 						<table width="100%" border="0" cellspacing="0" cellpadding="0">
 							<tr>
 								<td><div style="background-color:#e8e8e8;padding:5px;"><CODE>' . $po['onitm_text'] . '</CODE></div></td>
@@ -7467,13 +6956,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 if (isset($po['gravi'])) {
-                    $is2 .= '<br>�� ����������� ������������� �������: <strong>' . $po['gravi'] . '</strong>';
+                    $is2 .= '<br>На поверхности выгравирована надпись: <strong>' . $po['gravi'] . '</strong>';
                 }
 
                 $is2 .= '<small style="">';
 
                 if ($pl['info'] != '') {
-                    $is2 .= '<div><strong>������������:</strong></div><div>' . $pl['info'] . '</div>';
+                    $is2 .= '<div><strong>Рекомендации:</strong></div><div>' . $pl['info'] . '</div>';
                 }
 
                 if (isset($po['info']) && $po['info'] != '') {
@@ -7481,17 +6970,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 if ($pl['maidin'] != '') {
-                    //$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
+                    //$is2 .= '<div>Сделано в '.$this->city_name[$pl['maidin']].'</div>';
                 }
 
                 if (isset($po['toclan'])) {
                     $po['toclan1'] = explode('#', $po['toclan']);
                     $clpo = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $po['toclan1'][0] . '" LIMIT 1'));
                     if (isset($clpo['id'])) {
-                        $is2 .= '<div style="color:brown;">������� ����������� ����� <img style="vertical-align:bottom" src="https://img.new-combats.com/i/clan/' . $clpo['name_mini'] . '.gif" width="24" height"15"> <strong>' . $clpo['name'] . '</strong>';
+                        $is2 .= '<div style="color:brown;">Предмет принадлежит клану <img style="vertical-align:bottom" src="https://img.new-combats.com/i/clan/' . $clpo['name_mini'] . '.gif" width="24" height"15"> <strong>' . $clpo['name'] . '</strong>';
                         $plpo = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . $po['toclan1'][1] . '" LIMIT 1'));
                         if (isset($plpo['id'])) {
-                            $is2 .= ' <font color=grey>(��� ������ <strong>' . $plpo['login'] . '</strong><a href="info/' . $plpo['id'] . '" target="_blank"><img src="https://img.new-combats.com/i/inf_' . $plpo['cityreg'] . '.gif" width="9"></a>)</font>';
+                            $is2 .= ' <font color=grey>(Дар игрока <strong>' . $plpo['login'] . '</strong><a href="info/' . $plpo['id'] . '" target="_blank"><img src="https://img.new-combats.com/i/inf_' . $plpo['cityreg'] . '.gif" width="9"></a>)</font>';
                             if ($plpo['login'] == $this->info['login']) {
                                 if (isset($_GET['backmyitm'])) {
                                     $pl['inOdet'] = 0;
@@ -7500,33 +6989,33 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                     $pl['data'] = $this->impStats($po);
                                     mysql_query('UPDATE `items_users` SET `data` = "' . mysql_real_escape_string($pl['data']) . '",`inOdet` = 0,`uid` = "' . $pl['uid'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
                                 }
-                                $is2 .= '<br>(�� �������� ��������: <a href="main.php?clan&deposit&backmyitm=' . $pl['id'] . '">������� ������� ����</a>)';
+                                $is2 .= '<br>(Вы владелец предмета: <a href="main.php?clan&deposit&backmyitm=' . $pl['id'] . '">Вернуть предмет себе</a>)';
                             }
                         }
                         $is2 .= '</div>';
                     }
                 }
                 if (isset($po['noremont'])) {
-                    $is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет не подлежит ремонту</div>';
                 }
                 if (isset($po['nosale'])) {
-                    $is2 .= '<div style="color:brown;">������� ������ �������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет нельзя продать</div>';
                 }
                 if (isset($po['nomodif'])) {
-                    $is2 .= '<div style="color:brown;">������� ������ ��������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет нельзя улучшать</div>';
                 }
                 if (isset($po['nodelete'])) {
-                    $is2 .= '<div style="color:brown;">������� ������ ���������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет нельзя выбросить</div>';
                 }
                 if (isset($po['frompisher'])) {
-                    $is2 .= '<div style="color:brown;">������� �� ����������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет из подземелья</div>';
                 }
                 if (isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
+                    $is2 .= '<div style="color:brown;">Предмет не портится во время сна</div>';
                 }
 
                 if (isset($po['fromlaba']) && $po['fromlaba'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� �� ���������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет из лабиринта</div>';
                 }
 
                 if (isset($po['vip_sale']) && $po['vip_sale'] > 0) {
@@ -7535,28 +7024,28 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $pl['time_create'] = $this->stats['slvtm'];
                             mysql_query('UPDATE `items_users` SET `time_create` = "' . $pl['time_create'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
                         }
-                        $is2 .= '<div style="color:brown;">������� ����� ���������� ����� ' . $this->timeOut($pl['time_create'] - time()) . '</div>';
-                        //$is2 .= '<div style="color:brown;">������� �������� ����� '.$this->timeOut($pl['time_create']-time()+86400*30).'</div>';
+                        $is2 .= '<div style="color:brown;">Предмет будет недоступен через ' . $this->timeOut($pl['time_create'] - time()) . '</div>';
+                        //$is2 .= '<div style="color:brown;">Предмет исчезнет через '.$this->timeOut($pl['time_create']-time()+86400*30).'</div>';
                     } else {
-                        $is2 .= '<div style="color:brown;">������� ����������, ����������� ���������� VIP</div>';
+                        $is2 .= '<div style="color:brown;">Предмет недоступен, приобретите конкретный VIP</div>';
                         if (($pl['time_create'] - time() + 86400 * 30) < 1) {
-                            $is2 .= '<div style="color:brown;">������� ���������� � ��� �� ������...</div>';
+                            $is2 .= '<div style="color:brown;">Предмет рассыпался у Вас на глазах...</div>';
                         } else {
-                            $is2 .= '<div style="color:brown;">������� �������� ����� ' . $this->timeOut($pl['time_create'] - time() + 86400 * 30) . '</div>';
+                            $is2 .= '<div style="color:brown;">Предмет исчезнет через ' . $this->timeOut($pl['time_create'] - time() + 86400 * 30) . '</div>';
                         }
                     }
                 }
 
                 if ($pl['dn_delete'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
+                    $is2 .= '<div style="color:brown;">Предмет будет удален при выходе из подземелья</div>';
                 }
 
                 if ($this->pokol > $pl['geni']) {
-                    $is2 .= '<div style="color:brown">������� �������</div>';
+                    $is2 .= '<div style="color:brown">Предмет устарел</div>';
                 }
 
                 if (isset($po['zazuby']) && $po['zazuby'] > 0) {
-                    $is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
+                    $is2 .= '<div style="color:brown;">Предмет куплен за зубы</div>';
                 }
 
                 $is2 .= '</small>';
@@ -7581,18 +7070,18 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                 if ($type == 81) {
 
-                    $is1 .= '<small><a href="main.php?inv=1&otdel=' . floor($_GET['otdel']) . '&use_rune=' . floor($_GET['use_rune']) . '&item_rune=0&item_rune_id=' . $pl['id'] . '">������� ������ �������</a></small>';
+                    $is1 .= '<small><a href="main.php?inv=1&otdel=' . floor($_GET['otdel']) . '&use_rune=' . floor($_GET['use_rune']) . '&item_rune=0&item_rune_id=' . $pl['id'] . '">Выбрать данный предмет</a></small>';
 
 
                 } elseif ($type == 80) {
                     //$this->lookStats($itm['data']); //$pl['id']
                     $itemrun = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` ="' . $pl['id'] . '" LIMIT 1'));
                     $it = $this->lookStats($itemrun['data']);
-                    if (!isset($it['rune_name']) || $_GET['otdel'] == 2) //����� 2(�������)
+                    if (!isset($it['rune_name']) || $_GET['otdel'] == 2) //отдел 2(заточки)
                     {
-                        $is1 .= '<small><a href="main.php?inv=1&otdel=' . floor($_GET['otdel']) . '&use_rune=' . floor($_GET['use_rune']) . '&item_rune=0&item_rune_id=' . $pl['id'] . '">������� ������ �������</a></small>';
+                        $is1 .= '<small><a href="main.php?inv=1&otdel=' . floor($_GET['otdel']) . '&use_rune=' . floor($_GET['use_rune']) . '&item_rune=0&item_rune_id=' . $pl['id'] . '">Выбрать данный предмет</a></small>';
                     } else {
-                        $is1 .= '<small><strong>������������:<br>' . $it['rune_name'] . '</strong></small>';
+                        $is1 .= '<small><strong>Установленна:<br>' . $it['rune_name'] . '</strong></small>';
                     }
                     unset($itemrun, $it);
                 } elseif ($type == 69) {
@@ -7604,61 +7093,61 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
                     $prs1 = $this->floordec($po['hprs'] * $col, 2);
                     $rps1 = $this->floordec($po['hprp'] * $col);
-                    $is1 .= '<small style="font-size:11px;"><a href="?sale1kr=' . $pl['id'] . '">�������� �� ' . $prs1 . ' ��.</a><br><a href="?sale1rep=' . $pl['id'] . '">�������� �� ' . $rps1 . ' ��. ���������</a>';
+                    $is1 .= '<small style="font-size:11px;"><a href="?sale1kr=' . $pl['id'] . '">Обменять на ' . $prs1 . ' кр.</a><br><a href="?sale1rep=' . $pl['id'] . '">Обменять на ' . $rps1 . ' ед. репутации</a>';
                     $is1 .= '</small>';
                 } elseif ($type == 68) {
-                    $is1 .= '<small style="font-size:11px;"><a href="?r=3&itm_take=' . $pl['id'] . '">�������</a><br><a href="?r=3&itm_cancel=' . $pl['id'] . '">����������</a>';
+                    $is1 .= '<small style="font-size:11px;"><a href="?r=3&itm_take=' . $pl['id'] . '">Забрать</a><br><a href="?r=3&itm_cancel=' . $pl['id'] . '">Отказаться</a>';
                     if ($pl['lastUPD'] > 0) {
                         $is1 .= '<br><br>(' . $this->timeOut(($pl['lastUPD'] + 7 * 24 * 60 * 60) - time()) . ')';
                     }
                     $is1 .= '</small>';
                 } elseif ($type == 67) {
-                    $is1 .= '<small style="font-size:11px;"><a href="javascript:void(0)" onclick="itmToUser(' . $pl['id'] . ')">�������� �� ' . (round(1 + $pl['price1'] / 100 * 7) * $col) . ' ��.</a></small>';
+                    $is1 .= '<small style="font-size:11px;"><a href="javascript:void(0)" onclick="itmToUser(' . $pl['id'] . ')">передать за ' . (round(1 + $pl['price1'] / 100 * 7) * $col) . ' кр.</a></small>';
                 } elseif ($type == 66) {
                     $pos = explode('#', $po['toclan']);
                     $us_1 = $pos[1];
                     if ($pl['uid'] < 1) {
-                        $is1 .= '<small style=""><a href="?clan&deposit&take_itm=' . $pl['id'] . '">����� �������</a></small>';
+                        $is1 .= '<small style=""><a href="?clan&deposit&take_itm=' . $pl['id'] . '">Взять предмет</a></small>';
                     } else {
                         $yui = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "' . mysql_real_escape_string($pl['uid']) . '" LIMIT 1'));
-                        $is1 .= '<small>������� � ������<br><strong>' . $yui['login'] . '</strong><a href="info/' . $yui['id'] . '" target="_blank"><img width="10" src="https://img.new-combats.com/i/inf_' . $yui['cityreg'] . '.gif"></a></small>';
+                        $is1 .= '<small>Предмет у игрока<br><strong>' . $yui['login'] . '</strong><a href="info/' . $yui['id'] . '" target="_blank"><img width="10" src="https://img.new-combats.com/i/inf_' . $yui['cityreg'] . '.gif"></a></small>';
                         if ($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) {
-                            $is1 .= '<br><small style=""><a href="?clan&deposit&ungive_itm=' . $pl['id'] . '">������ �������</a></small>';
+                            $is1 .= '<br><small style=""><a href="?clan&deposit&ungive_itm=' . $pl['id'] . '">Изъять предмет</a></small>';
                         }
                     }
                 } elseif ($type == 65) {
                     if (!isset($po['toclan'])) {
-                        $is1 .= '<small style=""><a href="?clan&deposit&give_itm=' . $pl['id'] . '">������������</a></small>';
+                        $is1 .= '<small style=""><a href="?clan&deposit&give_itm=' . $pl['id'] . '">Пожертвовать</a></small>';
                     } else {
-                        $is1 .= '<small style=""><a href="?clan&deposit&give_itm=' . $pl['id'] . '">�������</a></small>';
+                        $is1 .= '<small style=""><a href="?clan&deposit&give_itm=' . $pl['id'] . '">Вернуть</a></small>';
                     }
                 } elseif ($type == 62) {
                     $upgitm = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "' . $pl['item_id'] . '" LIMIT 1'));
                     if (!isset($upgitm['id'])) {
-                        $is1 .= '<small style="">��������� ����������</small>';
+                        $is1 .= '<small style="">Улучшение невозможно</small>';
                     } else {
                         $prcup = '';
                         if ($upgitm['price1'] > 0) {
-                            $prcup .= $upgitm['price1'] . ' ��.';
+                            $prcup .= $upgitm['price1'] . ' кр.';
                         }
                         if ($upgitm['price2'] > 0) {
                             if ($prcup != '') {
-                                $prcup .= ' � ';
+                                $prcup .= ' и ';
                             }
-                            $prcup .= $upgitm['price2'] . ' ���.';
+                            $prcup .= $upgitm['price2'] . ' екр.';
                         }
-                        $is1 .= '<small style=""><a href="?r=8&upgradelvl=' . $pl['id'] . '">�������� �� ' . $prcup . '</a></small>';
+                        $is1 .= '<small style=""><a href="?r=8&upgradelvl=' . $pl['id'] . '">Улучшить за ' . $prcup . '</a></small>';
                         unset($prcup);
                     }
                 } elseif ($type == 63) {
                     $prcup = '';
-                    $is1 .= '<small style=""><a href="?r=9&upgradelvlcom=' . $pl['id'] . '">��������</a></small>';
+                    $is1 .= '<small style=""><a href="?r=9&upgradelvlcom=' . $pl['id'] . '">комплект</a></small>';
                     unset($prcup);
                 } elseif ($type == 64) {
                     $prcup = '';
-                    $is1 .= '<small style=""><a href="?r=9">������� ������ �������</a></small>';
+                    $is1 .= '<small style=""><a href="?r=9">Выбрать другой предмет</a></small>';
                     unset($prcup);
-                } elseif ($type == 61) { //��������� ��������
+                } elseif ($type == 61) { //улучшение предмета
                     if ($pl['price1'] > $pl['1price']) {
                         $pl['1price'] = $pl['price1'];
                     }
@@ -7674,8 +7163,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $prpod = $prpod / 2.37;
                     }
                     $prpod = round($prpod + $prpod / 100 * (37.795 * ($po['upgrade'] + 1)));
-                    $is1 .= '<small style=""><a href="?upgrade=' . $pl['id'] . '&r=6&t=2&rnd=' . $code . '">������� �� ' . $prpod . ' ��.</a></small>';
-                } elseif ($type == 60) { //���������������
+                    $is1 .= '<small style=""><a href="?upgrade=' . $pl['id'] . '&r=6&t=2&rnd=' . $code . '">Усилить за ' . $prpod . ' кр.</a></small>';
+                } elseif ($type == 60) { //модифицирование
                     if ($pl['price1'] > $pl['1price']) {
                         $pl['1price'] = $pl['price1'];
                     }
@@ -7691,24 +7180,24 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $prpod = $prpod / 2;
                     }
                     $prpod = round($prpod);
-                    $is1 .= '<small style=""><a href="?modif=' . $pl['id'] . '&r=7&t=2&rnd=' . $code . '">�������������� �� ' . $prpod . ' ��.</a></small>';
+                    $is1 .= '<small style=""><a href="?modif=' . $pl['id'] . '&r=7&t=2&rnd=' . $code . '">Модифицировать за ' . $prpod . ' кр.</a></small>';
 
-                } elseif ($type == 59) { //�������������
+                } elseif ($type == 59) { //дезинтеграция
                     if ($po['tr_lvl'] > $pl['level']) {
                         $pl['level'] = $po['tr_lvl'];
                     }
                     //$prpod = $pl['level']*200;
                     $prpod = 250;
                     $prpod_ekr = $pl['level'] * 0.25;
-                    //$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������������� �� '.$prpod.' ��.</a></small>';
+                    //$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">Дезинтегрировать за '.$prpod.' кр.</a></small>';
 
                     if ($this->stats['repair_z'] >= 1) {
-                        $is1 .= '<small style=""><a href="?ubeff=' . $pl['id'] . '&r=3&t=2&rnd=' . $code . '">���������� �������������</a></small>';
+                        $is1 .= '<small style=""><a href="?ubeff=' . $pl['id'] . '&r=3&t=2&rnd=' . $code . '">Бесплатная дезинтеграция</a></small>';
                     } else {
-                        $is1 .= '<small style=""><a href="?ubeff=' . $pl['id'] . '&r=3&t=2&rnd=' . $code . '">���������������� �� ' . $prpod . ' ��.</a></small>
-						<!--<br><small style=""><a href="?ubeff_ekr=' . $pl['id'] . '&r=3&t=2&rnd=' . $code . '">���������������� �� ' . $prpod_ekr . ' ���.</a></small>-->';
+                        $is1 .= '<small style=""><a href="?ubeff=' . $pl['id'] . '&r=3&t=2&rnd=' . $code . '">Дезинтегрировать за ' . $prpod . ' Кр.</a></small>
+						<!--<br><small style=""><a href="?ubeff_ekr=' . $pl['id'] . '&r=3&t=2&rnd=' . $code . '">Дезинтегрировать за ' . $prpod_ekr . ' Екр.</a></small>-->';
                     }
-                } elseif ($type == 58) { //������������ ���
+                } elseif ($type == 58) { //вытаскивание рун
                     if ($po['tr_lvl'] > $pl['level']) {
                         $pl['level'] = $po['tr_lvl'];
                     }
@@ -7716,10 +7205,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $prpod = 2500;
                     $prpod_ekr = $pl['level'] * 0.15;
                     if ($this->stats['repair_r'] >= 1) {
-                        $is1 .= '<small style=""><a href="?unrune=' . $pl['id'] . '&r=4&t=2&rnd=' . $code . '">��������� ������� ����</a></small>';
+                        $is1 .= '<small style=""><a href="?unrune=' . $pl['id'] . '&r=4&t=2&rnd=' . $code . '">Бесплатно извлечь руны</a></small>';
                     } else {
-                        $is1 .= '<small style=""><a href="?unrune=' . $pl['id'] . '&r=4&t=2&rnd=' . $code . '">������� ���� �� ' . $prpod . ' ��.</a></small><br>
-						<!--<small style=""><a href="?unrune_ekr=' . $pl['id'] . '&r=4&t=2&rnd=' . $code . '">������� ���� �� ' . $prpod_ekr . ' ���.</a>
+                        $is1 .= '<small style=""><a href="?unrune=' . $pl['id'] . '&r=4&t=2&rnd=' . $code . '">Извлечь руны за ' . $prpod . ' Кр.</a></small><br>
+						<!--<small style=""><a href="?unrune_ekr=' . $pl['id'] . '&r=4&t=2&rnd=' . $code . '">Извлечь руны за ' . $prpod_ekr . ' Екр.</a>
 						</small> -->';
                     }
                 } elseif ($type == 57) {
@@ -7730,19 +7219,19 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $prpod = 15;
                     }
                     if (isset($po['gravi'])) {
-                        $is1 .= '<small style=""><a onclick="top.un_grava(\'' . $pl['id'] . '\',\'' . $pl['name'] . '\',\'' . $prpod . '.00\',\'data\')" href="javascript:void(0)">�������� ������� �� ' . $prpod . ' ��.</a></small>';
+                        $is1 .= '<small style=""><a onclick="top.un_grava(\'' . $pl['id'] . '\',\'' . $pl['name'] . '\',\'' . $prpod . '.00\',\'data\')" href="javascript:void(0)">Изменить надпись за ' . $prpod . ' кр.</a></small>';
                     } else {
-                        $is1 .= '<small style=""><a onclick="top.grava(\'' . $pl['id'] . '\',\'' . $pl['name'] . '\',\'' . $prpod . '.00\',\'data\')" href="javascript:void(0)">������������� ������� �� ' . $prpod . ' ��.</a></small>';
+                        $is1 .= '<small style=""><a onclick="top.grava(\'' . $pl['id'] . '\',\'' . $pl['name'] . '\',\'' . $prpod . '.00\',\'data\')" href="javascript:void(0)">Выгравировать надпись за ' . $prpod . ' кр.</a></small>';
                     }
-                } elseif ($type == 56) { //��������
+                } elseif ($type == 56) { //Подгонка
                     if ($po['tr_lvl'] > $pl['level']) {
                         $pl['level'] = $po['tr_lvl'];
                     }
                     $prpod = 5 * $pl['level'] + 10;
                     $prhp = 6 * $pl['level'] + 6;
-                    $is1 .= '<small style=""><a href="?podgon=' . $pl['id'] . '&r=5&t=2&rnd=' . $code . '">��������� �� ' . $prpod . ' ��.</a></small>';
-                } elseif ($type == 15) { //�������� �����
-                    $is1 .= '<a href="main.php?pet=1&obj_corm=' . $pl['id'] . '&rnd=' . $code . '">�������</a>';
+                    $is1 .= '<small style=""><a href="?podgon=' . $pl['id'] . '&r=5&t=2&rnd=' . $code . '">Подогнать за ' . $prpod . ' кр.</a></small>';
+                } elseif ($type == 15) { //кормушка зверя
+                    $is1 .= '<a href="main.php?pet=1&obj_corm=' . $pl['id'] . '&rnd=' . $code . '">Кормить</a>';
                 } elseif ($type == 11) {
                     $pl['rep'] = 0;
                     if ($this->rep['rep1'] < 100) {
@@ -7771,49 +7260,49 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $pl['rep'] = 2;
                         }
                     }
-                    $is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\'' . $pl['img'] . '\',' . $pl['id'] . ',' . $pl['rep'] . ');">�������</a>';
+                    $is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\'' . $pl['img'] . '\',' . $pl['id'] . ',' . $pl['rep'] . ');">Выбрать</a>';
                 } elseif ($type == 14) {
-                    $is1 .= '<a href="javascript:void(0);" onclick="massTakeItRun(\'' . $pl['img'] . '\',' . $pl['id'] . ',0);">�������</a>';
+                    $is1 .= '<a href="javascript:void(0);" onclick="massTakeItRun(\'' . $pl['img'] . '\',' . $pl['id'] . ',0);">Выбрать</a>';
                 } elseif ($type == 12) {
-                    $is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\'' . $pl['img'] . '\',' . $pl['id'] . ',1);">�������</a>';
+                    $is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\'' . $pl['img'] . '\',' . $pl['id'] . ',1);">Выбрать</a>';
                 } elseif ($type == 10) {
-                    //������ (����������� ��������� � ������ (��� �������))
-                    $is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">� ������</a>';
+                    //Общага (отображение предметов в общаге (под стеклом))
+                    $is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">В рюкзак</a>';
                 } elseif ($type == 9) {
-                    //������ (����������� ��������� � ��������� (��� �������))
-                    $is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">��� ������</a>';
+                    //Общага (отображение предметов в инвентаре (под стеклом))
+                    $is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">Под стекло</a>';
                 } elseif ($type == 8) {
-                    //������ (����������� ��������� � ���������)
-                    $is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">� ������</a>';
+                    //Общага (отображение предметов в инвентаре)
+                    $is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">В сундук</a>';
                 } elseif ($type == 7) {
-                    //������ (����������� ��������� � ������)
-                    $is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">� ������</a>';
+                    //Общага (отображение предметов в общаге)
+                    $is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="' . $code . '" data-room="' . ((int)$_GET['room']) . '" rel="' . $pl['id'] . '">В рюкзак</a>';
                 } elseif ($type == 6) {
-                    //��������� �������
-                    $is1 .= '<a href="main.php?otdel=2&add_item_f=' . $pl['id'] . '&rnd=' . $code . '">��������</a>';
+                    //Цветочный магазин
+                    $is1 .= '<a href="main.php?otdel=2&add_item_f=' . $pl['id'] . '&rnd=' . $code . '">Добавить</a>';
                 } elseif ($type == 5) {
-                    //��������
-                    $is1 .= '<a onClick="saleitem(' . $pl['id'] . ',1); return false;" href="javascript:void(0)">��������</a><br><a onClick="saleitem(' . $pl['id'] . ',2); return false;" href="#">��������</a><br><small style="font-size:10px">(�����: 1 ��.)</small>';
+                    //передача
+                    $is1 .= '<a onClick="saleitem(' . $pl['id'] . ',1); return false;" href="javascript:void(0)">подарить</a><br><a onClick="saleitem(' . $pl['id'] . ',2); return false;" href="#">передать</a><br><small style="font-size:10px">(налог: 1 кр.)</small>';
                 } elseif ($type == 12) {
-                    //�������� �����
+                    //передача почта
                     $skcd = round($col * ($pl['price1'] * 0.06 - 0.01 * $this->stats['os1']), 2);
                     if ($skcd < 0.06) {
                         $skcd = 0.06;
                     }
-                    $is1 .= '<a href="main.php?otdel=' . $_GET['otdel'] . '&setlogin=' . $_REQUEST['setlogin'] . '&setobject=' . $pl['id'] . '&room=2&tmp=' . $code . '" onclick="return confirm(\'�������� ������� ' . $pl['name'] . '?\')">��������&nbsp;��&nbsp;' . (1 + $skcd) . '&nbsp;��.</A>';
+                    $is1 .= '<a href="main.php?otdel=' . $_GET['otdel'] . '&setlogin=' . $_REQUEST['setlogin'] . '&setobject=' . $pl['id'] . '&room=2&tmp=' . $code . '" onclick="return confirm(\'Передать предмет ' . $pl['name'] . '?\')">передать&nbsp;за&nbsp;' . (1 + $skcd) . '&nbsp;кр.</A>';
                 } elseif ($type == 13) {
-                    //�������� ����
+                    //Забираем шмот
                     if ($pl['1price'] > 0) {
-                        $mess = "���������� �� ��������? ������� ����� ���������!";
-                        $pl['name'] = '������ ' . $pl['1price'] . ' ��.';
+                        $mess = "Отказаться от предмета? Предмет будет уничтожен!";
+                        $pl['name'] = 'Деньги ' . $pl['1price'] . ' кр.';
                     } else {
-                        $mess = "���������� �� ��������? ������� ����� ��������� �����������";
+                        $mess = "Отказаться от предмета? Предмет будет возвращен отправителю";
                     }
                     $date1 = $pl['delete'] - time();
-                    $is1 .= '<BR><NOBR><A href="?room=4&to_box=' . $pl['id'] . '&tmp=' . $code . '">�������</A></NOBR>
-							<BR><NOBR><A onclick="return confirm(\'' . $mess . '\')" href="?room=4&del_box=' . $pl['id'] . '&tmp=' . $code . '">����������</A></NOBR><SMALL><BR><BR>(' . date("j ��. H �.", $date1) . ' )</small></TD>';
+                    $is1 .= '<BR><NOBR><A href="?room=4&to_box=' . $pl['id'] . '&tmp=' . $code . '">Забрать</A></NOBR>
+							<BR><NOBR><A onclick="return confirm(\'' . $mess . '\')" href="?room=4&del_box=' . $pl['id'] . '&tmp=' . $code . '">Отказаться</A></NOBR><SMALL><BR><BR>(' . date("j дн. H ч.", $date1) . ' )</small></TD>';
                 } elseif ($type == 4) {
-                    //������
+                    //ремонт
                     $r1 = round($pl['price1'] * 0.1 / 100, 2);
                     $r2 = round($pl['price1'] * 0.1 / 10, 2);
                     $r3 = round($pl['price1'] * $pl['iznosNOW'] * 0.10 / 100, 2);
@@ -7833,22 +7322,22 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     if ($r3 < 0.01) {
                         $r3 = 0.01;
                     }
-                    $is1 .= '<small style=""><a href="?remon=' . $pl['id'] . '&t=1&rnd=' . $code . '">������ 1 ��. �� ' . $r1 . ' ��.</a><br>';
+                    $is1 .= '<small style=""><a href="?remon=' . $pl['id'] . '&t=1&rnd=' . $code . '">Ремонт 1 ед. за ' . $r1 . ' кр.</a><br>';
                     if ($pl['iznosNOW'] >= 10) {
-                        $is1 .= '<a href="?remon=' . $pl['id'] . '&t=2&rnd=' . $code . '">������ 10 ��. �� ' . $r2 . ' ��.</a><br>';
+                        $is1 .= '<a href="?remon=' . $pl['id'] . '&t=2&rnd=' . $code . '">Ремонт 10 ед. за ' . $r2 . ' кр.</a><br>';
                     }
-                    $is1 .= '<a href="?remon=' . $pl['id'] . '&t=3&rnd=' . $code . '">������ ������ �� ' . $r3 . ' ��.</a></small>';
+                    $is1 .= '<a href="?remon=' . $pl['id'] . '&t=3&rnd=' . $code . '">Полный ремонт за ' . $r3 . ' кр.</a></small>';
                     if ($c['zuby'] == true) {
                         if ($this->info['level'] < 8) {
-                            $is1 .= '<hr><small style=""><a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz=' . $pl['id'] . '&t=1&rnd=' . $code . '">������ 1 ��. �� ' . $this->zuby($r1) . '</a><br>';
+                            $is1 .= '<hr><small style=""><a onClick="if(!confirm(\'Отремонтировать предмет за зубы?\n(Предмет нельзя будет продать) \')){ return false; }" href="?remonz=' . $pl['id'] . '&t=1&rnd=' . $code . '">Ремонт 1 ед. за ' . $this->zuby($r1) . '</a><br>';
                             if ($pl['iznosNOW'] >= 10) {
-                                $is1 .= '<a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz=' . $pl['id'] . '&t=2&rnd=' . $code . '">������ 10 ��. �� ' . $this->zuby($r2) . '</a><br>';
+                                $is1 .= '<a onClick="if(!confirm(\'Отремонтировать предмет за зубы?\n(Предмет нельзя будет продать) \')){ return false; }" href="?remonz=' . $pl['id'] . '&t=2&rnd=' . $code . '">Ремонт 10 ед. за ' . $this->zuby($r2) . '</a><br>';
                             }
-                            $is1 .= '<a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz=' . $pl['id'] . '&t=3&rnd=' . $code . '">������ ������ �� ' . $this->zuby($r3) . '</a></small>';
+                            $is1 .= '<a onClick="if(!confirm(\'Отремонтировать предмет за зубы?\n(Предмет нельзя будет продать) \')){ return false; }" href="?remonz=' . $pl['id'] . '&t=3&rnd=' . $code . '">Полный ремонт за ' . $this->zuby($r3) . '</a></small>';
                         }
                     }
                 } elseif ($type == 3) {
-                    $is1 .= '<input type="button" onClick="document.getElementById(\'itemgift\').value=' . $pl['id'] . ';document.F1.submit();" value="��������" />';
+                    $is1 .= '<input type="button" onClick="document.getElementById(\'itemgift\').value=' . $pl['id'] . ';document.F1.submit();" value="Подарить" />';
                 } elseif ($type == 2) {
                     global $shopProcent;
                     $shpCena = $pl['1price'];
@@ -7891,13 +7380,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     } else {
                         $d_s = true;
                     }
-                    if ($d_s == true) { // ������� �� �� ���
-                        $is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'������� ������� &quot;' . $pl['name'] . '&quot; �� ' . $shpCena . ' ��.?\')){ location = \'main.php?sale&sd4=' . $this->info['nextAct'] . '&item=' . $pl['id'] . '&rnd=' . $code . '\'; }">������� �� ' . $shpCena . ' ��.</a>';
+                    if ($d_s == true) { // Продать за кр тут
+                        $is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'Продать предмет &quot;' . $pl['name'] . '&quot; за ' . $shpCena . ' кр.?\')){ location = \'main.php?sale&sd4=' . $this->info['nextAct'] . '&item=' . $pl['id'] . '&rnd=' . $code . '\'; }">Продать за ' . $shpCena . ' кр.</a>';
                         if ($pl['pricerep'] > 0) {
-                            $is1 .= '<br><a href="javascript:void(0)" onClick="if(confirm(\'�������� ������� &quot;' . $pl['name'] . '&quot; �� ' . floor($pl['pricerep'] * $pl['kolvo'] / 2) . ' ��������������?\')){ location = \'main.php?sale&sd4=' . $this->info['nextAct'] . '&item_rep=' . $pl['id'] . '&rnd=' . $code . '\'; }">�������� �� ' . floor($pl['pricerep'] * $pl['kolvo'] / 2) . ' ����c. </a>';
+                            $is1 .= '<br><a href="javascript:void(0)" onClick="if(confirm(\'Обменять предмет &quot;' . $pl['name'] . '&quot; на ' . floor($pl['pricerep'] * $pl['kolvo'] / 2) . ' воинственности?\')){ location = \'main.php?sale&sd4=' . $this->info['nextAct'] . '&item_rep=' . $pl['id'] . '&rnd=' . $code . '\'; }">Обменять на ' . floor($pl['pricerep'] * $pl['kolvo'] / 2) . ' Воинc. </a>';
                         }
                     } else {
-                        $is1 .= '��� �� ��� �������.';
+                        $is1 .= 'Это не ваш предмет.';
                     }
                 } elseif ($type == 16) {
                     $shpCena = $pl['price2'];
@@ -7923,11 +7412,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     if ($pl['iznosMAX'] > 0 && $pl['iznosMAXi'] > 0 && $pl['iznosMAXi'] > $pl['iznosMAX']) {
                         $shpCena = $shpCena / 100 * ($pl['iznosMAX'] / $pl['iznosMAXi'] * 100);
                     }
-                    //$shpCena = $this->round2($shpCena*0.5); // ���� ���������
+                    //$shpCena = $this->round2($shpCena*0.5); // Цена предметов
                     if (isset($po['art'])) {
-                        $shpCena = $this->round2($shpCena * $this->berezCena()); // ���� ����
+                        $shpCena = $this->round2($shpCena * $this->berezCena()); // Цена арта
                     } else {
-                        $shpCena = $this->round2($shpCena * $this->berezCena()); // ����
+                        $shpCena = $this->round2($shpCena * $this->berezCena()); // Цена
                     }
                     if ($shpCena < 0) {
                         $shpCena = 0;
@@ -7944,9 +7433,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $d_s = true;
                     }
                     if ($d_s == true) {
-                        $is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'������� ������� &quot;' . $pl['name'] . '&quot; �� ' . $shpCena . ' ���.?\')){ location = \'main.php?sale&sd4=' . $this->info['nextAct'] . '&item=' . $pl['id'] . '&rnd=' . $code . '\'; }">������� �� ' . $shpCena . ' ���.</a>';
+                        $is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'Продать предмет &quot;' . $pl['name'] . '&quot; за ' . $shpCena . ' екр.?\')){ location = \'main.php?sale&sd4=' . $this->info['nextAct'] . '&item=' . $pl['id'] . '&rnd=' . $code . '\'; }">Продать за ' . $shpCena . ' екр.</a>';
                     } else {
-                        $is1 .= '��� �� ��� �������.';
+                        $is1 .= 'Это не ваш предмет.';
                     }
                 } elseif ($type == 30) {
                     if (isset($po['toclan'])) {
@@ -7961,40 +7450,40 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $d_s = true;
                     }
                     if ($d_s == true) {
-                        $is1 .= '<form method="POST"><input type="hidden" value="' . $pl['id'] . '" name="iid"><input type="text" value="" name="summTR"><input type="submit" value="����� � �������" name="PresTR"></form>';
+                        $is1 .= '<form method="POST"><input type="hidden" value="' . $pl['id'] . '" name="iid"><input type="text" value="" name="summTR"><input type="submit" value="Сдать в магазин" name="PresTR"></form>';
                     } else {
-                        $is1 .= '��� �� ��� �������.';
+                        $is1 .= 'Это не ваш предмет.';
                     }
                 } elseif ($type == 31) {
-                    $is1 .= '<form method="POST"><input type="hidden" value="' . $pl['id'] . '" name="iid"><input type="submit" value="�������" name="PresTR"> </form>';
+                    $is1 .= '<form method="POST"><input type="hidden" value="' . $pl['id'] . '" name="iid"><input type="submit" value="Забрать" name="PresTR"> </form>';
                 } else {
-                    if ($d[2] == 1) { //����� ������������
+                    if ($d[2] == 1) { //можно использовать
                         $inv1 = '';
                         if (isset($_GET['inv'])) {
                             $inv1 = 'inv=1&';
                         }
                         if ($pl['item_id'] == 74) {
-                            $is1 .= '<a onclick="top.addNewSmile(' . $pl['id'] . ',0); return false;" href="javascript:void(0)" title="������������">���-��</a>';
+                            $is1 .= '<a onclick="top.addNewSmile(' . $pl['id'] . ',0); return false;" href="javascript:void(0)" title="Использовать">исп-ть</a>';
                         } else {
                             $useUrl = '';
                             if ($pl['magic_inc'] == '') {
                                 $pl['magic_inc'] = $pl['magic_inci'];
                             }
                             if ($pl['magic_inc'] && $pl['type'] == 30) {
-                                //���������� �������
-                                $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>������������ ������?</td></tr></table>';
+                                //используем эликсир
+                                $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
                                 $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
-                            } elseif ($pl['magic_inc'] && $pl['type'] == 29) { //���������� ��������
-                                if (isset($po['useOnLogin']) && !isset($po['zazuby'])) { //�� ���������
+                            } elseif ($pl['magic_inc'] && $pl['type'] == 29) { //используем заклятие
+                                if (isset($po['useOnLogin']) && !isset($po['zazuby'])) { //на персонажа
                                     $useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'otdel=' . ((int)$_GET['otdel']) . '&use_pid=' . $pl['id'] . '&rnd=' . $code . '\');';
-                                } else { //������ ������������� (�� ����, ���� ��� �������� ��������\������)
-                                    $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>������������ ������?</td></tr></table>';
+                                } else { //просто использование (на себя, либо без указания предмета\логина)
+                                    $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
                                     $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\',' . (0 + $_GET['otdel']) . ');';
                                 }
-                                //�� �������
+                                //на предмет
                             }
                             if ($useUrl != '') {
-                                $is1 .= '<a href="javascript:void(0)" onClick="' . $useUrl . '" title="������������">���-��</a>';
+                                $is1 .= '<a href="javascript:void(0)" onClick="' . $useUrl . '" title="Использовать">исп-ть</a>';
                             } else {
                                 $d[2] = 0;
                             }
@@ -8002,46 +7491,46 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     }
 
                     if ($pl['max_text'] > 0 && $pl['max_text'] - $pl['use_text'] > 0) {
-                        $is1 .= '<a onclick="top.addNewText(' . $pl['id'] . ',' . ($pl['max_text'] - $pl['use_text']) . ',' . $pl['inRazdel'] . '); return false;" href="javascript:void(0)" title="�������� ����� �� ��������">��������</a><br>';
+                        $is1 .= '<a onclick="top.addNewText(' . $pl['id'] . ',' . ($pl['max_text'] - $pl['use_text']) . ',' . $pl['inRazdel'] . '); return false;" href="javascript:void(0)" title="Записать текст на предмете">Записать</a><br>';
                     }
                     if ($pl['type'] == 31 || $pl['type'] == 46 || $pl['type'] == 48 || $pl['type'] == 50 || $pl['type'] == 62 || $pl['type'] == 68 || $pl['type'] == 37 || $pl['type'] == 47) {
                         if ($d[2] == 1) {
                             $is1 .= '<br>';
                         }
                         if (($pl['type'] != 37 || !isset($po['item_inbox']) || $po['item_inbox'] == 0) && $pl['item_id'] != 10038 && $pl['item_id'] != 10039 && $pl['item_id'] != 10040) {
-                            $is1 .= '<a href="javascript:void(0);" onClick="top.useRune(' . $pl['id'] . ',\'' . $pl['name'] . '\',\'' . $pl['img'] . '\',\'main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&use_rune=' . $pl['id'] . '&rnd=' . $code . '\');return false;" title="������������">���-��</a>';
+                            $is1 .= '<a href="javascript:void(0);" onClick="top.useRune(' . $pl['id'] . ',\'' . $pl['name'] . '\',\'' . $pl['img'] . '\',\'main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&use_rune=' . $pl['id'] . '&rnd=' . $code . '\');return false;" title="Использовать">исп-ть</a>';
                         }
                     }
 
-                    if ($d[0] == 1 && $pl['type'] != 30 && $pl['type'] != 31 && (($pl['type'] != 38 && $pl['type'] != 39 && $pl['type'] != 37) || $pl['gift'] != '')) {//����� �����
+                    if ($d[0] == 1 && $pl['type'] != 30 && $pl['type'] != 31 && (($pl['type'] != 38 && $pl['type'] != 39 && $pl['type'] != 37) || $pl['gift'] != '')) {//можно одеть
                         if (!isset($po['noodet']) && $pl['inslot'] > 0) {
                             if ($d[2] == 1) {
                                 $is1 .= '<br>';
                             }
-                            $is1 .= '<a href="main.php?otdel=' . $pl['inRazdel'] . '&inv=1&oid=' . $pl['id'] . '&rnd=' . $code . '" title="������">������</a>';
+                            $is1 .= '<a href="main.php?otdel=' . $pl['inRazdel'] . '&inv=1&oid=' . $pl['id'] . '&rnd=' . $code . '" title="Надеть">надеть</a>';
                         }
                     }
                     if (isset($po['open']) && $d[0] == 1) {
                         if ($d[2] == 1) {
                             $is1 .= '<br>';
                         }
-                        $is1 .= '<a href="main.php?otdel=' . $pl['inRazdel'] . '&inv=1&open=1&oid=' . $pl['id'] . '&rnd=' . $code . '" title="�������">�������</a>';
+                        $is1 .= '<a href="main.php?otdel=' . $pl['inRazdel'] . '&inv=1&open=1&oid=' . $pl['id'] . '&rnd=' . $code . '" title="Открыть">Открыть</a>';
                     }
                     if (isset($po['close'])) {
                         if ($d[2] == 1) {
                             $is1 .= '<br>';
                         }
-                        $is1 .= '<small><strong>������� ������</strong></small>';
+                        $is1 .= '<small><strong>Предмет закрыт</strong></small>';
                     }
                     if ($pl['group'] > 0) {
                         $is1 .= '<br>';
                         if ($this->itemsX($pl['id']) < $pl['group_max']) {
-                            $is1 .= '<a href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&stack=' . $pl['id'] . '&rnd=' . $code . '" title="�������"><img src="https://img.new-combats.com/i/stack.gif" /></a>';
+                            $is1 .= '<a href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&stack=' . $pl['id'] . '&rnd=' . $code . '" title="Собрать"><img src="https://img.new-combats.com/i/stack.gif" /></a>';
                         }
                         if ($this->itemsX($pl['id']) > 1) {
                             $is1 .= ' <a
-							onClick="top.unstack(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td align=\\\'center\\\' rowspan=\\\'2\\\' width=\\\'70px\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>��������� ������� <strong>' . $pl['name'] . '</strong>?</td></tr></table>\',\'' . intval($_GET['otdel']) . '\'); return false;"
-							href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&unstack=' . $pl['id'] . '&rnd=' . $code . '" title="���������"><img src="https://img.new-combats.com/i/unstack.gif" /></a>' . $script;
+							onClick="top.unstack(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td align=\\\'center\\\' rowspan=\\\'2\\\' width=\\\'70px\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Разделить предмет <strong>' . $pl['name'] . '</strong>?</td></tr></table>\',\'' . intval($_GET['otdel']) . '\'); return false;"
+							href="main.php?inv=1&otdel=' . ((int)$_GET['otdel']) . '&unstack=' . $pl['id'] . '&rnd=' . $code . '" title="Разделить"><img src="https://img.new-combats.com/i/unstack.gif" /></a>' . $script;
                         }
                     }
                     if (isset($po['toclan'])) {
@@ -8052,17 +7541,17 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         }
                     }
 
-                    $is1 .= ' <a href="javascript:void(0);" onclick="top.addfastpanel(\'' . $pl['id'] . '\',\'' . $pl['name'] . '\',\'' . $pl['type'] . '\',\'' . $pl['1price'] . '\',\'' . $pl['2price'] . '\',\'' . $this->city_name[$pl['maidin']] . '\',\'' . $pl['img'] . '\',\'' . $pl['item_id'] . '\',\'' . $pl['iznosNOW'] . '\',\'' . $pl['iznosMAX'] . '\',\'' . intval($_GET['otdel']) . '\',\'' . $d[0] . '\',\'' . $d[2] . '\',\'0\');" title="�������� � ���������"><img width="16" height="15" src="https://img.new-combats.com/add_itm2.gif"></a> ';
+                    $is1 .= ' <a href="javascript:void(0);" onclick="top.addfastpanel(\'' . $pl['id'] . '\',\'' . $pl['name'] . '\',\'' . $pl['type'] . '\',\'' . $pl['1price'] . '\',\'' . $pl['2price'] . '\',\'' . $this->city_name[$pl['maidin']] . '\',\'' . $pl['img'] . '\',\'' . $pl['item_id'] . '\',\'' . $pl['iznosNOW'] . '\',\'' . $pl['iznosMAX'] . '\',\'' . intval($_GET['otdel']) . '\',\'' . $d[0] . '\',\'' . $d[2] . '\',\'0\');" title="Добавить в избранное"><img width="16" height="15" src="https://img.new-combats.com/add_itm2.gif"></a> ';
 
-                    if ($d[1] == 1) { //����� ��������
+                    if ($d[1] == 1) { //можно выкинуть
                         if (!isset($po['nodelete'])) {
-                            $is1 .= ' <a onClick="top.drop(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>������� <strong>' . $pl['name'] . '</strong> ����� ������, �� ������� ?</td></tr></table>\',\'' . intval($_GET['otdel']) . '\'); return false;" href="javascript:void(0);" title="�������� �������"><img src="https://img.new-combats.com/i/clear.gif"></a>';
+                            $is1 .= ' <a onClick="top.drop(' . $pl['id'] . ',\'' . $pl['img'] . '\',\'' . $pl['name'] . '\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></td><td align=\\\'left\\\'>Предмет <strong>' . $pl['name'] . '</strong> будет утерян, вы уверены ?</td></tr></table>\',\'' . intval($_GET['otdel']) . '\'); return false;" href="javascript:void(0);" title="Выкинуть предмет"><img src="https://img.new-combats.com/i/clear.gif"></a>';
                         }
-                        //$is1 .= ' <img onclick="if (confirm(\'������� &quot;'.$pl['name'].'&quot; ����� ������, �� �������?\')) window.location=\'main.php?inv=1&delete='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'" title="�������� �������" src="https://img.new-combats.com/i/clear.gif" style="cursor:pointer;">';
+                        //$is1 .= ' <img onclick="if (confirm(\'Предмет &quot;'.$pl['name'].'&quot; будет утерян, вы уверены?\')) window.location=\'main.php?inv=1&delete='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'" title="Выкинуть предмет" src="https://img.new-combats.com/i/clear.gif" style="cursor:pointer;">';
                     }
                 }
 
-                //�������� ��� � ���� (:
+                //собираем все в одно (:
                 $rt[2] .= '<tr class="item"><td align="center" bgcolor="#' . $clr[$k] . '"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="100" align="center" style="border-right:#A5A5A5 1px solid; padding:5px;">' . $is1 . '</td><td valign="top" align="left" style="padding-left:3px; padding-bottom:3px; padding-top:7px;"><div align="left">' . $is2 . '</div></td></tr></table></td></tr>';
                 $rt[1] += $pl['massa'];
                 $i++;
@@ -8093,7 +7582,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
     }
 
     private function stackGroupCheck($uid, $group, $item)
-    { // ������� ���������������� ID ������ ���������.
+    { // Находит неиспользованный ID группы предметов.
         $g = 0;
         $i = 0;
         do {
@@ -8119,15 +7608,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 		LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id AND `iuu`.inShop = 0)
 		WHERE `iu`.`id` = "' . mysql_real_escape_string((int)$id) . '" AND `iu`.`uid` = "' . $this->info['id'] . '" AND `iuu`.`uid` = "' . $this->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT 1'));
 
-        if (isset($itm['id']) && $itm['iznosNOW'] == 0) { //���������� ������� ��������� �������� � ����
-            // ������� ������
-            if ($itm['inGroup'] == 0) { // ���� ������� �� � ������, �������� ��� ������� �������� �� �������.
+        if (isset($itm['id']) && $itm['iznosNOW'] == 0) { //группируем похожие свободные предметы с этим
+            // создаем группу
+            if ($itm['inGroup'] == 0) { // Если предмет не в группе, собираем все похожие предметы по группам.
                 $items = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="' . $itm['item_id'] . '"'));
                 $items = ceil($items / $itm['group_max']);
-            } else { // �������� �������� � ������ �� ������� ����������, �� ��������� � inGroup == 0
-                $curG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="' . $itm['inGroup'] . '" AND `iu`.item_id="' . $itm['item_id'] . '"')); // ������� ���������� ��������� � ��������� ������
-                $curNG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="' . $itm['item_id'] . '"')); // ������� ���������� ��������� ������� ��� ������
-                $needG = $itm['group_max'] - $curG; // ������ ��������� ���������� ��� ������, ���� ����� ������ 0 � ��������� ���������� ������
+            } else { // Добираем предметы в группу до полного количества, из предметов с inGroup == 0
+                $curG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="' . $itm['inGroup'] . '" AND `iu`.item_id="' . $itm['item_id'] . '"')); // Текущее количество предметов в выбранной группе
+                $curNG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="' . $itm['item_id'] . '"')); // Текущее количество предметов которые без группы
+                $needG = $itm['group_max'] - $curG; // Задаем требуемое количество для добора, если нужно больше 0 и требуемое количество меньше
 
                 if ($needG > 0 and $curNG == 0) {
                     $curItem = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, count(`iu`.inGroup) as itemsInGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`inGroup`!="' . $itm['inGroup'] . '" AND `iu`.`uid`="' . $this->info['id'] . '" AND `iu`.`delete`="0" AND `iu`.item_id="' . $itm['item_id'] . '" GROUP BY `iu`.inGroup HAVING itemsInGroup <= "' . $needG . '" ORDER BY itemsInGroup DESC LIMIT 1'));
@@ -8177,7 +7666,7 @@ ORDER BY `iu`.lastUPD DESC
 LIMIT 1'));
         if (isset($itm['id']) && $itm['inGroup'] > 0 && $itm['inGroupCount'] > 0) {
             if ($x == 0 or $x == null) {
-                $x = $this->itemsX($itm['id']); //���-�� �������
+                $x = $this->itemsX($itm['id']); //кол-во распада
                 $inGroup = 0;
             } elseif ($x != 0) {
                 $inGroup = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']);
@@ -8247,7 +7736,7 @@ LIMIT 1'));
         }
         if (isset($u['id'])) {
             $snIt = 0;
-            //��������� ������ ���� � ���� � ������ ��������
+            //Проверяем одетые вещи и вещи с сроком годности
             $cl = mysql_query('SELECT
 			`iu`.`id` AS `iduid`,
 			`iu`.`time_sleep`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
@@ -8257,7 +7746,7 @@ LIMIT 1'));
                 $po = [];
                 $po = $this->lookStats($itm['data']);
                 $po['lvl'] = $u['level'];
-                //��������� ����������
+                //проверяем требования
                 $t = $this->items['tr'];
                 $x = 0;
                 $notr = 0;
@@ -8282,11 +7771,11 @@ LIMIT 1'));
                     $x++;
                 }
                 if ($this->info['twink'] > 0) {
-                    //�� ������ 100 ���.
+                    //Не дороже 100 екр.
                     if ($itm['price2'] > 1 || $itm['2price'] > 1) {
                         $notr++;
                     }
-                    //������ ���� + �����
+                    //Нельзя руны + чарки
                     if (isset($po['rune']) && $po['rune'] > 0) {
                         $notr++;
                     }
@@ -8300,7 +7789,7 @@ LIMIT 1'));
                     mysql_query('UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1');
                 }
                 if (isset($po['zazuby']) && !isset($po['srok']) && ($itm['type'] == 29 || $itm['type'] == 30 || $itm['type'] == 36 || $itm['type'] == 49 || $itm['type'] == 46 || $itm['type'] == 34)) {
-                    //�������� �� ���� �� ������ ��������
+                    //Предметы за зубы со сроком годности
                     $po['srok'] = 86400 * 7;
                     $itm['data'] = $this->impStats($po);
                     mysql_query('UPDATE `items_users` SET `data` = "' . $itm['data'] . '" WHERE `id` = "' . $itm['iduid'] . '" AND `uid` = "' . $u['id'] . '" LIMIT 1');
@@ -8321,13 +7810,13 @@ LIMIT 1'));
                     $notr++;
                 }
                 if ($notr > 0 && $itm['inOdet'] != 0) {
-                    //������� �������
+                    //снимаем предмет
                     $this->snatItem($itm['id'], $u['id']);
                     $snIt++;
                 }
-                //��������� ���� ��������
+                //проверяем срок годности
                 if ($itm['iznosNOW'] >= ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999) {
-                    //������� ��������
+                    //предмет сломался
                     if (isset($po['musor'])) {
                         if ($po['musor'] > 0) {
                             $this->recr($itm['id'], $itm['type'], $u['id'], (int)$po['musor']);
@@ -8339,7 +7828,7 @@ LIMIT 1'));
                         $this->snatItem($itm['id'], $u['id']);
                         $snIt++;
                     }
-                    //������� �������
+                    //удаляем предмет
                     if ($itm['item_id'] == 4704) {
                         $po['musor2'] = 4708;
                     }
@@ -8369,9 +7858,9 @@ LIMIT 1'));
             }
             $upd = mysql_query('UPDATE `items_users` SET `delete`="' . time() . '" WHERE `id` = "' . $id . '" ' . $uid2 . ' LIMIT 1');
             if ($upd) {
-                $this->addDelo(2, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: ������� [itm:' . $it . '] ��� <strong>������</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
+                $this->addDelo(2, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: Предмет [itm:' . $it . '] был <strong>сломан</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
                 if ($id2 > 1) {
-                    //��������� ������ �������
+                    //Добавляем пустую бутылку
                     $this->addItem($id2, $uid, 'noodet=1|noremont=1');
                 }
             }
@@ -8392,9 +7881,9 @@ LIMIT 1'));
             $upd = mysql_query('UPDATE `items_users` SET `delete`="' . time() . '",`timeOver`="1" WHERE `id` = "' . $it . '" ' . $uid2 . ' LIMIT 1');
             if ($upd) {
                 $upd = mysql_query('UPDATE `items_users` SET `inGroup`="0",`timeOver`="' . time() . '" WHERE `inGroup` = "' . $it . '" ' . $uid2 . '');
-                $this->addDelo(2, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: ������� <strong>' . $name . '</strong> [itm:' . $it . '] ��� <strong>��������</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
+                $this->addDelo(2, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: Предмет <strong>' . $name . '</strong> [itm:' . $it . '] был <strong>испорчен</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
                 if ($tp != 0) {
-                    //��������� ���������� ������� � ���������, � ����������� �� ����
+                    //Добавляем испорченый предмет в инвентарь, в зависимости от типа
                     $zzba = '';
                     if ($zub > 0) {
                         $zzba = '|zazuby=1';
@@ -8408,7 +7897,7 @@ LIMIT 1'));
                         }
                     } else {
                         if ($type == 30) {
-                            //����������� �������
+                            //испорченный эликсир
                             $this->addItem(4036, $uid, '|renameadd=' . $name . '|noodet=1' . $zzba);
                         }
                     }
@@ -8423,7 +7912,7 @@ LIMIT 1'));
         $i = 1;
         $sv = [];
         while ($i <= 10) {
-            $sv[$i] = '<img class="nopriemuse" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w101.gif" />';
+            $sv[$i] = '<img class="nopriemuse" title="Пустой слот заклятия" src="https://img.new-combats.com/i/items/w/w101.gif" />';
             $i++;
         }
         $i = 0;
@@ -8440,7 +7929,7 @@ LIMIT 1'));
                     }
                     $vl = 'style="cursor:pointer" onclick="' . $useUrl . '"';
                 }
-                $sv[$this->stats['items'][$i]['inOdet'] - 39] = '<img ' . $vl . ' title="�������������: ' . floor($this->stats['items'][$i]['iznosNOW']) . '/' . floor($this->stats['items'][$i]['iznosMAX']) . '" src="https://img.new-combats.com/i/items/' . $this->stats['items'][$i]['img'] . '" />';
+                $sv[$this->stats['items'][$i]['inOdet'] - 39] = '<img ' . $vl . ' title="Долговечность: ' . floor($this->stats['items'][$i]['iznosNOW']) . '/' . floor($this->stats['items'][$i]['iznosMAX']) . '" src="https://img.new-combats.com/i/items/' . $this->stats['items'][$i]['img'] . '" />';
             }
             $i++;
         }
@@ -8472,18 +7961,18 @@ LIMIT 1'));
         //if( $this->info['admin'] > 0 ) {
         if (isset($po['rune']) && $po['rune'] > 0) {
             $rnc = explode(' ', $po['rune_name']);
-            if ($rnc[0] == '�����') {
+            if ($rnc[0] == 'Игнис') {
                 $rnc = '#9b5d40';
-            } elseif ($rnc[0] == '����') {
+            } elseif ($rnc[0] == 'Аква') {
                 $rnc = '#3a2b64';
-            } elseif ($rnc[0] == '����') {
+            } elseif ($rnc[0] == 'Аура') {
                 $rnc = '#20a3b0';
-            } elseif ($rnc[0] == '����') {
+            } elseif ($rnc[0] == 'Тера') {
                 $rnc = '#4c7718';
             } else {
                 $rnc = '#4c4c4c';
             }
-            $r .= '<br><font color=green>����: <strong>' . $po['rune_name'] . '</strong></font>';
+            $r .= '<br><font color=green>Руна: <strong>' . $po['rune_name'] . '</strong></font>';
             unset($rnc);
         }
         if (isset($po['spell'])) {
@@ -8516,7 +8005,7 @@ LIMIT 1'));
 					{
 						$td['add_hpAll'] = '+'.$td['add_hpAll'];
 					}
-					$lvar .= '<br>������� �����: '.$td['add_hpAll'].'';
+					$lvar .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
 				}
 				if(isset($td['add_mpAll']) && $td['add_mpAll']!=0)
 				{
@@ -8524,10 +8013,10 @@ LIMIT 1'));
 					{
 						$td['add_mpAll'] = '+'.$td['add_mpAll'];
 					}
-					$lvar .= '<br>������� ����: '.$td['add_mpAll'].'';
+					$lvar .= '<br>Уровень маны: '.$td['add_mpAll'].'';
 				}*/
         if (isset($td['sv_yron_max']) && $td['sv_yron_max'] > 0) {
-            $lvar .= '<br>����: ' . $td['sv_yron_min'] . '-' . $td['sv_yron_max'] . '';
+            $lvar .= '<br>Урон: ' . $td['sv_yron_min'] . '-' . $td['sv_yron_max'] . '';
         }
         if (isset($td['add_mab1']) && $td['add_mab1'] > 0) {
             if ($td['add_mib1'] == $td['add_mab1'] && $pl['geniration'] == 1) {
@@ -8535,9 +8024,9 @@ LIMIT 1'));
                 if ($td['add_mab1'] < 0) {
                     $m1l = '';
                 }
-                $lvar .= '<br>����� ������: ' . $m1l . '' . (0 + $td['add_mab1']) . '';
+                $lvar .= '<br>Броня головы: ' . $m1l . '' . (0 + $td['add_mab1']) . '';
             } else {
-                $lvar .= '<br>����� ������: ' . (0 + $td['add_mib1']) . '-' . (0 + $td['add_mab1']) . '';
+                $lvar .= '<br>Броня головы: ' . (0 + $td['add_mib1']) . '-' . (0 + $td['add_mab1']) . '';
             }
         }
         //
@@ -8570,10 +8059,10 @@ LIMIT 1'));
             $x++;
         }
         if ($pl['2h'] == 1) {
-            $lvar .= '<br>� ��������� ������';
+            $lvar .= '<br>• Двуручное оружие';
         }
         if (isset($po['zonb'])) {
-            $lvar .= '<br>���� ������������: ';
+            $lvar .= '<br>Зоны блокирования: ';
             if ($lvar['zonb'] > 0) {
                 $x = 1;
                 while ($x <= $td['zonb']) {
@@ -8581,7 +8070,7 @@ LIMIT 1'));
                     $x++;
                 }
             } else {
-                $lvar .= '�';
+                $lvar .= '—';
             }
         }
 
@@ -8592,9 +8081,9 @@ LIMIT 1'));
                 if ($td['add_mab2'] < 0) {
                     $m1l = '';
                 }
-                $lvar .= '<br>����� �������: ' . $m1l . '' . (0 + $td['add_mab2']) . '';
+                $lvar .= '<br>Броня корпуса: ' . $m1l . '' . (0 + $td['add_mab2']) . '';
             } else {
-                $lvar .= '<br>����� �������: ' . (0 + $td['add_mib2']) . '-' . (0 + $td['add_mab2']) . '';
+                $lvar .= '<br>Броня корпуса: ' . (0 + $td['add_mib2']) . '-' . (0 + $td['add_mab2']) . '';
             }
         }
         if (isset($td['add_mab3']) && $td['add_mab3'] > 0) {
@@ -8603,9 +8092,9 @@ LIMIT 1'));
                 if ($td['add_mab3'] < 0) {
                     $m1l = '';
                 }
-                $lvar .= '<br>����� �����: ' . $m1l . '' . (0 + $td['add_mab3']) . '';
+                $lvar .= '<br>Броня пояса: ' . $m1l . '' . (0 + $td['add_mab3']) . '';
             } else {
-                $lvar .= '<br>����� �����: ' . (0 + $td['add_mib3']) . '-' . (0 + $td['add_mab3']) . '';
+                $lvar .= '<br>Броня пояса: ' . (0 + $td['add_mib3']) . '-' . (0 + $td['add_mab3']) . '';
             }
         }
         if (isset($td['add_mab4']) && $td['add_mab4'] > 0) {
@@ -8614,21 +8103,21 @@ LIMIT 1'));
                 if ($td['add_mab4'] < 0) {
                     $m1l = '';
                 }
-                $lvar .= '<br>����� ���: ' . $m1l . '' . (0 + $td['add_mab4']) . '';
+                $lvar .= '<br>Броня ног: ' . $m1l . '' . (0 + $td['add_mab4']) . '';
             } else {
-                $lvar .= '<br>����� ���: ' . (0 + $td['add_mib4']) . '-' . (0 + $td['add_mab4']) . '';
+                $lvar .= '<br>Броня ног: ' . (0 + $td['add_mib4']) . '-' . (0 + $td['add_mab4']) . '';
             }
         }
         if ($pl['iznosMAX'] > 0) {
             if ($pl['iznosMAXi'] >= 909999999) {
-                //$lvar .= '<br>�������������: <font color=brown>�����������</font > ';
+                //$lvar .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
             } else {
-                $lvar .= '<br>�������������: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']);
+                $lvar .= '<br>Долговечность: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']);
             }
         }
 
         if ($po['battleUseZd'] > 0) {
-            $lvar .= '<br>�������� �������������: ' . $this->timeOut($po['battleUseZd']) . '';
+            $lvar .= '<br>Задержка использования: ' . $this->timeOut($po['battleUseZd']) . '';
         }
 
         if (isset($td['gravi'])) {
@@ -8676,8 +8165,8 @@ LIMIT 1'));
             10 => 13,
             9 => 14,
             8 => 15,
-            11 => 17, //������ 2
-            12 => 18 //������ 3
+            11 => 17, //кольцо 2
+            12 => 18 //кольцо 3
         ];
 
         if (isset($u['id'], $u['stats'])) {
@@ -8690,29 +8179,29 @@ LIMIT 1'));
             $st['login'] = $u['login'];
             $st['lvl'] = $u['level'];
 
-            //�������������� �� ��������� � �� �����������
+            //Характеристики от предметов и их изображение
             $witm = [];
-            $witm[1] = '<img width="60" height="60" style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w9.gif">';
-            $witm[2] = '<img width="60" height="40" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w13.gif">';
-            $witm[3] = '<img width="60" height="60" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w3.gif">';
-            $witm[4] = '<img width="60" height="80" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w4.gif">';
-            $witm[7] = '<img width="60" height="40" style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w5.gif">';
-            $witm[8] = '<img width="60" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w1.gif">';
-            $witm[9] = '<img width="60" height="20" style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w2.gif">';
-            $witm[10] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-            $witm[11] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-            $witm[12] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-            $witm[13] = '<img width="60" height="40" style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w11.gif">';
-            $witm[14] = '<img width="60" height="60" style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/i/items/w/w10.gif">';
-            $witm[16] = '<img width="60" height="80" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w19.gif">';
-            $witm[17] = '<img width="60" height="40" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w12.gif">';
-            //40-52 ���� ��� �����
-            $witm[53] = '<img width="40" height="20" style="display:block;" title="������ ���� ������ ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-            $witm[54] = '<img width="40" height="20" style="display:block;" title="������ ���� ����� ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-            $witm[55] = '<img width="40" height="20" style="display:block;" title="������ ���� ����������� ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-            $witm[56] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-            $witm[57] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-            $witm[58] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
+            $witm[1] = '<img width="60" height="60" style="display:block;" title="Пустой слот шлем" src="https://img.new-combats.com/i/items/w/w9.gif">';
+            $witm[2] = '<img width="60" height="40" style="display:block;" title="Пустой слот наручи" src="https://img.new-combats.com/i/items/w/w13.gif">';
+            $witm[3] = '<img width="60" height="60" style="display:block;" title="Пустой слот оружие" src="https://img.new-combats.com/i/items/w/w3.gif">';
+            $witm[4] = '<img width="60" height="80" style="display:block;" title="Пустой слот броня" src="https://img.new-combats.com/i/items/w/w4.gif">';
+            $witm[7] = '<img width="60" height="40" style="display:block;" title="Пустой слот пояс" src="https://img.new-combats.com/i/items/w/w5.gif">';
+            $witm[8] = '<img width="60" height="20" style="display:block;" title="Пустой слот серьги" src="https://img.new-combats.com/i/items/w/w1.gif">';
+            $witm[9] = '<img width="60" height="20" style="display:block;" title="Пустой слот ожерелье" src="https://img.new-combats.com/i/items/w/w2.gif">';
+            $witm[10] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
+            $witm[11] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
+            $witm[12] = '<img width="20" height="20" style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
+            $witm[13] = '<img width="60" height="40" style="display:block;" title="Пустой слот перчатки" src="https://img.new-combats.com/i/items/w/w11.gif">';
+            $witm[14] = '<img width="60" height="60" style="display:block;" title="Пустой слот щит" src="https://img.new-combats.com/i/items/w/w10.gif">';
+            $witm[16] = '<img width="60" height="80" style="display:block;" title="Пустой слот поножи" src="https://img.new-combats.com/i/items/w/w19.gif">';
+            $witm[17] = '<img width="60" height="40" style="display:block;" title="Пустой слот обувь" src="https://img.new-combats.com/i/items/w/w12.gif">';
+            //40-52 слот под магию
+            $witm[53] = '<img width="40" height="20" style="display:block;" title="Пустой слот правый карман" src="https://img.new-combats.com/i/items/w/w15.gif">';
+            $witm[54] = '<img width="40" height="20" style="display:block;" title="Пустой слот левый карман" src="https://img.new-combats.com/i/items/w/w15.gif">';
+            $witm[55] = '<img width="40" height="20" style="display:block;" title="Пустой слот центральный карман" src="https://img.new-combats.com/i/items/w/w15.gif">';
+            $witm[56] = '<img width="40" height="20" style="display:block;" title="Пустой слот смена" src="https://img.new-combats.com/i/items/w/w20.gif">';
+            $witm[57] = '<img width="40" height="20" style="display:block;" title="Пустой слот смена" src="https://img.new-combats.com/i/items/w/w20.gif">';
+            $witm[58] = '<img width="40" height="20" style="display:block;" title="Пустой слот смена" src="https://img.new-combats.com/i/items/w/w20.gif">';
             $cl = mysql_query('SELECT 
 			`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
 			`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
@@ -8724,7 +8213,7 @@ LIMIT 1'));
                 $td = $this->lookStats($pl['data']);
 
                 if (isset($td['modif'])) {
-                    $pl['name'] = $pl['name'] . ' (��)';
+                    $pl['name'] = $pl['name'] . ' (мф)';
                 }
 
                 if (isset($td['upatack_lvl'])) {
@@ -8748,20 +8237,20 @@ LIMIT 1'));
 					{
 						$td['add_hpAll'] = '+'.$td['add_hpAll'];
 					}
-					$lvar .= '<br>������� �����: '.$td['add_hpAll'].'';
+					$lvar .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
 				}
 				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
 				{
-					$lvar .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
+					$lvar .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
 				}
 				if(isset($td['add_mab1']) && $td['add_mab1']>0)
 				{
 					if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
+						$lvar .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
 					}else{
-						$lvar .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
+						$lvar .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
 					}
 				}
 				if(isset($td['add_mab2']) && $td['add_mab2']>0)
@@ -8769,9 +8258,9 @@ LIMIT 1'));
 					if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
+						$lvar .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
 					}else{
-						$lvar .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
+						$lvar .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
 					}
 				}
 				if(isset($td['add_mab3']) && $td['add_mab3']>0)
@@ -8779,9 +8268,9 @@ LIMIT 1'));
 					if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
+						$lvar .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
 					}else{
-						$lvar .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
+						$lvar .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
 					}
 				}
 				if(isset($td['add_mab4']) && $td['add_mab4']>0)
@@ -8789,38 +8278,38 @@ LIMIT 1'));
 					if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
+						$lvar .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
 					}else{
-						$lvar .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
+						$lvar .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
 					}
 				}
 				if($pl['iznosMAX']>0)
 				{
 	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$lvar .= '<br>�������������: <font color=brown>�����������</font > ';
+						$lvar .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
 					}else{
-						$lvar .= '<br>�������������: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']);
+						$lvar .= '<br>Долговечность: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']);
 					}
 				}
 
 				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '<br>�������� �������������: '.$this->timeOut($po['battleUseZd']).'';
+					$is2 .= '<br>Задержка использования: '.$this->timeOut($po['battleUseZd']).'';
 				}
 
 				if(isset($td['gravi'])) {
 					$td['gravitp'] = array(
-						18 => '�������',
-						19 => '������',
-						20 => '������',
-						21 => '������',
-						22 => '������',
-						23 => '����',
-						24 => '��������',
-						26 => '��������',
-						27 => '��������',
-						28 => '��������'
+						18 => 'кинжале',
+						19 => 'топоре',
+						20 => 'молоте',
+						21 => 'клинке',
+						22 => 'посохе',
+						23 => 'луке',
+						24 => 'арбалете',
+						26 => 'рукоятке',
+						27 => 'предмете',
+						28 => 'предмете'
 					);
-					$lvar .= '<br>�� '.$td['gravitp'][$pl['type']].' ������������� �������: '.$td['gravi'].'';
+					$lvar .= '<br>На '.$td['gravitp'][$pl['type']].' выгравирована надпись: '.$td['gravi'].'';
 					unset($td['gravitp']);
 				}*/
 
@@ -8829,10 +8318,10 @@ LIMIT 1'));
 					if( $pl['2h'] == 1 ) {
 						if(@isset($sn['items_img'][$tp_img[14]])) {
 							$uimg2 = 'rimg/r'.$sn['items_img'][$tp_img[14]];
-							$witm[14] = '<img width="60" height="60" style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/'.$uimg2.'">';
+							$witm[14] = '<img width="60" height="60" style="display:block;" title="Пустой слот щит" src="https://img.new-combats.com/'.$uimg2.'">';
 						}else{
 							$uimg2 = 'i/items/'.$pl['img'].'';
-							$witm[14] = '<img width="60" height="60" style="background-image:url(https://img.new-combats.com/i/items/w/w10.gif);display:block;filter:alpha(opacity=37);opacity:0.37;-moz-opacity:0.37;-khtml-opacity:0.37;" title="������ ���� ���" src="https://img.new-combats.com/'.$uimg2.'">';
+							$witm[14] = '<img width="60" height="60" style="background-image:url(https://img.new-combats.com/i/items/w/w10.gif);display:block;filter:alpha(opacity=37);opacity:0.37;-moz-opacity:0.37;-khtml-opacity:0.37;" title="Пустой слот щит" src="https://img.new-combats.com/'.$uimg2.'">';
 						}
 						unset($uimg2);
 					}
@@ -8858,12 +8347,12 @@ LIMIT 1'));
                             $pl['magic_inc'] = $pl['magic_inci'];
                         }
                         if ($pl['magic_inc'] && $pl['type'] == 30) {
-                            //���������� �������
-                            $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>������������ ������?</td></tr></table>';
+                            //используем эликсир
+                            $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
                             $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
                         } elseif ($pl['magic_inc'] && $pl['type'] == 29) {
-                            //���������� ��������
-                            //�� ���������
+                            //используем заклятие
+                            //на персонажа
                             if (isset($td['useOnLogin'])) {
                                 $inv1 = '';
                                 if (isset($_GET['inv'])) {
@@ -8871,21 +8360,21 @@ LIMIT 1'));
                                 }
                                 $useUrl = 'top.useMagic(\'' . $pl['name'] . '\',' . (0 + $pl['id']) . ',\'' . $pl['img'] . '\',1,\'main.php?' . $inv1 . 'use_pid=' . $pl['id'] . '&rnd=' . $code . '\');';
                             } else {
-                                //������ ������������� (�� ����, ���� ��� �������� ��������\������)
-                                $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>������������ ������?</td></tr></table>';
+                                //просто использование (на селя, либо без указания предмета\логина)
+                                $pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/' . $pl['img'] . '\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<strong>' . $pl['name'] . '</strong>&quot;<br>Использовать сейчас?</td></tr></table>';
                                 $useUrl = 'top.useiteminv(\'' . (0 + $pl['id']) . '\',\'' . $pl['img'] . '\',\'' . $pl['img'] . '\',1,\'' . $pldate . '\',\'' . (0 + $_GET['otdel']) . '\');';
                             }
                         }
                         $witm[$pl['inOdet']] = '<a href="javascript:void(0);" onClick="' . $useUrl . '">' . $witm[$pl['inOdet']] . '</a>';
                     } elseif ($pl['item_id'] == 998 && !isset($_GET['inv'])) {
-                        //�������
+                        //варежки
                         $witm[$pl['inOdet']] = '<a href="main.php?use_snowball=' . $code . '">' . $witm[$pl['inOdet']] . '</a>';
                     } else {
                         $witm[$pl['inOdet']] = '<a href="main.php?otdel=' . $pl['inRazdel'] . '&inv=1&sid=' . $pl['id'] . '&rnd=' . $code . '">' . $witm[$pl['inOdet']] . '</a>';
                     }
                 }
             }
-            //����,�����
+            //Шлем,Венок
             $wj1i = '';
             $br = '<div align=\\\'center\\\' style=\\\'margin:4px;\\\'><img src=\\\'https://img.new-combats.com/1x1.gif\\\' height=\\\'1\\\' width=\\\'111\\\' style=\\\'background-color:black;\\\'></div>';
             if ($wj[1] != false) {
@@ -8904,20 +8393,20 @@ LIMIT 1'));
 					{
 						$td['add_hpAll'] = '+'.$td['add_hpAll'];
 					}
-					$wj1i .= '<br>������� �����: '.$td['add_hpAll'].'';
+					$wj1i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
 				}
 				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
 				{
-					$wj1i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
+					$wj1i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
 				}
 				if(isset($td['add_mab1']) && $td['add_mab1']>0)
 				{
 					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
+						$wj1i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
 					}else{
-						$wj1i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
+						$wj1i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
 					}
 				}
 				if(isset($td['add_mab2']) && $td['add_mab2']>0)
@@ -8925,9 +8414,9 @@ LIMIT 1'));
 					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
+						$wj1i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
 					}else{
-						$wj1i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
+						$wj1i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
 					}
 				}
 				if(isset($td['add_mab3']) && $td['add_mab3']>0)
@@ -8935,9 +8424,9 @@ LIMIT 1'));
 					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
+						$wj1i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
 					}else{
-						$wj1i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
+						$wj1i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
 					}
 				}
 				if(isset($td['add_mab4']) && $td['add_mab4']>0)
@@ -8945,18 +8434,18 @@ LIMIT 1'));
 					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
+						$wj1i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
 					}else{
-						$wj1i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
+						$wj1i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
 					}
 				}
 
 				if($wj[1]['iznosMAX']>0)
 				{
 	 	 	 	 	 if($wj[1]['iznosMAXi'] == 999999999) {
-						$wj1i .= '<br>�������������: <font color=brown>�����������</font > ';
+						$wj1i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
 					}else{
-						$wj1i .= '<br>�������������: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).'';
+						$wj1i .= '<br>Долговечность: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).'';
 					}
 				}*/
             }
@@ -8968,9 +8457,9 @@ LIMIT 1'));
 				if($wj[52]['iznosMAX']>0)
 				{
 	 	 	 	 	 if($wj[52]['iznosMAXi'] == 999999999) {
-						$wj1i = '<br>�������������: <font color=brown>�����������</font ><br>'.$wj1i;
+						$wj1i = '<br>Долговечность: <font color=brown>неразрушимо</font ><br>'.$wj1i;
 					}else{
-						$wj1i = '<br>�������������: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i;
+						$wj1i = '<br>Долговечность: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i;
 					}
 				}
 
@@ -8979,9 +8468,9 @@ LIMIT 1'));
 					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i = '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i;
+						$wj1i = '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i;
 					}else{
-						$wj1i = '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i;
+						$wj1i = '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i;
 					}
 				}
 
@@ -8990,9 +8479,9 @@ LIMIT 1'));
 					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i = '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i;
+						$wj1i = '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i;
 					}else{
-						$wj1i = '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i;
+						$wj1i = '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i;
 					}
 				}
 
@@ -9001,9 +8490,9 @@ LIMIT 1'));
 					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i = '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i;
+						$wj1i = '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i;
 					}else{
-						$wj1i = '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i;
+						$wj1i = '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i;
 					}
 				}
 
@@ -9012,9 +8501,9 @@ LIMIT 1'));
 					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i = '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i;
+						$wj1i = '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i;
 					}else{
-						$wj1i = '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i;
+						$wj1i = '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i;
 					}
 				}
 
@@ -9024,12 +8513,12 @@ LIMIT 1'));
 					{
 						$td['add_hpAll'] = '+'.$td['add_hpAll'];
 					}
-					$wj1i = '<br>������� �����: '.$td['add_hpAll'].''.$wj1i;
+					$wj1i = '<br>Уровень жизни: '.$td['add_hpAll'].''.$wj1i;
 				}
 
 				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
 				{
-					$wj1i = '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i;
+					$wj1i = '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i;
 				}*/
 
 
@@ -9039,7 +8528,7 @@ LIMIT 1'));
                 $wj[1]['id'] = $wj[52]['id'];
                 $wj[1]['inRazdel'] = $wj[52]['inRazdel'];
             }
-            //������,�����,����
+            //Рубаха,Броня,Плащ
             $wj4idd = $wj[5]['item_id'];
             $wj4i = '';
             if ($wj[6] != false) {
@@ -9053,20 +8542,20 @@ LIMIT 1'));
 					{
 						$td['add_hpAll'] = '+'.$td['add_hpAll'];
 					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
+					$wj4i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
 				}
 				if($td['sv_yron_max']>0)
 				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
+					$wj4i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
 				}
 				if($td['add_mab1']>0)
 				{
 					if($td['add_mib1']==$td['add_mab1'] && $wj[6]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
+						$wj4i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
 					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
+						$wj4i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
 					}
 				}
 				if($td['add_mab2']>0)
@@ -9074,9 +8563,9 @@ LIMIT 1'));
 					if($td['add_mib2']==$td['add_mab2'] && $wj[6]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
+						$wj4i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
 					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
+						$wj4i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
 					}
 				}
 				if($td['add_mab3']>0)
@@ -9084,9 +8573,9 @@ LIMIT 1'));
 					if($td['add_mib3']==$td['add_mab3'] && $wj[6]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
+						$wj4i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
 					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
+						$wj4i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
 					}
 				}
 				if($td['add_mab4']>0)
@@ -9094,18 +8583,18 @@ LIMIT 1'));
 					if($td['add_mib4']==$td['add_mab4'] && $wj[6]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
+						$wj4i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
 					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
+						$wj4i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
 					}
 				}
 
 				if($wj[6]['iznosMAX']>0)
 				{
 	 	 	 	 	 if($wj[6]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
+						$wj4i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
 					}else{
-						$wj4i .= '<br>�������������: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).'';
+						$wj4i .= '<br>Долговечность: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).'';
 					}
 				}*/
                 $wj4i .= $this->getInfoItemInfo($wj[6]);
@@ -9124,20 +8613,20 @@ LIMIT 1'));
 					{
 						$td['add_hpAll'] = '+'.$td['add_hpAll'];
 					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
+					$wj4i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
 				}
 				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
 				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
+					$wj4i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
 				}
 				if(isset($td['add_mab1']) && $td['add_mab1']>0)
 				{
 					if($td['add_mib1']==$td['add_mab1'] && $wj[5]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
+						$wj4i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
 					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
+						$wj4i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
 					}
 				}
 				if(isset($td['add_mab2']) && $td['add_mab2']>0)
@@ -9145,9 +8634,9 @@ LIMIT 1'));
 					if($td['add_mib2']==$td['add_mab2'] && $wj[5]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
+						$wj4i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
 					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
+						$wj4i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
 					}
 				}
 				if(isset($td['add_mab3']) && $td['add_mab3']>0)
@@ -9155,9 +8644,9 @@ LIMIT 1'));
 					if($td['add_mib3']==$td['add_mab3'] && $wj[5]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
+						$wj4i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
 					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
+						$wj4i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
 					}
 				}
 				if(isset($td['add_mab4']) && $td['add_mab4']>0)
@@ -9165,18 +8654,18 @@ LIMIT 1'));
 					if($td['add_mib4']==$td['add_mab4'] && $wj[5]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
+						$wj4i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
 					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
+						$wj4i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
 					}
 				}
 
 				if($wj[5]['iznosMAX']>0)
 				{
 	 	 	 	 	 if($wj[5]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
+						$wj4i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
 					}else{
-						$wj4i .= '<br>�������������: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).'';
+						$wj4i .= '<br>Долговечность: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).'';
 					}
 				}
 				*/
@@ -9196,20 +8685,20 @@ LIMIT 1'));
 					{
 						$td['add_hpAll'] = '+'.$td['add_hpAll'];
 					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
+					$wj4i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
 				}
 				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
 				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
+					$wj4i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
 				}
 				if(isset($td['add_mab1']) && $td['add_mab1']>0)
 				{
 					if($td['add_mib1']==$td['add_mab1'] && $wj[4]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
+						$wj4i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
 					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
+						$wj4i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
 					}
 				}
 				if(isset($td['add_mab2']) && $td['add_mab2']>0)
@@ -9217,9 +8706,9 @@ LIMIT 1'));
 					if($td['add_mib2']==$td['add_mab2'] && $wj[4]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
+						$wj4i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
 					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
+						$wj4i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
 					}
 				}
 				if(isset($td['add_mab3']) && $td['add_mab3']>0)
@@ -9227,9 +8716,9 @@ LIMIT 1'));
 					if($td['add_mib3']==$td['add_mab3'] && $wj[4]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
+						$wj4i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
 					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
+						$wj4i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
 					}
 				}
 				if(isset($td['add_mab4']) && $td['add_mab4']>0)
@@ -9237,18 +8726,18 @@ LIMIT 1'));
 					if($td['add_mib4']==$td['add_mab4'] && $wj[4]['geniration']==1)
 					{
 						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
+						$wj4i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
 					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
+						$wj4i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
 					}
 				}
 
 				if($wj[4]['iznosMAX']>0)
 				{
 	 	 	 	 	 if($wj[4]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
+						$wj4i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
 					}else{
-						$wj4i .= '<br>�������������: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).'';
+						$wj4i .= '<br>Долговечность: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).'';
 					}
 				}*/
                 $wj4i .= $this->getInfoItemInfo($wj[4]);
@@ -9317,7 +8806,7 @@ LIMIT 1'));
                     $witm[4] = '<a href="main.php?otdel=' . $wj[4]['inRazdel'] . '&inv=1&sid=' . $wj[4]['id'] . '&rnd=' . $code . '">' . $witm[4] . '</a>';
                 }
             }
-            /*------------ ���������� ���. � ��������� ---------------*/
+            /*------------ ГЕНЕРИРУЕМ ИНФ. О ПЕРСОНАЖЕ ---------------*/
             $nmmsgl1 = 0;
             if ($u['align'] >= 1 && $u['align'] < 2) {
                 $nmmsgl1 = 1;
@@ -9341,20 +8830,20 @@ LIMIT 1'));
                 7 => 'dragon'
             ];
             $anan2 = [
-                1 => '���',
-                2 => '����',
-                3 => '�������',
-                4 => '�������',
-                5 => 'ϸ�',
-                6 => '����',
-                7 => '������'
+                1 => 'Кот',
+                2 => 'Сова',
+                3 => 'Светляк',
+                4 => 'Чертяка',
+                5 => 'Пёс',
+                6 => 'Свин',
+                7 => 'Дракон'
             ];
             $anml = '';
             if ($u['animal'] > 0) {
                 $an = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "' . $u['animal'] . '" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1'));
                 if (isset($an['id'])) {
                     if ($i1 != 1) {
-                        //$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><a href="main.php?pet"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].'] (���������� �����)"></a></div>';
+                        //$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><a href="main.php?pet"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].'] (Посмотреть образ)"></a></div>';
                     } else {
                         if ($an['eda'] > 0) {
                             //$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].']"></div>';
@@ -9362,9 +8851,9 @@ LIMIT 1'));
                     }
                     $petimg = mysql_fetch_array(mysql_query('SELECT `id`,`img` FROM `obraz_pet` WHERE `uid` = "' . $u['id'] . '" AND `use` = 1 LIMIT 1'));
                     if (isset($petimg['id'])) {
-                        $anml = '<img height="40" width="120" src="https://' . $c['img'] . '/pet/' . $petimg['img'] . '" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong> <i>(' . $anan2[$an['type']] . ')</i><br>�������: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
+                        $anml = '<img height="40" width="120" src="https://' . $c['img'] . '/pet/' . $petimg['img'] . '" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong> <i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
                     } else {
-                        $anml = '<img height="40" width="120" src="https://' . $c['img'] . '/pet/' . $anan[$an['type']] . '.png" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong><i>(' . $anan2[$an['type']] . ')</i><br>�������: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
+                        $anml = '<img height="40" width="120" src="https://' . $c['img'] . '/pet/' . $anan[$an['type']] . '.png" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong><i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
                     }
                 }
             }
@@ -9384,7 +8873,7 @@ LIMIT 1'));
             $oi = '';
             if ($i1 != 1) {
                 $jf = 'main';
-                $oi = 'onMouseOver="top.hi(this,\'' . $u['login'] . ' (������� � &quot;���������&quot;)\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"';
+                $oi = 'onMouseOver="top.hi(this,\'' . $u['login'] . ' (Перейти в &quot;Инвентарь&quot;)\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"';
                 $msl = '<table width="120" border="0" cellspacing="0" cellpadding="0">
 						<tr>
 						  <td width="40" height="20">' . $witm[53] . '</td>
@@ -9400,7 +8889,7 @@ LIMIT 1'));
             }
             $hpmp = '';
             $eff = '';
-            //-------- ���������� �������
+            //-------- генерируем эффекты
             $efs = mysql_query('SELECT 
 			`eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`tr_life_user`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`,
 			`em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch`
@@ -9423,23 +8912,23 @@ LIMIT 1'));
                 if (($e['timeUse'] + $e['timeAce'] + $e['actionTime'] >= time() || $e['timeUse'] == 77) && $esee == 1) {
                     $ei = '<strong><u>' . $e['name'] . '</u></strong>';
                     if ($e['type1'] > 0 && $e['type1'] < 7) {
-                        $ei .= ' (�������)';
+                        $ei .= ' (Эликсир)';
                     } elseif (($e['type1'] > 6 && $e['type1'] < 11) || $e['type1'] == 16) {
-                        $ei .= ' (��������)';
+                        $ei .= ' (Заклятие)';
                     } elseif ($e['type1'] == 14) {
-                        $ei .= ' (�����)';
+                        $ei .= ' (Прием)';
                     } elseif ($e['type1'] == 15) {
-                        $ei .= ' (��������)';
+                        $ei .= ' (Изучение)';
                     } elseif ($e['type1'] == 17) {
-                        $ei .= ' (���������)';
+                        $ei .= ' (Проклятие)';
                     } elseif ($e['type1'] == 18 || $e['type1'] == 19) {
-                        $ei .= ' (������)';
+                        $ei .= ' (Травма)';
                     } elseif ($e['type1'] == 20) {
-                        $ei .= ' (�����������)';
+                        $ei .= ' (Пристрастие)';
                     } elseif ($e['type1'] == 22) {
-                        $ei .= ' (��������)';
+                        $ei .= ' (Ожидание)';
                     } else {
-                        $ei .= ' (������)';
+                        $ei .= ' (Эффект)';
                     }
                     $ei .= '<br>';
 
@@ -9451,7 +8940,7 @@ LIMIT 1'));
                         if ($tmp > 0) {
                             $id++;
                             if ($id < 3) {
-                                $out .= $tmp . " ���. ";
+                                $out .= $tmp . " мес. ";
                             }
                             $time_still = $time_still - $tmp * 2592000;
                         }
@@ -9459,7 +8948,7 @@ LIMIT 1'));
                         if ($tmp > 0) {
                             $id++;
                             if ($id < 3) {
-                                $out .= $tmp . " ���. ";
+                                $out .= $tmp . " нед. ";
                             }
                             $time_still = $time_still - $tmp * 604800;
                         }
@@ -9467,7 +8956,7 @@ LIMIT 1'));
                         if ($tmp > 0) {
                             $id++;
                             if ($id < 3) {
-                                $out .= $tmp . " ��. ";
+                                $out .= $tmp . " дн. ";
                             }
                             $time_still = $time_still - $tmp * 86400;
                         }
@@ -9475,7 +8964,7 @@ LIMIT 1'));
                         if ($tmp > 0) {
                             $id++;
                             if ($id < 3) {
-                                $out .= $tmp . " �. ";
+                                $out .= $tmp . " ч. ";
                             }
                             $time_still = $time_still - $tmp * 3600;
                         }
@@ -9483,16 +8972,16 @@ LIMIT 1'));
                         if ($tmp > 0) {
                             $id++;
                             if ($id < 3) {
-                                $out .= $tmp . " ���. ";
+                                $out .= $tmp . " мин. ";
                             }
                         }
                         if ($out == '') {
-                            $out = $time_still . ' ���.';
+                            $out = $time_still . ' сек.';
                         }
-                        $ei .= '��������: ' . $out . '';
+                        $ei .= 'Осталось: ' . $out . '';
                     }
 
-                    //�������� �������
+                    //Действие эффекта
                     $tr = '';
                     $t = $this->items['add'];
                     $x = 0;
@@ -9512,7 +9001,7 @@ LIMIT 1'));
                         $ei .= $tr;
                     }
                     if ($e['info'] != '') {
-                        $ei .= '<br><i>����������:</i><br>' . $e['info'];
+                        $ei .= '<br><i>Информация:</i><br>' . $e['info'];
                     }
                     if ($e['img2'] != '' && $e['img'] == 'icon_none.gif') {
                         $e['img'] = $e['img2'];
@@ -9522,7 +9011,7 @@ LIMIT 1'));
                     }
                     $eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="https://img.new-combats.com/i/eff/' . $e['img'] . '"onMouseOver="top.hi(this,\'' . $ei . '\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
                 } elseif ($e['timeUse'] + $e['timeAce'] + $e['actionTime'] < time() && $e['timeUse'] != 77) {
-                    //������� ������
+                    //удаляем эффект
                     $ed = $this->lookStats($e['data']);
                     if (!isset($ed['finish_file']) || $this->info['id'] == $e['uid']) {
                         $this->endEffect($e['id'], $u);
@@ -9531,11 +9020,11 @@ LIMIT 1'));
             }
 
             if ($sn['itmslvl'] == 0) {
-                //$ei = '<strong><u>������ ����������</u></strong> (������)<br>��������: <i>����������</i>';
+                //$ei = '<strong><u>Легкое вооружение</u></strong> (Эффект)<br>Осталось: <i>Бесконечно</i>';
                 //$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="https://img.new-combats.com/i/eff/light_armor.gif"onMouseOver="top.hi(this,\''.$ei.'\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
             }
 
-            //��������
+            //здоровье
             if ($type_info == 1) {
                 $hptop = 0;
                 $lh = [0 => 'hp_none', 1 => 1];
@@ -9550,24 +9039,24 @@ LIMIT 1'));
                     $lh[0] = 'hp_3';
                 }
                 if ($sn['mpAll'] > 0) {
-                    //����
+                    //мана
                     $lm = [0 => 'hp_none', 1 => 1];
                     $lm[1] = floor($sn['mpNow'] / $sn['mpAll'] * 120);
                     if ($lm[1] > 0) {
                         $lm[0] = 'hp_mp';
                     }
-                    $hpmp .= '<div id="vmp' . $u['id'] . '" title="������� ����" align="center" class="seemp" style="position:absolute; top:10px; left:-5px; width:120px; height:10px; z-index:12;">' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '</div>
-							 <div title="������� ����" class="hpborder" style="position:absolute; top:10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+                    $hpmp .= '<div id="vmp' . $u['id'] . '" title="Уровень маны" align="center" class="seemp" style="position:absolute; top:10px; left:-5px; width:120px; height:10px; z-index:12;">' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '</div>
+							 <div title="Уровень маны" class="hpborder" style="position:absolute; top:10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 							 <div class="' . $lm[0] . ' senohp" style="height:9px; position:absolute; top:10px; width:' . $lm[1] . 'px; z-index:11;" id="lmp' . $u['id'] . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div title="������� ����" class="hp_none" style="position:absolute; top:10px; width:120px; height:10px; z-index:10;"></div>';
+							 <div title="Уровень маны" class="hp_none" style="position:absolute; top:10px; width:120px; height:10px; z-index:10;"></div>';
                 } else {
                     $hptop = 5;
                 }
-                $hpmp = '<div id="vhp' . $u['id'] . '" title="������� �����" align="center" class="seehp" style="position:absolute; top:' . $hptop . 'px;  left:-5px; width:120px; height:10px; z-index:12;">' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '</div>
-						 <div title="������� �����" class="hpborder" style="position:absolute; top:' . $hptop . 'px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+                $hpmp = '<div id="vhp' . $u['id'] . '" title="Уровень жизни" align="center" class="seehp" style="position:absolute; top:' . $hptop . 'px;  left:-5px; width:120px; height:10px; z-index:12;">' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '</div>
+						 <div title="Уровень жизни" class="hpborder" style="position:absolute; top:' . $hptop . 'px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 						 <div class="' . $lh[0] . ' senohp" style="height:9px; width:' . $lh[1] . 'px; position:absolute; top:' . $hptop . 'px; z-index:11;" id="lhp' . $u['id'] . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div title="������� �����" class="hp_none" style="position:absolute; top:' . $hptop . 'px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>' . $hpmp;
-                //�������� �� � ��
+						 <div title="Уровень жизни" class="hp_none" style="position:absolute; top:' . $hptop . 'px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>' . $hpmp;
+                //Собираем НР и МР
                 $hpmp = '<div style="position:relative;">' . $hpmp . '</div>';
             } elseif ($type_info == 2) {
                 $hptop = 0;
@@ -9584,24 +9073,24 @@ LIMIT 1'));
                 }
                 if ($sn['mpAll'] > 0) {
 
-                    //����
+                    //мана
                     $lm = [0 => 'hp_none', 1 => 1];
                     $lm[1] = floor($sn['mpNow'] / $sn['mpAll'] * 200);
                     if ($lm[1] > 0) {
                         $lm[0] = 'hp_mp';
                     }
-                    $hpmp .= '<div id="vmp' . $u['id'] . '" title="������� ����" align="center" class="seemp" style="position:absolute; top:10px; width:200px; height:10px; z-index:12;"> ' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '</div>
-							 <div title="������� ����" class="hpborder" style="position:absolute; top:10px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+                    $hpmp .= '<div id="vmp' . $u['id'] . '" title="Уровень маны" align="center" class="seemp" style="position:absolute; top:10px; width:200px; height:10px; z-index:12;"> ' . floor($sn['mpNow']) . '/' . (0 + $sn['mpAll']) . '</div>
+							 <div title="Уровень маны" class="hpborder" style="position:absolute; top:10px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 							 <div class="' . $lm[0] . ' senohp" style="height:9px; position:absolute; top:10px; width:' . $lm[1] . 'px; z-index:11;" id="lmp' . $u['id'] . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div title="������� ����" class="hp_none" style="position:absolute; top:10px; width:200px; height:10px; z-index:10;"></div>';
+							 <div title="Уровень маны" class="hp_none" style="position:absolute; top:10px; width:200px; height:10px; z-index:10;"></div>';
                 } else {
                     $hptop = 5;
                 }
-                $hpmp = '<div id="vhp' . $u['id'] . '" title="������� �����" align="center" class="seehp" style="position:absolute; top:' . $hptop . 'px; width:200px; height:10px; z-index:12;"> ' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '</div>
-						 <div title="������� �����" class="hpborder" style="position:absolute; top:' . $hptop . 'px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+                $hpmp = '<div id="vhp' . $u['id'] . '" title="Уровень жизни" align="center" class="seehp" style="position:absolute; top:' . $hptop . 'px; width:200px; height:10px; z-index:12;"> ' . floor($sn['hpNow']) . '/' . (0 + $sn['hpAll']) . '</div>
+						 <div title="Уровень жизни" class="hpborder" style="position:absolute; top:' . $hptop . 'px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 						 <div class="' . $lh[0] . ' senohp" style="height:9px; width:' . $lh[1] . 'px; position:absolute; top:' . $hptop . 'px; z-index:11;" id="lhp' . $u['id'] . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div title="������� �����" class="hp_none" style="position:absolute; top:' . $hptop . 'px; width:200px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>' . $hpmp;
-                //�������� �� � ��
+						 <div title="Уровень жизни" class="hp_none" style="position:absolute; top:' . $hptop . 'px; width:200px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>' . $hpmp;
+                //Собираем НР и МР
                 $hpmp = '<div style="position:relative;height:20px;">' . $hpmp . '</div>';
             }
 
@@ -9619,30 +9108,30 @@ LIMIT 1'));
             }
             $pb = '';
             if ($u['banned'] > 0) {
-                $pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><strong>�������� ������������</strong></font></div>';
+                $pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><strong>Персонаж заблокирован</strong></font></div>';
             }
             if ($u['allLock'] > time()) {
-                $pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><strong>��������� ������ �������!</strong></font></div>';
+                $pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><strong>Временный запрет передач!</strong></font></div>';
             }
 
-            $swm = 0; //������ �����
+            $swm = 0; //свитки магии
             $l = 40;
             while ($l <= 52) {
                 if (isset($witm[$l])) {
                     $swm++;
                 } else {
-                    $witm[$l] = '<img title="������ ���� ����������" src="https://img.new-combats.com/i/items/w/w101.gif">';
+                    $witm[$l] = '<img title="Пустой слот заклинания" src="https://img.new-combats.com/i/items/w/w101.gif">';
                 }
                 $l++;
             }
 
-            $ssm = 0; //����� �����
+            $ssm = 0; //слоты сумки
             $l = 59;
             while ($l <= 62) {
                 if (isset($witm[$l])) {
                     $ssm++;
                 } else {
-                    $witm[$l] = '<img width="60" height="60" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w83.gif">';
+                    $witm[$l] = '<img width="60" height="60" title="Пустой слот сумка" src="https://img.new-combats.com/i/items/w/w83.gif">';
                 }
                 $l++;
             }
@@ -9687,20 +9176,20 @@ LIMIT 1'));
 
                 $zag = '<img width="243" height="283" style="position:absolute;top:-1px;left:-1px;" src="https://img.new-combats.com/i/zag/' . $u['zag'] . '">';
                 /*
-				$witmn[1] = '<img style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w9.gif">';
-				$witmn[2] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w13.gif">';
-				$witmn[3] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w3.gif">';
-				$witmn[4] = '<img style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w4.gif">';
-				$witmn[7] = '<img style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w5.gif">';
-				$witmn[8] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w1.gif">';
-				$witmn[9] = '<img style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w2.gif">';
-				$witmn[10] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[11] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[12] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[13] = '<img style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w11.gif">';
-				$witmn[14] = '<img style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/i/items/w/w10.gif">';
-				$witmn[16] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w19.gif">';
-				$witmn[17] = '<img style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w12.gif">';
+				$witmn[1] = '<img style="display:block;" title="Пустой слот шлем" src="https://img.new-combats.com/i/items/w/w9.gif">';
+				$witmn[2] = '<img style="display:block;" title="Пустой слот наручи" src="https://img.new-combats.com/i/items/w/w13.gif">';
+				$witmn[3] = '<img style="display:block;" title="Пустой слот оружие" src="https://img.new-combats.com/i/items/w/w3.gif">';
+				$witmn[4] = '<img style="display:block;" title="Пустой слот броня" src="https://img.new-combats.com/i/items/w/w4.gif">';
+				$witmn[7] = '<img style="display:block;" title="Пустой слот пояс" src="https://img.new-combats.com/i/items/w/w5.gif">';
+				$witmn[8] = '<img style="display:block;" title="Пустой слот серьги" src="https://img.new-combats.com/i/items/w/w1.gif">';
+				$witmn[9] = '<img style="display:block;" title="Пустой слот ожерелье" src="https://img.new-combats.com/i/items/w/w2.gif">';
+				$witmn[10] = '<img style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
+				$witmn[11] = '<img style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
+				$witmn[12] = '<img style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
+				$witmn[13] = '<img style="display:block;" title="Пустой слот перчатки" src="https://img.new-combats.com/i/items/w/w11.gif">';
+				$witmn[14] = '<img style="display:block;" title="Пустой слот щит" src="https://img.new-combats.com/i/items/w/w10.gif">';
+				$witmn[16] = '<img style="display:block;" title="Пустой слот поножи" src="https://img.new-combats.com/i/items/w/w19.gif">';
+				$witmn[17] = '<img style="display:block;" title="Пустой слот обувь" src="https://img.new-combats.com/i/items/w/w12.gif">';
 */
                 $j2 = 0;
                 while ($j2 <= 17) {
@@ -9753,36 +9242,36 @@ LIMIT 1'));
                 if ($zag == '') {
                     if ($i1 == 0) {
                         if (!isset($_GET['inv'])) {
-                            $invg = [0 => 'main.php?inv=1', 1 => '������'];
+                            $invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак'];
                         } else {
-                            $invg = [0 => 'main.php?skills=1', 1 => '������'];
+                            $invg = [0 => 'main.php?skills=1', 1 => 'Умения'];
                         }
                     } else {
                         $o = mysql_fetch_array(mysql_query('SELECT `id` FROM `obraz` WHERE `img` = "' . mysql_real_escape_string($this->info['obraz']) . '" AND `sex` = "' . $this->info['sex'] . '" LIMIT 1'));
-                        $invg = [0 => 'https://new-combats.com/shadow/' . $o['id'] . '" target="_blank', 1 => '������� �������'];
+                        $invg = [0 => 'https://new-combats.com/shadow/' . $o['id'] . '" target="_blank', 1 => 'Галерея образов'];
                     }
                     $uobr = 'i/obraz/' . $u['sex'] . '/' . $u['obraz'] . '';
                     if (isset($sn['items_img'][1])) {
                         $uobr = 'rimg/r' . $sn['items_img'][1];
                     }
                     $rt[0] .= '<div style="position:relative;height:220px;">
-								<!-- ����� -->
-									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'������� � &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/' . $uobr . '" ' . $oi . '></a></div>
+								<!-- образ -->
+									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/' . $uobr . '" ' . $oi . '></a></div>
 									<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">' . $eff . '</div>' . $anml . '
 							</div>';
                 } else {
                     if ($i1 == 0) {
                         if (!isset($_GET['inv'])) {
-                            $invg = [0 => 'main.php?inv=1', 1 => '������'];
+                            $invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак'];
                         } else {
-                            $invg = [0 => 'main.php?skills=1', 1 => '������'];
+                            $invg = [0 => 'main.php?skills=1', 1 => 'Умения'];
                         }
                     } else {
-                        $invg = [0 => 'https://lib.new-combats.com/obraz.php?namez=' . $u['zag'] . '" target="_blank', 1 => '������� �������'];
+                        $invg = [0 => 'https://lib.new-combats.com/obraz.php?namez=' . $u['zag'] . '" target="_blank', 1 => 'Галерея образов'];
                     }
                     $rt[0] .= '<div class="inf2s" style="position:relative;height:220px;">
-								<!-- ����� -->
-									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'������� � &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/1x1.gif" ' . $oi . '></a></div>
+								<!-- образ -->
+									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/1x1.gif" ' . $oi . '></a></div>
 									<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">' . $eff . '</div>' . $anml . '
 							</div>';
                 }
@@ -9872,12 +9361,12 @@ LIMIT 1'));
                 if ($zag == '') {
                     if ($i1 == 0) {
                         if (!isset($_GET['inv'])) {
-                            $invg = [0 => 'main.php?inv=1', 1 => '������'];
+                            $invg = [0 => 'main.php?inv=1', 1 => 'Рюкзак'];
                         } else {
-                            $invg = [0 => 'main.php?skills=1', 1 => '������'];
+                            $invg = [0 => 'main.php?skills=1', 1 => 'Умения'];
                         }
                     } else {
-                        $invg = [0 => 'https://lib.new-combats.com/obraz.php?name=' . $u['obraz'] . '" target="_blank', 1 => '������� �������'];
+                        $invg = [0 => 'https://lib.new-combats.com/obraz.php?name=' . $u['obraz'] . '" target="_blank', 1 => 'Галерея образов'];
                     }
                     $u['obraz'] = '0.gif';
                     $uobr = 'i/obraz/' . $u['sex'] . '/old/' . $u['obraz'] . '';
@@ -9885,8 +9374,8 @@ LIMIT 1'));
                         $uobr = 'rimg/r' . $sn['items_img'][1];
                     }
                     $rt[0] .= '<div style="position:relative;height:209px;">
-							<!-- ����� -->
-								<div style="position:absolute; width:76px; height:209px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'������� � &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="76" height="209" src="https://img.new-combats.com/' . $uobr . '" ' . $oi . '></a></div>
+							<!-- образ -->
+								<div style="position:absolute; width:76px; height:209px; z-index:1;"><a href="' . $invg[0] . '"><img onMouseOver="top.hi(this,\'Перейти в &quot;<strong>' . $invg[1] . '</strong>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="76" height="209" src="https://img.new-combats.com/' . $uobr . '" ' . $oi . '></a></div>
 								<div style="position:absolute; width:76px; height:auto; z-index:3;" align="left">' . $eff . '</div>' . $anml . '
 						</div>';
                 }
@@ -9941,8 +9430,8 @@ LIMIT 1'));
         if (isset($e['id'])) {
             $sleep = $this->testAction('`vars` = "sleep" AND `uid` = "' . $e['uid'] . '" LIMIT 1', 1);
             if ($e['id_eff'] == 2) {
-                //��������
-                $ev = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_main` WHERE `name` = "' . mysql_real_escape_string(str_replace('��������: ', '', $e['name'])) . '" LIMIT 1'));
+                //Проверка
+                $ev = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_main` WHERE `name` = "' . mysql_real_escape_string(str_replace('Изучение: ', '', $e['name'])) . '" LIMIT 1'));
                 $et = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "' . $e['uid'] . '" AND `vars` LIKE "%read%" AND `vals` = "' . $ev['id'] . '" LIMIT 1'));
                 if (isset($et['id'])) {
                     if ($et['time'] < time()) {
@@ -9969,7 +9458,7 @@ LIMIT 1'));
                         }
                     }
                     if (isset($u['id']) && ($e['type1'] < 11 || ($e['type1'] > 16 && $e['type1'] < 23)) && $e['noch'] == 0) {
-                        $text = '����������� �������� ������� &quot;<strong>' . $e['name'] . '</strong>&quot;';
+                        $text = 'Закончилось действие эффекта &quot;<strong>' . $e['name'] . '</strong>&quot;';
                         mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('" . $u['city'] . "','" . $u['room'] . "','','" . $u['login'] . "','" . $text . "','-1','6','0',1)");
                         if ($u['battle'] > 0) {
                             $lastHOD = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = "' . $u['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1'));
@@ -9978,7 +9467,7 @@ LIMIT 1'));
                                 if ($lastHOD['type'] != 6) {
                                     $id_hod++;
                                 }
-                                mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u['battle'] . '","' . ($id_hod) . '","{tm1} ' . $text . ' � ��������� {u1}.","login1=' . $u['login'] . '||t1=' . $u['team'] . '||time1=' . time() . '","","","","","6")');
+                                mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u['battle'] . '","' . ($id_hod) . '","{tm1} ' . $text . ' у персонажа {u1}.","login1=' . $u['login'] . '||t1=' . $u['team'] . '||time1=' . time() . '","","","","","6")');
                             }
                         }
                     }
@@ -10072,7 +9561,7 @@ LIMIT 1'));
 					`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
 					FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1'));
 					if(!isset($itm['id'])) {
-						$this->error = '������ ��������� ��������...';
+						$this->error = 'Группа предметов ошибочна...';
 						$notr++;
 					} else {
 						$itm['delete'] = 0;
@@ -10087,16 +9576,16 @@ LIMIT 1'));
             if (isset($tr['maks_itm_one']) && $tr['maks_itm_one'] > 0) {
                 $test = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $this->info['id'] . '" AND `inOdet` > 0 AND `delete` = 0 AND `data` LIKE "%maks_itm_one=' . $tr['maks_itm_one'] . '%" LIMIT 1'));
                 if (isset($test['id'])) {
-                    $this->error = '��������� ������������� �������� ������ ��������!';
+                    $this->error = 'Возможное использование максимум одного предмета!';
                     $notr++;
                 }
             }
             if ($this->info['twink'] > 0) {
-                //�� ������ 100 ���.
+                //Не дороже 100 екр.
                 if ($itm['price2'] > 100 || $itm['2price'] > 100) {
                     $notr++;
                 }
-                //������ ���� + �����
+                //Нельзя руны + чарки
                 if (isset($tr['rune']) && $tr['rune'] > 0) {
                     $notr++;
                 }
@@ -10134,11 +9623,11 @@ LIMIT 1'));
                 }
             }
             if ($notr > 0) {
-                //�� ������� ������������� ��� �� ��������� �������
+                //Не хватает характеристик или не совпадают условия
                 if (isset($tr['open']) && isset($_GET['open'])) {
-                    $this->error = '�� �� ������ ������� ������ �������';
+                    $this->error = 'Вы не можете открыть данный предмет';
                 } else {
-                    $this->error = '������ ����� ������ ������ �������� ������� ����';
+                    $this->error = 'Нельзя одеть больше одного предмета данного типа';
                 }
                 return 0;
             } elseif (isset($tr['open']) && isset($_GET['open']) && isset($tr['items_in_file'])) {
@@ -10150,45 +9639,45 @@ LIMIT 1'));
                     require('_incl_data/class/magic/' . $tr['items_in_file'] . '.php');
                     if (!isset($no_open_itm)) {
                         $this->deleteItem($itm['id'], $this->info['id']);
-                        $this->error = '�� ������� ������� &quot;' . $itm['name'] . '&quot;:<br>' . $io . '...';
+                        $this->error = 'Вы успешно открыли &quot;' . $itm['name'] . '&quot;:<br>' . $io . '...';
                     } else {
                         unset($no_open_itm);
                     }
                 } else {
-                    $this->error = '������� &quot;' . $itm['name'] . '&quot; ���������� �������...';
+                    $this->error = 'Предмет &quot;' . $itm['name'] . '&quot; невозможно открыть...';
                 }
             } elseif (isset($tr['open']) && isset($_GET['open'])) {
-                //��������� �������
+                //открываем предмет
                 $io = '';
                 $i = 0;
                 $itms = explode(',', $tr['items_in']);
 
 
                 if ($itm['type'] == 37) {
-                    //������������� ��������
+                    //Распаковываем упаковку
                     $io = '';
                     $itmin = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "' . $tr['item_inbox'] . '" LIMIT 1'));
                     $itmmn = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "' . $itmin['item_id'] . '" LIMIT 1'));
                     //
                     if ($itm['gift'] == '' || $itm['gift'] == '0') {
-                        $this->error = '������� ������ ���� �������, ������ ��� ��� ���������!';
+                        $this->error = 'Предмет должен быть подарен, прежде чем его открывать!';
                     } elseif (!isset($itmin['id'])) {
-                        $this->error = '� �������� ������ ���, ������ ����� ������� ���-�� ������� �� ����...';
+                        $this->error = 'В упаковке ничего нет, скорее всего предмет кто-то вытащил от туда...';
                     } else {
                         $io .= $itmmn['name'];
                         if ($itmin['item_id'] == 4867) {
-                            //�� ��������
+                            //Не откроешь
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
-                            $this->error = '�� ������� ������� �������. ���������� ���������.';
+                            $this->error = 'Не удалось открыть подарок. Содержимое испорчено.';
                         } elseif ($itmin['item_id'] == 4868) {
-                            //������� ����
+                            //Летучая мышь
                             mysql_query('UPDATE `stats` SET `hpNow` = 1,`mpNow` = 1 WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
-                            $this->error = '�� �������� ��� HP...';
+                            $this->error = 'Вы потеряли все HP...';
                         } elseif ($itmin['item_id'] == 4870) {
-                            //������ ��������
+                            //Минута молчания
                             if ($this->info['molch1'] > time()) {
                                 $this->info['molch1'] += 3600;
                             } else {
@@ -10197,90 +9686,90 @@ LIMIT 1'));
                             mysql_query('UPDATE `users` SET `molch1` = "' . $this->info['molch1'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
-                            $this->error = '�� ��������� ��� �������� �������� ��������...';
+                            $this->error = 'Вы оказались под действие заклятия молчания...';
                         } elseif ($itmin['item_id'] == 4873) {
-                            //�������� ��
+                            //Крысиный яд
                             $a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "' . $this->info['id'] . '" AND `id` = "' . $this->info['animal'] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
                             if (isset($a['id'])) {
-                                $this->error = '��� ����� &quot;' . $a['name'] . '&quot; ������� ���������...';
+                                $this->error = 'Ваш зверь &quot;' . $a['name'] . '&quot; странно позеленел...';
                                 mysql_query('UPDATE `users_animal` SET `eda` = 0, `yad` = "' . (time() + 86400 * 7) . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1');
                             } else {
-                                $this->error = '���-�� ������� �������� ������ �����, �������� � ��� ��� :)';
+                                $this->error = 'Кто-то пытался отравить вашего зверя, которого у вас нет :)';
                             }
                         } elseif ($itmin['item_id'] == 4869) {
-                            //����������� ������  (������ ������ �� 1 ���)
+                            //Неасчастный случай  (легкая травма на 1 час)
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
                             mysql_query('INSERT INTO `eff_users`
 							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
 								"0","' . (time() + 3600) . '","-1",
-								"������� � ������������","add_s' . rand(1, 3) . '=-' . rand(5, 15) . '","' . $this->info['id'] . '",
+								"Неверие в человечество","add_s' . rand(1, 3) . '=-' . rand(5, 15) . '","' . $this->info['id'] . '",
 								"4", "bad_present_travma1.gif","0", "1"
 							)');
-                            $this->error = '�� ������������. � ��� ����� � ���������...';
+                            $this->error = 'Вы травмированы. В том числе и физически...';
                         } elseif ($itmin['item_id'] == 4872) {
-                            //��������  (������� ������ �� 1 ���)
+                            //Трагедия  (средняя травма на 1 час)
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
                             mysql_query('INSERT INTO `eff_users`
 							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
 								"0","' . (time() + 3600) . '","-1",
-								"������� � ������������","add_s' . rand(1, 3) . '=-' . rand(16, 25) . '","' . $this->info['id'] . '",
+								"Неверие в человечество","add_s' . rand(1, 3) . '=-' . rand(16, 25) . '","' . $this->info['id'] . '",
 								"4", "bad_present_travma2.gif","0", "2"
 							)');
-                            $this->error = '�� ������������. � ��� ����� � ���������...';
+                            $this->error = 'Вы травмированы. В том числе и физически...';
                         } elseif ($itmin['item_id'] == 4876) {
-                            //����������  (������� ������ �� 1 ���)
+                            //Катастрофа  (тяжелая травма на 1 час)
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
                             mysql_query('INSERT INTO `eff_users`
 							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
 								"0","' . (time() + 3600) . '","-1",
-								"������� � ������������","add_s' . rand(1, 3) . '=-' . rand(26, 35) . '","' . $this->info['id'] . '",
+								"Неверие в человечество","add_s' . rand(1, 3) . '=-' . rand(26, 35) . '","' . $this->info['id'] . '",
 								"4", "bad_present_travma3.gif","0", "3"
 							)');
-                            $this->error = '�� ������������. � ��� ����� � ���������...';
+                            $this->error = 'Вы травмированы. В том числе и физически...';
                         } elseif ($itmin['item_id'] == 4878) {
-                            //������������  (add_puti=7200)
+                            //Недвижимость  (add_puti=7200)
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
                             mysql_query('INSERT INTO `eff_users`
 							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
 								"0","' . (time() + 7200) . '","-1",
-								"������������","add_puti=1","' . $this->info['id'] . '",
+								"Недвижимость","add_puti=1","' . $this->info['id'] . '",
 								"4", "bad_present_chains.gif","0", "3"
 							)');
-                            $this->error = '�� �� ������ �������������...';
+                            $this->error = 'Вы не можете передвигаться...';
                         } elseif ($itmin['item_id'] == 4874) {
-                            //������� ��� ����  �� ���
+                            //Сюрприз для мага  на час
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
                             mysql_query('INSERT INTO `eff_users`
 							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
 								"0","' . (time() + 3600) . '","-1",
-								"������� ��� ����","add_s5=-50","' . $this->info['id'] . '",
+								"Сюрприз для Мага","add_s5=-50","' . $this->info['id'] . '",
 								"4", "bad_present_dmage.gif","0", "3"
 							)');
-                            $this->error = '��� ��������...';
+                            $this->error = 'Вам нехорошо...';
                         } elseif ($itmin['item_id'] == 4871) {
-                            //������� ��� �����  �� ���
+                            //Сюрприз для воина  на час
                             $this->deleteItem($itm['id'], $this->info['id']);
                             $this->deleteItem($itmin['id'], $this->info['id']);
                             mysql_query('INSERT INTO `eff_users`
 							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
 								"0","' . (time() + 3600) . '","-1",
-								"������� ��� �����","add_s1=-50","' . $this->info['id'] . '",
+								"Сюрприз для Воина","add_s1=-50","' . $this->info['id'] . '",
 								"4", "bad_present_dfighter.gif","0", "3"
 							)');
-                            $this->error = '��� ��������...';
-                        } elseif (mysql_query('UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = "������� �� ��������. ���� ���������: ' . date('d.m.Y H:i:s', $itmin['time_create']) . '" WHERE `id` = "' . $itmin['id'] . '" LIMIT 1')) {
-                            //������� ��������
+                            $this->error = 'Вам нехорошо...';
+                        } elseif (mysql_query('UPDATE `items_users` SET `uid` = "' . $this->info['id'] . '",`lastUPD` = "' . time() . '",`gift` = "' . $itm['gift'] . '",`gtxt1` = "' . $itm['gtxt1'] . '",`gtxt2` = "Предмет из упаковки. Дата запаковки: ' . date('d.m.Y H:i:s', $itmin['time_create']) . '" WHERE `id` = "' . $itmin['id'] . '" LIMIT 1')) {
+                            //Удаляем упаковку
                             $this->deleteItem($itm['id'], $this->info['id']);
-                            $this->error = '�� ������� ������� &quot;' . $itm['name'] . '&quot;, ������ ���� �������:<br>' . $io . '...';
+                            $this->error = 'Вы успешно открыли &quot;' . $itm['name'] . '&quot;, внутри было найдено:<br>' . $io . '...';
                         } else {
-                            $this->error = '��������� ������� �������, ��� �� ���?';
+                            $this->error = 'Неудалось открыть подарок, что же там?';
                         }
                         //
                     }
@@ -10312,7 +9801,7 @@ LIMIT 1'));
                         mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '",`inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                     }
                     $this->deleteItem($itm['id'], $this->info['id']);
-                    $this->error = '�� ������� ������� &quot;' . $itm['name'] . '&quot;, ������ ���� �������:<br>' . $io . '...';
+                    $this->error = 'Вы успешно открыли &quot;' . $itm['name'] . '&quot;, внутри было найдено:<br>' . $io . '...';
                 }
             } else {
                 $inSlot = $itm['inslot'];
@@ -10322,13 +9811,13 @@ LIMIT 1'));
                     $d[$p['inOdet']] = $p['id'];
                 }
 
-                //���� � ���� ������ � ����� ����� � ����� ����
+                //Если в слот оружия и можно одеть в левую руку
                 if ($itm['2too'] == 1 && $inSlot == 3 && isset($d[3])) {
                     $inSlot = 14;
                 }
 
                 if ($inSlot == 3 || $inSlot == 14) {
-                    //��������� ����-�� ��������� ������
+                    //Проверяем есть-ли двуручное оружие
                     if ($this->stats['items'][$this->stats['wp3id']]['2h'] == 1 || $this->stats['items'][$this->stats['wp14id']]['2h'] == 1 || $itm['2h'] == 1) {
                         $this->snatItem($this->stats['items'][$this->stats['wp3id']]['id'], $uid);
                         $this->snatItem($this->stats['items'][$this->stats['wp14id']]['id'], $uid);
@@ -10391,7 +9880,7 @@ LIMIT 1'));
                     mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `inGroup` = 0, `delete` = 0 WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                 }
                 if ($upd) {
-                    //���� ������� ������������� ����� ��������
+                    //Если предмет привязывается после одевания
                     //if($itm[''])
                     //{
                     //
@@ -10400,12 +9889,12 @@ LIMIT 1'));
                     mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                     return 1;
                 } else {
-                    $this->error = '(!) ������ ���������� ������';
+                    $this->error = '(!) Ошибка обновления данных';
                     return 0;
                 }
             }
         } else {
-            $this->error = '������� �� ������ � ����� �������';
+            $this->error = 'Предмет не найден в вашем рюкзаке';
             return 0;
         }
     }
@@ -10422,14 +9911,14 @@ LIMIT 1'));
         if (isset($itm['id'])) {
 
             if ($coldel == 0) {
-                //������� �������
+                //Удаляем целиком
                 $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `id`="' . $itm['id'] . '" LIMIT 1');
                 $col = $this->itemsX($itm['id']);
                 if ($col > 0) {
                     mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '",`inGroup` = "0" WHERE `inGroup`="' . $itm['id'] . '" LIMIT ' . $col);
                 }
             } else {
-                //������� ���������� ���-��
+                //Удаляем конкретное кол-во
                 $col = $this->itemsX($itm['id']);
                 if ($col > 1) {
                     if ($col <= $coldel) {
@@ -10437,7 +9926,7 @@ LIMIT 1'));
                     }
                     $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '",`inGroup` = "0" WHERE `inGroup`="' . $itm['id'] . '" AND `delete` = "1000" LIMIT ' . $coldel);
                 } else {
-                    //������� �������
+                    //Удаляем целиком
                     $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `id`="' . $itm['id'] . '" LIMIT 1');
                     $upd = mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '",`inGroup` = "0" WHERE `inGroup`="' . $itm['id'] . '" AND `delete` = "1000" LIMIT ' . $col);
                 }
@@ -10452,18 +9941,18 @@ LIMIT 1'));
                     $col = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr));
                     $col = $col[0];
                     mysql_query('UPDATE `items_users` SET `lastUPD`="' . time() . '",`delete`="' . time() . '" WHERE `item_id`="' . $itm['item_id'] . '" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "' . $itm['uid'] . '" AND `data` NOT LIKE "%nodelete%"' . $whr);
-                    $this->error = '�������� "' . $itm['name'] . ' (x' . ($col + 1) . ')" ���������';
-                    $this->addDelo(1, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: �������� &quot;<strong>' . $itm['name'] . ' (x' . $col . ')</strong>&quot; [itm:' . $itm['id'] . '=' . time() . '] ���� <strong>���������</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
+                    $this->error = 'Предметы "' . $itm['name'] . ' (x' . ($col + 1) . ')" выброшены';
+                    $this->addDelo(1, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: Предметы &quot;<strong>' . $itm['name'] . ' (x' . $col . ')</strong>&quot; [itm:' . $itm['id'] . '=' . time() . '] были <strong>выброшены</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
                 } else {
-                    $this->error = '������� "' . $itm['name'] . '" ��������';
-                    $this->addDelo(1, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: ������� &quot;<strong>' . $itm['name'] . '</strong>&quot; [itm:' . $itm['id'] . '] ��� <strong>��������</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
+                    $this->error = 'Предмет "' . $itm['name'] . '" выброшен';
+                    $this->addDelo(1, $uid, '&quot;<font color="maroon">System.inventory</font>&quot;: Предмет &quot;<strong>' . $itm['name'] . '</strong>&quot; [itm:' . $itm['id'] . '] был <strong>выброшен</strong>.', time(), $this->info['city'], 'System.inventory', 0, 0);
                 }
                 return 1;
             } else {
                 return 0;
             }
         } else {
-            $this->error = '������� �� ������ � ����� �������';
+            $this->error = 'Предмет не найден в вашем рюкзаке';
         }
     }
 
@@ -10570,7 +10059,7 @@ LIMIT 1'));
                 $sts = explode('|', $u['stats']);
                 $i = 0;
                 $ste = '';
-                //������ ��������������
+                //Родные характеристики
                 while ($i < count($sts)) {
                     $ste = explode('=', $sts[$i]);
                     if (isset($ste[1])) {
@@ -10601,7 +10090,7 @@ LIMIT 1'));
 					');
                 }
 
-                //��������� ��������
+                //Шаблонные картинки
                 if ($this->info['id'] == $u['id'] || $reimg != false) {
                     $sp_img = mysql_query('SELECT * FROM `items_img` WHERE `uid` = "' . $u['id'] . '" AND `img_id` != "0" LIMIT 16');
                     while ($pl_img = mysql_fetch_array($sp_img)) {
@@ -10614,7 +10103,7 @@ LIMIT 1'));
                     }
                 }
 
-                //�������������� �� ��������� //��� tr_lvl
+                //Характеристики от предметов //ТУТ tr_lvl
                 $cl = mysql_query('SELECT 
 				`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
 				`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
@@ -10625,7 +10114,7 @@ LIMIT 1'));
                 $hnd2 = 0;
                 $sht1 = 0;
                 $reitm = [];
-                $coms = []; // ���������
+                $coms = []; // комплекты
                 $dom = [];
                 $btl_cof = 0;
                 $oza = [
@@ -10633,13 +10122,13 @@ LIMIT 1'));
                     2 => [0, 0],
                     3 => [0, 0],
                     4 => [0, 0]
-                ]; //����������� ������
+                ]; //особенности защиты
                 $ozm = [
                     1 => [0, 0],
                     2 => [0, 0],
                     3 => [0, 0],
                     4 => [0, 0]
-                ]; //����������� �����
+                ]; //особенности магии
 
                 $itmslvl = 0;
                 $itmsCfc = 0;
@@ -10652,7 +10141,7 @@ LIMIT 1'));
                             $st['irka'] += $pl['price1'];
                         }
                     }
-                    /* ������������� */
+                    /* Доминирование */
                     //$dom[count($dom)] = array($pl['inOdet'],$pl['class'],$pl['class_point'],$pl['anti_class'],$pl['anti_class_point'],$pl['level'],$u['level'],$pl['price2']);
 
 
@@ -10741,46 +10230,46 @@ LIMIT 1'));
                         if (isset($sti['add_oza' . $ko])) {
                             if (isset($sti['add_oza'])) {
                                 if ($sti['add_oza'] == 1) {
-                                    //������
+                                    //Слабая
                                     $oza[$ko][0] += 1;
                                     $oza[$ko][1] += 9;
                                 } elseif ($sti['add_oza'] == 2) {
-                                    //����������
+                                    //Нормальная
                                     $oza[$ko][0] += 20;
                                     $oza[$ko][1] += 39;
                                 } elseif ($sti['add_oza'] == 3) {
-                                    //�������
+                                    //Хорошая
                                     $oza[$ko][0] += 40;
                                     $oza[$ko][1] += 69;
                                 } elseif ($sti['add_oza'] == 4) {
-                                    //��������������
+                                    //Посредственная
                                     $oza[$ko][0] += 10;
                                     $oza[$ko][1] += 19;
                                 } elseif ($sti['add_oza'] == 5) {
-                                    //������������
+                                    //Великолепная
                                     $oza[$ko][0] += 70;
                                     $oza[$ko][1] += 89;
                                 }
                             }
                             if (isset($sti['add_ozm'])) {
                                 if ($sti['add_ozm'] == 1) {
-                                    //������
+                                    //Слабая
                                     $ozm[$ko][0] += 1;
                                     $ozm[$ko][1] += 9;
                                 } elseif ($sti['add_ozm'] == 2) {
-                                    //����������
+                                    //Нормальная
                                     $ozm[$ko][0] += 20;
                                     $ozm[$ko][1] += 39;
                                 } elseif ($sti['add_ozm'] == 3) {
-                                    //�������
+                                    //Хорошая
                                     $ozm[$ko][0] += 40;
                                     $ozm[$ko][1] += 69;
                                 } elseif ($sti['add_ozm'] == 4) {
-                                    //��������������
+                                    //Посредственная
                                     $ozm[$ko][0] += 10;
                                     $ozm[$ko][1] += 19;
                                 } elseif ($sti['add_ozm'] == 5) {
-                                    //������������
+                                    //Великолепная
                                     $ozm[$ko][0] += 70;
                                     $ozm[$ko][1] += 89;
                                 }
@@ -10789,45 +10278,45 @@ LIMIT 1'));
                                 $ozm[$ko][1] += 9;
                             }
                             if ($sti['add_oza' . $ko] == 1) {
-                                //������
+                                //Слабая
                                 $oza[$ko][0] += 1;
                                 $oza[$ko][1] += 9;
                             } elseif ($sti['add_oza' . $ko] == 2) {
-                                //����������
+                                //Нормальная
                                 $oza[$ko][0] += 20;
                                 $oza[$ko][1] += 39;
                             } elseif ($sti['add_oza' . $ko] == 3) {
-                                //�������
+                                //Хорошая
                                 $oza[$ko][0] += 40;
                                 $oza[$ko][1] += 69;
                             } elseif ($sti['add_oza' . $ko] == 4) {
-                                //��������������
+                                //Посредственная
                                 $oza[$ko][0] += 10;
                                 $oza[$ko][1] += 19;
                             } elseif ($sti['add_oza' . $ko] == 5) {
-                                //������������
+                                //Великолепная
                                 $oza[$ko][0] += 70;
                                 $oza[$ko][1] += 89;
                             }
                             if (isset($sti['add_ozm' . $ko])) {
                                 if ($sti['add_ozm' . $ko] == 1) {
-                                    //������
+                                    //Слабая
                                     $ozm[$ko][0] += 1;
                                     $ozm[$ko][1] += 9;
                                 } elseif ($sti['add_ozm' . $ko] == 2) {
-                                    //����������
+                                    //Нормальная
                                     $ozm[$ko][0] += 20;
                                     $ozm[$ko][1] += 39;
                                 } elseif ($sti['add_ozm' . $ko] == 3) {
-                                    //�������
+                                    //Хорошая
                                     $ozm[$ko][0] += 40;
                                     $ozm[$ko][1] += 69;
                                 } elseif ($sti['add_ozm' . $ko] == 4) {
-                                    //��������������
+                                    //Посредственная
                                     $ozm[$ko][0] += 10;
                                     $ozm[$ko][1] += 19;
                                 } elseif ($sti['add_ozm' . $ko] == 5) {
-                                    //������������
+                                    //Великолепная
                                     $ozm[$ko][0] += 70;
                                     $ozm[$ko][1] += 89;
                                 }
@@ -10908,13 +10397,13 @@ LIMIT 1'));
                         $st['zona'] += $sti['zona'];
                     }
 
-                    //��������� ����� �� ������� ��������
+                    //Добавляем статы от данного предмета
                     if (!isset($sti['restart_stats'])) {
                         $i = 0;
                         while ($i < count($ia)) {
                             if (isset($ia[$i])) {
 
-                                //��������� �� (��������� ��)
+                                //Действует на (Действует на)
                                 if (isset($sti['add_' . $ia[$i]])) {
 
                                     if ($ia[$i] != 'zmproc' && $ia[$i] != 'zaproc') {
@@ -10954,13 +10443,13 @@ LIMIT 1'));
                     }
                 }
 
-                //����������� ���-�� � ������
+                //Сохраненные хар-ки и умения
                 if (count($reitm) > 0) {
                     $i39 = [0 => 0, 1 => 0, 2 => 0];
                     $i = 0;
                     while ($i < count($reitm)) {
                         if (isset($reitm[$i]['sm_skill']) && $i39[0] == 0) {
-                            //������
+                            //умения
                             $i9 = 1;
                             $i39[0] = 1;
                             while ($i9 <= 7) {
@@ -10969,7 +10458,7 @@ LIMIT 1'));
                                 $i9++;
                             }
                         } elseif (isset($reitm[$i]['sm_abil']) && $i39[1] == 0) {
-                            //�����
+                            //статы
                             $i9 = 1;
                             $i39[1] = 1;
                             while ($i9 <= 12) {
@@ -10977,7 +10466,7 @@ LIMIT 1'));
                                 $i9++;
                             }
                         } elseif (isset($reitm[$i]['sm_skill2']) && $i39[2] == 0) {
-                            //������
+                            //навыки
 
                             $i39[2] = 1;
                         }
@@ -10985,7 +10474,7 @@ LIMIT 1'));
                     }
                 }
 
-                //����� �� ������
+                //Харки от иконок
                 $efs = mysql_query('SELECT * FROM `users_ico` WHERE `uid`="' . mysql_real_escape_string($u['id']) . '" AND (`endTime` > "' . time() . '" OR `endTime` = 0)');
                 while ($e = mysql_fetch_array($efs)) {
                     $sts = $this->lookStats($e['bonus']);
@@ -11011,7 +10500,7 @@ LIMIT 1'));
                     }
                 }
                 /*if( $u['battle'] > 0 ) {
-					//��������
+					//Кэшируем
 					$cache_items = array(
 						'st' => $st,
 						'sti' => $sti,
@@ -11040,7 +10529,7 @@ LIMIT 1'));
                 $test_noef = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_actions` WHERE `uid` = "' . $u['id'] . '" AND `vars` = "noeffectbattle1" AND `btl` = "' . $u['battle'] . '" LIMIT 1'));
             }
             //}
-            //�������������� �� ��������
+            //Характеристики от эффектов
             $h = 0;
             $nbs = [];
             $prsu = [];
@@ -11052,7 +10541,7 @@ LIMIT 1'));
                     if ($u['dnow'] == 0) {
                         if ($u['battle'] == 0) {
                             mysql_query('DELETE FROM `eff_users` WHERE `id_eff` = "' . $e['id_eff'] . '" AND `uid` = "' . $u['id'] . '" AND `id` != "' . $e['id'] . '" ORDER BY `id` ASC');
-                            //��������� � ������
+                            //Переводим в заряды
                             if ($e['v1'] != 'priem') {
                                 if ($e['hod'] != -1) {
                                     mysql_query('UPDATE `eff_users` SET `hod` = "-1",`timeUse` = "' . (time() + ($e['hod'] * $c['effz']) - $e['actionTime']) . '" WHERE `id` = "' . $e['id'] . '" LIMIT 1');
@@ -11071,9 +10560,9 @@ LIMIT 1'));
                     }
                     //echo '['.date( 'd.m.Y H:i:s' , time() + round((($e['timeUse']+$e['timeAce']+$e['actionTime'])-time())/$c['effz'])*$c['effz']).']';
                     if (true == false && $test_btl_info['noeff'] == 1 && isset($this->ekrcast[$e['id_eff']])) {
-                        //������� �� ���������
+                        //эффекты не действуют
                     } elseif ($e['sleeptime'] != 0 && substr_count($e['v1'], 'pgb') > 0) {
-                        //�� ���������� �������� ����������� �� ����� ���
+                        //Не отображаем действие пристрастия во время сна
                     } elseif (($e['timeUse'] + $e['timeAce'] + $e['actionTime'] > time() || $e['timeUse'] == 77)) {
                         if ($e['v1'] == 'priem') {
                             $prsu[$e['v2']] = 0 + $prsu['x'];
@@ -11136,7 +10625,7 @@ LIMIT 1'));
                             $i++;
                         }
                     } elseif ($e['timeUse'] != 77) {
-                        //������� ������
+                        //удаляем эффект
                         if ($e['img2'] != 'tz.gif' || $u['id'] == $this->info['id']) {
                             if ($e['sleeptime'] == 0) {
                                 $this->endEffect($e['id'], $u);
@@ -11149,38 +10638,38 @@ LIMIT 1'));
                 $st['noeffectbattle1'] = 1;
             }
 
-            //�������� �� ��������
+            //Заглушки от эффектов
             //$st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format'];
             if ($nbs[4899] > 0) {
-                //������� ��������
+                //Зеленый комплект
                 $st['items_img'][8] = 'robe_illusion4.gif';
                 $st['items_img'][11] = 'leg_illusion4.gif';
             } elseif ($nbs[4900] > 0) {
-                //������ ��������
+                //Золото комплект
                 $st['items_img'][8] = 'robe_illusion5.gif';
                 $st['items_img'][11] = 'leg_illusion5.gif';
             } elseif ($nbs[4901] > 0) {
-                //������� ��������
+                //Голубой комплект
                 $st['items_img'][8] = 'robe_illusion3.gif';
                 $st['items_img'][11] = 'leg_illusion3.gif';
             } elseif ($nbs[4902] > 0) {
-                //����� ��������
+                //Синий комплект
                 $st['items_img'][8] = 'robe_illusion6.gif';
                 $st['items_img'][11] = 'leg_illusion6.gif';
             } elseif ($nbs[4903] > 0) {
-                //������ ��������
+                //Желтый комплект
                 $st['items_img'][8] = 'robe_illusion8.gif';
                 $st['items_img'][11] = 'leg_illusion8.gif';
             } elseif ($nbs[4904] > 0) {
-                //��������� ������
+                //Сиреневое платье
                 $st['items_img'][8] = 'robe_illusion7.gif';
                 $st['items_img'][11] = 'leg_illusion7.gif';
             } elseif ($nbs[4905] > 0) {
-                //��������� ������
+                //Оранжевое платье
                 $st['items_img'][8] = 'robe_illusion9.gif';
                 $st['items_img'][11] = 'leg_illusion9.gif';
             } elseif ($nbs[4908] > 0) {
-                //����� ������ ������
+                //Набор Темной Одежды
                 $st['items_img'][8] = 'robe_illusion2.gif';
                 $st['items_img'][11] = 'leg_illusion2.gif';
                 $st['items_img'][10] = 'boots_illusion2.gif';
@@ -11189,7 +10678,7 @@ LIMIT 1'));
                 $st['items_img'][4] = 'helmet_illusion2.gif';
                 $st['items_img'][12] = 'perchi_illusion2.gif';
             } elseif ($nbs[4906] > 0) {
-                //����� ������������� ������
+                //Набор Бриллиантовой Одежды
                 $st['items_img'][8] = 'robe_illusion1.gif';
                 $st['items_img'][11] = 'leg_illusion1.gif';
                 $st['items_img'][10] = 'boots_illusion1.gif';
@@ -11199,14 +10688,14 @@ LIMIT 1'));
                 $st['items_img'][12] = 'perchi_illusion1.gif';
             }
             if ($nbs[4909] > 0) {
-                //����� ������� ���������
+                //Набор Золотых украшений
                 $st['items_img'][13] = 'ring_illusion2.gif';
                 $st['items_img'][17] = 'ring_illusion2.gif';
                 $st['items_img'][18] = 'ring_illusion2.gif';
                 $st['items_img'][14] = 'amulet_illusion2.gif';
                 $st['items_img'][15] = 'earrings_illusion2.gif';
             } elseif ($nbs[4907] > 0) {
-                //����� ������� ���������
+                //Набор Золотых украшений
                 $st['items_img'][13] = 'ring_illusion1.gif';
                 $st['items_img'][17] = 'ring_illusion1.gif';
                 $st['items_img'][18] = 'ring_illusion1.gif';
@@ -11215,7 +10704,7 @@ LIMIT 1'));
             }
 
             if ($itmslvl < 5) {
-                //������ ����������
+                //Эффект ослабления
                 $st['itmslvl'] = 0;
             } else {
                 $st['itmslvl'] = 1;
@@ -11226,7 +10715,7 @@ LIMIT 1'));
             unset($test_btl_info);
 
             if ($u['battle'] > 0) {
-                //�������������� �� �������
+                //Характеристики от приемов
                 $efs = mysql_query('SELECT `eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`tr_life_user`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace` FROM `eff_users` AS `eu` WHERE `eu`.`uid`="' . mysql_real_escape_string($u['id']) . '" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "' . time() . '" AND `eu`.`v1` = "priem" ORDER BY `eu`.`id` ASC');
                 $st['set_pog'] = [];
                 $st['set_pog2'] = [];
@@ -11315,14 +10804,14 @@ LIMIT 1'));
                             $i++;
                         }
                     } elseif ($e['timeUse'] != 77) {
-                        //������� ������
+                        //удаляем эффект
                         $this->endEffect($e['id'], $u);
                         $st['act'] = 1;
                     }
                 }
             }
 
-            //����� ����������
+            //Бонус покупателя
             /*$bl = mysql_fetch_array(mysql_query('SELECT `id`,`level` FROM `users_paybonus` WHERE `id` = "'.$u['id'].'" LIMIT 1'));
 			$st['pbe'] = 0+$bl['level'];
 			if( $st['pbe'] > 1000 ) {
@@ -11330,7 +10819,7 @@ LIMIT 1'));
 			}
 			unset($bl);*/
 
-            //���� ������
+            //Клан абилки
             /*
 			if( $st['clanpos'] > 0 ) {
 				if( $st['clanpos'] == 1 ) {
@@ -11363,7 +10852,7 @@ LIMIT 1'));
 				}
 			}*/
 
-            //�������������� �� ������
+            //Характеристики от статов
 
             if (!isset($st['hpAll'])) {
                 $st['hpAll'] = 0;
@@ -11379,26 +10868,26 @@ LIMIT 1'));
             }
             @$st['mpAll'] += @$st['s6'] * 10;
 
-            //������
+            //Турнир
             if (!isset($st['m1'])) {
                 $st['m1'] = 0;
             }
             $st['m1'] += $st['s3'] * 5;
 
 
-            // ��.����-���� = 2.5
+            // мф.анти-крит = 2.5
             if (!isset($st['m2'])) {
                 $st['m2'] = 0;
             }
             $st['m2'] += $st['s3'] * 5;
 
-            // ��.������ = 2.5
+            // мф.уворот = 2.5
             if (!isset($st['m4'])) {
                 $st['m4'] = 0;
             }
             $st['m4'] += $st['s2'] * 5;
 
-            // ��.����-������ = 2.5
+            // мф.анти-уворот = 2.5
             if (!isset($st['m5'])) {
                 $st['m5'] = 0;
             }
@@ -11434,7 +10923,7 @@ LIMIT 1'));
 			}
 			$st['pa2']	 += $st['s1']*0.1;*/
 
-            if (!isset($st['zaproc'])) { //��� �� 'zaproc'=>'������ �� ����� (%)','zmproc'=>'������ �� ����� ������ (%)
+            if (!isset($st['zaproc'])) { //Тут зм 'zaproc'=>'Защита от урона (%)','zmproc'=>'Защита от магии стихий (%)
                 $st['zaproc'] = 0;
             }
             $st['zaproc'] += round($st['s5'] * 0);
@@ -11444,8 +10933,8 @@ LIMIT 1'));
             }
             $st['m19'] += round($st['s3'] * 0.03);
 
-            //��������
-            //�������� ������ "�������� ����. �����". ����
+            //Мощности
+            //Мощность против "Мощность крит. урона". Гамс
             if (!isset($st['antm3'])) {
                 $st['antm3'] = 0;
             }
@@ -11473,15 +10962,15 @@ LIMIT 1'));
             }
             $st['m8'] += 0;
 
-            //������ ����������
+            //Бонусы комплектов
             $i = 0;
             while ($i <= count(@$coms['new'])) {
                 if (@isset($coms['new'][$i])) {
-                    //$coms[$i]['id'] - id ���������, $j - ���-�� ��������� ������� ���������
+                    //$coms[$i]['id'] - id комплекта, $j - кол-во предметов данного комплекта
                     $j = @$coms['com'][$coms['new'][$i]];
                     $com = mysql_fetch_array(mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "' . ((int)$coms['new'][$i]) . '" AND `x` <= ' . ((int)$j) . ' ORDER BY  `x` DESC  LIMIT 1'));
                     if (isset($com['id'])) {
-                        //��������� �������� ���������
+                        //добавляем действия комплекта
                         $ij = 0;
                         $sti = $this->lookStats($com['data']);
                         while ($ij < count($ia)) {
@@ -11495,10 +10984,10 @@ LIMIT 1'));
                 $i++;
             }
 
-            //������ ������
-            //������ �������
+            //Бонусы статов
+            //Замена свитков
             if ($u['autospell'] != '' && $u['autospell'] != 0 && $u['battle'] == 0) {
-                //��������� ������
+                //проверяем свитки
                 $splink = '';
                 $spi = mysql_query('SELECT `id`,`item_id`,`inOdet` FROM `items_users` WHERE `inOdet` >= 40 AND `inOdet` <= 50 AND `uid` = "' . $u['id'] . '" AND `delete` = 0 ORDER BY `item_id` DESC LIMIT 20');
                 while ($pli = mysql_fetch_array($spi)) {
@@ -11506,13 +10995,13 @@ LIMIT 1'));
                 }
                 $splink = rtrim($splink, ',');
 
-                //���������� ����� �������� �������
+                //Запоминаем новый комплект свитков
                 if ($u['autospell'] == 1) {
                     $u['autospell'] = $splink;
                     mysql_query('UPDATE `users` SET `autospell` = "' . $splink . '" WHERE `id` = "' . $u['id'] . '" LIMIT 1');
                 }
 
-                //������ ������ ������, ���� �� ���� � ���������
+                //Выдаем нужный свиток, если он есть в инвентаре
                 if ($u['autospell'] != $splink) {
                     $spe1 = explode(',', $splink);
                     $spe2 = explode(',', $u['autospell']);
@@ -11546,9 +11035,9 @@ LIMIT 1'));
             }
 
 
-            //������ ������
-            //���
-            //����
+            //Бонусы статов
+            //ТУТ
+            //сила
             /*if($st['s1']>24 && $st['s1']<50){ $st['m10']  += 5;  }
 			if($st['s1']>49 && $st['s1']<75){ $st['m10']  += 10; }
 			if($st['s1']>74 && $st['s1']<100){ $st['m10']  += 17; }
@@ -11589,7 +11078,7 @@ LIMIT 1'));
                 $st['m7'] += 7;
             }
 
-            //�������� $st[1]['pa1']  += 2; $st['m7']  += 35;
+            //ловкость $st[1]['pa1']  += 2; $st['m7']  += 35;
             /*if($st['s2']>24 && $st['s2']<50){ $st[1]['pa1']  += 2; }
 			if($st['s2']>49 && $st['s2']<75){ $st['m7']  += 5; $st['m4']  += 35; $st['m2']  += 15; }
 			if($st['s2']>74 && $st['s2']<100){ $st['m7']  += 15; $st['m4']  += 35; $st['m2']  += 15; }
@@ -11642,7 +11131,7 @@ LIMIT 1'));
                 $st['m15'] += 5;
             }
 
-            //��������
+            //интуиция
             /*if($st['s3']>24 && $st['s3']<50){ $st['m3'] += 10; }
 			if($st['s3']>49 && $st['s3']<75){ $st['m3'] += 10; $st['m1'] += 35; $st['m5'] += 15; }
 			if($st['s3']>74 && $st['s3']<100){ $st['m3'] += 25; $st['m1'] += 35; $st['m5'] += 15; }
@@ -11701,7 +11190,7 @@ LIMIT 1'));
                 $st['m14'] += 5;
             }
 
-            //������������
+            //выносливость
             /*if($st['s4']>0){ $st['hpAll']   += 30;  }
 			if($st['s4']>24 && $st['s4']<50){ $st['hpAll']  += 50;  }
 			if($st['s4']>49 && $st['s4']<75){ $st['hpAll']  += 100; }
@@ -11747,7 +11236,7 @@ LIMIT 1'));
                 $st['za'] += 125;
                 $st['zm'] += 125;
             }
-            //��������
+            //интелект
             /*if($st['s5']>24 && $st['s5']<50){ $st['m11'] += 5; }
 			if($st['s5']>49 && $st['s5']<75){ $st['m11'] += 10;  }
 			if($st['s5']>74 && $st['s5']<100){ $st['m11'] += 17; }
@@ -11780,7 +11269,7 @@ LIMIT 1'));
             if ($st['s5'] > 199) {
                 $st['pzm'] += 5;
             }
-            //��������
+            //мудрость
             /*if($st['s6']>24 && $st['s6']<50){ $st['mpAll'] += 50; $st['speedmp'] +=100; }
 			if($st['s6']>49 && $st['s6']<75){ $st['mpAll'] += 100; $st['speedmp'] +=200; }
 			if($st['s6']>74 && $st['s6']<100){ $st['mpAll'] += 175; $st['speedmp'] += 350; }
@@ -11825,7 +11314,7 @@ LIMIT 1'));
                 $st['pzm'] += 7;
             }
 
-            //���� ������ ������ �����
+            //если второе оружие одето
             if ($hnd2 == 1 && $hnd1 == 1) {
                 $st['zona']++;
             }
@@ -11837,7 +11326,7 @@ LIMIT 1'));
             //$st['speedhp'] += $st['pbe'];
             //$st['speedmp'] += $st['pbe'];
 
-            /* �������� */
+            /* Владения */
             $i = 1;
             while ($i <= 7) {
                 if (!isset($st['pm' . $i])) {
@@ -11907,23 +11396,23 @@ LIMIT 1'));
                 $i++;
             }
 
-            //���������� ������ � ������
+            //Уязвимость оружие и магиям
 
             $i = 1;
             while ($i <= 7) {
                 @$st['yzm' . $i] += @$st['yzma'];
                 if ($i <= 4) {
-                    @$st['yzm' . $i] += @$st['yzm'];//��������� ���� ������
-                    @$st['yza' . $i] += @$st['yza']; //���� ������
+                    @$st['yzm' . $i] += @$st['yzm'];//стихийный урон только
+                    @$st['yza' . $i] += @$st['yza']; //урон оружия
                 }
-                //�������� �� ������ �� �����
+                //Отнимает от защиты от урона
                 if (isset($st['yza' . $i]) && $i <= 4) {
                     $st['za' . $i] = ($st['za' . $i] / 100 * (100 + ($st['yza' . $i])));
                     if ($st['za' . $i] < 0) {
                         $st['za' . $i] = 0;
                     }
                 }
-                //�������� �� ������ �� �����
+                //Отнимает от защиты от магии
                 if (isset($st['yzm' . $i])) {
                     $st['zm' . $i] = ($st['zm' . $i] / 100 * (100 + ($st['yzm' . $i])));
                     if ($st['zm' . $i] < 0) {
@@ -11950,13 +11439,13 @@ LIMIT 1'));
                 $st['mpAll'] += round($st['mpAll'] / 100 * $st['mpProc']);
             }
 
-            //�����. - 250 ��.
+            //Реген. - 250 ед.
             /*if( $u['level'] > 7 ) {
 				$st['speedhp'] -= 240;
 				$st['speedmp'] -= 240;
 			}*/
 
-            //����� �������
+            //конец бонусов
             if ($st['hpNow'] < 0) {
                 $st['hpNow'] = 0;
             } elseif ($st['hpNow'] > $st['hpAll']) {
@@ -11968,7 +11457,7 @@ LIMIT 1'));
                 $st['mpNow'] = $st['mpAll'];
             }
 
-            //���� ����� � �����
+            //зоны блока и удара
             if ($st['zona'] < 1) {
                 $st['zona'] = 1;
             }
@@ -11996,7 +11485,7 @@ LIMIT 1'));
             $st['y'] = $u['y'];
             $st['s'] = $u['s'];
 
-            //�������� �������
+            //Собираем рейтинг
             /*$st['reting'] = 0;
 			//
 			$st['reting'] += $st['hpAll'];
@@ -12063,7 +11552,7 @@ LIMIT 1'));
                 $st['pzm'] += 5;
             }
 
-            //����� �� �������
+            //Бонус от медалей
             $rep1 = mysql_fetch_array(mysql_query('SELECT 
 			`add_slot`,`nu_sandcity`,`n_sandcity`,
 			`dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`,
@@ -12084,49 +11573,49 @@ LIMIT 1'));
                 $st['hpAll'] += 250;
             }
 
-            //��������
+            //Водосток
             if ($rep1['repdreamscity'] >= 24999) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
-            //�����
+            //излом
             if ($rep1['repizlom'] == 9999) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
-            //������
+            //Бездна
             if ($rep1['repangelscity'] == 25000) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
-            //���������
+            //Катакомбы
             if ($rep1['repdemonscity'] == 25000) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
-            //��������
+            //Грибница
             if ($rep1['repdemonscity'] == 25000) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
-            //������ ������ ���������
+            //Пещера тысячи проклятий
             if ($rep1['repcapitalcity'] == 25000) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
-            //����
+            //Санд
             if ($rep1['repsandcity'] == 25000) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
-            //���� �������
+            //Гора легиона
             if ($rep1['repabandonedplain'] == 24999) {
                 $st['m10'] += 10;
                 $st['pzm'] += 1;
             }
 
 
-            //���������� ������ ��� �������
+            //Добавочный подьем для игроков
             $st['maxves'] += 500;
 
             if ($st['silver'] >= 5) {
@@ -12146,7 +11635,7 @@ LIMIT 1'));
                 $st['exp'] += 25;
             }
 
-            //��������� ������� ������
+            //Сохраняем рейтинг игрока
             $st['reting'] = floor($st['reting']);
             //if(@$st['btl_cof'] != @$st['reting']) {
             //$st['btl_cof'] = $st['reting'];
@@ -12166,14 +11655,14 @@ LIMIT 1'));
             }
 
             if ($u['room'] == 411) {
-                //������, ������ �� ����� -25% ��
+                //Хоккей, эффект от шайбы -25% НР
                 $shb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "' . $u['id'] . '" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1'));
                 if (isset($shb['id'])) {
                     $st['hpAll'] = round($st['hpAll'] / 100 * 75);
                 }
             }
 
-            if (stristr($u['login'], '(����� ') == true || (stristr($u['login'], '�������� �����') && $u['ip'] == '0')) {
+            if (stristr($u['login'], '(зверь ') == true || (stristr($u['login'], 'Каменный страж') && $u['ip'] == '0')) {
                 $st['this_animal'] = 1;
             } else {
                 $st['this_animal'] = 0;
@@ -12182,7 +11671,7 @@ LIMIT 1'));
             $rt = [];
             if ($i1 == 1) {
                 $rt[0] = $st;
-                $rt[1] = $st2; //������ �����
+                $rt[1] = $st2; //родные статы
             } else {
                 $rt = $st;
             }
@@ -12220,7 +11709,7 @@ LIMIT 1'));
         return $msg_id;
     }
 
-    //�������� �������
+    //получаем уровень
     public function testLevel()
     {
         global $c;
@@ -12253,17 +11742,17 @@ LIMIT 1'));
             if ($this->info['exp'] >= $telvl[$this->info['upLevel']]) {
                 $lvl = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="' . $this->info['upLevel'] . '" LIMIT 1'));
                 $lvln = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="' . ($lvl['upLevel'] + 1) . '" LIMIT 1'));
-                //������� ��������
+                //Кристал вечности
                 if ($this->info['exp'] > 12499 && $this->info['level'] <= 5 && $c['infinity5level'] == true) {
                     $itm = mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "1204" AND `delete` = "0" AND `uid` = "' . $this->info['id'] . '" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
                     if (!isset($itm['id']) && $this->info['host_reg'] != 'noinfinity5' && $this->info['twink'] == 0) {
                         $this->info['exp'] = 12499;
                         mysql_query('UPDATE `stats` SET `exp` = "12499" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
-                        echo '<script>chat.sendMsg(["new","' . time() . '","6","","' . $this->info['login'] . '","��� �������� �� 6-�� ������� ��������� &quot;<strong>�������� �������� [6]</strong>&quot;.","Black","1","1","0"]);</script>';
+                        echo '<script>chat.sendMsg(["new","' . time() . '","6","","' . $this->info['login'] . '","Для перехода на 6-ой уровень требуется &quot;<strong>Кристалл Вечности [6]</strong>&quot;.","Black","1","1","0"]);</script>';
                     } else {
 
                         mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
-                        $text = '������� &quot;<strong>�������� �������� [6]</strong>&quot; ��� ������� �����������.';
+                        $text = 'Предмет &quot;<strong>Кристалл Вечности [6]</strong>&quot; был успешно использован.';
                         echo '<script>chat.sendMsg(["new","' . time() . '","6","","' . $this->info['login'] . '","' . $text . '","Black","1","1","0"]);</script>';
                         //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1',".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$text."','".time()."','6','0')");
                     }
@@ -12276,16 +11765,16 @@ LIMIT 1'));
                 while ($i != 1) {
                     if ($c['nolevel'] == true && $this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) {
                         $tlus = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `real` = 1 AND `level` = "' . $this->info['level'] . '" LIMIT 1'));
-                        //����� ��� ��� �������, $lvln
+                        //берем апп или уровень, $lvln
                         if ($tlus[0] < $this->info['level'] * 5) {
-                            //������ �������� ���/���� ���� �� ����� 100 ���������� �������� ������
+                            //Нельзя получать лвл/аппы пока не будет 100 персонажей текущего уровня
                             $this->info['exp'] = $lvl['exp'] - 1;
                             mysql_query('UPDATE `stats` SET `exp` = "' . $this->info['exp'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                         }
                     }
                     if ($this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) {
                         if ($lvl['nextLevel'] > $this->info['level']) {
-                            /*������ �������� ��������
+                            /*Выдаем бонусные предметы
 							if($lvl['nextLevel']==9){
 								$this->addItem(5021,$this->info['id'],'|sudba='.$this->info['login']);
 							}
@@ -12299,7 +11788,7 @@ LIMIT 1'));
 								$this->addItem(5023,$this->info['id'],'|sudba='.$this->info['login']);
 								$this->addItem(5023,$this->info['id'],'|sudba='.$this->info['login']);
 							}*/
-                            //�������� ������������
+                            //повышаем выносливость
                             $a4 = 1;
                             if ($lvl['nextLevel'] == 9) {
                                 $a4 = 2;
@@ -12314,12 +11803,12 @@ LIMIT 1'));
                             $this->stats['s4'] += $a4;
                             $sex1 = '';
                             if ($this->info['sex'] == 1) {
-                                $sex1 = '��';
+                                $sex1 = 'ла';
                             }
 
                             $ult = 1;
 
-                            //��������
+                            //Рефералы
                             if ($this->info['twink'] == 0 && (round($this->info['host_reg']) > 0 && ($this->info['dieline'] == 0 || $this->info['dieline'] < $lvl['exp']))) {
                                 $mtest = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`uid2`,`ip` FROM `mults` WHERE (`uid` = "' . $this->info['id'] . '" AND `uid2` = "' . ((int)$this->info['host_reg']) . '") OR (`uid2` = "' . $this->info['id'] . '" AND `uid` = "' . ((int)$this->info['host_reg']) . '") LIMIT 1'));
                                 $rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "' . ((int)$this->info['host_reg']) . '" LIMIT 1'));
@@ -12353,23 +11842,23 @@ LIMIT 1'));
                                         $up = mysql_query('UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . mysql_real_escape_string($rlog['id']) . '" LIMIT 1');
                                         if ($up) {
 
-                                            //������� 1-�� ������
+                                            //Реферал 1-го уровня
                                             $krtxt = '';
                                             if ($kr > 0) {
-                                                $krtxt .= '' . $kr . ' ��';
+                                                $krtxt .= '' . $kr . ' КР';
                                                 if ($ekr > 0) {
                                                     $krtxt .= ', ';
                                                 }
                                             }
                                             if ($ekr > 0) {
-                                                $krtxt .= '' . $ekr . ' ���';
+                                                $krtxt .= '' . $ekr . ' ЕКР';
                                             }
-                                            $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], '��� ������� <strong>' . $this->info['login'] . '</strong> ������' . $sex1 . ' ������ ' . $lvl['nextLevel'] . '! ��� ���������� ' . $krtxt, -1, 6, 0, 0, 0, 1);
+                                            $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt, -1, 6, 0, 0, 0, 1);
                                             $rlog['catch'] += $bn['add_bank'];
                                             mysql_query('UPDATE `users` SET `catch` = "' . $rlog['catch'] . '" WHERE `id` = "' . $rlog['id'] . '" LIMIT 1');
                                             //
                                             if ((int)$rlog['host_reg'] > 0) {
-                                                //������� 2-�� ������
+                                                //Реферал 2-го уровня
                                                 $llogin = $rlog['login'];
                                                 $ekr = round($bn['add_bank'] * 0.4, 2);
                                                 $kr = round($bn['add_money'] * 0.4, 2);
@@ -12377,20 +11866,20 @@ LIMIT 1'));
                                                 if (isset($rlog['id'])) {
                                                     $krtxt = '';
                                                     if ($kr > 0) {
-                                                        $krtxt .= '' . $kr . ' ��';
+                                                        $krtxt .= '' . $kr . ' КР';
                                                         if ($ekr > 0) {
                                                             $krtxt .= ', ';
                                                         }
                                                     }
                                                     if ($ekr > 0) {
-                                                        $krtxt .= '' . $ekr . ' ���';
+                                                        $krtxt .= '' . $ekr . ' ЕКР';
                                                     }
-                                                    $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], '��� ������� <strong>' . $this->info['login'] . '</strong> (2-�� ������ �� &quot;' . $llogin . '&quot; ) ������' . $sex1 . ' ������ ' . $lvl['nextLevel'] . '! ��� ���������� ' . $krtxt, -1, 6, 0, 0, 0, 1);
+                                                    $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> (2-го уровня от &quot;' . $llogin . '&quot; ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt, -1, 6, 0, 0, 0, 1);
                                                     $rlog['catch'] += $bn['add_bank'];
                                                     mysql_query('UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1');
                                                     //
                                                     if ((int)$rlog['host_reg'] > 0) {
-                                                        //������� 3-�� ������
+                                                        //Реферал 3-го уровня
                                                         $llogin2 = $rlog['login'];
                                                         $ekr = round($bn['add_bank'] * 0.2, 2);
                                                         $kr = round($bn['add_money'] * 0.2, 2);
@@ -12398,15 +11887,15 @@ LIMIT 1'));
                                                         if (isset($rlog['id'])) {
                                                             $krtxt = '';
                                                             if ($kr > 0) {
-                                                                $krtxt .= '' . $kr . ' ��';
+                                                                $krtxt .= '' . $kr . ' КР';
                                                                 if ($ekr > 0) {
                                                                     $krtxt .= ', ';
                                                                 }
                                                             }
                                                             if ($ekr > 0) {
-                                                                $krtxt .= '' . $ekr . ' ���';
+                                                                $krtxt .= '' . $ekr . ' ЕКР';
                                                             }
-                                                            $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], '��� ������� <strong>' . $this->info['login'] . '</strong> (3-�� ������ �� &quot;' . $llogin2 . '&quot; (������� ' . $llogin . ') ) ������' . $sex1 . ' ������ ' . $lvl['nextLevel'] . '! ��� ���������� ' . $krtxt, -1, 6, 0, 0, 0, 1);
+                                                            $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> (3-го уровня от &quot;' . $llogin2 . '&quot; (Реферал ' . $llogin . ') ) достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! Вам зачисленно ' . $krtxt, -1, 6, 0, 0, 0, 1);
                                                             $rlog['catch'] += $bn['add_bank'];
                                                             mysql_query('UPDATE `users` SET `money` = `money` + ' . $kr . ',`money2` = `money2` + ' . $ekr . ' WHERE `id` = "' . $rlog['id'] . '" LIMIT 1');
                                                             //
@@ -12417,14 +11906,14 @@ LIMIT 1'));
                                             }
 
                                         } else {
-                                            $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], '��� ������� <strong>' . $this->info['login'] . '</strong> ������' . $sex1 . ' ������ ' . $lvl['nextLevel'] . '! (������ ����������, ���������� � ������������� �������) �� ��� ���������� ���� �' . $bnk . ' ���������� ' . $ekr . ' ��.', -1, 6, 0, 0, 0, 1);
+                                            $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! (Ошибка зачисления, обратитесь с Администрации проекта) На Ваш банковский счет №' . $bnk . ' зачисленно ' . $ekr . ' кр.', -1, 6, 0, 0, 0, 1);
                                         }
                                     }
                                     //
                                     mysql_query("UPDATE `users` SET `referals` = `referals` + 5 WHERE `id` = '" . mysql_real_escape_string($rlog['id']) . "' LIMIT 1");
                                     //
                                 } elseif (isset($rlog['id'])) {
-                                    $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], '��� ������� <strong>' . $this->info['login'] . '</strong> ������' . $sex1 . ' ������ ' . $lvl['nextLevel'] . '! <small><font color=red>(�������� �� �����������, ���� � ��� ��������� IP! ��������� �� ����� 1 ������ ��������!)</font></small>', -1, 6, 0, 0, 0, 1);
+                                    $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! <small><font color=red>(Персонаж не активирован, либо у вас совпадают IP! Разрешено не более 1 такого реферала!)</font></small>', -1, 6, 0, 0, 0, 1);
                                 }
                             }
 
@@ -12439,7 +11928,7 @@ LIMIT 1'));
 
                         /*if( $this->info['twink'] == 0 ) {
 							if( $this->info['exp'] >= 300000 ) {
-								$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'�� ���������� ������ ������/����, �� ���������: <strong>'.$lvl['money'].' ��.</strong>',-1,6,0,0,0,1);
+								$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'За достижение нового уровня/аппа, Вы получаете: <strong>'.$lvl['money'].' кр.</strong>',-1,6,0,0,0,1);
 							}
 						}*/
 
@@ -12456,7 +11945,7 @@ LIMIT 1'));
                         $this->info['nskills'] += $lvl['nskills'];
                         if ($this->info['twink'] == 0) {
                             //if( $this->info['level'] < 8 ) {
-                            //������ �� ���� ���� 0-7 ���
+                            //Выдаем за аппы зубы 0-7 лвл
                             //$this->info['money4'] = $lvl['money']+$this->info['money4'];
                             //}else{
                             $this->info['money'] = $lvl['money'] + $this->info['money'];
@@ -12473,22 +11962,22 @@ LIMIT 1'));
                 }
                 if ($ult == 1) {
                     if ($this->info['level'] == 4 || $this->info['level'] == 8) {
-                        //������ �������� �� ������
+                        //Убрать задержки на пещеры
                         mysql_query('DELETE FROM `actions` WHERE `uid` = "' . $this->info['id'] . '" AND `vars` LIKE "psh%"');
-                        $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], '����������� ����������� ������ � �������� � ����� ���������!!!!!!!!!!!!!!!.', -1, 6, 0, 0, 0, 1);
+                        $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], 'Обязательно используйте свитки и эликсиры в своем инвентаре!!!!!!!!!!!!!!!.', -1, 6, 0, 0, 0, 1);
                     }
                     /*if( $this->info['level'] > 0 && $this->info['level'] <= 5 ) {
 						$this->info['money4'] += 100;
 						mysql_query('UPDATE `users` SET `money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'�� ���������� ������ ������ �� ��������� '.$this->zuby(100,1).'',-1,6,0,0,0,1);
+						$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'За достижение нового уровня вы получаете '.$this->zuby(100,1).'',-1,6,0,0,0,1);
 					}*/
                     //if( isset($itm['id']) || $lvl['nextLevel'] != 6 ) {
                     //
-                    /*$txti  = '������';
+                    /*$txti  = 'Достиг';
 						if( $this->info['sex'] == 1 ) {
-							$txti .= '��';
+							$txti .= 'ла';
 						}
-						$txti .= ' '.$this->info['level'].' ������!<br>'.date('d.m.Y H:i').'';
+						$txti .= ' '.$this->info['level'].' уровня!<br>'.date('d.m.Y H:i').'';
 						//
 						mysql_query('INSERT INTO `users_ico` (
 							`uid`,`time`,`text`,`img`,`type`,`x`,`see`
@@ -12496,13 +11985,13 @@ LIMIT 1'));
 							"'.$this->info['id'].'","'.time().'","'.$txti.'","pod_lvl'.$this->info['level'].'.gif","2","1","1"
 						)');*/
                     //
-                    $this->send('', $this->info['room'], $this->info['city'], '', '', '<strong>' . $this->info['login'] . '</strong> ������' . $sex1 . ' ������ ' . $this->info['level'] . '!', time(), 6, 0, 0, 0, 1, 2); // ������� ���
+                    $this->send('', $this->info['room'], $this->info['city'], '', '', '<strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $this->info['level'] . '!', time(), 6, 0, 0, 0, 1, 2); // Наверно тут
                     //}
                 }
                 //mysql_query('UNLOCK TABLES');
                 if ($rt > 0) {
                     if ($this->info['level'] >= 11) {
-                        //$this->info['stopexp'] = 1; //���������� �����
+                        //$this->info['stopexp'] = 1; //Блокировка опыта
                         $this->info['stopexp'] = 0;
                     } else {
                         $this->info['stopexp'] = 0;
@@ -12520,7 +12009,7 @@ LIMIT 1'));
         }
         /*------------*/
         if ($this->info['animal'] > 0) {
-            //������� �����
+            //уровень зверя
             $a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "' . $this->info['id'] . '" AND `id` = "' . $this->info['animal'] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
             if (isset($a['id']) && $a['level'] < 12) {
                 $ea = [
@@ -12556,14 +12045,14 @@ LIMIT 1'));
                 $iz = 0;
                 while ($iz != -1) {
                     if ($ea[$a['level'] + 1] <= $a['exp']) {
-                        //��������� �������
+                        //поднимаем уровень
                         $a['level']++;
                         $a['max_exp'] = $mx[$a['level']];
                     } else {
                         if ($iz > 0) {
                             $a['stats'] = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`exp`,`level`,`stats`,`bonus` FROM `levels_animal` WHERE `type` = "' . $a['type'] . '" AND `level` = "' . $a['level'] . '" LIMIT 1'));
                             $a['stats'] = $a['stats']['stats'];
-                            $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], '<strong>' . $a['name'] . '</strong> ������ ' . $a['level'] . ' ������!', time(), 6, 0, 0, 0, 1);
+                            $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], '<strong>' . $a['name'] . '</strong> достиг ' . $a['level'] . ' уровня!', time(), 6, 0, 0, 0, 1);
                             mysql_query('UPDATE `users_animal` SET `stats` = "' . $a['stats'] . '",`level`="' . $a['level'] . '",`max_exp`="' . $a['max_exp'] . '" WHERE `id` = "' . $a['id'] . '" LIMIT 1');
                         }
                         $iz = -2;
@@ -12606,29 +12095,29 @@ LIMIT 1'));
             //$btl = mysql_fetch_array(mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `id` = "'.$u['battle'].'" AND `team_win` = "-1" LIMIT 1'));
         }
         if ($u['battle'] == 0 || (isset($btl['id']) && $btl['time_start'] > $this->info['timereg'])) {
-            $sth = $u['minHP']; //����������� ����� �������������� � ������� HP
-            $stm = $u['minMP']; //����������� ����� �������������� � ������� MP
-            $sh = 0; //�������� ����������� �� � 1 ���.
-            $sm = 0; //�������� ����������� M� � 1 ���.
-            /*---����������(�����������)---*/
+            $sth = $u['minHP']; //Стандартное время восстановления в минутах HP
+            $stm = $u['minMP']; //Стандартное время восстановления в минутах MP
+            $sh = 0; //Скорость регенерации НР в 1 сек.
+            $sm = 0; //Скорость регенерации MР в 1 сек.
+            /*---Двужильный(Особенность)---*/
             if (@$st['os9'] > 0) {
                 if (@$st['os9'] == 5) {
                     @$st['os9'] = 6;
                 }
                 $sth = floor($u['minHP'] - ($u['minHP'] / 100) * ($st['os9'] * 5));
             }
-            /*---����������(�����������)---*/
-            /*---��������������(�����������)---*/
+            /*---Двужильный(Особенность)---*/
+            /*---Здравомыслящий(Особенность)---*/
             if (@$st['os10'] > 0) {
                 $stm = floor($u['minMP'] - ($u['minMP'] / 100) * ($st['os10'] * 5));
             }
-            /*---��������������(�����������)---*/
+            /*---Здравомыслящий(Особенность)---*/
             if ($u['battle'] > 0) {
                 $this->info['timereg'] = $btl['time_start'];
             }
 
-            //������� ������ �����
-            //����� ����
+            //Тестеры первой волны
+            //тесты боев
             $st['speedhp'] += 150;
             $st['speedmp'] += 150;
 
@@ -12660,7 +12149,7 @@ LIMIT 1'));
             } elseif ($st['mpNow'] > $st['mpAll']) {
                 $st['mpNow'] = $st['mpAll'];
             }
-            //������� ����� ������ � ����
+            //Заносим новые данные в базу
             $upd = mysql_query('UPDATE `stats` SET `regHP`="' . time() . '",`regMP`="' . time() . '",`hpNow`="' . $st['hpNow'] . '",`mpNow`="' . $st['mpNow'] . '" WHERE `id` = "' . $u['id'] . '" LIMIT 1');
             if (!$upd) {
                 return [0 => 0, 1 => 0];
@@ -12676,14 +12165,14 @@ LIMIT 1'));
         }
     }
 
-    public function send_mime_mail($name_from, // ��� �����������
-                                   $email_from, // email �����������
-                                   $name_to, // ��� ����������
-                                   $email_to, // email ����������
-                                   $data_charset, // ��������� ���������� ������
-                                   $send_charset, // ��������� ������
-                                   $subject, // ���� ������
-                                   $body // ����� ������
+    public function send_mime_mail($name_from, // имя отправителя
+                                   $email_from, // email отправителя
+                                   $name_to, // имя получателя
+                                   $email_to, // email получателя
+                                   $data_charset, // кодировка переданных данных
+                                   $send_charset, // кодировка письма
+                                   $subject, // тема письма
+                                   $body // текст письма
     )
     {
         $to = $this->mime_header_encode($name_to, $data_charset, $send_charset)
@@ -12719,37 +12208,37 @@ LIMIT 1'));
                 $po['toclan1'] = $po['toclan1'][0];
             }
             if (isset($po['sudba']) && $po['sudba'] != '0') {
-                $r = '<font color="#FF0000"><strong>������� ������ � ���� �������</strong></font><br>';
+                $r = '<font color="#FF0000"><strong>Предмет связан с вами судьбой</strong></font><br>';
             } elseif (isset($po['toclan']) && $po['toclan1'] != $user['clan']) {
-                $r = '<font color="#FF0000"><strong>������� � ��� ����������� �����...</strong></font><br>';
+                $r = '<font color="#FF0000"><strong>Предмет и так пренадлежит клану...</strong></font><br>';
             } elseif ($user['inTurnir'] > 0 || $user['inTurnirnew'] > 0) {
-                $r = '<font color="#FF0000"><strong>�� ����� ������� � ������� ��������� ������������ �������� ���������.</strong></font><br>';
+                $r = '<font color="#FF0000"><strong>Во время участия в турнире запрещено использовать клановое хранилище.</strong></font><br>';
             } else {
                 if ((isset($po['sudba']) && $po['sudba'] != '0') || isset($po['icos']) || isset($po['frompisher']) || isset($po['fromlaba']) || ($item_['gift'] != '' && $item_['gift'] != 0)) {
-                    $r = '�� �������';
+                    $r = 'Не удалось';
                 } elseif (!isset($po['toclan'])) {
                     $po['toclan'] = $user['clan'] . '#' . $user['id'];
                     $item_['data'] = $this->impStats($po);
                     if (mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '", `data` = "' . $item_['data'] . '" WHERE `id` = "' . $id . '" LIMIT 1')) {
-                        $r = '<font color="#FF0000"><strong>�� ������� ������������ ������� &quot;' . $item_['name'] . '&quot; �����</strong></font><br />';
+                        $r = '<font color="#FF0000"><strong>Вы успешно пожертвовали предмет &quot;' . $item_['name'] . '&quot; клану</strong></font><br />';
                         $col = $this->itemsX(((int)$id));
-                        $this->addDelo(2, $user['id'], '&quot;<font color="green">System.transfer.MONEY</font>&quot;: ������� &quot;' . $item_['name'] . '&quot; (#id : "' . $id . '") (x' . $col . ') ��� ����������� ����� &quot;' . $res['name'] . '&quot; (' . $res['id'] . ').', time(), $user['city'], 'System.transfer.clan', 0, 0);
-                        mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "4", "' . $user['login'] . '", "' . $item_['name'] . ' (x' . $col . ') �� : [' . $id . ']", "' . $user['id'] . '")');
+                        $this->addDelo(2, $user['id'], '&quot;<font color="green">System.transfer.MONEY</font>&quot;: Предмет &quot;' . $item_['name'] . '&quot; (#id : "' . $id . '") (x' . $col . ') был пожертвован клану &quot;' . $res['name'] . '&quot; (' . $res['id'] . ').', time(), $user['city'], 'System.transfer.clan', 0, 0);
+                        mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "4", "' . $user['login'] . '", "' . $item_['name'] . ' (x' . $col . ') Ид : [' . $id . ']", "' . $user['id'] . '")');
                     } else {
-                        $r = '<font color="#FF0000"><strong>�� �������...</strong></font><br>';
+                        $r = '<font color="#FF0000"><strong>Не удалось...</strong></font><br>';
                     }
                 } else {
                     if (mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '" WHERE `id` = "' . $id . '" LIMIT 1')) {
                         $col = $this->itemsX(((int)$id));
-                        mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "3", "' . $user['login'] . '", "' . $item_['name'] . '" (x' . $col . ') �� : [' . $id . '], "' . $user['id'] . '")');
-                        $r = '<font color="#FF0000"><strong>�� ������� ������� ������� &quot;' . $item_['name'] . '&quot; � ��������� �����</strong></font><br />';
+                        mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "3", "' . $user['login'] . '", "' . $item_['name'] . '" (x' . $col . ') Ид : [' . $id . '], "' . $user['id'] . '")');
+                        $r = '<font color="#FF0000"><strong>Вы успешно вернули предмет &quot;' . $item_['name'] . '&quot; в хранилище клана</strong></font><br />';
                     } else {
-                        $r = '<font color="#FF0000"><strong>�� �������...</strong></font><br>';
+                        $r = '<font color="#FF0000"><strong>Не удалось...</strong></font><br>';
                     }
                 }
             }
         } else {
-            $r = '<font color="#FF0000"><strong>������� �� ������.</strong></font><br>';
+            $r = '<font color="#FF0000"><strong>Предмет не найден.</strong></font><br>';
         }
         return $r;
     }
@@ -12761,7 +12250,7 @@ LIMIT 1'));
         $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $cl . '" LIMIT 1'));
         $user_itm = mysql_fetch_array(mysql_query('SELECT `id`,`bot`,`clone` FROM `stats` WHERE `id` = "' . $itm_['uid'] . '" LIMIT 1'));
         if ($user_itm['bot'] > 0 || $user_itm['clone'] > 0 || !isset($user_itm['id'])) {
-            $r = '<font color="#FF0000"><strong>�� �� ������ ������ ������ �������, �� �� ����������� �����</strong></font><br />';
+            $r = '<font color="#FF0000"><strong>Вы не можете изьять данный предмет, он не принадлежит клану</strong></font><br />';
         } elseif (isset($itm_['id'])) {
             if ($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
                 if ($itm_['inOdet'] != 0) {
@@ -12769,15 +12258,15 @@ LIMIT 1'));
                 } else {
                     $o = '';
                 }
-                $r = '<font color="#FF0000"><strong>�� ������� ������ ������� &quot;' . $itm_['name'] . '&quot;</strong></font><br />';
+                $r = '<font color="#FF0000"><strong>Вы успешно изъяли предмет &quot;' . $itm_['name'] . '&quot;</strong></font><br />';
                 $col = $this->itemsX(((int)$id));
-                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') �� : [' . $id . '] | � ��������� : [' . $itm_['uid'] . ']", "' . $user['id'] . '")');
+                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "6", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] | У персонажа : [' . $itm_['uid'] . ']", "' . $user['id'] . '")');
                 mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $res['id'] . '" ' . $o . ' WHERE `id` = "' . $id . '" LIMIT 1');
             } else {
-                $r = '<font color="#FF0000"><strong>�� ����� ������� � ������� ��������� ������������ �������� ���������.</strong></font><br />';
+                $r = '<font color="#FF0000"><strong>Во время участия в турнире запрещено использовать клановое хранилище.</strong></font><br />';
             }
         } else {
-            $r = '<font color="#FF0000"><strong>������� �� ������.</strong></font><br />';
+            $r = '<font color="#FF0000"><strong>Предмет не найден.</strong></font><br />';
         }
         return $r;
     }
@@ -12794,14 +12283,14 @@ LIMIT 1'));
             }
             if ($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
                 $col = $this->itemsX(((int)$id));
-                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') �� : [' . $id . '] ������ : [' . $cls . ']", "' . $user['id'] . '")');
+                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "5", "' . $user['login'] . '", "' . $itm_['name'] . ' (x' . $col . ') Ид : [' . $id . '] Хозяин : [' . $cls . ']", "' . $user['id'] . '")');
                 mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '" WHERE `id` = "' . $id . '" LIMIT 1');
-                $r = '<font color="#FF0000"><strong>�� ������� ����� ������� &quot;' . $itm_['name'] . '&quot; �� ���������</strong></font><br />';
+                $r = '<font color="#FF0000"><strong>Вы успешно взяли предмет &quot;' . $itm_['name'] . '&quot; из хранилища</strong></font><br />';
             } else {
-                $r = '<font color="#FF0000"><strong>�� ����� ������� � ������� ��������� ������������ �������� ���������.</strong></font><br />';
+                $r = '<font color="#FF0000"><strong>Во время участия в турнире запрещено использовать клановое хранилище.</strong></font><br />';
             }
         } else {
-            $r = '<font color="#FF0000"><strong>������� �� ������.</strong></font><br />' . $id;
+            $r = '<font color="#FF0000"><strong>Предмет не найден.</strong></font><br />' . $id;
         }
         return $r;
     }
@@ -12826,24 +12315,24 @@ LIMIT 1'));
                 $col = $this->itemsX(((int)$pl['id']));
                 $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $pl['item_id'] . '"'));
                 mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "' . $user['id'] . '", `data` = "' . $pl['data'] . '" WHERE `id` = "' . $pl['id'] . '"');
-                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') �� : [' . $pl['id'] . ']", "' . $user['id'] . '")');
+                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "' . $type . '", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")');
             } elseif ($cls != $user['id'] && $pl['uid'] == $user['id']) {
                 $col = $this->itemsX(((int)$pl['id']));
                 $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . $pl['item_id'] . '"'));
                 mysql_query('UPDATE `items_users` SET `lastUPD` = "' . time() . '", `uid` = "-21' . $user['clan'] . '" WHERE `id` = "' . $pl['id'] . '"');
-                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') �� : [' . $pl['id'] . ']", "' . $user['id'] . '")');
+                mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("' . $res['id'] . '", "' . time() . '", "9", "' . $user['login'] . '", "' . $it_n['name'] . ' (x' . $col . ') Ид : [' . $pl['id'] . ']", "' . $user['id'] . '")');
             }
         }
     }
 
-    public function send_mail($to, $to_name, $from = 'support@new-combats.com', $name = '<strong>���������� ����</strong> 2', $title, $text)
+    public function send_mail($to, $to_name, $from = 'support@new-combats.com', $name = '<strong>Бойцовский Клуб</strong> 2', $title, $text)
     {
         $this->send_mime_mail($name,
             $from,
             $to_name,
             $to,
-            'CP1251',  // ���������, � ������� ��������� ������������ ������
-            'KOI8-R', // ���������, � ������� ����� ���������� ������
+            'CP1251',  // кодировка, в которой находятся передаваемые строки
+            'KOI8-R', // кодировка, в которой будет отправлено письмо
             $title,
             $text); // \r\n
     }
diff --git a/inf.php b/inf.php
index c8eda6fd..03a08e8e 100644
--- a/inf.php
+++ b/inf.php
@@ -18,39 +18,39 @@ $uplogin = $uplogin[0];
 $uplogin = preg_replace('/%20/'," ",$uplogin);
 
 function utf8_win($s) {
-	$s=str_replace("%D0%B0","�",$s); $s=str_replace("%D0%90","�",$s);
-	$s=str_replace("%D0%B1","�",$s); $s=str_replace("%D0%91","�",$s);
-	$s=str_replace("%D0%B2","�",$s); $s=str_replace("%D0%92","�",$s);
-	$s=str_replace("%D0%B3","�",$s); $s=str_replace("%D0%93","�",$s);
-	$s=str_replace("%D0%B4","�",$s); $s=str_replace("%D0%94","�",$s);
-	$s=str_replace("%D0%B5","�",$s); $s=str_replace("%D0%95","�",$s);
-	$s=str_replace("%D1%91","�",$s); $s=str_replace("%D0%81","�",$s);
-	$s=str_replace("%D0%B6","�",$s); $s=str_replace("%D0%96","�",$s);
-	$s=str_replace("%D0%B7","�",$s); $s=str_replace("%D0%97","�",$s);
-	$s=str_replace("%D0%B8","�",$s); $s=str_replace("%D0%98","�",$s);
-	$s=str_replace("%D0%B9","�",$s); $s=str_replace("%D0%99","�",$s);
-	$s=str_replace("%D0%BA","�",$s); $s=str_replace("%D0%9A","�",$s);
-	$s=str_replace("%D0%BB","�",$s); $s=str_replace("%D0%9B","�",$s);
-	$s=str_replace("%D0%BC","�",$s); $s=str_replace("%D0%9C","�",$s);
-	$s=str_replace("%D0%BD","�",$s); $s=str_replace("%D0%9D","�",$s);
-	$s=str_replace("%D0%BE","�",$s); $s=str_replace("%D0%9E","�",$s);
-	$s=str_replace("%D0%BF","�",$s); $s=str_replace("%D0%9F","�",$s);
-	$s=str_replace("%D1%80","�",$s); $s=str_replace("%D0%A0","�",$s);
-	$s=str_replace("%D1%81","�",$s); $s=str_replace("%D0%A1","�",$s);
-	$s=str_replace("%D1%82","�",$s); $s=str_replace("%D0%A2","�",$s);
-	$s=str_replace("%D1%83","�",$s); $s=str_replace("%D0%A3","�",$s);
-	$s=str_replace("%D1%84","�",$s); $s=str_replace("%D0%A4","�",$s);
-	$s=str_replace("%D1%85","�",$s); $s=str_replace("%D0%A5","�",$s);
-	$s=str_replace("%D1%86","�",$s); $s=str_replace("%D0%A6","�",$s);
-	$s=str_replace("%D1%87","�",$s); $s=str_replace("%D0%A7","�",$s);
-	$s=str_replace("%D1%88","�",$s); $s=str_replace("%D0%A8","�",$s);
-	$s=str_replace("%D1%89","�",$s); $s=str_replace("%D0%A9","�",$s);
-	$s=str_replace("%D1%8A","�",$s); $s=str_replace("%D0%AA","�",$s);
-	$s=str_replace("%D1%8B","�",$s); $s=str_replace("%D0%AB","�",$s);
-	$s=str_replace("%D1%8C","�",$s); $s=str_replace("%D0%AC","�",$s);
-	$s=str_replace("%D1%8D","�",$s); $s=str_replace("%D0%AD","�",$s);
-	$s=str_replace("%D1%8E","�",$s); $s=str_replace("%D0%AE","�",$s);
-	$s=str_replace("%D1%8F","�",$s); $s=str_replace("%D0%AF","�",$s);
+	$s=str_replace("%D0%B0","а",$s); $s=str_replace("%D0%90","А",$s);
+	$s=str_replace("%D0%B1","б",$s); $s=str_replace("%D0%91","Б",$s);
+	$s=str_replace("%D0%B2","в",$s); $s=str_replace("%D0%92","В",$s);
+	$s=str_replace("%D0%B3","г",$s); $s=str_replace("%D0%93","Г",$s);
+	$s=str_replace("%D0%B4","д",$s); $s=str_replace("%D0%94","Д",$s);
+	$s=str_replace("%D0%B5","е",$s); $s=str_replace("%D0%95","Е",$s);
+	$s=str_replace("%D1%91","ё",$s); $s=str_replace("%D0%81","Ё",$s);
+	$s=str_replace("%D0%B6","ж",$s); $s=str_replace("%D0%96","Ж",$s);
+	$s=str_replace("%D0%B7","з",$s); $s=str_replace("%D0%97","З",$s);
+	$s=str_replace("%D0%B8","и",$s); $s=str_replace("%D0%98","И",$s);
+	$s=str_replace("%D0%B9","й",$s); $s=str_replace("%D0%99","Й",$s);
+	$s=str_replace("%D0%BA","к",$s); $s=str_replace("%D0%9A","К",$s);
+	$s=str_replace("%D0%BB","л",$s); $s=str_replace("%D0%9B","Л",$s);
+	$s=str_replace("%D0%BC","м",$s); $s=str_replace("%D0%9C","М",$s);
+	$s=str_replace("%D0%BD","н",$s); $s=str_replace("%D0%9D","Н",$s);
+	$s=str_replace("%D0%BE","о",$s); $s=str_replace("%D0%9E","О",$s);
+	$s=str_replace("%D0%BF","п",$s); $s=str_replace("%D0%9F","П",$s);
+	$s=str_replace("%D1%80","р",$s); $s=str_replace("%D0%A0","Р",$s);
+	$s=str_replace("%D1%81","с",$s); $s=str_replace("%D0%A1","С",$s);
+	$s=str_replace("%D1%82","т",$s); $s=str_replace("%D0%A2","Т",$s);
+	$s=str_replace("%D1%83","у",$s); $s=str_replace("%D0%A3","У",$s);
+	$s=str_replace("%D1%84","ф",$s); $s=str_replace("%D0%A4","Ф",$s);
+	$s=str_replace("%D1%85","х",$s); $s=str_replace("%D0%A5","Х",$s);
+	$s=str_replace("%D1%86","ц",$s); $s=str_replace("%D0%A6","Ц",$s);
+	$s=str_replace("%D1%87","ч",$s); $s=str_replace("%D0%A7","Ч",$s);
+	$s=str_replace("%D1%88","ш",$s); $s=str_replace("%D0%A8","Ш",$s);
+	$s=str_replace("%D1%89","щ",$s); $s=str_replace("%D0%A9","Щ",$s);
+	$s=str_replace("%D1%8A","ъ",$s); $s=str_replace("%D0%AA","Ъ",$s);
+	$s=str_replace("%D1%8B","ы",$s); $s=str_replace("%D0%AB","Ы",$s);
+	$s=str_replace("%D1%8C","ь",$s); $s=str_replace("%D0%AC","Ь",$s);
+	$s=str_replace("%D1%8D","э",$s); $s=str_replace("%D0%AD","Э",$s);
+	$s=str_replace("%D1%8E","ю",$s); $s=str_replace("%D0%AE","Ю",$s);
+	$s=str_replace("%D1%8F","я",$s); $s=str_replace("%D0%AF","Я",$s);
 	return $s;
 }
 
@@ -68,8 +68,6 @@ if(!isset($_GET['login']))
 
 if(!isset($upLogin)){ $upLogin = ''; }
 
-
-
 $utf8Login = '';
 $utf8Login2 = '';
 
@@ -95,24 +93,18 @@ if($uplogin == 'delete' || $utf8Login == 'delete' || $utf8Login2 == 'delete') {
 	}
 }
 
-/*if( $inf['id'] == 1000000 && $u->info['id'] != 1000000 ) {
-	die('<center><img width="330" height="420" src="https://www.bugaga.ru/uploads/posts/thumbs/1198763406_10.jpg"><br><h3>Can no longer open this page.</h3></center>');
-}*/
-
 if(!isset($inf['id']))
 {
 	unset($inf);
 }else{
-	if($inf['inTurnir'] > 0) {
-		//$inf['online'] = time();
-	}
+
 	if(isset($_GET['restartmonster']) && $u->info['admin'] > 0) {
 		mysql_query('UPDATE `stats` SET `res_x` = 0 WHERE `id` = "'.mysql_real_escape_string($inf['id']).'" LIMIT 1');
 		$inf['res_x'] = 0;
 	}
 	if($inf['haos']>1)
 	{
-		//������� ����
+		//снимаем хаос
 		if($inf['haos']<time())
 		{
 			$inf['align'] = 0;
@@ -126,9 +118,9 @@ if(!isset($inf['id']))
 			$upd = mysql_query('UPDATE `stats` SET `wipe` = "1" WHERE `id` = "'.$inf['id'].'" LIMIT 1');
 			if($upd)
 			{
-				$uer = '����� ������������� ������ �������<br>';
+				$uer = 'Сброс характеристик прошел успешно<br>';
 			}else{
-				$uer = '������ ������...<br>';
+				$uer = 'Ошибка сброса...<br>';
 			}
 		}
 	}
@@ -139,9 +131,9 @@ if(!isset($inf['id']))
 			$upd = mysql_query('UPDATE `users` SET `molch3` = "'.$inf['molch1'].'" WHERE `id` = "'.$inf['id'].'" LIMIT 1');
 			if($upd)
 			{
-				$uer = '��� ������ �������...<br>';
+				$uer = 'Все прошло успешно...<br>';
 			}else{
-				$uer = '������...<br>';
+				$uer = 'Ошибка...<br>';
 			}
 		}
 	}
@@ -153,14 +145,14 @@ if( $inf['room'] == 303 && $u->info['admin'] == 0 ) {
 	
 if(!isset($inf['id']))
 {
-	die('������. �������� �� ������.');
+	die('Ошибка. Персонаж не найден.');
 	die('<html><head>
 	<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
 	<meta http-equiv="Content-Language" content="ru">
 	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
-	<TITLE>��������� ������</TITLE></HEAD><BODY text="#FFFFFF" style="padding-top:0px; margin-top:7px; height:100%; background-color:#dedede;"><p><font color=black>
-	��������� ������: <pre>��������� �������� �� ������...</pre>
-	<b><p><a href = "javascript:window.history.go(-1);">�����</b></a>
+	<TITLE>Произошла ошибка</TITLE></HEAD><BODY text="#FFFFFF" style="padding-top:0px; margin-top:7px; height:100%; background-color:#dedede;"><p><font color=black>
+	Произошла ошибка: <pre>Указанный персонаж не найден...</pre>
+	<b><p><a href = "javascript:window.history.go(-1);">Назад</b></a>
 	<HR>
 	<p align="right">&copy; <a href="https://new-combats.com/">'.$c['title'].'</a></p>
 	'.$c['counters'].'
@@ -245,7 +237,7 @@ if($id_zodiak==null)
   $id_zodiak = 1;
 }
 
-$name_zodiak = array(1=>'����',2=>'�����',3=>'��������',4=>'���',5=>'���',6=>'����',7=>'����',8=>'��������',9=>'�������',10=>'�������',11=>'�������',12=>'����');
+$name_zodiak = array(1=>'Овен',2=>'Телец',3=>'Близнецы',4=>'Рак',5=>'Лев',6=>'Дева',7=>'Весы',8=>'Скорпион',9=>'Стрелец',10=>'Козерог',11=>'Водолей',12=>'Рыбы');
 $name_zodiak = $name_zodiak[$id_zodiak];
 
 function statInfo($s)
@@ -440,8 +432,8 @@ if( $inf['inTurnir'] > 0 && ($u->info['inTurnir'] == $inf['inTurnir'] || $u->inf
 <html>
 <head>
 <meta charset="windows-1251"/>
-<title>���������� � <? echo $inf['login']; ?></title>
-<meta "description" name content="�������������� ���������� � ������� ���������� ���������� ���� ���������� ����.������� � ����� ������ ������� ���������� ���� combats.com ������ 2."/>
+<title>Информация о <? echo $inf['login']; ?></title>
+<meta "description" name content="Просматривайте информацию о игровых персонажах браузерной игры Бойцовский Клуб.Играйте в новый проект потивам браузерной игры combats.com версии 2."/>
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"/>
 <script type="text/javascript" src="/js/jquery.js"></script>
 <script type="text/javascript" src="/js/jquery.zclip.js"></script>
@@ -679,7 +671,7 @@ progress {
 var lafstReg = {};
 function lookGift(e,id,nm,img,txt,from) {
   if(from == 1) {
-	 from = '<i>���������</i>'; 
+	 from = '<i>Невидимка</i>'; 
   }
   if(!e) { e = window.event; }
   var body2 = document.body;
@@ -689,10 +681,10 @@ function lookGift(e,id,nm,img,txt,from) {
   if(gf != undefined) {
 		gf.style.top = mY+'px';
 		gf.style.left = mX+'px';
-		if( from == '<i>�������</i>' ) {
-			from = '</a><i>�������</i><a>';
+		if( from == '<i>Анонима</i>' ) {
+			from = '</a><i>Анонима</i><a>';
 		}
-		gf.innerHTML = `<b><span style="float:left;">${nm}</span> <span style="float:right;">&nbsp; <a href="javascript:void(0);" onClick="closeGift();">X</a></span></b><br><div align="center" style="padding:5px;background-color:#dcdedc;"><img src="https://img.new-combats.com/i/items/${img}"></div>${txt}<div>������� �� <a target="_blank" href="/info/${from}">${from}</a></div>`;
+		gf.innerHTML = `<b><span style="float:left;">${nm}</span> <span style="float:right;">&nbsp; <a href="javascript:void(0);" onClick="closeGift();">X</a></span></b><br><div align="center" style="padding:5px;background-color:#dcdedc;"><img src="https://img.new-combats.com/i/items/${img}"></div>${txt}<div>Подарок от <a target="_blank" href="/info/${from}">${from}</a></div>`;
 		gf.innerHTML = `<small>${gf.innerHTML}</small>`;
 		gf.style.display = '';
 	}
@@ -708,13 +700,13 @@ function closeGift() {
 function tstlgnthm() {
 	if( window.opener && ( window.opener.textmsg != undefined || window.opener.parent.textmsg != undefined ) ) {
 		/*
-		<img onclick="window.opener.chat.toUser(\'' + data.login + '\',\'private\');" title="������" width="20" height="15" class="cp" src="https://' + cfg.img + '/images/lock3.gif">
+		<img onclick="window.opener.chat.toUser(\'' + data.login + '\',\'private\');" title="Приват" width="20" height="15" class="cp" src="https://' + cfg.img + '/images/lock3.gif">
 		*/
 		if( window.opener.textmsg != undefined ) {
-			$('#lgnthm').html( '<img onclick="window.opener.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="�������� ���������" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
+			$('#lgnthm').html( '<img onclick="window.opener.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="Написать персонажу" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
 			return
 		}
-		$('#lgnthm').html( '<img onclick="window.opener.parent.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="�������� ���������" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
+		$('#lgnthm').html( '<img onclick="window.opener.parent.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="Написать персонажу" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
 		return
 	}
 
@@ -736,10 +728,10 @@ if(isset($uer)){ echo '<div align="left"><font color=\'red\'>'.$uer.'</font></di
 		$st = array(); $st2 = array(); $st = $u->getStats($inf['id'],1,0,true); $st2 = $st[1]; $st = $st[0]; 
 		
         //if( $u->info['admin'] > 0 ) {
-		//	echo '<div>�������� ���������: '.$st['reting'].'</div>';
+		//	echo '<div>Мощность персонажа: '.$st['reting'].'</div>';
 		//}
 		
-		$rgd = $u->regen($inf['id'],$st,1); $us = $u->getInfoPers($inf['id'],1,$st); if( isset($bs['id']) && $bs['type_btl'] == 2 && ($u->info['x'] != $inf['x'] || $u->info['y'] != $inf['y'])) { $us[0] = '<div align="center" style="width:255px;height300px;"><br><br><br><br><br><br><br><br>���������� ������,<br>�� � ������ ��������.<br><br><br><br><br><br><br></div>'; } if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?></div>
+		$rgd = $u->regen($inf['id'],$st,1); $us = $u->getInfoPers($inf['id'],1,$st); if( isset($bs['id']) && $bs['type_btl'] == 2 && ($u->info['x'] != $inf['x'] || $u->info['y'] != $inf['y'])) { $us[0] = '<div align="center" style="width:255px;height300px;"><br><br><br><br><br><br><br><br>Информация скрыта,<br>Вы в разных комнатах.<br><br><br><br><br><br><br></div>'; } if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?></div>
         <!-- pos2 -->
         <div align="left"></div><div align="left"></div><script>tstlgnthm();lafstReg[<? echo $inf['id']; ?>] = 1;
 		<?
@@ -776,30 +768,17 @@ $kp = array(
 	21 => 60
 );
 
-
-/*$onj = floor((time()-$inf['online'])/60/60/24);
-//if( $kp[$inf['level']]/2 < $onj && $inf['admin'] == 0 ) {
-if( $onj > 6 && $inf['admin'] == 0 ) {
-	echo '<small><div style="margin-left:6px;width:236px;padding:5px;" align="center" class="private">';
-	if( ( (3*2) - $onj) < 1 ) {
-		echo '<b>�������� ����� ����� � ����<br>������� � �������</b>';
-	}else{
-		echo '<b>�������� ����� ����� � ����<br>����� '.( ($kp[$inf['level']]*2) - $onj).' ��.</b>';
-	}
-	echo '</div></small>';
-}*/
-
 ?>
 <!-- pos1 -->
 <?
-		//�������� ������
+		//Персонаж онлайн
 		if( $inf['admin'] > 0 ) {
 			if($inf['battle']>0)
 			{
 				$btl3 = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = '.$inf['battle'].''));  
 				if(isset($btl3['id']) && $btl3['time_over']==0)
 				{
-					echo '<center><small><br>�������� ������ � <a target="_blank" href="/logs.php?log='.$btl3['id'].'">��������</a></small></center>';
+					echo '<center><small><br>Персонаж сейчас в <a target="_blank" href="/logs.php?log='.$btl3['id'].'">поединке</a></small></center>';
 				}
 			}
 		}elseif( $inf['room'] != 303 ) {
@@ -808,7 +787,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 			
 			if($inf['online']>time()-520 && $inf['banned']==0 && $inf['invis']!=1 && $inf['invis'] < time())
 			{
-				echo '�������� ������ ��������� � �����.<br><b>"'.$room['name'].'"</b>';
+				echo 'Персонаж сейчас находится в клубе.<br><b>"'.$room['name'].'"</b>';
 			}else{
 				if($inf['admin']==0 || $inf['admin']==2)
 				{
@@ -816,73 +795,73 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 					{
 						$inf['online'] = $inf['timeREG'];
 					}
-					echo '�������� �� � �����';
+					echo 'Персонаж не в клубе';
 					if(date('Y',$inf['online']) == date('Y')) {
-						echo ', �� ��� ���:<br>'.date('d.m.Y H:i',$inf['online']).'<img title="����� �������" src="https://img.new-combats.com/i/clok3_2.png">';
+						echo ', но был тут:<br>'.date('d.m.Y H:i',$inf['online']).'<img title="Время сервера" src="https://img.new-combats.com/i/clok3_2.png">';
 						$out = '';
 						$time_still = time()-$inf['online'];
 						$tmp = floor($time_still/2592000);
 						$id=0;
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." ���. ";}
+							if ($id<3) {$out .= $tmp." мес. ";}
 							$time_still = $time_still-$tmp*2592000;
 						}
 						$tmp = floor($time_still/604800);
 						if ($tmp > 0) { 
 						$id++;
-						if ($id<3) {$out .= $tmp." ���. ";}
+						if ($id<3) {$out .= $tmp." нед. ";}
 						$time_still = $time_still-$tmp*604800;
 						}
 						$tmp = floor($time_still/86400);
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." ��. ";}
+							if ($id<3) {$out .= $tmp." дн. ";}
 							$time_still = $time_still-$tmp*86400;
 						}
 						$tmp = floor($time_still/3600);
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." �. ";}
+							if ($id<3) {$out .= $tmp." ч. ";}
 							$time_still = $time_still-$tmp*3600;
 						}
 						$tmp = floor($time_still/60);
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." ���. ";}
+							if ($id<3) {$out .= $tmp." мин. ";}
 						}
 						if($out=='')
 						{
-							$out = $time_still.' ���.';
+							$out = $time_still.' сек.';
 						}
-						echo '<br>('.$out.' �����)';
+						echo '<br>('.$out.' назад)';
 					}
 				}elseif($inf['admin']>0)
 				{
-					echo '�������� �� � �����.';
+					echo 'Персонаж не в клубе.';
 				}
 			}
 			if($inf['inUser']>0 AND $inf['id']!=12059 )
 			{
-				echo '<br>�������� �������� � <a target="_blank" href="/info/'.$inf['inUser'].'">����</a>';
+				echo '<br>Персонаж вселился в <a target="_blank" href="/info/'.$inf['inUser'].'">бота</a>';
 			}
 			if($inf['battle']>0)
 			{
 				$btl3 = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = '.$inf['battle'].''));  
 				if(isset($btl3['id']) && $btl3['time_over']==0)
 				{
-					echo '<br>�������� ������ � <a target="_blank" href="/logs.php?log='.$btl3['id'].'">��������</a>';
+					echo '<br>Персонаж сейчас в <a target="_blank" href="/logs.php?log='.$btl3['id'].'">поединке</a>';
 				}
 			}
 			echo '</small></center>';
 		}else{
 			if( $inf['res_x']-time() > 0 ) {
-				echo '<center style="padding-top:3px;">�������� ����� <b>'.($u->timeOut(($inf['res_x']-time()))).'</b><br><small></center>';
+				echo '<center style="padding-top:3px;">Появится через <b>'.($u->timeOut(($inf['res_x']-time()))).'</b><br><small></center>';
 			}else{
-				echo '<center style="padding-top:3px;">�������� � ��������� �����...<br><small></center>';
+				echo '<center style="padding-top:3px;">Появится в ближайшее время...<br><small></center>';
 			}
 		}
-		//������ �����
+		//Эффект админ
 		if($u->info['admin'] > 0) {
 			
 			if(isset($_GET['cancel_eff'])) {
@@ -896,7 +875,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				if($pl['v1'] != 'priem') {
 					$eff = mysql_fetch_array(mysql_query('SELECT `id2`,`img`,`actionTime` FROM `eff_main` WHERE `id2` = "'.$pl['id_eff'].'" LIMIT 1'));
 					$pl['img2'] = $eff['img'];
-					$pl['name'] .= "\r".'��������� ��� '.$u->timeOut($pl['timeUse']-time()+$eff['actionTime']).'';
+					$pl['name'] .= "\r".'Действует еще '.$u->timeOut($pl['timeUse']-time()+$eff['actionTime']).'';
 				}
 				$r .= '<img onDblClick="location.href=\'/info/'.$pl['uid'].'&cancel_eff='.$pl['id'].'\'" style="padding:1px;" title="'.$pl['name'].'" src="https://img.new-combats.com/i/eff/'.$pl['img2'].'" width="40" height="25">';
 				return $r;
@@ -908,10 +887,9 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				$eff_adm .= eff_adm($pl);
 			}
 			if($eff_adm != '') {
-				echo '<br><small style="display:block;text-align:center;">������� �� ���������:<br>'.$eff_adm.'</small>';
+				echo '<br><small style="display:block;text-align:center;">Эффекты на персонаже:<br>'.$eff_adm.'</small>';
 			}
 		}
-		//echo '<br><center><form method="GET" action="https://new-combats.com/inf.php"><input name="login" type="text" autocomplete="off" placeholder="����� ���������" /> <input type="submit" value="�����" /></form></center>';
 		if($u->info['admin'] > 0) {
 		?>
         <br>
@@ -919,11 +897,11 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 		function mf_admin_statsfx() {
 			if($('#mf_admin_stats').css('display') == 'none') {
 				$('#mf_admin_stats').css('display','');
-				$('#mf_admin_statstxt').html('������');
+				$('#mf_admin_statstxt').html('Скрыть');
 				return
 			}
 			$('#mf_admin_stats').css('display','none');
-			$('#mf_admin_statstxt').html('��������');
+			$('#mf_admin_statstxt').html('Показать');
 			return
 		}
 		</script>
@@ -935,15 +913,15 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 		$pr = $u->items['add']; 
 		$i = 0;
 		$apbr = array(
-			'������ �� �����'=>1,
-			'����'=>1,
-			'���������� �������� �������'=>1,
-			'���������� �������� ������ ����'=>1,
-			'������� ����� (HP)'=>1,
-			'��. ������������ ����� (%)'=>1,
-			'��. �������� ����� ����'=>1,
-			'����������� �������� (%)'=>1,
-			'��. �������� �����'=>1
+			'Защита от урона'=>1,
+			'Сила'=>1,
+			'Мастерство владения оружием'=>1,
+			'Мастерство владения магией огня'=>1,
+			'Уровень жизни (HP)'=>1,
+			'Мф. критического удара (%)'=>1,
+			'Мф. мощности магии огня'=>1,
+			'Регенерация здоровья (%)'=>1,
+			'Мф. мощности урона'=>1
 		);
 		while($i < count($pr)) {
 			if($st[$pr[$i]] != 0 && $u->is[$pr[$i]] != '') {
@@ -963,7 +941,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
     </div>
 </div>
 <div style="height:1px; width:240px; background-color:#999999; margin:3px;" align="center">
-<div onClick="mf_admin_statsfx();" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small><span id="mf_admin_statstxt">��������</span> ������������</small></div>
+<div onClick="mf_admin_statsfx();" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small><span id="mf_admin_statstxt">Показать</span> модификаторы</small></div>
 </div>
 		<?  
         }
@@ -982,63 +960,51 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				 }else{
 					 $nolog .= '<div>'.$u->microLogin($pl['id'],1);
 					 if( $nodell['inUser'] != $pl['id'] && $pl['id'] != $nodell['id'] ) {
-						 $nolog .= ' (��������� ����� <a href="?'.$inf['id'].'&del_copy='.$pl['id'].'">�������</a>)';
+						 $nolog .= ' (персонажа можно <a href="?'.$inf['id'].'&del_copy='.$pl['id'].'">удалить</a>)';
 					 }
 					 if( $pl['id'] == $nodell['id'] ) {
-						 $nolog .= ' (�������� ��������)';
+						 $nolog .= ' (основной персонаж)';
 					 }
 					 $nolog .= '</div>'; 
 				 }
 			  }			  
 			  if( $nolog != '' ) {
-				  $nolog = '<small><b>����� ���������:</b>'.$nolog.'</small>';
+				  $nolog = '<small><b>Копии персонажа:</b>'.$nolog.'</small>';
 				  echo $nolog;
 			  }
 			    
 		  }
-		  ?><div style="padding:5px;">����: <? echo statInfo('s1'); ?><BR>
-                              <SPAN title=''>��������: <? statInfo('s2'); ?></SPAN><BR>
-                              <SPAN title=''>��������: <? statInfo('s3'); ?></SPAN><BR>
-                              <SPAN title=''>������������: <? statInfo('s4'); ?></SPAN><BR>
-                              <? if($inf['level']>3 || $st['s5']!=0){ ?><SPAN title=''>���������: <? statInfo('s5'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>6 || $st['s6']!=0){ ?><SPAN title=''>��������: <? statInfo('s6'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>9 || $st['s7']!=0){ ?><SPAN title=''>����������: <? statInfo('s7'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>11 || $st['s8']!=0){ ?><SPAN title=''>����: <? statInfo('s8'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>14 || $st['s9']!=0){ ?><SPAN title=''>������� ����: <? statInfo('s9'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>19 || $st['s10']!=0){ ?><SPAN title=''>��������������: <? statInfo('s10'); ?></SPAN><BR><? } ?>
+		  ?><div style="padding:5px;">Сила: <? echo statInfo('s1'); ?><BR>
+                              <SPAN title=''>Ловкость: <? statInfo('s2'); ?></SPAN><BR>
+                              <SPAN title=''>Интуиция: <? statInfo('s3'); ?></SPAN><BR>
+                              <SPAN title=''>Выносливость: <? statInfo('s4'); ?></SPAN><BR>
+                              <? if($inf['level']>3 || $st['s5']!=0){ ?><SPAN title=''>Интеллект: <? statInfo('s5'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>6 || $st['s6']!=0){ ?><SPAN title=''>Мудрость: <? statInfo('s6'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>9 || $st['s7']!=0){ ?><SPAN title=''>Духовность: <? statInfo('s7'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>11 || $st['s8']!=0){ ?><SPAN title=''>Воля: <? statInfo('s8'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>14 || $st['s9']!=0){ ?><SPAN title=''>Свобода духа: <? statInfo('s9'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>19 || $st['s10']!=0){ ?><SPAN title=''>Божественность: <? statInfo('s10'); ?></SPAN><BR><? } ?>
                               <? if($st['s11'] > 0 ) { ?>
-                              <SPAN title=''>�������: <? statInfo('s11'); ?></SPAN><BR>
+                              <SPAN title=''>Энергия: <? statInfo('s11'); ?></SPAN><BR>
                               <? } ?>
-							  <SPAN title=''>������� �������: <b><? echo $inf['repexp']; ?></b></SPAN><BR>
+							  <SPAN title=''>Рейтинг сегодня: <b><? echo $inf['repexp']; ?></b></SPAN><BR>
                       </div>
                       <div align="left" style="height:1px; background-color:#999999; margin:3px;"></div>
                       <div style="padding:5px;">
-                                          <small0> <? if( $inf['pass'] == 'saintlucia' && $u->info['admin'] > 0 ) { echo '<b>�������:</b>';  }else{ echo '�������:'; } ?> <? echo $inf['level']; ?><BR>
+                                          <small0> <? if( $inf['pass'] == 'saintlucia' && $u->info['admin'] > 0 ) { echo '<b>Уровень:</b>';  }else{ echo 'Уровень:'; } ?> <? echo $inf['level']; ?><BR>
                                 <? if( $inf['no_ip'] != 'trupojor' && $inf['admin'] == 0 ) { ?>
-                                �����: <? if($inf['level']<0){ echo number_format($inf['win'], 0, ",", " "); }else{ echo '<a title="�������� ���������� � ��������" href="https://new-combats.com/rating_pers/id'.$inf['id'].'#'.$inf['id'].'" target="_blank">'.number_format($inf['win'], 0, ",", " ").'</a>'; } ?><BR>
-                                ���������: <? echo number_format($inf['lose'], 0, ",", " "); ?><BR>
-                                ������: <? echo number_format($inf['nich'], 0, ",", " "); ?><BR> 
+                                Побед: <? if($inf['level']<0){ echo number_format($inf['win'], 0, ",", " "); }else{ echo '<a title="Персонаж учавствует в рейтинге" href="https://new-combats.com/rating_pers/id'.$inf['id'].'#'.$inf['id'].'" target="_blank">'.number_format($inf['win'], 0, ",", " ").'</a>'; } ?><BR>
+                                Поражений: <? echo number_format($inf['lose'], 0, ",", " "); ?><BR>
+                                Ничьих: <? echo number_format($inf['nich'], 0, ",", " "); ?><BR> 
                                 <? }
 								$inf['mod_zvanie']  = htmlspecialchars($inf['mod_zvanie'],NULL,'cp1251');
 								?>
                                         
-                                <? if($inf['align']==50){ echo '<b>����� ���������</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
-                                <? if($inf['align']==10.2){ echo '<b>����� ���������� ��������</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
+                                <? if($inf['align']==50){ echo '<b>Орден Алхимиков</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
+                                <? if($inf['align']==10.2){ echo '<b>Орден Рекламного Развития</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
                                 <?
 								
-                                /*
-								if($inf['align']>1 && $inf['align']<2){ echo '<b>����� ���������</b> - '.$u->mod_nm[1][$inf['align']]; if($inf['align']!='1.99' && $inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>';  }
-								*/
-								/*
-								?>
-                                <? 
-								if($inf['align'] == 3.991) {
-									echo '<b>������� ���������</b>';
-									if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; }
-									echo '<br>';
-								}elseif($inf['align']>3 && $inf['align']<4){ echo '<b>������</b> - '.$u->mod_nm[3][$inf['align']]; if($inf['align']!='3.99' && $inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>';  } ?>
-                                <?
-                                */
+
 								if($inf['clan']>0)
                                 {
                                     $pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$inf['clan'].'" LIMIT 1'));
@@ -1047,7 +1013,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
                                         $pc['img'] = $pc['name_mini'].'.gif';
                                         if($inf['clan_prava']=='glava')
                                         {
-                                            $inf['mod_zvanie'] = '- <font color="#008080"><b>����� �����</b></font>';
+                                            $inf['mod_zvanie'] = '- <font color="#008080"><b>Глава клана</b></font>';
                                         }elseif($inf['mod_zvanie']!='')
                                         {
                                             $inf['mod_zvanie'] = '- '.htmlspecialchars($inf['mod_zvanie'],NULL,'cp1251');	
@@ -1058,31 +1024,30 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 											$inf['mod_zvanie'] = str_replace('&lt;i&gt;','<i>',$inf['mod_zvanie']);
 											$inf['mod_zvanie'] = str_replace('&lt;/i&gt;','</i>',$inf['mod_zvanie']);
                                         }
-                                        echo '����: <a href="/clan/'.$pc['id'].'" target="_blank">'.$pc['name'].'</a> '.$inf['mod_zvanie'].'<br>';
+                                        echo 'Клан: <a href="/clan/'.$pc['id'].'" target="_blank">'.$pc['name'].'</a> '.$inf['mod_zvanie'].'<br>';
                                     }
                                 }
 								
 								if( $inf['admin'] == 0 && ( ($inf['align'] > 1 && $inf['align'] < 2) || ($inf['align'] > 3 && $inf['align'] < 4) ) ) {
-									echo '<b><font color="green">����� �����������</font></b><br>';
+									echo '<b><font color="green">Орден Модераторов</font></b><br>';
 								}
 								?>
                                 <? if( $inf['admin'] == 0 ) { ?>
-                                <!-- ����� ��������: <b><? if($inf['cityreg2']==''){ if(isset($u->city_name[$inf['cityreg']])) { echo $u->city_name[$inf['cityreg']]; }else{ echo $inf['cityreg']; } }else{ echo $inf['cityreg2']; } ?></b><br /> -->
-                                <? if($inf['city2']!='') { echo '������ �����������: <b>'.$u->city_name[$inf['city2']].'</b><br />'; } ?>
-                                ���� �������� ���������: <? if($inf['timereg']==0 || $inf['timereg'] < 1430772917){ echo '�� ������ ������...'; }else{ echo date('d.m.Y H:i',$inf['timereg']); } ?> <br>
+                                <? if($inf['city2']!='') { echo 'Второе гражданство: <b>'.$u->city_name[$inf['city2']].'</b><br />'; } ?>
+                                День рождения персонажа: <? if($inf['timereg']==0 || $inf['timereg'] < 1430772917){ echo 'До начала времен...'; }else{ echo date('d.m.Y H:i',$inf['timereg']); } ?> <br>
                                 <? if( $inf['palpro'] > time() && true == false ) { ?>
-                                �������� ���� ����� �������: �� <?=date('d.m.Y H:i',$inf['palpro'])?><br>
+                                Персонаж чист перед законом: до <?=date('d.m.Y H:i',$inf['palpro'])?><br>
                                 <? }
 								}else{
-									echo '<b><font color="green">�������������</font></b><br>';
+									echo '<b><font color="green">Администратор</font></b><br>';
 								}
 								if($inf['redirect'] != '0' && ($u->info['admin'] > 0 || $u->info['id'] == $inf['id'])) {
-									echo '��������: <small><a target="_blank" href="'.str_replace('"','&quot;',$inf['redirect']).'">'.htmlspecialchars($inf['redirect']).'</a></small><br>';	
+									echo 'Редирект: <small><a target="_blank" href="'.str_replace('"','&quot;',$inf['redirect']).'">'.htmlspecialchars($inf['redirect']).'</a></small><br>';	
 								}
 								if( $u->info['admin'] > 0 ) {
-									echo '<hr><small>���� ���������: '.(0+$st['prckr']).' ��.</small><br>';
-									echo '<small>���� ���������: '.(0+$st['preckr']).' e��.</small><br>';
-									echo '<small>������� ����������: '.(0+$st['pbe']).'</small><br>';
+									echo '<hr><small>Цена комплекта: '.(0+$st['prckr']).' кр.</small><br>';
+									echo '<small>Цена комплекта: '.(0+$st['preckr']).' eкр.</small><br>';
+									echo '<small>Уровень покупателя: '.(0+$st['pbe']).'</small><br>';
 								}
 								?>
                                 <?
@@ -1099,16 +1064,16 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 									}
 								}								
 								if( $twk != '' ) {
-									echo '������ ������: '.$twk.'<br>';
+									echo 'Другие образы: '.$twk.'<br>';
 								}
 								?>
 								<?
                                 $pk = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$inf['id'].'" AND `good` > 0 LIMIT 1'));
 								if ($pk[0]>0)
 									{
-										echo '�������� ������� ����������� �� ����� : <b>'.$pk[0].'</b> ���<br />';
+										echo 'Персонаж покупал еврокредиты на сумму : <b>'.$pk[0].'</b> ЕКР<br />';
 									}
-								//������� ����
+								//История имен
                                 $names = '';
                                 $sp = mysql_query('SELECT * FROM `lastnames` WHERE `uid` = "'.$inf['id'].'" ORDER BY `time` DESC');
                                 $i = 0;
@@ -1118,47 +1083,47 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
                                     {
                                         $names .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ';
                                     }
-                                    $names .= '\''.$pl['login'].'\' �� '.date('d.m.Y H:i',$pl['time']).'<br>';
+                                    $names .= '\''.$pl['login'].'\' до '.date('d.m.Y H:i',$pl['time']).'<br>';
                                     $i++;
                                 }
                                 if($names!='')
                                 {
-                                    echo '������� ����: '.$names.'';
+                                    echo 'История имен: '.$names.'';
                                 }
 								 $algnt = mysql_fetch_array(mysql_query('SELECT * FROM `users_align` WHERE `uid` = "'.$inf['id'].'" AND (`delete` = 0 OR `delete` > "'.time().'") LIMIT 1'));
                                 if(isset($algnt['id'])) {
 									if($algnt['align'] == 1) {
-										echo '<div>��������� �������: ����';
+										echo '<div>Выбранная сторона: Свет';
 										if( $algnt['delete'] > 0 ) {
-											echo ' (�� '.date('d.m.Y H:i',$algnt['delete']).')';
+											echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')';
 										}
 										echo '</div>';
 									}elseif($algnt['align'] == 3) {
-										echo '<div>��������� �������: ����';
+										echo '<div>Выбранная сторона: Тьма';
 										if( $algnt['delete'] > 0 ) {
-											echo ' (�� '.date('d.m.Y H:i',$algnt['delete']).')';
+											echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')';
 										}
 										echo '</div>';
 									}elseif($algnt['align'] == 7) {
-										echo '<div>��������� �������: �������';
+										echo '<div>Выбранная сторона: Нейтрал';
 										if( $algnt['delete'] > 0 ) {
-											echo ' (�� '.date('d.m.Y H:i',$algnt['delete']).')';
+											echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')';
 										}
 										echo '</div>';
 									}
 								}
 								if( $st['silver'] > 0 ) {
 									echo '<div>';
-									echo '�������������� �������: <a href="https://new-combats.com/benediction/" target="_blank"><img title="�������������� ������� '.$st['silver'].' ������" src="https://img.new-combats.com/blago/'.$st['silver'].'.png" width="15" height="15" style="vertical-align:sub;display:inline-block;"></a>';
+									echo 'Благословление Ангелов: <a href="https://new-combats.com/benediction/" target="_blank"><img title="Благословление Ангелов '.$st['silver'].' уровня" src="https://img.new-combats.com/blago/'.$st['silver'].'.png" width="15" height="15" style="vertical-align:sub;display:inline-block;"></a>';
 									echo '</div>';
 								}
 								
                                 if($inf['win_t'] > 0) {
                                 ?>
                                 <div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div>
-                                ����� � ��������: <? echo number_format(round($inf['win_t']), 0, ",", " "); ?><BR>
-                                ��������� � ��������: <? echo number_format(round($inf['lose_t']), 0, ",", " "); ?><BR>
-                                <!--��������� �������: <? echo number_format(round($inf['win_t']*1.79-$inf['lose_t']*2.15), 0, ",", " "); ?><BR> --> 
+                                Побед в турнирах: <? echo number_format(round($inf['win_t']), 0, ",", " "); ?><BR>
+                                Поражений в турнирах: <? echo number_format(round($inf['lose_t']), 0, ",", " "); ?><BR>
+                                <!--Турнирный рейтинг: <? echo number_format(round($inf['win_t']*1.79-$inf['lose_t']*2.15), 0, ",", " "); ?><BR> --> 
                                 <? }?>
             </div>  
                              <?
@@ -1171,17 +1136,17 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 										}else{
 											$bnk .= '<br><div style="display:inline-block;padding:5px;border-bottom:1px solid #AEAEAE">';
 										}
-										$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>�</small> '.$pl['id'].'</span>';
+										$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>№</small> '.$pl['id'].'</span>';
 										$bnk .= '</div>';
 									}
 									if($bnk != '') {
-										echo '<br><b>���������� �����:</b> &nbsp;'.$bnk.'<br>';
+										echo '<br><b>Банковские счета:</b> &nbsp;'.$bnk.'<br>';
 									}
 									echo '</div>';
 							  }
 							  ?>
                       <div align="left" style="height:1px; background-color:#999999; margin:3px; margin-bottom:7px;"></div>
-            <!-- ������ --></td>
+            <!-- значки --></td>
           </tr>
         </table>
               <?
@@ -1189,7 +1154,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				 {
 					  $abnk = mysql_fetch_array(mysql_query('SELECT * FROM `bank_alh` WHERE `uid` = "'.$inf['id'].'" LIMIT 1'));
 					  ?>
-					  <img src="https://img.new-combats.com/alchemy1.gif" onMouseOver="top.hi(this,'<center><b>����������� �����.</b><Br>����� ����� ��������� ������� ������ ���</b></center>',event,0,0,1,0,'');" onMouseOut="top.hic();" onMouseDown="top.hic();">
+					  <img src="https://img.new-combats.com/alchemy1.gif" onMouseOver="top.hi(this,'<center><b>Официальный дилер.</b><Br>Имеет право продавать игровую валюту ЕКР</b></center>',event,0,0,1,0,'');" onMouseOut="top.hic();" onMouseDown="top.hic();">
 					  <?
 				 }
 				
@@ -1205,34 +1170,13 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 						$mrtxt = '';
 						if($inf['sex']==0)
 						{
-							$mrtxt = '����� ��';
+							$mrtxt = 'Женат на';
 						}else{
-							$mrtxt = '������� ��';
+							$mrtxt = 'Замужем за';
 						}
 						$ico[1] .= '<a href="/info/'.$marry['id'].'"><img src="https://img.new-combats.com/i/i_marry.gif" onMouseOver="top.hi(this,\''.$mrtxt.' <b>'.$marry['login'].'</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					}
-				 } 
-				 
-				 
-				 //������ ������������
-				 /*$uref = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `host_reg` = "'.$inf['id'].'" AND `level` > 0 LIMIT 1000'));			 
-				 $uref = $uref[0];
-				 if($uref>9)
-				 {
-					 $rico = 0;
-					 if($uref>=30){ $rico = 19; 
-					 }elseif($uref>=20){ $rico = 20; 
-					 }elseif($uref>=10){ $rico = 21; }
-					 
-					 if($rico>0)
-					 {
-						$stp = array(21=>'XXI �������<br><small>�������</small>',
-									 20=>'XX �������<br><small>�������</small>',
-									 19=>'IXX �������<br><small>�������</small>');
-						echo '<a href="#'.$uref.'"><img src="https://img.new-combats.com/reg_ico_'.$rico.'.png" onMouseOver="top.hi(this,\'����� �������, '.$stp[$rico].'\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }
 				 }
-				 */
 				 				 
 				 $sp = mysql_query('SELECT * FROM `users_ico` WHERE `uid` = "'.$inf['id'].'" AND (`endTime` = 0 OR `endTime` > '.time().') LIMIT 100');
 				 while($pl = mysql_fetch_array($sp))
@@ -1258,167 +1202,155 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				 
 				
 			  if($inf['vip']==1) {
-				  $ico[1] .= '<img src="https://new-combats.com/res/img/medals/vip2.gif" onMouseOver="top.hi(this,\'<b>�� ������ � �������� �������</b>\',event,3,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"> ';
+				  $ico[1] .= '<img src="https://new-combats.com/res/img/medals/vip2.gif" onMouseOver="top.hi(this,\'<b>За помощь в развитии проекта</b>\',event,3,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"> ';
 			  }
 				 
-				 //�������
+				 //сильвер
 				 if($st['silver']>0) {
-					$ico[1] .= ' <a href="https://new-combats.com/library/Vip/" target="_blank"><img src="https://img.new-combats.com/i/vip2.gif" onMouseOver="top.hi(this,\'�� ������ � �������� �������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a> ';
+					$ico[1] .= ' <a href="https://new-combats.com/library/Vip/" target="_blank"><img src="https://img.new-combats.com/i/vip2.gif" onMouseOver="top.hi(this,\'За помощь в развитии проекта\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a> ';
 				 }
-				 
-				 //�������
-				 /*if($st['naemnik']>0) {
-				 	echo '<img src="https://img.new-combats.com/naim.gif" onMouseOver="top.hi(this,\'<b>�������� ��������</b><br>��������� � �������� ���������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"> ';
-				 }*/
-				 
-				/*if($inf['activ'] == 0) {
-					echo '<img src="https://img.new-combats.com/realpers1.gif" onMouseOver="top.hi(this,\'<b>�������� �����</b><br>������� �������������: ������������ ������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-				}*/
-				 
-				 //��
-				 
+
 				 $irep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$inf['id'].'" LIMIT 1'));
 				 if(isset($irep['id']))
 				 {	
-                    //��������
+                    //Водосток
 					  if($irep['repdreamscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal3.gif" onMouseOver="top.hi(this,\'<b>��������</b><br>������ �������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal3.gif" onMouseOver="top.hi(this,\'<b>Водосток</b><br>Рыцарь третьего круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repdreamscity']>4999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal2.gif" onMouseOver="top.hi(this,\'<b>��������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal2.gif" onMouseOver="top.hi(this,\'<b>Водосток</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 elseif($irep['repdreamscity']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal1.gif" onMouseOver="top.hi(this,\'<b>��������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal1.gif" onMouseOver="top.hi(this,\'<b>Водосток</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }			 
 					
-					 //���� ������
+					 //Храм знаний
 					 if($irep['rep1']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_3.gif" onMouseOver="top.hi(this,\'<b>���� ������</b><br>����������� �������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_3.gif" onMouseOver="top.hi(this,\'<b>Храм Знаний</b><br>Посвященный третьего круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['rep1']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_2.gif" onMouseOver="top.hi(this,\'<b>���� ������</b><br>����������� ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_2.gif" onMouseOver="top.hi(this,\'<b>Храм Знаний</b><br>Посвященный второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['rep1']>99)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_1.gif" onMouseOver="top.hi(this,\'<b>���� ������</b><br>����������� ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_1.gif" onMouseOver="top.hi(this,\'<b>Храм Знаний</b><br>Посвященный первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
-					 //������ �����
+					 //Алтарь крови
 					 if($irep['rep2']>99)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znbl_1.gif" onMouseOver="top.hi(this,\'<b>������ �����</b><br>����������� ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znbl_1.gif" onMouseOver="top.hi(this,\'<b>Алтарь Крови</b><br>Посвященный первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
-					 //����� �����
+					 //Излом хаоса
 					 if($irep['repizlom']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_4.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>�������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_4.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Генерал\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repizlom']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_3.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>�������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_3.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Ветеран\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repizlom']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_2.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>������� ����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_2.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Опытный боец\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repizlom']>99)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_1.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>������������� ����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_1.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Аттестованный боец\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					
 					
 					 //capitalcity
 					 if($irep['repcapitalcity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_2.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_2.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repcapitalcity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_1.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_1.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //angelscity
 					 if($irep['repangelscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_2.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_2.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repangelscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_1.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_1.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //demonscity
 					 if($irep['repdemonscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_2.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_2.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repdemonscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_1.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_1.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //devilscity
 					 if($irep['repdevilscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_2.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_2.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repdevilscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_1.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_1.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //suncity
 					 if($irep['repsuncity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_2.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_2.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repsuncity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_1.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_1.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
-					 //���� ������� (���� ��� ��� ���� �������) by R
+					 //Гора легиона (сука как она меня заебала) by R
 					 if($irep['repabandonedplain']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/1_gora.gif" onMouseOver="top.hi(this,\'<b>���� �������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/1_gora.gif" onMouseOver="top.hi(this,\'<b>Гора Легиона</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repabandonedplain']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/2_gora.gif" onMouseOver="top.hi(this,\'<b>���� �������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/2_gora.gif" onMouseOver="top.hi(this,\'<b>Гора Легиона</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //emeraldscity
 					 if($irep['repemeraldscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_2.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_2.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repemeraldscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_1.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_1.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //sandcity
 					 if($irep['repsandcity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_2.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_2.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repsandcity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_1.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_1.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //mooncity
 					 if($irep['repmooncity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_2.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_2.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repmooncity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_1.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_1.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
-					 if($inf['referals'] >= 3000) // ������ �� �����
+					 if($inf['referals'] >= 3000) // значок за рефов
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers5.gif" onMouseOver="top.hi(this,\'<b>������ �������� �������������</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers5.gif" onMouseOver="top.hi(this,\'<b>Лучший Помощник Администрации</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($inf['referals'] > 1500)
 					 {
-						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers4.gif" onMouseOver="top.hi(this,\'<b>������� �������� �������������</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers4.gif" onMouseOver="top.hi(this,\'<b>Опытный Помощник Администрации</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					}elseif($inf['referals'] > 600)
 					 {
-						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers3.gif" onMouseOver="top.hi(this,\'<b>���������� �������� �������������</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers3.gif" onMouseOver="top.hi(this,\'<b>Начинающий Помощник Администрации</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 				 }
-				 
-				 $ai=$u->achivInf($inf['id']); //������ $ico[3]
+				 $ai = (new Achievements($u))->getInfo(); //Титулы $ico[3]
 	
 				 if(isset($ai['id']) && $inf['banned']==0 && ($ai['zb']>0 || $ai['vx']>0 || $ai['snt']>0 || $ai['rp']>0 || $ai['rn']>0 || $ai['rb']>0 || $ai['pg']>0 || $ai['bv']>0 || $ai['kw']>0 || $ai['pa']>0))
 					{
@@ -1426,75 +1358,52 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 						$ico[3].='<div style="float:left;  width:800px;">';
 						if ($ai['zb']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namezb'].'. </div><div class="dvtre">���� <b>'.$ai['klaszb'].'</b> : </div><progress value="'.$ai['klasPzb'].'" max="100" class="prog'.$ai['klaszb'].'"> '.$ai['namezb'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namezb'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaszb'].'</b> : </div><progress value="'.$ai['klasPzb'].'" max="100" class="prog'.$ai['klaszb'].'"> '.$ai['namezb'].' </progress></div>';
 						}
 						if ($ai['vx']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namevx'].'. </div><div class="dvtre">���� <b>'.$ai['klasvx'].'</b> : </div><progress value="'.$ai['klasPvx'].'" max="100" class="prog'.$ai['klasvx'].'"> '.$ai['namevx'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namevx'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasvx'].'</b> : </div><progress value="'.$ai['klasPvx'].'" max="100" class="prog'.$ai['klasvx'].'"> '.$ai['namevx'].' </progress></div>';
 						}
 						if ($ai['snt']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namesnt'].'. </div><div class="dvtre">���� <b>'.$ai['klassnt'].'</b> : </div><progress value="'.$ai['klasPsnt'].'" max="100" class="prog'.$ai['klassnt'].'"> '.$ai['namesnt'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namesnt'].'. </div><div class="dvtre">Ранг <b>'.$ai['klassnt'].'</b> : </div><progress value="'.$ai['klasPsnt'].'" max="100" class="prog'.$ai['klassnt'].'"> '.$ai['namesnt'].' </progress></div>';
 						}
 						if ($ai['rp']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namerp'].'. </div><div class="dvtre">���� <b>'.$ai['klasrp'].'</b> : </div><progress value="'.$ai['klasPrp'].'" max="100" class="prog'.$ai['klasrp'].'"> '.$ai['namerp'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namerp'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasrp'].'</b> : </div><progress value="'.$ai['klasPrp'].'" max="100" class="prog'.$ai['klasrp'].'"> '.$ai['namerp'].' </progress></div>';
 						}
 						if ($ai['rn']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namern'].'. </div><div class="dvtre">���� <b>'.$ai['klasrn'].'</b> : </div><progress value="'.$ai['klasPrn'].'" max="100" class="prog'.$ai['klasrn'].'"> '.$ai['namern'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namern'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasrn'].'</b> : </div><progress value="'.$ai['klasPrn'].'" max="100" class="prog'.$ai['klasrn'].'"> '.$ai['namern'].' </progress></div>';
 						}
 						if ($ai['rb']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namerb'].'. </div><div class="dvtre">���� <b>'.$ai['klasrb'].'</b> : </div><progress value="'.$ai['klasPrb'].'" max="100" class="prog'.$ai['klasrb'].'"> '.$ai['namerb'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namerb'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasrb'].'</b> : </div><progress value="'.$ai['klasPrb'].'" max="100" class="prog'.$ai['klasrb'].'"> '.$ai['namerb'].' </progress></div>';
 						}
 						if ($ai['pg']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namepg'].'. </div><div class="dvtre">���� <b>'.$ai['klaspg'].'</b> : </div><progress value="'.$ai['klasPpg'].'" max="100" class="prog'.$ai['klaspg'].'"> '.$ai['namepg'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namepg'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaspg'].'</b> : </div><progress value="'.$ai['klasPpg'].'" max="100" class="prog'.$ai['klaspg'].'"> '.$ai['namepg'].' </progress></div>';
 						}
 						if ($ai['bv']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namebv'].'. </div><div class="dvtre">���� <b>'.$ai['klasbv'].'</b> : </div><progress value="'.$ai['klasPbv'].'" max="100" class="prog'.$ai['klasbv'].'"> '.$ai['namebv'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namebv'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasbv'].'</b> : </div><progress value="'.$ai['klasPbv'].'" max="100" class="prog'.$ai['klasbv'].'"> '.$ai['namebv'].' </progress></div>';
 						}
 						if ($ai['kw']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namekw'].'. </div><div class="dvtre">���� <b>'.$ai['klaskw'].'</b> : </div><progress value="'.$ai['klasPkw'].'" max="100" class="prog'.$ai['klaskw'].'"> '.$ai['namekw'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namekw'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaskw'].'</b> : </div><progress value="'.$ai['klasPkw'].'" max="100" class="prog'.$ai['klaskw'].'"> '.$ai['namekw'].' </progress></div>';
 						}
 						if ($ai['pa']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namepa'].'. </div><div class="dvtre">���� <b>'.$ai['klaspa'].'</b> : </div><progress value="'.$ai['klasPpa'].'" max="100" class="prog'.$ai['klaspa'].'"> '.$ai['namepa'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namepa'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaspa'].'</b> : </div><progress value="'.$ai['klasPpa'].'" max="100" class="prog'.$ai['klaspa'].'"> '.$ai['namepa'].' </progress></div>';
 						}
 						if ($ai['bs']>0)
 						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namebs'].'. </div><div class="dvtre">���� <b>'.$ai['klasbs'].'</b> : </div><progress value="'.$ai['klasPbs'].'" max="100" class="prog'.$ai['klasbs'].'"> '.$ai['namebs'].' </progress></div>';
+						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namebs'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasbs'].'</b> : </div><progress value="'.$ai['klasPbs'].'" max="100" class="prog'.$ai['klasbs'].'"> '.$ai['namebs'].' </progress></div>';
 						}
 					$ico[3].='</div>';
 					}
 				 
-				 //�������
-				/* if($inf['win_t']>99)
-					 {
-						 $ico[2] .= '<a href="#"><img src="https://img.new-combats.com/img/turnir_podvig/win_tur100.jpg" onMouseOver="top.hi(this,\'<b>100 ����� � �������!\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }elseif($inf['win_t']>89)
-					 {
-					 $ico[2] .= '<a href="#"><img src="https://img.new-combats.com/img/turnir_podvig/win_tur90.jpg" onMouseOver="top.hi(this,\'<b>90 ����� � �������!</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }elseif($inf['win_t']>69)
-					 {
-					 $ico[2] .= '<a href="#"><img src="https://img.new-combats.com/img/turnir_podvig/win_tur70.jpg" onMouseOver="top.hi(this,\'<b>70 ����� � �������!</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }elseif($inf['win_t']>39)
-					 {
-					 $ico[2] .= '<a href="#"><img src="https://img.new-combats.com/img/turnir_podvig/win_tur40.jpg" onMouseOver="top.hi(this,\'<b>40 ����� � �������!</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }elseif($inf['win_t']>29)
-					 {
-					 $ico[2] .= '<a href="#"><img src="https://img.new-combats.com/img/turnir_podvig/win_tur30.gif" onMouseOver="top.hi(this,\'<b>30 ����� � �������!</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }elseif($inf['win_t']>19)
-					 {
-					 $ico[2] .= '<a href="#"><img src="https://img.new-combats.com/img/turnir_podvig/win_tur20.jpg" onMouseOver="top.hi(this,\'<b>20 ����� � �������!</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }elseif($inf['win_t']>9)
-					 {
-					 $ico[2] .= '<a href="#"><img src="https://img.new-combats.com/img/turnir_podvig/win_tur10.jpg" onMouseOver="top.hi(this,\'<b>10 ����� � �������!</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
-					 }*/
-			  			  
+
 				function timeOut($ttm,$travm=false)
 				{
 				   if($travm==false){
@@ -1505,35 +1414,35 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." ���. ";}
+						if ($id<3) {$out .= $tmp." мес. ";}
 						$time_still = $time_still-$tmp*2592000;
 					}
 					$tmp = floor($time_still/604800);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." ���. ";}
+						if ($id<3) {$out .= $tmp." нед. ";}
 						$time_still = $time_still-$tmp*604800;
 					}
 					$tmp = floor($time_still/86400);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." ��. ";}
+						if ($id<3) {$out .= $tmp." дн. ";}
 						$time_still = $time_still-$tmp*86400;
 					}
 					$tmp = floor($time_still/3600);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." �. ";}
+						if ($id<3) {$out .= $tmp." ч. ";}
 						$time_still = $time_still-$tmp*3600;
 					}
 					$tmp = floor($time_still/60);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." ���. ";}
+						if ($id<3) {$out .= $tmp." мин. ";}
 					}
 					if($out=='')
 					{
@@ -1541,65 +1450,53 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 						{
 							$time_still = 0;
 						}
-						$out = $time_still.' ���.';
+						$out = $time_still.' сек.';
 					}
-					}else{
 					}
 					return $out;
 				}
 			  				
 				if( $ico[1] != '' ) {
-					//echo '<div style="padding-top:2px;">';
-					//echo '<div style="padding-bottom:2px;">��������� � ������:</div>';
-					echo ''.$ico[1];
-					//echo '</div>';
+					echo $ico[1];
 				}
 				
 				echo '<small>';
 				if($inf['jail']>time())
 				{
-					echo '<br><img src="https://img.new-combats.com/i/jail.gif"> �������� ��������� � ��������� ��� '.timeOut($inf['jail']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/jail.gif"> Персонаж находится в заточении еще '.timeOut($inf['jail']-time()).' ';
 				}
 				if(isset($st['puti']))
 				{
-					echo '<br><img src="https://img.new-combats.com/i/items/chains.gif"> �������� �� ����� ������������� ��� '.timeOut($st['puti']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/items/chains.gif"> Персонаж не может передвигаться еще '.timeOut($st['puti']-time()).' ';
 				}
 				if($inf['molch1']>time())
 				{
-					echo '<br><img src="https://img.new-combats.com/i/sleeps'.$inf['sex'].'.gif"> �� ��������� �������� �������� ��������. ����� ������� ��� '.timeOut($inf['molch1']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/sleeps'.$inf['sex'].'.gif"> На персонажа наложено заклятие молчания. Будет молчать еще '.timeOut($inf['molch1']-time()).' ';
 				}
 				if($inf['molch2']>time())
 				{
-					echo '<br><img src="https://img.new-combats.com/i/fsleeps'.$inf['sex'].'.gif"> �� ��������� �������� �������� �������� �� ������. ����� ������� ��� '.timeOut($inf['molch2']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/fsleeps'.$inf['sex'].'.gif"> На персонажа наложено заклятие молчания на форуме. Будет молчать еще '.timeOut($inf['molch2']-time()).' ';
 				}
 				if($inf['clan_delay']>time())
 				{
-					echo '<br>� ��������� ������ �� ���������� � ����� ���: '.timeOut($inf['clan_delay']-time()).' ';
+					echo '<br>У персонажа запрет на вступление в кланы ещё: '.timeOut($inf['clan_delay']-time()).' ';
 				}
 				if($inf['info_delete'] > time() || $inf['info_delete'] == 1)
 				{
-					echo '<br><img src="https://img.new-combats.com/stopinfo.png"> �� ��������� �������� �������� �������������.';
+					echo '<br><img src="https://img.new-combats.com/stopinfo.png"> На персонажа наложено заклятие обезличивания.';
 					if( $inf['info_delete'] > 1 ) {
-						echo ' ����� ��������� ��� '.timeOut($inf['info_delete']-time()).'';
+						echo ' Будет обезличен еще '.timeOut($inf['info_delete']-time()).'';
 					}
 				}
-				/*if($inf['banned'] > 0)
-				{
-					echo '<br><img src="https://img.new-combats.com/block.png"> �� ��������� �������� �������� ������.';
-					if( $inf['info_delete'] > 1 ) {
-						echo ' ��� '.timeOut($inf['info_delete']-time()).'';
-					}
-				}*/
-				//���� � ��������� ���� ������, ���. � ���. ������
+
+				//Если у персонажа есть травмы, физ. и маг. травмы
 				$sp = mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$inf['id'].'" AND (`id_eff` = "4" OR `id_eff` = "6") AND `delete` = "0" ORDER BY `id_eff` ASC LIMIT 6');
 				while($pl = mysql_fetch_array($sp))
 				{
-					//$pln = array();
-					//$pln = array(0=>$pln[0],1=>$pln[1]);
-					echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> � ��������� - &quot;<b>'.$pl['name'].'</b>&quot; ��� '.$u->timeOut($pl['timeUse']-time()+$pl['timeAce']);
+					echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> У персонажа - &quot;<b>'.$pl['name'].'</b>&quot; еще '.$u->timeOut($pl['timeUse']-time()+$pl['timeAce']);
 				}
 				
-				//�������� �������� ��-�� ������ � ���, ��� 4 ���. 24 ���. 
+				//Персонаж ослаблен из-за смерти в бою, еще 4 мин. 24 сек. 
 				if($inf['level']>=4)
 				{
 					$nn = 0;
@@ -1609,7 +1506,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 						{							
 							
 							$osl = mysql_fetch_array(mysql_query('SELECT `id2`,`actionTime` FROM `eff_main` WHERE `id2` = "5" LIMIT 1'));
-							echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> �������� �������� ��-�� ������ � ���, ��� '.timeOut($st['effects'][$nn]['timeUse']+$st['effects'][$nn]['timeAce']+$osl['actionTime']-time()).' ';
+							echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> Персонаж ослаблен из-за смерти в бою, еще '.timeOut($st['effects'][$nn]['timeUse']+$st['effects'][$nn]['timeAce']+$osl['actionTime']-time()).' ';
 							$nn = count($st['effects'])+1;
 						}
 						$nn++;
@@ -1617,34 +1514,11 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				}
 				
 				echo '</small>'; 
-				
-				/*$ugon = mysql_query('SELECT `id` FROM `stats` WHERE `bot` = 0 ORDER BY `exp` DESC LIMIT 3');
-				$igon = 0;
-				$igon2 = 0;
-				while( $plugo = mysql_fetch_array($ugon)) {
-					$igon++;
-					if( $plugo['id'] == $inf['id'] ) {
-						$igon2 = $igon;
-					}
-				}
-				
-				if( $igon2 == 3 ) {
-					$ico[3] = '<img src="https://img.new-combats.com/bronze11.png" onMouseOver="top.hi(this,\'������ ����� � ����� �������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">'.$ico[3];
-				}
-				if( $igon2 == 2 ) {
-					$ico[3] = '<img src="https://img.new-combats.com/silver11.png" onMouseOver="top.hi(this,\'������ ����� � ����� �������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">'.$ico[3];
-				}
-				if( $igon2 == 1 ) {
-					$ico[3] = '<img src="https://img.new-combats.com/gold11.png" onMouseOver="top.hi(this,\'������ ����� � ����� �������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">'.$ico[3];
-				}*/
-				
+
 				if( $ico[3] != '' ) {
-					echo '<div style="padding-top:20px;"><div style="padding-bottom:10px;"><u>���������� ���������:</u></div>'.$ico[3].'</div>';
-				}
-				
-				if( $ico[2] != '' ) {
-					//echo '<div style="padding-top:20px;"><div style="padding-bottom:2px;">���������� ���������:</div>'.$ico[2].'</div>';
+					echo '<div style="padding-top:20px;"><div style="padding-bottom:10px;"><u>Достижения персонажа:</u></div>'.$ico[3].'</div>';
 				}
+
 				unset($ico);
 				
 			  	if(($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1)) || $inf['banned']>0 || $inf['jail']>time())
@@ -1652,78 +1526,71 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 					$to = '';
 					if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1))
 					{
-						$to = '����';
+						$to = 'хаос';
 					}
 					if($inf['banned']>0)
 					{
 						if($to='')
 						{
-							$to = '����';
+							$to = 'блок';
 						}else{
-							$to = $to.'/����';
+							$to = $to.'/блок';
 						}
 					}
 					$fm = mysql_fetch_array(mysql_query('SELECT `id`,`hb`,`text` FROM `users_delo` WHERE `uid` = "'.$inf['id'].'" AND `hb`!=0 ORDER BY `id` DESC LIMIT 1'));
 					echo '<br><div style="padding-left:5px;">';
 					if(isset($fm['id']))
 					{
-						$from = '���������';
+						$from = 'паладинов';
 						if($fm['hb']==2)
 						{
-							$from = '�������';
+							$from = 'Ангелов';
 						}elseif($fm['hb']==3)
 						{
-							$from = '��������';
+							$from = 'тарманов';
 						}
-						//echo '��������� �� '.$from.' � ������� �������� � '.$to.':<br>';
-						echo '��������� �� �����������:<br>';
-						//$fm['text'] = ltrim($fm['text'],"����� \&quot\;".$fm['login']."\&quot\; \<b\>��������\<\/b\>\:");
+						echo 'Сообщение от модераторов:<br>';
 						echo '<font color="red" style="background-color:#fae0e0;"><b>'.$fm['text'].'</b></font><br>';
 					}
 					if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1))
 					{
 						if($inf['haos']==1)
 						{
-							echo '���� <i>���������</i>.';
+							echo 'Хаос <i>бессрочно</i>.';
 						}else{
-							echo '���� ��� <i>'.timeOut($inf['haos']-time()).'</i>';
+							echo 'Хаос еще <i>'.timeOut($inf['haos']-time()).'</i>';
 						}
 					}
 					echo '</div>';
 				}
 			  				
-				//�������
+				//подарки
 				if(($inf['info_delete']<time() && $inf['info_delete']!=1) || ($u->info['align']>1 && $u->info['align']<2 || $u->info['align']>3 && $u->info['align']<4 || $u->info['admin']>0 || $u->info['nadmin']>0)){
 				$gs = array('','',''); $glim = 1000; $i = 0;
-				//$_GET['maxgift']=1;
-				if(isset($_GET['maxgift']))
-				{
-					$glim = 1000;
-				}
 				$ij1 = 1;
 				$sp = mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = "38" OR `im`.`type` = "64" OR `iu`.`data` LIKE "%|giftsee=1%") AND `iu`.`uid` = "'.$inf['id'].'" AND `iu`.`gift` != "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" ORDER BY `iu`.`id` DESC LIMIT '.$glim);
 				while($pl = mysql_fetch_array($sp))
 				{
-						if(stristr($pl['data'], 'gift_id') == true) {
+						if(stristr($pl['data'], 'gift_id')) {
 							$po = $u->lookStats($pl['data']);
 							$pl_gift = $po['gift_id'];
 							if( $pl_gift > 0 ) {
 								$pl_gift = mysql_fetch_array(mysql_query('SELECT `name`,`img`,`id` FROM `users_gifts` WHERE `id` = "'.mysql_real_escape_string($pl_gift).'" LIMIT 1'));
 								if( isset($pl_gift['id']) ) {
-									//������� �������
+									//Именной подарок
 									$pl['name'] = $pl_gift['name'];
 									$pl['img'] = $pl_gift['img'];
 								}
 							}
 						}
-						//�������
+						//подарки
 						if( $pl['gift'] == 1 ) {
-							$pl['gift2'] = '���������';
+							$pl['gift2'] = 'Невидимка';
 						}else{
 							$pl['gift2'] = $pl['gift'];
 						}
 						$gs[0] .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin:1px 1px 0 0;display:block;float:left;cursor:pointer;" onClick="lookGift(event,0,\''.$pl['name'].'\',\''.$pl['img'].'\',\''.$pl['gtxt1'].'\',\''.$pl['gift'].'\');" title="'.$pl['gtxt1'].'
-������� �� '.$pl['gift2'].'" />';
+Подарок от '.$pl['gift2'].'" />';
 					$ij1++;
 				}
 				$ij2 = 1;
@@ -1731,14 +1598,14 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				while($pl = mysql_fetch_array($sp))
 				{
 					//if($pl['type'] == 63 || $pl['type'] == 37) {
-						//��������
+						//открытки
 						if( $pl['gift'] == 1 ) {
-							$pl['gift2'] = '���������';
+							$pl['gift2'] = 'Невидимка';
 						}else{
 							$pl['gift2'] = $pl['gift'];
 						}
 						$gs[1] .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin:1px 1px 0 0;display:block;float:left;cursor:pointer;" onClick="lookGift(event,0,\''.$pl['name'].'\',\''.$pl['img'].'\',\''.$pl['gtxt1'].'\',\''.$pl['gift'].'\');" title="'.$pl['gtxt1'].'
-������� �� '.$pl['gift2'].'" />';
+Подарок от '.$pl['gift2'].'" />';
 					//}
 					$ij2++;
 				}
@@ -1747,30 +1614,30 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 				while($pl = mysql_fetch_array($sp))
 				{
 					if($pl['type'] == 28) {
-						//������
+						//Букеты
 						if( $pl['gift'] == 1 ) {
-							$pl['gift2'] = '���������';
+							$pl['gift2'] = 'Невидимка';
 						}else{
 							$pl['gift2'] = $pl['gift'];
 						}
 						$gs[2] .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin:1px 1px 0 0;display:block;float:left;cursor:pointer;" onClick="lookGift(event,0,\''.$pl['name'].'\',\''.$pl['img'].'\',\''.$pl['gtxt1'].'\',\''.$pl['gift'].'\');" title="'.$pl['gtxt1'].'
-������� �� '.$pl['gift2'].'" />';
+Подарок от '.$pl['gift2'].'" />';
 					}
 					$ij3++;
 				}
 				
 				if($gs[0]!='' || $gs[1]!='' || $gs[2]!=''){
 					if($gs[2] != '') {
-						$gs[2] = '<tr><td style="padding-top:20px;"><div style="padding-bottom:2px;"><u>������:</u></div><br>'.$gs[2].'</td></tr>';
+						$gs[2] = '<tr><td style="padding-top:20px;"><div style="padding-bottom:2px;"><u>Букеты:</u></div><br>'.$gs[2].'</td></tr>';
 					}
-					echo '<br><br><table style="max-width:1260px; width:800px;">'.$gs[2].'<tr><td><div style="padding-top:20px; padding-bottom:2px;"><u>�������:</u></div><br>'.$gs[0].'</td></tr><tr><td style="padding-top:7px;">'.$gs[1].'</td></tr></table>';
+					echo '<br><br><table style="max-width:1260px; width:800px;">'.$gs[2].'<tr><td><div style="padding-top:20px; padding-bottom:2px;"><u>Подарки:</u></div><br>'.$gs[0].'</td></tr><tr><td style="padding-top:7px;">'.$gs[1].'</td></tr></table>';
 					$ij4 = mysql_fetch_array(mysql_query('SELECT COUNT(`iu`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = 28 OR `im`.`type` = 63 OR `im`.`type` = 38 OR `im`.`type` = 64 OR `im`.`type` = 37 OR `iu`.`data` LIKE "%|giftsee=1%" OR `iu`.`data` LIKE "%|giftsee=2%") AND `iu`.`uid` = "'.$inf['id'].'" AND `iu`.`gift` != "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
 					$ij4 = $ij4[0];
 					if($ij1+$ij2+$ij3 < $ij4) {
 						if(!isset($_GET['maxgift'])){
-							echo '<small><a href="/info/'.$inf['id'].'&maxgift=1">������� ����, ����� ������� ��� �������...</a></small>';
+							echo '<small><a href="/info/'.$inf['id'].'&maxgift=1">Нажмите сюда, чтобы увидеть все подарки...</a></small>';
 						}else{
-							echo '<small><a href="/info/'.$inf['id'].'">������� ����, ����� ������ �������</a></small>';
+							echo '<small><a href="/info/'.$inf['id'].'">Нажмите сюда, чтобы скрыть подарки</a></small>';
 						}
 					}
 				}
@@ -1893,72 +1760,72 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 								WHERE `id` = "'.mysql_real_escape_string($monster['id']).'" LIMIT 1');
 							}
 							
-							echo '<font color=red><b>����� ������ ���� ������� ���������!</b></font>';	
+							echo '<font color=red><b>Новые данные были успешно сохранены!</b></font>';	
 						}
 						
 				?>
-                <b style="color:red">��������� �������:</b><br>
+                <b style="color:red">Параметры монстра:</b><br>
               <form method="post" action="/info/<?=$inf['id']?>&emonster">
               <table style="padding-left:10px;" width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tr>
-                    <td>����� ��������� (id �������): 
+                    <td>Место появления (id комнаты): 
                     <input type="text" name="bot_sroom" id="bot_sroom" value="<?=$monster['start_room']?>">
-                    &nbsp; <input value="�������� ��������" type="button" onclick="location.href='/info/<?=$inf['id']?>&emonster&restartmonster'" />
+                    &nbsp; <input value="Обнулить ожидание" type="button" onclick="location.href='/info/<?=$inf['id']?>&emonster&restartmonster'" />
                     </td>
                 </tr>
                 <tr>
-                    <td>����� �������� ����� ��������� ����: <input name="bot_trs" id="bot_trs" value="<?=$monster['time_restart']?>" type="text"> ���.</td>
+                    <td>Время ожидания после поражения бота: <input name="bot_trs" id="bot_trs" value="<?=$monster['time_restart']?>" type="text"> мин.</td>
                 </tr>
                 <tr>
-                    <td>�������� ����� ����� ������:                    
+                    <td>Исчезнет после своей победы:                    
                       <select name="bot_winback" id="bot_winback">
-                        <option value="0">���</option>
-                        <option <? if( $monster['win_back'] == 1 ) { echo 'selected'; } ?> value="1">��</option>
+                        <option value="0">Нет</option>
+                        <option <? if( $monster['win_back'] == 1 ) { echo 'selected'; } ?> value="1">Да</option>
                     </select></td>
                 </tr>
                 <tr>
                   <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div></td>
                 </tr>
                 <tr>
-                    <td>����������, 
-                      �� 
+                    <td>Появляется, 
+                      ДН 
                       <select name="bot_sday" id="bot_sday">
-                        <option value="-1">&bull; ���� ������</option>
-                        <option <? if( $monster['start_day'] == 1 ) { echo 'selected'; } ?> value="1">�����������</option>
-                        <option <? if( $monster['start_day'] == 2 ) { echo 'selected'; } ?> value="2">�������</option>
-                        <option <? if( $monster['start_day'] == 3 ) { echo 'selected'; } ?> value="3">�����</option>
-                        <option <? if( $monster['start_day'] == 4 ) { echo 'selected'; } ?> value="4">�������</option>
-                        <option <? if( $monster['start_day'] == 5 ) { echo 'selected'; } ?> value="5">�������</option>
-                        <option <? if( $monster['start_day'] == 6 ) { echo 'selected'; } ?> value="6">�������</option>
-                        <option <? if( $monster['start_day'] == 7 ) { echo 'selected'; } ?> value="7">�����������</option>
+                        <option value="-1">&bull; День недели</option>
+                        <option <? if( $monster['start_day'] == 1 ) { echo 'selected'; } ?> value="1">Понедельник</option>
+                        <option <? if( $monster['start_day'] == 2 ) { echo 'selected'; } ?> value="2">Вторник</option>
+                        <option <? if( $monster['start_day'] == 3 ) { echo 'selected'; } ?> value="3">Среда</option>
+                        <option <? if( $monster['start_day'] == 4 ) { echo 'selected'; } ?> value="4">Четверг</option>
+                        <option <? if( $monster['start_day'] == 5 ) { echo 'selected'; } ?> value="5">Пятница</option>
+                        <option <? if( $monster['start_day'] == 6 ) { echo 'selected'; } ?> value="6">Суббота</option>
+                        <option <? if( $monster['start_day'] == 7 ) { echo 'selected'; } ?> value="7">Воскресенье</option>
                     </select>
-                     �
+                     Д
 					
 					 <select name="bot_sdd" id="bot_sdd">
-					   <option value="-1">&bull; ����</option>
+					   <option value="-1">&bull; День</option>
 					   <? $i = 0; while($i < 31) { $i++; ?>
 					   <option <? if( $monster['start_dd'] == $i ) { echo 'selected'; } ?> value="<?=$i?>">
 					     <?=$i?>
 				       </option>
 					   <? } ?>
 				      </select>
-                      � 
+                      М 
 					  <select name="bot_smm" id="bot_smm">
-                      <option value="-1">&bull; �����</option>
+                      <option value="-1">&bull; Месяц</option>
                         <? $i = 0; while($i < 12) { $i++; ?>
                         <option <? if( $monster['start_mm'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      � 
+                      Ч 
 					 <select name="bot_shh" id="bot_shh">
-                      <option value="-1">&bull; ���</option>
+                      <option value="-1">&bull; Час</option>
                         <? $i = -1; while($i < 23) { $i++; ?>
                         <option <? if( $monster['start_hh'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      ��� 
+                      Мин 
 					 <select name="bot_smin" id="bot_smin">
-                      <option value="-1">&bull; ���</option>
+                      <option value="-1">&bull; Мин</option>
                         <? $i = -1; while($i < 58) { $i++; ?>
                         <option <? if( $monster['start_min'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
@@ -1966,44 +1833,44 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
                   </td>
                 </tr>
                 <tr>
-                  <td>��������, &nbsp; &nbsp;�� 
+                  <td>Исчезает, &nbsp; &nbsp;ДН 
                       <select name="bot_bday" id="bot_bday">
-                        <option value="-1">&bull; ���� ������</option>
-                        <option <? if( $monster['back_day'] == 1 ) { echo 'selected'; } ?> value="1">�����������</option>
-                        <option <? if( $monster['back_day'] == 2 ) { echo 'selected'; } ?> value="2">�������</option>
-                        <option <? if( $monster['back_day'] == 3 ) { echo 'selected'; } ?> value="3">�����</option>
-                        <option <? if( $monster['back_day'] == 4 ) { echo 'selected'; } ?> value="4">�������</option>
-                        <option <? if( $monster['back_day'] == 5 ) { echo 'selected'; } ?> value="5">�������</option>
-                        <option <? if( $monster['back_day'] == 6 ) { echo 'selected'; } ?> value="6">�������</option>
-                        <option <? if( $monster['back_day'] == 7 ) { echo 'selected'; } ?> value="7">�����������</option>
+                        <option value="-1">&bull; День недели</option>
+                        <option <? if( $monster['back_day'] == 1 ) { echo 'selected'; } ?> value="1">Понедельник</option>
+                        <option <? if( $monster['back_day'] == 2 ) { echo 'selected'; } ?> value="2">Вторник</option>
+                        <option <? if( $monster['back_day'] == 3 ) { echo 'selected'; } ?> value="3">Среда</option>
+                        <option <? if( $monster['back_day'] == 4 ) { echo 'selected'; } ?> value="4">Четверг</option>
+                        <option <? if( $monster['back_day'] == 5 ) { echo 'selected'; } ?> value="5">Пятница</option>
+                        <option <? if( $monster['back_day'] == 6 ) { echo 'selected'; } ?> value="6">Суббота</option>
+                        <option <? if( $monster['back_day'] == 7 ) { echo 'selected'; } ?> value="7">Воскресенье</option>
                     </select>
-                     �
+                     Д
 					
 					 <select name="bot_bdd" id="bot_bdd">
-					   <option value="-1">&bull; ����</option>
+					   <option value="-1">&bull; День</option>
 					   <? $i = 0; while($i < 31) { $i++; ?>
 					   <option <? if( $monster['back_dd'] == $i ) { echo 'selected'; } ?> value="<?=$i?>">
 					     <?=$i?>
 				       </option>
 					   <? } ?>
 			        </select>
-                      � 
+                      М 
 					  <select name="bot_bmm" id="bot_bmm">
-                      <option value="-1">&bull; �����</option>
+                      <option value="-1">&bull; Месяц</option>
                         <? $i = 0; while($i < 12) { $i++; ?>
                         <option <? if( $monster['back_mm'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      � 
+                      Ч 
 					 <select name="bot_bhh" id="bot_bhh">
-                      <option value="-1">&bull; ���</option>
+                      <option value="-1">&bull; Час</option>
                         <? $i = -1; while($i < 23) { $i++; ?>
                         <option <? if( $monster['back_hh'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      ��� 
+                      Мин 
 					 <select name="bot_bmin" id="bot_bmin">
-                      <option value="-1">&bull; ���</option>
+                      <option value="-1">&bull; Мин</option>
                         <? $i = -1; while($i < 58) { $i++; ?>
                         <option <? if( $monster['back_min'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
@@ -2013,132 +1880,132 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
                   <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div></td>
                 </tr>
                 <tr>
-                  <td>����� ��������� (����� ���� <b>{b}</b>, ������ ������� <b>{u}</b>):</td>
+                  <td>Текст появления (Логин бота <b>{b}</b>, Логины игроков <b>{u}</b>):</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['start_text']?>" name="bot_stext" type="text" id="bot_stext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>����� ������������:</td>
+                  <td>Текст исчезновения:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['back_text']?>" name="bot_btext" type="text" id="bot_btext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>����� ������ ������:</td>
+                  <td>Текст победы игрока:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_text']?>" name="bot_wintext" type="text" id="bot_wintext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>����� ��������� ������:</td>
+                  <td>Текст поражения игрока:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_text']?>" name="bot_losetext" type="text" id="bot_losetext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>����� ������:</td>
+                  <td>Текст ничьей:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['nich_text']?>" name="bot_nichtext" type="text" id="bot_nichtext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div>                    <b>������� (������ ������):</b></td>
+                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div>                    <b>Награда (победа игрока):</b></td>
                 </tr>
                 <tr>
-                  <td>��.: </td>
+                  <td>Кр.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_money1']?>" name="bot_winmoney1" type="text" id="bot_winmoney1" size="100" maxlength="17"></td>
                 </tr>
                 <tr>
-                  <td>���.: </td>
+                  <td>Екр.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_money2']?>" name="bot_winmoney2" type="text" id="bot_winmoney2" size="100" maxlength="10"></td>
                 </tr>
                 <tr>
-                  <td>���� (�� 100% �� �������): </td>
+                  <td>Опыт (За 100% НР монстра): </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_exp']?>" name="bot_winexp" type="text" id="bot_winexp" size="100" maxlength="17"></td>
                 </tr>
                 <tr>
-                  <td>�������� (id@kolvo@data, ...):</td>
+                  <td>Предметы (id@kolvo@data, ...):</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_itm']?>" name="bot_winitm" type="text" id="bot_winitm" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>������:</td>
+                  <td>Эффект:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_eff']?>" name="bot_wineff" type="text" id="bot_wineff" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>�������:</td>
+                  <td>Подвиги:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_ico']?>" name="bot_winico" type="text" id="bot_winico" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div><b>������� (��������� ������):</b></td>
+                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div><b>Награда (поражение игрока):</b></td>
                 </tr>
                 <tr>
-                  <td>��.: </td>
+                  <td>Кр.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_money1']?>" name="bot_losemoney1" type="text" id="bot_losemoney1" size="100" maxlength="10"></td>
                 </tr>
                 <tr>
-                  <td>���.: </td>
+                  <td>Екр.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_money2']?>" name="bot_losemoney2" type="text" id="bot_losemoney2" size="100" maxlength="10"></td>
                 </tr>
                 <tr>
-                  <td>����: </td>
+                  <td>Опыт: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_exp']?>" name="bot_loseexp" type="text" id="bot_loseexp" size="100" maxlength="17"></td>
                 </tr>
                 <tr>
-                  <td>��������:</td>
+                  <td>Предметы:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_itm']?>" name="bot_loseitm" type="text" id="bot_loseitm" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>������:</td>
+                  <td>Эффект:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_eff']?>" name="bot_loseeff" type="text" id="bot_loseeff" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>�������:</td>
+                  <td>Подвиги:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_ico']?>" name="bot_loseico" type="text" id="bot_loseico" size="100" maxlength="500"></td>
                 </tr>
             </table>
             <div style="padding-left:120px;">
-            	<input type="submit" value="���������" />
+            	<input type="submit" value="Сохранить" />
             </div>
             <br><br>
             </form>
 <div style="height:1px; width:300px; background-color:#999999; margin:3px;" align="center">
-<div onClick="location.href='/info/<?=$inf['id']?>'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>������</small></div>
+<div onClick="location.href='/info/<?=$inf['id']?>'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>Скрыть</small></div>
 </div>
 <?
 					}else{
 ?>
 <div style="height:1px; width:300px; background-color:#999999; margin:3px;" align="center">
-<div onClick="location.href='/info/<?=$inf['id']?>&emonster'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>��������� �������</small></div>
+<div onClick="location.href='/info/<?=$inf['id']?>&emonster'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>Настройка монстра</small></div>
 </div>
 <?
 					}
 				}
-				//������ ������� :D
+				//темные делишки :D
 				if($inf['id'] == 1 || $inf['id'] == 15 ) {
 					
 				}elseif($inf['no_ip'] != 'trupojor' && (($u->info['align']>=1.1 && $u->info['align']<=1.99 && $inf['admin']<1) || ($u->info['align']>=3.05 && $u->info['align']<=3.99 && $inf['admin']<1) || $u->info['admin']>0 || $u->info['nadmin']>0)) 
@@ -2172,17 +2039,17 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 						}
 					}
 					
-					if( $nopal == true ) {
-						//echo '<h3>�� �� ������ ������������� ���������� �������� �� ������...</h3>';
+					if($nopal) {
+						//echo '<h3>Вы не можете просматривать информацию старшего по званию...</h3>';
 					} elseif ($u->info['admin']==0 && (($u->info['admin']==0 && (floor($u->info['align'])==1 && $inf['align']>=3.01 && $inf['align']<=3.99) || (floor($u->info['align'])==3 && $inf['align']>=1.1 && $inf['align']<=1.99)) || ($u->info['admin']==0 && $inf['admin']>0)))  
 					{
-						echo '<h3>�������� ����� ��������� ����������...</h3>';
+						echo '<h3>Персонаж носит вражескую склонность...</h3>';
 					}else{
-						echo '<br /><br /><div style="color:#828282;">�� ������� �������� ��������� ������ �������:<br /><small><span class=dsc>';
+						echo '<br /><br /><div style="color:#828282;">За игроком замечены следующие темные делишки:<br /><small><span class=dsc>';
 						if(!isset($_GET['mod_inf'])) {
-							echo '<a href="/info/'.$inf['id'].'&mod_inf">�������� ������ ����</a>';
+							echo '<a href="/info/'.$inf['id'].'&mod_inf">Показать личное дело</a>';
 						}else{
-							//������ ���� ���������
+							//Личное дело персонажа
 							$log = mysql_query('SELECT * FROM `users_delo` WHERE `uid`="'.$inf['id'].'" AND `type`="0" ORDER by `id` DESC LIMIT 21');
 							$i = 0;
 							while ($log_w = mysql_fetch_array($log))
@@ -2190,39 +2057,25 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 								echo ''.date("d.m.Y H:i:s",$log_w['time']).'&nbsp;'.$log_w['text'].' <br />';
 								$i++;
 							}
-							echo '<a href="/info/'.$inf['id'].'">������ ������ ����</a>';
+							echo '<a href="/info/'.$inf['id'].'">Скрыть личное дело</a>';
 						}
 						echo '</small><br>';
-						//���������� ��� ���������\��������\�������
+						//Информация для паладинов\тарманов\ангелов
 						if(($u->info['align']>=1.4 && $u->info['align']<=1.99 && $u->info['align']!=1.6 && $u->info['align']!=1.75 && $inf['admin']<1) || ($u->info['align']>=3.05 && $u->info['align']<=3.99 && $u->info['align']!=3.06 && $inf['admin']<1) || $u->info['admin']>0) 
 						{
 							if ((int)$u->info['align']==1) 
 							{ 
-								$rang = '���������'; 
+								$rang = 'Паладинов'; 
 							} elseif ((int)$u->info['align']==3) 
 							{
-								$rang = '��������'; 
+								$rang = 'Тарманов'; 
 							} else 
 							{ 
-								$rang = '�������'; 
+								$rang = 'Ангелов'; 
 							}					
-							
-							/*
-							$pr1 = mysql_fetch_array(mysql_query('SELECT * FROM `register_code` WHERE `reg_id` = "'.$inf['id'].'" LIMIT 1'));
-							$pr = array('login'=>'');
-							if(isset($pr1['id']))
-							{
-								$pr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level` FROM `users` WHERE `id` = "'.$pr1['uid'].'" LIMIT 1'));
-								if(isset($pr['id']))
-								{
-									$pr['login'] = '��������� ����������: <b>'.$pr['login'].'</b> ['.$pr['level'].'] <a href="/info/'.$pr['id'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" title="���. � '.$pr['login'].'"></a><br>';
-								}else{
-									$pr['login'] = '��������� ����������: #<i>'.$pr1['uid'].'</i><br>';
-								}
-							}
-							*/
+
 							if($u->info['admin'] == 1) {
-							  echo '�������: '.$inf['room'].'<br />';
+							  echo 'Комната: '.$inf['room'].'<br />';
 							}
 							if((int)$inf['host_reg'] >= 1){
 								$inf['ref'] = $u->microLogin((int)$inf['host_reg'],1);
@@ -2232,11 +2085,11 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 							if(!isset($inf['ipReg'])){ $inf['ipReg'] = '--'; }	
 							echo '
 							<br />
-							<b style="color:red"><u>������ ��� '.$rang.'</u></b><br />
-							<i>���� ��������: '.$inf['bithday'].'<br />';
+							<b style="color:red"><u>Только для '.$rang.'</u></b><br />
+							<i>День рождения: '.$inf['bithday'].'<br />';
 							
 							if($inf['vip']==1) {
-								echo '<font color=red><b>VIP ��������</font></b><br>';
+								echo '<font color=red><b>VIP персонаж</font></b><br>';
 							}
 							
 							if($u->info['admin'] > 0) {
@@ -2246,7 +2099,7 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 								  
 								  $mls = mysql_fetch_array(mysql_query('SELECT * FROM `users_rbk` WHERE `email` = "'.mysql_real_escape_string($inf['mail']).'" LIMIT 1'));
 								  if(isset($mls['name'])) {
-									 echo '<u>E-mail: '.$inf['mail'].'</u> (��������)'; 
+									 echo '<u>E-mail: '.$inf['mail'].'</u> (РАССЫЛКА)'; 
 								  }else{
 									 echo 'E-mail: '.$inf['mail'].'';
 								  }
@@ -2258,9 +2111,9 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 								  }
 							}else{
 								  if( $inf['activ'] == 0 ) {
-									 echo '<font color=green><b>�������� �����������</b></font>';  
+									 echo '<font color=green><b>Персонаж активирован</b></font>';  
 								  }else{
-									 echo '<font color=red><b>�������� �� �����������</b></font>'; 
+									 echo '<font color=red><b>Персонаж не активирован</b></font>'; 
 								  }
 								  echo '<br>';
 							}
@@ -2268,50 +2121,50 @@ if( $onj > 6 && $inf['admin'] == 0 ) {
 								$inf['ipReg'] = $inf['no_ip'];
 								$inf['ip'] = $inf['no_ip'];
 							}
-							echo '��������� ����������: '.$inf['ref'].'<br />
-							��������� ��� ������� � ����: '.date('d.m.Y H:i',$inf['online']).'<br />
-							'.$pr['login'].'IP ��� �����������: '.$inf['ipReg'].'<br />';
+							echo 'Персонажа пригласили: '.$inf['ref'].'<br />
+							Последний раз заходил в клуб: '.date('d.m.Y H:i',$inf['online']).'<br />
+							'.$pr['login'].'IP при регистрации: '.$inf['ipReg'].'<br />';
 							if($inf['no_ip'] == '' || $u->info['admin']>0) {
-								echo 'IP ���������: <b>'.$inf['ip'].'</b>';
+								echo 'IP последние: <b>'.$inf['ip'].'</b>';
 								$auth = mysql_query('SELECT * FROM `logs_auth` WHERE `uid`="'.$inf['id'].'" AND `type`="1" ORDER by `id` DESC LIMIT 10');
 								$country = '';
 								while ($auth_w = mysql_fetch_array($auth)) {
 									echo '<br />'.$auth_w['ip'].' <small><b>('.date('d.m.Y H:i',$auth_w['time']).')</b></small>';
 								}
 							}else{
-								echo 'IP ���������: <b>'.$inf['no_ip'].'</b>';
+								echo 'IP последние: <b>'.$inf['no_ip'].'</b>';
 							}
 							
 							
 function user_browser($agent) {
-	preg_match("/(MSIE|Opera|Firefox|Chrome|Version|Opera Mini|Netscape|Konqueror|SeaMonkey|Camino|Minefield|Iceweasel|K-Meleon|Maxthon)(?:\/| )([0-9.]+)/", $agent, $browser_info); // ���������� ���������, ������� ��������� ����������� 90% ���������
-        list(,$browser,$version) = $browser_info; // �������� ������ �� ������� � ����������
-        if (preg_match("/Opera ([0-9.]+)/i", $agent, $opera)) return 'Opera '.$opera[1]; // ����������� _�����_������_ ������ ����� (�� 8.50), ��� ������� ����� ������
-        if ($browser == 'MSIE') { // ���� ������� �������� ��� IE
-                preg_match("/(Maxthon|Avant Browser|MyIE2)/i", $agent, $ie); // ���������, �� ���������� �� ��� �� ������ IE
-                if ($ie) return $ie[1].' based on IE '.$version; // ���� ��, �� ���������� ��������� �� ����
-                return 'IE '.$version; // ����� ������ ���������� IE � ����� ������
+	preg_match("/(MSIE|Opera|Firefox|Chrome|Version|Opera Mini|Netscape|Konqueror|SeaMonkey|Camino|Minefield|Iceweasel|K-Meleon|Maxthon)(?:\/| )([0-9.]+)/", $agent, $browser_info); // регулярное выражение, которое позволяет отпределить 90% браузеров
+        list(,$browser,$version) = $browser_info; // получаем данные из массива в переменную
+        if (preg_match("/Opera ([0-9.]+)/i", $agent, $opera)) return 'Opera '.$opera[1]; // определение _очень_старых_ версий Оперы (до 8.50), при желании можно убрать
+        if ($browser == 'MSIE') { // если браузер определён как IE
+                preg_match("/(Maxthon|Avant Browser|MyIE2)/i", $agent, $ie); // проверяем, не разработка ли это на основе IE
+                if ($ie) return $ie[1].' based on IE '.$version; // если да, то возвращаем сообщение об этом
+                return 'IE '.$version; // иначе просто возвращаем IE и номер версии
         }
-        if ($browser == 'Firefox') { // ���� ������� �������� ��� Firefox
-                preg_match("/(Flock|Navigator|Epiphany)\/([0-9.]+)/", $agent, $ff); // ���������, �� ���������� �� ��� �� ������ Firefox
-                if ($ff) return $ff[1].' '.$ff[2]; // ���� ��, �� ������� ����� � ������
+        if ($browser == 'Firefox') { // если браузер определён как Firefox
+                preg_match("/(Flock|Navigator|Epiphany)\/([0-9.]+)/", $agent, $ff); // проверяем, не разработка ли это на основе Firefox
+                if ($ff) return $ff[1].' '.$ff[2]; // если да, то выводим номер и версию
         }
-        if ($browser == 'Opera' && $version == '9.80') return 'Opera '.substr($agent,-5); // ���� ������� �������� ��� Opera 9.80, ���� ������ ����� �� ����� ������
-        if ($browser == 'Version') return 'Safari '.$version; // ���������� ������
-        if (!$browser && strpos($agent, 'Gecko')) return 'Browser based on Gecko'; // ��� ������������ ��������� ���������, ���� ��� �� ������ Gecko, � ��������� ��������� �� ����
-        return $browser.' '.$version; // ��� ���� ��������� ���������� ������� � ������
+        if ($browser == 'Opera' && $version == '9.80') return 'Opera '.substr($agent,-5); // если браузер определён как Opera 9.80, берём версию Оперы из конца строки
+        if ($browser == 'Version') return 'Safari '.$version; // определяем Сафари
+        if (!$browser && strpos($agent, 'Gecko')) return 'Browser based on Gecko'; // для неопознанных браузеров проверяем, если они на движке Gecko, и возращаем сообщение об этом
+        return $browser.' '.$version; // для всех остальных возвращаем браузер и версию
 }
 							
 							
 							echo'
 							<br />
-							�������: <b style="color:#0E0F0E">'.user_browser($inf['dateEnter']).'</b><br />
+							Браузер: <b style="color:#0E0F0E">'.user_browser($inf['dateEnter']).'</b><br />
 							';
 														
 							if($inf['no_ip'] == '' || $u->info['admin']>0) {
 								if($mults!='' && $inf['admin']==0){
 									$mults = trim($mults,', ');
-									echo '������ ���� ����� �����:  '.$mults.'<br />';
+									echo 'Другие ники этого бойца:  '.$mults.'<br />';
 								}
 							}
 							
@@ -2320,29 +2173,29 @@ function user_browser($agent) {
 							
 							$sp = mysql_query('SELECT `id`,`login`,`ip`,`ipreg`,`timereg`,`online` FROM `users` WHERE `host_reg` = "'.$inf['id'].'" AND `activ` = "0" ORDER BY `timereg` DESC');
 							while( $pl = mysql_fetch_array($sp) ) {
-								$referalos .= '<br>���� ���.: '.date('d.m.Y H:i',$pl['timereg']).' / ��� ���: '.date('d.m.Y H:i',$pl['online']).' &nbsp; '.$u->microLogin($pl['id'],1).' <small>( '.$pl['ip'].' , '.$pl['ipreg'].' )</small>';
+								$referalos .= '<br>Дата рег.: '.date('d.m.Y H:i',$pl['timereg']).' / Был тут: '.date('d.m.Y H:i',$pl['online']).' &nbsp; '.$u->microLogin($pl['id'],1).' <small>( '.$pl['ip'].' , '.$pl['ipreg'].' )</small>';
 								$rfs++;
 							}
 							
 							if( $referalos == '' ) {
-								$referalos = '<i>�����������</i>';
+								$referalos = '<i>Отсутствуют</i>';
 							}
-							echo '<hr><b>�������� �����:</b>'.$referalos.'<hr>';
+							echo '<hr><b>Рефералы бойца:</b>'.$referalos.'<hr>';
 							if($u->info['admin']>0)
 							{
-								echo '���. �����������: <small><a href="/info/'.$inf['id'].'&wipe&sd4='.$u->info['nextAct'].'">�������� ��������������</a></small><br>';
+								echo 'Доп. возможности: <small><a href="/info/'.$inf['id'].'&wipe&sd4='.$u->info['nextAct'].'">сбросить характеристики</a></small><br>';
 								$on1 = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$inf['id'].'" LIMIT 1'));
-								echo '����� � ������� (�����): '.timeOut($on1['time_all']).'<br>����� � ������� (�������): '.timeOut($on1['time_today']).'<br>';
+								echo 'Время в онлайне (всего): '.timeOut($on1['time_all']).'<br>Время в онлайне (сегодня): '.timeOut($on1['time_today']).'<br>';
 							}	
 							if($inf['molch3']<time() && $inf['molch1'] > time())
 							{
-								echo '<small><a href="/info/'.$inf['id'].'&molchMax&sd4='.$u->info['nextAct'].'">��������� ��������� ���������� ��������� � ���������</a></small><br>';
+								echo '<small><a href="/info/'.$inf['id'].'&molchMax&sd4='.$u->info['nextAct'].'">Запретить персонажу отправлять сообщения с молчанкой</a></small><br>';
 							}
 							
 							echo'	
-							����: '.$inf['exp'].' <br />
-							����� ���������������� UP-��: '.$inf['ability'].' <br />
-							<b>��������:</b> '.$inf['money'].'<br><b>������������:</b> '.$inf['money2'].'<br><b>�����:</b> <small>'.$u->zuby($inf['money4']).'</small>';
+							Опыт: '.$inf['exp'].' <br />
+							Число неиспользованных UP-ов: '.$inf['ability'].' <br />
+							<b>Кредитов:</b> '.$inf['money'].'<br><b>ЕвроКредитов:</b> '.$inf['money2'].'<br><b>Зубов:</b> <small>'.$u->zuby($inf['money4']).'</small>';
 							$bnk = ''; $bmn1 = 0; $bmn2 = 0;
 							$sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$inf['id'].'"');
 							while($pl = mysql_fetch_array($sp)) {
@@ -2351,31 +2204,31 @@ function user_browser($agent) {
 								}else{
 									$bnk .= '<div style="padding:5px;border-bottom:1px solid #AEAEAE">';
 								}
-								$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>�</small> '.$pl['id'].'</span>';
-								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money1'].' ��.</small></span>';
-								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money2'].' ���.</small></span>';
+								$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>№</small> '.$pl['id'].'</span>';
+								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money1'].' кр.</small></span>';
+								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money2'].' екр.</small></span>';
 								if($u->info['admin'] > 0) {
-									$bnk .= '<span style="display:inline-block;"><small>������: '.htmlspecialchars($pl['pass'],NULL,'cp1251').'</small></span>';
+									$bnk .= '<span style="display:inline-block;"><small>Пароль: '.htmlspecialchars($pl['pass'],NULL,'cp1251').'</small></span>';
 								}
 								if($pl['moneyBuy'] > 0) {
-								  $ds = '<b><i><u>�������� ������� �����������</u></i></b>&nbsp;&nbsp;����� : '.$pl['moneyBuy'].'<br />';
+								  $ds = '<b><i><u>Персонаж покупал еврокредиты</u></i></b>&nbsp;&nbsp;Сумма : '.$pl['moneyBuy'].'<br />';
 								}
 								$bmn1 += $pl['money1'];
 								$bmn2 += $pl['money2'];
 								$bnk .= '</div>';
 							}
 							$pk = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$inf['id'].'" AND `good` > 0 LIMIT 1'));
-							echo '<br><b><i><u>�������� ������� �����������</u></i></b>&nbsp;&nbsp;����� : '.$pk[0].' ���<br />';
+							echo '<br><b><i><u>Персонаж покупал еврокредиты</u></i></b>&nbsp;&nbsp;Сумма : '.$pk[0].' ЕКР<br />';
 							if($bnk != '') {
-								echo '<br><b>���������� �����:</b>'.$bnk.' &nbsp; <small><b>������ (����� � �����):</b> &nbsp; '.$bmn1.' ��. &nbsp; &nbsp; '.$bmn2.' ���.</small><br/>'.$ds;
+								echo '<br><b>Банковские счета:</b>'.$bnk.' &nbsp; <small><b>Деньги (Всего в банке):</b> &nbsp; '.$bmn1.' кр. &nbsp; &nbsp; '.$bmn2.' екр.</small><br/>'.$ds;
 							}
 							if($u->info['admin']>0 && $inf['admin']>0) {
 								echo '<br><small>admin: '.$inf['admin'].'</small>';
 							}
 							if($inf['active']!=''){
-							echo '<br><font color=red>��������!���� �������� �� �������� ������ � ���������� �������� ��� ������ �������.</red>';
+							echo '<br><font color=red>Внимание!Если персонаж не получает письма с активацией отправте ему письмо вручную.</red>';
 							echo '<br><input type=text value="'.$inf['mail'].'">';
-							echo "<br><textarea cols=60 rows=5>������������! �� ����� ���� ������ ��������� � ����� ����! \r\n ��� ��������: ".$inf['login']."  \r\n ������ ��� ���������: https://capitalcity.new-combats.com/bk?active=".$inf['active'].".\r\n\r\n� ���������, �������������!</textarea><br>";
+							echo "<br><textarea cols=60 rows=5>Здравствуйте! Мы очень рады новому персонажу в нашем Мире! \r\n Ваш персонаж: ".$inf['login']."  \r\n Ссылка для активации: https://capitalcity.new-combats.com/bk?active=".$inf['active'].".\r\n\r\nС уважением, Администрация!</textarea><br>";
 							}
 							echo '</div>';
 						}
@@ -2386,7 +2239,7 @@ function user_browser($agent) {
         <div style="float:right">
         <table cellspacing=0 cellpadding=0>
           <tr>
-            <td width="111" style='text-align: center; padding-bottom: 18; '><!-- ������ -->
+            <td width="111" style='text-align: center; padding-bottom: 18; '><!-- Зодиак -->
                   <img width="100" height="99" title="<? echo $name_zodiak; ?>" style="margin-bottom: 25; padding:5px;" src='https://img.new-combats.com/i/zodiac/<? echo $id_zodiak; ?>.gif' border=0><BR>
                   <BR>
               	  
@@ -2394,16 +2247,16 @@ function user_browser($agent) {
                     
                     <? }elseif($inf['align']>1 && $inf['align']<2) { ?>
                   <A href='https://paladins.<? echo $c['host']; ?>/' target='_blank'><img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_light.gif' border=0></A><BR>
-                  <A href='https://paladins.<? echo $c['host']; ?>/' target='_blank'><small>����� �����</small></A>
+                  <A href='https://paladins.<? echo $c['host']; ?>/' target='_blank'><small>Орден Света</small></A>
                     <? }elseif($inf['align']>=3.01 && $inf['align']<=3.99) { ?>
                   <A target='_blank' href='https://tarmans.<? echo $c['host']; ?>/'><img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_dark.gif' border=0></A><BR>
-                  <A href='https://tarmans.<? echo $c['host']; ?>/' target='_blank'><small>������</small></A>
+                  <A href='https://tarmans.<? echo $c['host']; ?>/' target='_blank'><small>Армада</small></A>
                     <? }elseif($inf['align']>=2 && $inf['align']<3) { ?>
                   <A target='_blank' href='https://chaos.<? echo $c['host']; ?>/'><img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_haos.gif' border=0></A><BR>
-                  <A href='https://chaos.<? echo $c['host']; ?>/' target='_blank'><small>�������� �����</small></A>
+                  <A href='https://chaos.<? echo $c['host']; ?>/' target='_blank'><small>Цитадель Хаоса</small></A>
                     <? }else{ ?>
                   <A target='_blank' href='https://new-combats.com/news/'> <img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_gray.gif'></a><BR>
-                  <A href='https://new-combats.com/news/' target='_blank'><small>�������</small></A><br>
+                  <A href='https://new-combats.com/news/' target='_blank'><small>Новости</small></A><br>
                     <? } ?>
             </td>
           </tr>
@@ -2423,13 +2276,13 @@ if( $u->info['align'] > 3 && $u->info['align'] < 4 ) {
 if($inf['level'] < 8 && $inf['admin'] == 0 && $u->info['admin'] == 0 && $moder == 0) {
 ?>
 <hr>
-<H3 align="center" style="color:#8f0000">��������� �� ���������� 8 ������</H3>
+<H3 align="center" style="color:#8f0000">Обезличен до достижения 8 уровня</H3>
 <?
 $inf['info_delete'] = time()+86400;
 }elseif($inf['info_delete']!=0)
 {
 ?>
-<H3 align="center" style="color:#8f0000">�������� ��������� <? if($inf['info_delete']>1){ echo '�� '.date('d.m.Y H:i',$inf['info_delete']).'.'; }else{ echo '.'; } ?></H3>
+<H3 align="center" style="color:#8f0000">Персонаж обезличен <? if($inf['info_delete']>1){ echo 'до '.date('d.m.Y H:i',$inf['info_delete']).'.'; }else{ echo '.'; } ?></H3>
 <?
 	if($u->info['align']>1 && $u->info['align']<2 || $u->info['align']>3 && $u->info['align']<4 || $u->info['admin']>0)
 	{
@@ -2441,25 +2294,25 @@ if($inf['info_delete']==0 || (($u->info['align']>1 && $u->info['align']<2) || ($
 ?> 
 <div style="line-height:11pt;"> 
 <hr style="border-color:#999999;">
-<? if($inf['info_delete']==0){ ?><H3 align="center" style="color:#8f0000">�������� ������</H3><? } ?>
+<? if($inf['info_delete']==0){ ?><H3 align="center" style="color:#8f0000">Анкетные данные</H3><? } ?>
 <?
 if($inf['name'] != '') {
 ?>
-<b style="color:#444">���:</b> <? echo $inf['name']; ?><BR><? } ?>
-<b style="color:#444">���:</b>
-<? $sex[0] = '�������'; $sex[1] = '�������'; echo $sex[$inf['sex']]; ?><BR>
+<b style="color:#444">Имя:</b> <? echo $inf['name']; ?><BR><? } ?>
+<b style="color:#444">Пол:</b>
+<? $sex[0] = 'Мужской'; $sex[1] = 'Женский'; echo $sex[$inf['sex']]; ?><BR>
 <? if($inf['city_real']!=''){ ?>
-<b style="color:#444">�����:</b> <? echo $inf['city_real']; ?><BR><? } ?>
+<b style="color:#444">Город:</b> <? echo $inf['city_real']; ?><BR><? } ?>
 <? if($inf['icq']>0 && $inf['icq_hide']==0){ echo '<b>ICQ:</b> '.$inf['icq'].'<br>'; } ?>
 <? if($inf['skype']!='' && $inf['skype_hide']==0){ echo '<b>Skype:</b> '.$inf['skype'].'<br>'; } ?>
 <? if(isset($inf['homepage']) && $inf['homepage']!='' && $inf['level']>4) { 
 $url = ((substr($inf['homepage'],0,4)=='https'?"":"https://").$inf['homepage']);
 ?>
-<b style="color:#444">�������� ��������:</b> <A HREF="<? echo $url; ?>" target="_blank"><? echo $url; ?></A><BR> <? } ?>
+<b style="color:#444">Домашняя страница:</b> <A HREF="<? echo $url; ?>" target="_blank"><? echo $url; ?></A><BR> <? } ?>
 <? if($inf['deviz']!=''){ ?>
-<b style="color:#444">�����:</b> <code><? echo $inf['deviz']; ?></code><BR>  <? } ?>
+<b style="color:#444">Девиз:</b> <code><? echo $inf['deviz']; ?></code><BR>  <? } ?>
 <? if($inf['hobby']!=''){ ?>  
-<b style="color:#444">��������� / �����:</b><BR>
+<b style="color:#444">Увлечения / хобби:</b><BR>
 <? 
 		echo str_replace("\n",'<br>',$inf['hobby']); 
 	}
@@ -2472,7 +2325,7 @@ echo '<br><br><div align="right">'.$c['counters_noFrm'].'</div>';
 ?>
 </div>
 <div align="right"><br>
-<!-- ����� &copy; <?=date('Y')?>, �www.new-combats.com� &nbsp; &nbsp; --></div>
+<!-- ЛегБК &copy; <?=date('Y')?>, «www.new-combats.com» &nbsp; &nbsp; --></div>
 <br /><br />
 </body>
 </html>
diff --git a/modules_data/__user.php b/modules_data/__user.php
deleted file mode 100644
index 94a22c11..00000000
--- a/modules_data/__user.php
+++ /dev/null
@@ -1,12567 +0,0 @@
-<?php
-if(!defined('GAME')) { die(); }
-
-//system('pkill www-data');
-
-function getdr($s, $v, $d) {
-  global $u;
-  $i = 0;
-  while($i < count($v))	{
-	if(isset($v[$i])) {
-	  $s = str_replace('{'.$v[$i].'}',$d[$i],$s);
-	}
-	$i++;
-  }
-  $s = eval("return (".$s.");");
-  return floor($s);
-}
-
-class user {
-	private static $flag_one;
-	public $pokol = 2; //����������� ��������� ���������
-	public $ekrcast = array(
-		310 => true, //�������� ������� ��������
-		
-		33	=> true, //�������� �������
-		34	=> true, //�������� �������
-		35	=> true, //�������� ������
-		
-		42	=> true, //������������ ������	
-		43	=> true, //������������ �������
-		
-		296	=> true
-		
-	);
-	public $aves = array('now'=>0,'max'=>0),$rep,$tfer,$error2 = '', $room = array(), $bank = array(), $align_nm = array(
-		1	=>	'����',
-		2	=>	'����',
-		3	=>	'����',
-		7	=>	'�����������'
-	), $mod_nm = array(
-						0=>array(0=>''),
-						1=>array('1'=>'����','1.1'=>'������� ����������','1.4'=>'���������� �������','1.5'=>'������� ��������� ������','1.6'=>'����������','1.7'=>'������� �������� ����','1.75'=>'�������-���������','1.9'=>'������� ����','1.91'=>'������� ������� ����','1.92'=>'������� ������','1.99'=>'��������� �������'),
-						3=>array('3'=>'����','3.01'=>'������-���������','3.05'=>'������-�����������','3.06'=>'��������','3.07'=>'������-������','3.075'=>'������-���������','3.09'=>'������-�����','3.091'=>'������-�������','3.092'=>'������� ������','3.99'=>'������ ��������')
-						);
-	public $btl_txt = '',$rgd = array(0=>0,1=>0),$error = '',
-	
-	$city_unid = array(0,'capitalcity','angelscity','abandonedplain','newcapitalcity','demonscity','fallenearth','emeraldscity','dreamscity','suncity'),
-	$city_id = array('capitalcity'=>1,'angelscity'=>2,'abandonedplain'=>3,'newcapitalcity'=>4,'demonscity'=>5,'fallenearth'=>6,'emeraldscity'=>6,'suncity'=>7,'dreamscity'=>8),
-	$city_name = array('emeraldscity' => 'Emeralds city','abandonedplain'=>'Abandoned Plain','capitalcity'=>'Capital city','angelscity'=>'Angels city','newcapitalcity'=>'New Capital city','demonscity'=>'Demons city','fallenearth'=>'Fallen Earth','dreamscity'=>'Dreams City','suncity'=>'Sun City'),
-	$city_name2 = array('emeraldscity' => 'Emeraldscity', 'abandonedplain'=>'Abandonedplain','capitalcity'=>'Capitalcity','angelscity'=>'Angelscity','newcapitalcity'=>'Newcapitalcity','demonscity'=>'Demonscity','fallenearth'=>'FallenEarth','dreamscity'=>'Dreams City','suncity'=>'Sun City'),
-	
-	$stats,$info,$map,$mapUsers,$is = array(
-	'acestar' => '��������� ���� ����� �����������', 'spasenie' => '�������� ����� ������','more_awards' => '��������� ������� %', 'exp' => '���������� ���� (%)', 'align_bs' => '��������� ������',
-	'nopryh' => '������ ���������', 'puti'=>'������ �����������','align'=>'����������','hpAll'=>'<font color=darkgreen><b>������� ����� (HP)</font></b>','mpAll'=>'<font color=blue><b>������� ����</font></b>','enAll'=>'������� �������','sex'=>'���','lvl'=>'�������','s1'=>'����','s2'=>'��������','s3'=>'��������','s4'=>'������������','s5'=>'���������','s6'=>'��������','s7'=>'����������','s8'=>'����','s9'=>'������� ����','s10'=>'��������������','s11'=>'�������','m1'=>'��. ������������ ����� (%)','m2'=>'��. ������ ������������ ����� (%)','m3'=>'��. �������� ����. ����� (%)','m4'=>'��. ����������� (%)','m5'=>'��. ������ ����������� (%)','m6'=>'��. ���������� (%)','m7'=>'��. ����������� (%)','m8'=>'��. ����� ����� (%)','m9'=>'��. ����� ������ ����� (%)','m14'=>'��. ���. ������������ ����� (%)','m15'=>'��. ���. ����������� (%)','m16'=>'��. ���. ����������� (%)','m17'=>'��. ���. ���������� (%)','m18'=>'��. ���. ����� ����� (%)','m19'=>'��. ���. ���������� ������ (%)','m20'=>'��. ����� (%)','a1'=>'���������� �������� ������, ���������','a2'=>'���������� �������� ��������, ��������','a3'=>'���������� �������� ��������, ��������','a4'=>'���������� �������� ������','a5'=>'���������� �������� ����������� ��������','a6'=>'���������� �������� ������','a7'=>'���������� �������� ����������','aall'=>'���������� �������� �������','mall'=>'���������� �������� ������ ������','m2all'=>'���������� �������� ������','mg1'=>'���������� �������� ������ ����','mg2'=>'���������� �������� ������ �������','mg3'=>'���������� �������� ������ ����','mg4'=>'���������� �������� ������ �����','mg5'=>'���������� �������� ������ �����','mg6'=>'���������� �������� ������ ����','mg7'=>'���������� �������� ����� ������','tj'=>'������� �����','lh'=>'������ �����','minAtack'=>'����������� ����','maxAtack'=>'������������ ����','m10'=>'��. �������� �����','m11'=>'��. �������� ����� ������','m11a'=>'��. �������� �����','pa1'=>'��. �������� �������� �����','pa2'=>'��. �������� �������� �����','pa3'=>'��. �������� �������� �����','pa4'=>'��. �������� ������� �����','pm1'=>'��. �������� ����� ����','pm2'=>'��. �������� ����� �������','pm3'=>'��. �������� ����� ����','pm4'=>'��. �������� ����� �����','pm5'=>'��. �������� ����� �����','pm6'=>'��. �������� ����� ����','pm7'=>'��. �������� ����� �����','za'=>'������ �� �����','zm'=>'������ �� ����� ������','zma'=>'������ �� �����','za1'=>'������ �� �������� �����','za2'=>'������ �� �������� �����','za3'=>'������ �� ��������� �����','za4'=>'������ �� �������� �����','zm1'=>'������ �� ����� ����','zm2'=>'������ �� ����� �������','zm3'=>'������ �� ����� ����','zm4'=>'������ �� ����� �����','zm5'=>'������ �� ����� �����','zm6'=>'������ �� ����� ����','zm7'=>'������ �� ����� �����','magic_cast'=>'�������������� ���� �� ���','pza'=>'��������� ������ �� �����','pzm'=>'��������� ������ �� �����','pza1'=>'��������� ������ �� �������� �����','min_heal_proc'=>'������ ������� (%)','notravma'=>'������ �� �����','yron_min'=>'����������� ����','yron_max'=>'������������ ����','zaproc'=>'������ �� ����� (%)','zmproc'=>'������ �� ����� ������ (%)','zm2proc'=>'������ �� ����� ������� (%)','pza2'=>'��������� ������ �� �������� �����','pza3'=>'��������� ������ �� ��������� �����','pza4'=>'��������� ������ �� �������� �����','pzm1'=>'��������� ������ �� ����� ����','pzm2'=>'��������� ������ �� ����� �������','pzm3'=>'��������� ������ �� ����� ����','pzm4'=>'��������� ������ �� ����� �����','pzm5'=>'��������� ������ �� ����� �����','pzm6'=>'��������� ������ �� ����� ����','pzm7'=>'��������� ������ �� ����� �����','speedhp'=>'����������� �������� (%)','speedmp'=>'����������� ���� (%)','tya1'=>'������� �����','tya2'=>'������� �����','tya3'=>'�������� �����','tya4'=>'������� �����','tym1'=>'�������� �����','mg2static_points'=>'������� ������ (������)','tym2'=>'������������� �����','tym3'=>'������� �����','tym4'=>'�������� �����','hpProc'=>'������� ����� (%)','mpProc'=>'������� ���� (%)','tym5'=>'����� �����','tym6'=>'����� ����','tym7'=>'����� �����','min_use_mp'=>'��������� ������ ����','pog'=>'���������� �����','pog2'=>'���������� �����','pog2p'=>'������� ���������� �����','pog2mp'=>'���� ���������� �����','maxves'=>'����������� ������','bonusexp'=>'����������� ���������� ����','speeden'=>'����������� ������� (%)',
-	'antm3' => '��. ������ �������� �����','repair_z' => '���������� ���������� �������','repair_r' => '���������� ���������� ���',
-'yza' => '���������� ����������� ����� (%)','yzm' => '���������� ����� ������ (%)','yzma' => '���������� ����� (%)'
-,'yza1' => '���������� �������� ����� (%)','yza2' => '���������� �������� ����� (%)','yza3' => '���������� ��������� ����� (%)','yza4' => '���������� �������� ����� (%)'
-,'yzm1' => '���������� ����� ���� (%)','yzm2' => '���������� ����� ������� (%)','yzm3' => '���������� ����� ���� (%)','yzm4' => '���������� ����� ����� (%)','yzm5' => '���������� ����� (%)','yzm6' => '���������� ����� (%)','yzm7' => '���������� ����� (%)','rep'=> '��������� ������'
-,'repair_discount' => '������ �� ������ �����','hpVinos' => '����� �����','bronze' => 'Bronze Premium Account','silvers' => 'Silver Premium Account','gold' => 'Gold Premium Account','speed_dungeon' => '�������� ������������ �� �����������'
-);
-	public $items = array(
-					'tr'  => array('sex','align','lvl','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','a1','a2','a3','a4','a5','a6','a7','mg1','mg2','mg3','mg4','mg5','mg6','mg7','mall','m2all','aall','rep', 'align_bs'),
-					'add' => array(
-					'no_vor','antm3','acestar','spasenie','exp','enemy_am1','hod_minmana','yhod','noshock_voda','bronze','silvers','gold','repair_discount',
-					'yza','yzm','yzma','yza1','yza2','yza3','yza4','yzm1','yzm2','yzm3','yzm4','yzm5','yzm6','yzm7','repair_z','repair_r',
-					'notuse_last_pr','yrn_mg_first','antishock','nopryh','speed_dungeon','naemnik','mg2static_points','yrnhealmpprocmg3','nousepriem','notactic','seeAllEff','100proboi1','pog2','pog2p','magic_cast','min_heal_proc','no_yv1','no_krit1','no_krit2','no_contr1','no_contr2','no_bl1','no_pr1','no_yv2','no_bl2','no_pr2','silver','pza','pza1','pza2','pza3','pza4','pzm','pzm1','pzm2','pzm3','pzm4','pzm5','pzm6','pzm7','yron_min','yron_max','notravma','min_zonb','min_zona','nokrit','pog','min_use_mp','za1proc','za2proc','za3proc','za4proc','zaproc','zmproc','zm1proc','zm2proc','zm3proc','zm4proc','shopSale','shopSaleEkr','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','hpVinos','mpVinos','mpAll','enAll','hpProc','mpProc','m1','m2','m3','m4','m5','m6','m7','m8','m9','m14','m15','m16','m17','m18','m19','m20','pa1','pa2','pa3','pa4','pm1','pm2','pm3','pm4','pm5','pm6','pm7','za','za1','za2','za3','za4','zma','zm','zm1','zm2','zm3','zm4','zm5','zm6','zm7','mib1','mab1','mib2','mab2','mib3','mab3','mib4','mab4','speedhp','speedmp','m10','m11','m11a','zona','zonb','maxves','minAtack','maxAtack','bonusexp','speeden'),
-					'sv' => array('pza','pza1','pza2','pza3','pza4','pzm','pzm1','pzm2','pzm3','pzm4','pzm5','pzm6','pzm7','notravma','min_zonb','min_zona','nokrit','pog','min_use_mp','za1proc','za2proc','za3proc','za4proc','zaproc','zmproc','zm1proc','zm2proc','zm3proc','zm4proc','shopSale','shopSaleEkr','s1','s2','s3','s4','s5','s6','s7','s8','s9','s10','s11','aall','a1','a2','a3','a4','a5','a6','a7','m2all','mall','mg1','mg2','mg3','mg4','mg5','mg6','mg7','hpAll','mpAll','enAll','m1','m2','m3','m4','m5','m6','m7','m8','m9','m14','m15','m16','m17','m18','m19','m20','pa1','pa2','pa3','pa4','pm1','pm2','pm3','pm4','pm5','pm6','pm7','min_use_mp','za','za1','za2','za3','za4','zma','zm','zm1','zm2','zm3','zm4','zm5','zm6','zm7','mib1','mab1','mib2','mab2','mib3','mab3','mib4','mab4','speedhp','speedmp','m10','m11','zona','zonb','maxves','minAtack','maxAtack','speeden')
-					);
-					
-					/*
-						yrnhealmpprocmg3 - ���������������� ���� �� ����� �� ������, � % (����� ����)
-					*/
-
-	public function sys_add($uid,$time,$type,$text,$data,$time_see) {
-		/*if(mysql_query('INSERT INTO `a_system` (`uid`,`time`,`type`,`text`,`data`,`time_see`) VALUES ("'.$uid.'","'.$time.'","'.$type.'","'.$text.'","'.$data.'","'.$time_see.'")')){
-			
-		}else{
-			echo '.';
-		}
-		*/
-	}
-	
-	public function pensia($type) {
-		if( $type == false ) {
-			if( ( $this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] >8) && $this->info['align'] != 2 ) {
-				$r = ($this->info['level']-6) * 0.04;
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = $r.' ���.';
-			}else{
-				$r = $this->info['level'];
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = $r .' ��.';
-			}
-		}else{
-			if( ($this->info['align'] > 0 || $this->info['clan'] > 0 || $this->info['level'] >8) && $this->info['align'] != 2 ) {
-				$r = ($this->info['level']-6) * 0.04;
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = array(2,$r);
-			}else{
-				$r = $this->info['level'];
-				if( date('m') >= 6 || date('m') <= 8 ) {
-					$r = round($r * 2,2);
-				}elseif( date('w') == 0 || date('w') == 6 ) {
-					$r = round($r * 2,2);
-				}
-				$r = array(1,$r);
-			}
-		}
-		return $r;
-	}
-	
-	public function testAlign( $an , $uid ) {
-		$r = 1;
-		if( floor($an) > 0 ) {
-			$a = mysql_fetch_array(mysql_query('SELECT * FROM `users_align` WHERE `uid` = "'.$uid.'" AND (`delete` = "0" OR `delete` > "'.time().'") LIMIT 1'));
-			if(isset($a['id'])) {
-				if( floor($a['align']) > 0 ) {
-					if( floor($a['align']) != $an ) {
-						$r = 0;
-					}
-				}
-			}
-		}
-		return $r;
-	}
-	
-	public function abilsRoom($type) {
-		$r = '';
-		//
-		if( $this->info['clan'] > 0 ) {
-			//������ ������������ ���������� � �����
-		}elseif( $type == 'test' ) {
-			if( $this->room['name'] == '��� �����' || $this->room['name'] == '��� ���������' || $this->room['name'] == '��� ����' ) {
-				if(isset($_GET['vhp'])) {
-					$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 1 ORDER BY `time` DESC LIMIT 1'));
-					if( isset($v['id']) && $v['time'] > time() - 60 * 60 ) {
-						//��� �����
-						$this->error = '���������� ��������� ��� '.$this->timeOut( $v['time'] + 60 * 60 - time() );
-					}else{
-						if( $this->stats['hpNow'] < 1 ) { $this->stats['hpNow'] = 0; }
-						$this->error = '�� ������� ������������ '.round($this->stats['hpAll'] - $this->stats['hpNow']).' HP.';
-						mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES (
-							"'.$this->info['id'].'","'.time().'","'.$this->info['room'].'","'.round($this->stats['hpAll'] - $this->stats['hpNow']).'","1"
-						)');
-						$this->stats['hpNow'] = $this->stats['hpAll'];
-						mysql_query('UPDATE `stats` SET `hpNow` = "'.$this->stats['hpNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-				}elseif(isset($_GET['vmp'])) {
-					$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 2 ORDER BY `time` DESC LIMIT 1'));
-					if( isset($v['id']) && $v['time'] > time() - 60 * 60 ) {
-						//��� �����
-						$this->error = '���������� ��������� ��� '.$this->timeOut( $v['time'] + 60 * 60 - time() );
-					}else{
-						if( $this->stats['mpNow'] < 1 ) { $this->stats['mpNow'] = 0; }
-						$this->error = '�� ������� ������������ '.round($this->stats['mpAll'] - $this->stats['mpNow']).' MP.';
-						mysql_query('INSERT INTO `vortex` ( `uid`,`time`,`room`,`val`,`type` ) VALUES (
-							"'.$this->info['id'].'","'.time().'","'.$this->info['room'].'","'.round($this->stats['mpAll'] - $this->stats['mpNow']).'","2"
-						)');
-						$this->stats['hpNow'] = $this->stats['hpAll'];
-						mysql_query('UPDATE `stats` SET `mpNow` = "'.$this->stats['mpNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-				}
-			}
-		}elseif( $type == 'look' ) {
-			//
-			if( $this->room['name'] == '��� �����' || $this->room['name'] == '��� ����' || $this->room['name'] == '��� ���������' ) {
-				$vid = 0;
-				//
-				if( $this->room['name'] == '��� �����' ) {
-					$vid = 6;
-				}elseif( $this->room['name'] == '��� ����' ) {
-					$vid = 7;
-				}elseif( $this->room['name'] == '��� ���������' ) {
-					$vid = 10;
-				}
-				//
-				$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 1 ORDER BY `time` DESC LIMIT 1'));
-				if(isset($v['id']) && $v['time'] + 60 * 60 > time() ) {
-					$r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'�������� ��������������� ����� '.$this->timeOut( $v['time'] + 60 * 60 - time() ).'\');" src="https://img.new-combats.com/i/items/healvortex_'.$vid.'.png" width="40" height="25" title="������ HP (��������)"> ';	
-				}else{
-					$r .= '<a href="main.php?vhp"><img src="https://img.new-combats.com/i/items/healvortex_'.$vid.'.png" width="40" height="25" title="������ HP"></a> ';	
-				}				
-				$v = mysql_fetch_array(mysql_query('SELECT * FROM `vortex` WHERE `uid` = "'.$this->info['id'].'" AND `type` = 2 ORDER BY `time` DESC LIMIT 1'));
-				if(isset($v['id']) && $v['time'] + 60 * 60 > time() ) {
-					$r .= '<img style="cursor:pointer;filter:alpha(opacity=47);opacity:0.47;-moz-opacity:0.47;-khtml-opacity:0.47;" onClick="alert(\'�������� ��������������� ����� '.$this->timeOut( $v['time'] + 60 * 60 - time() ).'\');" src="https://img.new-combats.com/i/items/manavortex_'.$vid.'.png" width="40" height="25" title="������ MP (��������)"> ';
-				}else{
-					$r .= '<a href="main.php?vmp""><img src="https://img.new-combats.com/i/items/manavortex_'.$vid.'.png" width="40" height="25" title="������ MP"></a> ';
-				}
-			}
-			//
-		}
-		return $r;	
-	}
-	
-	public function insertAlign( $an , $uid ) {
-		if( $an > 0 ) {
-			mysql_query('UPDATE `users_align` SET `delete` = "'.(time()+1).'" WHERE `uid` = "'.mysql_real_escape_string($uid).'" AND `align` = "'.mysql_real_escape_string(floor($an)).'"');
-			mysql_query('INSERT INTO `users_align` (`uid`,`time`,`delete`,`align`) VALUES (
-				"'.mysql_real_escape_string($uid).'","'.time().'","0","'.mysql_real_escape_string(floor($an)).'"
-			) ');
-		}
-	}
-	
-	public function deleteAlign( $an , $uid ) {
-		if( $an > 0 ) {
-			mysql_query('UPDATE `users_align` SET `delete` = "'.(time()+86400*60).'" WHERE `uid` = "'.mysql_real_escape_string($uid).'" AND `align` = "'.mysql_real_escape_string(floor($an)).'"');
-		}
-	}
-	
-	public function shopSaleM( $val, $itm ) {
-		global $c;
-		/*$proc = array(
-			0,0,0,0,0,0,0,0,
-			5,30,30,30,30,30,30,30,30,30,30,30,30,30			
-		);
-		$po = $this->lookStats($itm['data']);
-		$proc = $proc[$po['tr_lvl']];*/
-		$proc = 0;	
-		//
-		$proc = array(
-			0,	//0
-			0,	//1
-			0,	//2
-			0,	//3
-			0,	//4
-			0,	//5
-			0,	//6
-			0,	//7
-			5,30,30,30,30,30,30,30,30,30,30,30,30,30			
-		);
-		$po = $this->lookStats($itm['data']);
-		$proc = $proc[$po['tr_lvl']];
-		//
-		if( $itm['type'] >= 28 ) {
-			$proc = 50;
-		}
-		if($itm['type']==46){
-			$proc = 0;
-		}
-		if( $c['shop_all'] > 0 ) {
-			$proc = 100-$c['shop_all'];
-		}elseif( $c['shop_all_type1'] > 0 && !isset($this->info['inBerezka']) ) {
-			$proc = 100-$c['shop_all_type1'];
-		}elseif( $c['shop_all_type2'] > 0 && isset($this->info['inBerezka'])) {
-			$proc = 100-$c['shop_all_type2'];
-		}
-		$val = round(($val/100*(100-$proc)),2);
-		return $val;
-	}
-	
-	//�������� ������������� ���� ���������
- public function deleteItemID($id, $uid, $coldel) {
-   $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($id).'" AND `uid` = "'.mysql_real_escape_string($uid).'" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT '.$coldel);
-   $delitm = array();
-   while($pl = mysql_fetch_array($sp)) {
-	 if(count($delitm) < $coldel) {
-	   $delitm[] = $pl['id'];
-	 }
-   }
-   $i = 0;
-   while($i < count($delitm)) {
-	 mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$delitm[$i].'" LIMIT 1');
-	 $i++;
-   }		
- }
- 
- public function count_items($id, $uid, $coldel) {
-   $sp = mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.mysql_real_escape_string($id).'" AND `uid` = "'.mysql_real_escape_string($uid).'" AND (`delete` = 0 OR `delete` = 1000) ORDER BY `inGroup` DESC LIMIT '.$coldel);
-   $delitm = array();
-   while($pl = mysql_fetch_array($sp)) {
-     if(count($delitm) < $coldel) {
-       $delitm[] = $pl['id'];
-     }
-   }
-   $i = 0;
-   while($i < count($delitm)) {
-     $i++;
-   }
-   return $i;
- }
-	
-	public function repobmen($id,$type)
-	{
-		//echo '�����';
-		$pl = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1;'));
-		$d = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1'));
-		$po = $this->lookStats($pl['data']);
-		//echo $po['dungeon'].' '.$po['tr_lvl'];
-		if((!isset($po['frompisher']) or $po['tr_lvl']<4) and $pl['type']!=31){
-			$e = '�� ������� �������� ������� �� ���������.';
-		}else{
-			$e = '����� �������� "'.$pl['name'].'" �� ��������� �apitalcity ������ ������.';
-			mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-			$this->rep['repcapitalcity'] += 1;
-			mysql_query('UPDATE `rep` SET `repcapitalcity` = "'.$this->rep['repcapitalcity'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');		
-		}
-		return $e;
-	}	
-	
-	public function add_buf($id,$tp,$uid = NULL,$mod = NULL) {
-		/*if($this->info['admin'] > 0) {
-			if($tp == 1) {
-				
-				$cache = ob_get_contents();
-				ob_end_clean ();
-								
-				//��������� �����
-				if($uid != '') {
-					$uid_f = floor($uid/1000);
-				}else{
-					$uid_f = '_m';
-				}
-								
-				//��������� ������������� ������ ����������
-				if(!is_dir($id.'~a/'.$uid_f.'/') ) {
-					//�������
-					mkdir($id.'~a/'.$uid_f.'/', 0700);
-				}
-				
-				//��������� ������������� ������ ����������
-				if(!is_dir($id.'~a/'.$uid_f.'/'.$uid.'/') ) {
-					//�������
-					mkdir($id.'~a/'.$uid_f.'/'.$uid.'/', 0700);
-				}
-				
-				$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-				
-				//������� ���������� ���������
-				if(file_exists($id)) {
-					$this->del_buf($id);
-				}
-				
-				//������� ����
-				$fp = @fopen ($id, "w");
-				@fwrite($fp, $cache);
-				@fclose($fp);
-				
-			}elseif($tp == 0) {
-				ob_start();
-			}
-		}*/
-	}
-	
-	public function del_buf($id,$uid = NULL,$mod = NULL) {
-		/*if($uid != NULL && $mod != NULL) {
-			//���������� ������
-			if((int)$uid > 0 && $uid != '') {
-				$uid_f = floor($uid/1000);
-			}else{
-				$uid_f = '_m_'.$uid;
-			}
-			$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-		}
-		if(file_exists($id)) {			
-			unlink($id);
-		}*/
-	}
-	
-	public function see_buf($id,$uid = NULL,$mod = NULL) {
-		/*if(file_exists($id)) {
-			if($uid != NULL && $mod != NULL) {
-				//���������� ������
-				if($uid != '') {
-					$uid_f = floor($uid/1000);
-				}else{
-					$uid_f = '_m';
-				}
-				$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-			}
-			return file_get_contents($id);
-		}else{
-			return false;
-		}*/
-	}
-	
-	public function sys_see($type) {
-			/*
-			$r = ''; $lid = $this->info['sys'];
-			$sp = mysql_query('SELECT `id`,`uid`,`time`,`type`,`text`,`data`,`time_see` FROM `a_system` WHERE `uid` = "'.$this->info['id'].'" AND `id` > "'.$this->info['sys'].'" ORDER BY `time` DESC LIMIT 20');
-			while($pl = mysql_fetch_array($sp)) {
-				$r .= 'top.tow('.$pl['id'].',"'.$pl['text'].'",'.$pl['time_see'].','.$pl['data'].');';
-				if($pl['id'] > $lid) {
-					$lid = $pl['id'];
-				}
-			}
-			if($lid > $this->info['sys']) {
-				mysql_query('UPDATE `users` SET `sys` = "'.$lid.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			}
-			return $r;
-			*/
-	}
-	
-	public static function start()
-	{
-		if (!isset(self::$flag_one))
-		{
-			$c = __CLASS__;
-			self::$flag_one = new $c();
-		}
-		return self::$flag_one;
-	}
-	
-	public function lookKeys($m,$i)
-	{
-		$e = explode('|',$m);
-		$r = array();
-		while($i<count($e))
-		{
-			$j = explode('=',$e[$i]);
-			$r[$i] = $j[0];
-			$i++;	
-		}
-		return $r;
-	}
-	
-	public function bsfinish($id, $bu, $di) {
-		if($bu == true) {
-			/* � ���� ��� ��������� ������ */
-			$i = 0;
-			while($i < count($bu[$i])) {
-			  if($bu[$i]['lose'] > 0 || $bu[$i]['nich']) {
-					mysql_query('UPDATE `users` SET `lose` = "'.$bu[$i]['lose'].'", `nick` = "'.$bu[$i]['nich'].'" WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1');
-					mysql_query('UPDATE `bs_turnirs` SET `users_finish` = `users_finish` + 1 WHERE `id` = "'.$id['id'].'" LIMIT 1');
-					/* ������� ����� */
-					if($bu['inBot'] == 0) {
-						$pls1 = mysql_fetch_array(mysql_query('SELECT `id`, `bsid`, `money`, `finish`, `time`, `inBot`, `uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `finish` = 0 AND `time` = "'.$id['time_start'].'" AND `inBot` = "'.$bu[$i]['id'].'" LIMIT 1'));
-						if(isset($pls1['id'])) {
-							mysql_query('DELETE FROM `users` WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1');
-							mysql_query('DELETE FROM `stats` WHERE `id` = "'.$bu[$i]['id'].'" LIMIT 1');
-							
-							//���������� �������� �� �����
-							$spi = mysql_query('SELECT `id`,`item_id` FROM `items_users` WHERE `uid` = "'.$bu[$i]['id'].'" LIMIT 500');
-							$ins = '';
-							while($pli = mysql_fetch_array($spi))
-							{
-								$ins .= '("'.$di['dn_id'].'","'.$pli['item_id'].'","'.time().'","'.$di['x'].'","'.$di['y'].'"),'; 
-							}
-							
-							$ins = rtrim($ins,',');
-							mysql_query('INSERT INTO `dungeon_items` (`dn`,`item_id`,`time`,`x`,`y`) VALUES '.$ins.'');
-							mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pls1['inBot'].'" LIMIT 1');	
-							mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pls1['inBot'].'" LIMIT 1');	
-							mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `id` = "'.$pls1['id'].'" LIMIT 1');
-							mysql_query('UPDATE `users` SET `inUser` = 0 WHERE `id` = "'.$pls1['uid'].'" LIMIT 1');	
-						}
-					}
-					$id['users_finish']++;
-				}
-				$i++;
-			}
-		}
-		if($id['users']-$id['users_finish'] < 2) {
-			$win = array();
-			$sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `finish` = "0" AND `time` = "'.$id['time_start'].'" ORDER BY `money` DESC LIMIT 100');	
-			while($pl = mysql_fetch_array($sp))
-			{
-				$ur = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1'));
-				$ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$ur['inUser'].'" LIMIT 1'));
-				if(isset($ur['id']) && isset($ub['id']))
-				{
-					if($ub['lose'] > 0 || $ub['nich'] > 0) {
-						//���������� �� ��
-						
-					}else{
-						$win = $ub;
-						$winr = $ur;
-					}
-				}
-			}
-			
-			/* ��������� �� */
-			if(isset($win['id']) && $win['lose'] == 0 && $win['nich'] == 0 && $win['id'] > 0) {
-				//���� ����������
-				$bsep = 0;
-				if($winr['level'] < 6) {
-					$bsep = 2500;
-				}elseif($winr['level'] < 7) {
-					$bsep = 5000;
-				}elseif($winr['level'] < 8) {
-					$bsep = 15000;
-				}elseif($winr['level'] < 9) {
-					$bsep = 25000;
-				}else{
-					$bsep = 50000;
-				}
-				/* ������ ���� */
-				$mn = (round($id['money']/100*85));
-				mysql_query('UPDATE `users` SET `money` = `money` + "'.$mn.'" WHERE `id` = "'.$winr['id'].'" LIMIT 1');
-				mysql_query('UPDATE `stats` SET `exp` = `exp` + "'.$bsep.'" WHERE `id` = "'.$winr['id'].'" LIMIT 1');
-				/* ��� */
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','".$winr['login']."','�����������! �� �������� � ������� &quot;����� ������&quot;! �������� �����: ".$bsep.", ������: ".$mn." ��.','-1','6','0')");
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> ���������� ������ &quot;����� ������&quot;, ���������� �������: <b>".$winr['login']."</b>! �����������!','-1','5','0')");
-				$this->addDelo(1,$uid,'&quot;<font color=#C65F00>WinTournament.'.$this->info['city'].'</font>&quot; (����� ������): �������� &quot;<b>'.$mn.'</b> ��.&quot;',time(),$this->info['city'],'WinTournament.'.$this->info['city'].'',0,0);
-			}else{
-				//��� ����������				
-				//������ ������
-				
-				/* ��� */
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> ���������� ������ &quot;����� ������&quot;, ���������� �������: �����������.','-1','5','0')");
-			}
-			
-			$sp = mysql_query('SELECT `id`,`bsid`,`money`,`finish`,`time`,`inBot`,`uid` FROM `bs_zv` WHERE `bsid` = "'.$id['id'].'" AND `time` = "'.$id['time_start'].'" ORDER BY `money` DESC LIMIT 100');	
-			while($pl = mysql_fetch_array($sp))
-			{
-				$ur = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$pl['uid'].'" LIMIT 1'));
-				$ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "'.$ur['inUser'].'" LIMIT 1'));
-				if(isset($ub['id']))
-				{
-					//del
-					mysql_query('DELETE FROM `users` WHERE `id` = "'.$ub['id'].'" LIMIT 1');
-					mysql_query('DELETE FROM `stats` WHERE `id` = "'.$ub['id'].'" LIMIT 1');	
-					mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$ub['id'].'" LIMIT 500');	
-					mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$ub['id'].'" LIMIT 500');	
-					//upd
-					mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "'.$pl['uid'].'" LIMIT 1');					
-				}
-			}			
-		}
-	}
-	
-	//��� ��������� � �����
-	public function ves($u)
-	{
-		$r = array('now'=>0,'max'=>0);
-		if($u==NULL)
-		{
-			//������� ��������
-			$r['now'] = mysql_fetch_array(mysql_query('SELECT SUM(`im`.`massa`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$this->info['id'].'" AND (`iu`.`delete` = "0" OR (`iu`.`delete` = "1000" AND `iu`.`inGroup` > 0)) AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'));
-			$r['now'] = 0+$r['now'][0];
-			@$r['max'] = 40+($this->stats['os7']*10)+$this->stats['s4']+$this->stats['maxves']+$this->stats['s1']*4;
-			$r['items'] = mysql_fetch_array(mysql_query('SELECT COUNT(`im`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0"'));
-			$r['items'] = $r['items'][0];
-		}else{
-			
-		}
-		return $r;
-	}
-	
-	//���������� ����� \ ���
-	public function plavka($id, $type)
-	{
-		$e = '';
-		$rn = 0; $rnn = array();
-		$pl = mysql_fetch_array(mysql_query('SELECT		
-`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1;'));
-		$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1'));
-		$po = $this->lookStats($d['data']);
-		$rlvl = 4;
-		if($pl['level'] == 0) {
-			$pl['level'] = 0+$po['tr_lvl'];
-		}
-
-		if($pl['level']==7 || $pl['level']==8){
-			$rlvl = 7;
-		}elseif($pl['level']==9){
-			$rlvl = 9;
-		}elseif($pl['level']>=10){
-			$rlvl = 9;
-		}
-		//����������� ��������� �������
-		if( ( rand(0,100) == 0 ) && $this->rep['rep1'] >= 1000 ) {
-			$rlvl = 1;
-			$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` >= 5024 AND `id` < 6000');
-		}elseif( ( rand(0,100) <= 1 ) && $this->rep['rep1'] >= 10000 ) {
-			$rlvl = 1;
-			$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` >= 5024 AND `id` < 6000');
-		}else{
-			$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'" AND `id` < 5024');
-		}
-		
-		//$rs = mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `type` = 31 AND `level` = "'.$rlvl.'"');
-		while($rl = mysql_fetch_array($rs))
-		{
-			$nm = explode(' ',$rl['name']);
-			if(($nm[0] && $nm[1] || $rlvl >= 10)) {
-				$rnn[count($rnn)] = $rl['id'];
-			}
-		}
-		$rn = $rnn[rand(0,count($rnn)-1)];
-		
-		$chns = round(50 + ( ( 4 - $po['tr_lvl'] ) * 5 ) ); //���� ������
-		if( $chns > 90 ) {
-			$chns = 90;
-		}elseif( $chns < 50 ) {
-			$chns = 70;
-		}
-		
-		if($po['tr_lvl']<4 && $pl['item_id']!=1035)
-		{
-			$e = '������� ������ ���� 4-�� � ���� ������';
-		}elseif($pl['type']!=1 && $pl['type']!=3 && $pl['type']!=5 && $pl['type']!=6 && $pl['type']!=8 && $pl['type']!=9 && $pl['type']!=10 && $pl['type']!=11 && $pl['type']!=12 && $pl['type']!=14 && $pl['type']!=15 && $pl['type']!=18 && $pl['type']!=19 && $pl['type']!=20 && $pl['type']!=21 && $pl['type']!=22 && $pl['type']!=13 && $pl['item_id']!=1035)
-		{
-			$e = '���� ���, � �� ����! ���� ������� �������? �� �������� ��! ������� ��� ����� ���-�� �������!';
-		}elseif($po['tr_lvl']>=7 && $this->rep['rep1']<100)
-		{
-			$e = '��� ����������� ��������� 7-�� � ������ ������ ��������� ���� ����� ������ ������� �����';
-		}elseif($po['tr_lvl']>=9 && $this->rep['rep1']<1000)
-		{
-			$e = '��� ����������� ��������� 9-�� � ������ ������ ��������� ���� ����� ������ ������� �����';
-		}elseif($po['tr_lvl']>=10 && $this->rep['rep1']<10000)
-		{
-			$e = '��� ����������� ��������� 10-�� � ������ ������ ��������� ���� ����� ������ �������� �����';
-		}elseif($rn>0)
-		{
-			if(isset($pl['id'],$d['id']))
-			{
-				$rnn = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `type` = "31" AND `id` = "'.$rn.'" LIMIT 1'));
-				if(isset($rnn['id'])){
-					$pl['rep'] = 0;
-					if( $po['tr_lvl'] >= 4 && $po['tr_lvl'] <= 6 && $this->rep['rep1'] < 100 ) {
-						$pl['rep'] = 1; //4-6
-					}elseif($this->rep['rep1'] > 99 && $this->rep['rep1'] < 1000){
-						if( $po['tr_lvl'] >= 7 && $po['tr_lvl'] <= 8 ) { //7-8
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						} 
-					}elseif($this->rep['rep1'] > 999){
-						if( $po['tr_lvl'] >= 9 && $po['tr_lvl'] <= 10 ) { //9-10
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						} 
-					}else{
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						} 
-					}
-					//����������� ��������� ����
-					if( $chns <= rand(0,100) && $pl['item_id'] != 1035) {
-						$e = '������� "'.$pl['name'].'" ��� ��������� ��������...';
-						$ld = $this->addDelo(1, $this->info['id'],'&quot;<font color=#C65F00>AddItems.'.$this->info['city'].'</font>&quot;: ������� [<b>'.$pl['name'].'</b>] ��� ���������� ��������.',time(),$this->info['city'],'AddItems.'.$this->info['city'].'',0,0); 
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					}elseif(mysql_query('UPDATE `rep` SET `rep1` = `rep1` + "'.$pl['rep'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1')){
-						
-						$e = '������ ��������� ������� "'.$pl['name'].'". '.( $pl['item_id'] != 1035 ? '�������� ���� "'.$rnn['name'].'".' : '').'. �������� ���������: +'.$pl['rep'].' ��.';
-						if($pl['item_id'] != 1035) {
-							$irunew = $this->addItem($rnn['id'],$this->info['id'], null, null, null, null, $pl['name']);
-							/*if( $rlvl == 1 ) {
-								$irunew = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "'.$irunew.'" LIMIT 1'));
-								if(isset($irunew['id'])) {
-									$irunew['data'] .= '|sudba='.$u->info['login'].'';
-								}
-								mysql_query('UPDATE `items_users` SET `data` = "'.$irunew['data'].'" WHERE `id` = "'.$irunew['id'].'" LIMIT 1');
-								unset($irunew);
-							}*/
-						}
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						$this->rep['rep1'] += $pl['rep'];
-						mysql_query('UPDATE `rep` SET `rep1` = "'.$this->rep['rep1'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');						
-					}else{
-						$e = '�� ������� ���������� �������, ����� ���������� ...';
-					}
-				}else{
-					$e = '�� ������� ���������� ������� ...';
-				}
-			}else{
-				$e = '������� �� ������, ���� �� �������� '.$pl['item_id'].'...';
-			}
-		}else{
-			$e = '�� ������� �����������, ������� ��� ���� �������� ...';
-		}
-		return $e;
-	}
-	
-	//������� ���� ������� ����� ���������������
-	public function info_remont()
-	{
-		$r = '';
-		$sp = mysql_query('SELECT 
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		 FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.((int)$this->info['id']).'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` > "0" AND `iu`.`inOdet` < "18" LIMIT 18');
-		while($pl = mysql_fetch_array($sp))
-		{
-			if($pl['iznosNOW']>ceil($pl['iznosMAX']*0.80))
-			{
-				$r .= '<b>'.$pl['name'].'</b> [<font color="brown">'.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).'</font>] ��������� ������<br>';
-			}
-		}
-		$r = '<div align="left"><small>'.$r.'</small></div>';
-		return $r;
-	}
-	
-	//������ ����� �� ������
-	public function weaponAtc($item,$st,$x)
-	{
-		$tp = 0;
-		if(isset($item['id']))
-		{
-			$itm = $this->lookStats($item['data']);				
-			//�������� ������ �����
-			if(!isset($st['minAtack'])) {		$st['minAtack'] = 0;		}
-			if(!isset($st['maxAtack'])) {		$st['maxAtack'] = 0;		}
-			if(!isset($st['yron_min'])) {		$st['yron_min'] = 0;		}
-			if(!isset($st['yron_max'])) {		$st['yron_max'] = 0;		}
-			if(!isset($itm['yron_min'])) {		$itm['yron_min'] = 0;		}
-			if(!isset($itm['yron_max'])) {		$itm['yron_max'] = 0;		}
-			if(!isset($itm['sv_yron_min'])) {	$itm['sv_yron_min'] = 0;	}
-			if(!isset($itm['sv_yron_max'])) {	$itm['sv_yron_max'] = 0;	}
-			
-			$min = $itm['sv_yron_min']+$st['minAtack']+$itm['yron_min']+$st['yron_min'];
-			$max = $itm['sv_yron_max']+$st['maxAtack']+$itm['yron_max']+$st['yron_max'];
-			
-			//if($x!=0)
-			//{
-				//��� �����: 0 - ��� �����, 1 - �������, 2 - �������, 3 - ��������, 4 - �������, 5 - �����, 6 - ������, 7 - ����, 8 - �����, 9 - ����, 10 - ����, 11 - �����
-				if($item['type'] == 18)
-				{
-					//�������
-					$sss = ceil((($st['s1']*0.45+$st['s2']*0.55)));
-				}elseif($item['type'] == 19)
-				{
-					//�������
-					$sss = ceil(($st['s1']*0.60+$st['s2']*0.25+$st['s3']*0.25));
-				}elseif($item['type'] == 20)
-				{
-					//��������
-					$sss = ceil($st['s1']*0.95);
-				}elseif($item['type'] == 21)
-				{
-					//�������
-					$sss = ceil(($st['s1']*0.45+$st['s3']*0.45));
-				}else{
-					//��� ����������� �����
-					$sss = ceil($st['s1']*0.5);
-				}
-				
-				
-			//������� ����
-				//$p['B'][0] = 5;
-				//$p['B'][1] = 9;
-				
-				$p['B'][0] = ceil($st['s1']*1.4);
-				$p['B'][1] = ceil(0.4+$p['B'][0]/0.9);
-				
-				$p['B'][0] = 2 + $st['level'] + $st['s1'] - round($st['s1']/5);
-				$p['B'][1] = $p['B'][0] + 3;
-				
-				$p['B']['rnd'] = rand($p['B'][0],$p['B'][1]);
-				//���������� ����������� ����
-				$p['W'][0] = $min;
-				$p['W'][1] = $max;				
-				$p['W']['rnd'] = rand($p['W'][0],$p['W'][1]);
-				// ����. ������
-				$p['T'] = 1;
-				//��������
-				$bn = 0;
-				if($item['type'] == 21) {
-					// ���
-					$p['M'] = $st['pa4'];
-					$bn = $st['a4'];
-					$p['M'] = $st['pa'.$x];
-				}elseif($item['type'] == 20) {
-					// ������
-					$p['M'] = $st['pa3'];
-					$bn = $st['a3'];
-				}elseif($item['type'] == 19) {
-					// �����
-					$p['M'] = $st['pa2'];
-					$bn = $st['a2'];
-				}elseif($item['type'] == 18) {
-					// ���
-					$p['M'] = $st['pa1'];
-					$bn = $st['pa1'];
-				}elseif($item['type'] == 22) {
-					// �����
-					$p['M'] = $st['pa'];
-					$bn = $st['a5'];					
-				}
-				//���������
-				//if( $x < 5 ) {
-				//$p['M'] = $st['pa'.$x];
-				//}else{
-				//	$p['M'] = $st['pm'.($x-4)];
-				//}
-				$min  = (($p['B'][0]+$sss+$p['W'][0])*$p['T']*(1+0.005*$bn))*(1+$p['M']/100);
-				$max  = (($p['B'][1]+$sss+$p['W'][1])*$p['T']*(1+0.005*$bn))*(1+$p['M']/100);	
-				//
-				$kmin  = ceil( ( 2 * ( 1 + $st['m3']/100 ) ) * $min);
-				$kmax  = ceil( ( 2 * ( 1 + $st['m3']/100 ) ) * $max);	
-				/*
-				$r['Kmin'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['min']);
-				$r['Kmax'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['max']);
-				*/
-				//
-				//$min = $min*0.8;
-				//$max = $max*0.8;		
-			//}
-			$tp = array(0=>ceil($min),1=>ceil($max),2=>ceil($kmin),3=>ceil($kmax));
-		}
-		return $tp;
-	}
-	
-		public function yronLvl($lvl1,$lvl2) {
-			$r = array(
-				1  => array(0,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				2  => array(0,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				3  => array(0,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				4  => array(0,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				5  => array(0,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200,200,200),
-				6  => array(0,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200,200,200),
-				7  => array(0,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200,200,200),
-				8  => array(0,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200,200,200),
-				9  => array(0,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200,200,200),
-				10 => array(0,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200,200,200),
-				11 => array(0,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600,400,200),
-				12 => array(0,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000,800,600),
-				13 => array(0,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400,1200,1000),
-				14 => array(0,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800,1600,1400),
-				15 => array(0,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200,2000,1800),
-				16 => array(0,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600,2400,2200),
-				17 => array(0,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000,2800,2600),
-				18 => array(0,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400,3200,3000),
-				19 => array(0,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800,3600,3400),
-				20 => array(0,7800,7600,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200,4000,3800),
-				21 => array(0,8200,8000,7800,7600,7400,7200,7000,6800,6600,6400,6200,6000,5800,5600,5400,5200,5000,4800,4600,4400,4200)
-			);
-			$r = floor($r[$lvl1][$lvl2]/100);
-			$r = 0;
-			return $r;
-		}
-		
-	//������ ������
-		public function zago($v) {
-			/*if($v > 1000) {
-				$v = 1000;
-			}
-			$r = (1-( pow(0.5, ($v/250) ) ))*100;		
-			return $r;*/
-			if($v > 1700) {
-				$v = 1700;
-			}
-			$r = round( (1-( pow(0.5, ($v/399.51) ) ))*100 , 2 );
-			return $r;
-		}
-	//������ ������ (�����)
-		public function zmgo($v) {
-			if($v > 1000) {
-				$v = 1000;
-			}
-			$r = (1-( pow(0.5, ($v/250) ) ))*100;		
-			return $r;
-		}
-	
-	public function inform($v)
-
-	{
-		//$this->stats['items'][13] , $this->stats['items'][14]
-		$r = '';
-		if($v=='yrontest' || $v=='yrontest-krit')
-		{
-			$y = array();
-			/* ������ ������ ��� ����� */
-			$w1 = 0;
-			$w2 = 0;
-			$i = 0;
-			while($i<count($this->stats['items']))
-			{
-				if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w1 = $this->stats['items'][$i];
-				}elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w2 = $this->stats['items'][$i];
-				}
-				$i++;
-			}
-			if(isset($w1['id']) && $w1['inOdet']!=14)
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w1['data']);
-				while($i<=4)
-				{
-					if(isset($d['tya'.$i]) && $t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w1,$this->stats,$tp);
-				if($v=='yrontest-krit') {
-					$y[0] = $y[2];
-					$y[1] = $y[3];
-				}
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= '<span title="'.$w1['name'].'">'.$y[0].'-'.$y[1].'</span>';
-			}else{
-				//���� �������
-				$y[0] = ceil( 2 + $this->info['level'] + $this->stats ['s1'] - round($this->stats['s1'] / 5) )+$this->stats['minAtack']+$this->stats['yron_min'];
-				$y[1] = ceil($y[0] + 3)+$this->stats['maxAtack']+$this->stats['yron_max'];
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= $y[0].'-'.$y[1];	
-			}
-			/* ������ ������ */
-			if(isset($w2['id']))
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w2['data']);
-				while($i<=4)
-				{
-					if($t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w2,$this->stats,$tp);
-				if($v=='yrontest-krit') {
-					$y[0] = $y[2];
-					$y[1] = $y[3];
-				}
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= ' / <span title="'.$w2['name'].'">'.$y[0].'-'.$y[1].'</span>';	
-			}		
-			/* --- */
-		}elseif($v=='yron')
-		{
-			$y = array();
-			/* ������ ������ ��� ����� */
-			$w1 = 0;
-			$w2 = 0;
-			$i = 0;
-			while($i<count($this->stats['items']))
-			{
-				if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w1 = $this->stats['items'][$i];
-				}elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-				{
-					$w2 = $this->stats['items'][$i];
-				}
-				$i++;
-			}
-			if(isset($w1['id']) && $w1['inOdet']!=14)
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w1['data']);
-				while($i<=4)
-				{
-					if(isset($d['tya'.$i]) && $t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w1,$this->stats,$tp);
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= '<span title="'.$w1['name'].'">'.$y[0].'-'.$y[1].'</span>';
-			}else{
-				//���� �������
-				$y[0] = ceil($this->stats['s1']*1.4)+$this->stats['minAtack']+$this->stats['yron_min'];
-				$y[1] = ceil(0.4+$y[0]/0.9)+$this->stats['maxAtack']+$this->stats['yron_max'];
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= $y[0].'-'.$y[1];	
-			}
-			/* ������ ������ */
-			if(isset($w2['id']))
-			{
-				$tp = 0;
-				$t = 0;
-				$i = 1;
-				$d = $this->lookStats($w2['data']);
-				while($i<=4)
-				{
-					if($t<$d['tya'.$i])
-					{
-						$t = $d['tya'.$i];
-						$tp = $i;
-					}
-					$i++;
-				}
-				$y = $this->weaponAtc($w2,$this->stats,$tp);
-				if( $y[0] < 1 ) {
-					$y[0] = 1;
-				}
-				if( $y[1] < 1 ) {
-					$y[1] = 1;
-				}
-				$r .= ' / <span title="'.$w2['name'].'">'.$y[0].'-'.$y[1].'</span>';	
-			}
-		}else{
-			//������������
-				$y = array();
-				/* ������ ������ ��� ����� */
-				$w1 = 0;
-				$w2 = 0;
-				$i = 0;
-				$ry = 0;
-				while($i<count($this->stats['items']))
-				{
-					if($this->stats['items'][$i]['inOdet']==3 && $w1==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-					{
-						$w1 = $this->stats['items'][$i];
-					}elseif($this->stats['items'][$i]['inOdet']==14 && $w2==0 && $this->stats['items'][$i]['type'] >= 18 && $this->stats['items'][$i]['type'] <= 28)
-					{
-						$w2 = $this->stats['items'][$i];
-					}
-					$i++;
-				}
-				if(isset($w1['id']) && $w1['inOdet']!=14)
-				{
-					$tp = 0;
-					$t = 0;
-					$i = 1;
-					$d = $this->lookStats($w1['data']);
-					$y = 0;
-					if(isset($d['sv_'.$v])) {
-						$y += $d['sv_'.$v];
-					}
-					if(isset($this->stats[$v])) {
-						$y += $this->stats[$v];
-					}
-					$ry = $y;
-					$r .= '<span title="'.$w1['name'].'">'.$y.'</span>';
-				}else{
-					//�������
-					$r .= $this->stats[$v];	
-					$ry = $this->stats[$v];
-				}
-				/* ������ ������ */
-				if(isset($w2['id']))
-				{
-					$tp = 0;
-					$t = 0;
-					$i = 1;
-					$d = $this->lookStats($w2['data']);
-					$y = @$this->stats[$v]+@$d['sv_'.$v];
-					if($y!=$ry)
-					{
-						$r .= ' / <span title="'.$w2['name'].'">'.$y.'</span>';	
-					}else{
-						$r = str_replace('title="'.$w1['name'].'"','',$r);
-					}
-				}
-			//������������
-		}
-		return $r;
-	}
-	
-	public function timeOut($ttm)
-	{
-		 $out = '';
-		$time_still = $ttm;
-		$tmp = floor($time_still/2592000);
-		$id=0;
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." ���. ";}
-			$time_still = $time_still-$tmp*2592000;
-		}
-		$tmp = floor($time_still/86400);
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." ��. ";}
-			$time_still = $time_still-$tmp*86400;
-		}
-		$tmp = floor($time_still/3600);
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." �. ";}
-			$time_still = $time_still-$tmp*3600;
-		}
-		$tmp = floor($time_still/60);
-		if ($tmp > 0) 
-		{ 
-			$id++;
-			if ($id<3) {$out .= $tmp." ���. ";}
-		}
-		if($out=='')
-		{
-			if($time_still<0)
-			{
-				$time_still = 0;
-			}
-			$out = $time_still.' ���.';
-		}
-		return $out;
-	}
-	
-	public function rep_zv($id,$e)
-	{
-		if($id==1)
-		{
-			//���� ������
-			if($e>9999)
-			{
-				$r = '����������� �������� �����, '.$e.' / ??';
-			}elseif($e>999)
-			{
-				$r = '����������� ������� �����, ' .$e.' / 9999';
-			}elseif($e>99)
-			{
-				$r = '����������� ������� �����, '.$e.' / 999';
-			}else{
-				$r = $e.' / 99';
-			}
-		}elseif($id==2)
-		{
-			//Capital city
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==3)
-		{
-			//Angels city
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==4)
-		{
-			//Demons city
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==5)
-		{
-			//������ �����
-			if($e>99)
-			{
-				$r = '����������� ������� ����� '.$e.' / 999';
-			}else{
-				$r = $e.' / 99';
-			}
-		}elseif($id==6)
-		{
-			//Sand
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==7)
-		{
-			//Sun
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-		}elseif($id==8)
-		{
-			//Moon
-			if($e>24999)
-			{
-				$r = '������ ������� �����, '.$e.' / ??';
-			}elseif($e>9999)
-			{
-				$r = '������ ������� �����, '.$e.' / 24999';
-			}else{
-				$r = $e.' / 10000';
-			}
-	  }elseif($id==9)
-		{
-			//Dreams city
-			if($e>9999)
-			{
-				$r = '����������� �������� �����,  ['.$e.']';
-			}elseif($e>4999)
-			{
-				$r = '����������� ������� �����,'  .$e.' / 9999';
-			}elseif($e>999)
-			{
-				$r = '����������� ������� �����,  '.$e.' / 4999';
-			}else{
-				$r = $e.' / 999';
-			}
-		}elseif($id==10) {
-			//���� �������
-		   if($e>9999)
-			{
-				$r = '����������� ������� �����,['.$e.']';
-			}elseif($e>999)
-			{
-				$r = '����������� ������� �����,  '.$e.' / 4999';
-			}else{
-				$r = $e.' / 999';
-			}
-		}elseif($id==11)
-		{
-			//����� �����
-			if($e>9999)
-			{
-				$r = '������� ������ �����,  ['.$e.']';
-			}elseif($e>4999)
-			{
-				$r = '������� ������ �����,'  .$e.' / 9999';
-			}elseif($e>999)
-			{
-				$r = '������ ������ �����,  '.$e.' / 4999';
-			}else{
-				$r = $e.' / 999';
-			}
-		}
-		
-		return $r;
-	}
-	
-	public function getInfoById($id){
-			$ch = mysql_fetch_array(mysql_query("SELECT `users`.*,`stats`.* FROM `users` INNER JOIN `stats` ON (`stats`.`id`=`users`.`id`) WHERE `users`.`id`='".$id."' OR
-			`users`.`login`= '".mysql_real_escape_string($id)."'"));
-
-
-			return $ch;
-		}
-	
-	public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null) {
-		$rt = -1;
-		$i = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp` FROM `items_main` AS `im` WHERE `im`.`id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
-		if(isset($i['id']))
-		{
-			$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));		
-			//����� ����
-			$data = $d['data'];	
-			if($i['ts']>0)
-			{
-				if( $nosudba == NULL ) {
-					$ui = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "'.mysql_real_escape_string($uid).'" LIMIT 1'));
-					$data .= '|sudba='.$ui['login'];
-				}
-			}
-			if($md!=NULL)
-			{
-				  $data .= $md; 
-				  $data = $this->lookStats($data); // ���� � ������� ������� ��� ���������� ��������� SROK?
-				  $data = $this->impStats($data);
-			}
-
-	
-			if($dn!=NULL)
-			{
-				//������� � ����������� �� ����������
-				if($dn['dn_delete']>0)
-				{
-					$i['dn_delete'] = 1;
-				}
-			}
-			if($mxiznos > 0) {
-				$i['iznosMAXi'] = $mxiznos;
-			}
-			if($this->info['dnow'] > 0){
-				$room = $this->room['city'];
-			}else {
-				$room = $this->info['city'];
-			}
-			$ins = mysql_query('INSERT INTO `items_users` (`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`,`dn_delete`) VALUES (
-											"'.$i['overTypei'].'",
-											"'.$i['id'].'",
-											"'.$uid.'",
-											"'.$data.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geni'].'",
-											"'.$i['magic_inci'].'",
-											"'.$room.'",
-											"'.time().'",
-											"'.time().'",
-											"'.$i['dn_delete'].'")');
-			if($ins)
-			{
-				$rt = mysql_insert_id();
-				mysql_query('UPDATE `items_users` SET `dn_delete` = "1" WHERE `id` = "'.$rt.'" AND `data` LIKE "%dn_delete=%" LIMIT 1');
-				if( $uid == $this->info['id'] ) {
-					$this->stack( $rt );
-				}
-				$ads = '';
-				if($plavka != null) {
-				  $ads = '���������� ������� : ['.$plavka.']';
-				}
-				//���������� � ������ ���� ��� ������� �������
-				$ld = $this->addDelo(1,$uid,'&quot;<font color=#C65F00>AddItems.'.$this->info['city'].'</font>&quot;: ������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x1) [#'.$i['iid'].']. '.$ads.'',time(),$this->info['city'],'AddItems.'.$this->info['city'].'',0,0);
-			}else{
-				$rt = 0;	
-			}			
-		}
-		return $rt;
-	}
-	
-	public function getNum($v)
-	{
-		$plid = $v;
-		$pi = iconv_strlen($plid);
-		if($pi<5)
-		{
-			$i = 0;
-			while($i<=5-$pi)
-			{
-				$plid = '0'.$plid;
-				$i++;
-			}
-		}
-		return $plid;
-	}
-	
-	public function microLogin2($bus) {
-		$bus['login_BIG']  = '<b>';
-		if( $bus['align'] > 0 ) {
-			$bus['login_BIG'] .= '<img src=https://img.new-combats.com/i/align/align'.$bus['align'].'.gif width=12 height=15 >';
-		}
-		if( $bus['align2'] > 0 ) {
-			$bus['login_BIG'] .= '<img src=https://img.new-combats.com/i/align/align'.$bus['align2'].'.gif width=12 height=15 >';
-		}
-		if( $bus['clan'] > 0 ) {
-			$bus['login_BIG'] .= '<img src=https://img.new-combats.com/i/clan/'.$bus['clan'].'.gif width=24 height=15 >';
-		}
-		$bus['login_BIG'] .= ''.$bus['login'].'</b>['.$bus['level'].']<a target=_blank href=https://new-combats.com/info/'.$bus['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-		return $bus['login_BIG'];
-	}
-	
-	public function microLogin($id,$t,$nnz = 1)
-	{
-		global $c;
-		if($t==1)
-		{
-			$inf = mysql_fetch_array(mysql_query('SELECT 
-			`u`.`id`,
-			`u`.`align`,`u`.`align2`,
-			`u`.`login`,
-			`u`.`clan`,
-			`u`.`level`,
-			`u`.`city`,
-			`u`.`online`,
-			`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,
-			`u`.`cityreg`,
-			`u`.`palpro`,
-			`u`.`invis`,
-			`st`.`hpNow` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($id).'" OR `u`.`login` = "'.mysql_real_escape_string((int)$id).'" LIMIT 1'));
-		}else{
-			$inf = $id;
-			$id = $inf['id'];
-		}
-		$r = '';
-		if(isset($inf['id']) && ( ($inf['invis'] < time() && $inf['invis'] != 1) || ($this->info['id'] == $inf['id'] && $nnz == 1) ))
-		{
-			if($inf['align']>0)
-			{
-				$r .= '<img width="12" height="15" src="https://img.new-combats.com/i/align/align'.$inf['align'].'.gif" />';
-			}
-			if($inf['align2']>0)
-			{
-				$r .= '<img width="12" height="15" src="https://img.new-combats.com/i/align/align'.$inf['align2'].'.gif" />';
-			}
-			if($inf['clan']>0)
-			{
-				$cln = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id` = "'.$inf['clan'].'" LIMIT 1'));
-				if(isset($cln['id']))
-				{
-					$r .= '<img width="24" height="15" src="https://img.new-combats.com/i/clan/'.$cln['name_mini'].'.gif" />';
-				}
-			}
-			if($inf['cityreg'] == '') {
-				$inf['cityreg'] = 'capitalcity';
-			}
-			$r .= ' <b>'.$inf['login'].'</b> ['.$inf['level'].']<a target="_blank" href="https://new-combats.com/info/'.$inf['id'].'"><img src="https://img.new-combats.com/i/inf_'.$inf['cityreg'].'.gif" /></a>';	
-		}else{
-			$r = '<b><i>���������</i></b> [??]<a target="_blank" href="https://new-combats.com/info/0"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" /></a>';	
-		}
-		return $r;
-	}
-	
-	public function testHome()
-	{
-		/*----�������(�����������)----*/
-		$timeforwait = 3600;
-		if(isset($st['os3']) && $st['os3']>0) {
-			$timeforwait = 3600-(($st['os6']*5)*60);
-		}
-		/*----�������(�����������)----*/
-		$hgo = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` >= '.(time()-$timeforwait).' AND `vars` = "go_homeworld" LIMIT 1',1);
-		if($this->info['level']==0 || $this->info['active']!='' || $this->info['inTurnir'] > 0 || $this->info['inTurnirnew'] > 0 || $this->info['zv'] > 0 || $this->info['dnow'] > 0) {
-			$hgo['id'] = true;
-		}
-		if(isset($this->info['noreal']) || $this->info['dnow'] > 0) {
-			$hgo['id'] = true;
-		}
-		if(!isset($hgo['id'])) {
-			$ku = mysql_fetch_array(mysql_query('SELECT `id` FROM `katok_zv` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-			if(isset($ku['id'])) {
-				$hgo['id'] = true;
-			}
-		}
-		return $hgo;
-	}
-	
-	public function telegram($uid,$text,$type = 1,$from = NULL)
-	{
-		if(!(int)$uid)
-		{
-			$uid = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			$uid = $uid['id'];
-		}
-		$r = 0;
-		if($uid>0)
-		{
-			if($from == NULL)
-			{
-				$from = $this->info['login'];
-			}
-			$ins = mysql_query('INSERT INTO `telegram` (`uid`,`from`,`time`,`fromType`,`text`) VALUES ("'.mysql_real_escape_string($uid).'","'.mysql_real_escape_string($from).'","'.time().'","'.mysql_real_escape_string($type).'","'.mysql_real_escape_string(htmlspecialchars($text,NULL,'cp1251')).'")');
-			if($ins)
-			{
-				$r = 1;
-			}else{
-				$r = -2;	
-			}
-		}else{
-			$r = -1;	
-		}
-		return $r;
-	}
-	
-	public function functionThisData() {
-		//���������� ������ �������
-		
-	}
-	
-	private function __construct()
-	{
-		global $c,$code,$magic;
-		
-		$this->info = mysql_fetch_array(mysql_query('
-SELECT
-    `u`.`nextBonus`,
-    `u`.`mat`,
-    `u`.`skype`,
-    `u`.`skype_hide`,
-    `u`.`stopexp`,
-    `u`.`twink`,
-    `u`.`swin`,
-    `u`.`slose`,
-    `u`.`send`,
-    `u`.`activ`,
-    `u`.`b1`,
-    `u`.`nadmin`,
-    `u`.`fnq`,
-    `u`.`id`,
-    `u`.`login`,
-    `u`.`login2`,
-    `u`.`pass`,
-    `u`.`pass2`,
-    `u`.`repass`,
-    `u`.`notrhod`,
-    `u`.`emailconfirmation`,
-    `u`.`securetime`,
-    `u`.`sys`,
-    `u`.`palpro`,
-    `u`.`online`,
-    `u`.`ip`,
-    `u`.`ipreg`,
-    `u`.`joinIP`,
-    `u`.`admin`,
-    `u`.`city`,
-    `u`.`room`,
-    `u`.`banned`,
-    `u`.`auth`,
-    `u`.`align`,
-    `u`.`align2`,
-    `u`.`align_lvl`,
-    `u`.`align_exp`,
-    `u`.`mod_zvanie`,
-    `u`.`clan`,
-    `u`.`nextMsg`,
-    `u`.`molch1`,
-    `u`.`molch2`,
-    `u`.`molch3`,
-    `u`.`level`,
-    `u`.`money`,
-    `u`.`money2`,
-    `u`.`money4`,
-    `u`.`money3`,
-    `u`.`money3`,
-    `u`.`battle`,
-    `u`.`cityreg`,
-    `u`.`invBlock`,
-    `u`.`allLock`,
-    `u`.`invBlockCode`,
-    `u`.`zag`,
-    `u`.`a1`,
-    `u`.`q1`,
-    `u`.`mail`,
-    `u`.`name`,
-    `u`.`bithday`,
-    `u`.`sex`,
-    `u`.`design`,
-    `u`.`autospell`,
-    `u`.`noplaw`,
-    `u`.`city_real`,
-    `u`.`icq`,
-    `u`.`icq_hide`,
-    `u`.`homepage`,
-    `u`.`deviz`,
-    `u`.`hobby`,
-    `u`.`chatColor`,
-    `u`.`timereg`,
-    `u`.`add_smiles`,
-    `u`.`obraz`,
-    `u`.`win`,
-    `u`.`lose`,
-    `u`.`nich`,
-    `u`.`cityreg2`,
-    `u`.`host`,
-    `u`.`info_delete`,
-    `u`.`dateEnter`,
-    `u`.`afk`,
-    `u`.`dnd`,
-    `u`.`timeMain`,
-    `u`.`clan_prava`,
-    `u`.`addpr`,
-    `u`.`marry`,
-    `u`.`city2`,
-    `u`.`invis`,
-    `u`.`bot_id`,
-    `u`.`haos`,
-    `u`.`host_reg`,
-    `u`.`inUser`,
-    `u`.`inTurnir`,
-    `u`.`inTurnirnew`,
-    `u`.`jail`,
-    `u`.`animal`,
-    `u`.`vip`,
-    `u`.`catch`,
-    `u`.`frg`,
-    `u`.`no_ip`,
-    `u`.`type_pers`,
-    `u`.`bot_room`,
-    `u`.`clan_delay`,
-    `u`.`bukmeker`,
-    `u`.`ang_g`,
-    `st`.`id`,
-    `st`.`lider`,
-    `st`.`btl_cof`,
-    `st`.`last_hp`,
-    `st`.`last_pr`,
-    `st`.`smena`,
-    `st`.`stats`,
-    `st`.`hpAll`,
-    `st`.`mpAll`,
-    `st`.`hpNow`,
-    `st`.`mpNow`,
-    `st`.`enNow`,
-    `st`.`transfers`,
-    `st`.`regHP`,
-    `st`.`regMP`,
-    `st`.`showmenu`,
-    `st`.`prmenu`,
-    `st`.`ability`,
-    `st`.`skills`,
-    `st`.`sskills`,
-    `st`.`nskills`,
-    `st`.`exp`,
-    `st`.`minHP`,
-    `st`.`minMP`,
-    `st`.`zv`,
-    `st`.`dn`,
-    `st`.`dnow`,
-    `st`.`team`,
-    `st`.`battle_yron`,
-    `st`.`battle_exp`,
-    `st`.`enemy`,
-    `st`.`last_a`,
-    `st`.`last_b`,
-    `st`.`battle_text`,
-    `st`.`upLevel`,
-    `st`.`wipe`,
-    `st`.`bagStats`,
-    `st`.`timeGo`,
-    `st`.`timeGoL`,
-    `st`.`nextAct`,
-    `st`.`active`,
-    `st`.`bot`,
-    `st`.`lastAlign`,
-    `st`.`tactic1`,
-    `st`.`tactic2`,
-    `st`.`tactic3`,
-    `st`.`tactic4`,
-    `st`.`tactic5`,
-    `st`.`tactic6`,
-    `st`.`tactic7`,
-    `st`.`x`,
-    `st`.`y`,
-    `st`.`s`,
-    `st`.`battleEnd`,
-    `st`.`priemslot`,
-    `st`.`priems`,
-    `st`.`priems_z`,
-    `st`.`bet`,
-    `st`.`clone`,
-    `st`.`atack`,
-    `st`.`bbexp`,
-    `st`.`ref_data`,
-    `st`.`res_x`,
-    `st`.`res_y`,
-    `st`.`res_s`,
-    `st`.`bn_capitalcity`,
-    `st`.`bn_demonscity`,
-    `r`.`noatack` 
-FROM 
-    `users` AS `u` 
-        LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) 
-        LEFT JOIN `room` AS `r` ON (`u`.`room` = `r`.`id`) 
-WHERE 
-    `u`.`login`="'.mysql_real_escape_string($_COOKIE['login']).'" AND 
-    `u`.`pass`="'.mysql_real_escape_string($_COOKIE['pass']).'" 
-    LIMIT 1'));
-
-		
-		if( $c['securetime'] > 0 ) {
-			if(!defined('IP')) {
-				$dip = '';
-				if (!empty($_SERVER['HTTP_CLIENT_IP']))
-					$dip = $_SERVER['HTTP_CLIENT_IP'];
-				else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
-					$dip = $_SERVER['HTTP_X_FORWARDED_FOR'];
-				$dip = $_SERVER['REMOTE_ADDR'];
-				define('IP',$dip);
-			}
-			
-			if( isset($this->info['id']) && ($this->info['ip'] != IP  || $this->info['banned'] > 0) ) {
-				if( $_SERVER['REQUEST_URI'] != '/' ) {
-					unset($this->info, $_COOKIE['login'], $_COOKIE['pass']);
-					die('<script>top.location.href="https://new-combats.com/";</script>');
-				}
-			}
-		}
-		
-		if(isset($this->info['id'])) {
-			if( $this->info['exp'] > 300000 && $this->info['twink'] > 0 ) {
-				$this->info['exp'] = 300000;
-				mysql_query('UPDATE `users` SET `exp` = '.$this->info['exp'].' WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			}
-		}
-				
-		if(isset($this->info['id']) && $this->info['inUser'])
-		{
-			$md = array($this->info['molch1'],$this->info['molch2'],$this->info['molch3'],$this->info['admin'],$this->info['nadmin'],$this->info['banned'],$this->info['activ'],$this->info['align'],$this->info['id'],$this->info['level']);
-			$this->info = mysql_fetch_array(mysql_query('SELECT 
-			`u`.`nextBonus`,`u`.`mat`,`u`.`skype`,`u`.`skype_hide`,`u`.`stopexp`,`u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`activ`,`u`.`nadmin`,`u`.`b1`,`u`.`fnq`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`,
-			`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-			 FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($this->info['inUser']).'" LIMIT 1'));
-			if($this->info['molch1'] < $md[0]) {
-				$this->info['molch1'] = $md[0];
-			}
-			if($this->info['molch2'] < $md[1]) {
-				$this->info['molch2'] = $md[1];
-			}
-			if($this->info['molch3'] < $md[2]) {
-				$this->info['molch3'] = $md[2];
-			}
-			if($this->info['admin'] < $md[3]) {
-				$this->info['admin'] = $md[3];
-			}
-			if($this->info['nadmin'] < $md[4]) {
-				$this->info['nadmin'] = $md[4];
-			}
-			if($this->info['banned'] < $md[5]) {
-				$this->info['banned'] = $md[5];
-			}
-			$this->info['activ'] = $md[6];
-			$this->info['noreal'] = 1;
-			$this->info['align_real'] = $md[7];
-			$this->info['__id'] = $md[8];
-			$this->info['__level'] = $md[9];
-		}
-		
-		if($this->info['battle'] != $_COOKIE['btl']) {
-			setcookie('btl',$this->info['battle'],time()+86400);
-		}
-				
-		//��� �������
-		/*if($this->info['banned'] == 7007001) {
-			$spm_url = mysql_fetch_array(mysql_query('SELECT * FROM `_spamer` WHERE `host` = "'.$this->info['host'].'" LIMIT 1'));
-			if(isset($spm_url['id'])) {
-				die('<meta http-equiv="refresh" content="0; URL=/banned.php?id='.$spm_url['id'].'">');
-			}else{
-				die('<meta http-equiv="refresh" content="0; URL=/banned.php?kill=1">');
-			}
-		}*/
-		
-		if(!isset($this->info['id']))
-		{
-			$this->info = mysql_fetch_array(mysql_query('SELECT 
-			`u`.`nadmin`,`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`
-			FROM `users` AS `u` WHERE `u`.`login`="'.mysql_real_escape_string($_COOKIE['login']).'" AND `u`.`pass`="'.mysql_real_escape_string($_COOKIE['pass']).'" LIMIT 1'));
-			if($this->info['dateEnter']!=$_SERVER['HTTP_USER_AGENT'])
-			{
-				unset($this->info);
-			}
-			$this->btl_txt = $this->info['battle_text'];
-			if(!isset($this->info['id']))
-			{
-				unset($this->info);
-				setcookie('login','',time()-60*60*24,'',$c['host']);
-				setcookie('pass','',time()-60*60*24,'',$c['host']);
-			}else{
-				echo 'stats is lost.';
-			}
-		}
-			
-		if(isset($this->info['id'])) {
-			if($this->info['invis'] == 1 || $this->info['invis'] > time()) {
-				$this->info['cast_login'] = '<i>���������</i>';
-			}else{
-				$this->info['cast_login'] = $this->info['login'];
-			}
-		}
-			
-		if(isset($this->info['id']) && $this->info['battle'] == 0)
-		{										
-			$sb = mysql_fetch_array(mysql_query('SELECT SUM(`money2`) FROM `bank` WHERE `uid` = "'.$this->info['id'].'" LIMIT 100'));
-			$sb = $sb[0];
-			
-			if($sb-1 > $this->info['catch']-$this->info['frg']) {
-				if($this->info['frg'] == -1) {
-					$sm = $this->testAction('`uid` = "'.$this->info['id'].'" AND `vars` = "frg" LIMIT 1',1);
-				}
-				if(!isset($sm['id']) && $this->info['frg']==-1) {
-					mysql_query('UPDATE `users` SET `catch` = "'.round($sb).'",`frg` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					$this->addAction(time(),'frg','[ '.$this->info['login'].' ] '.date('d.m.Y H:i:s').' [true] , balance: '.$sb.' / '.$this->info['catch'].' / '.$this->info['frg'].' ');
-				}else{
-					mysql_query('UPDATE `users` SET `catch` = "'.round($sb+$this->info['frg']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					if($sb-10 > $this->info['catch']-$this->info['frg']) {
-						$this->addAction(time(),'frgfalse','[ '.$this->info['login'].' ] '.date('d.m.Y H:i:s').' [false] , ['.($sb-($this->info['catch']-$this->info['frg'])).'] , balance: '.$sb.' | '.$this->info['catch'].' | '.$this->info['frg'].' ');
-					}
-				}
-			}
-			
-			if($this->info['login2']!='' && $this->info['battle']==0 && $this->info['zv']==0) {
-				mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->info['login2'] = '';	
-			}
-			
-			$this->rep = mysql_fetch_array(mysql_query('SELECT 
-			`add_slot`,`nu_sandcity`,`n_sandcity`,
-			`dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`,
-			`repdevilscity`,`repmooncity`,`repsuncity`,`repsandcity`,`repemeraldscity`,`repdreamscity`,`repizlom`,
-			`n_capitalcity`,`n_demonscity`,`n_suncity`,`nu_demonscity`,`nu_angelscity`,`nu_abandonedplain`,
-			`nu_capitalcity`,`nu_suncity`,`nu_devilscity`,`nu_dreamscity`,`add_stats`,`add_money`,`add_skills`,`add_skills2`,
-			`rep3`,`rep3_buy`,`repdragonscity`,`n_dragonscity`,`nu_dragonscity`,
-			(`repcapitalcity`+`repdemonscity`+`repangelscity`+`repsuncity`+`repdreamscity`+`repabandonedplain`+`repsandcity`+`repemeraldscity`) as allrep, 
-			(`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`+`nu_emeraldscity`) as allnurep
-			FROM `rep` WHERE `id` = "'.$this->info['id'].'" LIMIT 1'));
-			 
-			
-			if(!isset($this->rep['id'])){
-				mysql_query('INSERT INTO `rep` (`id`) VALUES ('.$this->info['id'].')');
-			}
-			if($this->info['login2'] != '' && $this->info['zv'] == 0 && $this->info['battle'] == 0) {
-				$this->info['login2'] = '';
-				mysql_query('UPDATE `users` SET `login2` = "" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			}
-			/* ��������� �����������  */
-			/*$i = $this->testAction('`time` >= "'.(time()-7129).'" AND `vars` = "reclama1" LIMIT 1',1);
-			if(!isset($i['id']))
-			{				
-				$this->addAction(time(),'reclama1','');				
-				//��������� � ���
-				$t6 = array('','');
-				if(date('N') == 1) {
-					//�����������
-					$t6[0] = '� �����';
-				}elseif(date('N') == 2) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 3) {
-					//�����
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �������';
-					}
-				}elseif(date('N') == 4) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 5) {
-					//�������
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �����������';
-					}
-				}elseif(date('N') == 6) {
-					//�������
-					$t6[0] = '������';
-				}elseif(date('N') == 7) {
-					//�����������
-					if(date('H')<20) {
-						$t6[0] = '�������';
-					}else{
-						$t6[0] = '� �����';
-					}
-				}
-				$r = '<font color=red><b>�����������!</b></font> ������ �� ������ ������ ��������� '.$t6[0].' (� 20:00 �� ����������� �������). ����� ��������� ���������� � ��������� <img src=https://img.new-combats.com/i/clan/PokerStars.com.gif width=24 height=15><a href=https://new-combats.com/info/1457199 target=_blank>Alexandr</a> ��� �� ����� ������� <a href=https://events.new-combats.com/?page_id=3&st=323 target=_blank>Events.new-combats.com</a>';				
-				//���������� ��������� � ���
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
-			}
-			*/
-			/*
-			//���� ������� ������������ �� �����
-			mysql_query('LOCK TABLES users,stats,chat,room,test_bot,battle WRITE');
-			$dasc = array('ASC','DESC');
-			$sp = mysql_query('SELECT `u`.`id`,`u`.`bot_room`,`s`.`atack`,`u`.`type_pers`,`s`.`bbexp`,`s`.`timeGo`,`s`.`timeGoL`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`room`,`u`.`level`,`u`.`battle`,`s`.`hpNow`,`s`.`mpNow`,`s`.`team`,`u`.`city` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`type_pers` > 0 AND `s`.`timeGo` < '.time().' AND `s`.`timeGoL` < '.time().' ORDER BY `s`.`timeGoL` '.$dasc[rand(0,1)].' LIMIT 11');
-			while($pl = mysql_fetch_array($sp)) {
-				if($pl['type_pers']>0 && $pl['battle'] == 0) {
-					//��� ������������
-					if($pl['timeGo']<time()) {
-						$rm = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `id` = "'.$pl['room'].'" LIMIT 1'));
-						$rmgo = explode(',',$rm['roomGo']);
-						$rmgo = $rmgo[rand(0,count($rmgo)-1)];
-						$rmgo = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `id` = "'.$rmgo.'" AND `botgo` > 0 AND `close` = 0 AND `destroy` = 0 LIMIT 1'));
-						if(isset($rmgo['id'])) {
-							$pl['room'] = $rmgo['id'];
-							mysql_query('UPDATE `users` SET `room` = "'.$rmgo['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							mysql_query('UPDATE `stats` SET `timeGo` = "'.(time()+rand(60,240)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-					}
-				}
-				if($pl['type_pers']>1 && $pl['battle'] == 0 && $pl['timeGoL']<time()) {
-					//��� �������
-					$ru = array();
-					$rs = array();
-					$spu = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-10).'" AND `u`.`banned` = "0" LIMIT 5');
-					while($plu = mysql_fetch_array($spu)) {
-						if($plu['battle'] == 0) {
-							$ru[count($ru)] = $plu['id'];
-							$rs[$plu['id']] = $plu;
-						}
-					}
-					$ru = $ru[rand(0,count($ru)-1)];
-					if($ru > 0 && rand(0,10000) < 2500) {
-						//�������� �� �����
-						if($pl['timeGoL'] < time()) {
-							//��������
-							$atc = $magic->atackUser($pl['id'],$ru,$rs[$ru]['team'],$rs[$ru]['battle'],$pl['bbexp']);
-							if($atc == 1) {
-								$rs[$ru] = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`battle`,`s`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`room` = "'.$pl['room'].'" AND `u`.`city` = "'.$pl['city'].'" AND `u`.`type_pers` = 0 AND `s`.`bot` = 0 AND `u`.`id` != "'.$pl['id'].'" AND `u`.`level` > 6 AND `u`.`online` > "'.(time()-60).'" AND `u`.`banned` = "0" AND `u`.`id` = "'.$rs[$ru]['id'].'" LIMIT 1'));
-								$pl['battle'] = $rs[$ru]['battle'];
-								if($rs[$ru]['team'] == 1) {
-									$pl['team'] = 2;
-								}else{
-									$pl['team'] = 1;
-								}
-								mysql_query('UPDATE `users` SET `battle` = "'.$pl['battle'].'",`team` = "'.$pl['team'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <b>".$pl['login']."</b> �������� ��������� �� <b>".$rs[$ru]['login']."</b>...','".time()."','6','0')");
-								$sx = '';
-								if($pl['sex'] == 1) {
-									$sx = '�';
-								}
-								$rtxt = '[img[items/pal_button8.gif]] &quot;<small><font color=grey>!</font></small>'.$pl['login'].'&quot; �����������'.$sx.' ����� ��������� �� ��������� &quot;'.$rs[$ru]['login'].'&quot;.';
-								mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`,`new`) VALUES ('".$pl['city']."','','','','".$rtxt."','".time()."','7','0','1','1')");	
-							}else{
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <b>".$pl['login']."</b> �������� �� ������� ��������� �� <b>".$rs[$ru]['login']."</b>...','".time()."','6','0')");
-							}
-						}else{
-							//�������������
-							mysql_query('UPDATE `stats` SET `timeGoL` = "'.(time()+rand(30,520)).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-					}
-				}
-				
-				if($pl['type_pers']>2) {
-					if($pl['battle'] > 0) {
-						//��� � ��������
-						$btlu = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle` WHERE `time_over` = 0 AND `id` = "'.$pl['battle'].'" LIMIT 1'));
-						if(!isset($btlu['id'])) {
-							//�������� ��������
-							mysql_query('UPDATE `users` SET `battle` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							//mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}else{
-							//�������� ������������
-							if($pl['atack'] < time()) {
-								//mysql_query('UPDATE `stats` SET `atack` = "'.(time()+123456789).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						}
-					}else{
-						//��� �� � ��������
-						if($pl['atack'] > time()) {
-							//mysql_query('UPDATE `stats` SET `atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-						
-						//��� ����������� ��
-						if($pl['hpNow'] < 1) {
-							if($pl['bot_room'] > 0) {
-								//��������� � "����� ������"
-								mysql_query('UPDATE `users` SET `room` = "'.$pl['bot_room'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								mysql_query('UPDATE `stats` SET `hpNow` = "1",`mpNow` = "1",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red><b>��������!</b></font> <b>".$pl['login']."</b> ��� �������� � ".$this->city_name[$pl['city']]."...','".time()."','6','0')");
-							}else{
-								//������ ������
-								mysql_query('UPDATE `stats` SET `hpNow` = "1000000000",`mpNow` = "1000000000",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						}elseif($pl['bot_room'] > 0 && $pl['room'] == $pl['bot_room']) {
-							$btst = $this->getStats($pl['id']);
-							if($btst['hpAll'] <= $btst['hpNow'] && $btst['mpAll'] <= $btst['mpNow']) {
-								mysql_query('UPDATE `stats` SET `hpNow` = "'.$btst['hpAll'].'",`mpNow` = "'.$btst['mpAll'].'",`team` = "0",`timeGoL` = "'.(time()+rand(60,240)).'",`atack` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								$nrm = mysql_fetch_array(mysql_query('SELECT `id` FROM `room` WHERE `name` = "����������� �������" AND `city` = "'.$pl['city'].'" LIMIT 1'));
-								mysql_query('UPDATE `users` SET `room` = "'.(0+$nrm['id']).'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$pl['city']."','0','','','<font color=red>��������!</font> <b>".$pl['login']."</b> �������� � ������� &quot;����������� �������&quot; � ".$this->city_name[$pl['city']]."...','".time()."','6','0')");
-								unset($nrm);
-							}else{
-								//��������
-								
-							}
-							unset($btst);
-						}
-					}
-				}				
-			}
-			mysql_query('UNLOCK TABLES');
-			unset($pl,$sp,$plu,$spu,$atc,$ru,$rs);
-			/*
-			$upd = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `login` = "��������" AND `online` < '.(time()-604800).' LIMIT 1'));
-			if(isset($upd['id']))
-			{
-				mysql_query('UPDATE `users` SET `online` = "'.(time()+600).'" WHERE `id` = "'.$upd['id'].'" LIMIT 1');
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red>��������!</font> <b>��������</b> �������� �� ����� Capital City! ������ ���������!','-1','5','0')");
-				unset($upd);
-			}
-			*/
-			
-			if(isset($_GET['homeworld']))
-			{
-				if($this->info['zv']==0 && $this->info['battle']==0 && $this->info['dnow']==0)
-				{
-					$hgo = $this->testHome();
-					if(!isset($hgo['id']) && $this->info['room'] != 274 && $this->info['align']!=2 && $this->info['inTurnir'] == 0)
-					{
-						$this->addAction(time(),'go_homeworld','');
-						$rmt = mysql_fetch_array(mysql_query('SELECT `id`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee` FROM `room` WHERE `name` = "����������� �������" AND `city` = "'.$this->info['city'].'" LIMIT 1'));
-						if(isset($rmt['id']))
-						{
-							//������� ��� ������ � ��
-							if( $this->room['file'] == 'bsenter' ) {
-								//������� ��� ������ � ��
-								$sp_bs = mysql_query('SELECT `id`,`bsid`,`money` FROM `bs_zv` WHERE `uid` = "'.$this->info['id'].'" AND `inBot` = "0" AND `finish` = "0"');
-								while( $pl_bs = mysql_fetch_array($sp_bs) ) {
-									mysql_query('UPDATE `bs_turnirs` SET `users` = `users` - 1 WHERE `id` = "'.$pl_bs['bsid'].'" LIMIT 1');
-								}
-								unset($sp_bs,$pl_bs);
-								mysql_query('UPDATE `bs_zv` SET `finish` = "'.time().'" WHERE `uid` = "'.$this->info['id'].'" AND `inBot` = "0" AND `finish` = "0"');
-							}
-							$this->info['room'] = $rmt['id'];
-							mysql_query('UPDATE `users` SET `room` = "'.$this->info['room'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');	
-
-						}else{
-							$this->error = '� ���� ������ ������ ������������ ������� �������';
-						}
-						unset($rmt);
-					}else{
-						$this->error = '��� ��������� ������������ ������� �������';
-					}
-					unset($hgo);
-				}
-			}
-			
-			//������� �����
-			if(isset($_GET['itmid']) && isset($_GET['addtext'])) {
-				$itm = mysql_fetch_array(mysql_query('SELECT 
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`max_text` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($_GET['itmid']).'" LIMIT 1'));
-				if(isset($itm['id'])) {
-					if($itm['max_text'] > 0 && $itm['max_text']-$itm['use_text'] > 0) {
-						$txt = $_GET['addtext'];
-						$txt = str_replace(' ','',$txt);
-						$txt = str_replace('	','',$txt);
-						if($txt != '') {						
-							$txt = substr($_GET['addtext'],0,$itm['max_text']-$itm['use_text']);
-							$sx = iconv_strlen($txt);
-							$itm['use_text'] += $sx;
-							if($itm['use_text'] > $itm['max_text']) {
-								$itm['use_text'] = $itm['max_text'];
-							}
-							
-							mysql_query('UPDATE `items_users` SET `use_text` = "'.$itm['use_text'].'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`) VALUES ("'.$itm['id'].'","'.time().'","'.$this->info['login'].'","'.mysql_real_escape_string(htmlspecialchars($txt,NULL,'cp1251')).'","'.$this->info['city'].'","'.$sx.'")');
-							$this->error = '������ ������� �����������';
-						}else{
-							$this->error = '����� ���-�� ��������...';
-						}
-					}else{
-						$this->error = '������� ��� ������ �� ��������';
-					}
-				}else{
-					$this->error = '������� ��� ������ �� ������';
-				}
-			}
-			
-			//������ ��������
-			if(isset($_POST['trnLogin'],$_GET['transfer']) && $this->info['battle']==0) {
-				if($this->info['level']<4 && $this->info['admin']==0) {
-					$this->error = '���������� �������� ����� ��������� ������ 4-�� ������';
-				} elseif($this->info['align']==2 && $this->info['admin']==0) {
-					$this->error = '�������� �� ����� ���������� �������� ������ ����������';
-				} else {
-					$t = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`login2`,`pass`,`pass2`,`emailconfirmation`,`securetime`,`sys`,`online`,`ip`,`ipreg`,`joinIP`,`admin`,`city`,`room`,`banned`,`auth`,`align`,`mod_zvanie`,`clan`,`nextMsg`,`molch1`,`molch2`,`molch3`,`level`,`money`,`battle`,`cityreg`,`invBlock`,`invBlockCode`,`zag`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`homepage`,`deviz`,`hobby`,`chatColor`,`timereg`,`add_smiles`,`obraz`,`win`,`lose`,`nich`,`cityreg2`,`host`,`info_delete`,`dateEnter`,`afk`,`dnd`,`timeMain`,`clan_prava`,`addpr`,`marry`,`city2`,`invis`,`bot_id`,`haos`,`host_reg`,`inUser`,`jail`,`animal`,`vip`,`catch`,`frg`,`no_ip`,`type_pers`,`bot_room` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_POST['trnLogin']).'" AND `city` = "'.$this->info['city'].'" LIMIT 1'));
-					if(isset($t['id']))
-					{
-					if($this->info['login']==$t['login']) {
-					$this->error = '�� �� ������ �������� ������ ����, �������� '.$this->microLogin($t['id'],1).'';
-					}elseif($t['battle']>0)
-						{
-							$this->error = '�������� ��������� � ���';
-						}elseif($t['level']<4 && $this->info['admin']==0)
-						{
-							$this->error = '�� �� ������ ���������� �������� ���������� ���� 4-�� ������';
-						}elseif($t['align']==2 && $this->info['admin']==0)
-						{
-							$this->error = '�� �� ������ ���������� �������� ���������';
-						}elseif($t['room']!=$this->info['room'])
-						{
-							$this->error = '�� ������ ��������� � ����� ������� � ����������';	
-						}else{
-							//������� ��������
-							$tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$this->info['id'].'" OR `uid2` = "'.$this->info['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'")) ORDER BY `id` DESC LIMIT 1'));
-							if(isset($tt['id']))
-							{
-								$this->error = '�� ��� ���������� � ��������';
-							}else{
-								$tt = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$t['id'].'" OR `uid2` = "'.$t['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$t['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$t['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$t['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$t['id'].'")) ORDER BY `id` DESC LIMIT 1'));
-								if(isset($tt['id']))
-								{
-									$this->error = '�������� ��� �������� ������';
-								}else{
-									$ins = mysql_query('INSERT INTO `transfers` (`uid1`,`uid2`,`city`,`room`,`time`,`text`,`start1`) VALUES ("'.$this->info['id'].'","'.$t['id'].'","'.$this->info['city'].'","'.$this->info['room'].'","'.time().'","'.mysql_real_escape_string(htmlspecialchars($_POST['textarea'],NULL,'cp1251')).'","'.time().'")');
-									if($ins)
-									{
-										$this->addAction(time(),'trasfer_'.$this->info['city'].'_'.$this->info['room'].'_'.$t['id'].'',$this->info['login']);
-									}
-								}
-							}
-						}
-					}else{
-						$this->error = '�������� �� ������ � ���� ������';	
-					}
-				}
-			}
-			
-			//�������� ��������
-			$this->tfer = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`uid1`,`uid2`,`city`,`room`,`good1`,`good2`,`cancel1`,`cancel2`,`money1`,`money2`,`start1`,`start2`,`text`,`r0`,`r1`,`r2`,`finish1`,`finish2` FROM `transfers` WHERE (`uid1` = "'.$this->info['id'].'" OR `uid2` = "'.$this->info['id'].'") AND (`cancel1` = "0" OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'") OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'")) AND (`cancel2` = "0" OR (`finish2` > 0 AND `uid2` = "'.$this->info['id'].'") OR (`finish1` > 0 AND `uid1` = "'.$this->info['id'].'")) ORDER BY `id` DESC LIMIT 1'));
-			if($this->tfer['uid1'] == $this->tfer['uid2']) {
-				$this->tfer = false;
-			}
-			if(isset($this->tfer['id']))
-			{
-				if($this->tfer['cancel1']==0 && $this->tfer['cancel2']==0)
-				{
-					if($this->tfer['uid2']==$this->info['id'] && $this->tfer['start2']==0 && isset($_GET['transfer']))
-					{
-						$this->tfer['start2'] = time();
-						mysql_query('UPDATE `transfers` SET `start2` = "'.$this->tfer['start2'].'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');	
-					}
-					if($this->tfer['uid2']==$this->info['id'] && $this->tfer['start2']==0)
-					{
-						$this->tfer = false;
-					}elseif($this->tfer['time']<time()-1800)
-					{
-						//���� �������� ������ 30 �����, �� ������
-						$upd = mysql_query('UPDATE `transfers` SET `cancel1` = "'.time().'",`cancel2` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');
-						if($upd)
-						{
-							unset($this->tfer,$upd);
-						}
-					}elseif($this->info['room']!=$this->tfer['room'] || $this->info['city']!=$this->tfer['city'] || $this->info['battle']>0)
-					{
-						$upd = mysql_query('UPDATE `transfers` SET `cancel1` = "'.time().'",`cancel2` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');
-						if($upd)
-						{
-							
-							
-							
-							
-							
-							mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "'.$this->tfer['uid1'].'" OR `uid` = "'.$this->tfer['uid2'].'") AND `inTransfer` > 0');
-							unset($this->tfer,$upd);
-						}
-					}elseif(isset($_GET['exit_transfer']))				
-					{
-						$upd = 1;
-						if($this->tfer['uid2']==$this->info['id'])
-						{
-							$upd = 2;
-						}
-						$upd = mysql_query('UPDATE `transfers` SET `cancel'.$upd.'` = "'.time().'" WHERE `id` = "'.$this->tfer['id'].'" LIMIT 1');
-						if($upd)
-						{
-							
-							$this->error = '�� ������� ���������� �� ��������.';
-							
-							
-							
-							mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "'.$this->tfer['uid1'].'" OR `uid` = "'.$this->tfer['uid2'].'") AND `inTransfer` > 0');
-							//��������� ��������� � ���
-							if($this->tfer['start2']>0)
-							{
-								
-
-
-
-							}
-							unset($this->tfer,$upd);
-						}
-					}else{
-						if($this->tfer['uid1']==$this->info['id'])
-						{
-							//�������� �������� ������� ������
-							
-						}elseif($this->tfer['uid2']==$this->info['id'])
-						{
-							//��������� �������� �� ������� ������
-							
-						}
-					}
-				}
-			}
-			
-			/*
-			�������������
-			*/
-
-			//���������� ��������� �� �������
-			$stat = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` >= '.strtotime('now 00:00:00').' AND `vars` = "statistic_today" LIMIT 1',1);
-			if(!isset($stat['id']))
-			{
-				$this->addAction(time(),'statistic_today','e='.$this->info['exp'].'|w='.$this->info['win'].'|l='.$this->info['lose'].'|n='.$this->info['nich']);
-			}
-			
-			//������� ������ ��������
-			if(isset($_GET['usec1']) && $this->info['battle']==0)
-			{
-				$cmp = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`type`,`val`,`name`,`time`,`delete` FROM `save_com` WHERE `uid` = "'.$this->info['id'].'" AND `delete` = "0" AND `id` = "'.mysql_real_escape_string($_GET['usec1']).'" LIMIT 1'));
-				if(isset($cmp['id']))
-				{
-					//������� ��� ����
-					mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$this->info['id'].'"');
-					//������� ����, ���� ��� �� �������
-					$cm = $this->lookStats($cmp['val']);
-					$i = 1;
-					while($i<=250)
-					{
-						if(isset($cm[$i]))
-						{
-							mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$this->info['id'].'" AND `inOdet` = "'.$i.'"');
-							mysql_query('UPDATE `items_users` SET `inOdet` = "'.$i.'" WHERE `id` = "'.((int)$cm[$i]).'" AND `uid` = "'.$this->info['id'].'" AND `delete` = "0" AND `inShop` = "0"');
-						}
-						$i++;
-					}
-				}
-				
-				
-				
-				
-				
-				unset($cmp,$cm);
-			}
-			
-			$this->room = mysql_fetch_array(mysql_query('SELECT `id`,`extdlg`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee`,`roomAjax` FROM `room` WHERE `id` = "'.$this->info['room'].'" LIMIT 1'));
-			
-			if(isset($_POST['bankpsw']))
-			{
-				$this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" AND `id` = "'.mysql_real_escape_string((int)$_POST['bank']).'" AND `pass` = "'.mysql_real_escape_string($_POST['bankpsw']).'"  LIMIT 1'));
-				if(isset($this->bank))
-				{
-					mysql_query('UPDATE `bank` SET `useNow` = "'.(time()+24*60*60).'" WHERE `id` = "'.$this->bank['id'].'" LIMIT 1');
-				}else{
-					$this->bank['error'] = '�������� ������ �� �����';
-				}
-			}elseif(!isset($_GET['bank_exit']))
-			{
-				$this->bank = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`block`,`create`,`pass`,`money1`,`money2`,`useNow`,`notmail` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" AND `useNow` > '.time().' ORDER BY `useNow` DESC  LIMIT 1'));
-			}
-			
-			if(isset($_GET['bank_exit']))
-			{
-				mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `uid` = "'.$this->info['id'].'" AND `useNow`!="0" LIMIT 1');
-			}
-			
-			if(!isset($_GET['obt_sel']) && $this->info['battle'] == 0 && $this->info['obraz'] != '0.gif') {
-				//��������� ������� �����
-					$this->stats = $this->getStats($this->info['id']);
-					$tr = true;
-					$o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `img` = "'.mysql_real_escape_string($this->info['obraz']).'" AND `sex` = "'.$this->info['sex'].'" AND (`login` = "" OR `login` = "'.$this->info['login'].'") LIMIT 1'));
-					$t = $this->items['tr'];
-					$x = 0;
-					$po = $this->lookStats($o['tr']);
-					if( $o['itm'] > 0 ) {
-						$o['itm'] = explode(',',$o['itm']);
-						$j = 0;
-						while( $j < count($o['itm']) ) {
-							$itm_id = $o['itm'][$j];
-							if( $itm_id > 0 ) {
-								$itm_id = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$itm_id.'" LIMIT 1'));
-								$itm_id_true = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "'.$itm_id['id'].'" AND
-								`delete` = 0 AND `inOdet` > 0 AND `inShop` = 0 AND `uid` = "'.$this->info['id'].'"
-								LIMIT 1'));
-								if(!isset($itm_id_true['id'])) {
-									$tr = false;
-								}
-							}
-							$j++;
-						}
-					}
-					while($x<count($t))	{
-						$n = $t[$x];
-						if(isset($po['tr_'.$n])) {
-							if($po['tr_'.$n] > $this->stats[$n]) {
-								$tr = false;
-							}
-						}
-						$x++;
-					}
-					if( $this->info['clan'] != $o['clan'] && $o['clan'] != 0 ) {
-						$tr = false;
-					}
-					if(!isset($o['id']) || $tr == false) {
-						if( $this->info['obraz'] == $o['img'] ) {
-							$this->info['obraz'] = '0.gif';
-							mysql_query('UPDATE `users` SET `obraz` = "'.$this->info['obraz'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						}
-					}
-
-			}
-						
-			if(isset($_GET['obr_sel']) || isset($_GET['obraz']))
-			{
-				$sm = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time` > '.(time()-86400).' AND `vars` = "sel_obraz" LIMIT 1',1);
-				if(!isset($sm['id']))
-				{
-					if(isset($_GET['obr_sel']))
-					{
-						$this->stats = $this->getStats($this->info['id']);
-						$tr = true;
-						$o = mysql_fetch_array(mysql_query('SELECT `id`,`sex`,`tr`,`img`,`login`,`level`,`admin`,`align`,`clan`,`itm` FROM `obraz` WHERE `id` = "'.((int)$_GET['obr_sel']).'" AND `sex` = "'.$this->info['sex'].'" AND (`login` = "" OR `login` = "'.$this->info['login'].'") LIMIT 1'));
-						$t = $this->items['tr'];
-						$x = 0;
-						$po = $this->lookStats($o['tr']);
-						if( $o['itm'] > 0 ) {
-							$o['itm'] = explode(',',$o['itm']);
-							$j = 0;
-							$tritm = '';
-							while( $j < count($o['itm']) ) {
-								$itm_id = $o['itm'][$j];
-								if( $itm_id > 0 ) {
-									$itm_id = mysql_fetch_array(mysql_query('SELECT `id`,`name` FROM `items_main` WHERE `id` = "'.$itm_id.'" LIMIT 1'));
-									$itm_id_true = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `item_id` = "'.$itm_id['id'].'" AND
-									`delete` = 0 AND `inOdet` > 0 AND `inShop` = 0 AND `uid` = "'.$this->info['id'].'"
-									LIMIT 1'));
-									if(!isset($itm_id_true['id'])) {
-										$tr = false;
-									}
-									if( $j > 0 ) {
-										$tritm .= ', ';
-									}
-									$tritm .= '&quot;'.$itm_id['name'].'&quot;';
-								}
-								$j++;
-							}
-							if( $tritm != '' && $tr == false ) {
-								$this->error = '���������� ��������: '.$tritm.'';
-							}
-						}
-						while($x<count($t))	{
-							$n = $t[$x];
-							if(isset($po['tr_'.$n])) {
-								if($po['tr_'.$n] > $this->stats[$n]) {
-									$tr = false;
-									$this->error = '������������ ������������� ��� ���������� ���������';
-								}
-							}
-							$x++;
-						}
-						if(isset($o['id']) && $tr == true) {
-							if( $this->info['obraz'] != $o['img'] ) {
-								mysql_query('UPDATE `users` SET `obraz` = "'.$o['img'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-								$this->addAction(time(),'sel_obraz','id='.$o['id'].'');
-								$this->info['obraz'] = $o['img'];
-							}
-						}else{
-							if( $this->info['obraz'] == $o['img'] ) {
-								$this->info['obraz'] = '0.gif';
-								mysql_query('UPDATE `users` SET `obraz` = "'.$this->info['obraz'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-							}
-						}
-					}
-				}else{
-					$this->error = '�������� ����� ����� �� ���� ������ ���� � �����, ��������� ����� '.date('d.m.Y H:i',$sm['time']+86400).'';
-					unset($_GET['obr_sel']);
-					$_GET['inv'] = 1;
-				}
-			}
-			
-			if($this->info['zv'] > 0)
-			{
-				$zv = mysql_fetch_array(mysql_query('SELECT `id` FROM `zayvki` WHERE `id` = "'.$this->info['zv'].'" AND `btl_id` = "0" AND `cancel` = "0" LIMIT 1'));
-				if(!isset($zv['id']))
-				{
-					$this->info['zv'] = 0;
-					mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');	
-				}
-			}
-			
-			if($this->info['wipe']!=0)
-			{
-				$this->wipe();
-			}else{
-				//��������� �����
-				
-			}
-						
-			$this->allActionsStart();
-
-		}elseif(isset($this->info['id'])) {
-			$this->room = mysql_fetch_array(mysql_query('SELECT `id`,`extdlg`,`lider`,`name`,`city`,`code`,`timeGO`,`file`,`level`,`align`,`clan`,`items`,`effects`,`destroy`,`close`,`roomGo`,`sex`,`FR`,`noatack`,`botgo`,`block_all`,`zvsee`,`roomAjax` FROM `room` WHERE `id` = "'.$this->info['room'].'" LIMIT 1'));
-		}
-	}
-	
-	public function allActionsStart()
-	{
-		global $magic;
-		if(isset($_GET['use_snowball']))
-		{
-			$this->stats = $this->getStats($this->info,0);
-			//�������� ������ ������ �� ��
-			if(isset($this->stats['items'][$this->stats['wp13id']]['id']) && $this->stats['items'][$this->stats['wp13id']]['item_id']==998)
-			{
-				//������� �����, ��� ��
-				if($this->room['name']!='����������� �������')
-				{
-					$this->error2 = '�������� ���� ����� ������ �� ����������� �������';
-				}else{
-					$smt = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time`>='.(time()-600).' AND `vars` = "create_snowball_cp" LIMIT 1',1);
-					if(isset($smt['id']))
-					{
-						$this->error2 = '������ ������ ��������� ������� ������������ ;)';
-					}else{
-						$smt = $this->testAction('`uid` = "'.$this->info['id'].'" AND `time`>='.strtotime('now 00:00:00').' AND `vars` = "create_snowball_cp" LIMIT 25',2);
-						$smt = $smt[0];
-						if($smt<24)
-						{
-							$this->addAction(time(),'create_snowball_cp',$this->info['city']);
-							$magic->add_eff($this->info['id'],24);
-							$this->error2 = '�������� ������ ������, �������� '.(24-$smt).' ��� �� ������� ...';
-						}else{
-							$this->error2 = '�� ��� ������� 24 ������ �� ������� ...';
-						}
-					}
-				}
-			}
-		}
-	}
-	
-	public function round2($v)
-	{
-		$v = explode('.',$v);
-		$v = doubleval($v[0].'.'.$v[1][0].''.$v[1][1]);
-		$f = explode('.',$v);
-		if(!isset($f[1]))
-		{
-			$v = $v.'.00';
-		}
-		return $v;
-	}
-	
-	public function zuby($v,$t = 0) {
-		$r = '';
-		if( $v < 0 ) {
-			$v = 0;
-		}
-		if($t == 0) {
-			$names[] = ' <img height=7 title=������&nbsp;��� src=https://img.new-combats.com/zub_low1.gif />';
-			$names[] = ' <img height=7 title=����������&nbsp;��� src=https://img.new-combats.com/zub_low2.gif />';
-			$names[] = ' <img height=7 title=�����&nbsp;��� src=https://img.new-combats.com/zub_low3.gif />';
-			$names[] = ' <img height=7 title=�������&nbsp;��� src=https://img.new-combats.com/zub_low4.gif />';
-		}else{
-			$names[] = ' <img style=vertical-align:baseline height=7 title=������&nbsp;��� src=https://img.new-combats.com/zub_low1.gif />';
-			$names[] = ' <img style=vertical-align:baseline height=7 title=����������&nbsp;��� src=https://img.new-combats.com/zub_low2.gif />';
-			$names[] = ' <img style=vertical-align:baseline height=7 title=�����&nbsp;��� src=https://img.new-combats.com/zub_low3.gif />';
-			$names[] = ' <img style=vertical-align:baseline height=7 title=�������&nbsp;��� src=https://img.new-combats.com/zub_low4.gif />';
-		}
-		$int = $v;
-		do{
-		 $mod = $int%10;
-		 $int = floor($int/10);//��� ������� $int = ($int-$mod)/10;
-		 $r = array_shift($names)."".$mod."".$r;
-		 
-		}while($int);
-	
-		$ost = explode('.',$v);
-		$ost = $ost[1];
-		if($ost == '' || $ost == 0) {
-			$ost = '00';
-		}
-		
-		$r .= '.'.$ost;
-	
-		return $r;
-	}
-	
-	public function onlineBonus()
-	{
-		/*if( $this->info['inTurnir'] == 0 ){
-			$ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-			$tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1'));
-			$m = floor(($ts['time_all']-$tf['vals'])/60);
-			$h = floor($m/60);
-				
-			if($h > 0 ) {
-				$ekr_add = round($h*0.45,2);
-				$bnks = mysql_fetch_array(mysql_query('SELECT `id`,`money2` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" ORDER BY `id` DESC LIMIT 1'));
-				if( isset($bnks['id']) ) {
-					$r .= ' �� �������� '.$ekr_add.' ���. (<small>���� �'.$bnks['id'].'</small>) �� '.$h.' �. � �������!';
-					$this->info['catch'] += $ekr_add;
-					$bnks['money2'] += $ekr_add;
-					mysql_query('UPDATE `users` SET `catch` = "'.$this->info['catch'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					mysql_query('UPDATE `bank` SET `money2` = "'.$bnks['money2'].'" WHERE `id` = "'.$bnks['id'].'" LIMIT 1');
-					if(!isset($tf['id'])) {
-						$this->addAction(time(),'online_bonus_time',$ts['time_all']);
-					}elseif($tf['vals'] < $ts['time_all']) {
-						mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1');
-					}
-					mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('2','1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','".time()."','6','0')");
-				}
-			}
-		}
-				/*$ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-				$tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1'));
-				$m = floor(($ts['time_all']-$tf['vals'])/60);
-				$h = floor($m/60);
-			
-				if($m > 0)
-				{
-					$this->stats = $this->getStats($this->info,0);
-					$r = '';
-					if(!isset($tf['id']))
-					{
-						$this->addAction(time(),'online_bonus_time',$ts['time_all']);
-					}elseif($tf['vals'] < $ts['time_all'])
-					{
-						mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1');
-					}
-					
-					//������ $m ��. ��������� ������� �� ������
-					if($m > 0) {
-						$hrg = 1;
-						//$this->addItem(2130,$this->info['id'],'noodet=1|noremont=1');
-						$this->stats['enNow'] = $this->info['enNow'];
-						$enreg = round($m*(@$this->stats['enAll']/(60*$hrg)),7);
-						if($this->info['admin'] > 0) {
-							//
-						}
-						
-						$this->stats['enNow'] += $enreg;
-						if($this->stats['enNow'] > $this->stats['enAll']) {
-							$this->stats['enNow'] = $this->stats['enAll'];
-							$enreg = 0;
-						}
-						$this->info['enNow'] = $this->stats['enNow'];
-						mysql_query('UPDATE `stats` SET `enNow` = "'.$this->stats['enNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-					
-					/*if($this->info['id'] == 285838 || $this->info['admin'] > 0) {
-					$r .= '<b><font color=red>��������!</font></b> ������������� �������: <b>'.$enreg.'</b> ��. ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']';
-					
-					//���������� ��������� � ���
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','-1','5','0')");
-					}*/
-				//}
-			return NULL;
-	}
-	
-	   public function addAction($time,$vars,$vls,$uid = NULL)
-	   {
-		 if($uid==NULL)
-		 {
-		  $uid = $this->info['id'];
-		 }
-		 //mysql_query('LOCK TABLES actions WRITE');
-		 $ins = mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("'.$uid.'","'.$time.'","'.$this->info['city'].'","'.$this->info['room'].'","'.mysql_real_escape_string($vars).'","'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'","'.mysql_real_escape_string($vls).'")');
-		 
-		 //mysql_query('UNLOCK TABLES');
-		 if($ins)
-		 {
-		  return true;
-		 }else{
-		  return false;
-		 }	 
-	   }
-	
-	   public function testAction($filter,$tp)
-	   {
-		 //mysql_query('LOCK TABLES actions WRITE');
-		 if($tp==1)
-		 {
-		  $ins = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`,`val` FROM `actions` WHERE '.$filter.''));
-		 }elseif($tp==2){
-		  $ins = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `actions` WHERE '.$filter.''));
-		 }
-		 return $ins;
-	   }
-	
-	public function takePersInfo($whr)
-	{
-		$inf = mysql_fetch_array(mysql_query('SELECT 
-		`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`,
-		`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-		FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE '.$whr.' LIMIT 1'));
-		return $inf;
-	}
-	
-	public function addNewbot($id,$botDate,$clon,$logins_bot,$luser,$round)
-	{
-		global $c,$code;
-		if($clon!=NULL)
-		{
-			$r = false;
-			if( is_array($clon) ) { 
-				//��� ����� ����
-			}else{
-				$clon = $this->takePersInfo('`u`.`id` = "'.((int)$clon).'"');
-			}
-			if(isset($clon['id']))
-			{
-				if( !isset($clon['loclon']) ) {
-					$clon['login'] .= ' (����)';
-				}
-				//�������� ������������
-				$ins1 = mysql_query('INSERT INTO `users` (
-				`align`,
-				`login`,
-				`level`,
-				`pass`,
-				`city`,
-				`cityreg`,
-				`name`,
-				`sex`,
-				`deviz`,
-				`hobby`,
-				`timereg`,
-				`obraz`,
-				`bot_id`,
-				`inTurnir`
-				) VALUES (
-				"'.$clon['align'].'",
-				"'.$clon['login'].'",
-				"'.$clon['level'].'",
-				"'.md5('bot_pass_'.$clon['login'].'_').'",
-				"'.$this->info['city'].'",
-				"'.$clon['city_reg'].'",
-				"'.$clon['login'].'",
-				"'.$clon['sex'].'",
-				"",
-				"",
-				"'.$clon['time_reg'].'",
-				"'.$clon['obraz'].'",
-				"'.mysql_real_escape_string($id).'",
-				"'.$clon['inTurnir'].'"
-				)');
-				if($ins1)
-				{
-					if( $round > 0 ) {
-						//�������� ��. � ����� � �� 1 ����� = +10%
-						$statss = $this->lookStats($clon['stats']);
-						//
-						$statss['s1'] = ceil($statss['s1']*(1 + 0.1*($round)));
-						$statss['s2'] = ceil($statss['s2']*(1 + 0.1*($round)));
-						$statss['s3'] = ceil($statss['s3']*(1 + 0.1*($round)));
-						$statss['s4'] = ceil($statss['s4']*(1 + 0.1*($round)));
-						//
-						$statss['hpAll'] = ceil($statss['hpAll']*(1 + 0.1*($round)));
-						$statss['mpAll'] = ceil($statss['mpAll']*(1 + 0.1*($round)));
-						//
-						$statss['m1'] = ceil($statss['m1']*(1 + 0.1*($round)));
-						$statss['m2'] = ceil($statss['m2']*(1 + 0.1*($round)));
-						$statss['m3'] = ceil($statss['m3']*(1 + 0.1*($round)));
-						$statss['m4'] = ceil($statss['m4']*(1 + 0.1*($round)));
-						$statss['m5'] = ceil($statss['m5']*(1 + 0.1*($round)));
-						$statss['za'] = ceil($statss['za']*(1 + 0.1*($round)));
-						$statss['zm'] = ceil($statss['zm']*(1 + 0.1*($round)));
-						$clon['stats'] = $this->impStats($statss);
-						unset($statss);
-					}
-					if($luser == true && $clon['level'] < 8) {
-						//���� ������, ���� � ������
-						$statss = $this->lookStats($clon['stats']);
-						$statss['m1'] = ceil($statss['m1']*0.75);
-						$statss['m2'] = ceil($statss['m2']*0.75);
-						$statss['m3'] = ceil($statss['m3']*0.75);
-						$statss['m4'] = ceil($statss['m4']*0.75);
-						$statss['m5'] = ceil($statss['m5']*0.75);
-						$statss['za']  = ceil($statss['za']*0.25);
-						
-						//$statss['yron_min']  -= $clon['level'] * 7;
-						//$statss['yron_max']  -= $clon['level'] * 12;
-						
-						$clon['stats'] = $this->impStats($statss);
-						unset($statss);
-					}
-					$uid = mysql_insert_id();
-					//�������� �����
-					$ins2 = mysql_query('INSERT INTO `stats` (`clone`,`id`,`stats`,`hpNow`,`upLevel`,`bot`,`priems`) VALUES ("'.$clon['id'].'","'.$uid.'","'.$clon['stats'].'","1000000","'.$clon['upLevel'].'","1","'.$clon['priems'].'")');
-					if($ins2)
-					{							
-						//�������� ��������
-						$sp = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `uid` = "'.$clon['id'].'" AND `inOdet` > 0 AND `delete` = "0" LIMIT 50');
-						while($pl = mysql_fetch_array($sp))
-						{
-							$pl['data'] = str_replace('toclan','to_clan_',$pl['data']);
-							mysql_query('INSERT INTO `items_users` (`uid`,`item_id`,`data`,`inOdet`,`iznosMAX`,`kolvo`) VALUES ("'.$uid.'","'.$pl['item_id'].'","'.$pl['data'].'","'.$pl['inOdet'].'","'.$pl['iznosMAX'].'","'.$pl['kolvo'].'")');
-						}
-						//�������� �������
-						$sp = mysql_query('SELECT `id`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`timeAce`,`user_use`,`delete`,`v1`,`v2`,`img2`,`x`,`hod`,`bj`,`sleeptime`,`no_Ace`,`tr_life_user` FROM `eff_users` WHERE `uid` = "'.$clon['id'].'" AND `delete` = "0" AND `deactiveTime` < "'.time().'" AND `v1` != "priem" LIMIT 50');
-						while($pl = mysql_fetch_array($sp))
-						{
-							mysql_query('INSERT INTO `eff_users` (`uid`,`id_eff`,`data`,`name`,`overType`,`timeUse`,`x`) VALUES ("'.$uid.'","'.$pl['id_eff'].'","'.$pl['data'].'","'.$pl['name'].'","'.$pl['overType'].'","'.$pl['timeUse'].'","'.$pl['x'].'")');
-						}
-						$r = $uid;
-					}
-				}
-			}
-			return $r;
-		}else{
-			if($botDate==NULL){
-				$bot = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`stats`,`obraz`,`level`,`sex`,`name`,`deviz`,`hobby`,`type`,`itemsUse`,`priemUse`,`align`,`clan`,`align_zvanie`,`bonus`,`clan_zvanie`,`time_reg`,`city_reg`,`upLevel`,`active`,`expB`,`p_items`,`agressor`,`priems`,`priems_z`,`award` FROM `test_bot` WHERE `id` = "'.$id.'" LIMIT 1'));
-			}else{
-				$bot = $botDate;
-			}
-			if(isset($bot['id']))
-			{
-				if(isset($logins_bot[$bot['login']]))
-				{				
-					$logins_bot[$bot['login']]++;
-					$bot['login'] = $bot['login'].' ('.$logins_bot[$bot['login']].')';											
-				}else{
-					$logins_bot[$bot['login']] = 1;
-				}
-				$ret = true;
-				if($bot['time_reg']==100)
-				{
-					$bot['time_reg'] = time();
-				}
-				if($bot['city_reg']=='{thiscity}')
-				{
-					$bot['city_reg'] = $this->info['city'];
-				}
-				
-				$ins1 = mysql_query('INSERT INTO `users` (
-				`align`,
-				`login`,
-				`level`,
-				`pass`,
-				`city`,
-				`cityreg`,
-				`name`,
-				`sex`,
-				`deviz`,
-				`hobby`,
-				`timereg`,
-				`obraz`,
-				`bot_id`
-				) VALUES (
-				"'.$bot['align'].'",
-				"'.$bot['login'].'",
-				"'.$bot['level'].'",
-				"'.md5('bot_pass_'.$bot['login'].'_').'",
-				"'.$this->info['city'].'",
-				"'.$bot['city_reg'].'",
-				"'.$bot['name'].'",
-				"'.$bot['sex'].'",
-				"'.$bot['deviz'].'",
-				"'.$bot['hobby'].'",
-				"'.$bot['time_reg'].'",
-				"'.$bot['obraz'].'",
-				"'.mysql_real_escape_string($id).'"
-				)');
-				if($ins1){
-					$uid = mysql_insert_id();
-					if( $round > 0 ) {
-						//�������� ��. � ����� � �� 1 ����� = +20%
-						$statss = $this->lookStats($bot['stats']);
-						//
-						$statss['s1'] = ceil($statss['s1']*(1 + 0.10*($round)));
-						$statss['s2'] = ceil($statss['s2']*(1 + 0.10*($round)));
-						$statss['s3'] = ceil($statss['s3']*(1 + 0.10*($round)));
-						$statss['s4'] = ceil($statss['s4']*(1 + 0.10*($round)));
-						//
-						$statss['hpAll'] = ceil($statss['hpAll']*(1 + 0.10*($round)));
-						$statss['mpAll'] = ceil($statss['mpAll']*(1 + 0.10*($round)));
-						//
-						$statss['m1'] = ceil($statss['m1']*(1 + 0.10*($round)));
-						$statss['m2'] = ceil($statss['m2']*(1 + 0.10*($round)));
-						$statss['m3'] = ceil($statss['m3']*(1 + 0.10*($round)));
-						$statss['m4'] = ceil($statss['m4']*(1 + 0.10*($round)));
-						$statss['m5'] = ceil($statss['m5']*(1 + 0.10*($round)));
-						$statss['za'] = ceil($statss['za']*(1 + 0.10*($round)));
-						$statss['zm'] = ceil($statss['zm']*(1 + 0.10*($round)));
-						$bot['stats'] = $this->impStats($statss);
-						unset($statss);
-					}
-					$ins2 = mysql_query('INSERT INTO `stats` (`id`,`stats`,`hpNow`,`upLevel`,`bot`) VALUES ("'.$uid.'","'.$bot['stats'].'","1000000","'.$bot['upLevel'].'","1")');
-					if($ins2){
-						$bot['id'] = $uid;
-						$bot['logins_bot'] = $logins_bot;
-						$ret = $bot;
-						
-						//������ ��������
-						//$this->addItem($item_id,$uid);
-						$iu = explode(',',$bot['itemsUse']);
-						$i = 0;
-						$w3b = 0;
-						while($i<count($iu)) {
-							if($iu[$i]>0) {
-								$idiu = $this->addItem($iu[$i],$bot['id']);
-								$islot = mysql_fetch_array(mysql_query('SELECT `id`,`inslot` FROM `items_main` WHERE `id` = "'.$iu[$i].'" LIMIT 1'));
-								if(isset($islot['id'])) {
-									if( $islot['inslot'] == 3 ) {
-										if( $w3b == 1 ) {
-											$islot = 14;
-										}else{
-											$islot = 3;
-											$w3b = 1;
-										}
-									}else{
-										$islot = $islot['inslot'];
-									}
-								}else{
-									$islot = 2000;
-								}
-								mysql_query('UPDATE `items_users` SET `inOdet` = "'.$islot.'" WHERE `id` = "'.$idiu.'" LIMIT 1');
-							}
-							$i++;
-						}
-						
-					}else{
-						$ret = false;
-					}
-				}else{
-					$ret = false;
-				}
-				return $ret;
-			}else{
-				return false;
-			}
-		}
-	}
-	
-	/*
-	 	  * $iid ���������� id �������� � ����������� ���� ���
-	 	  * ������� �� �����.
-	 	  */
-	public function buyItem($sid,$itm,$x,$mdata = NULL,$vip = false) {
-	global $c,$code,$sid;
-	// sid 700 - 730 ����������������� �������� ��� ������ � ������ (�� ����� �� 10���)
-	$x = round((int)$x);
-	if($x<1){ $x = 1; }
-	if($x>99){ $x = 99; }
-	$i = mysql_fetch_array(mysql_query('SELECT `im`.*,`ish`.* FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`kolvo` > 0 AND `ish`.`item_id` = "'.mysql_real_escape_string($itm).'" LIMIT 1'));
-	
-	$r = '';
-	$vip = false;
-	if( $vip == true ) {
-		$test = $this->testVipItems($i['type']);
-	}
-	if( $vip == true && $test == false ) {
-		$r = '������ ������� ���������� VIP ���������, ����������� ����� ������� �������';
-	}elseif($this->info['allLock'] > time()) {
-		$r = '��� ��������� ��������� ������� �� '.date('d.m.y H:i',$this->info['allLock']).'';
-	}elseif(isset($i['id'])){
-		if($i['price_4'] <= 0) {
-			$i['price_4'] = $i['price3'];
-		}
-		if($i['price_4'] > 0) {
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($x<1){
-				$x = 1;
-			}
-			$price = $i['price_4']*$x;
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!=''){
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)){
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`price4`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])){
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`4price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $row){
-					if( $this->rep[$row[0]] >= $row[1] ){
-						$need_rep++;
-					}
-				}
-			} else $need_rep = 0;
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-			
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( $need_rep > 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_4']*$x > ($this->rep['rep3']-$this->rep['rep3_buy'])){
-				$r = '� ��� ������������ ��������� (�� ������� '.($price-($this->rep['rep3']-$this->rep['rep3_buy'])).' ���������.)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				$this->rep['rep3_buy'] += $price;
-				$upd = mysql_query('UPDATE `rep` SET `rep3_buy` = "'.mysql_real_escape_string($this->rep['rep3_buy']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type']!=71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-								"1",
-								"1",
-								"'.$i['overType'].'",
-								"'.$i['item_id'].'",
-								"'.$this->info['id'].'",
-								"'.str_replace('sudba=0','',$data).'|sudba='.$this->info['login'].'|icos=WL|fromshop='.$sid.'",
-								"'.$i['iznosMAXi'].'",
-								"'.$i['geniration'].'",
-								"'.$i['magic_inc'].'",
-								"'.$this->info['city'].'",
-								"'.time().'",
-								"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-						$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ���������. '.$trnt.'<br>������� ������� �������� � ���������.';
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-						//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><b>����������� �������!</b></font> �������� <b>".$this->info['login']."</b> �������� ������� &quot;<font color=salmon><b>".$i['name']."</b></font>&quot; , ����������� � ������� ��������!','-1','5','0')");
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ���������.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ���������. <br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ���������. ',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}elseif($i['price_3'] > 0) {
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($x<1){
-				$x = 1;
-			}
-			$price = $i['price_3']*$x;
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!=''){
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)){
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`price4`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])){
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`4price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $row){
-					if( $this->rep[$row[0]] >= $row[1] ){
-						$need_rep++;
-					}
-				}
-			} else $need_rep = 0;
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( $need_rep > 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_3']*$x > $this->info['money3']){
-				$r = '� ��� ������������ ������ (�� ������� '.($price-$this->info['money3']).' $)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				$this->info['money3'] -= $price;
-				$upd = mysql_query('UPDATE `users` SET `money3` = "'.mysql_real_escape_string($this->info['money3']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type']!=71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-								"1",
-								"1",
-								"'.$i['overType'].'",
-								"'.$i['item_id'].'",
-								"'.$this->info['id'].'",
-								"'.str_replace('sudba=0','',$data).'|sudba='.$this->info['login'].'|frombax=1|fromshop='.$sid.'",
-								"'.$i['iznosMAXi'].'",
-								"'.$i['geniration'].'",
-								"'.$i['magic_inc'].'",
-								"'.$this->info['city'].'",
-								"'.time().'",
-								"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-						$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' $. '.$trnt.'<br>������� ������� �������� � ���������.';
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-						//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','0','','','<font color=red><b>����������� �������!</b></font> �������� <b>".$this->info['login']."</b> �������� ������� &quot;<font color=salmon><b>".$i['name']."</b></font>&quot; , ����������� � ������� ��������!','-1','5','0')");
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> $',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' $ <br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> $ ',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}elseif($sid==2 || $sid==777) {
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($i['price_2']<=0){
-				$i['price_2'] = $i['price2'];
-			}
-			if($i['price_1']<=0){
-				$i['price_1'] = $i['price1'];
-			}
-			if( $vip == true ) {
-				$i['price_2'] = round($i['price_2']/20,2);
-			}
-			
-			//������ � ��������������� ������� 5%
-			if( $this->stats['silver'] >= 1 ) {
-				if( $sid == 2 ) {
-					$i['price_1'] = round($i['price_1']/100*95 , 2);
-				}
-			}
-			
-			//������ � ������� ������� 5%
-			if( $this->stats['silver'] >= 5 ) {
-				if( $sid == 2 ) {
-					$i['price_2'] = round($i['price_2']/100*95 , 2);
-				}
-			}
-			
-			$price = $i['price_2']*$x;
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������';
-			}elseif($i['price_2']*$x>$this->info['money2']){
-				$r = '� ��� ������������ ����� �� ����� (�� ������� '.($price-$this->info['money2']).' ���.)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				$this->info['money2'] -= $price;
-				$upd = mysql_query('UPDATE `users` SET `money2` = "'.mysql_real_escape_string(round($this->info['money2'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					$this->info['frg'] += $price;
-					mysql_query('UPDATE `users` SET `frg` = "'.floor($this->info['frg']).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					$i['time_create'] = time();
-					if( $vip == true ) {
-						$i['time_create'] = $this->stats['slvtm'];
-						$mdata .= '|vip_sale=1|sudba='.$this->info['login'].'';
-						$data = str_replace('sudba=0','',$data);
-						$data = str_replace('sudba=1','',$data);
-					}
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type'] != 71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-											"'.($i['price_1']/2).'",
-											"'.$i['price_2'].'",
-											"'.$i['overType'].'",
-											"'.$i['item_id'].'",
-											"'.$this->info['id'].'",
-											"'.$data.'|fromshop='.$sid.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geniration'].'",
-											"'.$i['magic_inc'].'",
-											"'.$this->info['city'].'",
-											"'.time().'",
-											"'.$i['time_create'].'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ���.<br>������� ������� �������� � ���������.';
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>EkrShop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.',add items '.$gix.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ���.',time(),$this->info['city'],'EkrShop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ���.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>EkrShop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ���.',time(),$this->info['city'],'EkrShop.'.$this->info['city'].'',0,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		} elseif( ($sid >= 700 && $sid <=730 ) /*OR ( $sid >= 800 && $sid <=805 )*/ ) { // nalpva2.php �������� �������, � ���������� � ���� �����, ���� � ������.
-			if( $i['kolvo'] < $x ) $x = $i['kolvo'];
-			if( $x < 1 ) $x = 1;
-			if( $i['price_1'] <= 0 && $i['tr_items']=='' ) $i['price_1'] = $i['price1'];
-			if( $i['price_2'] <= 0 && $i['tr_items']=='' ) $i['price_2'] = $i['price2'];
-
-			$price = $i['price_1']*$x;
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!='') {
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)) {
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])) {
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation'] != '' ) { // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $row){
-					if( $this->rep[$row[0]] >= $row[1] ){
-						$need_rep++;
-					}
-				}
-			} else $need_rep = 0;
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			if($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( $need_rep > 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($i['price_1']*$x>$this->info['money4'] && $zuby == 1){
-				$r = '� ��� ������������ �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������<br>�������� ������: '.$i['max_buy'].' ��.';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_1']*$x>$this->info['money'] && $zuby == 0){
-				$r = '� ��� ������������ ����� (�� ������� '.($price-$this->info['money']).' ��.)';
-			}else{
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-				if($zuby == 0) {
-					$this->info['money'] -= $price;
-				}
-				$upd = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money'],2)).'",`money4` = "'.mysql_real_escape_string(round($this->info['money4'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-					$j=0;
-					$c_itm = 0;
-					$c_itm_data_a = array();
-					while( $j < count($detrn) ) {
-						$itm= mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0") AND `inShop` = "0" ORDER BY `inGroup` DESC LIMIT 1'));
-
-						if ( isset($itm['data']) && $itm['data'] != '' && $c_itm == 0){
-							$po = $this->lookStats($itm['data']);
-							//if(isset($po['complect'])) {
-							//	if(isset($po['complect'])) $c_itm_data_a['complect'] = $po['complect'];
-							//}
-							if(isset($po['sudba'])) {
-								if(isset($po['sudba'])) $c_itm_data_a['sudba'] = $po['sudba'];
-							}
-							if(isset($po['gravi']) && $po['gravi']!='') {
-								if(isset($po['gravi'])) $c_itm_data_a['gravi'] = $po['gravi'];
-								if(isset($po['gravic'])) $c_itm_data_a['gravic'] = $po['gravic'];
-								$c_itm++;
-							}
-							if(isset($po['imposed_id']) && $po['imposed_id']>0) {
-								if(isset($po['imposed'])) $c_itm_data_a['imposed'] = $po['imposed'];
-								if(isset($po['imposed_id'])) $c_itm_data_a['imposed_id'] = $po['imposed_id'];
-								if(isset($po['imposed_name'])) $c_itm_data_a['imposed_name'] = $po['imposed_name'];
-								if(isset($po['imposed_level'])) $c_itm_data_a['imposed_level'] = $po['imposed_level'];
-								if(isset($po['bm_a1'])) $c_itm_data_a['bm_a1'] = $po['bm_a1'];
-								$c_itm++;
-							}
-							if(isset($po['spell_id']) && $po['spell_id']>0) {
-								if(isset($po['spell'])) $c_itm_data_a['spell'] = $po['spell'];
-								if(isset($po['spell_id'])) $c_itm_data_a['spell_id'] = $po['spell_id'];
-								if(isset($po['spell_name'])) $c_itm_data_a['spell_name'] = $po['spell_name'];
-								if(isset($po['spell_lvl'])) $c_itm_data_a['spell_lvl'] = $po['spell_lvl'];
-								if(isset($po['spell_st_name'])) $c_itm_data_a['spell_st_name'] = $po['spell_st_name'];
-								if(isset($po['spell_st_val'])) $c_itm_data_a['spell_st_val'] = $po['spell_st_val'];
-								$c_itm++;
-							}
-							if(isset($po['rune_id']) && $po['rune_id']>0) {
-								if(isset($po['rune'])) $c_itm_data_a['rune'] = $po['rune'];
-								if(isset($po['rune_id'])) $c_itm_data_a['rune_id'] = $po['rune_id'];
-								if(isset($po['rune_name'])) $c_itm_data_a['rune_name'] = $po['rune_name'];
-								if(isset($po['rune_lvl'])) $c_itm_data_a['rune_lvl'] = $po['rune_lvl'];
-								$c_itm++;
-							}
-							if(isset($po['upatack_id']) && $po['upatack_id']>0) {
-								if(isset($po['upatack'])) $c_itm_data_a['upatack'] = $po['upatack'];
-								if(isset($po['upatack_id'])) $c_itm_data_a['upatack_id'] = $po['upatack_id'];
-								if(isset($po['upatack_name'])) $c_itm_data_a['upatack_name'] = $po['upatack_name'];
-								if(isset($po['upatack_lvl'])) $c_itm_data_a['upatack_lvl'] = $po['upatack_lvl'];
-								$c_itm++;
-							}
-						}
-						$j++;
-					}
-					if($c_itm>0){
-						$data = $this->lookStats($data);
-						// �����
-						if( isset($c_itm_data_a['spell_st_name']) && isset($c_itm_data_a['spell_st_val']) && $c_itm_data_a['spell_st_name'] != '' && $c_itm_data_a['spell_st_val'] != '' ){
-							$data['add_'.$c_itm_data_a['spell_st_name']] = (int)( isset($data['add_'.$c_itm_data_a['spell_st_name']]) ? (int)$data['add_'.$c_itm_data_a['spell_st_name']] : 0 ) + (int)$c_itm_data_a['spell_st_val'];
-						}
-						// ����
-						if(isset($c_itm_data_a['rune']) && $c_itm_data_a['rune'] > 0) {
-
-							$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$c_itm_data_a['rune_id'].'" LIMIT 1'));
-							$j = 0;
-							$data_r = $this->lookStats($ritm['data']);
-							while( $j < count($this->items['add']) ) {
-								if( isset($data_r['add_'.$this->items['add'][$j]]) ) {
-									$data['add_'.$this->items['add'][$j]] += $data_r['add_'.$this->items['add'][$j]];
-								}
-								$j++;
-							}
-
-						}
-
-						$data = $this->impStats($data);
-						$c_itm_data = $this->impStats($c_itm_data_a);
-						$data .= '|'.$c_itm_data;
-					}
-
-					$i['gift'] = '';
-
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type'] != 71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							//
-							$i['price_2'] = 0;
-							//
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`gift`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-											"'.$i['price_1'].'",
-											"'.$i['price_2'].'",
-											"'.$i['gift'].'",
-											"'.$i['overType'].'",
-											"'.$i['item_id'].'",
-											"'.$this->info['id'].'",
-											"'.$data.'|fromshop='.$sid.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geniration'].'",
-											"'.$i['magic_inc'].'",
-											"'.$this->info['city'].'",
-											"'.time().'",
-											"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-
-						if($zuby == 0) {
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ��. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}else{
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$this->zuby($price).'. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ��.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		} else { // ����������� ������� ��������
-			if($i['kolvo']<$x){
-				$x = $i['kolvo'];
-			}
-			if($x<1){
-				$x = 1;
-			}
-			if($i['price_1']<=0 && $i['tr_items']==''){
-				$i['price_1'] = $i['price1'];
-			}
-			if($i['price_2']<=0 && $i['tr_items']==''){
-				$i['price_2'] = $i['price2'];
-			}
-			
-			//������ � ��������������� ������� 5%
-			if( $this->stats['silver'] >= 1 ) {
-				if( $sid == 1 ) {
-					$i['price_1'] = round($i['price_1']/100*95 , 2);
-				}
-			}
-			
-			//������ � ������� ������� 5%
-			if( $this->stats['silver'] >= 5 ) {
-				if( $sid == 2 ) {
-					$i['price_2'] = round($i['price_2']/100*95 , 2);
-				}
-			}
-			
-			$price = $i['price_1']*$x;
-						
-			$trnt = ''; $detrn = array();
-			$trn = 1;
-			if($i['tr_items']!='') {
-				$tims2 = explode(',',$i['tr_items']);
-				$j = 0;
-				while($j<count($tims2)){
-					$tims = explode('=',$tims2[$j]);
-					if($tims[0]>0 && $tims[1]>0){
-						$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-						if(isset($tis['id'])){
-							$num_rows = 0;
-							$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" LIMIT '.((int)$tims[1]*$x).'');
-							while($p1l = mysql_fetch_array($s1p)){
-								$num_rows++;
-							}
-							if($num_rows < (int)$tims[1]*$x){
-								$trn = 0;
-							}else{
-								$detrn[count($detrn)] = array(0 => $tims[0], 1 => ((int)$tims[1]*$x)); //id_item
-							}
-							$trnt .= '['.$tis['name'].' (x'.$x.')]x'.$tims[1].', ';
-						}
-					}
-					$j++;
-				}
-				$trnt = rtrim($trnt,', ');
-			}
-			if( $c['noitembuy'] == true ) {
-				$trn = 1;
-			}
-
-			if( isset($i['tr_reputation']) && $i['tr_reputation']!=''){ // ��������� ��������� ��� �������
-				$need_rep = 0;
-				$tr_rep = $this->lookStats($i['tr_reputation']);
-				foreach($tr_rep as $key=>$val){
-					if( (int)$this->rep[$key] > (int)$val ){
-						$need_rep++;
-					}
-				}
-			} else unset($need_rep);
-
-			$mxby = 0;
-			if($i['max_buy'] > 0) {
-				$mxby = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `items_users` WHERE ( `delete` = "0" OR `delete` = "1000" ) AND `item_id` = "'.mysql_real_escape_string($itm).'" AND `uid` = "'.$this->info['id'].'" LIMIT '.$i['max_buy']));
-				if($mxby[0] >= $i['max_buy']) {
-					$mxby = -1;
-				}
-			}
-
-			$zuby = 0;
-			if(isset($_GET['zuby']) && $i['level'] < 8 && $c['zuby'] == true) {
-				$zuby = 1;
-			}
-
-			$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$i['id'].'" LIMIT 1'));
-			$po = $this->lookStats($d['data']);
-			
-			if( $zuby == 1 && $po['tr_lvl'] > 7 ) {
-				$r = '������ ������� ������ ���������� �� ����.';
-			}elseif(!isset($this->sid_zuby[$sid]) && $zuby == 1) {
-				$r = '������ ������� ������ ���������� �� ����.';
-			}elseif($zuby == 1 && $i['nozuby'] == 1) {
-				$r = '������ ������� ������ ���������� �� ����.';
-			}elseif($i['max_buy'] < $x && $i['max_buy'] > 0) {
-				$r = '��� ������� �������� '.$i['max_buy'].' ��.';
-			}elseif( isset($need_rep) && $need_rep == 0 ) {
-				$r = '�� �� ��������� ������ �������, �� �� �������� ��� ���� �����.';
-			}elseif($zuby == 1 && $this->info['money4'] < $i['price_1']) {
-				$r = '� ��� ������������ �����.';
-			}elseif($i['price_1']*$x>$this->info['money4'] && $zuby == 1){
-				$r = '� ��� ������������ �����.';
-			}elseif($mxby == -1) {
-				$r = '������������ ���������� ������� ��� ������� �������� ���������<br>�������� ������: '.$i['max_buy'].' ��.';
-			}elseif($trn==0 && $this->info['admin'] == 0){
-				$r = '� ��� ������������ ��������� ��������� (�� ������� '.$trnt.')';
-			}elseif($i['price_1']*$x > $this->info['money'] && $zuby == 0){
-				$r = '� ��� ������������ ����� (�� ������� '.($price-$this->info['money']).' ��.)';
-			}else{
-				if($zuby == 0) {
-					$this->info['money'] -= $price;
-				}else{
-					$this->info['money4'] -= $price;
-				}
-				$upd = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money'],2)).'",`money4` = "'.mysql_real_escape_string(round($this->info['money4'],2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($upd){
-					//����� ����
-					$data = '';
-					$data .= $d['data'];
-					$data = str_replace('sudba=1','sudba='.$this->info['login'],$data);
-
-					if($mdata!=NULL){
-						$data .= '|'.$mdata;
-					}
-
-					$i['gift'] = '';
-					if($zuby == 1) {
-						$i['gift'] = '1';
-						$data .= '|nosale=1|zazuby='.round($price/$x,2).'';
-					}
-					
-					if( $sid == 404 ) {
-						$data .= '|nosale=1|notransfer=1|fromshop=404|sudba=1';
-					}
-					
-					$ix = 1; $gix = 0;
-					while($ix<=$x){
-						if($i['type'] != 71) {
-							if( $i['iznos'] > 0 ) {
-								$i['iznosMAXi'] = $i['iznos'];
-							}
-							//
-							$i['price_2'] = 0;
-							//
-							$ins = mysql_query('INSERT INTO `items_users` (`1price`,`2price`,`gift`,`overType`,`item_id`,`uid`,`data`,`iznosMAX`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`time_create`) VALUES (
-											"'.$i['price_1'].'",
-											"'.$i['price_2'].'",
-											"'.$i['gift'].'",
-											"'.$i['overType'].'",
-											"'.$i['item_id'].'",
-											"'.$this->info['id'].'",
-											"'.$data.'|fromshop='.$sid.'",
-											"'.$i['iznosMAXi'].'",
-											"'.$i['geniration'].'",
-											"'.$i['magic_inc'].'",
-											"'.$this->info['city'].'",
-											"'.time().'",
-											"'.time().'")');
-						}else{
-							mysql_query('DELETE FROM `obraz` WHERE `uid` = "'.$this->info['id'].'" AND `sex` = "'.$i['sex'].'" AND `img` = "'.str_replace('.png','.gif',$i['img']).'" LIMIT 1');
-							$ins = mysql_query('INSERT INTO `obraz` (`sex`,`img`,`level`,`uid`,`usr_add`) VALUES ("'.$i['sex'].'","'.str_replace('.png','.gif',$i['img']).'","'.$i['level'].'","'.$this->info['id'].'","'.time().'")');
-						}
-						if($ins){
-							$gix++;
-						}
-						$ix++;
-					}
-					if($ins){
-						//���������� � ������ ���� ��� ������� �������
-						if($trnt!='' && $i['tr_items']!=''){
-							$trnt = ', '.$trnt;
-						}
-
-						if($zuby == 0) {
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$price.' ��. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}else{
-							$r = '�� ��������� ������� &quot;'.$i['name'].'&quot; (x'.$x.' / '.$gix.') �� '.$this->zuby($price).'. '.$trnt.'<br>������� ������� �������� � ���������.';
-						}
-
-						$zx = 0; $rs = 0;
-						while($zx < $x) {
-
-							if( ( $sid == 1 || $sid == 5 ) && $i['level'] >= 4 && round($price/$x) > 25 ) {
-								if($this->stats['shopSale'] == 0 && $c['nosanich'] == false) {
-									//������ ��������� ������ � ��� �������� � ������
-									$prmn = 0; //�������������� �����
-									$prmn = (1-( pow(0.5, ($price/$x/200) ) ))*100;
-									$prmn = round(20/100*$prmn);
-									if(rand(0,100) < 20+$prmn && rand(0,100) > 80-$prmn) {
-										//3143 - 3192
-										if(rand(0,100) < 20+$prmn && rand(0,100) > 80-$prmn) {
-											//�������
-											$gitm = rand(3193,3195);
-										}else{
-											$gitm = rand(3143,3192);
-										}
-										if($gitm == 3193) {
-											$gitm = 3194;
-										}
-										if($sid == 5) {
-											//����������� �������
-										}
-										$this->addItem($gitm,$this->info['id']);
-										$rs++;
-									}
-								}
-							}
-							$zx++;
-						}
-
-						if($rs > 1) {
-							if(rand(0,1) == 1) {
-								$r .= ' ������� ��� �������� � �����-�� �������. (x'.$rs.')';
-							}elseif(rand(0,1)){
-								$r .= ' ������� ��� �������� � �������� ������. (x'.$rs.')';
-							}else{
-								$r .= ' � �������� ���� ����������� �����-�� �������. (x'.$rs.')';
-							}
-						}elseif($rs > 0) {
-							if(rand(0,1) == 1) {
-								$r .= ' ������� ��� �������� � �����-�� �������.';
-							}elseif(rand(0,1)){
-								$r .= ' ������� ��� �������� � �������� ������.';
-							}else{
-								$r .= ' � �������� ���� ����������� �����-�� �������.';
-							}
-						}
-
-
-						$j = 0;
-						while($j<count($detrn)){
-							$ost = ((int)$detrn[$j][1]);
-							$s4 = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$detrn[$j][0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0" ORDER BY `inGroup` DESC LIMIT '.((int)$detrn[$j][1]).'');
-							while($itm = mysql_fetch_array($s4)){
-								//������� �������
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							$j++;
-						}
-
-
-
-
-
-						mysql_query('UPDATE `items_shop` SET `kolvo` = "'.($i['kolvo']-$x).'" WHERE `iid` = "'.$i['iid'].'" LIMIT 1');
-						$zuby_inf = '';
-						if($zuby == 1) {
-							$zuby_inf = ' <font color=red><small>(�� ����)</small></font>';
-						}
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i['name'].'</b>&quot; (x'.$x.') [#'.$i['iid'].'] �� <b>'.$price.'</b> ��.'.$zuby_inf.'',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-					}else{
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i['name'].'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ��.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=green>Shop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i['iid'].'. � �������: <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld){
-							echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-						}
-					}
-				}else{
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}
-	}else{
-		$r = '������� �� ������ �� ��������';
-	}
-	return '<div align="left">'.$r.'</div>';
-}
-	  
-	public function takeBonus() {
-			if(!isset($_GET['getb1w'])) {
-				/*$this->info['money'] += 25;
-				mysql_query('UPDATE `users` SET `money` = "'.$this->info['money'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				mysql_query('INSERT INTO `aaa_bonus` (`uid`,`time`) VALUES (
-					"'.$this->info['id'].'","'.(time()+1*3600).'"
-				)');
-				$this->error = '��� ��������� 25 ��.';*/
-			}else{
-				if( $_GET['getb1w'] == 3 ) {
-					$pensia1 = $this->pensia(false);
-					$pensia2 = $this->pensia(true);
-					if( $this->info['timeMain'] < time() - 15 * 60 ) {
-						$afk = 1;
-					}else{
-						$afk = 0;
-					}
-					if( $pensia2[0] == 1 ) {
-						$this->info['money'] += $pensia2[1];
-						mysql_query('UPDATE `users` SET `money` = `money` + "'.$pensia2[1].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}else{
-						$this->info['money2'] += $pensia2[1];
-						mysql_query('UPDATE `users` SET `money2` = `money2` + "'.$pensia2[1].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-					$this->error = '��� �������� ����� � ������� '.$pensia1.'! ';
-					mysql_query('INSERT INTO `aaa_bonus` (
-						`uid`,`time`,`afk`,`type`,`money`
-					) VALUES (
-						"'.$this->info['id'].'","'.(time()+1*3600).'","'.$afk.'","'.$pensia2[0].'","'.$pensia2[1].'"
-					)');
-					
-				}
-			}
-	}
-	
-	public function addDelo($tp,$uid,$txt,$tm,$ct,$frm,$mo,$mi,$vvv = false)
-	{
-		$inc = mysql_query("INSERT INTO `users_delo` (`dop`,`moneyOut`,`moneyIn`,`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('".mysql_real_escape_string($vvv)."','".mysql_real_escape_string($mo)."','".mysql_real_escape_string($mi)."','".mysql_real_escape_string($uid)."','".$_SERVER['HTTP_X_REAL_IP']."','".$ct."','".$tm."','".mysql_real_escape_string($txt)."','".mysql_real_escape_string($frm)."',".$tp.")");	
-		if($inc)
-		{
-			return true;
-		}else{
-			return false;
-		}	
-	}
-	
-	public function newAct($test){
-		$r = true;
-		if($test!=$this->info['nextAct'] && $this->info['nextAct']!='0'){
-			$r = false;
-		}else{
-			$na = md5(time().'_nextAct_'.rand(0,100));
-			$upd = mysql_query('UPDATE `stats` SET `nextAct` = "'.$na.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			if(!$upd){
-				$r = false;
-			}else{
-				$this->info['nextAct'] = $na;
-			}
-		}
-		return $r;
-	}
-
-	public function buyItemCommison($sid, $item, $iid = NULL) {
-		global $sid;
-		$sid = mysql_real_escape_string($sid);
-		$itme = mysql_real_escape_string($item);
-		$iid = mysql_real_escape_string($iid);
-		$i2 = mysql_fetch_array(mysql_query('SELECT `iu`.`uid`, `iu`.`id`, `iu`.`uid`, `iu`.`1price`, `iu`.inGroup, `iu`.`data`, `iu`.`inShop`, `iu`.`item_id`, `u`.`login` as login FROM `items_users` as `iu` LEFT JOIN `users` as `u` ON `u`.id=`iu`.uid WHERE `iu`.`id` = '.$iid.' AND `iu`.`inShop` = 30 LIMIT 1'));
-		$i1 = mysql_fetch_array(mysql_query('SELECT `name`,`price1` FROM `items_main` WHERE `id` = '.$i2['item_id'].' LIMIT 1'));
-		$price = $i2['1price'];
-		if(isset($i2['id']) && isset($iid) && $sid==1 && $i2['inShop']==30){
-			if($price>$this->info['money'])
-				$r = '� ��� ������������ ����� (�� ������� '.($price-$this->info['money']).' ��.)';
-			else{
-				$UpdMoney = mysql_query('UPDATE `users` SET `money` = "'.mysql_real_escape_string(round($this->info['money']-$price,2)).'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				if($UpdMoney) {
-					$this->info['money'] -= $price;
-					$UpMoney2 = mysql_query('UPDATE `users` SET `money` = `money` + '.$price.' WHERE `id` = '.$i2['uid'].' LIMIT 1');
-					#$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `id` = '.$iid.' and `inShop` = 30 LIMIT 1');
-					
-					$col = $this->itemsX($iid);
-					if($col > 1) {
-						$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `inGroup` = `inGroup`+1000, `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `inShop` = 30 AND `inOdet` = "0"AND `item_id`="'.$i2['item_id'].'" AND `uid`="'.$i2['uid'].'" AND `inGroup` = "'.$i2['inGroup'].'" LIMIT '.$col.'');
-					} else {
-						$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE  `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" AND `uid`="'.$i2['uid'].'" LIMIT 1');
-					}
-					//��������� ������� �������� �������� ��������� ��������
-					if($UpItems){
-						//���������� � ������ ���� ��� ������� �������
-						$r = '�� ��������� ������� &quot;'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'&quot; �� '.$price.' ��.<br>������� ������� �������� � ���������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>ComissShop.'.$this->info['city'].'</font>&quot;: �������� ������� &quot;<b>'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'</b>&quot; [item:'.$iid.'] � ������������ �������� �� <b>'.$price.'</b> ��. [��������: '.( $i2['login']!='' ? '<a href="https://new-combats.com/info/'.$i2['uid'].'" target="_blank">'.$i2['login'].'</a>' : '('.$i2['uid'].')').']',time(),$this->info['city'],'Shop.'.$this->info['city'].'',$price,0);
-						$u2s = mysql_fetch_array(mysql_query('SELECT * FROM `users` WHERE `id` = "'.$i2['uid'].'" LIMIT 1'));
-						$ld = $this->addDelo(1,$u2s['id'],'&quot;<font color=#C65F00>ComissShop.'.$this->info['city'].'</font>&quot;: ������ ������� &quot;<b>'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'</b>&quot; [item:'.$iid.'] ����� ������������ �������� �� <b>'.$price.'</b> ��. [����������: <a href="https://new-combats.com/info/'.$this->info['id'].'" target="_blank">'.$this->info['login'].'</a>]',time(),$this->info['city'],'Shop.'.$this->info['city'].'',0,$price);
-					} else {
-						//���������� � ������ ���� ��� ������� �� �������
-						$r = '��� �� ������� ���������� &quot;'.$i1['name'].( $col>1 ? ' (x'.$col.')' : '').'&quot;. ������������� �������� � &quot;'.$this->city_name[$this->info['city']].'&quot; ������ ��� '.$price.' ���.<br>�������� ���� ��������� �� ����������.';
-						$ld = $this->addDelo(1,$this->info['id'],'&quot;<font color=#C65F00>EkrShop.'.$this->info['city'].'</font>&quot;: �� ������� ���������� ������� #'.$i1['iid'].'. � �������: <b>'.$price.'</b> ��.',time(),$this->info['city'],'Shop.'.$this->info['city'].'',(int)$price,0);
-						if(!$ld) echo '<div>������, ���������� �������� ������ � /db/usersDelo/!</div>';
-					}
-				} else {
-					$r = '��� �� ������� ���������� �������...';
-				}
-			}
-		}else
-			$r = '������� �� ������ �� ��������';
-		return '<div align="left">'.$r.'</div>';
-	}
-	 	 
-	public function commisonRent($action,$iid,$price=NULL) {
-		if($action=="����� � �������" && isset($iid) && $price >0 ) {
-			$ChImtem = mysql_fetch_array(mysql_query('SELECT `id`, `item_id`, `data`, `inGroup`, `uid` FROM `items_users` WHERE `id` = '.$iid.' LIMIT 1')); 
-			$ChSudba = $this->lookStats($ChImtem['data']);
-			if(isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['sudba']==1 || isset($ChSudba['toclan'])) {
-				continue;
-			} else {
-				if( isset($ChImtem['inGroup']) AND $ChImtem['inGroup'] > 0 ) {
-					$col = $this->itemsX($ChImtem['id']);
-					if($col > 1){
-						mysql_query('UPDATE `items_users` SET `inShop` = 30, `1price` = '.$price.' WHERE `item_id`="'.$ChImtem['item_id'].'" AND `uid`="'.$ChImtem['uid'].'" AND `inGroup` = "'.$ChImtem['inGroup'].'" LIMIT '.$col.'');
-					} else {
-						mysql_query('UPDATE `items_users` SET `inShop` = 30, `1price` = '.$price.' WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" ');
-					}
-				} else {
-					mysql_query('UPDATE `items_users` set `inShop` = 30, `1price` = '.$price.' where `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			}
-		}elseif($action=="�������" && isset($iid)) {
-			$i = mysql_fetch_array(mysql_query('SELECT `im`.`price1`,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.$iid.'" AND `iu`.`inShop` = "30" AND `iu`.`delete` = "0" LIMIT 1'));
-			if( isset($i['inGroup']) AND $i['inGroup'] > 0 ){
-				$col = $this->itemsX($i['id']);
-				if($col > 1){
-					mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = '.$i['price1'].' WHERE `item_id`="'.$i['item_id'].'" AND `inShop` = "30" AND `uid`="'.$i['uid'].'" AND `inGroup` = "'.$i['inGroup'].'" LIMIT '.$col.'');
-				} else {
-					mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = '.$i['price1'].' WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$iid.'" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			} else {
-				mysql_query('UPDATE `items_users` SET `inShop` = 0, `1price` = "'.$i['price1'].'" WHERE `id` = "'.$iid.'" and `inShop` = "30" LIMIT 1');
-			}
-		}
-	}
-
-	public function bronFx($br) {
-		$r = '';
-		if( $br[0] > 0 ) {
-			$r .= $br[0]-1;
-		}else{
-			$r .= 0;
-		}
-		$r .= 'd';
-		if( $br[0] > 0 ) {
-			$r .= $br[1]-$br[0];
-		}else{
-			$r .= 0;
-		}
-		return $r;
-	}
-	 	 
-	/*public function commisionShop($sid,$preview = "full"){	 	 	 	 	 	 	 	    
-		global $c,$code,$sid;
-	 	 	 
-		switch ((int)$_GET['otdel']) {
-	 	 	 	 	 case 1:$typeOtdel = 18; break;
-	 	 	 	 	 case 2:$typeOtdel = 19; break;
-	 	 	 	 	 case 3:$typeOtdel = 20; break;
-	 	 	 	 	 case 4:$typeOtdel = 21; break;
-	 	 	 	 	 case 5:$typeOtdel = 22; break;
-	 	 	 	 	 case 6:$typeOtdel = 15; break;
-	 	 	 	 	 case 7:$typeOtdel = 12; break;
-	 	 	 	 	 case 8:$typeOtdel = 4; break;
-	 	 	 	 	 case 9:$typeOtdel = 5; break;
-	 	 	 	 	 case 10:$typeOtdel = 6; break;
-	 	 	 	 	 case 11:$typeOtdel = 1; break;
-	 	 	 	 	 case 12:$typeOtdel = 3; break;
-	 	 	 	 	 case 13:$typeOtdel = 8; break;
-	 	 	 	 	 case 14:$typeOtdel = 14; break;
-	 	 	 	 	 case 15:$typeOtdel = 13; break;
-	 	 	 	 	 case 16:$typeOtdel = 9; break;
-	 	 	 	 	 case 17:$typeOtdel = 10; break;
-	 	 	 	 	 case 18:$typeOtdel = 11; break;
-	 	 	 	 	 case 19:$typeOtdel = 29; break;
-	 	 	 	 	 case 20:$typeOtdel = 30; break;
-					case 1050:$typeOtdel = 1050; break;
-	 	 	 	 	 default :$typeOtdel = 18;
-		}
-		
-		
-		//
-		
-		if( $typeOtdel == 1050 ) {
-			//�������� �������
-			if($preview == "full") {
-				
-			}else{
-				$sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND
-					`b`.`type` != "18" AND
-					`b`.`type` != "19" AND
-					`b`.`type` != "20" AND
-					`b`.`type` != "21" AND
-					`b`.`type` != "22" AND
-					`b`.`type` != "15" AND
-					`b`.`type` != "12" AND
-					`b`.`type` != "4" AND
-					`b`.`type` != "5" AND
-					`b`.`type` != "6" AND
-					`b`.`type` != "1" AND
-					`b`.`type` != "3" AND
-					`b`.`type` != "8" AND
-					`b`.`type` != "14" AND
-					`b`.`type` != "13" AND
-					`b`.`type` != "9" AND
-					`b`.`type` != "10" AND
-					`b`.`type` != "11" AND
-					`b`.`type` != "29" AND
-					`b`.`type` != "30"
-					
-					GROUP BY `b`.`name`
-					
-					');
-			}
-		}else{
-			//����� ������ ������ ���������
-			if($preview == "full") {
-					
-			}else{
-				$sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND `b`.`type` = "'.mysql_real_escape_string($typeOtdel).'" GROUP BY `b`.`name` ORDER BY `b`.`name` DESC');
-			}
-			//
-		}
-		$cr = 'c8c8c8';
-		$i = 0;
-	 	 $steckCikl = 1;
-		while($pl = mysql_fetch_array($sp)) {
-			//
-			$is1 = '';
-			$is2 = '';
-			//
-			if($preview == "full") {
-				
-			}else{		
-				//����������� � ��������
-				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` ASC LIMIT 1'));
-				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` DESC LIMIT 1'));
-				//
-				$is2 .= '<a target="_blank" href="https://new-combats.com/item/'.$pl['item_id'].'">'.$pl['name'].'</a> &nbsp; (�����: '.$pl['massa'].')';
-				//$is2 .= '<br><b>����: '.$pvr1[0].'-'.$pvr2[0].' ��.</b> <small>(����������: 0)</small>';
-				//
-				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` ASC LIMIT 1'));
-				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` DESC LIMIT 1'));
-				//
-				//$is2 .= '<br>�������������: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).'';
-				//
-				$is1 .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';	
-				$is1 .= '<a href="?toRent=3&otdel='.round($_GET['otdel']).'&itemid='.$pl['item_id'].'">���������</a><br>';			
-			}
-			echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top">'.$is2.'</td></tr>';
-			if( $cr == 'c8c8c8' ) {
-				$cr = 'd4d4d4';
-			}else{
-				$cr = 'c8c8c8';
-			}
-			$i++;
-		}
-		//
-		if( $i == 0 ) {
-			echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
-		}
-		//
-	 	 //*   * * * * * * * * * *  
-	 }*/
-	
-	public function commisionShop($sid,$preview = "full"){
-		global $c,$code,$sid;
-		switch ((int)$_GET['otdel']){
-			case 1:$typeOtdel = 18; break;
-			case 2:$typeOtdel = 19; break;
-			case 3:$typeOtdel = 20; break;
-			case 4:$typeOtdel = 21; break;
-			case 5:$typeOtdel = 22; break;
-			case 6:$typeOtdel = 15; break;
-			case 7:$typeOtdel = 12; break;
-			case 8:$typeOtdel = 4; break;
-			case 9:$typeOtdel = 5; break;
-			case 10:$typeOtdel = 6; break;
-			case 11:$typeOtdel = 1; break;
-			case 12:$typeOtdel = 3; break;
-			case 13:$typeOtdel = 8; break;
-			case 14:$typeOtdel = 14; break;
-			case 15:$typeOtdel = 13; break;
-			case 16:$typeOtdel = 9; break;
-			case 17:$typeOtdel = 10; break;
-			case 18:$typeOtdel = 11; break;
-			case 19:$typeOtdel = 29; break;
-			case 20:$typeOtdel = 30; break;
-			case 1050:$typeOtdel = 1050; break;
-			default :$typeOtdel = 18;
-	 	}
-	 	if($typeOtdel != 1050) {
-			if($preview == "full"){
-				$cl = mysql_query('SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount
-FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`)
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" and `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" GROUP BY `items_users`.`inGroup`, `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup > 0
-UNION ALL SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount
-FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`)
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" and `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'" GROUP BY `items_users`.`uid`, `items_users`.`1price` HAVING `items_users`.inGroup = 0 
-ORDER BY `1price`ASC , inGroupCount DESC');	 	 	 	 	 	 	 	 	 
-	 	 	} else {
-				$cl = mysql_query('SELECT `items_users`.`id`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp` FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` = "'.mysql_real_escape_string($typeOtdel).'" GROUP BY `items_users`.`item_id` ORDER BY `items_main`.`id` DESC');
-			}
-		} else {
-			if($preview == "full"){
-	 	 	 	$cl = mysql_query('SELECT 
-`items_users`.`id` as id, `items_users`.`id` AS `idu`,`items_users`.`item_id` as item_id,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,
-`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,
-`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,
-`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,
-`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id` as item_id,`items_main`.`name`,
-`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,
-`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,
-`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,
-`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,
-`items_main`.`lvl_aexp` , count(`items_users`.`id`) as inGroupCount
-FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) 
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0"  AND `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'"
-AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" 
-GROUP BY `items_users`.`inGroup`, `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup > 0
-UNION ALL 
-SELECT `items_users`.`id` as id, `items_users`.`id` AS `idu`,`items_users`.`item_id` as item_id,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,
-`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,
-`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,
-`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,
-`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id` as item_id,`items_main`.`name`,
-`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,
-`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,
-`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,
-`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,
-`items_main`.`lvl_aexp`, count(`items_users`.`id`) as inGroupCount
-FROM  `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) 
-WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0"  AND `items_users`.`item_id` = "'.(INT)$_GET['itemid'].'"
-AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" 
-GROUP BY `items_users`.`uid`,`items_users`.`1price` HAVING `items_users`.inGroup = 0
-ORDER BY `1price`ASC , inGroupCount DESC');	 	 	 	 	 	 	 	 	 
-	 	 	} else {
-				$cl = mysql_query('SELECT `items_users`.`id`, `items_users`.`id` AS `idu`,`items_users`.`item_id`,`items_users`.`1price`,`items_users`.`2price`,`items_users`.`uid`,`items_users`.`use_text`,`items_users`.`data`,`items_users`.`inOdet`,`items_users`.`inShop`,`items_users`.`delete`,`items_users`.`iznosNOW`,`items_users`.`iznosMAX`,`items_users`.`gift`,`items_users`.`gtxt1`,`items_users`.`gtxt2`,`items_users`.`kolvo`,`items_users`.`geniration`,`items_users`.`magic_inc`,`items_users`.`maidin`,`items_users`.`lastUPD`,`items_users`.`timeOver`,`items_users`.`overType`,`items_users`.`secret_id`,`items_users`.`time_create`,`items_users`.`inGroup`,`items_users`.`dn_delete`,`items_users`.`inTransfer`,`items_users`.`post_delivery`,`items_users`.`lbtl_`,`items_users`.`bexp`,`items_users`.`so`,`items_users`.`blvl`,`items_main`.`id`,`items_main`.`name`,`items_main`.`img`,`items_main`.`type`,`items_main`.`inslot`,`items_main`.`2h`,`items_main`.`2too`,`items_main`.`iznosMAXi`,`items_main`.`inRazdel`,`items_main`.`price1`,`items_main`.`price2`,`items_main`.`magic_chance`,`items_main`.`info`,`items_main`.`massa`,`items_main`.`level`,`items_main`.`magic_inci`,`items_main`.`overTypei`,`items_main`.`group`,`items_main`.`group_max`,`items_main`.`geni`,`items_main`.`ts`,`items_main`.`srok`,`items_main`.`class`,`items_main`.`class_point`,`items_main`.`anti_class`,`items_main`.`anti_class_point`,`items_main`.`max_text`,`items_main`.`useInBattle`,`items_main`.`lbtl`,`items_main`.`lvl_itm`,`items_main`.`lvl_exp`,`items_main`.`lvl_aexp` FROM `items_users` LEFT JOIN `items_main` ON (`items_main`.`id` = `items_users`.`item_id`) WHERE (( `items_users`.time_create + `items_main`.srok) > unix_timestamp()  OR `items_main`.srok = "0") AND `items_users`.`delete`="0" AND `items_users`.`inOdet`="0" AND `items_users`.`inShop`="30" and `items_main`.`type` != "18" AND `items_main`.`type` != "19" AND `items_main`.`type` != "20" AND `items_main`.`type` != "21" AND `items_main`.`type` != "22" AND `items_main`.`type` != "15" AND `items_main`.`type` != "12" AND `items_main`.`type` != "4" AND `items_main`.`type` != "5" AND `items_main`.`type` != "6" AND `items_main`.`type` != "1" AND `items_main`.`type` != "3" AND `items_main`.`type` != "8" AND `items_main`.`type` != "14" AND `items_main`.`type` != "13" AND `items_main`.`type` != "9" AND `items_main`.`type` != "10" AND `items_main`.`type` != "11" AND `items_main`.`type` != "29" AND `items_main`.`type` != "30" GROUP BY `items_users`.`item_id` ORDER BY `items_main`.`id` DESC');
-			}
-		}
-		$cr = 'c8c8c8';
-		$i = 0;
-	 	$steckCikl = 1;
-		while($pl = mysql_fetch_array($cl)){
-			// ���������� ���������� ��������� � �����
-	 	 	if ( $preview == "preview" ) {
-		 	 	//$steck = mysql_fetch_array(mysql_query('SELECT COUNT(`item_id`) FROM `items_users` WHERE `item_id` = "'.$pl['item_id'].'" AND `inShop` = 30 LIMIT 1'));
-				$steck = array('--' , '--' , '--' , '--');
-			}
-			if($cr=='d4d4d4'){ $cr = 'c8c8c8'; } else { $cr = 'd4d4d4'; }
-			if( $preview == "preview" && ($steck[0]>1 && $steck[0]>$steckCikl )){
-				++$steckCikl;
-				continue;
-			} else {
-				$steckCikl = 1;
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['item_id'].'" LIMIT 1'));
-				if($steck[0]>1 && $preview == "preview") {
-					$po = $this->lookStats($d['data']);
-				} else {
-					$po = $this->lookStats($pl['data']);
-				}
-				if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27) {
-					//���� ����� +
-					if($pl['inOdet'] != 14) {
-						$po['zonb']++;
-					}
-				}
-				$is2 = '';
-				$is1 = '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				if ($preview == "full"){
-					$is1 .= '<a href="?otdel='.((int)$_GET['otdel']).'&toRent=3&itemid='.(INT)$_GET['itemid'].'&buy='.$pl[0].'&sd4='.$this->info['nextAct'].'&rnd='.$code.' " >������</a> ';	 	 	 	 	 	 	 	 
-				} elseif($preview=="preview") {
-					$is1 .= '<a href="?otdel='.((int)$_GET['otdel']).'&toRent=3&itemid='.$pl['item_id'].' " >�����������</a> ';
-				}
-				//��������
-				
-				$col = $this->itemsX($pl[0]); 
-				if($col>1 && $pl['inGroup']!=0 && $pl['inGroupCount']>1) { 
-					$pl['kolvo'] = $col;
-					$pl['name'] .= ' (x'.$col.')';
-				}
-				$is2 .= '<a href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$pl['name'].'</a> &nbsp; &nbsp;';
-				if($pl['massa']>0 && $preview == "full") {
-					$is2 .= '(�����: '.round($pl['massa'],2).')';
-					if($pl['gift']!=''){
-						$ttl = '';
-						if($pl['gift']==1){
-							$ttl = '�� �� ������ �������� ���� ������� ����-����';
-						}else{
-							$ttl = '���� ������� ������� '.$pl['gift'].'. �� �� ������� �������� ���� ������� ����-���� ���';
-						}
-						$is2 .= ' <img title="'.$ttl.'" src="https://img.new-combats.com/i/podarok.gif">';
-					}
-					if(isset($po['art'])){
-						$is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
-					}
-					if(isset($po['sudba'])){
-						if($po['sudba']=='0'){
-							$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-						}elseif($po['sudba']=='1'){
-							$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-						}else{
-							$is2 .= ' <img title="���� ������� ������ ����� ������� � '.$po['sudba'].'. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
-						}
-					}
-				}
-				//����
-				$is2 .= '<br><b>����: ';	 	 	 	 	 	 	 
-				if($steck[0]>1 && $preview == "preview") {
-						$is2 .= $steck[3].'-'.$steck[4].' ��.</b> ';
-				} else {
-					$is2 .= $pl['1price'].' ��.</b> ';
-				}
-				if($pl['pricerep']>0){
-					$is2 .= ' <small><b>('.round($pl['pricerep'],2).' ��������������)</b></small>';
-				}
-
-				//�������������
-				if($pl['iznosMAX']>0){
-					$izcol = '';
-					if(floor($pl['iznosNOW'])>=(floor($pl['iznosMAX'])-ceil($pl['iznosMAX'])/100*20)){
-						$izcol = 'brown';
-					}
-				} 
-				if ($preview == "preview") {
-					$is2 .= '<br>�������������: <font color="'.$izcol.'">'.floor($steck[1]).'/'.ceil($steck[2]).'</font>';
-				} else {
-					if($pl['iznosMAXi'] == 999999999) {
-						$is2 .= '<br>�������������: <font color="brown">�����������</font>';
-					} else {
-						$is2 .= '<br>�������������: <font color="'.$izcol.'">'.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).'</font>';
-					}
-				}
-				//���� �������� ��������
-				
-				if($po['srok'] > 0){
-					$pl['srok'] = $po['srok'];
-				}
-				if( $pl['srok'] > 0 AND $preview!="preview" ) {
-					if( $pl['time_create']+$pl['srok'] < time() ){
-						$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']).' (��������)';
-					} else {
-						$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']).' (�� '.date('d.m.Y H:i',$pl['time_create']+$pl['srok']).')';
-					}
-				}elseif( $pl['srok'] > 0 ){
-					$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']);
-				}
-				if($pl['magic_chance'] > 0) {
-					$is2 .= '<br>����������� ������������: '.min(array($pl['magic_chance'],100)).'%';
-				}
-
-				//����������������� �������� �����:
-				if((int)$pl['magic_inci'] > 0){
-					$efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1'));
-					if( isset($efi['id2']) && $efi['actionTime'] > 0 ){
-						$is2 .= '<br>����������������� ��������: '.$this->timeOut($efi['actionTime']);
-					}
-				}
-				if ($preview == "full" || $preview == "preview"){
-					//<b>��������� �����������:</b>
-					$tr = '';
-					$t = $this->items['tr'];
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($po['tr_'.$n]) && $po['tr_'.$n] != 0){
-							if($po['tr_'.$n] > $this->stats[$n]){
-								if( $n == 'rep' ) {
-									$temp = explode('::',$po['tr_'.$n]);
-									if( $this->rep['rep'.$temp[1]] < $temp[0] ) { $tr .= '<font color="red">'; $notr++; }
-									unset($temp);
-								} elseif( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-									$tr .= '<font color="red">'; $notr++;
-								}
-							}
-							$tr .= '<br>� ';
-							if( $n == 'rep' ) {
-								$temp = explode('::',$po['tr_'.$n]);
-								$tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0];
-								unset($temp);
-							}elseif( $n != 'align' ) {
-								if( $n == 'sex' ) {
-									if( $po['tr_'.$n] == 1 ) {
-										$tr .= $this->is[$n].': �������';
-									}else{
-										$tr .= $this->is[$n].': �������';
-									}
-								}else{
-									$tr .= $this->is[$n].': '.$po['tr_'.$n];
-								}
-							}else{
-								$tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]];
-							}
-							if($po['tr_'.$n] > $this->stats[$n]){
-								if( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-									$tr .= '</font>';
-								}
-							}
-						}
-						$x++;
-					}
-
-					if($tr!=''){
-						$is2 .= '<br><b>��������� �����������:</b>'.$tr;
-					}
-					//<b>��������� ��:</b>
-					$tr = ''; $t = $this->items['add'];
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($po['add_'.$n],$this->is[$n])){
-							$z = '+';
-							if($po['add_'.$n]<0){
-								$z = '';
-							}
-							$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['add_'.$n];
-						}
-						$x++;
-					}
-					//��������� �� (�����)
-					$i = 1; $bn = array(1=>'������',2=>'�������',3=>'�����',4=>'���');
-					while($i<=4){
-						if(isset($po['add_mab'.$i])){
-							if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1){
-								$z = '+';
-								if($po['add_mab'.$i]<0){
-									$z = '';
-								}
-								$tr .= '<br>� ����� '.$bn[$i].': '.$z.''.$po['add_mab'.$i];
-							}else{
-								$tr .= '<br>� ����� '.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i].' ('.$this->bronFx(array($po['add_mib'.$i],$po['add_mab'.$i])).')';
-							}
-						}
-						$i++;
-					}
-					if($tr!=''){
-						$is2 .= '<br><b>��������� ��:</b>'.$tr;
-					}
-					//<b>�������� ��������:</b>
-					$tr = ''; $t = $this->items['sv'];
-					if(isset($po['sv_yron_min'],$po['sv_yron_max'])){
-						$tr .= '<br>� ����: '.$po['sv_yron_min'].' - '.$po['sv_yron_max'];
-					}
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($po['sv_'.$n])){
-							$z = '+';
-							if($po['sv_'.$n]<0){
-								$z = '';
-							}
-							$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['sv_'.$n];
-						}
-						$x++;
-					}
-					if($pl['2too']==1){
-						$tr .= '<br>� ������ ������';
-					}
-					if($pl['2h']==1){
-						$tr .= '<br>� ��������� ������';
-					}
-					if(isset($po['zonb'])){
-						$tr .= '<br>� ���� ������������: ';
-						if($po['zonb']>0){
-							$x = 1;
-							while($x<=$po['zonb']){
-								$tr .= '+';
-								$x++;
-							}
-						}else{
-							$tr .= '�';
-						}
-					}
-
-					if($tr!=''){
-						$is2 .= '<br><b>�������� ��������:</b>'.$tr;
-					}
-
-					//�����������
-					/*$tr = '';
-					$x = 1;
-					while($x<=4){
-						if($po['tya'.$x]>0){
-							$tyc = '�������� �����';
-							if($po['tya'.$x]>6){
-								$tyc = '�����';
-							}
-							if($po['tya'.$x]>14){
-								$tyc = '����';
-							}
-							if($po['tya'.$x]>34){
-								$tyc = '���������';
-							}
-							if($po['tya'.$x]>79){
-								$tyc = '���������';
-							}
-							if($po['tya'.$x]>89){
-								$tyc = '�����';
-							}
-							if($po['tya'.$x]>=100){
-								$tyc = '������';
-							}
-							$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-						}
-						$x++;
-					}
-					$x = 1;
-					while($x<=7){
-						if($po['tym'.$x]>0){
-							$tyc = '�������� �����';
-							if($po['tym'.$x]>6){
-								$tyc = '�����';
-							}
-							if($po['tym'.$x]>14){
-								$tyc = '����';
-							}
-							if($po['tym'.$x]>34){
-								$tyc = '���������';
-							}
-							if($po['tym'.$x]>79){
-								$tyc = '���������';
-							}
-							if($po['tym'.$x]>89){
-								$tyc = '�����';
-							}
-							if($po['tym'.$x]>=100){
-								$tyc = '������';
-							}
-							$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-						}
-						$x++;
-					}
-					
-					if($tr!=''){
-						$is2 .= '<br><b>�����������:</b>'.$tr;
-					}*/
-					
-				$tr = '';
-					
-				if(isset($po['imposed']) && $po['imposed']>0) {
-					if($po['imposed_lvl'] == 0) {
-						$rnc = 'maroon';
-					}elseif($po['imposed_lvl'] == 1) {
-						$rnc = '#624542';
-					}elseif($po['imposed_lvl'] == 2) {
-						$rnc = '#77090b';
-					}elseif($po['imposed_lvl'] == 3) {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['imposed_name'] = str_replace('���� ','',$po['imposed_name']); 
-					$tr .= '<br>&bull; <font color='.$rnc.'>�������� ��������:</font> '.$po['imposed_name'].' '; 
-					unset($rnc);
-				} 
-				if($tr!='') {
-					$is2 .= '<br><b>��������� ��������:</b>';
-					$is2 .= $tr;
-				}
-					
-					if($notr==0){
-						$d[0] = 1;
-						if($pl['magic_inc']!=''){
-							$d[2] = 1;
-						}
-					}
-					if(isset($po['free_stats']) && $po['free_stats']>0){
-						$is2 .= '<br><b>������������� ������:</b>';
-						$is2 .= '&bull; ��������� �������������: '.$po['free_stats'].'';
-					}
-					if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX'])){
-						$d[0] = 0;
-						$d[2] = 0;
-					}
-					if(isset($po['complect']) || isset($po['complect2'])){
-						$is2 .= '<br><i>�������������� ����������:</i>';
-					}
-					if(isset($po['complect'])){
-						//�� ������������
-						$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-						$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY `x` ASC LIMIT 20');
-						while($plc = mysql_fetch_array($spc)){
-							$com1['name'] = $plc['name'];
-							$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-							//�������� ���������
-							$i1c = 0; $i2c = 0;
-							$i1e = $this->lookStats($plc['data']);
-							while($i1c<count($this->items['add'])){
-								if(isset($i1e[$this->items['add'][$i1c]])){
-									$i3c = $i1e[$this->items['add'][$i1c]];
-									if($i3c>0){
-										$i3c = '+'.$i3c;
-									}
-									if($i2c>0){
-										$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}else{
-										$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}
-									$com1['text'] .= '<br>';
-									$i2c++;
-								}
-								$i1c++;
-							}
-							unset($i1c,$i2c,$i3c);
-							$com1['x']++;
-						}
-						$is2 .= '<br>&bull; ����� ���������: <b>'.$com1['name'].'</b><br><small>';
-						$is2 .= $com1['text'];
-						$is2 .= '</small>';
-					}
-					if(isset($po['complect2'])){
-						//�� ������������
-						$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-						$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect2'].'" ORDER BY `x` ASC LIMIT 20');
-						while($plc = mysql_fetch_array($spc)){
-							$com1['name'] = $plc['name'];
-							$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-							//�������� ���������
-							$i1c = 0; $i2c = 0;
-							$i1e = $this->lookStats($plc['data']);
-							while($i1c<count($this->items['add'])){
-								if(isset($i1e[$this->items['add'][$i1c]])){
-									$i3c = $i1e[$this->items['add'][$i1c]];
-									if($i3c>0){
-										$i3c = '+'.$i3c;
-									}
-									if($i2c>0){
-										$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}else{
-										$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-									}
-									$com1['text'] .= '<br>';
-									$i2c++;
-								}
-								$i1c++;
-							}
-							unset($i1c,$i2c,$i3c);
-							$com1['x']++;
-						}
-						$is2 .= '<br>&bull; ����� ��������� (��������): <b>'.$com1['name'].'</b><br><small>';
-						$is2 .= $com1['text'];
-						$is2 .= '</small>';
-					}
-
-					$is2 .= '<small style="">';
-					if(isset($po['gravi'])) {
-						$is2 .= '<br>�� ����������� ������������� �������: <b>'.$po['gravi'].'</b>';
-					}
-					if($pl['info']!=''){
-						$is2 .= '<div><b>��������:</b></div><div>'.$pl['info'].'</div>';
-					}
-					if($po['info']!=''){
-						$is2 .= '<div>'.$po['info'].'</div>';	 	 	 	 	 	 	 	 	 
-					}
-					if($pl['max_text']-$pl['use_text'] > 0) {
-						$is2 .= '<div>���������� ��������: '.($pl['max_text']-$pl['use_text']).'</div>';
-					}
-					if($pl['maidin']!=''){
-					//	$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
-					}
-					if(isset($po['noremont'])){
-						$is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
-					}
-					if(isset($po['nosale'])){
-						$is2 .= '<div style="color:brown;">������� ������ �������</div>';
-					}
-					if(isset($po['nomodif'])){
-						$is2 .= '<div style="color:brown;">������� ������ ��������</div>';
-					}
-					if(isset($po['nodelete'])){
-						$is2 .= '<div style="color:brown;">������� ������ ���������</div>';
-					}
-					if(isset($po['frompisher']) && $po['frompisher']>0){
-						$is2 .= '<div style="color:brown;">������� �� ����������</div>';
-					}
-					if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) {
-						$is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
-					}
-					if(isset($po['fromlaba']) && $po['fromlaba']>0){
-						$is2 .= '<div style="color:brown;">������� �� ���������</div>';
-					}
-					if(isset($po['vip_sale']) && $po['vip_sale']>0) {
-						$is2 .= '<div style="color:brown;">������� ������ �� 10% �� ���������</div>';
-					}
-					if($pl['dn_delete']>0){
-						$is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
-					}
-					if( $this->pokol > $pl['geni'] ) {
-						$is2 .= '<div style="color:brown">������� �������</div>';
-					}
-					if(isset($po['zazuby']) && $po['zazuby']>0){
-						$is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
-					}
-					//$is2 .= '<div>������� � '.$this->city_name[$this->info['city']].'</div>';
-					$is2 .= '</small>';
-				}
-				if ($preview == "preview"){
-					$kolvoprint = "<small style=\"float:right; color:grey;\" align=\"right\">����������: <b>$steck[0]</b> ��.</small>";
-				}
-				echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top">'.$kolvoprint.$is2.'</td></tr>';
-				$i++;
-			}
-	 	}
-		if($i==0) echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
-	}
-
-	public $sid_zuby = array(
-	//�������
-		1 => 1, //���
-		9 => 1, //�������
-		8 => 1 //���
-	);
-
-	public function shopItems($sid,$plu = '')
-	{
-		global $c,$code,$sid;
-		
-		$sid_zuby = 0;
-		
-		if(isset($this->sid_zuby[$sid])) {
-			$sid_zuby = 1;
-		}
-		
-		if( $this->info['admin'] > 0 ) {
-			$ishp = mysql_fetch_array(mysql_query('SELECT * FROM `items_shop` WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" AND `kolvo` > 0 LIMIT 1'));
-			if( isset($_GET['itmup']) ) {
-				//mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']+1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']-1).'" LIMIT 1');
-				mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']-1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'"  AND `kolvo` > 0 LIMIT 1');
-			}elseif( isset($_GET['itmdown']) ) {
-				//mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']-1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']+1).'" LIMIT 1');
-				mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']+1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'"  AND `kolvo` > 0 LIMIT 1');
-			}elseif( isset($_GET['itmid']) ) {
-				//mysql_query('UPDATE `items_shop` SET `pos` = "'.mysql_real_escape_string($_GET['itmpos']).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" LIMIT 1');
-			}
-		}
-		
-		
-		
-		
-		$cl = mysql_query('SELECT
-		`ish`.`price_4`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby`
-		FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`r` = "'.mysql_real_escape_string($_GET['otdel']).'" ORDER BY `ish`.`pos` ASC');
-		
-		
-		
-		/*
-		$cl = mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby`
-		FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`r` = "'.mysql_real_escape_string($_GET['otdel']).'" ORDER BY `ish`.`pos` ASC');
-		*/
-		
-		$cr = 'c8c8c8';
-		$i = 0;
-		$jid = 0;
-		while($pl = mysql_fetch_array($cl))
-		{
-			/*if($pl['price_1']==0 && $pl['price1']>0)
-			{
-				mysql_query('UPDATE `items_shop` SET `price_1` = "'.$pl['price1'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-			}
-			if($pl['price_2']==0 && $pl['price2']>0)
-			{
-				mysql_query('UPDATE `items_shop` SET `price_2` = "'.$pl['price2'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-			}*/			
-			
-			if($pl['kolvo']>0)
-			{
-				$jid++;				
-				//if( $pl['pos'] != $jid ) {
-				//	$pl['pos'] = $jid;
-				//	mysql_query('UPDATE `items_shop` SET `pos` = "'.($jid).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.$pl['id'].'" AND `kolvo` > 0 LIMIT 1');
-				//}
-				if($cr=='d4d4d4')
-				{
-					$cr = 'c8c8c8';
-				}else{
-					$cr = 'd4d4d4';
-				}
-				if($pl['price_1']<0.01 && $pl['tr_items']=='')
-				{
-					$pl['price_1'] = $pl['price1'];
-				}
-				if($pl['price_2']<0.01 && $pl['tr_items']=='')
-				{
-					$pl['price_2'] = $pl['price2'];
-				}
-								
-				if($pl['price_1']<0){ $pl['price_1'] = 0; }
-				if($pl['price_2']<0){ $pl['price_2'] = 0; }
-				$d = mysql_fetch_array(mysql_query('SELECT `id`,`items_id`,`data` FROM `items_main_data` WHERE `items_id` = "'.$pl['id'].'" LIMIT 1'));
-				$po = $this->lookStats($d['data']);
-				
-				if( $sid == 609 ) {
-					$po['icos'] = 'WL';
-				}
-				
-				/*
-				if($pl['level']==0 && $po['tr_lvl']>0)
-				{
-					mysql_query('UPDATE `items_shop` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-					mysql_query('UPDATE `items_main` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['id'].'" LIMIT 1');
-				}*/
-				
-				if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27)
-				{
-					//���� ����� +
-					$po['zonb']++;
-				}	
-				
-				$is2 = '';
-				if($pl['type'] == 71) {
-					$is1 = '<img width="80" src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				}else{
-					$is1 = '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				}
-				if( $sid == 609 ) {
-					$is1 .= '<span id="shopPlus'.$pl['id'].'"></span><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\'??\',\' ??.\');">������</a>';
-				}else{
-					//if($this->info['money']>$pl['price'])
-					//{
-					if($sid==2 || $sid==777) {
-						$is1 .= '<span id="shopPlus'.$pl['id'].'"></span><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\''.$pl['price_2'].'\',\' ���.\');">������</a> <a href="javascript:void(0);" onClick="top.payPlus('.$pl['id'].');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="������ ��������� ���������"></a>';
-					}else{
-						$is1 .= '<span id="shopPlus'.$pl['id'].'"></span><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\''.$pl['price_1'].'\',\' ��.\');">������</a> <a href="javascript:void(0);" onClick="top.payPlus('.$pl['id'].');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="������ ��������� ���������"></a>';
-					}
-					//}
-					if( $sid == 777 && $this->stats['silver'] > 1 ) {
-						//$is1 .= '<br><a onClick="if(confirm(\'��������� VIP-�������?\')){ location.href = \'main.php?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy_vip='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'; }" href="javascript:void('.$pl['id'].');">VIP ������� ('.round($pl['price_2']/20,2).' ���.)</a> ';
-					}
-					if($pl['nozuby'] == 0) {
-						if($this->info['level'] > 0 && $this->info['level'] < 8) {
-							if($pl['level'] < 8 && $sid_zuby == 1 && $pl['nozuby'] == 0 && $c['zuby'] == true) {
-								$is1 .= '<br><a href="javascript:void('.$pl['id'].');" onClick="top.buyShopNow('.$pl['id'].',\'?'.$plu.'otdel='.((int)$_GET['otdel']).'&zuby=1&buy='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\',\''.$pl['name'].'\',\''.$pl['price_1'].'\',\' (����)\');">������ �� ����</a>';
-								/*if( $this->info['admin'] > 0 ) {
-									if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
-										mysql_query('UPDATE `items_shop` SET `nozuby` = 1 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-									}
-									$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">��������� ������� �� ����</a>)</small>';
-								}*/
-							}
-						}
-					}/*elseif( $this->info['admin'] > 0 ) {
-						if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
-							mysql_query('UPDATE `items_shop` SET `nozuby` = 0 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-						}
-						$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">��������� ������� �� ����</a>)</small>';
-					}*/
-				}
-				/*
-				if($this->info['admin'] > 0) {
-					$is1 .= '<br><br><small>�������� ��� ��������: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_class=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">����</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">����</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">���������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">���</a></small>';
-				}
-				
-				if($this->info['admin'] > 0) {
-					$is1 .= '<br><small>�������� ��� �������������: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_aclass=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">�����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ��������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� ���������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� �����������</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">��� �����</a></small>';
-					//������� �������������
-					
-				}
-				
-				if($this->info['admin']>0) {
-					if(isset($_GET['add_class']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) {
-						mysql_query('UPDATE `items_main` SET `class` = "'.mysql_real_escape_string($_GET['add_class']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1');
-						$pl['class'] = $_GET['add_class'];
-					}
-					if(isset($_GET['add_aclass']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) {
-						mysql_query('UPDATE `items_main` SET `anti_class` = "'.mysql_real_escape_string($_GET['add_aclass']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1');
-						$pl['anti_class'] = $_GET['add_aclass'];
-					}
-					
-					if($pl['class'] > 0) {
-						$clnm = array('�����������','����','������','����','�������','���������','���');
-						$is1 .= '<br><br><small>������� ��� '.$clnm[$pl['class']].'�</small>';
-						unset($clnm);
-					}
-					
-					if($pl['anti_class'] > 0) {
-						$clnm = array('�����������','����','������','����','�������','���������','���');
-						$is1 .= '<br><small>���������� ��� '.$clnm[$pl['anti_class']].'��</small>';
-						unset($clnm);
-					}
-				}
-				*/
-				//��������
-				
-				if(isset($po['tr_align']) && !isset($po['tr_align_bs'])) {
-					$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
-				} elseif(isset($po['tr_align_bs'])) {
-					if($po['tr_align_bs'] == '1') {
-					  $pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align1.75.gif >';
-					} elseif($po['tr_align_bs'] == '3') {
-					  $pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align3.01.gif >';
-					}
-				}
-				
-				if( isset($po['tr_rep']) && isset($po['tr_dungeon']) ) {
-					//$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
-				}
-				if( isset($po['renameadd']) && $po['renameadd'] != '' ) {
-					$pl['name'] .= ' (�������: '.$po['renameadd'].')';
-				}
-				if( isset($po['icos']) ) {
-					$pl['name'] = '<span class="icos_'.$po['icos'].'">'.$pl['name'].' <span><small>&nbsp;'.$po['icos'].'&nbsp;</small></span></span>';
-				}
-				$is2 .= '<a name="sit_'.$pl['id'].'" href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$pl['name'].'</a> &nbsp; &nbsp;';
-				
-				
-				if($pl['massa']>0)
-				{
-					$is2 .= '(�����: '.round($pl['massa'],2).')';
-				}
-				
-				if(isset($po['art']))
-				{
-					$is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
-				}
-				
-				if(isset($po['sudba']))
-				{
-					if($po['sudba']=='0')
-					{
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}elseif($po['sudba']=='1'){
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}else{
-						$is2 .= ' <img title="���� ������� ������ ����� ������� � '.$po['sudba'].'. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
-					}
-				}
-				
-				//����
-				if( $this->info['admin'] > 0 ) {
-					$is2 .= '<div style="float:right"> <a href="?otdel='.round($_GET['otdel']).'&itmid='.$pl['id'].'&itmup=1&rnd='.microtime().'#itmdown'.$pl['id'].'">&uarr;</a> &nbsp; '.$pl['pos'].' &nbsp; <a name="itmdown'.$pl['id'].'" id="itmdown'.$pl['id'].'" href="?rand='.microtime().'&otdel='.round($_GET['otdel']).'&itmid='.$pl['id'].'&itmdown=1#itmdown'.$pl['id'].'">&darr;</a></div>';
-				}
-				$is2 .= '<br><b>����: ';
-				if( $this->stats['silver'] >= 1 && $sid == 1 ) {
-					$is2 .= '<strike>';
-				}elseif( $this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777) ) {
-					$is2 .= '<strike>';
-				}
-				if( $sid == 609 ) {
-					if($pl['price_4'] > ($this->rep['rep3']-$this->rep['rep3_buy']))
-					{
-						$is2 .= '<font color="red">'.round($pl['price_4']).'</font>';
-					}else{
-						$is2 .= '<font color="green">'.round($pl['price_4']).'</font>';
-					}
-					
-					$is2 .= '</b> <b></b> �������������� ';
-				}elseif($pl['price_3'] > 0) {
-					if($pl['price_3']>$this->info['money3'])
-					{
-						$is2 .= '<font color="red">'.$pl['price_3'].'</font>';
-					}else{
-						$is2 .= $pl['price_3'];
-					}
-					$is2 .= ' $ </b> ';
-				}elseif($sid==2 || $sid==777)
-				{
-					$is .= '<span style="color:#f93737">';
-					if($pl['price_2']>$this->info['money2'])
-					{
-						$is2 .= '<font color="red">'.$pl['price_2'].'</font>';
-					}else{
-						$is2 .= $pl['price_2'];
-					}
-					$is2 .= ' ���.</b></span> ';
-				}else{
-					if($pl['price_1']>$this->info['money'])
-					{
-						$is2 .= '<font color="red">'.$pl['price_1'].'</font>';
-					}else{
-						$is2 .= $pl['price_1'];
-					}
-					$is2 .= ' ��.</b> ';
-				}
-				if( $this->stats['silver'] >= 1 && $sid == 1 ) {
-					$is2 .= '</strike> &nbsp; <b>';
-					if($pl['price_1']>$this->info['money'])
-					{
-						$is2 .= '<font color="red">'.round($pl['price_1']*0.95,2).'</font>';
-					}else{
-						$is2 .= round($pl['price_1']*0.95,2);
-					}
-					$is2 .= ' ��.</b> <sup><small style=color:blue; >������ -5%</small></sup>';
-				}elseif( $this->stats['silver'] >= 5 && ($sid == 2 || $sid == 777) ) {
-					$is2 .= '</strike> &nbsp; <b>';
-					if($pl['price_2']>$this->info['money2'])
-					{
-						$is2 .= '<font color="red">'.round($pl['price_2']*0.95,2).'</font>';
-					}else{
-						$is2 .= round($pl['price_2']*0.95,2);
-					}
-					$is2 .= ' ���.</b> <sup><small style=color:blue; >������ -5%</small></sup>';
-				}
-				
-				if($pl['pricerep']>0)
-				{
-					$is2 .= ' <small><b>('.round($pl['pricerep'],2).' ��������������)</b></small>';
-				}
-				
-				if($pl['kolvo'] < 100000) {
-					$is2 .= ' &nbsp; &nbsp; <small>(����������: <b>'.$pl['kolvo'].'</b>)</small>';
-				}
-				
-				if($pl['nozuby'] == 0 && $sid != 609 && $c['zuby'] == true) {
-					if($this->info['level'] > 0 && $this->info['level'] < 8) {
-						if($pl['level'] < 8 && $sid_zuby == 1) {
-							if( $this->stats['silver'] > 0 && $sid == 1 ) {
-								$is2 .= ' (<small>'.ltrim($this->zuby(round($pl['price_1']*0.95,2)),' ').'</small>)';
-							}else{
-								$is2 .= ' (<small>'.ltrim($this->zuby($pl['price_1']),' ').'</small>)';
-							}
-						}
-					}
-				}
-				
-				if($pl['tr_items']!='')
-				{
-					$ttmm = '';
-					$trn = 1;
-					$tims2 = explode(',',$pl['tr_items']);
-					$j = 0;
-					while($j<count($tims2))
-					{
-						$tims = explode('=',$tims2[$j]);
-						if($tims[0]>0 && $tims[1]>0)
-						{
-							$tis = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$tims[0].'" LIMIT 1'));
-							if(isset($tis['id']))
-							{
-								$num_rows = 0;
-								$s1p = mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "'.((int)$tims[0]).'" AND `uid` = "'.$this->info['id'].'" AND (`delete` = "0" OR `delete` = "1000") AND `inShop` = "0" AND `inOdet` = "0"');
-								while($p1l = mysql_fetch_array($s1p))
-								{
-									$num_rows++;	
-								}
-								if($num_rows < (int)$tims[1])
-								{
-									$trn = 0;	
-								}
-								$ttmm .= '[<b>'.$tis['name'].'</b>] x'.$tims[1].', ';	
-							}
-						}
-						$j++;	
-					}
-					if( $c['noitembuy'] == true ) {
-						$trn = 1;
-						$ttmm = '';
-					}
-					
-					if($ttmm!='')
-					{
-						$ttmm = '<br>������� �������: '.rtrim($ttmm,', ').' ';	
-						if($trn==0)
-						{
-							$ttmm = '<font color="red">'.$ttmm.'</font>';	
-						}
-					}
-				}
-				
-				$is2 .= $ttmm.' <br>';
-				unset($ttmm);
-				
-				
-				//�������������
-				if( $pl['iznos'] > 0 ) {
-					$pl['iznosMAXi'] = $pl['iznos'];
-				}
-				if($pl['iznosMAXi']>0)
-				{
-	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$is2 .= '�������������: <font color=brown>�����������</font > <br>';
-					}else{
-						$is2 .= '�������������: 0/'.$pl['iznosMAXi'].'<br>';
-					}
-				}
-				
-				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '�������� �������������: '.$this->timeOut($po['battleUseZd']).'<br>';
-				}
-				
-				$is2 = rtrim($is2,'<br>');
-				
-				//���� �������� ��������
-				if($po['srok'] > 0)
-				{
-					$pl['srok'] = $po['srok'];
-				}
-				if($pl['srok'] > 0)
-				{
-					$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']);
-				}
-				if($pl['magic_chance'] > 0) {
-					$is2 .= '<br>����������� ������������: '.min(array($pl['magic_chance'],100)).'%';
-				}
-				
-				//����������������� �������� �����:
-				if((int)$pl['magic_inci'] > 0)
-				{
-					$efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1'));
-					if(isset($efi['id2']) && $efi['actionTime']>0)
-					{
-						$is2 .= '<br>����������������� ��������: '.$this->timeOut($efi['actionTime']);
-					}
-				}
-				
-				//<b>��������� �����������:</b>
-				$tr = ''; $t = $this->items['tr'];
-				$x = 0;
-				while($x<count($t))
-				{
-					$n = $t[$x];
-					if(isset($po['tr_'.$n]) && $po['tr_'.$n] != 0)
-					{
-						if($po['tr_'.$n] > $this->stats[$n])
-						{
-							if( $n == 'rep' ) {
-								$temp = explode('::',$po['tr_'.$n]); 
-								if( $this->rep['rep'.$temp[1]] < $temp[0] ) { $tr .= '<font color="red">'; $notr++; } 
-								unset($temp);
-							} elseif( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-								$tr .= '<font color="red">'; $notr++;
-							}
-						}
-						$tr .= '<br>� ';
-						if( $n == 'rep' ) {
-							$temp = explode('::',$po['tr_'.$n]);
-							$tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0];
-							unset($temp);
-						}elseif( $n != 'align' ) {
-							if( $n == 'sex' ) {
-								if( $po['tr_'.$n] == 1 ) {
-									$tr .= $this->is[$n].': �������';
-								}else{
-									$tr .= $this->is[$n].': �������';
-								}
-							}else{
-								$tr .= $this->is[$n].': '.$po['tr_'.$n];
-							}
-						}else{
-							$tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]];
-						}
-						if($po['tr_'.$n] > $this->stats[$n])
-						{
-							if( $n != 'align' || floor($this->info['align']) != $po['tr_'.$n] ) {
-								$tr .= '</font>';
-							}
-						}
-					}
-					$x++;
-				}
-				if($tr!='')
-				{
-					
-					$is2 .= '<br><b>��������� �����������:</b>'.$tr;
-				}
-				//<b>��������� ��:</b>
-				$tr = ''; $t = $this->items['add'];
-				$x = 0;
-				while($x<count($t))
-				{
-					$n = $t[$x];
-					if(isset($po['add_'.$n],$this->is[$n]))
-					{
-						$z = '+';
-						if($po['add_'.$n]<0)
-						{
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['add_'.$n];
-					}
-					$x++;
-				}
-				//��������� �� (�����)
-				$i = 1; $bn = array(1=>'������',2=>'�������',3=>'�����',4=>'���');
-				while($i<=4)
-				{
-					if(isset($po['add_mab'.$i]))
-					{
-						if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1)
-						{
-							$z = '+';
-							if($po['add_mab'.$i]<0)
-							{
-								$z = '';
-							}
-							$tr .= '<br>� ����� '.$bn[$i].': '.$z.''.$po['add_mab'.$i];
-						}else{
-							$tr .= '<br>� ����� '.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i];
-						}
-					}
-					$i++;
-				}
-				
-				if($tr!='')
-				{
-					$is2 .= '<br><b>��������� ��:</b>'.$tr;
-				}
-				//<b>�������� ��������:</b>
-				$tr = ''; $t = $this->items['sv'];
-				if(isset($po['sv_yron_min'],$po['sv_yron_max']))
-				{
-					$tr .= '<br>� ����: '.$po['sv_yron_min'].' - '.$po['sv_yron_max'];
-				}
-				$x = 0;
-				while($x<count($t))
-				{
-					$n = $t[$x];
-					if(isset($po['sv_'.$n]))
-					{
-						$z = '+';
-						if($po['sv_'.$n]<0)
-						{
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['sv_'.$n];
-					}
-					$x++;
-				}
-				if($pl['2too']==1)
-				{
-					$tr .= '<br>� ������ ������';
-				}
-				if($pl['2h']==1)
-				{
-					$tr .= '<br>� ��������� ������';
-				}
-				if(isset($po['zonb']))
-				{
-					$tr .= '<br>� ���� ������������: ';
-					if($po['zonb']>0)
-					{
-						$x = 1;
-						while($x<=$po['zonb'])
-						{
-							$tr .= '+';
-							$x++;
-						}
-					}else{
-						$tr .= '�';
-					}
-				}
-				if($tr!='')
-				{
-					$is2 .= '<br><b>�������� ��������:</b>'.$tr;
-				}
-				
-				//�����������
-				/*$tr = '';
-				$x = 1;
-				while($x<=4)
-				{
-					if($po['tya'.$x]>0)
-					{
-						$tyc = '�������� �����';
-						if($po['tya'.$x]>6)
-						{
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>14)
-						{
-							$tyc = '����';
-						}
-						if($po['tya'.$x]>34)
-						{
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>79)
-						{
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>89)
-						{
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>=100)
-						{
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-					}
-					$x++;
-				}
-				$x = 1;
-				while($x<=7)
-				{
-					if(@$po['tym'.$x]>0)
-					{
-						$tyc = '�������� �����';
-						if($po['tym'.$x]>6)
-						{
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>14)
-						{
-							$tyc = '����';
-						}
-						if($po['tym'.$x]>34)
-						{
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>79)
-						{
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>89)
-						{
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>=100)
-						{
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-					}
-					$x++;
-				}
-				if($tr!='')
-				{
-					$is2 .= '<br><b>�����������:</b>'.$tr;
-				}*/
-				
-				$tr = '';
-				
-				if(isset($po['imposed']) && $po['imposed']>0) {
-					if($po['imposed_lvl'] == 0) {
-						$rnc = 'maroon';
-					}elseif($po['imposed_lvl'] == 1) {
-						$rnc = '#624542';
-					}elseif($po['imposed_lvl'] == 2) {
-						$rnc = '#77090b';
-					}elseif($po['imposed_lvl'] == 3) {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['imposed_name'] = str_replace('���� ','',$po['imposed_name']); 
-					$tr .= '<br>&bull; <font color='.$rnc.'>�������� ��������:</font> '.$po['imposed_name'].' '; 
-					unset($rnc);
-				} 
-				if($tr!='') {
-					$is2 .= '<br><b>��������� ��������:</b>';
-					$is2 .= $tr;
-				}
-				
-				
-				if($notr==0)
-				{
-					$d[0] = 1;
-					if($pl['magic_inc']!='')
-					{
-						$d[2] = 1;
-					}
-				}
-				
-				if(isset($po['free_stats']) && $po['free_stats']>0)
-				{
-					$is2 .= '<br><b>������������� ������:</b><br>';
-					$is2 .= '&bull; ��������� �������������: +'.$po['free_stats'].' �������������';
-				}
-				
-				//���������� �����
-				if($pl['magic_inci']!='' || $pl['magic_inc']!='') {
-					if($pl['magic_inc'] == '') {
-						$pl['magic_inc'] = $pl['magic_inci'];
-					}
-					$mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$pl['magic_inc'].'" AND `type1` = "12345" LIMIT 1'));
-					if(isset($mgi['id2'])) {
-						$is2 .= '<div> �������� �������� <img height=18 title="'.$mgi['mname'].'" src="https://img.new-combats.com/i/eff/'.$mgi['img'].'"> '.$mgi['minfo'].'</div>';
-					}
-				}
-				
-				if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX']))
-				{
-					$d[0] = 0;
-					$d[2] = 0;
-				}
-				if(isset($po['complect']))
-				{
-					$is2 .= '<br><i>�������������� ����������:</i>';
-				}
-				if(isset($po['complect']))
-				{
-					//�� ������������
-					$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-					$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY  `x` ASC LIMIT 20');
-					while($plc = mysql_fetch_array($spc))
-					{
-						$com1['name'] = $plc['name'];
-						$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-						//�������� ���������
-						$i1c = 0; $i2c = 0;
-						$i1e = $this->lookStats($plc['data']);
-						while($i1c<count($this->items['add']))
-						{
-							if(isset($i1e[$this->items['add'][$i1c]]))
-							{
-								$i3c = $i1e[$this->items['add'][$i1c]];
-								if($i3c>0)
-								{
-									$i3c = '+'.$i3c;
-								}
-								if($i2c>0)
-								{
-									$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}else{
-									$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}								
-								$com1['text'] .= '<br>';
-								$i2c++;
-							}
-							$i1c++;
-						}
-						unset($i1c,$i2c,$i3c);
-						$com1['x']++;
-					}
-					$is2 .= '<br>&bull; ����� ���������: <b>'.$com1['name'].'</b><br><small>';
-					$is2 .= $com1['text'];
-					$is2 .= '</small>';
-				}
-				
-				if($pl['max_text']-$pl['use_text'] > 0) {
-					$is2 .= '<div>���������� ��������: '.($pl['max_text']-$pl['use_text']).'</div>';
-				}
-				
-				$is2 .= '<small style="">';
-				
-				if(isset($po['gravi'])) {
-					$is2 .= '<br>�� ����������� ������������� �������: <b>'.$po['gravi'].'</b>';
-				}
-				
-				if($pl['info']!='')
-				{
-					$is2 .= '<div><b>��������:</b></div><div>'.$pl['info'].'</div>';
-				}
-				
-				if($po['info']!='')
-				{
-					$is2 .= '<div>'.$po['info'].'</div>';
-				}
-								
-				if($pl['maidin']!='')
-				{
-				//	$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
-				}
-				
-				if(isset($po['noremont']))
-				{
-					$is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
-				}
-				
-				if(isset($po['nosale']))
-				{
-					$is2 .= '<div style="color:brown;">������� ������ �������</div>';
-				}
-				
-				if(isset($po['nomodif']))
-				{
-					$is2 .= '<div style="color:brown;">������� ������ ��������</div>';
-				}
-				
-				if(isset($po['nodelete']))
-				{
-					$is2 .= '<div style="color:brown;">������� ������ ���������</div>';
-				}
-				
-				if(isset($po['frompisher']) && $po['frompisher']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� �� ����������</div>';
-				}
-				
-				if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) {
-					$is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
-				}
-				
-				if(isset($po['fromlaba']) && $po['fromlaba']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� �� ���������</div>';
-				}
-				
-				if(isset($po['vip_sale']) && $po['vip_sale']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� ������ �� 10% �� ���������</div>';
-				}
-				
-				if($pl['dn_delete']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
-				}
-				
-				if( $this->pokol > $pl['geni'] ) {
-					$is2 .= '<div style="color:brown">������� �������</div>';
-				}	
-				
-				if(isset($po['zazuby']) && $po['zazuby']>0)
-				{
-					$is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
-				}
-				
-				//$is2 .= '<div>������� � '.$this->city_name[$this->info['city']].'</div>';
-				
-				$is2 .= '</small>';
-				
-				$crd = '';
-				
-				if($this->info['admin'] > 0) {
-					$crd = '<small><a href="javascript:window.open(\'https://new-combats.com/item_edit_data.php?edit_item_data='.$pl['id'].'\',\'winEdi1\',\'width=850,height=400,top=400,left=500,resizable=no,scrollbars=yes,status=no\');" target="_blank">������������� �������</a> &nbsp; <a href="https://new-combats.com/main.php?timeWorld='.microtime().'&otdel='.round((int)$_GET['otdel']).'#itmShop'.$pl['id'].'" name="itmShop'.$pl['id'].'">��������</a></small><br>';
-				}
-				
-				echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top"><span style="float:right">&nbsp;'.$crd.'</span>'.$is2.'</td></tr>';
-				$i++;
-			}
-			
-		}		
-		if($i==0)
-		{
-			echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">�������� �������� ����</td></tr>';
-		}
-	}
-	
-	public function price($vl)
-	{
-		if($vl==round($vl))
-		{
-			$vl = $vl.'.00';
-		}
-		$vl = explode('.',$vl);
-		$vl = $vl[0].'.<small>'.$vl[1].'</small>';
-		return $vl;
-	}
-	
-	public function testBagStats()
-	{
-		$st = $this->lookStats($this->info['stats']);
-		$n1 = $this->info['ability'];
-		$i = 1;
-		while($i<=10)
-		{
-			$n1 += $st['s'.$i];
-			$i++;
-		}
-		$n2 = $this->info['skills'];
-		$i = 1;
-		while($i<=7)
-		{
-			$n2 += $st['a'.$i]+$st['mg'.$i];
-			$i++;
-		}
-		
-		$n01 = 12;
-		$n02 = 1; $ll = 0;
-		$lvl = mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel` < "'.$this->info['upLevel'].'"');
-		while($pl = mysql_fetch_array($lvl))
-		{
-			$n01 += $pl['ability'];
-			$n02 += $pl['skills'];
-			if($ll<$pl['nextLevel'])
-			{
-				$n01 += 1; //�����
-				if($this->info['level']>=9)
-				{
-					$n01 += 1;
-				}
-				if($this->info['level']>=10)
-				{
-					$n01 += 2;
-				}
-				if($this->info['level']>=11)
-				{
-					$n01 += 4;
-				}
-				$ll++;
-			}			
-		}
-		
-		if($n1-$n01!=3 || $n2!=$n02)
-		{
-			if($this->info['bagStats']!=$bg)
-			{
-				$bg = '['.$n1.'|'.$n01.'|'.$n2.'|'.$n02.']';
-				mysql_query('UPDATE `stats` SET `bagStats` = "'.$bg.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->info['bagStats'] = $bg;
-			}
-		}else{
-			if($this->info['bagStats']!='0')
-			{
-				mysql_query('UPDATE `stats` SET `bagStats` = "0" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->info['bagStats'] = 0;
-			}
-		}
-	}
-	
-	public function wipe()
-	{
-		if($this->info['wipe']>0 && $this->info['battle']==0)
-		{
-			//wipe = 1 , ������ �������� ����� � ������
-			if($this->info['wipe']<4)
-			{
-				$st = $this->lookStats($this->info['stats']);
-				$n1 = $this->info['ability']; //�����������
-				$n2 = $this->info['skills']; //�������� ������ � �������
-				$n3 = $this->info['sskills']; //�����������
-				$n4 = $this->info['nskills']; //???
-				if($this->info['wipe']==1 || $this->info['wipe']==2)
-
-				{
-					$i = 1;
-					while($i<=11)
-					{					
-						if($i<=4)
-						{
-							$n1 += $st['s'.$i]-3;
-							$st['s'.$i] = 3;
-						}else{
-							$n1 += $st['s'.$i];
-							$st['s'.$i] = 0;
-						}
-						$i++;
-					}
-					$n1 -= $this->info['level'];
-					$st['s4'] = 3+$this->info['level'];
-					if($this->info['level']>=9)
-					{
-						$st['s4'] += 1;
-						$n1 -= 1;
-					}
-					if($this->info['level']>=10)
-					{
-						$st['s4'] += 2;
-						$n1 -= 2;
-					}
-					if($this->info['level']>=11)
-					{
-						$st['s4'] += 4;
-						$n1 -= 4;
-					}
-				}
-				
-				if($this->info['wipe']==1 || $this->info['wipe']==3)
-				{
-					$i = 1;
-					while($i<=7)
-					{
-						$n2 += $st['a'.$i];
-						$n2 += $st['mg'.$i];
-						$st['a'.$i]  = 0;
-						$st['mg'.$i] = 0;
-						$i++;
-					}
-				}
-				if($this->info['wipe']==1 || $this->info['wipe']==3.5)#---����� ������������
-				{
-					$i = 1;
-					while($i<=11)
-					{
-					$n3 += $st['os'.$i];
-					$st['os'.$i] = 0;
-					$i++;
-					}
-				}
-				//��������� ������
-				$st = $this->impStats($st);
-				$upd = mysql_query('UPDATE `stats` SET `wipe`="0",`stats`="'.$st.'",`ability`="'.$n1.'",`skills`="'.$n2.'",`sskills`="'.$n3.'",`nskills`="'.$n4.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');		
-				if($upd)
-				{
-					$this->info['stats'] = $st;
-					$this->info['ability'] = $n1;
-					$this->info['skills'] = $n2;
-					$this->info['sskills'] = $n3;
-					$this->info['nskills'] = $n4;
-				}					
-			}
-		}
-	}
-	
-	public function __clone()
-	{
-		trigger_error('������������ �� �����������.', E_USER_ERROR);
-	}
-	
-	//������� ���������� �������� ��� ��� �������������
-	public function trItem($po)
-	{
-		$tr = ''; $t = $this->items['tr'];
-		$x = 0; $notr = 0;
-		while($x<count($t))
-		{
-			$n = $t[$x];
-			if(isset($po['tr_'.$n]))
-			{
-				if( $n == 'sex' ) {
-					if( $this->info['sex'] != $po['tr_'.$n] ) {
-						$notr++;
-					}
-				}elseif($po['tr_'.$n] > $this->stats[$n] && $n != 'align')
-				{
-					$notr++;
-				}
-			}
-			$x++;
-		}
-		return $notr;
-	}
-	
-	public function freeStatsMod($id,$s,$uid)
-	{
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-		if(isset($itm['id']))
-		{
-			$po = $this->lookStats($itm['data']);
-/*
-		mf_stats
-		mf_mod
-		mf_mib
-*/
-			//�����
-			if($_GET['mf'] == 's1' || $_GET['mf'] == 's2' || $_GET['mf'] == 's3' || $_GET['mf'] == 's5') {
-				if(isset($po['mf_stats']) && $po['mf_stats']>0 && isset($po['add_'.$_GET['mf']])) {
-					$po['mf_stats'] = (int)$po['mf_stats'];
-					$po['mf_stats'] -= 1;
-					$po['add_'.$_GET['mf']] += 1;		
-					
-					$po = $this->impStats($po);				
-					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-			}elseif($_GET['mf'] == 'm1' || $_GET['mf'] == 'm2' || $_GET['mf'] == 'm4' || $_GET['mf'] == 'm5') {
-				if(isset($po['mf_mod']) && $po['mf_mod']>0 && isset($po['add_'.$_GET['mf']])) {
-					$po['mf_mod'] = (int)$po['mf_mod'];
-					$po['mf_mod'] -= 1;
-					$po['add_'.$_GET['mf']] += 1;		
-					
-					$po = $this->impStats($po);				
-					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-			}elseif($_GET['mf'] == 'mib1' || $_GET['mf'] == 'mib2' || $_GET['mf'] == 'mib3' || $_GET['mf'] == 'mib4') {
-				$s = $_GET['mf'];
-				$s = str_replace('mib','',$s);
-				$s = (int)$s;
-				if(isset($po['mf_mib']) && $po['mf_mib']>0 && (isset($po['add_mib'.$s]) || isset($po['add_mab'.$s]))) {
-					$po['mf_mib'] = (int)$po['mf_mib'];
-					$po['mf_mib'] -= 1;
-					if(isset($po['add_mab'.$s])) {
-						$po['add_mab'.$s] += 1;	
-					}
-					if(isset($po['add_mib'.$s])) {
-						$po['add_mib'.$s] += 1;	
-					}
-					
-					$po = $this->impStats($po);				
-					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-			}
-			
-		}
-	}
-	
-	public function freeStatsItem($id,$s,$uid)
-	{
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-		if(isset($itm['id']) && ( $s == 1 || $s == 2 || $s == 3 || $s == 5 ) )
-		{
-			$po = $this->lookStats($itm['data']);
-			if(isset($po['free_stats']) && $po['free_stats']>0)
-			{
-				$s = (int)$s;
-				if($s>=1 || $s<=3 || $s==5)
-				{
-					$po['free_stats'] = (int)$po['free_stats'];
-					$po['free_stats'] -= 1;
-					$po['add_s'.$s] += 1;
-				}
-			}
-			$po = $this->impStats($po);
-			
-			mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-		}
-	}
-	
-	public function freeStats2Item($id,$s,$uid,$tp)
-	{
-
-			$itm = mysql_fetch_array(mysql_query('SELECT
-			`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-			`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-			FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-			if(isset($itm['id']))
-			{
-				$po = $this->lookStats($itm['data']);
-				if($itm['so'] > 0)
-				{
-					$s = (int)$s;
-					if($tp == 1) {
-						//�����
-						if($s == 1 || $s == 2 || $s == 3 || $s == 5) {
-							if(10+25*$po['add_s'.$s] <= $itm['so'] && $itm['so'] > 0) {
-								$itm['so'] -= 10+25*$po['add_s'.$s];
-								$po['add_s'.$s]++;
-								$this->error = '�������������� ��������...';
-							}else{
-								$this->error = '�� ������� ����� ��������...';
-							}
-						}
-					}elseif($tp == 2) {
-						//��
-						if($s > 0 && $s < 13) {
-							$s2 = 0;							
-							if($s == 9 || $s == 12) {
-								if($s == 9) {
-									$s = 'm10';
-								}elseif($s == 12) {
-									$s = 'zm';
-								}
-								$s2 = 4+4*$po['add_'.$s];
-							}else{
-								if($s == 1) {
-									$s = 'm1';
-								}elseif($s == 2) {
-									$s = 'm2';
-								}elseif($s == 3) {
-									$s = 'm4';
-								}elseif($s == 4) {
-									$s = 'm5';
-								}elseif($s == 5) {
-									$s = 'mab1';
-								}elseif($s == 6) {
-									$s = 'mab2';
-								}elseif($s == 7) {
-									$s = 'mab3';
-								}elseif($s == 8) {
-									$s = 'mab4';
-								}elseif($s == 10) {
-									$s = 'za';
-								}elseif($s == 11) {
-									$s = 'm11a';
-								}
-								$s2 = 5+5*$po['add_'.$s];
-							}
-							
-							if(4+4*$po['add_'.$s] <= $itm['so'] && $itm['so'] > 0) {
-								$itm['so'] -= $s2;
-								if($s=='mab1') {
-									$po['add_mib1']++;
-								}elseif($s=='mab2') {
-									$po['add_mib2']++;
-								}elseif($s=='mab3') {
-									$po['add_mib3']++;
-								}elseif($s=='mab4') {
-									$po['add_mib4']++;
-								}
-								$po['add_'.$s]++;
-							}else{
-								$this->error = '�� ������� ����� ��������...';
-							}
-						}
-					}
-				}
-				$po = $this->impStats($po);
-				mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`so` = "'.$itm['so'].'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-			}
-	}
-
-	public function obj_addItem($id){
-		$itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1'));
-		if( $this->info['transfers'] < 1 ) {
-			$this->error = '�� ������� ����� ������� ��������.';
-		}elseif(isset($itm['id'])){
-			if( isset($itm['inGroup']) AND $itm['inGroup'] > 0 ) {
-				$col = $this->itemsX($itm['id']);
-				if($col > 1){
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `item_id`="'.$itm['item_id'].'" AND `inShop` != "30" AND `uid`="'.$itm['uid'].'" AND `inGroup` = "'.$itm['inGroup'].'" LIMIT '.$col.'');
-				} else {
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `uid` = "'.$this->info['id'].'" AND `inShop` != "30" AND `id` = "'.$itm['id'].'" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			} else {
-				$upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `uid` = "'.$this->info['id'].'" AND `inShop` != "30" AND `id` = "'.$id.'" AND `inOdet` = "0" AND `delete` = "0" ');
-			} 
-			if($upd) { /*
-				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
-				$this->info['transfers']--;
-				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->error = '������� &quot;'.$itm['name'].''.$col.'&quot; ��������� �� ���������';
-				*/
-			}
-		} else {
-			$this->error = '������� �� ������ � �������';	
-		}
-	}
-	
-	public function obj_takeItem($id){
-		$itm = mysql_fetch_array(mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="1" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1'));
-		if( $this->info['transfers'] < 1 ) {
-			$this->error = '�� ������� ����� ������� ��������.';
-		}elseif(isset($itm['id'])){
-			if( isset($itm['inGroup']) && $itm['inGroup'] > 0 ) {
-				$col = $this->itemsX($itm['id']);
-				if($col > 1){
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND ( `id` = "'.$itm['id'].'" OR `inGroup` = "'.$itm['inGroup'].'") AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" ');
-				} else {
-					$upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$itm['id'].'" AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" ');
-				}
-			} else {
-				$upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$id.'" AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" ');
-			}
-			if($upd){ /*
-				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
-				$this->error = '������� &quot;'.$itm['name'].''.$col.'&quot; ��������� � ���������';
-				$this->info['transfers']--;
-				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				*/
-			}
-		}else{
-			$this->error = '������� �� ������ � �������';	
-		}
-	}
-	
-	public function itemsSmSave($id,$s,$uid){
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.((int)$id).'" AND `iu`.`uid` = "'.$uid.'" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
-		if(isset($itm['id']))
-		{
-			$s = (int)$s;
-			$po = $this->lookStats($itm['data']);
-			if(!isset($po['sudba']) || $po['sudba']!='0')
-			{
-				if(isset($po['sm_skill']) && $s>100)
-				{
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7)
-					{
-						$mx1 += ($mx3['a'.$mx2]+$mx3['mg'.$mx2])-($po['add_a'.$mx2]+$po['add_mg'.$mx2]);
-						$mx2++;
-					}
-					$mx1 += $this->info['skills'];
-					if($mx1>0)
-					{
-						//������
-						$s = $s - 100;
-						if($s>5 && $s<=12)
-						{
-							//�����
-							$po['add_mg'.($s-5)]++;						
-						}elseif($s>0)
-						{
-							//������
-							$po['add_a'.$s]++;
-						}
-					}
-				}elseif(isset($po['sm_abil']) && $s<11 && $s>0)
-				{
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7)
-					{
-						$mx1 += $mx3['s'.$mx2]-$po['add_s'.$mx2];
-						$mx2++;
-					}
-					$mx1 += $this->info['ability'];
-					if($mx1>0)
-					{
-						$po['add_s'.$s]++;
-					}
-				}
-				
-				$po = $this->impStats($po);
-				mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				
-				unset($mx1,$mx2,$mx3,$po);
-			}
-		}
-	}
-	
-	public function runeItem($id,$name,$ruid) {
-		
-		if($id == NULL) {
-			
-			if($ruid < 1 && isset($_GET['use_rune'])) {
-				$ruid = $_GET['use_rune'];
-			}
-			$rune = mysql_fetch_array(mysql_query('SELECT 
-			`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-			,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE
-			`i`.`id` = "'.mysql_real_escape_string($ruid).'"			
-			AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
-			
-			$it_type = 0;
-			if(isset($_GET['item_rune'])) {
-				$name = $_GET['item_rune'];
-			}
-			$vi = 0;
-			$vid = '';
-			if( isset($_GET['item_rune_id']) ) {
-				$sp = mysql_query('SELECT
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`type`,`m`.`2h`,`m`.`inslot`,`m`.`name`,`m`.`img` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON (`i`.`item_id` = `m`.`id`)
-					WHERE `i`.`inShop` = "0" AND
-					
-					( (`m`.`inslot` > 0 AND `m`.`inslot` < 18) OR "'.$rune['type'].'" = "37" )
-					
-				AND `i`.`delete` = "0" AND `i`.`inOdet` = "0" AND `i`.`id` = "'.mysql_real_escape_string($_GET['item_rune_id']).'" AND `i`.`uid` = "'.mysql_real_escape_string($this->info['id']).'"');
-				$vi = -1;
-			}else{
-				$sp = mysql_query('SELECT
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`type`,`m`.`2h`,`m`.`inslot`,`m`.`name`,`m`.`img` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON (`i`.`item_id` = `m`.`id`)
-				
-					WHERE	
-							
-				( (`m`.`inslot` > 0 AND `m`.`inslot` < 18) OR "'.$rune['type'].'" = "37" ) AND
-				
-				`i`.`inShop` = "0" AND `i`.`delete` = "0" AND `i`.`inOdet` = "0" AND `m`.`name` LIKE "%'.mysql_real_escape_string(str_replace('"','&quot;',$name)).'%" AND `i`.`uid` = "'.mysql_real_escape_string($this->info['id']).'"');
-			}
-			while($pl = mysql_fetch_array($sp)) {
-				$vibor .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><hr>';
-				if(!isset($id['id'])) {
-					//if($pl['type']!=4 && $pl['type']!=2 && $pl['type']!=7 ) {
-						$dt = $this->lookStats($pl['data']);
-						$id = array();
-						$id = $pl;	
-						$id_type = $pl['type'];
-					//}
-				}
-				if( $vi != -1 ) {
-					$vi++;
-					$vid .= '`iu`.`id` = "'.$pl[0].'" OR';
-				}
-			}
-		}
-		
-		if( $vi > 0 ) {
-			$itm_inv = $this->genInv(80,' '.rtrim($vid,'OR').' ');
-			echo '<button style="float:right" class="btn" type="button" onclick="top.frames[\'main\'].location=\'main.php?inv=1&otdel='.floor($_GET['otdel']).'\'">���������</button><b>�������� ������� ��� ������������� &quot;'.$rune['name'].'&quot;:</b><br><br><table width="100%" border="0" cellspacing="1" align="center" cellpadding="0" bgcolor="#A5A5A5">'.$itm_inv[2].'</table>';
-			die();
-		}else{
-			unset($rune);
-		}
-
-		if($id['id'] > 0) {	
-		
-			if($ruid < 1 && isset($_GET['use_rune'])) {
-				$ruid = $_GET['use_rune'];
-			}
-			
-			$idtrue = false;
-			
-			$rune = mysql_fetch_array(mysql_query('SELECT 
-			`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-			,`m`.`name`,`m`.`type`,`m`.`level` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($ruid).'" AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
-			if($rune['level'] > $this->info['level'] && $rune['type']==31) {
-				$this->error = '� ��� ������� ��������� ������� ����� ������������ ��� ����';
-			}elseif($rune['type']==31 ) {
-				//���������� ����
-				if( $idt['type'] == 7 ){ $idt['type'] = 6; }
-				if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-				if( $idt['type'] == 4 ){ $idt['type'] = 6; }
-				$data = $this->lookStats($id['data']);
-				$type_rune = array(
-					'��' => 9, //������
-					'��' => 10, //��������
-					'��' => 11, //������
-					'��' => 12, //��������
-					'��' => 14, //������
-					'��' => 15, //�����
-					'��' => 1, //����
-					'��' => 3, //������
-					'��' => 6, //�����
-					'��' => 8  //����
-				);
-				if( $rune['type'] == 5 ) {
-					$type_rune['��'] = 5;
-				}
-				//
-				//$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-				//if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-				//$id['type'] = $idt['type'];
-				//
-				$type_rune = $type_rune[substr($rune['name'], -2, 2)];
-				if( $type_rune != $id['type'] && $type_rune != '' ) {
-					$type_rune2 = array(
-						'��' => '������', //������
-						'��' => '��������', //��������
-						'��' => '������', //������
-						'��' => '��������', //��������
-						'��' => '������', //������
-						'��' => '�����', //�����
-						'��' => '����', //����
-						'��' => '������', //������
-						'��' => '�����', //�����
-						'��' => '����'  //����
-					);
-					$this->error = '�������� ������ ���� �������� ������ � '.$type_rune2[substr($rune['name'], -2, 2)].' (��� ��������: '.$id['type'].'. ��������� ���: '.$type_rune.')';
-				}elseif(isset($data['nomodif'])) {
-					$this->error = '�������� ������ ������� ����������';
-				}elseif(isset($data['art']) && $data['tr_lvl'] < 0) {
-					$this->error = '����������� �������� � ��������� ���� 10-�� ������ ����������';
-				}else{
-					if(isset($data['rune']) && $data['rune'] > 0) {
-						$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['rune_id'].'" LIMIT 1'));
-						$j = 0;
-						$data_r = $this->lookStats($ritm['data']);
-						while($j < count($this->items['add'])) {
-							if(isset($data_r['add_'.$this->items['add'][$j]])) {
-								$data['add_'.$this->items['add'][$j]] -= $data_r['add_'.$this->items['add'][$j]];
-							}
-							$j++;
-						}
-					}
-					$data['rune'] = $rune['id'];
-					$data['rune_id'] = $rune['item_id'];
-					$data['rune_name'] = $rune['name'];
-					$data['rune_lvl'] = $rune['level'];
-					//��������� �������������� ����
-					$add = $this->lookStats($rune['data']);
-					$i = 0;
-					while($i<count($this->items['add'])) {
-						if(isset($add['add_'.$this->items['add'][$i]])) {
-							$data['add_'.$this->items['add'][$i]] += $add['add_'.$this->items['add'][$i]];
-						}
-						$i++;
-					}
-					//if( $rune['level'] > $data['tr_lvl'] ) {
-					//	$data['tr_lvl'] = $rune['level'];
-					//}
-					$data = $this->impStats($data);
-					mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-					mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-					
-					
-					
-					
-					
-					$this->error = '����������� ���� ������ �������';
-				}
-			}else{
-				$rune = mysql_fetch_array(mysql_query('SELECT 
-				`i`.`id`,`i`.`item_id`,`i`.`1price`,`i`.`2price`,`i`.`uid`,`i`.`use_text`,`i`.`data`,`i`.`inOdet`,`i`.`inShop`,`i`.`delete`,`i`.`iznosNOW`,`i`.`iznosMAX`,`i`.`gift`,`i`.`gtxt1`,`i`.`gtxt2`,`i`.`kolvo`,`i`.`geniration`,`i`.`magic_inc`,`i`.`maidin`,`i`.`lastUPD`,`i`.`timeOver`,`i`.`overType`,`i`.`secret_id`,`i`.`time_create`,`i`.`inGroup`,`i`.`dn_delete`,`i`.`inTransfer`,`i`.`post_delivery`,`i`.`lbtl_`,`i`.`bexp`,`i`.`so`,`i`.`blvl`
-				,`m`.`name`,`m`.`level`,`m`.`type` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `i`.`item_id` = `m`.`id` WHERE `i`.`id` = "'.mysql_real_escape_string($ruid).'" AND `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`inShop` = "0" LIMIT 1'));
-				if(!isset($rune['id'])) {
-					$this->error = '�������� ������� �� ������������ �� �������';
-				}elseif($rune['type']==62) {
-					
-					$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-					if( $idt['type'] == 7 ){ $idt['type'] = 6; }
-					if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-					if( $idt['type'] == 4 ){ $idt['type'] = 6; }
-					//$id['type'] = $idt['type'];
-					//���������� ���� 
-					$data = $this->lookStats($id['data']);
-					$add = $this->lookStats($rune['data']);				
-					if(isset($data['nomodif'])) {
-						$this->error = '�������� ������ ������� ����������';
-					}elseif(isset($data['art']) && $data['tr_lvl'] < 0) {
-						$this->error = '����������� �������� � ��������� ���� 10-�� ������ ����������';
-					}elseif(isset($add['onimposed'])) {
-						//���������� �����
-						//����� �����
-						$i = 0; $j = 0;
-						$utp = explode(',',$add['onItemType']);
-						while($i<count($utp)) {
-							if($utp[$i] == $id['type']){
-								$j++;
-							}
-							$i++;
-						}
-						if( $j > 0 ) {
-							
-							unset($data['imposed'],$data['imposed_name'],$data['bm_a1']);
-							
-							$imposed = array(
-								'imposed' => 1,
-								'imposed_name' => $add['onSpellName'],
-								'bm_a1' => $add['onSpellFile']
-							);
-							
-							if(!isset($add['onSpellFile'])) {
-								unset($imposed['bm_a1']);
-								//
-								if(isset($add['onSpell_mpAll'])) {
-									$imposed['addspell_mpAll'] = $add['onSpell_mpAll'];
-									$imposed['add_mpAll'] = $data['add_mpAll'] + $add['onSpell_mpAll'] - $data['addspell_mpAll'];
-								}
-								//
-							}
-							
-							$imposed['sudba'] = 1;
-														
-							$data = array_merge($data, $imposed); 
-							$data = $this->impStats($data);
-			
-							mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							$this->error = '�������� ���� "'.$add['onSpellName'].'" �� ������� &quot;'.$id['name'].'&quot;';
-						}else{
-							$this->error = '������� &quot;'.$id['name'].'&quot; �� �������� ��� ��������.,.';
-						}
-					}else{
-						if(isset($data['spell']) && $data['spell'] > 0) {
-							//�������� ������ �� ������� �����
-							$litm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$id['item_id'].'" LIMIT 1'));
-							
-							$data_l = $this->lookStats($litm['data']);
-							$pvr = array(
-								'i' => 0,
-								'spell' => array(),
-								'rune'	=> array(),
-								'atack'	=> array(),
-								'podgon'=> array()
-							);
-							
-							if( isset($data['podgon']) ) {
-								if($data['tr_lvl'] > $id['level']) {
-									$id['level'] = $data['tr_lvl'];
-								}
-								$pvr['podgon']['hpAll'] = 6*$id['level']+6;
-							}
-							if( isset($data['addspell_hpAll']) ) {
-								$pvr['podgon']['hpAll'] += $data['addspell_hpAll'];
-							}
-							if( isset($data['rune_id']) && $data['rune_id'] > 0 ) {
-								$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['rune_id'].'" LIMIT 1'));
-								$j = 0;
-								$data_r = $this->lookStats($ritm['data']);
-								while($j < count($this->items['add'])) {
-									if(isset($data_r['add_'.$this->items['add'][$j]])) {
-										$pvr['rune'][$this->items['add'][$j]] = $data_r['add_'.$this->items['add'][$j]];
-									}
-									$j++;
-								}
-							}
-							
-							if(isset($data['spell_st_val_hp'])) {
-								$data['add_hpAll'] -= $data['spell_st_val_hp'];
-							}
-							
-							//$i = 0;
-							//while( $i < count($data)) {
-							if( !isset($data['spell_st_name']) ) {
-								$delk = count($this->items['add']);
-								$this->items['add'][] = 'mib1';
-								$this->items['add'][] = 'mib2';
-								$this->items['add'][] = 'mib3';
-								$this->items['add'][] = 'mib4';								
-								$this->items['add'][] = 'mab1';
-								$this->items['add'][] = 'mab2';
-								$this->items['add'][] = 'mab3';
-								$this->items['add'][] = 'mab4';
-								$j = 0;
-								while($j < count($this->items['add'])) {
-									if(isset($data['add_'.$this->items['add'][$j]])) {
-										if( $data_l['add_'.$this->items['add'][$j]] != $data['add_'.$this->items['add'][$j]] - $pvr['rune'][$this->items['add'][$j]] - $pvr['podgon'][$this->items['add'][$j]] ) {									
-											//echo ''.$this->items['add'][$j].' -> '.$data_l['add_'.$this->items['add'][$j]].' / '.$data['add_'.$this->items['add'][$j]].'<br>';
-											if(!isset($data_l['add_'.$this->items['add'][$j]])) {
-												unset($data['add_'.$this->items['add'][$j]]);
-											}else{
-												$data['add_'.$this->items['add'][$j]] = $data_l['add_'.$this->items['add'][$j]];
-											}
-										}
-									}
-									$j++;
-								}
-								$i = 0;
-								while( $i < 8 ) {
-									unset($this->items['add'][$delk+$i]);
-									$i++;
-								}
-								//$i++;
-							//}
-							}							
-						}
-						//����� �����
-						$i = 0;
-						$utp = explode(',',$add['onItemType']);
-						while($i<count($utp)) {
-							if($utp[$i] == $id['type']){
-								// ���������� ������ ��� ������.
-								$itm_twohand = mysql_fetch_array(mysql_query('SELECT `2h` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT 1'));
-								if(isset($itm_twohand['2h']) && $itm_twohand['2h']==1) $tw = '2'; else $tw = '';
-								$j = 0;
-								while($j<count($this->items['add'])) {
-									if(isset($add[$tw.'add'.$utp[$i].'_'.$this->items['add'][$j]])) {									
-										$rnda[count($rnda)] = $this->items['add'][$j];
-									}
-									$j++;
-								}
-
-								if( isset($add['imposed']) && $add['imposed'] != '' ) {
-									$imposed = array(
-										'imposed'=>'1', // �������
-										'imposed_id'=>$rune['id'], // ID ����� ������
-										'imposed_name'=>$rune['name'], // ������������ ���, ������� ������������ �� ��������
-										'imposed_level'=>$rune['level'], // ���� ��������� ���������� ��� �����������. �� ���������: 0;
-										'bm_a1'=>$add['imposed'], // ��� ����� ����������.
-										'sudba'=>$this->info['login'] // ���� ��������� ���������� ��� �����������. �� ���������: 0;
-									);
-									if( isset($add['imposed_name']) ) $imposed['imposed_name']=$add['imposed_name'];
-									if( isset($add['imposed_level']) ) $imposed['imposed_level']=$add['imposed_level'];
-									$rnda[0] = 1;
-								}
-								if( count($rnda) >= 0 ) {
-									$rnda = $rnda[rand(0,count($rnda)-1)];
-									if( $rnda == 'mib1' || $rnda == 'mib2' || $rnda == 'mib3' || $rnda == 'mib4' ) {
-										$rnda = str_replace('mib','mab',$rnda);
-									}
-									
-									if( !isset($this->is[$rnda]) && isset($imposed) ){
-										$data = array_merge($data, $imposed); 
-										$data = $this->impStats($data);
-		
-										mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-										mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-										$this->error = '�������� ���� "'.$imposed['imposed_name'].'" �� ������� &quot;'.$id['name'].'&quot;';
-										
-									} elseif( !isset($this->is[$rnda])
-										&& $rnda != 'mib1' && $rnda != 'mib2' && $rnda != 'mib3' && $rnda != 'mib4'
-										&& $rnda != 'mab1' && $rnda != 'mab2' && $rnda != 'mab3' && $rnda != 'mab4'
-									) {
-										$this->error = '���������� �������� ������� �����. ( '.$rnda.' )';
-									} else {
-										$data['add_'.$rnda] += $add[$tw.'add'.$utp[$i].'_'.$rnda];
-										if( $rnda == 'mab1' || $rnda == 'mab2' || $rnda == 'mab3' || $rnda == 'mab4' ) {
-											$data['add_'.str_replace('mab','mib',$rnda)] += $add[$tw.'add'.$utp[$i].'_'.$rnda];
-										}
-										/*$jkh = 1;
-										while( $jkh <= 4 ) {
-											if($rnda == 'mib'.$jkh) {
-												$data['add_mab'.$jkh] += $add['add'.$utp[$i].'_'.$rnda];
-											}elseif($rnda == 'mab'.$jkh) {
-												$data['add_mib'.$jkh] += $add['add'.$utp[$i].'_'.$rnda];
-											}
-											$jkh++;
-										}*/
-											
-										$data['spell'] = $rune['id'];
-										if( !isset($data['sudba']) ) {
-											$data['sudba'] = '0';
-										}
-											
-										if( isset($data['spell_st_name']) ) {
-											$data['add_' . $data['spell_st_name']] -= $data['spell_st_val'];
-											if( $data['spell_st_name'] == 'mab1' || $data['spell_st_name'] == 'mab2' || $data['spell_st_name'] == 'mab3' || $data['spell_st_name'] == 'mab4' ) {
-												$data['add_'.str_replace('mab','mib',$data['spell_st_name'])] -= $data['spell_st_val'];
-											}
-											/*$jkh = 1;
-											while( $jkh <= 4 ) {
-												if( $data['spell_st_name'] == 'mib'.$jkh ) { 
-													$data['add_' . str_replace('mib','mab',$data['spell_st_name'])] -= $data['spell_st_val'];
-												}elseif( $data['spell_st_name'] == 'mab'.$jkh ) { 
-													$data['add_' . str_replace('mab','mib',$data['spell_st_name'])] -= $data['spell_st_val'];
-												}
-												$jkh++;
-											}*/
-											if( $data['add_' . $data['spell_st_name']] == 0 ) {
-												unset($data['add_' . $data['spell_st_name']]);
-											}
-											//die('������� ��������: '.$data['spell_st_name'].' +'.$data['spell_st_val'].'<br>���������� �����...');
-										}
-											
-										$data['spell_id'] = $rune['item_id'];
-										$data['spell_name'] = $rune['name'];
-										$data['spell_lvl'] = $rune['level'];
-										$data['spell_st_name'] = $rnda;
-										$data['spell_st_val'] = $add[$tw.'add'.$utp[$i].'_'.$rnda];	
-										if(isset($add['addspell_hpAll'])) {
-											$data['spell_st_val_hp'] = $add['addspell_hpAll'];
-											$data['add_hpAll'] += $add['addspell_hpAll'];
-										}else{
-											unset($data['spell_st_val_hp']);
-										}
-										$data = $this->impStats($data);	
-										
-										$this->is['mab1'] = '����� ������';
-										$this->is['mab2'] = '����� �������';
-										$this->is['mab3'] = '����� �����';
-										$this->is['mab4'] = '����� ���';
-										$this->error = '��������� �������������� �������� &quot;'.$id['name'].'&quot;, '.$this->is[$rnda].': +'.$add[$tw.'add'.$utp[$i].'_'.$rnda];
-										
-										//$this->error = '<br/><br/><br/>��������� �������������� �������� &quot;'.$id['name'].'&quot;, '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."<br/><br/>$:".$idt['2h']."<";
-		
-										unset($this->is['mab1'],$this->is['mab2'],$this->is['mab3'],$this->is['mab4']);
-		
-										mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-										mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-									}
-								}else{
-									$this->error = '���-�� �� ���, ���������� ���������� ������ �������';
-								}
-								$i = 100499;
-							}
-							$i++;
-						}
-						if($i < 100500) {
-							$this->error = '������ ������� �� �������� ��� �����������...';
-						}					
-					}
-					
-				} elseif($rune['type']==47) {
-					$add = $this->lookStats($id['data']);
-					$data = $this->lookStats($rune['data']);
-					if($add['art'] ==1) {
-				      if($id['iznosNOW'] > 0) {
-						$id['iznosNOW'] -= $data['repairLevel'];
-						if($id['iznosNOW'] < 0) { $id['iznosNOW'] = 0; }
-						mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$id['iznosNOW'].'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'"  LIMIT 1');
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-						$this->error = '������� '.$id['name'].' ������� ��������������.';
-					  } else {
-						$this->error = '������� �� ���������� � �������...';
-					  }
-					} else {
-					  $this->error = '������ ����������� ������ ���������...';
-					}
-				} elseif($rune['type']==46) {
-					$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-					if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-					$id['type'] = $idt['type'];
-					if($id_type < 18 || $id_type > 24) {
-						$add = $this->lookStats($rune['data']);
-						if( isset($add['uptimeitem']) ) {
-							$data = $this->lookStats($id['data']);
-							if( $data['srok'] > 0 || $id['srok'] > 0 ) {
-								if( !isset($data['srok']) ) {
-									$data['srok'] = $id['srok'];
-								}
-								if( $data['srok'] + $id['time_create'] - time() > 86400 + 30 ) {
-									$this->error = '������ ������������ �� �������� � ������ �������� 30 � ����� ����.';
-								}elseif( $id['inslot'] > 0 && $id['inslot'] < 20 ) {
-									$this->error = '���� �������� �������� &quot;'.$id['name'].'&quot; ������� �� '.$this->timeOut($add['uptimeitem']).'.';
-									
-									if( isset($data['sleep_moroz']) ) {
-										unset($data['sleep_moroz']);
-									}
-									
-									$data = $this->impStats($data);	
-									
-									mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-									mysql_query('UPDATE `items_users` SET `data` = "'.$data.'",`time_create` = `time_create` + '.floor($add['uptimeitem']).' WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-
-								}else{
-									$this->error = '������� ������� ���� ������ ��������...';
-								}
-							}else{
-								$this->error = '��� �������� ������ �� �������� � ������ ��������...';
-							}
-						}else{
-							$this->error = '���������� ����� ������ ������...';
-						}
-					}else{
-						//�������
-						$data = $this->lookStats($id['data']);
-						$add = $this->lookStats($rune['data']);
-						if(isset($data['upatack_id'])) {
-							$this->error = '������� ��� �������, �������� ������� � ��������� ����������.';
-						}elseif(isset($data['nomodif'])) {
-							$this->error = '�������� ������ ������� ����������';
-						}elseif($add['uptype'] != $id_type || $add['uptype'] == 0) {
-							$this->error = '������� �� �������� � ������� ��������...';
-						}else{
-							
-							if(isset($data['upatack_id']) && $data['upatack_id'] > 0) {
-								$ritm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$data['upatack_id'].'" LIMIT 1'));
-								$data_r = $this->lookStats($ritm['data']);
-								if( $id_type == 22 ) {
-									$data['add_m11'] -= $data_r['upatack']*2;
-								}elseif( $id['2h'] == 1 ) {
-									$data['sv_yron_min'] -= $data_r['upatack']*2;
-									$data['sv_yron_max'] -= $data_r['upatack']*2;
-								}else{
-									$data['sv_yron_min'] -= $data_r['upatack'];
-									$data['sv_yron_max'] -= $data_r['upatack'];
-								}
-							}
-							$data['upatack'] = $rune['id'];
-							$data['upatack_id'] = $rune['item_id'];
-							$data['upatack_name'] = $rune['name'];
-							$data['upatack_lvl'] = $add['upatack'];
-							$data['upatack_lvl'] = $add['upatack'];
-							if(!isset($data['base_price1'])) {
-								//$data['base_price1'] = $id['1price'];
-								//$data['base_price2'] = $id['2price'];
-							}
-
-							//��������� �������������� ����						
-							$i = 0;
-							while($i<count($this->items['add'])) {
-								if(isset($add['add_'.$this->items['add'][$i]])) {
-									$data['add_'.$this->items['add'][$i]] += $add['add_'.$this->items['add'][$i]];
-								}
-								$i++;
-							}
-							
-							if( $id_type == 22 ) {
-								$data['add_m11'] += $add['upatack']*2;
-								//print_r($data);
-								//die('������ �������� �� �������.');
-							}elseif( $id['2h'] == 1 ) {
-								$data['sv_yron_min'] += $add['upatack']*2;
-								$data['sv_yron_max'] += $add['upatack']*2;
-							}else{
-								$data['sv_yron_min'] += $add['upatack'];
-								$data['sv_yron_max'] += $add['upatack'];
-							}
-							
-							if( !isset($add['nosale']) && !isset($add['frompisher']) ) {
-								//$id['1price'] = $data['base_price1']+$rune['1price'];	
-								//$id['2price'] = $data['base_price2']+$rune['2price'];
-							}
-							
-							$this->addDelo(2,$this->info['id'],'&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: ������� &quot;'.$data['upatack_name'].'&quot; ���� ������� <b>��������</b> � ������� &quot;'.$id['name'].'&quot; [itm:'.$id['id'].']',time(),$this->info['city'],'System.remont.upatack',0,0);
-					
-							
-							$data = $this->impStats($data);
-													
-							mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `items_users` SET `1price` = "'.$id['1price'].'",`2price` = "'.$id['2price'].'",`data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							$this->error = '������� &quot;'.$id['name'].'&quot; ������ �������';
-						}
-					}
-				}elseif($rune['type']==68) {
-					$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-					if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-					$id['type'] = $idt['type'];
-
-						//���������� ����
-						$data = $this->lookStats($id['data']);
-						$add = $this->lookStats($rune['data']);
-						if(isset($data['nomodif'])) {
-							$this->error = '�������� ������ ������� ����������';
-						}elseif(!isset($data['close']) && $data['close'] != 0) {
-							$this->error = '�� �������� � ������� ��������, �� �� ������...';
-						}else{
-							$data['unopen'] = $rune['id'];
-							$data['unopen_id'] = $rune['item_id'];
-							$data['unopen_name'] = $rune['name'];
-							
-							unset($data['close']);
-							
-							$data['open'] = 1;
-							
-							$data = $this->impStats($data);								
-							
-							mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$rune['id'].'"  AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `items_users` SET `data` = "'.$data.'" WHERE `id` = "'.$id['id'].'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-							$this->error = '�������� &quot;'.$id['name'].'&quot; ������ �������';
-						}
-						
-				}elseif($rune['type']==37) {
-					$idt = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT 1'));
-					if($idt['type'] != 37) {
-						//
-						$data = $this->lookStats($id['data']);
-						$add = $this->lookStats($rune['data']);
-						//
-						if($id['gift'] == '' || $id['gift'] == '0') {
-							if(isset($data['notransfer'])) {
-								$this->error = '������� ������ ����������...';
-							}elseif(isset($data['sudba']) && $data['sudba'] != 0) {
-								$this->error = '������� ������ ����� �������...';
-							}else{
-								if(isset($add['item_inbox']) && $add['item_inbox'] > 0) {
-									$this->error = '� �������� ��� ���-�� ����, �������� ������� �������!';
-								}elseif($id['inTransfer'] > 0 || $id['inShop'] > 0 || $id['inGroup'] > 0) {
-									$this->error = '������ �������� ���� �������, �� � ��������, �� �������� ��� � ������...';
-								}else{
-									//���������� ������� � ��������
-									$add['item_inbox'] = $id['id'];		
-									$add['open'] = 1;
-									$add['nosale'] = 1;									
-									$add = $this->impStats($add);
-									//
-									mysql_query('UPDATE `items_users` SET `inGroup` = 0,`data` = "'.$add.'" WHERE `id` = "'.$rune['id'].'" LIMIT 1');
-									mysql_query('UPDATE `items_users` SET `uid` = -1 WHERE `id` = "'.$id['id'].'" LIMIT 1');
-									//
-									$this->error = '������� &quot;'.$idt['name'].'&quot; �������� � �������.';
-									//
-								}
-							}
-						}else{
-							$this->error = '�������� �� �����...';
-						}
-						//
-					}else{
-						$this->error = '�� �� ������� ��������� ��������...';
-					}						
-				}else{
-					$this->error = '('.$rune['type'].') �������� ������� �� ������������ �� �������...';
-				}
-			}
-		}else{
-			$this->error = '����������� �������� �� �������...';
-		}
-	}
-	
-	public function floordec($zahl,$decimals=2){	 
-		 return floor($zahl*pow(10,$decimals))/pow(10,$decimals);
-	}
-	
-	public function testBattle( $id ) {
-		$r = true;
-		if( $id == 0 ) {
-			$r = false;
-		}else{
-			$btla = mysql_fetch_array(mysql_query('SELECT `id`,`team_win` FROM `battle` WHERE `id` = "'.mysql_real_escape_string($id).'" LIMIT 1'));
-			if( isset($btla['id']) ) {
-				if( $btla['team_win'] > -1 ) {
-					$r = false;
-				}
-			}
-		}
-		return $r;
-	}
-	
-	public function testVipItems($slot_new) {
-		$sp = mysql_query('SELECT `i`.`id`,`m`.`type`,`i`.`2price`,`m`.`price2` FROM `items_users` AS `i` LEFT JOIN `items_main` AS `m` ON `m`.`id` = `i`.`item_id` WHERE `i`.`uid` = "'.$this->info['id'].'" AND `i`.`delete` = "0" AND `i`.`data` LIKE "%vip_sale%" LIMIT 20');
-		$itm = array();
-		$slot = array();
-		$j = 0;
-		if( $slot_new > 0 ) {
-			$itm[$j] = array('new');
-			$slot[$slot_new][] = $j;
-			$j++;
-		}
-		$r = true;
-		while( $pl = mysql_fetch_array($sp)) {
-			$itm[$j] = $pl;
-			$slot[$pl['type']][] = $j;
-			$j++;
-		}
-		$l = count($slot[18])+count($slot[19])+count($slot[20])+count($slot[21])+count($slot[22])+count($slot[23])+count($slot[24])+count($slot[25])+count($slot[26])+count($slot[27])+count($slot[28]);
-		$v = count($slot[9])+count($slot[10])+count($slot[11]);
-		$a = count($itm)-$l-$v;
-		if( $this->stats['silver'] == 2 ) {
-			// 3 ��������� (1������ � ��� ����� ��������)
-			if( $j > 3 || $l > 1 || $v > 0 ) {
-				$r = false;
-			}
-		}elseif( $this->stats['silver'] == 3 ) {
-			// 6 ���������� (1 ������, 1 �������� � 4 ���� �� �����) 
-			if( $j > 6 || $l > 1 || $v > 1 ) {
-				$r = false;
-			}
-		}elseif( $this->stats['silver'] == 4 ) {
-			// 9 ���������� (2 ������, 2 �������� � 5 ����� �� �����) 
-			if( $j > 9 || $l > 2 || $v > 2 ) {
-				$r = false;
-			}
-		}elseif( $this->stats['silver'] == 5 ) {
-			// ������� ������			
-		}	
-		return $r;
-	}
-	
-	public function berezCena() {
-		global $c;
-		$r = 0;
-		if( $this->stats['silver'] > 0 ) {
-			$r = 50+(($this->stats['silver']-1)*5);
-			$r = $r/100;
-		}
-		$r = $c['shop_type2'];
-		//$r = 1; //������ 100%
-		$r = round(($r/100),2);
-		return $r;	
-	}
-	
-	public function genInv($type, $sort){
-		global $c,$code;
-		
-		$i = 0; // �������, ������ ��������.
-		$j = 0;  // ����� ��������� while ++
-		$k = 1; // 0 ��� 1
-		$rt = array( 0=>0, 1=>0, 2=>'' ); // ����������? ���������
-		$clr = array( 0=>'c8c8c8', 1=>'d4d4d4' ); // ���� ���� ��� ��������� 
-			$sort = explode('ORDER BY', $sort);
-			if( isset($sort[0],$sort[1])){
-				$where= $sort[0];
-				if($sort[1] !='' )$sort = $sort[1].''; else $sort =''; 
-			} else {
-				$where = $sort[0]; $sort = ' `lastUPD`  DESC';
-			}
-			$cl = mysql_query('SELECT count(`iu`.item_id) as inGroupCount, `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`so`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE  '.$where.' GROUP BY `im`.id,`iu`.item_id, `iu`.inGroup HAVING `iu`.inGroup > 0  UNION ALL SELECT count(`iu`.item_id) as inGroupCount, `im`.`id`,`im`.`name`,`im`.`img`, `im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`, `im`.`iznosMAXi`,`im`.`inRazdel`, `im`.`price1`,`im`.`price2`, `im`.`pricerep`,`im`.`magic_chance`, `im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`, `im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`, `im`.`ts`,`im`.`srok`,`im`.`class`, `im`.`class_point`,`im`.`anti_class`, `im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`, `im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`so`,`iu`.`id`,`iu`.`item_id`, `iu`.`1price`,`iu`.`2price`,`iu`.`uid`, `iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`, `iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`, `iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`, `iu`.`magic_inc`, `iu`.`maidin`,`iu`.`lastUPD`, `iu`.`timeOver`, `iu`.`overType`, `iu`.`secret_id`, `iu`.`time_create`, `iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`, `iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE  `iu`.inGroup=0 AND '.$where.' GROUP BY `iu`.id, `iu`.item_id ORDER BY '.$sort.' 
-');
-		 
-		if($type == 15) {
-			$anm = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1'));
-		} 
-		while($pl = mysql_fetch_array($cl)) {
-	 	 	 if($type==30){
-	 	 	 	 $ChSudba = $this->lookStats($pl['data']);	 	 	 	 	 
-	 	 	 	 if(isset($ChSudba['sudba']) || $ChSudba['sudba'] != 0 || $ChSudba['nosale']==1)
-	 	 	 	    continue;
-	 	 	 }
-			if($pl['1price']>0) {
-				$pl['price1'] = $pl['1price'];
-			}
-			$is1 = '';
-			$is2 = '';
-			$d = array();
-			//����
-			$d[0] = 0;
-			$d[1] = 1;
-			$d[2] = 0;
-			$po = $this->lookStats($pl['data']);
-			
-			$see1 = 1;
-			if($type == 15) { //�������� �����
-				if($anm['type'] == 3 && substr_count($pl['img'],'wisp') == 0) {
-					$see1 = 0; //�������
-				}elseif($anm['type'] == 2 && substr_count($pl['img'],'owl') == 0) {
-					$see1 = 0; //����
-				}elseif($anm['type'] == 1 && substr_count($pl['img'],'cat') == 0) {
-					$see1 = 0; //���
-				}elseif($anm['type'] == 4 && substr_count($pl['img'],'chrt') == 0) {
-					$see1 = 0; //�������
-				}elseif($anm['type'] == 5 && substr_count($pl['img'],'dog') == 0) {
-					$see1 = 0; //������
-				}elseif($anm['type'] == 6 && substr_count($pl['img'],'pig') == 0) {
-					$see1 = 0; //������
-				}elseif($anm['type'] == 7 && substr_count($pl['img'],'dragon') == 0) {
-					$see1 = 0; //������
-				}
-			}elseif(isset($po['nosale']) && $type==2){
-				$see1 = 0;	
-				
-			}elseif(isset($po['noremont']) && $type==4){
-				$see1 = 0;	
-			}elseif($type==5 && $pl['gift']!=''){
-				$see1 = 0;	
-			}elseif(($type==9 || $type==10) && $pl['gift']==''){
-				$see1 = 0;	
-			}elseif($type==5 && isset($po['sudba']) && $po['sudba']!='0'){
-				$see1 = 0;	
-			}elseif($type==5 && $pl['inTransfer']>0){
-				$see1 = 0;
-			}elseif($type==6 && !isset($po['fshop'])){
-				$see1 = 0;
-			} elseif($type == 67 && isset($po['art'])) {
-				$see1 = 0;
-			}elseif($type == 67 && isset($po['sudba'])) {
-				$see1 = 0;
-			} elseif($type == 67 && $pl['gift']!='') {
-				$see1 = 0;
-			}elseif($type==11) { // ���� ������ (������ ���������)
-				if($pl['inTransfer']>0 || ($po['sudba'] != '' && $po['sudba'] != 0 && $po['sudba'] != 1 && $po['sudba'] != $this->info['id']) ){
-					$see1 = 0;
-				}
-				if($pl['type']!=1 && $pl['type']!=3 && $pl['type']!=9 && $pl['type']!=10 && $pl['type']!=11 && $pl['type']!=5 && $pl['type']!=6 && $pl['type']!=8 && $pl['type']!=12 && $pl['type']!=14 && $pl['type']!=15 && $pl['type']!=18 && $pl['type']!=19 && $pl['type']!=20 && $pl['type']!=21 && $pl['type']!=22 && $pl['type']!=13 && $pl['item_id']!=1035){
-					$see1 = 0; 
-				}
-				if($po['tr_lvl']<4 && $pl['item_id']!=1035){
-					$see1 = 0;
-				}
-			}elseif($type==14) { // ���� ������ (������ ���)
-				if($pl['inTransfer'] > 0){
-					$see1 = 0;
-				}
-				if($pl['type'] != 31){
-					$see1 = 0;
-				}
-			}elseif($type==12){
-				if($pl['inslot']!=3 && $pl['inslot']!=14 && $pl['type']!=31){
-					$see1 = 0;
-				}
-				if(!isset($po['frompisher']) && $pl['type']!=31){
-					$see1 = 0;
-				}
-			}elseif($type==56 && ($pl['inslot'] != 5 || isset($po['podgon']))){
-				$see1 = 0;	
-			}elseif(isset($po['musor']) && $po['musor']>0 && $pl['iznosNOW']>=$pl['iznosMAX']){
-				$see1 = 0;
-			}elseif($type==57) {
-				//��������
-				if($pl['type'] < 18 || $pl['type'] > 28 || $pl['type'] == 25) {
-					$see1 = 0;
-				}
-			}elseif($type==58) {
-				//������������ ���
-				if(!isset($po['rune_id'])) {
-					$see1 = 0;
-				}
-			}elseif($type == 65) {
-			  if(isset($po['sudba']) && $po['sudba'] != '0') {
-				$see1 = 0;
-			  }
-			  if(isset($po['toclan'])) {
-				$po['toclan1'] = explode('#',$po['toclan']);
-				$po['toclan1'] = $po['toclan1'][0];
-				if($po['toclan1'] != $this->info['clan']) {
-				  $see1 = 0;
-				}
-			  }
-			}elseif($type == 67) {
-				$po['toclan1'] = explode('#',$po['toclan']);
-				$po['toclan1'] = $po['toclan1'][0];
-				if($po['toclan1'] > 0) {
-					$see1 = 0;
-				}
-				if($this->itemsX($pl['id']) > 1) {
-					#$see1 = 0;
-				}
-				if($po['frompisher'] > 0) {
-					$see1 = 0;
-				}
-				if($pl['gift'] > 0) {
-					$see1 = 0;
-				}
-				if($po['sudba'] > 0) {
-					$see1 = 0;
-				}
-			}elseif($type == 69) {
-				$po['toclan1'] = explode('#',$po['toclan']);
-				$po['toclan1'] = $po['toclan1'][0];
-				if($po['toclan1'] > 0) {
-					$see1 = 0;
-				}
-				if($po['frompisher'] == 0) {
-					$see1 = 0;
-				}
-				if($pl['gift'] > 0) {
-					$see1 = 0;
-				}
-			}
-			
-			if($see1==1){
-				if($k==1){
-					$k = 0;
-				}else{
-					$k = 1;
-				}
-				if(($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27){ //���� ����� +
-					if(!isset($po['zonb'])) { $po['zonb'] = 0; }
-					$po['zonb']++;
-				}
-				//������ �����
-				$mx = '';
-				if(isset($po['upatack_lvl'])) {
-					$mx .= ' +'.$po['upatack_lvl'];
-				}
-				if(isset($po['modif'])) {
-					$mx .= ' (��)';
-				}
-				$col = $this->itemsX($pl['id']);
-				if($col>1 && $pl['inGroup']!=0 ){ 
-					$pl['kolvo'] = $col;
-					$mx .= ' (x'.$col.')';
-				}
-				if(isset($po['tr_align']) && !isset($po['tr_align_bs'])) {
-					$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
-				} elseif(isset($po['tr_align_bs'])) {
-					if($po['tr_align_bs'] == '1') {
-						$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align1.75.gif >';
-					} elseif($po['tr_align_bs'] == '3') {
-						$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align3.01.gif >';
-					}
-				}
-				if( isset($po['renameadd']) && $po['renameadd'] != '' ) {
-					$pl['name'] .= ' (<small>�������: '.$po['renameadd'].'</small>)';
-				}
-				if( isset($po['icos']) ) {
-					$pl['name'] = '<span class=icos_'.$po['icos'].' >'.$pl['name'].' <span><small>&nbsp;'.$po['icos'].'&nbsp;</small></span></span>';
-				}
-				$is2  = '<a oncontextmenu="top.addTo(\''.$pl['id'].'\',\'item\'); return false;" class="inv_name" href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$pl['name'].''.$mx.'</a>';
-				$is2 .= '&nbsp;&nbsp;';
-				if($pl['massa']>0){
-					$is2 .= ' (�����: '.($pl['massa']*$col).')';
-				}
-				if($pl['gift']!=''){
-					$ttl = '';
-					if($pl['gift']==1){
-						$ttl = '�� �� ������ �������� ���� ������� ����-����';
-					}else{
-						$ttl = '���� ������� ��� ������� '.$pl['gift'].'. �� �� ������� �������� ���� ������� ����-���� ���';
-					}
-					$is2 .= ' <img title="'.$ttl.'" src="https://img.new-combats.com/i/podarok.gif">';
-				}
-				
-				if(isset($po['art'])){
-					$is2 .= ' <img title="��������" src="https://img.new-combats.com/i/artefact.gif">';
-				}
-				
-				if(isset($po['sudba'])){
-					if($po['sudba']=='0'){
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� ���. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}elseif($po['sudba']=='1'){
-						$is2 .= ' <img title="���� ������� ����� ������ ����� ������� � ������, ��� ������� �������. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/destiny0.gif">';
-					}else{
-						$is2 .= ' <img title="���� ������� ������ ����� ������� � '.$po['sudba'].'. ����� ������ �� ������ ��� ������������." src="https://img.new-combats.com/i/desteny.gif">';
-					}
-				}
-				if($pl['price1']>0){ //����
-					$pex = explode('.',$pl['price1']);
-					if($pex[1]=='00'){
-						$pl['price1'] = $pex[0];
-					}
-					if($_GET['toRent']==2){
-						$is2 .= '<br><b>����: '.($pl['price1']).' ��.</b>';
-					} else{
-						$is2 .= '<br><b>����: '.($pl['price1']*$col).' ��.</b>';
-					}
-				}
-				if($pl['pricerep']>0){
-					$is2 .= ' <small><b>('.round($pl['pricerep']*$col,2).' ��������������)</b></small>';
-				}
-				if($pl['iznosMAX']>0){ //�������������
-					$izcol = '';
-					if(floor($pl['iznosNOW'])>=(floor($pl['iznosMAX'])-ceil($pl['iznosMAX'])/100*20)){
-						$izcol = 'brown';
-					}
-	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$is2 .= '<br>�������������: <font color="brown">�����������</font >';
-					}else{					
-						$is2 .= '<br>�������������: <font color="'.$izcol.'">'.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']).'</font>';
-					}
-				}
-				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '<br>�������� �������������: '.$this->timeOut($po['battleUseZd']).'';
-				}
-				if(isset($po['srok']) && $po['srok'] > 0){
-					$pl['srok'] = $po['srok'];
-				}
-				if($pl['srok'] > 0){ //���� �������� ��������
-					$is2 .= '<br>���� ��������: '.$this->timeOut($pl['srok']).' (�� '.date('d.m.Y H:i',$pl['time_create']+$pl['srok']).')';
-				}
-				if($pl['magic_chance'] > 0) {
-					$is2 .= '<br>����������� ������������: '.min(array($pl['magic_chance'],100)).'%';
-				} 
-				if((int)$pl['magic_inci'] > 0){ //����������������� �������� �����:
-					$efi = mysql_fetch_array(mysql_query('SELECT `id2`,`mname`,`type1`,`img`,`mdata`,`actionTime`,`type2`,`type3`,`onlyOne`,`oneType`,`noAce`,`see`,`info`,`overch`,`bp`,`noch` FROM `eff_main` WHERE `id2` = "'.((int)$pl['magic_inci']).'" LIMIT 1'));
-					if(isset($efi['id2']) && $efi['actionTime']>0){
-						$is2 .= '<br>����������������� ��������: '.$this->timeOut($efi['actionTime']);
-					}
-				}
-
-				$notr = 0;
-				if(isset($po['sudba']) && $po['sudba']!='0' && $po['sudba']!=$this->info['login']){
-					$notr++;
-				}
-				//<b>��������� �����������:</b>
-				$tr = ''; $t = $this->items['tr'];
-				$x = 0;
-				while($x < count($t)){
-					$n = $t[$x];
-					if(isset($po['tr_'.$n]) && $po['tr_'.$n] != 0) {
-						if( $n == 'sex' ) {
-							if( $this->info['sex'] != $po['tr_'.$n] ) {
-								$tr .= '<font color="red">'; $notr++;
-							}
-						}elseif($po['tr_'.$n] > $this->stats[$n]) {
-							if($n == 'align_bs' && $this->info['inTurnir'] > 0) {
-							  if($po['tr_align_bs'] == '1') {
-								 if($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2) { $pal = false; } else { $pal = true; }
-	 	 	 	 	 	 	   } elseif($po['tr_align_bs'] == '3') {
-					 	 	 	 if($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4) { $tar = false; } else { $tar = true; }
-	 	 	 	 	 	 	   }
-							}
-	 	 	 	 	 	 	if($n == 'rep') {
-								$temp = explode('::', $po['tr_'.$n]); 
-								if($this->rep['rep'.$temp[1]] < $temp[0]) { $tr .= '<font color="red">'; $notr++; } 
-								unset($temp);
-	 	 	 	 	 	    }elseif($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) {
-	 	 	 	 	 	 	 	 $tr .= '<font color="red">'; $notr++;
-							} elseif($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_'.$n]) {
-								$tr .= '<font color="red">'; $notr++;
-							}
-						}
-						$tr .= '<br />� ';
-						if($n == 'rep') {
-							$temp = explode('::',$po['tr_'.$n]);
-							$tr .= $this->is[$n].' '.ucfirst(str_replace('city',' city',$temp[1])).': '.$temp[0];
-							unset($temp);
-						} elseif($n != 'align' && $n != 'align_bs') {
-							if( $n == 'sex' ) {
-								if( $po['tr_'.$n] == 1 ) {
-									$tr .= $this->is[$n].': �������';
-								}else{
-									$tr .= $this->is[$n].': �������';
-								}
-							}else{
-								$tr .= $this->is[$n].': '.$po['tr_'.$n];
-							}
-						} else {
-							$tr .= $this->is[$n].': '.$this->align_nm[$po['tr_'.$n]];
-						}
-						if( $n == 'sex' ) {
-							if( $this->info['sex'] != $po['tr_'.$n] ) {
-								$tr .= '</font>';
-							}
-						}elseif($po['tr_'.$n] > $this->stats[$n]) {
-						  if($n == 'align_bs' && $this->info['inTurnir'] > 0 && ($pal = false || $tar = false)) {
-	 	 	 	 	 	 	 	 $tr .= '</font>';
-						  } elseif($n != 'align' && $n != 'align_bs' || floor($this->info['align']) != $po['tr_'.$n]) {
-							$tr .= '</font>';
-						  }
-						}
-					}
-					$x++;
-				}
-				if($tr!=''){
-					$is2 .= '<br><b>��������� �����������:</b>'.$tr;
-				}
-				//<b>��������� ��:</b>
-				$tr = ''; $t = $this->items['add'];
-				if(isset($po['mf_stats']) && $po['mf_stats'] > 0) {
-					$tr .= '<br>��������� ��������������: '.$po['mf_stats'];
-				}
-				if(isset($po['mf_mod']) && $po['mf_mod'] > 0) {
-					$tr .= '<br>��������� ������������: '.$po['mf_mod'];
-				}
-				if(isset($po['mf_mib']) && $po['mf_mib'] > 0) {
-					$tr .= '<br>��������� ��������� �����: '.$po['mf_mib'];
-				}
-				
-				$x = 0;
-				while($x<count($t)){
-					$n = $t[$x];
-					if(isset($po['add_'.$n],$this->is[$n])){
-						$z = '+';
-						if($po['add_'.$n]<0){
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['add_'.$n];
-						if(isset($po['mf_stats']) && $po['mf_stats'] > 0) {
-							if($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5') {
-								$tr .= ' <a href="main.php?inv=1&otdel='.$_GET['otdel'].'&rstv='.$pl['id'].'&mf='.$n.'"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-							}
-						}
-						if(isset($po['mf_mod']) && $po['mf_mod'] > 0) {
-							if($n == 'm1' || $n == 'm2' || $n == 'm4' || $n == 'm5') {
-								$tr .= ' <a href="main.php?inv=1&otdel='.$_GET['otdel'].'&rstv='.$pl['id'].'&mf='.$n.'"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-							}
-						}
-					}
-					$x++;
-				}
-				//��������� �� (�����)
-				$i = 1; $bn = array(1=>'������',2=>'�������',3=>'�����',4=>'���');
-				while($i<=4){
-					if(isset($po['add_mab'.$i])){
-						if($po['add_mab'.$i]==$po['add_mib'.$i] && $pl['geniration']==1){
-							$z = '+';
-							if($po['add_mab'.$i]<0){
-								$z = '';
-							}
-							$tr .= '<br>� ����� '.$bn[$i].': '.$z.''.$po['add_mab'.$i];
-						}else{
-							$tr .= '<br>� ����� '.$bn[$i].': '.$po['add_mib'.$i].'-'.$po['add_mab'.$i];
-						}
-						if(isset($po['mf_mib']) && $po['mf_mib'] > 0) {
-							$tr .= ' <a href="main.php?inv=1&otdel='.$_GET['otdel'].'&rstv='.$pl['id'].'&mf=mib'.$i.'"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-						}
-					}
-					$i++;
-				}
-				
-				if($tr!=''){
-					$is2 .= '<br><b>��������� ��:</b>'.$tr;
-				}
-				//<b>�������� ��������:</b>
-				$tr = ''; $t = $this->items['sv'];
-				if(isset($po['sv_yron_min'],$po['sv_yron_max'])){
-					$tr .= '<br>� ����: '.$po['sv_yron_min'].' - '.$po['sv_yron_max'];
-				}
-				$x = 0;
-				while($x<count($t)){
-					$n = $t[$x];
-					if(isset($po['sv_'.$n])){
-						$z = '+';
-						if($po['sv_'.$n]<0){
-							$z = '';
-						}
-						$tr .= '<br>� '.$this->is[$n].': '.$z.''.$po['sv_'.$n];
-					}
-					$x++;
-				}
-				if($pl['2too']==1){
-					$tr .= '<br>� ������ ������';
-				}
-				if($pl['2h']==1){
-					$tr .= '<br>� ��������� ������';
-				}
-				if(isset($po['zonb'])){
-					$tr .= '<br>� ���� ������������: ';
-					if($po['zonb']>0){
-						$x = 1;
-						while($x<=$po['zonb']){
-							$tr .= '+';
-							$x++;
-						}
-					}else{
-						$tr .= '�';
-					}
-				}
-				if($tr!=''){
-					$is2 .= '<br><b>�������� ��������:</b>'.$tr;
-				}
-				
-				//�����������
-				/*$tr = '';
-				$x = 1;
-				while($x<=4){
-					if(isset($po['tya'.$x]) && $po['tya'.$x]>0){
-						$tyc = '�������� �����';
-						if($po['tya'.$x]>6){
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>14){
-							$tyc = '����';
-						}
-						if($po['tya'.$x]>34){
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>79){
-							$tyc = '���������';
-						}
-						if($po['tya'.$x]>89){
-							$tyc = '�����';
-						}
-						if($po['tya'.$x]>=100){
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-					}
-					$x++;
-				}
-				$x = 1;
-				while($x<=7){
-					if(isset($po['tym'.$x]) && $po['tym'.$x]>0){
-						$tyc = '�������� �����';
-						if($po['tym'.$x]>6){
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>14){
-							$tyc = '����';
-						}
-						if($po['tym'.$x]>34){
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>79){
-							$tyc = '���������';
-						}
-						if($po['tym'.$x]>89){
-							$tyc = '�����';
-						}
-						if($po['tym'.$x]>=100){
-							$tyc = '������';
-						}
-						$tr .= '<br>� '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-					}
-					$x++;
-				}
-				if($tr!=''){
-					$is2 .= '<br><b>�����������:</b>'.$tr;
-				}*/
-				if($notr==0){
-					$d[0] = 1;
-					if($pl['magic_inci']!='' || $pl['magic_inc']!=''){
-						$d[2] = 1;
-					}
-				}
-				
-				$tr = '';
-				
-				if(floor($pl['iznosNOW'])>=ceil($pl['iznosMAX'])){
-					$d[0] = 0;
-					$d[2] = 0;
-				}				
-				//�������� �����
-				$tr = '';
-				//���������� �����
-				if($pl['magic_inci']!='' || $pl['magic_inc']!='') {
-					if($pl['magic_inc'] == '') {
-						$pl['magic_inc'] = $pl['magic_inci'];
-					}
-					$mgi = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$pl['magic_inc'].'" AND `type1` = "12345" LIMIT 1'));
-					if(isset($mgi['id2'])) {
-						$is2 .= '<div> �������� �������� <img height=18 title="'.$mgi['mname'].'" src="https://img.new-combats.com/i/eff/'.$mgi['img'].'"> '.$mgi['minfo'].'</div>';
-					}
-				}
-				
-				if(isset($po['rune']) && $po['rune']>0) {
-					$rnc = explode(' ',$po['rune_name']);
-					if($rnc[0] == '�����') {
-						$rnc = '#9b5d40';
-					}elseif($rnc[0] == '����') {
-						$rnc = '#3a2b64';
-					}elseif($rnc[0] == '����') {
-						$rnc = '#20a3b0';
-					}elseif($rnc[0] == '����') {
-						$rnc = '#4c7718';
-					}else{
-						$rnc = '#4c4c4c';
-					}
-					
-					$tr .= '<br>&bull; ���������� ����: <small><font color=green>&bull; <u><b>'.$po['rune_name'].'</b></u></font></small>';
-					unset($rnc);
-				}
-				
-				if(isset($po['spell']) && $po['spell']>0) {
-					$rnc = explode(' ',$po['spell_name']);
-					if($rnc[2] == '[0]') {
-						$rnc = '#282828';
-					}elseif($rnc[2] == '[1]') {
-						$rnc = '#624542';
-					}elseif($rnc[2] == '[2]') {
-						$rnc = '#77090b';
-					}elseif($rnc[2] == '[3]') {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['spell_name'] = str_replace('���������� ','',$po['spell_name']);
-					$this->is['mab1'] = '����� ������';
-					$this->is['mab2'] = '����� �������';
-					$this->is['mab3'] = '����� �����';
-					$this->is['mab4'] = '����� ���';
-					$tr .= '<br>&bull; ��������� �����������: <small><font color='.$rnc.'><u><b>'.$po['spell_name'].'</b></u> ('.$this->is[$po['spell_st_name']].': +'.$po['spell_st_val'].')</font></small>';
-					unset($this->is['mab1'],$this->is['mab2'],$this->is['mab3'],$this->is['mab4']);
-					unset($rnc);
-				}
-				
-				if(isset($po['imposed']) && $po['imposed']>0) {
-					if($po['imposed_lvl'] == 0) {
-						$rnc = 'maroon';
-					}elseif($po['imposed_lvl'] == 1) {
-						$rnc = '#624542';
-					}elseif($po['imposed_lvl'] == 2) {
-						$rnc = '#77090b';
-					}elseif($po['imposed_lvl'] == 3) {
-						$rnc = '#d99800';
-					}else{
-						$rnc = '#282828';
-					}
-					$po['imposed_name'] = str_replace('���� ','',$po['imposed_name']); 
-					$tr .= '<br>&bull; <font color='.$rnc.'>�������� ��������:</font> '.$po['imposed_name'].' '; 
-					unset($rnc);
-				} 
-				if($tr!='') {
-					$is2 .= '<br><b>��������� ��������:</b>';
-					$is2 .= $tr;
-				}
-				
-				/*
-				if($pl['lvl_itm']>0) {
-					$is2 .= '<br><b>������� ��������</b>: ['.$pl['blvl'].'/100]';
-				}
-				
-				if($pl['so']>0) {
-					$is2 .= '<br>&bull; ���� �������� ��������:';
-										
-					$is2 .= '<div style="margin-left:20px;"><small>
-					
-����: '.(0+$po['add_s1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s1']).' ��</b></small>
-<br>��������: '.$po['add_s2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s2']).' ��</b></small>
-<br>��������: '.$po['add_s3'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s3']).' ��</b></small>
-<br>���������: '.$po['add_s5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(10+25*$po['add_s5']).' ��</b></small>
-
-<br>��. ����. �����: '.$po['add_m1'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m1']).' ��</b></small>
-<br>��. ������ ����. �����: '.$po['add_m2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m2']).' ��</b></small>
-<br>��. �����������: '.$po['add_m4'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m4']).' ��</b></small>
-<br>��. ������ �����������: '.$po['add_m5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=4"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(1+2*$po['add_m5']).' ��</b></small>
-
-<br>����� ������: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab1']).' ��</b></small>
-<br>����� ������: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=6"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab2']).' ��</b></small>
-<br>����� ������: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=7"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab3']).' ��</b></small>
-<br>����� ������: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=8"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_mab4']).' ��</b></small>
-
-<br>�������� �����: '.$po['add_m10'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=9"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(4+4*$po['add_m10']).' ��</b></small>
-<br>�������� �����: '.$po['add_m11a'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=11"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_m11a']).' ��</b></small>
-
-<br>������ �� �����: '.$po['add_za'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=10"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(5+5*$po['add_za']).' ��</b></small>
-<br>������ �� �����: '.$po['add_zm'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=12"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><b>'.(4+4*$po['add_zm']).' ��</b></small>
-
-</small></div>';
-					
-					$is2 .= '&bull; �������� ����� ��������: '.$pl['so'].'';
-				}
-				*/
-					
-				if(isset($po['free_stats']) && $po['free_stats']>0){
-					$is2 .= '<br><b>������������� ������:</b>';
-					$is2 .= '<div style="margin-left:20px;"><small>����: '.$po['add_s1'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>��������: '.$po['add_s2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>��������: '.$po['add_s3'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>���������: '.$po['add_s5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs=5"><img src="https://img.new-combats.com/i/plus.gif"></a></small></div>';
-					$is2 .= '&bull; �������� �������������: '.$po['free_stats'].'';
-				}
-				
-				if(isset($po['sm_abil'])) {
-					//�������� ��������� � ������������ �����
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7){
-						$mx1 += $mx3['s'.$mx2]-$po['add_s'.$mx2];
-						$mx2++;
-					}
-					$mx1 += $this->info['ability'];
-					if($mx1>0) {
-						$is2 .= '<br><b>������������� �������������:</b>';
-						if(isset($po['sudba']) && $po['sudba']=='0') {
-							$mx1 = 0;
-							$is2 .= '<div style="margin-left:20px;"><small>&bull; ������������� ������������� ����� �������� ����� ������� ��������</small></div>';
-						}else{
-							$is2 .= '<div style="margin-left:20px;"><small>
-							����: '.(0+$po['add_s1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: '.(0+$po['add_s2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: '.(0+$po['add_s3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							������������: '.(0+$po['add_s4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������: '.(0+$po['add_s5']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							��������: '.(0+$po['add_s6']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsmst=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							</small></div>';					
-							$is2 .= '�������� �������������: '.$mx1;
-						}
-					}
-					unset($mx1,$mx2,$mx3);
-				}
-				
-				if(isset($po['sm_skill'])){
-					//�������� ��������� � ������������ �����
-					$mx2 = 1; $mx1 = 0; $mx3 = $this->lookStats($this->info['stats']);
-					while($mx2<=7){
-						$mx1 += ($mx3['a'.$mx2]+$mx3['mg'.$mx2])-($po['add_a'.$mx2]+$po['add_mg'.$mx2]);
-						$mx2++;
-					}
-					$mx1 += $this->info['skills'];
-					if($mx1>0){
-						$is2 .= '<br><b>������������� �������� ������� � ������:</b>';
-						if(isset($po['sudba']) && $po['sudba']=='0'){
-							$mx1 = 0;
-							$is2 .= '<div style="margin-left:20px;"><small>&bull; ������������� �������� ����� �������� ����� ������� ��������</small></div>';
-						}else{
-							$is2 .= '<div style="margin-left:20px;"><small>
-							���������� �������� ������: '.(0+$po['add_a1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ��������, ��������: '.(0+$po['add_a2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������, ���������: '.(0+$po['add_a3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ��������, ��������: '.(0+$po['add_a4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=4"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ����������� ��������: '.(0+$po['add_a5']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=5"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� ����: '.(0+$po['add_mg1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=6"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� �������: '.(0+$po['add_mg2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=7"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� ����: '.(0+$po['add_mg3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=8"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������� �����: '.(0+$po['add_mg4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=9"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������ �����: '.(0+$po['add_mg5']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=10"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ������ ����: '.(0+$po['add_mg6']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=11"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							���������� �������� ����� ������: '.(0+$po['add_mg7']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufsms=12"><img src="https://img.new-combats.com/i/plus.gif"></a><br>
-							</small></div>';					
-							$is2 .= '�������� �������������: '.$mx1;
-						}
-					}
-					unset($mx1,$mx2,$mx3);
-				}
-				
-				if(isset($po['complect']) || isset($po['complect2'])){
-					$is2 .= '<br><i>�������������� ����������:</i>';
-				}
-				if(isset($po['complect'])){
-					//�� ������������
-					$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-					$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect'].'" ORDER BY  `x` ASC LIMIT 20');
-					while($plc = mysql_fetch_array($spc)){
-						$com1['name'] = $plc['name'];
-						$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-						//�������� ���������
-						$i1c = 0; $i2c = 0;
-						$i1e = $this->lookStats($plc['data']);
-						while($i1c<count($this->items['add'])){
-							if(isset($i1e[$this->items['add'][$i1c]])){
-								$i3c = $i1e[$this->items['add'][$i1c]];
-								if($i3c>0){
-									$i3c = '+'.$i3c;
-								}
-								if($i2c>0){
-									$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}else{
-									$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}								
-								$com1['text'] .= '<br>';
-								$i2c++;
-							}
-							$i1c++;
-						}
-						unset($i1c,$i2c,$i3c);
-						$com1['x']++;
-					}
-					$is2 .= '<br>&bull; ����� ���������: <b>'.$com1['name'].'</b><br><small>';
-					$is2 .= $com1['text'];
-					$is2 .= '</small>';
-				}
-				if(isset($po['complect2'])){
-					//�� ������������
-					$com1 = array('name'=>'����������� ��������','x'=>0,'text'=>'');
-					$spc = mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.$po['complect2'].'" ORDER BY  `x` ASC LIMIT 20');
-					while($plc = mysql_fetch_array($spc)){
-						$com1['name'] = $plc['name'];
-						$com1['text'] .= '&nbsp; &nbsp; &bull; <font color="green">'.$plc['x'].'</font>: ';
-						//�������� ���������
-						$i1c = 0; $i2c = 0;
-						$i1e = $this->lookStats($plc['data']);
-						while($i1c<count($this->items['add'])){
-							if(isset($i1e[$this->items['add'][$i1c]])){
-								$i3c = $i1e[$this->items['add'][$i1c]];
-								if($i3c>0){
-									$i3c = '+'.$i3c;
-								}
-								if($i2c>0){
-									$com1['text'] .= '&nbsp; &nbsp; '.$this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}else{
-									$com1['text'] .= $this->is[$this->items['add'][$i1c]].': '.$i3c;
-								}								
-								$com1['text'] .= '<br>';
-								$i2c++;
-							}
-							$i1c++;
-						}
-						unset($i1c,$i2c,$i3c);
-						$com1['x']++;
-					}
-					$is2 .= '<br>&bull; ����� ��������� (��������): <b>'.$com1['name'].'</b><br><small>';
-					$is2 .= $com1['text'];
-					$is2 .= '</small>';
-				}
-				
-				if($pl['max_text'] > 0) {
-					//���������
-					$sm_sp = mysql_query('SELECT `id`,`item_id`,`time`,`login`,`type`,`text`,`city`,`x` FROM `items_text` WHERE `item_id` = "'.$pl['id'].'" ORDER BY `id` ASC  LIMIT 500');
-					$sma = 0; $smt = ''; $ixi = 0;
-					while($sm_pl = mysql_fetch_array($sm_sp)) {
-						if($sm_pl['type']==0) {
-							$smt .= '<font class="date">'.date('d.m.Y H:i',$sm_pl['time']).'</font> <b>'.$sm_pl['login'].'</b>. '.$sm_pl['text'].'<br>';
-						}else{
-							$smt .= $sm_pl['text'].'<br>';
-						}
-						if($ixi == 2) {
-							$smt .= '<div style="display:none" id="close_text_itm'.$pl['id'].'">';
-						}
-						$ixi++;
-						$sma += $sm_pl['x'];
-					}
-					$smt .= '</div>';
-					if($pl['max_text']-$pl['use_text'] > 0) {
-						$is2 .= '<div>���������� ��������: '.($pl['max_text']-$pl['use_text']).'</div>';
-					}
-					if($sma > 0) {
-						$is2 .= '<div>�� �������� ������� �����:<br>
-								<table width="100%" border="0" cellspacing="0" cellpadding="0">
-								  <tr>
-									<td><div style="background-color:#e8e8e8;padding:5px;"><CODE>'.$smt.'</CODE></div></td>
-									<td width="20" align="center" valign="top"><img style="cursor:pointer" onClick="seetext('.$pl['id'].');" src="https://img.new-combats.com/expand.gif" height="35" width="10"></td>
-								  </tr>
-								</table>
-							</div>';
-					}
-					unset($sm_sp,$sma,$sm_pl);
-				}elseif(isset($po['onitm_text'])) {
-					$is2 .= '<div>�� �������� ������� �����:<br>
-						<table width="100%" border="0" cellspacing="0" cellpadding="0">
-							<tr>
-								<td><div style="background-color:#e8e8e8;padding:5px;"><CODE>'.$po['onitm_text'].'</CODE></div></td>
-							</tr>
-						</table>
-					</div>';
-				}
-				
-				if(isset($po['gravi'])) {
-					$is2 .= '<br>�� ����������� ������������� �������: <b>'.$po['gravi'].'</b>';
-				}
-
-				$is2 .= '<small style="">';
-
-				if($pl['info']!=''){
-					$is2 .= '<div><b>��������:</b></div><div>'.$pl['info'].'</div>';
-				}
-
-				if(isset($po['info']) && $po['info']!=''){
-					$is2 .= '<div>'.$po['info'].'</div>';
-				}
-
-				if($pl['maidin']!=''){
-					//$is2 .= '<div>������� � '.$this->city_name[$pl['maidin']].'</div>';
-				}
-				
-				if(isset($po['toclan'])) {
-					$po['toclan1'] = explode('#',$po['toclan']);
-					$clpo = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$po['toclan1'][0].'" LIMIT 1'));
-					if(isset($clpo['id'])) {
-						$is2 .= '<div style="color:brown;">������� ����������� ����� <img style="vertical-align:bottom" src="https://img.new-combats.com/i/clan/'.$clpo['name_mini'].'.gif" width="24" height"15"> <b>'.$clpo['name'].'</b>';
-						$plpo = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "'.$po['toclan1'][1].'" LIMIT 1'));
-						if(isset($plpo['id'])) {
-							$is2 .= ' <font color=grey>(��� ������ <b>'.$plpo['login'].'</b><a href="info/'.$plpo['id'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_'.$plpo['cityreg'].'.gif" width="9"></a>)</font>';
-							if( $plpo['login'] == $this->info['login'] ) {
-								if( isset($_GET['backmyitm']) ) {
-									$pl['inOdet'] = 0;
-									$pl['uid'] = $plpo['id'];
-									unset($po['toclan1'],$po['toclan']);
-									$pl['data'] = $this->impStats($po);
-									mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($pl['data']).'",`inOdet` = 0,`uid` = "'.$pl['uid'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								}
-								$is2 .= '<br>(�� �������� ��������: <a href="main.php?clan&deposit&backmyitm='.$pl['id'].'">������� ������� ����</a>)';
-							}
-						}
-						$is2 .= '</div>';
-					}
-				}
-				if(isset($po['noremont'])){
-					$is2 .= '<div style="color:brown;">������� �� �������� �������</div>';
-				}
-				if(isset($po['nosale'])){
-					$is2 .= '<div style="color:brown;">������� ������ �������</div>';
-				}
-				if(isset($po['nomodif'])){
-					$is2 .= '<div style="color:brown;">������� ������ ��������</div>';
-				}
-				if(isset($po['nodelete'])){
-					$is2 .= '<div style="color:brown;">������� ������ ���������</div>';
-				}
-				if(isset($po['frompisher'])){
-					$is2 .= '<div style="color:brown;">������� �� ����������</div>';
-				}
-				if(isset($po['sleep_moroz']) && $po['sleep_moroz'] > 0 ) {
-					$is2 .= '<div style="color:brown;">������� �� �������� �� ����� ���</div>';
-				}
-				
-				if(isset($po['fromlaba']) && $po['fromlaba']>0){
-					$is2 .= '<div style="color:brown;">������� �� ���������</div>';
-				}
-				
-				if(isset($po['vip_sale']) && $po['vip_sale']>0){
-					if( $this->stats['slvtm'] > time() && $this->stats['silver'] > 1 ) {
-						if( $pl['time_create'] != $this->stats['slvtm'] ) {
-							$pl['time_create'] = $this->stats['slvtm'];
-							mysql_query('UPDATE `items_users` SET `time_create` = "'.$pl['time_create'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						}
-						$is2 .= '<div style="color:brown;">������� ����� ���������� ����� '.$this->timeOut($pl['time_create']-time()).'</div>';
-						//$is2 .= '<div style="color:brown;">������� �������� ����� '.$this->timeOut($pl['time_create']-time()+86400*30).'</div>';
-					}else{
-						$is2 .= '<div style="color:brown;">������� ����������, ����������� ���������� VIP</div>';
-						if( ($pl['time_create']-time()+86400*30) < 1 ) {
-							$is2 .= '<div style="color:brown;">������� ���������� � ��� �� ������...</div>';
-						}else{
-							$is2 .= '<div style="color:brown;">������� �������� ����� '.$this->timeOut($pl['time_create']-time()+86400*30).'</div>';
-						}
-					}
-				}
-				
-				if($pl['dn_delete']>0){
-					$is2 .= '<div style="color:brown;">������� ����� ������ ��� ������ �� ����������</div>';
-				}	
-				
-				if( $this->pokol > $pl['geni'] ) {
-					$is2 .= '<div style="color:brown">������� �������</div>';
-				}
-				
-				if(isset($po['zazuby']) && $po['zazuby']>0){
-					$is2 .= '<div style="color:brown;">������� ������ �� ����</div>';
-				}
-				
-				$is2 .= '</small>';
-				
-				if($col > 1000) {
-					$is1 .= '<table border="0" cellspacing="0" cellpadding="0">
-							  <tr>
-								<td><img src="https://img.new-combats.com/i/items/'.$pl['img'].'"></td>
-							  </tr>
-							  <tr>
-								<td align="right"><span style="position:relative;margin-bottom:5px;"><small style="position:absolute;background-color:grey;padding:1px;bottom:1px;right:1px;background-color:#E0E0E0;"><b>x'.$col.'</b></small></span></td>
-							  </tr>
-							</table>';
-				
-				}else{				
-					$is1 .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin-bottom:5px;">';
-				}
-
-				//$is1 .= '<br><small>(id'.$pl['id'].')</small><br>';
-				
-				$is1 .= '<br>';
-
-				if($type == 81) {
-					$is1 .= '<small><a href="main.php?inv=1&otdel='.floor($_GET['otdel']).'&use_rune='.floor($_GET['use_rune']).'&item_rune=0&item_rune_id='.$pl['id'].'">������� ������ �������</a></small>';
-				}elseif($type == 80) {
-					$is1 .= '<small><a href="main.php?inv=1&otdel='.floor($_GET['otdel']).'&use_rune='.floor($_GET['use_rune']).'&item_rune=0&item_rune_id='.$pl['id'].'">������� ������ �������</a></small>';
-				}elseif($type == 69) {
-					if(!isset($po['hprs'])) {
-						$po['hprs'] = 0.001;
-					}
-					if(!isset($po['hprp'])) {
-						$po['hprp'] = 0.0001;
-					}
-					$prs1 = $this->floordec($po['hprs']*$col,2);
-					$rps1 = $this->floordec($po['hprp']*$col);
-					$is1 .= '<small style="font-size:11px;"><a href="?sale1kr='.$pl['id'].'">�������� �� '.$prs1.' ��.</a><br><a href="?sale1rep='.$pl['id'].'">�������� �� '.$rps1.' ��. ���������</a>';
-					$is1 .= '</small>';
-				}elseif($type == 68) {
-					$is1 .= '<small style="font-size:11px;"><a href="?r=3&itm_take='.$pl['id'].'">�������</a><br><a href="?r=3&itm_cancel='.$pl['id'].'">����������</a>';
-					if($pl['lastUPD'] > 0) {
-						$is1 .= '<br><br>('.$this->timeOut(($pl['lastUPD']+7*24*60*60) - time()).')';
-					}
-					$is1 .= '</small>';
-				}elseif($type == 67) {
-					$is1 .= '<small style="font-size:11px;"><a href="javascript:void(0)" onclick="itmToUser('.$pl['id'].')">�������� �� '.(round(1+$pl['price1']/100*7)*$col).' ��.</a></small>';
-				}elseif($type == 66) {
-					$pos = explode('#', $po['toclan']);
-	 	 	 	 	 $us_1 = $pos[1];
-					if($pl['uid'] < 1) {
-						$is1 .= '<small style=""><a href="?clan&deposit&take_itm='.$pl['id'].'">����� �������</a></small>';
-					}else{
-						$yui = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`cityreg` FROM `users` WHERE `id` = "'.mysql_real_escape_string($pl['uid']).'" LIMIT 1'));
-						$is1 .= '<small>������� � ������<br><b>'.$yui['login'].'</b><a href="info/'.$yui['id'].'" target="_blank"><img width="10" src="https://img.new-combats.com/i/inf_'.$yui['cityreg'].'.gif"></a></small>';
-						if($this->info['tt'][14][0] == 1 || ($this->info['id'] == $us_1)) {
-						  $is1 .= '<br><small style=""><a href="?clan&deposit&ungive_itm='.$pl['id'].'">������ �������</a></small>';
-						}
-					}
-				}elseif($type == 65) {
-					if(!isset($po['toclan'])) {
-						$is1 .= '<small style=""><a href="?clan&deposit&give_itm='.$pl['id'].'">������������</a></small>';	
-					}else{
-						$is1 .= '<small style=""><a href="?clan&deposit&give_itm='.$pl['id'].'">�������</a></small>';	
-					}
-				}elseif($type == 62) {
-					$upgitm = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "'.$pl['item_id'].'" LIMIT 1'));
-					if(!isset($upgitm['id'])) {
-						$is1 .= '<small style="">��������� ����������</small>';
-					}else{
-						$prcup = '';
-						if($upgitm['price1'] > 0) {
-							$prcup .= $upgitm['price1'].' ��.';
-						}
-						if($upgitm['price2'] > 0) {
-							if($prcup!='') {
-								$prcup .= ' � ';
-							}
-							$prcup .= $upgitm['price2'].' ���.';
-						}
-						$is1 .= '<small style=""><a href="?r=8&upgradelvl='.$pl['id'].'">�������� �� '.$prcup.'</a></small>';
-						unset($prcup);
-					}
-				}elseif($type == 63) {
-					$prcup = '';
-					$is1 .= '<small style=""><a href="?r=9&upgradelvlcom='.$pl['id'].'">��������</a></small>';
-					unset($prcup);
-				}elseif($type == 64) {
-					$prcup = '';
-					$is1 .= '<small style=""><a href="?r=9">������� ������ �������</a></small>';
-					unset($prcup);
-				}elseif($type==61) { //��������� ��������
-					if($pl['price1']>$pl['1price']) {
-						$pl['1price'] = $pl['price1'];
-					}
-					$prpod = $pl['1price']/2.37;
-					if($pl['price2']>$pl['2price']) {
-						$pl['2price'] = $pl['price2'];
-					}
-					$prpod2 = 30*($pl['2price']/2.37);
-					if($prpod2 > $prpod) {
-						$prpod = $prpod2;
-					}
-					if(!isset($po['add_s1']) && !isset($po['add_s2']) && !isset($po['add_s3']) && !isset($po['add_s5'])) {
-						$prpod = $prpod/2.37;
-					}
-					$prpod = round($prpod+$prpod/100*(37.795*($po['upgrade']+1)));
-					$is1 .= '<small style=""><a href="?upgrade='.$pl['id'].'&r=6&t=2&rnd='.$code.'">������� �� '.$prpod.' ��.</a></small>';	
-				}elseif($type==60) { //���������������
-					if($pl['price1']>$pl['1price']) {
-						$pl['1price'] = $pl['price1'];
-					}
-					$prpod = $pl['1price']/2;
-					if($pl['price2']>$pl['2price']) {
-						$pl['2price'] = $pl['price2'];
-					}
-					$prpod2 = 30*($pl['2price']/2.37);
-					if($prpod2 > $prpod) {
-						$prpod = $prpod2;
-					}
-					if(!isset($po['add_s1']) && !isset($po['add_s2']) && !isset($po['add_s3']) && !isset($po['add_s5'])) {
-						$prpod = $prpod/2;
-					}
-					$prpod = round($prpod);
-					$is1 .= '<small style=""><a href="?modif='.$pl['id'].'&r=7&t=2&rnd='.$code.'">�������������� �� '.$prpod.' ��.</a></small>';				
-					
-				}elseif($type==59) { //�������������
-					if($po['tr_lvl'] > $pl['level']) {
-						$pl['level'] = $po['tr_lvl'];
-					}
-					//$prpod = $pl['level']*200;
-					$prpod = 250;
-					$prpod_ekr = $pl['level']*0.25;
-					//$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������������� �� '.$prpod.' ��.</a></small>';
-					
-					if($this->stats['repair_z'] >=1) {
-						$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������� �������������</a></small>';
-					}else{
-						$is1 .= '<small style=""><a href="?ubeff='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������������� �� '.$prpod.' ��.</a></small>
-						<!--<br><small style=""><a href="?ubeff_ekr='.$pl['id'].'&r=3&t=2&rnd='.$code.'">���������������� �� '.$prpod_ekr.' ���.</a></small>-->';
-					}
-				}elseif($type==58) { //������������ ���
-					if($po['tr_lvl'] > $pl['level']) {
-						$pl['level'] = $po['tr_lvl'];
-					}
-					//$prpod = 50*$pl['level']+200;
-					$prpod = 250;
-					$prpod_ekr = $pl['level']*0.15;
-					if($this->stats['repair_r']>=1){
-						$is1 .= '<small style=""><a href="?unrune='.$pl['id'].'&r=4&t=2&rnd='.$code.'">��������� ������� ����</a></small>';
-					}else{
-						$is1 .= '<small style=""><a href="?unrune='.$pl['id'].'&r=4&t=2&rnd='.$code.'">������� ���� �� '.$prpod.' ��.</a></small><br>
-						<!--<small style=""><a href="?unrune_ekr='.$pl['id'].'&r=4&t=2&rnd='.$code.'">������� ���� �� '.$prpod_ekr.' ���.</a>
-						</small> -->';
-					}
-				} elseif($type == 57) {
-					$prpod = 30;
-					if($pl['type'] == 22) { $prpod = 35; } elseif($pl['type'] == 18) { $prpod = 15; }
-					if(isset($po['gravi'])) {
-			 	 	   $is1 .= '<small style=""><a onclick="top.un_grava(\''.$pl['id'].'\',\''.$pl['name'].'\',\''.$prpod.'.00\',\'data\')" href="javascript:void(0)">�������� ������� �� '.$prpod.' ��.</a></small>';
-					} else {
-					  $is1 .= '<small style=""><a onclick="top.grava(\''.$pl['id'].'\',\''.$pl['name'].'\',\''.$prpod.'.00\',\'data\')" href="javascript:void(0)">������������� ������� �� '.$prpod.' ��.</a></small>';
-					}
-				} elseif($type==56) { //��������
-					if($po['tr_lvl']>$pl['level']) {
-						$pl['level'] = $po['tr_lvl'];
-					}
-					$prpod = 5*$pl['level']+10;
-					$prhp = 6*$pl['level']+6;
-					$is1 .= '<small style=""><a href="?podgon='.$pl['id'].'&r=5&t=2&rnd='.$code.'">��������� �� '.$prpod.' ��.</a></small>';
-				}elseif($type==15) { //�������� �����
-					$is1 .= '<a href="main.php?pet=1&obj_corm='.$pl['id'].'&rnd='.$code.'">�������</a>';
-				}elseif($type==11){
-					$pl['rep'] = 0;
-					if($this->rep['rep1']<100) {
-						if( $po['tr_lvl'] >= 4 && $po['tr_lvl'] <= 6 ) {
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						}
-					}elseif($this->rep['rep1']>99 && $this->rep['rep1']<1000) {
-						if( $po['tr_lvl'] >= 7 && $po['tr_lvl'] <= 8 ) {
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 1;
-						}
-					}elseif($this->rep['rep1']>999) {
-						if( $po['tr_lvl'] >= 9 && $po['tr_lvl'] <= 10 ) {
-							$pl['rep'] = 1;
-						}
-						if($pl['item_id']==1035){
-							$pl['rep'] = 1;
-						}
-					}else{
-						if($pl['item_id']==1035){
-							$pl['rep'] = 2;
-						}
-					}
-					$is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\''.$pl['img'].'\','.$pl['id'].','.$pl['rep'].');">�������</a>';
-				}elseif($type==14){
-					$is1 .= '<a href="javascript:void(0);" onclick="massTakeItRun(\''.$pl['img'].'\','.$pl['id'].',0);">�������</a>';
-				}elseif($type==12){
-					$is1 .= '<a href="javascript:void(0);" onclick="takeItRun(\''.$pl['img'].'\','.$pl['id'].',1);">�������</a>';
-				}elseif($type==10){
-					//������ (����������� ��������� � ������ (��� �������))
-					$is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">� ������</a>';
-				}elseif($type==9){
-					//������ (����������� ��������� � ��������� (��� �������))
-					$is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">��� ������</a>';
-				 }elseif($type==8){
-					 //������ (����������� ��������� � ���������)
-					 $is1 .= '<a href="javascript:void(0)" class="obj_add" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">� ������</a>';
-				 }elseif($type==7){
-					 //������ (����������� ��������� � ������)
-					 $is1 .= '<a href="javascript:void(0)" class="obj_take" data-code="'.$code.'" data-room="'.((int)$_GET['room']).'" rel="'.$pl['id'].'">� ������</a>';
-				 }elseif($type==6){
-					//��������� �������
-					$is1 .= '<a href="main.php?otdel=2&add_item_f='.$pl['id'].'&rnd='.$code.'">��������</a>';
-				}elseif($type==5){
-					//��������
-					$is1 .= '<a onClick="saleitem('.$pl['id'].',1); return false;" href="javascript:void(0)">��������</a><br><a onClick="saleitem('.$pl['id'].',2); return false;" href="#">��������</a><br><small style="font-size:10px">(�����: 1 ��.)</small>';
-				}elseif($type==12){
-					//�������� �����
-					$skcd = round($col*($pl['price1']*0.06-0.01*$this->stats['os1']),2);
-					if($skcd < 0.06) {
-						$skcd = 0.06;
-					}
-					$is1 .= '<a href="main.php?otdel='.$_GET['otdel'].'&setlogin='.$_REQUEST['setlogin'].'&setobject='.$pl['id'].'&room=2&tmp='.$code.'" onclick="return confirm(\'�������� ������� '.$pl['name'].'?\')">��������&nbsp;��&nbsp;'.(1+$skcd).'&nbsp;��.</A>';
-				}elseif($type==13){
-					//�������� ����
-					if($pl['1price']>0){
-					$mess = "���������� �� ��������? ������� ����� ���������!";
-					$pl['name']= '������ '.$pl['1price'].' ��.';
-					}else{
-					$mess = "���������� �� ��������? ������� ����� ��������� �����������";
-					}
-					$date1 = $pl['delete']-time();
-					$is1 .='<BR><NOBR><A href="?room=4&to_box='.$pl['id'].'&tmp='.$code.'">�������</A></NOBR>
-							<BR><NOBR><A onclick="return confirm(\''.$mess.'\')" href="?room=4&del_box='.$pl['id'].'&tmp='.$code.'">����������</A></NOBR><SMALL><BR><BR>('.date("j ��. H �.",$date1).' )</small></TD>';
-				}elseif($type==4){
-					//������
-					$r1 = round($pl['price1']*0.1/100,2);
-					$r2 = round($pl['price1']*0.1/10,2);
-					$r3 = round($pl['price1']*$pl['iznosNOW']*0.10/100,2);
-					
-					if( $this->stats['repair_discount'] >= 1 ) {
-						$r1 = round(($r1/100*25),2);
-						$r2 = round(($r2/100*25),2);
-						$r3 = round(($r3/100*25),2);
-					}
-					
-					if($r1<0.01){ $r1 = 0.01; }
-					if($r2<0.01){ $r2 = 0.01; }
-					if($r3<0.01){ $r3 = 0.01; }
-					$is1 .= '<small style=""><a href="?remon='.$pl['id'].'&t=1&rnd='.$code.'">������ 1 ��. �� '.$r1.' ��.</a><br>';
-					if($pl['iznosNOW']>=10){$is1 .= '<a href="?remon='.$pl['id'].'&t=2&rnd='.$code.'">������ 10 ��. �� '.$r2.' ��.</a><br>';}
-					$is1 .= '<a href="?remon='.$pl['id'].'&t=3&rnd='.$code.'">������ ������ �� '.$r3.' ��.</a></small>';
-					if($c['zuby'] == true) {
-						if( $this->info['level'] < 8 ) {
-							$is1 .= '<hr><small style=""><a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz='.$pl['id'].'&t=1&rnd='.$code.'">������ 1 ��. �� '.$this->zuby($r1).'</a><br>';
-							if($pl['iznosNOW']>=10){$is1 .= '<a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz='.$pl['id'].'&t=2&rnd='.$code.'">������ 10 ��. �� '.$this->zuby($r2).'</a><br>';}
-							$is1 .= '<a onClick="if(!confirm(\'��������������� ������� �� ����?\n(������� ������ ����� �������) \')){ return false; }" href="?remonz='.$pl['id'].'&t=3&rnd='.$code.'">������ ������ �� '.$this->zuby($r3).'</a></small>';
-						}
-					}
-				}elseif($type==3){
-					$is1 .= '<input type="button" onClick="document.getElementById(\'itemgift\').value='.$pl['id'].';document.F1.submit();" value="��������" />';
-				}elseif($type==2){
-					global $shopProcent; 
-					$shpCena = $pl['1price'];
-					if( $pl['1price'] == 0 ) {
-						$shpCena = $pl['price1'];
-					}
-					$plmx = 0;
-					if($pl['iznosMAXi']!=$pl['iznosMAX'] && $pl['iznosMAX']!=0){
-						$plmx = $pl['iznosMAX'];
-					}else{
-						$plmx = $pl['iznosMAXi'];
-					}
-					if($pl['iznosNOW']>0){
-						$prc1 = floor($pl['iznosNOW'])/ceil($plmx)*100;
-					}else{
-						$prc1 = 0;
-					}
-					$shpCena = $this->shopSaleM($shpCena,$pl);
-					$shpCena = $shpCena/100*(100-$prc1);
-					if( $pl['iznosMAXi'] < 999999999 ) {
-						if($pl['iznosMAX']>0 && $pl['iznosMAXi']>0 && $pl['iznosMAXi']>ceil($pl['iznosMAX']))
-						{
-							$shpCena = $shpCena/100*(ceil($pl['iznosMAX'])/$pl['iznosMAXi']*100);
-						}
-					}
-					$shpCena = $this->round2($shpCena/100*(100-$shopProcent));
-					if($shpCena<0){
-						$shpCena = 0;
-					} 
-					if($pl['kolvo']>0){
-						$shpCena = $shpCena*$pl['kolvo'];
-					}
-	 	 	 	 	 if(isset($po['toclan'])) {
-						$po['toclan1'] = explode('#',$po['toclan']);
-						$us_1 = $po['toclan1'][1];
-						if($us_1 != $this->info['id']) {
-							$d_s = false;
-						} else {
-							$d_s = true;
-						}
-					} else {
-						$d_s = true;
-					}
-					if($d_s == true) { // ������� �� �� ���
-						$is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'������� ������� &quot;'.$pl['name'].'&quot; �� '.$shpCena.' ��.?\')){ location = \'main.php?sale&sd4='.$this->info['nextAct'].'&item='.$pl['id'].'&rnd='.$code.'\'; }">������� �� '.$shpCena.' ��.</a>';
-						if($pl['pricerep'] > 0) {
-							$is1 .= '<br><a href="javascript:void(0)" onClick="if(confirm(\'�������� ������� &quot;'.$pl['name'].'&quot; �� '.floor($pl['pricerep']*$pl['kolvo']/2).' ��������������?\')){ location = \'main.php?sale&sd4='.$this->info['nextAct'].'&item_rep='.$pl['id'].'&rnd='.$code.'\'; }">�������� �� '.floor($pl['pricerep']*$pl['kolvo']/2).' ����c. </a>';
-						}
-	 	 	 	 	 } else {
-						$is1 .= '��� �� ��� �������.';
-	 	 	 	 	 }
-				}elseif($type==16){
-					$shpCena = $pl['price2'];
-					if($pl['2price'] > 0 ) {
-						$shpCena = $pl['2price'];
-					}
-					$shpCena = $this->shopSaleM($shpCena,$pl);
-					if($pl['kolvo']>0){
-						$shpCena = $shpCena*$pl['kolvo'];
-					}
-					$plmx = 0;
-					if($pl['iznosMAXi']!=$pl['iznosMAX'] && $pl['iznosMAX']!=0){
-						$plmx = $pl['iznosMAX'];
-					}else{
-						$plmx = $pl['iznosMAXi'];
-					}
-					if($pl['iznosNOW']>0){
-						$prc1 = floor($pl['iznosNOW'])/ceil($plmx)*100;
-					}else{
-						$prc1 = 0;
-					}
-					$shpCena = $shpCena/100*(100-$prc1);
-					if($pl['iznosMAX']>0 && $pl['iznosMAXi']>0 && $pl['iznosMAXi']>$pl['iznosMAX']){
-						$shpCena = $shpCena/100*($pl['iznosMAX']/$pl['iznosMAXi']*100);
-					}
-					//$shpCena = $this->round2($shpCena*0.5); // ���� ���������
-					if( isset($po['art']) ) {
-						$shpCena = $this->round2($shpCena*$this->berezCena()); // ���� ����
-					}else{
-						$shpCena = $this->round2($shpCena*$this->berezCena()); // ����
-					}
-					if($shpCena<0){
-						$shpCena = 0;
-					}
-	 	 	 	 	 if(isset($po['toclan'])) {
-						$po['toclan1'] = explode('#',$po['toclan']);
-						$us_1 = $po['toclan1'][1];
-						if($us_1 != $this->info['id']) {
-							$d_s = false;
-						} else {
-							$d_s = true;
-						}
-					} else {
-						$d_s = true;
-					}
-	 	 	 	 	 if($d_s == true) {
-						$is1 .= '<a href="javascript:void(0)" onClick="if(confirm(\'������� ������� &quot;'.$pl['name'].'&quot; �� '.$shpCena.' ���.?\')){ location = \'main.php?sale&sd4='.$this->info['nextAct'].'&item='.$pl['id'].'&rnd='.$code.'\'; }">������� �� '.$shpCena.' ���.</a>';
-					 } else {
-						$is1 .= '��� �� ��� �������.';
-					 }
-	 	 	 	 }elseif($type==30){
-					if(isset($po['toclan'])) {
-							$po['toclan1'] = explode('#',$po['toclan']);
-							$us_1 = $po['toclan1'][1];
-							if($us_1 != $this->info['id']) {
-							$d_s = false;
-						} else {
-							$d_s = true;
-						}
-					} else {
-						$d_s = true;
-					}
-	 	 	 	 	 if($d_s == true) {
-	 	 	 	 	   $is1.= '<form method="POST"><input type="hidden" value="'.$pl['id'].'" name="iid"><input type="text" value="" name="summTR"><input type="submit" value="����� � �������" name="PresTR"></form>'; 
-					} else {
-	 	 	 	 	   $is1.= '��� �� ��� �������.';
-	 	 	 	 	}
-	 	 	 	}elseif($type==31){
-					$is1.= '<form method="POST"><input type="hidden" value="'.$pl['id'].'" name="iid"><input type="submit" value="�������" name="PresTR"> </form>';
-				}else{
-					if($d[2]==1) { //����� ������������
-						$inv1 = '';
-						if(isset($_GET['inv'])) {
-							$inv1 = 'inv=1&';
-						}
-						if($pl['item_id']==74){
-							$is1 .= '<a onclick="top.addNewSmile('.$pl['id'].',0); return false;" href="javascript:void(0)" title="������������">���-��</a>';
-						}else{
-							$useUrl = '';
-							if($pl['magic_inc']==''){
-								$pl['magic_inc'] = $pl['magic_inci'];
-							}
-							if($pl['magic_inc'] && $pl['type']==30){
-								//���������� �������
-								$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-								$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');';
-							}elseif($pl['magic_inc'] && $pl['type']==29){ //���������� �������� 
-								if(isset($po['useOnLogin']) && !isset($po['zazuby'])){ //�� ���������
-									$useUrl = 'top.useMagic(\''.$pl['name'].'\','.(0+$pl['id']).',\''.$pl['img'].'\',1,\'main.php?'.$inv1.'otdel='.((int)$_GET['otdel']).'&use_pid='.$pl['id'].'&rnd='.$code.'\');';
-								}else{ //������ ������������� (�� ����, ���� ��� �������� ��������\������)
-									$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-									$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\','.(0+$_GET['otdel']).');';
-								}
-								//�� �������
-							}
-							if($useUrl != '') {
-								$is1 .= '<a href="javascript:void(0)" onClick="'.$useUrl.'" title="������������">���-��</a>';
-							}else{
-								$d[2] = 0;
-							}
-						}
-					}
-					
-					if($pl['max_text'] > 0 && $pl['max_text']-$pl['use_text'] > 0) {
-						$is1 .= '<a onclick="top.addNewText('.$pl['id'].','.($pl['max_text']-$pl['use_text']).','.$pl['inRazdel'].'); return false;" href="javascript:void(0)" title="�������� ����� �� ��������">��������</a><br>';
-					}
-					if($pl['type']==31 || $pl['type']==46 || $pl['type']==62 || $pl['type']==68 || $pl['type']==37 || $pl['type']==47){
-						if($d[2]==1){
-							$is1 .= '<br>';
-						}
-						if($pl['type'] != 37 || !isset($po['item_inbox']) || $po['item_inbox'] == 0) {
-							$is1 .= '<a href="javascript:void(0);" onClick="top.useRune('.$pl['id'].',\''.$pl['name'].'\',\''.$pl['img'].'\',\'main.php?inv=1&otdel='.((int)$_GET['otdel']).'&use_rune='.$pl['id'].'&rnd='.$code.'\');return false;" title="������������">���-��</a>';
-						}
-					}
-					
-					if($d[0]==1 && $pl['type']!=30 && $pl['type']!=31 && (($pl['type']!=38 && $pl['type']!=39 && $pl['type']!=37) || $pl['gift']!='')) {//����� �����
-						if(!isset($po['noodet']) && $pl['inslot'] > 0){
-							if($d[2]==1){
-								$is1 .= '<br>';
-							}
-							$is1 .= '<a href="main.php?otdel='.$pl['inRazdel'].'&inv=1&oid='.$pl['id'].'&rnd='.$code.'" title="������">������</a>';
-						}
-					}
-					if(isset($po['open']) && $d[0]==1){
-						if($d[2]==1){
-							$is1 .= '<br>';
-						}
-						$is1 .= '<a href="main.php?otdel='.$pl['inRazdel'].'&inv=1&open=1&oid='.$pl['id'].'&rnd='.$code.'" title="�������">�������</a>';	
-					}
-					if(isset($po['close'])){
-						if($d[2]==1){
-							$is1 .= '<br>';
-						}
-						$is1 .= '<small><b>������� ������</b></small>';	
-					}
-					if($pl['group']>0){
-						$is1 .= '<br>';
-						if($this->itemsX($pl['id']) < $pl['group_max'] ) {
-							$is1 .= '<a href="main.php?inv=1&otdel='.((int)$_GET['otdel']).'&stack='.$pl['id'].'&rnd='.$code.'" title="�������"><img src="https://img.new-combats.com/i/stack.gif" /></a>';
-						}
-						if($this->itemsX($pl['id'])>1 ){ 
-							$is1 .= ' <a
-							onClick="top.unstack('.$pl['id'].',\''.$pl['img'].'\',\''.$pl['name'].'\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td align=\\\'center\\\' rowspan=\\\'2\\\' width=\\\'70px\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></td><td align=\\\'left\\\'>��������� ������� <b>'.$pl['name'].'</b>?</td></tr></table>\',\''.intval($_GET['otdel']).'\'); return false;"
-							href="main.php?inv=1&otdel='.((int)$_GET['otdel']).'&unstack='.$pl['id'].'&rnd='.$code.'" title="���������"><img src="https://img.new-combats.com/i/unstack.gif" /></a>'.$script;
-						}
-					}
-					if(isset($po['toclan'])) {
-						$po['toclan1'] = explode('#',$po['toclan']);
-						$us_1 = $po['toclan1'][1];
-						if($us_1 != $this->info['id']) {
-							$d[1] = 0;
-						}
-	 	 	 	 	}
-					
-					$is1 .= ' <a href="javascript:void(0);" onclick="top.addfastpanel(\''.$pl['id'].'\',\''.$pl['name'].'\',\''.$pl['type'].'\',\''.$pl['1price'].'\',\''.$pl['2price'].'\',\''.$this->city_name[$pl['maidin']].'\',\''.$pl['img'].'\',\''.$pl['item_id'].'\',\''.$pl['iznosNOW'].'\',\''.$pl['iznosMAX'].'\',\''.intval($_GET['otdel']).'\',\''.$d[0].'\',\''.$d[2].'\',\'0\');" title="�������� � ���������"><img width="16" height="15" src="https://img.new-combats.com/add_itm2.gif"></a> ';
-				
-					if($d[1]==1) { //����� ��������
-						if(!isset($po['nodelete'])) {
-							$is1 .= ' <a onClick="top.drop('.$pl['id'].',\''.$pl['img'].'\',\''.$pl['name'].'\',1,\'<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></td><td align=\\\'left\\\'>������� <b>'.$pl['name'].'</b> ����� ������, �� ������� ?</td></tr></table>\',\''.intval($_GET['otdel']).'\'); return false;" href="javascript:void(0);" title="�������� �������"><img src="https://img.new-combats.com/i/clear.gif"></a>';
-						}
-						//$is1 .= ' <img onclick="if (confirm(\'������� &quot;'.$pl['name'].'&quot; ����� ������, �� �������?\')) window.location=\'main.php?inv=1&delete='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'" title="�������� �������" src="https://img.new-combats.com/i/clear.gif" style="cursor:pointer;">';
-					}
-				}
-				
-				//�������� ��� � ���� (:
-				$rt[2] .= '<tr class="item"><td align="center" bgcolor="#'.$clr[$k].'"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="100" align="center" style="border-right:#A5A5A5 1px solid; padding:5px;">'.$is1.'</td><td valign="top" align="left" style="padding-left:3px; padding-bottom:3px; padding-top:7px;"><div align="left">'.$is2.'</div></td></tr></table></td></tr>'; 
-				$rt[1] += $pl['massa'];
-				$i++;
-			}
-			$j++;
-		}
-		$rt[0] = $i;
-		$rt['collich']=$j;
-		return $rt;
-	}
-	
-	public function itemsX($id,$uid = NULL, $item_id=NULL){
-		$item = mysql_fetch_array(mysql_query('SELECT `iu`.`id`,`iu`.`item_id`,`iu`.`uid`,`iu`.`inGroup`,`iu`.`inShop` FROM `items_users` AS `iu` WHERE `iu`.`delete` = "0" AND `iu`.`id` = "'.((int)$id).'" LIMIT 1 '));
-		if($item['inGroup'] == 0){
-			$grp = ' LIMIT 1';
-		} else {
-			$grp = ' LIMIT 1000';
-		}
-		//$grp = ' LIMIT 1';
-		$r = mysql_num_rows(mysql_query('SELECT `iu`.`id` FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "'.$item['inShop'].'" AND `iu`.`item_id` = "'.$item['item_id'].'" AND `iu`.`uid` = "'.($item['uid']).'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.($item['inGroup']).'" '.$grp.' '));
-		/*
-		$r = mysql_fetch_array(mysql_query('SELECT COUNT(`iu`.`id`) FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "'.$item['inShop'].'" AND `iu`.`item_id` = "'.$item['item_id'].'" AND `iu`.`uid` = "'.($item['uid']).'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.($item['inGroup']).'" '.$grp.' '));
-		$r = $r[0];
-		*/
-		unset($item);
-		return $r;
-	}
-	
-	 private function stackGroupCheck($uid, $group, $item){ // ������� ���������������� ID ������ ���������.
-		$g = 0;
-		$i = 0; 
-		do {
-			$i++;
-			$gr = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` 
-			WHERE `iu`.`uid`="'.$uid.'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="'.$i.'" AND `iu`.item_id="'.$item.'" 
-			LIMIT 1'));
-			if( empty($gr['inGroup']) ) {
-				$g = 1;
-			} 
-		} while ($g == 0);
-		return $i;
-	 }
-	
-	public function stack($id) {
-		global $c,$code;
-		$where = '';
-		$itm = mysql_fetch_array(mysql_query('SELECT 
-`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`, count(`iuu`.id) as inGroupCount
-		FROM `items_users` AS `iu`
-		LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`)
-		LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id AND `iuu`.inShop = 0)
-		WHERE `iu`.`id` = "'.mysql_real_escape_string((int)$id).'" AND `iu`.`uid` = "'.$this->info['id'].'" AND `iuu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT 1'));
-
-		if(isset($itm['id']) && $itm['iznosNOW']==0 ) { //���������� ������� ��������� �������� � ����
-			// ������� ������
-			if( $itm['inGroup'] == 0 ) { // ���� ������� �� � ������, �������� ��� ������� �������� �� �������.
-				$items= mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="'.$itm['item_id'].'"'));
-				$items = ceil( $items / $itm['group_max'] );
-			} else { // �������� �������� � ������ �� ������� ����������, �� ��������� � inGroup == 0
-				$curG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="'.$itm['inGroup'].'" AND `iu`.item_id="'.$itm['item_id'].'"')); // ������� ���������� ��������� � ��������� ������
-				$curNG = mysql_num_rows(mysql_query('SELECT `iu`.id, `iu`.inGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0"AND `iu`.`inGroup`="0" AND `iu`.item_id="'.$itm['item_id'].'"')); // ������� ���������� ��������� ������� ��� ������
-				$needG = $itm['group_max']-$curG; // ������ ��������� ���������� ��� ������, ���� ����� ������ 0 � ��������� ���������� ������
-				
-				if( $needG > 0 AND $curNG==0 ) {
-					$curItem = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, count(`iu`.inGroup) as itemsInGroup, `iu`.`item_id` FROM `items_users` AS `iu` WHERE `iu`.`inGroup`!="'.$itm['inGroup'].'" AND `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `iu`.item_id="'.$itm['item_id'].'" GROUP BY `iu`.inGroup HAVING itemsInGroup <= "'.$needG.'" ORDER BY itemsInGroup DESC LIMIT 1'));
-					if(isset($curItem['id']) ){
-						$where = ' `iu`.`inGroup` = "'.$curItem['inGroup'].'" AND '; 
-					}
-					$itm['group_max'] = $needG;
-				} else { 
-					$itm['group_max'] = $needG;
-				} 
-				$items = 1;
-			}
-			$s = 0;
-			do {
-				if( !isset($curG) AND $curNG==0 ) $itm['inGroup'] = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']); 
-				$sp = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE '.$where.' `iu`.`kolvo` = "1" AND `iu`.`item_id` = "'.$itm['item_id'].'" AND `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" ORDER BY `iu`.`inGroup` ASC LIMIT '.$itm['group_max'].'');
-				$i = 0; $j = 0;
-				while($pl = mysql_fetch_array($sp)) {
-					$pl['data'] = $this->lookStats($pl['data']);unset($pl['data']['frompisher']);$pl['data'] = $this->impStats($pl['data']);
-					$itm['data'] = $this->lookStats($itm['data']);unset($itm['data']['frompisher']);$itm['data'] = $this->impStats($itm['data']);
-					if( $pl['data']==$itm['data'] && $pl['name']==$itm['name'] && $itm['iznosMAX']==$pl['iznosMAX'] && $pl['iznosNOW']==0 && ($pl['timeOver']==0 || $pl['timeOver']>time()) && $pl['gift']==$itm['gift'] ){
-						$upd = mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inGroup` = "'.$itm['inGroup'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-						if($upd){
-							$j++;
-						}
-						$i++;
-					}
-				}
-				mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				$s++;
-			} while ($s < $items); 
-		}
-	}
-	
-	public function unstack($id,$x = NULL) {
-		$id = (int)$id;
-		$itm = mysql_fetch_array(mysql_query('SELECT `iu`.id, `iu`.inGroup, `im`.`id` as item_id,`im`.`name`, count(`iuu`.id) as inGroupCount
-FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) LEFT JOIN `items_users` as `iuu` ON (`iuu`.inGroup = `iu`.inGroup AND `iuu`.item_id = `im`.id )
-WHERE `iuu`.`uid`="'.$this->info['id'].'" AND `iu`.`uid`="'.$this->info['id'].'" AND `iu`.`delete`="0" AND `im`.`group` = "1" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.id='.mysql_real_escape_string((int)$id).'
-ORDER BY `iu`.lastUPD DESC
-LIMIT 1'));
-		if(isset($itm['id']) && $itm['inGroup']>0 && $itm['inGroupCount']>0) {
-			if($x==0 OR $x==NULL) {
-				$x = $this->itemsX($itm['id']); //���-�� �������
-				$inGroup = 0 ;
-			} elseif( $x != 0 ) {  
-				$inGroup = $this->stackGroupCheck($this->info['id'], $itm['inGroup'], $itm['item_id']);
-			} else {
-				$inGroup = 0 ;
-			}
-			$sp = mysql_query('SELECT `im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl` FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.$this->info['id'].'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.$itm['inGroup'].'" AND `iu`.`item_id` = "'.$itm['item_id'].'" AND `iu`.`inOdet` = "0" AND `iu`.`inShop` = "0" AND `im`.`group` = "1" LIMIT '.$x.'');
-			$i = 0; $j = 0;
-			while($pl = mysql_fetch_array($sp)){
-				$upd = mysql_query('UPDATE `items_users` SET `inGroup` = "'.$inGroup.'", `lastUPD` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				if($upd){
-					$j++;	
-				}
-				$i++;
-			}
-			if( $this->itemsX($itm['id']) == 1){
-				mysql_query('UPDATE `items_users` SET `inGroup` = "0", `lastUPD` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-			}
-			if( $this->itemsX($pl['id']) == 1){
-				mysql_query('UPDATE `items_users` SET `inGroup` = "0", `lastUPD` = "'.time().'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-			}
-			
-		}
-	}
-	
-	public function lookStats($m)
-	{
-		$ist = array();
-		$di = explode('|',$m);
-		$i = 0; $de = false;
-		while($i<count($di))
-		{
-			$de = explode('=',$di[$i]);
-			if(isset($de[0],$de[1]))
-			{
-				if(!isset($ist[$de[0]])) {
-					$ist[$de[0]] = 0;
-				}
-				$ist[$de[0]] = $de[1];
-			}
-			$i++;
-		}
-		return $ist;
-	}
-	
-	public function testItems($uid, $sn, $dt) {
-		global $c, $code;
-		$st = false; $rt = false;
-		if($uid!=$this->info['id'])
-		{
-			$u = mysql_fetch_array(mysql_query('SELECT `u`.`align`,`u`.`align2`,`u`.`battle`,`u`.`clan`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`,
-			`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-			FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			if($sn==0)
-			{
-				$sn = $this->getStats($uid,$i1);
-			}
-		}else{
-			$u  = $this->info;
-			if(isset($this->stats['hpAll']))
-			{
-				$sn = $this->stats;
-			}elseif($sn!=0)
-			{
-				
-			}else{
-				$sn = $this->getStats($uid,$i1);
-			}
-		}
-		if(isset($u['id']))
-		{
-			$snIt = 0;
-			//��������� ������ ���� � ���� � ������ ��������
-			$cl = mysql_query('SELECT
-			`iu`.`id` AS `iduid`,
-			`iu`.`time_sleep`,`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-			`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-			FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`iu`.`inOdet`!="0" OR `iu`.`data` LIKE "%srok%" OR `iu`.`data` LIKE "%vip_sale%" OR `iu`.`data` LIKE "%sudba=1%" OR ( `iu`.`data` LIKE "%zazuby=%" AND `iu`.`data` NOT LIKE "%srok=%" ) OR `iu`.`iznosNOW` > 0 OR `im`.`srok` > 0 OR (`iu`.`timeOver`<'.time().' AND `iu`.`timeOver`!="0")) AND `iu`.`uid`="'.$u['id'].'" AND (`iu`.`delete`="0" OR `iu`.`delete`="1000")');
-			while($itm = mysql_fetch_array($cl)) {
-				$po = array();
-				$po = $this->lookStats($itm['data']);
-				$po['lvl'] = $u['level'];
-				//��������� ����������				
-				$t = $this->items['tr'];
-				$x = 0;
-				$notr = 0;
-				$j = 1;
-				while($j<=4){
-					if(!isset($po['tr_s'.$j]) && $itm['type']!=26){
-						$po['tr_s'.$j] = 0;
-					}
-					$j++;
-				}
-				while($x < count($t)) {
-				  $n = $t[$x];
-				  if( isset($po['tr_'.$n]) && $n == 'sex' ) {
-					  if( $po['tr_'.$n] != $this->info['sex'] ) {
-						 $notr++; 
-					  }
-				  }elseif(isset($po['tr_'.$n])) {
-					if($po['tr_'.$n] > $this->stats[$n] && $n != 'align' && $n != 'align_bs') {
-					  $notr++;
-					}
-				  }
-				  $x++;
-				}
-				if($this->info['twink']>0) {
-					//�� ������ 100 ���.
-					if( $itm['price2'] > 1 || $itm['2price'] > 1 ) {
-						$notr++;
-					}
-					//������ ���� + �����
-					if( isset($po['rune']) && $po['rune'] > 0 ) {
-						$notr++;
-					}
-					if( isset($po['spell_id']) && $po['spell_id'] > 0 ) {
-						$notr++;
-					}
-				}
-				if(isset($po['sudba']) && $po['sudba'] == 1 ) {
-					$po['sudba'] = $u['login'];
-					$itm['data'] = $this->impStats($po);
-					mysql_query('UPDATE `items_users` SET `data` = "'.$itm['data'].'" WHERE `id` = "'.$itm['iduid'].'" AND `uid` = "'.$u['id'].'" LIMIT 1');
-				}
-				if(isset($po['zazuby']) && !isset($po['srok']) && ( $itm['type'] == 29 || $itm['type'] == 30 || $itm['type'] == 36 || $itm['type'] == 49 || $itm['type'] == 46 || $itm['type'] == 34 ) ) {
-					//�������� �� ���� �� ������ ��������
-					$po['srok'] = 86400*7;
-					$itm['data'] = $this->impStats($po);
-					mysql_query('UPDATE `items_users` SET `data` = "'.$itm['data'].'" WHERE `id` = "'.$itm['iduid'].'" AND `uid` = "'.$u['id'].'" LIMIT 1');
-				}
-				if(isset($po['srok']) && $po['srok'] > 0){
-					$itm['srok'] = $po['srok'];
-				}
-				if(isset($po['vip_sale'])) {
-					if($sn['silver'] < 2 && ($itm['time_create']-time()) < 0) {
-						if( $itm['item_id'] == 4704 ) {
-							$po['musor2'] = 4708;
-						}
-						$this->isport($itm['id'],$itm['timeOver'],$itm['overType'],$u['id'],(int)$po['musor2'],$itm['type'],$itm['name'],$po['zazuby']);
-						$notr++;
-					}
-				}
-				if($itm['iznosNOW']>=ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999){
-					$notr++;	
-				}
-				if($notr > 0 && $itm['inOdet'] != 0) {
-					//������� �������
-					$this->snatItem($itm['id'],$u['id']);
-					$snIt++;
-				}
-				//��������� ���� ��������
-				if($itm['iznosNOW']>=ceil($itm['iznosMAX']) && $itm['iznosMAXi'] != 999999999){
-					//������� ��������
-					if(isset($po['musor'])){
-						if($po['musor']>0){
-							$this->recr($itm['id'],$itm['type'],$u['id'],(int)$po['musor']);
-						}
-					}
-				}
-				if($itm['time_create']+$itm['srok'] <= time() && $itm['srok']>0 && $itm['time_sleep'] == 0){
-					if($itm['inOdet']!=0){
-						$this->snatItem($itm['id'],$u['id']);
-						$snIt++;
-					}
-					//������� �������
-					if( $itm['item_id'] == 4704 ) {
-						$po['musor2'] = 4708;
-					}
-					$this->isport($itm['id'],$itm['timeOver'],$itm['overType'],$u['id'],(int)$po['musor2'],$itm['type'],$itm['name']);
-				}elseif($itm['time_create']+$itm['srok'] <= time() && $itm['srok']>0){
-					echo 'test';
-				}
-			}		
-			
-			if($snIt>0){
-				$this->testItems($uid,$sn,1);
-			}elseif($dt==0){
-				return -2;
-			}
-		}else{
-			return 0;
-		}
-	}
-	
-	public function recr($id,$tp,$uid,$id2){
-		if($id!=0){
-			if($uid!=0){
-				$uid2 = 'AND `uid`="'.$uid.'"';
-			}else{
-				$uid2 = '';
-			}
-			$upd = mysql_query('UPDATE `items_users` SET `delete`="'.time().'" WHERE `id` = "'.$id.'" '.$uid2.' LIMIT 1');
-			if($upd){
-				$this->addDelo(2,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: ������� [itm:'.$it.'] ��� <b>������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				if($id2>1){
-					//��������� ������ �������
-					$this->addItem($id2,$uid,'noodet=1|noremont=1');
-				}
-			}
-		}
-	}
-	
-	public function isport($it,$t,$tp,$uid,$id2,$type,$name,$zub){
-		if($id2 == 4708 ) {
-			$tp = 1;	
-		}
-		if($it!=0){
-			if($uid!=0){
-				$uid2 = 'AND `uid`="'.$uid.'"';
-			}else{
-				$uid2 = '';
-			}
-			$upd = mysql_query('UPDATE `items_users` SET `delete`="'.time().'",`timeOver`="1" WHERE `id` = "'.$it.'" '.$uid2.' LIMIT 1');
-			if($upd){
-				$upd = mysql_query('UPDATE `items_users` SET `inGroup`="0",`timeOver`="'.time().'" WHERE `inGroup` = "'.$it.'" '.$uid2.'');
-				$this->addDelo(2,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: ������� <b>'.$name.'</b> [itm:'.$it.'] ��� <b>��������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				if($tp!=0){
-					//��������� ���������� ������� � ���������, � ����������� �� ����
-					$zzba = '';
-					if( $zub > 0 ) {
-						$zzba = '|zazuby=1';
-					}
-					$po = $this->lookStats($this->stats['items'][$i]['data']);
-					if($id2>0){
-						if($id2 == 4708 ) {
-							$this->addItem($id2,$uid,'|notransfer=1|nosale=1'.$zzba);
-						}else{
-							$this->addItem($id2,$uid,'|noodet=1'.$zzba);
-						}
-					}else{
-						if( $type == 30 ) {
-							//����������� �������
-							$this->addItem(4036,$uid,'|renameadd='.$name.'|noodet=1'.$zzba);
-						}
-					}
-				}				
-			}
-		}
-	}
-	
-	public function btlMagicList() {
-		global $c;
-		$i = 1; $sv = array();
-		while($i<=10) {
-			$sv[$i] = '<img class="nopriemuse" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w101.gif" />';
-			$i++;
-		}
-		$i = 0;
-		while($i < count($this->stats['items'])) {
-			if($this->stats['items'][$i]['inslot'] == 40 || $this->stats['items'][$i]['inslot'] == 51) {
-				if($this->stats['items'][$i]['useInBattle']==0 || $this->stats['items'][$i]['btl_zd']>0 || $this->stats['items'][$i]['iznosNOW']>=$this->stats['items'][$i]['iznosMAX'] || $this->stats['items'][$i]['magic_inci']=='' || $this->stats['items'][$i]['magic_inci']=='0') {
-					$vl = ' class="nopriemuse"';
-				}else{
-					$po = $this->lookStats($this->stats['items'][$i]['data']);
-					if($po['useOnLogin']==1) {
-						$useUrl = 'top.useMagicBattle(\''.$this->stats['items'][$i]['name'].'\','.$this->stats['items'][$i]['id'].',\''.$this->stats['items'][$i]['img'].'\',1,1,\'\',\''.$this->stats['items'][$i]['useInBattle'].'\');';
-					}else{
-						$useUrl = 'top.useMagicBattle(\''.$this->stats['items'][$i]['name'].'\','.$this->stats['items'][$i]['id'].',\''.$this->stats['items'][$i]['img'].'\',1,2);';
-					}
-					$vl = 'style="cursor:pointer" onclick="'.$useUrl.'"';
-				}
-				$sv[$this->stats['items'][$i]['inOdet']-39] = '<img '.$vl.' title="�������������: '.floor($this->stats['items'][$i]['iznosNOW']).'/'.floor($this->stats['items'][$i]['iznosMAX']).'" src="https://img.new-combats.com/i/items/'.$this->stats['items'][$i]['img'].'" />';
-			}
-			$i++;
-		}
-		$r = '<table border="0" cellspacing="0" cellpadding="0">'.
-	 	 	 	  '<tr>'.
-	 	 	 	 	 '<td>'.$sv[1].'</td>'.
-	 	 	 	 	 '<td>'.$sv[2].'</td>'.
-	 	 	 	 	 '<td>'.$sv[3].'</td>'.
-	 	 	 	 	 '<td>'.$sv[4].'</td>'.
-	 	 	 	 	 '<td>'.$sv[5].'</td>'.
-	 	 	 	 	 '<td>'.$sv[6].'</td>'.
-	 	 	 	 	 '<td>'.$sv[7].'</td>'.
-	 	 	 	 	 '<td>'.$sv[8].'</td>'.
-	 	 	 	 	 '<td>'.$sv[9].'</td>'.
-	 	 	 	 	 '<td>'.$sv[10].'</td>'.
-					'<td>'.$sv[11].'</td>'.
-					'<td>'.$sv[12].'</td>'.
-	 	 	 	 	 '</tr>'.
-	 	 	 	 '</table>';
-			return str_replace('"','\"',$r);
-	}
-	
-	public function nameItemMf($pl,$po) {
-		$r = $pl['name'];
-		if( isset($po['icos']) ) {
-			$r = '<span class=icos_'.$po['icos'].' >'.$pl['name'].' <span style=font-size:8px>&nbsp;'.$po['icos'].'&nbsp;</span></span>';
-		}
-		//if( $this->info['admin'] > 0 ) {
-			if(isset($po['rune']) && $po['rune']>0) {
-				$rnc = explode(' ',$po['rune_name']);
-				if($rnc[0] == '�����') {
-					$rnc = '#9b5d40';
-				}elseif($rnc[0] == '����') {
-					$rnc = '#3a2b64';
-				}elseif($rnc[0] == '����') {
-					$rnc = '#20a3b0';
-				}elseif($rnc[0] == '����') {
-					$rnc = '#4c7718';
-				}else{
-					$rnc = '#4c4c4c';
-				}
-				$r .= '<br><font color=green>����: <b>'.$po['rune_name'].'</b></font>';
-				unset($rnc);
-			}
-			if( isset($po['spell']) ) {
-				$rnc = explode(' ',$po['spell_name']);
-				if($rnc[2] == '[0]') {
-					$rnc = '#282828';
-				}elseif($rnc[2] == '[1]') {
-					$rnc = '#624542';
-				}elseif($rnc[2] == '[2]') {
-					$rnc = '#77090b';
-				}elseif($rnc[2] == '[3]') {
-					$rnc = '#d99800';
-				}else{
-					$rnc = '#282828';
-				}
-				$r .= '<br><font color='.$rnc.'>'.$po['spell_name'].'</font>';
-				unset($rnc);
-			}
-		return $r;
-	}
-	
-			public function getInfoItemInfo($pl) {
-				$lvar = '';
-				$td = $this->lookStats($pl['data']);
-		
-				/*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$lvar .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['add_mpAll']) && $td['add_mpAll']!=0)
-				{
-					if($td['add_mpAll']>0)
-					{
-						$td['add_mpAll'] = '+'.$td['add_mpAll'];
-					}
-					$lvar .= '<br>������� ����: '.$td['add_mpAll'].'';
-				}*/
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$lvar .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$lvar .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				//
-					$t = $this->items['add'];
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($td['add_'.$n],$this->is[$n])){
-							$z = '+';
-							if($td['add_'.$n]<0){
-								$z = '';
-							}
-							$lvar .= '<br>'.$this->is[$n].': '.$z.''.$td['add_'.$n];
-						}
-						$x++;
-					}
-					//
-					$x = 0;
-					while($x<count($t)){
-						$n = $t[$x];
-						if(isset($td['sv_'.$n])){
-							$z = '+';
-							if($td['sv_'.$n]<0){
-								$z = '';
-							}
-							if( $n != 'yron_min' && $n != 'yron_max' ) {
-								$lvar .= '<br>'.$this->is[$n].': '.$z.''.$td['sv_'.$n];
-							}
-						}
-						$x++;
-					}
-					if($pl['2h']==1){
-						$lvar .= '<br>� ��������� ������';
-					}
-					if(isset($po['zonb'])){
-						$lvar .= '<br>���� ������������: ';
-						if($lvar['zonb']>0){
-							$x = 1;
-							while($x<=$td['zonb']){
-								$lvar .= '+';
-								$x++;
-							}
-						}else{
-							$lvar .= '�';
-						}
-					}					
-					
-				//
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$lvar .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$lvar .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$lvar .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}				
-				if($pl['iznosMAX']>0)
-				{
-	 	 	 	 	 if($pl['iznosMAXi'] >= 909999999) {
-						//$lvar .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$lvar .= '<br>�������������: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']);
-					}
-				}
-				
-				if( $po['battleUseZd'] > 0 ) {
-					$lvar .= '<br>�������� �������������: '.$this->timeOut($po['battleUseZd']).'';
-				}	
-				
-				if(isset($td['gravi'])) {
-					$lvar .= '<hr><b>&quot;<i>'.$td['gravi'].'</i>&quot;</b>';
-				}
-									
-				return $lvar;
-			}
-
-	
-	public function getInfoPers($uid,$i1,$sn = 0,$ivv = 0){
-		global $c,$code;
-		
-		$st = false; $rt = false; $type_info = 1;
-		if($uid!=$this->info['id']){
-			$u = mysql_fetch_array(mysql_query('SELECT `u`.`inTurnir`,`u`.`allLock`,`u`.`battle`,`u`.`zag`,`u`.`banned`,`u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`,
-			`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-			FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			if($sn==0){
-				$sn = $this->getStats($uid,$i1);
-			}
-		}else{
-			$u  = $this->info;
-			if(isset($this->stats['hpAll'])){
-				$sn = $this->stats;
-			}elseif($sn!=0){
-			}else{
-				$sn = $this->getStats($uid,$i1);
-			}
-		}
-
-		$tp_img = array(
-			1 => 4,
-			2 =>5,
-			14 => 6,
-			3 => 7,
-			5 => 8,
-			7 => 9,
-			17 => 10,
-			16 => 11,
-			13 => 12,
-			10 => 13,
-			9 => 14,
-			8 => 15,
-			11 => 17, //������ 2
-			12 => 18 //������ 3		
-		);
-
-		if(isset($u['id'],$u['stats'])){
-			//if( $u['inTurnir'] > 0 ) {
-			//	$type_info = 2;
-			//}
-			$rt = array(0=>'',1=>array());
-			$st = array();
-			$st['id'] = $u['id'];
-			$st['login'] = $u['login'];
-			$st['lvl'] = $u['level'];
-
-			//�������������� �� ��������� � �� �����������
-			$witm	 = array();
-			$witm[1] =  '<img width="60" height="60" style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w9.gif">';
-			$witm[2] =  '<img width="60" height="40" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w13.gif">';
-			$witm[3] =  '<img width="60" height="60" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w3.gif">';
-			$witm[4] =  '<img width="60" height="80" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w4.gif">';
-			$witm[7] =  '<img width="60" height="40" style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w5.gif">';
-			$witm[8] =  '<img width="60" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w1.gif">';
-			$witm[9] =  '<img width="60" height="20" style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w2.gif">';
-			$witm[10] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-			$witm[11] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-			$witm[12] = '<img width="20" height="20" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-			$witm[13] = '<img width="60" height="40" style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w11.gif">';
-			$witm[14] = '<img width="60" height="60" style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/i/items/w/w10.gif">';
-			$witm[16] = '<img width="60" height="80" style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w19.gif">';
-			$witm[17] = '<img width="60" height="40" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w12.gif">';
-			//40-52 ���� ��� �����		
-			$witm[53] = '<img width="40" height="20" style="display:block;" title="������ ���� ������ ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-			$witm[54] = '<img width="40" height="20" style="display:block;" title="������ ���� ����� ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-			$witm[55] = '<img width="40" height="20" style="display:block;" title="������ ���� ����������� ������" src="https://img.new-combats.com/i/items/w/w15.gif">';
-			$witm[56] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-			$witm[57] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-			$witm[58] = '<img width="40" height="20" style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w20.gif">';
-			$cl = mysql_query('SELECT 
-			`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-			`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-			FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$u['id'].'" AND `iu`.`delete`="0"');
-			$wj = array(1=>false,2=>false,4=>false,5=>false,6=>false);
-			$b1 = '<br>';
-			
-			while($pl = mysql_fetch_array($cl))
-			{				
-				$td = $this->lookStats($pl['data']);	
-				
-				if(isset($td['modif'])) {
-					$pl['name'] = $pl['name'].' (��)';
-				}
-				
-				if(isset($td['upatack_lvl']))
-				{
-					$pl['name'] = $pl['name'].' +'.$td['upatack_lvl'];
-				}
-								
-				if(isset($td['mod_lvl']))
-				{
-					$pl['name'] = $pl['name'].' '.$mx.' ['.$td['mod_lvl'].']';
-				}
-				
-				if($pl['inOdet']==1 || $pl['inOdet']==52 || ($pl['inOdet']>=4 && $pl['inOdet']<=6))
-				{
-					$wj[$pl['inOdet']] = $pl;
-				}
-				
-				$pl['name'] = $this->nameItemMf($pl,$td);
-												
-				$lvar = '';
-				/*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']!=0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$lvar .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$lvar .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$lvar .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$lvar .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$lvar .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$lvar .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$lvar .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$lvar .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}				
-				if($pl['iznosMAX']>0)
-				{
-	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$lvar .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$lvar .= '<br>�������������: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']);
-					}
-				}
-				
-				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '<br>�������� �������������: '.$this->timeOut($po['battleUseZd']).'';
-				}
-				
-				if(isset($td['gravi'])) {
-					$td['gravitp'] = array(
-						18 => '�������',
-						19 => '������',
-						20 => '������',
-						21 => '������',
-						22 => '������',
-						23 => '����',
-						24 => '��������',
-						26 => '��������',
-						27 => '��������',
-						28 => '��������'
-					);
-					$lvar .= '<br>�� '.$td['gravitp'][$pl['type']].' ������������� �������: '.$td['gravi'].'';
-					unset($td['gravitp']);
-				}*/
-				
-				/*
-				if( $pl['inOdet'] == 3 ) {
-					if( $pl['2h'] == 1 ) {
-						if(@isset($sn['items_img'][$tp_img[14]])) {
-							$uimg2 = 'rimg/r'.$sn['items_img'][$tp_img[14]];
-							$witm[14] = '<img width="60" height="60" style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/'.$uimg2.'">';
-						}else{
-							$uimg2 = 'i/items/'.$pl['img'].'';
-							$witm[14] = '<img width="60" height="60" style="background-image:url(https://img.new-combats.com/i/items/w/w10.gif);display:block;filter:alpha(opacity=37);opacity:0.37;-moz-opacity:0.37;-khtml-opacity:0.37;" title="������ ���� ���" src="https://img.new-combats.com/'.$uimg2.'">';
-						}
-						unset($uimg2);
-					}
-				}
-				*/
-				
-				$lvar = $this->getInfoItemInfo($pl);
-								
-				if(@isset($sn['items_img'][$tp_img[$pl['inOdet']]])) {
-					$uimg = 'rimg/r'.$sn['items_img'][$tp_img[$pl['inOdet']]];
-				}else{
-					$uimg = 'i/items/'.$pl['img'].'';
-				}
-				
-				$witm[$pl['inOdet']]  = '<img style="display:block;" src="https://img.new-combats.com/'.$uimg.'" onMouseOver="top.hi(this,\'<center><b>'.$pl['name'].'</b>'.$lvar.'</center>\',event,3,0,1,1,\'max-width:307px\')" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-				
-				if($i1==1){
-					$witm[$pl['inOdet']] = '<a href="https://new-combats.com/item/'.$pl['item_id'].'" target="_blank">'.$witm[$pl['inOdet']].'</a>';
-				}else{
-					if($pl['inOdet']>=40 && $pl['inOdet']<=52 && !isset($_GET['inv'])){
-						$useUrl = '';
-						if($pl['magic_inc']==''){
-							$pl['magic_inc'] = $pl['magic_inci'];
-						}
-						if($pl['magic_inc'] && $pl['type']==30){
-							//���������� �������
-							$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-							$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');';
-						}elseif($pl['magic_inc'] && $pl['type']==29){
-							//���������� ��������
-							//�� ���������
-							if(isset($td['useOnLogin'])){
-								$inv1 = '';
-								if(isset($_GET['inv'])) {
-									$inv1 = 'inv=1&otdel='.((int)$_GET['otdel']).'&';
-								}
-								$useUrl = 'top.useMagic(\''.$pl['name'].'\','.(0+$pl['id']).',\''.$pl['img'].'\',1,\'main.php?'.$inv1.'use_pid='.$pl['id'].'&rnd='.$code.'\');';
-							}else{
-								//������ ������������� (�� ����, ���� ��� �������� ��������\������)
-								$pldate = '<table border=\\\'0\\\' width=\\\'100%\\\' cellspacing=\\\'0\\\' cellpadding=\\\'5\\\'><tr><td rowspan=2 width=\\\'80\\\' valign=\\\'middle\\\'><div align=\\\'center\\\'><img src=\\\'https://img.new-combats.com/i/items/'.$pl['img'].'\\\'></div></td><td valign=\\\'middle\\\' align=\\\'left\\\'>&quot;<b>'.$pl['name'].'</b>&quot;<br>������������ ������?</td></tr></table>';
-								$useUrl = 'top.useiteminv(\''.(0+$pl['id']).'\',\''.$pl['img'].'\',\''.$pl['img'].'\',1,\''.$pldate.'\',\''.(0+$_GET['otdel']).'\');';
-							}				
-						}
-						$witm[$pl['inOdet']] = '<a href="javascript:void(0);" onClick="'.$useUrl.'">'.$witm[$pl['inOdet']].'</a>';
-					}elseif($pl['item_id']==998 && !isset($_GET['inv'])){
-						//�������
-						$witm[$pl['inOdet']] = '<a href="main.php?use_snowball='.$code.'">'.$witm[$pl['inOdet']].'</a>';
-					}else{
-						$witm[$pl['inOdet']] = '<a href="main.php?otdel='.$pl['inRazdel'].'&inv=1&sid='.$pl['id'].'&rnd='.$code.'">'.$witm[$pl['inOdet']].'</a>';
-					}
-				}
-			}
-			//����,�����
-			$wj1i = '';
-			$br  = '<div align=\\\'center\\\' style=\\\'margin:4px;\\\'><img src=\\\'https://img.new-combats.com/1x1.gif\\\' height=\\\'1\\\' width=\\\'111\\\' style=\\\'background-color:black;\\\'></div>';
-			if($wj[1]!=false)
-			{	
-			if($wj[52] != false) { $wj1i .= $br; }
-				$td = array();							
-				$td = $this->lookStats($wj[1]['data']);
-				$wj[1]['name'] = $this->nameItemMf($wj[1],$td);
-				$wj1i .= '<b>'.$wj[1]['name'].'</b>';	
-				$wj1i .= $this->getInfoItemInfo($wj[1]);
-				/*
-				if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj1i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj1i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj1i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj1i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj1i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj1i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[1]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[1]['iznosMAXi'] == 999999999) {
-						$wj1i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj1i .= '<br>�������������: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).'';
-					}
-				}*/
-			}
-			if(isset($wj[52]) && $wj[52]!=false)
-			{
-				$td = $this->lookStats($wj[52]['data']);
-				$wj[52]['name'] = $this->nameItemMf($wj[52],$td);
-				/*$wj1i = $wj1i;
-
-				if($wj[52]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[52]['iznosMAXi'] == 999999999) {
-						$wj1i = '<br>�������������: <font color=brown>�����������</font ><br>'.$wj1i;
-					}else{					
-						$wj1i = '<br>�������������: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i = '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i;
-					}
-				}
-
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i = '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i = '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i = '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i;
-					}else{
-						$wj1i = '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i;
-					}
-				}
-				
-				if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj1i = '<br>������� �����: '.$td['add_hpAll'].''.$wj1i;
-				}
-				
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj1i = '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i;
-				}*/
-				
-				
-				$wj1i = '<b>'.$wj[52]['name'].'</b>'.$wj1i;
-				$wj1i .= $this->getInfoItemInfo($wj[52]);
-				$wj[1]['img'] = $wj[52]['img'];
-				$wj[1]['id']  = $wj[52]['id'];
-				$wj[1]['inRazdel'] = $wj[52]['inRazdel'];
-			}
-			//������,�����,����
-			$wj4idd = $wj[5]['item_id'];
-			$wj4i = '';
-			if($wj[6]!=false)
-			{
-				$td = array();	
-				$td = $this->lookStats($wj[6]['data']);
-				$wj[6]['name'] = $this->nameItemMf($wj[6],$td);
-				$wj4i .= '<b>'.$wj[6]['name'].'</b>';				
-				/*if($td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if($td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if($td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if($td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if($td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if($td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[6]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[6]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj4i .= '<br>�������������: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).'';
-					}
-				}*/
-				$wj4i .= $this->getInfoItemInfo($wj[6]);
-				if($wj[5]!=false || $wj[4]!=false)
-				{
-					$wj4i .= $br;
-				}
-			}
-			if($wj[5]!=false)
-			{
-				$td = array();	
-				$td = $this->lookStats($wj[5]['data']);	
-				$wj[5]['name'] = $this->nameItemMf($wj[5],$td);
-				$wj4i .= '<b>'.$wj[5]['name'].'</b>';				
-				/*if($td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[5]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[5]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj4i .= '<br>�������������: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).'';
-					}
-				}
-				*/
-				$wj4i .= $this->getInfoItemInfo($wj[5]);
-				if($wj[4]!=false)
-				{
-					$wj4i .= $br;
-				}
-			}
-			if($wj[4]!=false)
-			{
-				$td = array();	
-				$td = $this->lookStats($wj[4]['data']);
-				$wj[4]['name'] = $this->nameItemMf($wj[4],$td);
-				$wj4i .= '<b>'.$wj[4]['name'].'</b>';					
-				/*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>������� �����: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>����: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ������: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>����� ������: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �������: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>����� �������: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� �����: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>����� �����: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>����� ���: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>����� ���: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				
-				if($wj[4]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[4]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>�������������: <font color=brown>�����������</font > ';
-					}else{					
-						$wj4i .= '<br>�������������: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).'';
-					}
-				}*/
-				$wj4i .= $this->getInfoItemInfo($wj[4]);
-			}
-			/*if($wj[6]!=false)
-			{
-				$wj[4]['img'] = $wj[6]['img'];
-				$wj[4]['id']  = $wj[6]['id'];
-				$wj[4]['inRazdel'] = $wj[6]['inRazdel'];
-			}elseif($wj[5]!=false)
-			{
-				$wj[4]['img'] = $wj[5]['img'];
-				$wj[4]['id']  = $wj[5]['id'];
-				$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-			}elseif($wj[4]!=false)
-			{
-
-			}*/
-			if( /*$i1 == 1 &&*/ (($this->info['noplaw'] == 1 && !isset($_GET['hide_plaw'])) || ($this->info['noplaw'] == 0 && isset($_GET['hide_plaw']))) ) {
-				if($wj[5]!=false)
-				{
-					$wj[4]['img'] = $wj[5]['img'];
-					$wj[4]['id']  = $wj[5]['id'];
-					$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-				}elseif($wj[4]!=false)
-				{
-					
-				}
-			}else{
-				if($wj[6]!=false)
-				{
-					$wj[4]['img'] = $wj[6]['img'];
-					$wj[4]['id']  = $wj[6]['id'];
-					$wj[4]['inRazdel'] = $wj[6]['inRazdel'];
-				}elseif($wj[5]!=false)
-				{
-					$wj[4]['img'] = $wj[5]['img'];
-					$wj[4]['id']  = $wj[5]['id'];
-					$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-				}elseif($wj[4]!=false)
-				{
-					
-				}
-			}
-			if($wj[1]!=false || $wj[2]!=false)
-			{
-				if(isset($sn['items_img'][$tp_img[1]])) {
-					$uimg = 'rimg/r'.$sn['items_img'][$tp_img[1]];
-				}else{
-					$uimg = 'i/items/'.$wj[1]['img'].'';
-				}
-				$witm[1] = '<img style="display:block;" src="https://img.new-combats.com/'.$uimg.'" onMouseOver="top.hi(this,\'<center>'.$wj1i.'</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-				if($i1==1)
-				{
-					$witm[1] = '<a href="https://new-combats.com/item/'.$wj[1]['item_id'].'" target="_blank">'.$witm[1].'</a>';
-				}else{
-					$witm[1] = '<a href="main.php?otdel='.$wj[1]['inRazdel'].'&inv=1&sid='.$wj[1]['id'].'&rnd='.$code.'">'.$witm[1].'</a>';
-				}	
-			}
-			if($wj[4]!=false || $wj[5]!=false || $wj[6]!=false)
-			{
-				if(isset($sn['items_img'][$tp_img[5]])) {
-					$uimg = 'rimg/r'.$sn['items_img'][$tp_img[5]];
-				}else{
-					$uimg = 'i/items/'.$wj[4]['img'].'';
-				}
-				$witm[4] = '<img style="display:block;" src="https://img.new-combats.com/'.$uimg.'" onMouseOver="top.hi(this,\'<center>'.$wj4i.'</center>\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-				if($i1==1)
-				{
-					if( $wj4idd > 0 ) {
-						$wj[4]['item_id'] = $wj4idd;
-					}
-					$witm[4] = '<a href="https://new-combats.com/item/'.$wj[4]['item_id'].'" target="_blank">'.$witm[4].'</a>';
-				}else{
-					$witm[4] = '<a href="main.php?otdel='.$wj[4]['inRazdel'].'&inv=1&sid='.$wj[4]['id'].'&rnd='.$code.'">'.$witm[4].'</a>';
-				}	
-			}
-			/*------------ ���������� ���. � ��������� ---------------*/
-			$nmmsgl1 = 0;
-			if($u['align'] >= 1 && $u['align'] < 2) {
-				$nmmsgl1 = 1;
-			}elseif($u['align'] >= 3 && $u['align'] < 4) {
-				$nmmsgl1 = 3;
-			}elseif($u['align'] >= 7 && $u['align'] < 8) {
-				$nmmsgl1 = 7;
-			}elseif($u['align'] >= 50 && $u['align'] < 50) {
-				$nmmsgl1 = 60;
-			}
-			if($u['admin'] > 0) {
-				$nmmsgl1 = 60;
-			}
-			$anan = array(
-				1 => 'cat',
-				2 => 'owl',
-				3 => 'wisp',
-				4 => 'demon',
-				5 => 'dog',
-				6 => 'pig'
-			);
-			$anan2 = array(
-				1 => '���',
-				2 => '����',
-				3 => '�������',
-				4 => '�������',
-				5 => 'ϸ�',
-				6 => '����'
-			);
-			$anml = '';
-			if($u['animal']>0)
-			{
-				$an = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "'.$u['animal'].'" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1'));
-				if(isset($an['id']))
-				{
-					if($i1 != 1){
-						//$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><a href="main.php?pet"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].'] (���������� �����)"></a></div>';
-					}else{
-						if( $an['eda'] > 0 ) {
-							//$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].']"></div>';
-						}
-					}
-					$petimg = mysql_fetch_array(mysql_query('SELECT `id`,`img` FROM `obraz_pet` WHERE `uid` = "'.$u['id'].'" AND `use` = 1 LIMIT 1'));
-					if(isset($petimg['id'])) {
-						$anml = '<img height="40" width="120" src="https://'.$c['img'].'/pet/'.$petimg['img'].'" onMouseOver="top.hi(this,\'<b>'.$an['name'].'</b> <i>('.$anan2[$an['type']].')</i><br>�������: '.$an['level'].'\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-					}else{
-						$anml = '<img height="40" width="120" src="https://'.$c['img'].'/pet/'.$anan[$an['type']].'.png" onMouseOver="top.hi(this,\'<b>'.$an['name'].'</b><i>('.$anan2[$an['type']].')</i><br>�������: '.$an['level'].'\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
-					}
-				}
-			}
-			unset($anan);
-			
-			if(@isset($sn['items_img'][2])) {
-				$msl = '<img width="120" height="40" style="display:block" src="https://img.new-combats.com/rimg/r'.$sn['items_img'][2].'">';
-			}else{
-				if( $anml == '' ) {
-					$msl = '<img width="120" height="40" style="display:block" src="https://img.new-combats.com/i/slot_bottom'.$nmmsgl1.'.gif">';
-				}else{
-					$msl = $anml;
-				}
-			}
-			unset($nmmsgl1);
-			$jf = '';
-			$oi = '';
-			if($i1!=1)
-			{
-				$jf = 'main';
-				$oi = 'onMouseOver="top.hi(this,\''.$u['login'].' (������� � &quot;���������&quot;)\',event,3,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"';
-				$msl = '<table width="120" border="0" cellspacing="0" cellpadding="0">
-						<tr>
-						  <td width="40" height="20">'.$witm[53].'</td>
-						  <td width="40" height="20">'.$witm[55].'</td>
-						  <td width="40" height="20">'.$witm[54].'</td>
-						</tr>
-						<tr>
-						  <td width="40" height="20">'.$witm[56].'</td>
-						  <td width="40" height="20">'.$witm[57].'</td>
-						  <td width="40" height="20">'.$witm[58].'</td>
-						</tr>
-					  </table>';
-			}
-			$hpmp = '';
-			$eff = '';
-			//-------- ���������� �������
-			$efs = mysql_query('SELECT 
-			`eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`tr_life_user`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`,
-			`em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch`
-			 FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `delete`="0" AND `deactiveTime` < "'.time().'" ORDER BY `deactiveTime` DESC,`timeUse` ASC');
-			while($e = mysql_fetch_array($efs))
-			{
-				$esee = 1;
-				if($e['see']==0 && $i1==1)
-				{
-					$esee = 0;
-				}
-				if($e['see']==2 && ($u['battle']!=$this->info['battle'] || $this->info['battle']==0))
-				{
-					$esee = 0;
-				}
-				if($e['see']==3 && $i1==0)
-				{
-					$esee = 0;
-				}
-				if($e['img'] == '') {
-					$esee = 0;
-				}
-				
-				if(($e['timeUse']+$e['timeAce']+$e['actionTime']>=time() || $e['timeUse']==77) && $esee == 1)
-				{
-					$ei = '<b><u>'.$e['name'].'</u></b>';
-					if($e['type1']>0 && $e['type1']<7)
-					{
-						$ei .= ' (�������)';
-					}elseif(($e['type1']>6 && $e['type1']<11) || $e['type1']==16)
-					{
-						$ei .= ' (��������)';
-					}elseif($e['type1']==14)
-					{
-						$ei .= ' (�����)';
-					}elseif($e['type1']==15)
-					{
-						$ei .= ' (��������)';
-					}elseif($e['type1']==17)
-					{
-						$ei .= ' (���������)';
-					}elseif($e['type1']==18 || $e['type1']==19)
-					{
-						$ei .= ' (������)';
-					}elseif($e['type1']==20)
-					{
-						$ei .= ' (�����������)';
-					}elseif($e['type1']==22)
-					{
-						$ei .= ' (��������)';
-					}else{
-						$ei .= ' (������)';
-					}
-					$ei .= '<br>';
-					
-					if($e['type1']!=13 && $e['timeUse']!=77)
-					{
-						$out = '';
-						$time_still = ($e['timeUse']+$e['timeAce']+$e['actionTime'])-time();
-						$tmp = floor($time_still/2592000);
-						$id=0;
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." ���. ";}
-							$time_still = $time_still-$tmp*2592000;
-						}
-						$tmp = floor($time_still/604800);
-						if ($tmp > 0) { 
-						$id++;
-						if ($id<3) {$out .= $tmp." ���. ";}
-						$time_still = $time_still-$tmp*604800;
-						}
-						$tmp = floor($time_still/86400);
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." ��. ";}
-							$time_still = $time_still-$tmp*86400;
-						}
-						$tmp = floor($time_still/3600);
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." �. ";}
-							$time_still = $time_still-$tmp*3600;
-						}
-						$tmp = floor($time_still/60);
-						if ($tmp > 0) { 
-							$id++;
-							if ($id<3) {$out .= $tmp." ���. ";}
-						}
-						if($out=='')
-						{
-							$out = $time_still.' ���.';
-						}
-						$ei .= '��������: '.$out.'';
-					}
-					
-					//�������� �������
-					$tr = ''; $t = $this->items['add'];
-					$x = 0; $ed = $this->lookStats($e['data']);	
-					while($x<count($t))
-					{
-						$n = $t[$x];
-						if(isset($ed['add_'.$n],$this->is[$n]))
-						{
-							$z = '';
-							if($ed['add_'.$n]>0)
-							{
-								$z = '+';
-							}
-							$tr .= '<br>'.$this->is[$n].': '.$z.''.$ed['add_'.$n];
-						}
-						$x++;
-					}
-					if($tr!='')
-					{
-						$ei .= $tr;
-					}
-					if($e['info']!='')
-					{
-						$ei .= '<br><i>����������:</i><br>'.$e['info'];
-					}
-					if($e['img2']!='' && $e['img']=='icon_none.gif')
-					{
-						$e['img'] = $e['img2'];
-					}
-					if($e['type1']==18 || $e['type1']==19)
-					{
-					$e['img'] = $e['img2'];
-					}
-					$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="https://img.new-combats.com/i/eff/'.$e['img'].'"onMouseOver="top.hi(this,\''.$ei.'\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
-				}elseif($e['timeUse']+$e['timeAce']+$e['actionTime']<time() && $e['timeUse']!=77)
-				{
-					//������� ������
-					$ed = $this->lookStats($e['data']);
-					if(!isset($ed['finish_file']) || $this->info['id'] == $e['uid']) {
-						$this->endEffect($e['id'],$u);
-					}
-				}
-			}
-			
-			if($sn['itmslvl'] == 0) {
-				//$ei = '<b><u>������ ����������</u></b> (������)<br>��������: <i>����������</i>';
-				//$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="https://img.new-combats.com/i/eff/light_armor.gif"onMouseOver="top.hi(this,\''.$ei.'\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
-			}
-			
-			//��������
-			if( $type_info == 1 ) {
-				$hptop = 0;
-				$lh = array(0=>'hp_none',1=>1);
-				$lh[1] = floor((0+$sn['hpNow'])/(0+$sn['hpAll'])*120);
-				if($lh[1]>0){  $lh[0] = 'hp_1'; }
-				if($lh[1]>32){ $lh[0] = 'hp_2'; }
-				if($lh[1]>65){ $lh[0] = 'hp_3'; }
-				if($sn['mpAll']>0)
-				{
-					//����
-					$lm = array(0=>'hp_none',1=>1);
-					$lm[1] = floor($sn['mpNow']/$sn['mpAll']*120);
-					if($lm[1]>0){ $lm[0] = 'hp_mp'; }
-					$hpmp .='<div id="vmp'.$u['id'].'" title="������� ����" align="center" class="seemp" style="position:absolute; top:10px; left:-5px; width:120px; height:10px; z-index:12;">'.floor($sn['mpNow']).'/'.(0+$sn['mpAll']).'</div>
-							 <div title="������� ����" class="hpborder" style="position:absolute; top:10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div class="'.$lm[0].' senohp" style="height:9px; position:absolute; top:10px; width:'.$lm[1].'px; z-index:11;" id="lmp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div title="������� ����" class="hp_none" style="position:absolute; top:10px; width:120px; height:10px; z-index:10;"></div>';
-				}else{
-					$hptop = 5;
-				}
-				$hpmp = '<div id="vhp'.$u['id'].'" title="������� �����" align="center" class="seehp" style="position:absolute; top:'.$hptop.'px;  left:-5px; width:120px; height:10px; z-index:12;">'.floor($sn['hpNow']).'/'.(0+$sn['hpAll']).'</div>
-						 <div title="������� �����" class="hpborder" style="position:absolute; top:'.$hptop.'px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div class="'.$lh[0].' senohp" style="height:9px; width:'.$lh[1].'px; position:absolute; top:'.$hptop.'px; z-index:11;" id="lhp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div title="������� �����" class="hp_none" style="position:absolute; top:'.$hptop.'px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>'.$hpmp;
-				//�������� �� � ��
-				$hpmp = '<div style="position:relative;">'.$hpmp.'</div>';
-			}elseif( $type_info == 2 ) {
-				$hptop = 0;
-				$lh = array(0=>'hp_none',1=>1);
-				$lh[1] = floor((0+$sn['hpNow'])/(0+$sn['hpAll'])*200);
-				if($lh[1]>0){  $lh[0] = 'hp_1'; }
-				if($lh[1]>32){ $lh[0] = 'hp_2'; }
-				if($lh[1]>65){ $lh[0] = 'hp_3'; }
-				if($sn['mpAll']>0)
-				{
-
-					//����
-					$lm = array(0=>'hp_none',1=>1);
-					$lm[1] = floor($sn['mpNow']/$sn['mpAll']*200);
-					if($lm[1]>0){ $lm[0] = 'hp_mp'; }
-					$hpmp .='<div id="vmp'.$u['id'].'" title="������� ����" align="center" class="seemp" style="position:absolute; top:10px; width:200px; height:10px; z-index:12;"> '.floor($sn['mpNow']).'/'.(0+$sn['mpAll']).'</div>
-							 <div title="������� ����" class="hpborder" style="position:absolute; top:10px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div class="'.$lm[0].' senohp" style="height:9px; position:absolute; top:10px; width:'.$lm[1].'px; z-index:11;" id="lmp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-							 <div title="������� ����" class="hp_none" style="position:absolute; top:10px; width:200px; height:10px; z-index:10;"></div>';
-				}else{
-					$hptop = 5;
-				}
-				$hpmp = '<div id="vhp'.$u['id'].'" title="������� �����" align="center" class="seehp" style="position:absolute; top:'.$hptop.'px; width:200px; height:10px; z-index:12;"> '.floor($sn['hpNow']).'/'.(0+$sn['hpAll']).'</div>
-						 <div title="������� �����" class="hpborder" style="position:absolute; top:'.$hptop.'px; width:200px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div class="'.$lh[0].' senohp" style="height:9px; width:'.$lh[1].'px; position:absolute; top:'.$hptop.'px; z-index:11;" id="lhp'.$u['id'].'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-						 <div title="������� �����" class="hp_none" style="position:absolute; top:'.$hptop.'px; width:200px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>'.$hpmp;
-				//�������� �� � ��
-				$hpmp = '<div style="position:relative;height:20px;">'.$hpmp.'</div>';
-			}
-			
-			$lgn = '<b>'.$u['login'].'</b> ['.$u['level'].']<a href="/info/'.$u['id'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif"></a>';
-			if($u['clan']!=0)
-			{
-				$pc = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`name_mini`,`align`,`type_m`,`money1`,`exp` FROM `clan` WHERE `id`="'.$u['clan'].'" LIMIT 1'));
-				$pc['img'] = $pc['name_mini'].'.gif';
-				$lgn = '<img title="'.$pc['name'].'" src="https://img.new-combats.com/i/clan/'.$pc['name_mini'].'.gif">'.$lgn;
-			}
-			if($u['align2']>0)
-			{
-				$lgn = '<img title="'.$this->mod_nm[floor(intval($u['align2']))][$u['align2']].'" src="https://img.new-combats.com/i/align/align'.$u['align2'].'.gif">'.$lgn;
-			}
-			if($u['align']>0)
-			{
-				$lgn = '<img title="'.$this->mod_nm[floor(intval($u['align']))][$u['align']].'" src="https://img.new-combats.com/i/align/align'.$u['align'].'.gif">'.$lgn;
-			}
-			$pb = '';
-			if($u['banned']>0)
-			{
-				$pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><b>�������� ������������</b></font></div>';
-			}
-			if($u['allLock'] > time()) {
-				$pb .= '<div style="margin:0 2px 0 2px;"><font color="red" style="background-color:#fae0e0"><b>��������� ������ �������!</b></font></div>';
-			}
-			
-			$swm = 0; //������ �����
-			$l = 40;
-			while($l<=52)
-			{
-				if(isset($witm[$l]))
-				{
-					$swm++;
-				}else{
-					$witm[$l] = '<img title="������ ���� ����������" src="https://img.new-combats.com/i/items/w/w101.gif">';
-				}
-				$l++;
-			}
-			
-			$ssm = 0; //����� �����
-			$l = 59;
-			while($l<=62)
-			{
-				if(isset($witm[$l]))
-				{
-					$ssm++;
-				}else{
-					$witm[$l] = '<img width="60" height="60" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w83.gif">';
-				}
-				$l++;
-			}
-			
-			$witmg = '';
-			
-			if($ssm>0 && $i1==0)
-			{
-				$witmg .= '<table style="padding-top:2px;padding-bottom:2px;" width="240" border="0" cellspacing="0" cellpadding="0">
-  <tr>
-	 <td width="60" height="60">'.$witm[59].'</td>
-	 <td width="60">'.$witm[60].'</td>
-	 <td width="60">'.$witm[61].'</td>
-	 <td width="60">'.$witm[62].'</td>
-  </tr>
-</table>';
-			}
-			
-			if($swm>0 && $i1==0)
-			{
-				$witmg .= '<table width="240" border="0" cellspacing="0" cellpadding="0">
-  <tr>
-	 <td width="40" height="25">'.$witm[40].'</td>
-	 <td width="40">'.$witm[41].'</td>
-	 <td width="40">'.$witm[42].'</td>
-	 <td width="40">'.$witm[43].'</td>
-	 <td width="40">'.$witm[44].'</td>
-	 <td width="40">'.$witm[50].'</td>
-  </tr>
-  <tr>
-	 <td height="25">'.$witm[45].'</td>
-	 <td>'.$witm[46].'</td>
-	 <td>'.$witm[47].'</td>
-	 <td>'.$witm[48].'</td>
-	 <td>'.$witm[49].'</td>
-	 <td>'.$witm[51].'</td>
-  </tr>
-
-</table>';
-			}
-			$zag = '';
-			if($u['zag']!='' && $i1 == 1) {
-				$rt[0] .= '<style> .inf2s { position:relative; filter: alpha(opacity=10); -moz-opacity: 0.10; -khtml-opacity: 0.10; opacity: 0.10; } .inf2s:hover { background-color:#e2e0e0;filter: alpha(opacity=70); -moz-opacity: 0.70; -khtml-opacity: 0.70; opacity: 0.70; } </style>';
-				
-				$zag = '<img width="243" height="283" style="position:absolute;top:-1px;left:-1px;" src="https://img.new-combats.com/i/zag/'.$u['zag'].'">';
-/*
-				$witmn[1] = '<img style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w9.gif">';
-				$witmn[2] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w13.gif">';
-				$witmn[3] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w3.gif">';
-				$witmn[4] = '<img style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w4.gif">';
-				$witmn[7] = '<img style="display:block;" title="������ ���� ����" src="https://img.new-combats.com/i/items/w/w5.gif">';
-				$witmn[8] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w1.gif">';
-				$witmn[9] = '<img style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w2.gif">';
-				$witmn[10] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[11] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[12] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[13] = '<img style="display:block;" title="������ ���� ��������" src="https://img.new-combats.com/i/items/w/w11.gif">';
-				$witmn[14] = '<img style="display:block;" title="������ ���� ���" src="https://img.new-combats.com/i/items/w/w10.gif">';
-				$witmn[16] = '<img style="display:block;" title="������ ���� ������" src="https://img.new-combats.com/i/items/w/w19.gif">';
-				$witmn[17] = '<img style="display:block;" title="������ ���� �����" src="https://img.new-combats.com/i/items/w/w12.gif">';
-*/
-				$j2 = 0;
-				while($j2 <= 17) {
-					$witm[$j2] = '<div class="inf2s">'.$witm[$j2].'</div>';
-					$j2++;
-				}
-				
-				$eff = $eff;
-				
-			}
-			//<div style="width:240px; padding:2px; border-bottom:1px solid #666666; border-right:1px solid #666666; border-left:1px solid #FFFFFF; border-top:1px solid #FFFFFF;">
-			if( $type_info == 1 ) {
-				if( $pb != '' ) {
-					$pb = '<div align="center" style="width:246px;"><!-- blocked -->'.$pb.'</div>';
-				}
-				$rt[0] .= '<div id="lgnthm" style="width:246px; padding:0 3px 0 3px;" align="center">'.$lgn.'</div>'.$pb.'
-				<div class="personag" style="width:240px; background-color:#CCC; padding:3px; margin-right:11px; border-bottom:1px solid #666666; border-right:1px solid #666666; border-left:1px solid #FFFFFF; border-top:1px solid #FFFFFF;">
-				<table width="240" border="0" cellspacing="0" cellpadding="0">
-				  <tr>
-					<td width="60" valign="top">
-					<table bgcolor="#e1e1e1" width="60" height="280" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="60"><div style="position:relative">'.$zag.''.$witm[1].'</div></td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[2].'</td>
-					  </tr>
-					  <tr>
-						<td height="60">'.$witm[3].'</td>
-					  </tr>
-					  <tr>
-						<td height="80">'.$witm[4].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[7].'</td>
-					  </tr>
-					</table>
-					</td>
-					<td height="280" valign="top">
-					<table bgcolor="#e1e1e1" width="120" height="280" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="20" bgcolor="#CCC" valign="top">
-						<!-- HP and MP -->
-						'.$hpmp.'
-						<!-- -->
-						</td>
-					  </tr>
-					  <tr>
-						<td valign="top">';
-						if($zag == ''){
-							if($i1 == 0) {
-								if(!isset($_GET['inv'])) {
-									$invg = array(0=>'main.php?inv=1',1=>'������');
-								}else{
-									$invg = array(0=>'main.php?skills=1',1=>'������');	
-								}
-							}else{
-								$o = mysql_fetch_array(mysql_query('SELECT `id` FROM `obraz` WHERE `img` = "'.mysql_real_escape_string($this->info['obraz']).'" AND `sex` = "'.$this->info['sex'].'" LIMIT 1'));
-								$invg = array(0=>'https://new-combats.com/shadow/'.$o['id'].'" target="_blank',1=>'������� �������');
-							}
-							$uobr = 'i/obraz/'.$u['sex'].'/'.$u['obraz'].'';
-							if(isset($sn['items_img'][1])) {
-								$uobr = 'rimg/r'.$sn['items_img'][1];
-							}
-							$rt[0] .= '<div style="position:relative;height:220px;">
-								<!-- ����� -->
-									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="'.$invg[0].'"><img onMouseOver="top.hi(this,\'������� � &quot;<b>'.$invg[1].'</b>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/'.$uobr.'" '.$oi.'></a></div>
-									<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">'.$eff.'</div>'.$anml.'
-							</div>';
-						}else{
-							if($i1 == 0) {
-								if(!isset($_GET['inv'])) {
-									$invg = array(0=>'main.php?inv=1',1=>'������');
-								}else{
-									$invg = array(0=>'main.php?skills=1',1=>'������');	
-								}
-							}else{
-								$invg = array(0=>'https://lib.new-combats.com/obraz.php?namez='.$u['zag'].'" target="_blank',1=>'������� �������');
-							}
-							$rt[0] .= '<div class="inf2s" style="position:relative;height:220px;">
-								<!-- ����� -->
-									<div style="position:absolute; width:120px; height:220px; z-index:1;"><a href="'.$invg[0].'"><img onMouseOver="top.hi(this,\'������� � &quot;<b>'.$invg[1].'</b>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="120" height="220" src="https://img.new-combats.com/1x1.gif" '.$oi.'></a></div>
-									<div style="position:absolute; width:120px; height:auto; z-index:3;" align="left">'.$eff.'</div>'.$anml.'
-							</div>';
-						}
-						
-						unset($invg);
-						
-						$rt[0] .= '</td>
-					  </tr>
-					  <tr>
-						<td height="40"><div align="center">'.$msl.'</div></td>
-					  </tr>
-					</table>
-					</td>
-					<td width="60" valign="top">
-					<table bgcolor="#e1e1e1" width="60" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="20">'.$witm[8].'</td>
-					  </tr>
-					  <tr>
-						<td height="20">'.$witm[9].'</td>
-					  </tr>
-					  <tr>
-						<td height="20"><table width="60" border="0" cellspacing="0" cellpadding="0">
-							<tr>
-							  <td width="20" height="20">'.$witm[10].'</td>
-							  <td width="20">'.$witm[11].'</td>
-							  <td width="20">'.$witm[12].'</td>
-							</tr>
-						</table></td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[13].'</td>
-					  </tr>
-					  <tr>
-						<td height="60">'.$witm[14].'</td>
-					  </tr>
-					  <tr>
-						<td height="80">'.$witm[16].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[17].'</td>
-					  </tr>
-					</table>
-					</td>
-				  </tr>
-				</table>'.$witmg.'</div>';
-			}elseif($type_info == 2) {
-				$rt[0] .= '<div style="width:209px; padding:2px;" align="center">'.$lgn.'</div>
-				<div style="width:196px; padding:2px;">
-				<div align="center"><!-- blocked -->'.$pb.'</div>
-				<div align="center">
-				<!-- HP and MP -->
-				'.$hpmp.'
-				<!-- -->
-				</div>
-				<table width="196" border="0" cellspacing="0" cellpadding="0">
-				  <tr>
-					<td width="60" valign="top">
-					<table width="60" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="20"><div style="position:relative">'.$zag.''.$witm[8].'</div></td>
-					  </tr>
-					  <tr>
-						<td height="20">'.$witm[9].'</td>
-					  </tr>
-					  <tr>
-						<td height="20">'.$witm[3].'</td>
-					  </tr>
-					  <tr>
-						<td height="80">'.$witm[4].'</td>
-					  </tr>
-					  <tr>
-						<td height="20"><table width="60" border="0" cellspacing="0" cellpadding="0">
-							<tr>
-							  <td width="20" height="20">'.$witm[10].'</td>
-							  <td width="20">'.$witm[11].'</td>
-							  <td width="20">'.$witm[12].'</td>
-							</tr>
-						</table></td>
-					  </tr>
-					</table>
-					</td>
-					<td valign="top">
-					<table width="76" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td valign="top">';
-						if($zag == ''){
-						if($i1 == 0) {
-							if(!isset($_GET['inv'])) {
-								$invg = array(0=>'main.php?inv=1',1=>'������');
-							}else{
-								$invg = array(0=>'main.php?skills=1',1=>'������');	
-							}
-						}else{
-							$invg = array(0=>'https://lib.new-combats.com/obraz.php?name='.$u['obraz'].'" target="_blank',1=>'������� �������');
-						}
-						$u['obraz'] = '0.gif';
-						$uobr = 'i/obraz/'.$u['sex'].'/old/'.$u['obraz'].'';
-						if(isset($sn['items_img'][1])) {
-							$uobr = 'rimg/r'.$sn['items_img'][1];
-						}
-						$rt[0] .= '<div style="position:relative;height:209px;">
-							<!-- ����� -->
-								<div style="position:absolute; width:76px; height:209px; z-index:1;"><a href="'.$invg[0].'"><img onMouseOver="top.hi(this,\'������� � &quot;<b>'.$invg[1].'</b>&quot;\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();" width="76" height="209" src="https://img.new-combats.com/'.$uobr.'" '.$oi.'></a></div>
-								<div style="position:absolute; width:76px; height:auto; z-index:3;" align="left">'.$eff.'</div>'.$anml.'
-						</div>';}
-						
-						unset($invg);
-						
-						$rt[0] .= '</td>
-					  </tr>
-					</table>
-					</td>
-					<td width="60" valign="top">
-					<table width="60" border="0" cellspacing="0" cellpadding="0">
-					  <tr>
-						<td height="60">'.$witm[1].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[13].'</td>
-					  </tr>
-					  <tr>
-						<td height="60">'.$witm[14].'</td>
-					  </tr>
-					  <tr>
-						<td height="40">'.$witm[17].'</td>
-					  </tr>
-					</table>
-					</td>
-				  </tr>
-				</table>'.$witmg.'</div>';
-			}
-			
-			if($i1==0 && $u['battle']==0)
-			{
-				$rt[0] .= '<script>top.lafstReg['.$u['id'].'] = 0; top.startHpRegen("main",'.$u['id'].','.(0+$sn['hpNow']).','.(0+$sn['hpAll']).','.(0+$sn['mpNow']).','.(0+$sn['mpAll']).','.(time()-$u['regHP']).','.(time()-$u['regMP']).','.(0+$this->rgd[0]).','.(0+$this->rgd[1]).',1);</script>';
-			}
-			if($ivv==0 && $i1==0)
-			{
-				$rt[0] .= $this->info_remont();
-			}
-		}
-		return $rt;
-	}
-	
-	public function endEffect($id,$u,$test)
-	{
-		if($test == false) {
-			$test = 0;
-		}
-		
-		$e = mysql_fetch_array(mysql_query('SELECT
-		`eu`.`id`,`eu`.`tr_life_user`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`,
-		`em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch`
-		FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`id`="'.mysql_real_escape_string($id).'" AND `delete`="0" AND `deactiveTime` < "'.time().'"'));
-		
-		if(isset($e['id']))
-		{		
-			$sleep = $this->testAction('`vars` = "sleep" AND `uid` = "'.$e['uid'].'" LIMIT 1', 1);
-			if( $e['id_eff'] == 2 ) {
-				//��������
-				$ev = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_main` WHERE `name` = "'.mysql_real_escape_string(str_replace('��������: ','',$e['name'])).'" LIMIT 1'));
-				$et = mysql_fetch_array(mysql_query('SELECT `id` FROM `actions` WHERE `uid` = "'.$e['uid'].'" AND `vars` LIKE "%read%" AND `vals` = "'.$ev['id'].'" LIMIT 1'));	
-				if(isset($et['id'])) {
-					if( $et['time'] < time() ) {
-						$et = false;
-					}else{
-						$et = true;
-					}
-				}else{
-					$et = false;
-				}
-			}else{
-				$et = false;
-			}
-			if($et == false && $e['sleeptime'] == 0 && $sleep['vars'] != 'sleep') {
-				$upd = mysql_query('UPDATE `eff_users` SET `delete`="'.time().'" WHERE `id` = "'.$e['id'].'" LIMIT 1');
-				if($upd)
-				{
-					$po = $this->lookStats($e['data']);
-					if(isset($po['finish_file']))
-					{
-						if(file_exists('_incl_data/class/magic/'.$po['finish_file'].'.php'))
-						{
-							require('_incl_data/class/magic/'.$po['finish_file'].'.php');
-
-						}else{
-							$this->error2 = '!File not exists &quot;cgi-bin/magic.pl?use_'.$po['finish_file'].'&quot;.';
-						}
-					}
-					if(isset($u['id']) && ($e['type1']<11 || ($e['type1']>16 && $e['type1']<23)) && $e['noch']==0)
-					{
-						$text = '����������� �������� ������� &quot;<b>'.$e['name'].'</b>&quot;';
-						mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`new`) VALUES ('".$u['city']."','".$u['room']."','','".$u['login']."','".$text."','-1','6','0',1)");
-						if($u['battle']>0) {
-							$lastHOD = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type` FROM `battle_logs` WHERE `battle` = "'.$u['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-							if(isset($lastHOD['id']))
-							{
-								$id_hod = $lastHOD['id_hod'];
-								if($lastHOD['type']!=6)
-								{
-									$id_hod++;
-								}
-								mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u['battle'].'","'.($id_hod).'","{tm1} '.$text.' � ��������� {u1}.","login1='.$u['login'].'||t1='.$u['team'].'||time1='.time().'","","","","","6")');
-							}
-						}
-					}
-					return 1;
-				}else{
-					return 0;
-				}
-			}else{
-				return 0;
-			}
-		}else{
-			return 0;
-		}
-	}
-	
-	public function snatItem($id,$uid)
-	{
-		if($uid!=0)
-		{
-			$au = 'AND `iu`.`uid`="'.mysql_real_escape_string($uid).'"';
-		}else{
-			$au = '';
-		}
-		$itm = mysql_fetch_array($cl = mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`!="0" '.$au.' AND `iu`.`delete`="0" LIMIT 1 FOR UPDATE'));
-		if(isset($itm['id']))
-		{
-			
-			$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`inOdet`="0" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-			if($upd)
-			{
-				if(isset($_GET['remitem']) || isset($_GET['sid'])) {
-					$this->info['autospell'] = 1;
-					mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				}
-				return 1;
-			}else{
-				return 0;
-			}
-		}else{
-			return 0;
-		}
-	}
-	
-	public function snatItemAll($uid)
-	{
-		$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`inOdet`="0" WHERE `uid`="'.$uid.'" AND `inOdet`!="0" AND `delete`="0" LIMIT 100');
-		if($upd)
-		{
-			return 1;
-		}else{
-			return 0;
-		}
-	}
-	
-	public function impStats($m)
-	{
-		$i = 0;
-		$k = array_keys($m);
-		$d = '';
-		while($i<=count($k))
-		{
-			if($k[$i]!='')
-			{
-				$d .= $k[$i].'='.$m[$k[$i]].'|';
-			}
-			$i++;
-		}
-		$d = rtrim($d,'|');
-		return $d;
-	}
-	
-	public function odetItem($id, $uid) {
-		if($uid != 0) {
-		  $au = 'AND `iu`.`uid` = "'.mysql_real_escape_string($uid).'"';
-		} else {
-		  $au = '';
-		}
-		
-		$itm = mysql_fetch_array(mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="0" LIMIT 1'));
-		if(isset($itm['id'])) {
-		  if($itm['group'] == 1) {
-			if($this->itemsX($itm['id']) > 1) {
-					$this->unstack($itm['id'],1);
-			  		/*$itm = mysql_fetch_array(mysql_query('SELECT
-					`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-					`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-					FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1'));
-					if(!isset($itm['id'])) {
-						$this->error = '������ ��������� ��������...';
-						$notr++;
-					} else {
-						$itm['delete'] = 0;
-					}*/					
-				}
-			}
-			
-			
-			$tr = $this->lookStats($itm['data']);
-			$notr = $this->trItem($tr);
-			$msb = '';
-			if(isset($tr['maks_itm_one']) && $tr['maks_itm_one']>0) {
-				$test = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$this->info['id'].'" AND `inOdet` > 0 AND `delete` = 0 AND `data` LIKE "%maks_itm_one='.$tr['maks_itm_one'].'%" LIMIT 1'));
-				if(isset($test['id'])) {
-					$this->error = '��������� ������������� �������� ������ ��������!';
-					$notr++;
-				}
-			}
-			if($this->info['twink']>0) {
-				//�� ������ 100 ���.
-				if( $itm['price2'] > 100 || $itm['2price'] > 100 ) {
-					$notr++;
-				}
-				//������ ���� + �����
-				if( isset($tr['rune']) && $tr['rune'] > 0 ) {
-					$notr++;
-				}
-				if( isset($tr['spell_id']) && $tr['spell_id'] > 0 ) {
-					$notr++;
-				}
-			}
-			if(isset($tr['vip_sale'])) {
-				if($this->stats['silver'] < 2) {
-					$notr++;
-				}
-			}
-			if(isset($tr['sudba'])) {
-				if($tr['sudba'] != '0' && $tr['sudba'] != $this->info['login']) {
-					$notr++;
-				} elseif($tr['sudba'] == '0'){
-					$tr['sudba'] = $this->info['login'];
-					$itm['data'] = $this->impStats($tr);
-					$msb = ',`data`="'.$itm['data'].'"';
-				}
-			}
-			if(isset($tr['tr_align_bs']) && $this->info['inTurnir'] > 0) {
-			  if($tr['tr_align_bs'] == '1') {
-				if($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2) { $notr++; } else { $notr = 0; }
-			  } else {
-				if($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4) { $notr++; } else { $notr = 0; }
-			  }
-			}
-			if($notr > 0) {
-				//�� ������� ������������� ��� �� ��������� �������
-				if(isset($tr['open']) && isset($_GET['open'])) {
-					$this->error = '�� �� ������ ������� ������ �������';
-				} else {
-					$this->error = '������ ����� ������ ������ �������� ������� ����';
-				}
-				return 0;
-			}elseif(isset($tr['open']) && isset($_GET['open']) && isset($tr['items_in_file']))
-			{
-				$io = '';
-				if($itm['inGroup'] > 0) {
-					mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-				if(file_exists('_incl_data/class/magic/'.$tr['items_in_file'].'.php')){
-					require('_incl_data/class/magic/'.$tr['items_in_file'].'.php');
-					if(!isset($no_open_itm)) {
-						$this->deleteItem($itm['id'],$this->info['id']);
-						$this->error = '�� ������� ������� &quot;'.$itm['name'].'&quot;:<br>'.$io.'...';
-					}else{
-						unset($no_open_itm);
-					}					
-				}else{
-					$this->error = '������� &quot;'.$itm['name'].'&quot; ���������� �������...';
-				}
-			}elseif(isset($tr['open']) && isset($_GET['open']))
-			{
-				//��������� �������
-				$io = '';
-				$i = 0;
-				$itms = explode(',',$tr['items_in']);
-				
-				
-				if($itm['type']==37) {
-					//������������� ��������
-					$io = '';
-					$itmin = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "'.$tr['item_inbox'].'" LIMIT 1'));
-					$itmmn = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$itmin['item_id'].'" LIMIT 1'));
-					//
-					if($itm['gift'] == '' || $itm['gift'] == '0') {
-						$this->error = '������� ������ ���� �������, ������ ��� ��� ���������!';
-					}elseif(!isset($itmin['id'])) {
-						$this->error = '� �������� ������ ���, ������ ����� ������� ���-�� ������� �� ����...';
-					}else{
-						$io .= $itmmn['name'];
-						if($itmin['item_id'] == 4867) {
-							//�� ��������
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							$this->error = '�� ������� ������� �������. ���������� ���������.';
-						}elseif($itmin['item_id'] == 4868) {
-							//������� ����
-							mysql_query('UPDATE `stats` SET `hpNow` = 1,`mpNow` = 1 WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							$this->error = '�� �������� ��� HP...';
-						}elseif($itmin['item_id'] == 4870) {
-							//������ ��������
-							if( $this->info['molch1'] > time() ) {
-								$this->info['molch1'] += 3600;
-							}else{
-								$this->info['molch1'] = time()+3600;
-							}
-							mysql_query('UPDATE `users` SET `molch1` = "'.$this->info['molch1'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							$this->error = '�� ��������� ��� �������� �������� ��������...';
-						}elseif($itmin['item_id'] == 4873) {
-							//�������� ��
-							$a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							if(isset($a['id'])) {
-								$this->error = '��� ����� &quot;'.$a['name'].'&quot; ������� ���������...';
-								mysql_query('UPDATE `users_animal` SET `eda` = 0, `yad` = "'.(time()+86400*7).'" WHERE `id` = "'.$a['id'].'" LIMIT 1');
-							}else{
-								$this->error = '���-�� ������� �������� ������ �����, �������� � ��� ��� :)';
-							}
-						}elseif($itmin['item_id'] == 4869) {
-							//����������� ������  (������ ������ �� 1 ���)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� � ������������","add_s'.rand(1,3).'=-'.rand(5,15).'","'.$this->info['id'].'",
-								"4", "bad_present_travma1.gif","0", "1"
-							)');					
-							$this->error = '�� ������������. � ��� ����� � ���������...';
-						}elseif($itmin['item_id'] == 4872) {
-							//��������  (������� ������ �� 1 ���)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� � ������������","add_s'.rand(1,3).'=-'.rand(16,25).'","'.$this->info['id'].'",
-								"4", "bad_present_travma2.gif","0", "2"
-							)');
-							$this->error = '�� ������������. � ��� ����� � ���������...';
-						}elseif($itmin['item_id'] == 4876) {
-							//����������  (������� ������ �� 1 ���)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� � ������������","add_s'.rand(1,3).'=-'.rand(26,35).'","'.$this->info['id'].'",
-								"4", "bad_present_travma3.gif","0", "3"
-							)');
-							$this->error = '�� ������������. � ��� ����� � ���������...';
-						}elseif($itmin['item_id'] == 4878) {
-							//������������  (add_puti=7200)
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+7200).'","-1",
-								"������������","add_puti=1","'.$this->info['id'].'",
-								"4", "bad_present_chains.gif","0", "3"
-							)');
-							$this->error = '�� �� ������ �������������...';
-						}elseif($itmin['item_id'] == 4874) {
-							//������� ��� ����  �� ���
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� ��� ����","add_s5=-50","'.$this->info['id'].'",
-								"4", "bad_present_dmage.gif","0", "3"
-							)');
-							$this->error = '��� ��������...';
-						}elseif($itmin['item_id'] == 4871) {
-							//������� ��� �����  �� ���
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->deleteItem($itmin['id'],$this->info['id']);
-							mysql_query('INSERT INTO `eff_users`
-							(`overType`,`timeUse`,`hod`,`name`,`data`,`uid`, `id_eff`, `img2`, `timeAce`, `v1`) VALUES (
-								"0","'.(time()+3600).'","-1",
-								"������� ��� �����","add_s1=-50","'.$this->info['id'].'",
-								"4", "bad_present_dfighter.gif","0", "3"
-							)');
-							$this->error = '��� ��������...';
-						}elseif(mysql_query('UPDATE `items_users` SET `uid` = "'.$this->info['id'].'",`lastUPD` = "'.time().'",`gift` = "'.$itm['gift'].'",`gtxt1` = "'.$itm['gtxt1'].'",`gtxt2` = "������� �� ��������. ���� ���������: '.date('d.m.Y H:i:s',$itmin['time_create']).'" WHERE `id` = "'.$itmin['id'].'" LIMIT 1')) {
-							//������� ��������
-							$this->deleteItem($itm['id'],$this->info['id']);
-							$this->error = '�� ������� ������� &quot;'.$itm['name'].'&quot;, ������ ���� �������:<br>'.$io.'...';
-						}else{
-							$this->error = '��������� ������� �������, ��� �� ���?';
-						}
-						//
-					}
-					//
-				}else{					
-					
-					while($i<count($itms))
-					{
-						if(isset($itms[$i]))
-						{
-							$x = 0;
-							$itms[$i] = explode('*',$itms[$i]);
-							$x += (int)$itms[$i][1];
-							$itms[$i] = $itms[$i][0];
-							$s = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id`="'.((int)$itms[$i]).'" LIMIT 1'));
-							if(isset($s['id']))
-							{
-								$j = 1;
-								while($j<=$x)
-								{
-									$pid = $this->addItem($s['id'],$this->info['id']);
-									if($pid>0)
-									{
-										mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`gift` = "'.$itm['gift'].'" WHERE `id` = "'.$pid.'" AND `uid` = "'.$this->info['id'].'" LIMIT 1');
-									}
-									$j++;
-								}
-								$io .= ''.$s['name'].' (x'.$x.'), ';	
-							}
-						}
-						$i++;
-					}
-					if($itm['inGroup'] > 0) {
-						mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'",`inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-					}
-					$this->deleteItem($itm['id'],$this->info['id']);
-					$this->error = '�� ������� ������� &quot;'.$itm['name'].'&quot;, ������ ���� �������:<br>'.$io.'...';
-				}
-			}else{
-				$inSlot = $itm['inslot'];
-				$s = mysql_query('SELECT `iu`.`id`,`iu`.`inOdet` FROM `items_users` AS `iu` WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$uid.'" AND `iu`.`delete`="0"');
-				$d = array();
-				while($p = mysql_fetch_array($s))
-				{
-					$d[$p['inOdet']] = $p['id'];
-				}
-				
-				//���� � ���� ������ � ����� ����� � ����� ����
-				if($itm['2too']==1 && $inSlot==3 && isset($d[3]))
-				{
-					$inSlot = 14;
-				}
-				
-				if($inSlot==3 || $inSlot==14)
-				{
-					//��������� ����-�� ��������� ������
-					 if($this->stats['items'][$this->stats['wp3id']]['2h']==1 || $this->stats['items'][$this->stats['wp14id']]['2h']==1 || $itm['2h']==1)
-					{
-						$this->snatItem($this->stats['items'][$this->stats['wp3id']]['id'],$uid);
-						$this->snatItem($this->stats['items'][$this->stats['wp14id']]['id'],$uid);					
-					}
-				}
-				
-				if(isset($d[$inSlot]))
-				{
-					if($inSlot==10)
-					{
-						if(!isset($d[12]))
-						{
-							$inSlot = 12;
-						}elseif(!isset($d[11]))
-						{
-							$inSlot = 11;	
-						}
-					}elseif($inSlot==40)
-					{
-						$i = 40;
-						while($i<=51)
-						{
-							if(!isset($d[$i]))
-							{
-								$inSlot = $i;
-								$i = 52;
-							}elseif($i==50)
-							{
-								$inSlot = 50;	
-							}
-							$i++;
-						}
-					}elseif($inSlot==53)
-					{
-						if(!isset($d[53]))
-						{
-							$inSlot = 53;
-						}elseif(!isset($d[54]))
-						{
-							$inSlot = 54;	
-						}
-					}elseif($inSlot==56)
-					{
-						if(!isset($d[56]))
-						{
-							$inSlot = 56;
-						}elseif(!isset($d[57]))
-						{
-							$inSlot = 57;	
-						}elseif(!isset($d[58]))
-						{
-							$inSlot = 58;	
-						}else{
-							$inSlot = 58;
-						}
-					}elseif($inSlot==59)
-					{
-						if(!isset($d[59]))
-						{
-							$inSlot = 59;
-						}elseif(!isset($d[60]))
-						{
-							$inSlot = 60;	
-						}elseif(!isset($d[61]))
-						{
-							$inSlot = 61;	
-						}elseif(!isset($d[62]))
-						{
-							$inSlot = 62;	
-						}
-					}
-				}
-				if(isset($d[$inSlot]))
-				{
-					$this->snatItem($d[$inSlot],$uid);
-				}
-				
-				
-				
-				
-				
-				$upd = mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inOdet` = "'.$inSlot.'"'.$msb.' WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				if($itm['inGroup'] > 0) {
-				  mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `inGroup` = 0, `delete` = 0 WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-				if($upd) {
-					//���� ������� ������������� ����� ��������
-					//if($itm[''])
-					//{
-					//	
-					//}
-					$this->info['autospell'] = 1;
-					mysql_query('UPDATE `users` SET `autospell` = "1" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					return 1; 
-				} else {
-					$this->error = '(!) ������ ���������� ������';
-					return 0; 
-				}
-			}
-		}else{
-			$this->error = '������� �� ������ � ����� �������';
-			return 0;
-		}
-	}	
-	
-	public function deleteItem($id,$uid,$coldel = 0)
-	{
-		if($uid!=0)
-		{
-			$au = 'AND `iu`.`uid`="'.mysql_real_escape_string($uid).'"';
-		}else{
-			$au = '';
-		}
-		$itm = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.*
-		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id`="'.mysql_real_escape_string($id).'" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND (`iu`.`delete`="0" OR `iu`.`delete`="1000") LIMIT 1'));
-		if(isset($itm['id']))
-		{
-			
-			if( $coldel == 0 ) {
-				//������� �������
-				$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-				$col = $this->itemsX($itm['id']);
-				if($col > 0) {
-					mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" LIMIT '.$col);
-				}
-			}else{
-				//������� ���������� ���-��
-				$col = $this->itemsX($itm['id']);
-				if( $col > 1 ) {
-					if( $col <= $coldel ) {
-						$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-					}
-					$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" AND `delete` = "1000" LIMIT '.$coldel);
-				}else{
-					//������� �������
-					$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `id`="'.$itm['id'].'" LIMIT 1');
-					$upd = mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'",`inGroup` = "0" WHERE `inGroup`="'.$itm['id'].'" AND `delete` = "1000" LIMIT '.$col);
-				}
-			}
-			if($upd)
-			{
-				if(isset($_GET['deleteall7'])) {
-					$st = $this->lookStats($itm['data']);
-					$whr = '';
-					if(isset($st['frompisher'])) {
-						$whr .= 'AND `data` LIKE "%frompisher='.$st['frompisher'].'%"';
-					}
-					$col = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `items_users` WHERE `item_id`="'.$itm['item_id'].'" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "'.$itm['uid'].'" AND `data` NOT LIKE "%nodelete%"'.$whr));
-					$col = $col[0];
-					mysql_query('UPDATE `items_users` SET `lastUPD`="'.time().'",`delete`="'.time().'" WHERE `item_id`="'.$itm['item_id'].'" AND `inOdet` = 0 AND `delete` < 100000 AND `uid` = "'.$itm['uid'].'" AND `data` NOT LIKE "%nodelete%"'.$whr);
-					$this->error = '�������� "'.$itm['name'].' (x'.($col+1).')" ���������';
-					$this->addDelo(1,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: �������� &quot;<b>'.$itm['name'].' (x'.$col.')</b>&quot; [itm:'.$itm['id'].'='.time().'] ���� <b>���������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				}else{
-					$this->error = '������� "'.$itm['name'].'" ��������';
-					$this->addDelo(1,$uid,'&quot;<font color="maroon">System.inventory</font>&quot;: ������� &quot;<b>'.$itm['name'].'</b>&quot; [itm:'.$itm['id'].'] ��� <b>��������</b>.',time(),$this->info['city'],'System.inventory',0,0);
-				}
-				return 1;
-			}else{
-				return 0;
-			}
-		}else{
-			$this->error = '������� �� ������ � ����� �������';
-		}
-	}
-	
-	public function return_btn()
-	{
-		return false;
-	}
-		
-	public function get_battle_cache($uid,$battle) {
-		$r = false;
-		if( $uid > 0 && $battle > 0 ) {
-			$r = mysql_fetch_array(mysql_query('SELECT * FROM `battle_cache` WHERE `battle` = "'.mysql_real_escape_string($battle).'" AND `uid` = "'.mysql_real_escape_string($uid).'" ORDER BY `id` DESC LIMIT 1'));
-			if( !isset($r['id']) ) {
-				$r = false;
-			}else{
-				$r = json_decode($r['data'],true);
-			}
-		}
-		return $r;
-	}
-	
-	public function clear_battle_cache($uid) {
-		mysql_query('DELETE FROM `battle_cache` WHERE `uid` = "'.mysql_real_escape_string($uid).'"');
-	}
-	
-	public function getStats($uid,$i1,$res = 0,$reimg = false,$btl_cache = false,$minimal = false)
-	{
-		global $c;
-		if(count($uid)>1)
-		{
-			$u = $uid;
-		}elseif($uid!=$this->info['id'] || $res==1)
-		{
-			if( $minimal == true ) {
-				$u = mysql_fetch_array(mysql_query('SELECT `u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`,
-				`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-				FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			}else{
-				$u = mysql_fetch_array(mysql_query('SELECT `u`.`twink`,`u`.`swin`,`u`.`slose`,`u`.`stopexp`,`u`.`battle`,`u`.`id`,`u`.`no_ip`,`u`.`level`,`u`.`login`,`u`.`clan`,
-				`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
-				FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			}
-		}else{
-			$u = $this->info;
-		}
-		
-		/*if( $btl_cache == true ) {
-			$cache = $this->get_battle_cache( $u['id'],$u['battle'] );
-			if( $cache == false ) {
-				unset($cache);
-			}else{
-				$cache['st'] = $u + $cache['st'];
-			}
-		}*/
-		
-		/*if( $u['battle'] > 0  ) {
-			$cache_items = $this->get_battle_cache( $u['id'],$u['battle'] );
-			if( $cache_items == false ) {
-				unset($cache_items);
-			}else{
-				$cache_items['st']['hpNow'] = $u['hpNow'];
-				$cache_items['st']['mpNow'] = $u['mpNow'];
-			}
-		}*/
-		
-		if(isset($u['id'],$u['stats']) && !isset($cache))
-		{			
-			$st  = array();
-			$s_vi = array();
-			$s_v = array();
-			$u['clanpos'] = 0;
-			if( $u['clan'] > 0 ) {
-				$r1 = mysql_fetch_array(mysql_query('SELECT `pos` FROM `aaa_clan_reting_list` WHERE `clan` = "'.$u['clan'].'" AND `date` = "'.date('dmY').'" LIMIT 1'));
-				if(isset($r1['pos'])) {
-					$st['clanpos'] = $r1['pos'];
-				}
-				unset($r1);
-			}
-						
-			if(!isset($cache_items)) {
-				//
-				//$st = new SplFixedArray(1024000);
-				//
-				$lvl = mysql_fetch_array(mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel` = "'.$u['upLevel'].'" LIMIT 1'));
-				if(isset($lvl['upLevel']))
-				{
-					$st['levels'] = $lvl;
-				}else{
-					$st['levels'] = 'undefined';
-				}
-				$st2 = array();
-				$st['id'] = $u['id'];
-				$st['login'] = $u['login'];
-				$st['lvl'] = $u['level'];
-				$st['hpNow'] = $u['hpNow'];
-				$st['hpAll'] = 0;
-				$st['mpNow'] = $u['mpNow'];
-				$st['mpAll'] = 0;
-				$st['zona'] = 1;
-				$st['zonb'] = 2;
-				$st['items'] = array();
-				$st['effects'] = array();
-				$st['reting'] = 0;
-				$st['irka'] = 0;
-				$sts = explode('|',$u['stats']);
-				$i = 0; $ste = '';
-				//������ ��������������
-				while($i<count($sts))
-				{
-					$ste = explode('=',$sts[$i]);
-					if(isset($ste[1]))
-					{
-						if(!isset($st[$ste[0]])) {
-							$st[$ste[0]] = 0;
-						}
-						$st[$ste[0]]  += intval($ste[1]);
-						
-						if(!isset($st2[$ste[0]])) {
-							$st2[$ste[0]] = 0;
-						}
-						$st2[$ste[0]] += intval($ste[1]);
-					}
-					$i++;
-				}			
-			
-				if($u['admin'] > 0) {
-					mysql_query('UPDATE `stats` SET
-						`tactic1` = 25,
-						`tactic2` = 25,
-						`tactic3` = 25,
-						`tactic4` = 25,
-						`tactic5` = 25,
-						`tactic6` = 25,
-						`tactic7` = 25,
-						`priems_z` = "0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|"
-					WHERE `id` = "'.$u['id'].'" LIMIT 1
-					');
-				}
-			
-				//��������� ��������
-				if($this->info['id'] == $u['id'] || $reimg != false) {
-					$sp_img = mysql_query('SELECT * FROM `items_img` WHERE `uid` = "'.$u['id'].'" AND `img_id` != "0" LIMIT 16');
-					while($pl_img = mysql_fetch_array($sp_img)) {
-						$pl_img_r = mysql_fetch_array(mysql_query('SELECT * FROM `reimage` WHERE ((`uid` = "'.$u['id'].'" AND `clan` = "0") OR (`clan` = "'.$u['clan'].'" AND '.$u['clan'].' > 0)) AND `good` > 0 AND `bad` = "0" AND `id` = "'.$pl_img['img_id'].'" LIMIT 1'));
-						if(isset($pl_img_r['id'])) {
-							$st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format'];
-						}else{
-							mysql_query('UPDATE `items_img` SET `img_id` = "0" WHERE `id` = "'.$pl_img['id'].'" LIMIT 1');
-						}
-					}
-				}
-			
-				//�������������� �� ���������
-				$cl = mysql_query('SELECT 
-				`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-				`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-				FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`!="0" AND `iu`.`uid`="'.$u['id'].'" AND `iu`.`delete`="0" LIMIT 250');
-				$ia = $this->items['add'];
-				$h = 0;
-				$hnd1 = 0;
-				$hnd2 = 0;
-				$sht1 = 0;
-				$reitm = array();
-				$coms = array(); // ���������
-				$dom = array();
-				$btl_cof = 0;
-				$oza = array(
-					1=>array(0,0),
-					2=>array(0,0),
-					3=>array(0,0),
-					4=>array(0,0)
-				); //����������� ������
-				$ozm = array(
-					1=>array(0,0),
-					2=>array(0,0),
-					3=>array(0,0),
-					4=>array(0,0)
-				); //����������� �����
-	
-				$itmslvl = 0;
-				$itmsCfc = 0;
-				$st['reting'] = 0;
-				while($pl = mysql_fetch_array($cl))
-				{	
-					if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) {
-						if( $pl['1price'] > 0 ) {
-							$st['irka'] += $pl['1price'];	
-						}else{
-							$st['irka'] += $pl['price1'];
-						}
-					}
-					/* ������������� */
-					//$dom[count($dom)] = array($pl['inOdet'],$pl['class'],$pl['class_point'],$pl['anti_class'],$pl['anti_class_point'],$pl['level'],$u['level'],$pl['price2']);
-					
-					
-					if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) {
-						/*if( $pl['2price'] > 0 ) {
-							$st['reting'] += $pl['2price']*12.5;
-						}elseif( $pl['price2'] > 0 ) {
-							$st['reting'] += $pl['price2']*12.5;
-						}elseif( $pl['1price'] > 0 ) {
-							$st['reting'] += $pl['1price'];
-						}elseif( $pl['price1'] > 0 ) {
-							$st['reting'] += $pl['price1'];
-						}*/
-					}
-					
-					
-					$st['wp'.$pl['inOdet'].'id'] = $h; 
-	
-					$st['items'][$h] = $pl;	$h++;
-					if($pl['inOdet']==3 && (($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27 || $pl['type']==28))
-					{
-						$hnd1 = 1;
-					}
-					if($pl['inOdet']==14 && (($pl['type']>=18 && $pl['type']<=24) || $pl['type']==26 || $pl['type']==27 || $pl['type']==28))
-					{
-						$hnd2 = 1;
-					}elseif($pl['inOdet']==14 && $pl['type']==13)
-					{
-						$sht1 = 1;
-					}
-					$sts = explode('|',$pl['data']);
-					$i = 0; $ste = ''; $sti = array();
-					while($i<count($sts))
-					{
-						$ste = explode('=',$sts[$i]);
-						if(isset($ste[1]))
-						{
-							if(!isset($sti[$ste[0]])) {
-								$sti[$ste[0]] = 0;
-							}
-							$sti[$ste[0]] += intval($ste[1]);
-						}
-						$i++;
-					}
-					
-					if( !isset($sti['zazuby']) && !isset($sti['frompisher']) ) {
-						if( $pl['inOdet'] < 18 && $pl['inOdet'] > 0 ) {
-							
-							if( $pl['2price'] == 0 && $pl['price2'] == 0 ) {
-								if( $pl['1price'] > 0 ) {
-									$st['prckr'] += $pl['1price'];	
-								}else{
-									$st['prckr'] += $pl['price1'];
-								}
-							} else {
-							  if( $pl['2price'] > 0 ) {
-								  $st['prckr'] += $pl['2price']*200;
-							  	  $st['preckr'] += $pl['2price'];
-							  }else{
-								  $st['prckr'] += $pl['price2']*200;
-							  	  $st['preckr'] += $pl['price2'];
-							  }
-							}
-						}
-					}else{
-						if( $pl['inOdet'] < 18 && $pl['inOdet'] > 0 ) {
-							if( $pl['2price'] == 0 && $pl['price2'] == 0 ) {
-								if( $pl['1price'] > 0 ) {
-									//$st['prckr'] += round($pl['1price']/3);	
-								}else{
-									//$st['prckr'] += round($pl['price1']/3);
-								}
-							}
-						}
-					}
-					
-					if($pl['inOdet'] <= 18 && $pl['inOdet'] > 0 ) {
-
-						$st['reting'] += 1;
-					}
-					
-					if(isset($sti['add_oza'])) {
-	
-					}
-					
-					$ko = 1;
-					while($ko <= 4) {
-						if(isset($sti['add_oza'.$ko])) {
-							if(isset($sti['add_oza'])) {
-								if($sti['add_oza'] == 1) {
-									//������
-									$oza[$ko][0] += 1;
-									$oza[$ko][1] += 9;
-								}elseif($sti['add_oza'] == 2) {
-									//����������
-									$oza[$ko][0] += 20;
-									$oza[$ko][1] += 39;
-								}elseif($sti['add_oza'] == 3) {
-									//�������
-									$oza[$ko][0] += 40;
-									$oza[$ko][1] += 69;
-								}elseif($sti['add_oza'] == 4) {
-									//��������������
-									$oza[$ko][0] += 10;
-									$oza[$ko][1] += 19;
-								}elseif($sti['add_oza'] == 5) {
-									//������������
-									$oza[$ko][0] += 70;
-									$oza[$ko][1] += 89;
-								}
-							}
-							if(isset($sti['add_ozm'])) {
-								if($sti['add_ozm'] == 1) {
-									//������
-									$ozm[$ko][0] += 1;
-									$ozm[$ko][1] += 9;
-								}elseif($sti['add_ozm'] == 2) {
-									//����������
-									$ozm[$ko][0] += 20;
-									$ozm[$ko][1] += 39;
-								}elseif($sti['add_ozm'] == 3) {
-									//�������
-									$ozm[$ko][0] += 40;
-									$ozm[$ko][1] += 69;
-								}elseif($sti['add_ozm'] == 4) {
-									//��������������
-									$ozm[$ko][0] += 10;
-									$ozm[$ko][1] += 19;
-								}elseif($sti['add_ozm'] == 5) {
-									//������������
-									$ozm[$ko][0] += 70;
-									$ozm[$ko][1] += 89;
-								}
-							}
-							if($sti['add_oza'.$ko] == 1) {
-								//������
-								$oza[$ko][0] += 1;
-								$oza[$ko][1] += 9;
-							}elseif($sti['add_oza'.$ko] == 2) {
-								//����������
-								$oza[$ko][0] += 20;
-								$oza[$ko][1] += 39;
-							}elseif($sti['add_oza'.$ko] == 3) {
-								//�������
-								$oza[$ko][0] += 40;
-								$oza[$ko][1] += 69;
-							}elseif($sti['add_oza'.$ko] == 4) {
-								//��������������
-								$oza[$ko][0] += 10;
-								$oza[$ko][1] += 19;
-							}elseif($sti['add_oza'.$ko] == 5) {
-								//������������
-								$oza[$ko][0] += 70;
-								$oza[$ko][1] += 89;
-							}
-							if($sti['add_ozm'.$ko] == 1) {
-								//������
-								$ozm[$ko][0] += 1;
-								$ozm[$ko][1] += 9;
-							}elseif($sti['add_ozm'.$ko] == 2) {
-								//����������
-								$ozm[$ko][0] += 20;
-								$ozm[$ko][1] += 39;
-							}elseif($sti['add_ozm'.$ko] == 3) {
-								//�������
-								$ozm[$ko][0] += 40;
-								$ozm[$ko][1] += 69;
-							}elseif($sti['add_ozm'.$ko] == 4) {
-								//��������������
-								$ozm[$ko][0] += 10;
-								$ozm[$ko][1] += 19;
-							}elseif($sti['add_ozm'.$ko] == 5) {
-								//������������
-								$ozm[$ko][0] += 70;
-								$ozm[$ko][1] += 89;
-							}
-						}
-						$ko++;
-					}
-					
-					//if( $sti['tr_lvl'] == $u['level'] ) {
-					if( $pl['inOdet'] <= 18 ) {
-						$itmslvl++;
-					}
-					if( $pl['inOdet'] <= 14 ) {
-						if( $pl['tr_lvl'] == $u['level'] ) {
-							$itmsCfc += 1;
-						}else{
-							$itmsCfc += ($sti['tr_lvl']/$u['level'])/4;
-						}
-					}
-					//}
-					
-					if(isset($sti['art'])) {
-						if(!isset($st['art'])) {
-							$st['art'] = 0;
-						}
-						$st['art'] += $sti['art'];
-					}
-					if(isset($sti['maks_itm'])) {
-						if(!isset($st['maks_itm'])) {
-							$st['maks_itm'] = 0;
-						}
-						$st['maks_itm'] += $sti['maks_itm'];
-					}
-					if(isset($sti['complect']))
-					{
-						$coms[count($coms)]['id'] = $sti['complect'];
-						if(!isset($coms['com'][$sti['complect']]))
-						{
-							$coms['com'][$sti['complect']] = 0;	
-							if(!isset($coms['new'])) {
-								$coms['new'] = array();
-							}
-							$coms['new'][count($coms['new'])] = $sti['complect'];
-						}
-						$coms['com'][$sti['complect']]++;
-						if($pl['2h'] > 0) {
-							$coms['com'][$sti['complect']]++;
-						}
-					}
-					if(isset($sti['complect2']))
-					{
-						$coms[count($coms)]['id'] = $sti['complect2'];
-						if(!isset($coms['com'][$sti['complect2']]))
-						{
-							$coms['com'][$sti['complect2']] = 0;	
-							if(!isset($coms['new'])) {
-								$coms['new'] = array();
-							}
-							$coms['new'][count($coms['new'])] = $sti['complect2'];
-						}
-						$coms['com'][$sti['complect2']]++;
-						if($pl['2h'] > 0) {
-							$coms['com'][$sti['complect2']]++;
-						}
-					}
-					
-					if(isset($sti['zonb']) && $sti['zonb']!=0)
-					{
-						if(!isset($st['zonb'])) {
-							$st['zonb'] = 0;
-						}
-						$st['zonb'] += $sti['zonb'];
-					}
-					
-					if(isset($sti['zona']) && $sti['zona']!=0)
-					{
-						if(!isset($st['zona'])) {
-							$st['zona'] = 0;
-						}
-						$st['zona'] += $sti['zona'];
-					}
-					
-					//��������� ����� �� ������� ��������
-					if(!isset($sti['restart_stats']))
-					{
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								//��������� �� (��������)
-								/*if( isset($sti['sv_'.$ia[$i]]) ) {
-									if($ia[$i] != 'zmproc' && $ia[$i] != 'zaproc' && $ia[$i] != 'm9') {
-										/*if( $ia[$i] == 'm1' || 
-											$ia[$i] == 'm2' ||
-											$ia[$i] == 'm4' || 
-											$ia[$i] == 'm5' || 
-											$ia[$i] == 'za' ||
-											$ia[$i] == 'za1' ||
-											$ia[$i] == 'za2' ||
-											$ia[$i] == 'za3' ||
-											$ia[$i] == 'za4' || 
-											$ia[$i] == 'zm' ||
-											$ia[$i] == 'zm1' ||
-											$ia[$i] == 'zm2' ||
-											$ia[$i] == 'zm3' ||
-											$ia[$i] == 'zm4' || 
-											$ia[$i] == 'zm5' ||
-											$ia[$i] == 'zm6' ||
-											$ia[$i] == 'zm7' ||
-											$ia[$i] == 'zma' 
-										) {*/
-											//$st[$ia[$i]] += intval($sti['sv_'.$ia[$i]]);
-										/*}*/
-									//}
-								//}
-								//��������� �� (��������� ��)
-								if(isset($sti['add_'.$ia[$i]])) {
-									
-									if($ia[$i] != 'zmproc' && $ia[$i] != 'zaproc') {
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] += intval($sti['add_'.$ia[$i]]);
-									}else{
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-										$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]]/100*intval($sti['add_'.$ia[$i]]);
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-									}
-									
-								}
-							}
-							$i++;
-						}
-					}else{
-						$reitm[count($reitm)] = $sti;
-					}
-					$i = 0;
-					while($i<count($ia))
-					{
-						if(isset($ia[$i]))
-						{
-							if(isset($sti['sv_'.$ia[$i]])) {
-								if(!isset($s_v[$ia[$i]])){
-									$s_v[$ia[$i]] = 0;
-									$s_v['z'][$pl['inOdet']][$ia[$i]] = 0;
-								}
-								$s_v[$ia[$i]] += intval($sti['sv_'.$ia[$i]]);
-								$s_v['z'][$pl['inOdet']][$ia[$i]] += intval($sti['sv_'.$ia[$i]]);
-							}
-						}
-						$i++;
-					}			
-				}
-			
-				//����������� ���-�� � ������
-				if(count($reitm)>0)
-				{
-					$i39 = array(0=>0,1=>0,2=>0);
-					$i = 0;
-					while($i<count($reitm))
-					{
-						if(isset($reitm[$i]['sm_skill']) && $i39[0]==0)
-						{
-							//������
-							$i9 = 1; $i39[0] = 1;
-							while($i9<=7)
-							{
-								$st['a'.$i9] = $st['a'.$i9]-$st2['a'.$i9]+$reitm[$i]['add_a'.$i9];
-								$st['mg'.$i9] = $st['mg'.$i9]-$st2['mg'.$i9]+$reitm[$i]['add_mg'.$i9];
-								$i9++;
-							}												
-						}elseif(isset($reitm[$i]['sm_abil']) && $i39[1]==0)
-						{
-							//�����
-							$i9 = 1; $i39[1] = 1;
-							while($i9<=12)
-							{
-								$st['s'.$i9] = $st['s'.$i9]-$st2['s'.$i9]+$reitm[$i]['add_s'.$i9];
-								$i9++;
-							}	
-						}elseif(isset($reitm[$i]['sm_skill2']) && $i39[2]==0)
-						{
-							//������
-							
-							$i39[2] = 1;
-						}
-						$i++;
-					}
-				}
-				
-				//����� �� ������
-				$efs = mysql_query('SELECT * FROM `users_ico` WHERE `uid`="'.mysql_real_escape_string($u['id']).'" AND (`endTime` > "'.time().'" OR `endTime` = 0)');
-				while($e = mysql_fetch_array($efs))
-				{
-						$sts = $this->lookStats($e['bonus']);
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if (!isset($sti[$ia[$i]])){
-								$sti[$ia[$i]] = 0;
-								 }
-								if (!isset($sts['add_'.$ia[$i]])){
-									$sts['add_'.$ia[$i]] =0;
-								}
-	
-								$sti[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-	
-								if(!isset($st[$ia[$i]])){
-									$st[$ia[$i]] = 0;
-								}
-								  //
-								$st[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-							}
-							$i++;
-						}	
-				}
-				/*if( $u['battle'] > 0 ) {
-					//��������
-					$cache_items = array(
-						'st' => $st,
-						'sti' => $sti,
-						's_v' => $s_v,
-						's_vi' => $s_vi
-					);
-					$cache_items = json_encode($cache_items);
-					mysql_query('INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("'.$u['id'].'","'.$u['battle'].'","'.mysql_real_escape_string($cache_items).'","'.time().'")');
-					unset($cache_items);
-				}*/
-			}else{
-				/*$st = $cache_items['st'];
-					unset($cache_items['st']);
-				$sti = $cache_items['sti'];
-					unset($cache_items['sti']);
-				$s_v = $cache_items['s_v'];
-					unset($cache_items['s_v']);
-				$s_vi = $cache_items['s_vi'];
-				unset($cache_items);*/
-			}	
-									
-			//
-			//if( $this->info['id'] != $u['id'] ) {
-				if( $u['battle'] > 0 ) {
-					$test_btl_info = mysql_fetch_array(mysql_query('SELECT `id`,`noeff` FROM `battle` WHERE `id` = "'.$u['battle'].'" LIMIT 1'));
-					$test_noef = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_actions` WHERE `uid` = "'.$u['id'].'" AND `vars` = "noeffectbattle1" AND `btl` = "'.$u['battle'].'" LIMIT 1'));
-				}
-			//}
-			//�������������� �� ��������
-			$h = 0;
-			$nbs = array();
-			$prsu = array();
-			if(!isset($test_noef['id'])) {
-				$efs = mysql_query('SELECT 
-				`eu`.`id`,`eu`.`id_eff`,`eu`.`tr_life_user`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace`,
-				`em`.`id2`,`em`.`mname`,`em`.`type1`,`em`.`img`,`em`.`mdata`,`em`.`actionTime`,`em`.`type2`,`em`.`type3`,`em`.`onlyOne`,`em`.`oneType`,`em`.`noAce`,`em`.`see`,`em`.`info`,`em`.`overch`,`em`.`bp`,`em`.`noch` FROM `eff_users` AS `eu` LEFT JOIN `eff_main` AS `em` ON (`eu`.`id_eff` = `em`.`id2`) WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "'.time().'" AND `eu`.`v1`!="priem" ORDER BY `eu`.`id` DESC LIMIT 50');
-				while($e = mysql_fetch_array($efs))
-				{
-					if( $u['dnow'] == 0 ) {
-						if( $u['battle'] == 0 ) {
-							mysql_query('DELETE FROM `eff_users` WHERE `id_eff` = "'.$e['id_eff'].'" AND `uid` = "'.$u['id'].'" AND `id` != "'.$e['id'].'" ORDER BY `id` ASC');
-							//��������� � ������
-							if($e['v1'] != 'priem') {
-								if($e['hod'] != -1) {
-									mysql_query('UPDATE `eff_users` SET `hod` = "-1",`timeUse` = "'.(time()+($e['hod']*$c['effz'])-$e['actionTime']).'" WHERE `id` = "'.$e['id'].'" LIMIT 1');
-								}
-							}
-						}else{
-							if($e['v1'] != 'priem' && $c['effz'] > 0) {
-								if($e['hod'] == -1) {
-									$efzz = round(($e['timeUse']+$e['actionTime']+$e['timeAce'])-time());
-									if( $efzz > 0 ) {
-										mysql_query('UPDATE `eff_users` SET `hod` = "'.($efzz/$c['effz']).'" WHERE `id` = "'.$e['id'].'" LIMIT 1');
-									}
-								}
-							}
-						}
-					}
-					//echo '['.date( 'd.m.Y H:i:s' , time() + round((($e['timeUse']+$e['timeAce']+$e['actionTime'])-time())/$c['effz'])*$c['effz']).']';
-					if(true == false && $test_btl_info['noeff']==1 && isset($this->ekrcast[$e['id_eff']])) {
-						//������� �� ���������
-					}elseif( $e['sleeptime'] != 0 && substr_count($e['v1'],'pgb') > 0 ) {
-						//�� ���������� �������� ����������� �� ����� ���
-					}elseif( ( $e['timeUse']+$e['timeAce']+$e['actionTime']>time() || $e['timeUse']==77 ) )
-					{					
-						if($e['v1'] == 'priem') {
-							$prsu[$e['v2']] = 0+$prsu['x'];
-						}
-						$st['effects'][$h] = $e;	$h++;
-						$sts = $this->lookStats($e['data']);
-						if(isset($sts['itempl']) && $sts['itempl'] > 0) {
-							$nbs[$sts['itempl']] += 1;
-						}
-						if( isset($sts['puti']) ) {
-							$st['puti'] = $sts['puti'];
-						}
-						if( isset($sts['add_silver']) ) {
-							$st['slvtm'] = $e['timeUse']+$e['actionTime'];
-						}
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['add_'.$ia[$i]])) {
-									if(!isset($sti[$ia[$i]])) {
-										$sti[$ia[$i]] = 0;
-									}
-									$sti[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-								}
-								if(isset($sts['add_'.$ia[$i]])) {
-									if($ia[$i] != 'zaproc' && $ia[$i] != 'zmproc') {
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-									}else{
-										if(!isset($st[$ia[$i]])) {
-											$st[$ia[$i]] = 0;
-										}
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-										$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]]/100*intval($sts['add_'.$ia[$i]]);
-										$st[$ia[$i]] = 100-$st[$ia[$i]];
-									}								
-								}
-							}
-							$i++;
-						}	
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['sv_'.$ia[$i]])) {
-									if(!isset($s_vi[$ia[$i]])) {
-										$s_vi[$ia[$i]] = 0;
-									}
-									$s_vi[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								}
-								if(isset($sts['sv_'.$ia[$i]])) {
-									if(!isset($s_v[$ia[$i]])) {
-										$s_v[$ia[$i]] = 0;
-									}
-									$s_v[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								}
-							}
-							$i++;
-						}	
-					}elseif($e['timeUse']!=77){
-						//������� ������	
-						if( $e['img2'] != 'tz.gif' || $u['id'] == $this->info['id'] ) {				
-							if( $e['sleeptime'] == 0 ) {
-								$this->endEffect($e['id'],$u);
-							}
-							$st['act'] = 1;
-						}
-					}
-				}
-			}else{
-				$st['noeffectbattle1'] = 1;
-			}
-			
-			//�������� �� ��������
-			//$st['items_img'][$pl_img['type']] = $pl_img_r['id'].'.'.$pl_img_r['format'];
-			if( $nbs[4899] > 0 ) {
-				//������� ��������
-				$st['items_img'][8] = 'robe_illusion4.gif';
-				$st['items_img'][11] = 'leg_illusion4.gif';				
-			}elseif( $nbs[4900] > 0 ) {
-				//������ ��������
-				$st['items_img'][8] = 'robe_illusion5.gif';
-				$st['items_img'][11] = 'leg_illusion5.gif';				
-			}elseif( $nbs[4901] > 0 ) {
-				//������� ��������
-				$st['items_img'][8] = 'robe_illusion3.gif';
-				$st['items_img'][11] = 'leg_illusion3.gif';				
-			}elseif( $nbs[4902] > 0 ) {
-				//����� ��������
-				$st['items_img'][8] = 'robe_illusion6.gif';
-				$st['items_img'][11] = 'leg_illusion6.gif';				
-			}elseif( $nbs[4903] > 0 ) {
-				//������ ��������
-				$st['items_img'][8] = 'robe_illusion8.gif';
-				$st['items_img'][11] = 'leg_illusion8.gif';				
-			}elseif( $nbs[4904] > 0 ) {
-				//��������� ������
-				$st['items_img'][8] = 'robe_illusion7.gif';
-				$st['items_img'][11] = 'leg_illusion7.gif';				
-			}elseif( $nbs[4905] > 0 ) {
-				//��������� ������
-				$st['items_img'][8] = 'robe_illusion9.gif';
-				$st['items_img'][11] = 'leg_illusion9.gif';				
-			}elseif( $nbs[4908] > 0 ) {
-				//����� ������ ������
-				$st['items_img'][8] = 'robe_illusion2.gif';
-				$st['items_img'][11] = 'leg_illusion2.gif';
-				$st['items_img'][10] = 'boots_illusion2.gif';
-				$st['items_img'][9] = 'belt_illusion2.gif';
-				$st['items_img'][5] = 'naruchi_illusion2.gif';	
-				$st['items_img'][4] = 'helmet_illusion2.gif';
-				$st['items_img'][12] = 'perchi_illusion2.gif';				
-			}elseif( $nbs[4906] > 0 ) {
-				//����� ������������� ������
-				$st['items_img'][8] = 'robe_illusion1.gif';
-				$st['items_img'][11] = 'leg_illusion1.gif';
-				$st['items_img'][10] = 'boots_illusion1.gif';
-				$st['items_img'][9] = 'belt_illusion1.gif';
-				$st['items_img'][5] = 'naruchi_illusion1.gif';	
-				$st['items_img'][4] = 'helmet_illusion1.gif';
-				$st['items_img'][12] = 'perchi_illusion1.gif';				
-			}
-			if( $nbs[4909] > 0 ) {
-				//����� ������� ���������
-				$st['items_img'][13] = 'ring_illusion2.gif';
-				$st['items_img'][17] = 'ring_illusion2.gif';
-				$st['items_img'][18] = 'ring_illusion2.gif';
-				$st['items_img'][14] = 'amulet_illusion2.gif';
-				$st['items_img'][15] = 'earrings_illusion2.gif';				
-			}elseif( $nbs[4907] > 0 ) {
-				//����� ������� ���������
-				$st['items_img'][13] = 'ring_illusion1.gif';
-				$st['items_img'][17] = 'ring_illusion1.gif';
-				$st['items_img'][18] = 'ring_illusion1.gif';
-				$st['items_img'][14] = 'amulet_illusion1.gif';
-				$st['items_img'][15] = 'earrings_illusion1.gif';				
-			}
-			
-			if( $itmslvl < 5 ) {
-				//������ ����������
-				$st['itmslvl'] = 0;
-			}else{
-				$st['itmslvl'] = 1;
-			}
-			//
-			$st['itmsCfc'] = $itmsCfc;
-			
-			unset($test_btl_info);
-			
-			if( $u['battle'] > 0 ) {
-				//�������������� �� �������
-				$efs = mysql_query('SELECT `eu`.`id`,`eu`.`id_eff`,`eu`.`uid`,`eu`.`name`,`eu`.`data`,`eu`.`overType`,`eu`.`timeUse`,`eu`.`timeAce`,`eu`.`user_use`,`eu`.`tr_life_user`,`eu`.`delete`,`eu`.`v1`,`eu`.`v2`,`eu`.`img2`,`eu`.`x`,`eu`.`hod`,`eu`.`bj`,`eu`.`sleeptime`,`eu`.`no_Ace` FROM `eff_users` AS `eu` WHERE `eu`.`uid`="'.mysql_real_escape_string($u['id']).'" AND `eu`.`delete`="0" AND `eu`.`deactiveTime` < "'.time().'" AND `eu`.`v1` = "priem" ORDER BY `eu`.`id` ASC');
-				$st['set_pog'] = array();
-				$st['set_pog2'] = array();
-				while($e = mysql_fetch_array($efs))
-				{
-					$e['type1'] = 14;
-					$e['img'] = $e['img2'];
-					if($e['tr_life_user'] > 0 ) {
-						$trlu = mysql_fetch_array(mysql_query('SELECT `hpNow` FROM `stats` WHERE `id` = "'.$e['tr_life_user'].'" LIMIT 1'));
-						if( floor($trlu['hpNow']) < 1 ) {
-							$this->endEffect($e['id'],$u);
-							$st['act'] = 1;
-						}
-					}
-					if($e['timeUse']+$e['timeAce']+$e['actionTime']>time() || $e['timeUse']==77)
-					{				
-						if($e['v1'] == 'priem') {
-							$prsu[$e['v2']] = 0+$prsu['x'];
-						}
-						$st['effects'][$h] = $e;	$h++;
-						$sts = $this->lookStats($e['data']);
-						if($e['v2'] == 217) {
-							$st['raztac'] = 1;
-						}
-						if(isset($sts['add_pog']))
-						{
-							$ctt = count($st['set_pog']);
-							$st['set_pog'][$ctt]['id'] = $h;
-							$st['set_pog'][$ctt]['y']  = $sts['add_pog'];
-							unset($ctt);
-						}
-						if(isset($sts['natoe'])) {
-							$st['set_natoe']['id'] = $h;
-							$st['set_natoe']['a'] = 0 + $sts['natoe_end'];
-							$st['set_natoe']['b'] = 0 + $sts['natoe'];
-							$st['set_natoe']['eff_id'] = $e['id'];
-							$st['set_natoe']['t'] = 0 + $sts['natoe_type'];
-							$st['set_natoe']['user_id'] = $e['tr_life_user'];
-						}
-						if(isset($sts['add_pog2']))
-						{
-							$ctt = count($st['set_pog2']);
-							$st['set_pog2'][$ctt]['id'] = $h;
-							$st['set_pog2'][$ctt]['y']  = $sts['add_pog2'];
-							$st['set_pog2'][$ctt]['p']  = $sts['add_pog2p'];
-							$st['set_pog2'][$ctt]['m']  = $sts['add_pog2mp'];
-							unset($ctt);
-						}
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['add_'.$ia[$i]])) 
-								{
-								if($ia[$i] != 'zaproc' && $ia[$i] != 'zmproc') {
-									if(!isset($sti[$ia[$i]])) {
-										$sti[$ia[$i]] = 0;
-									}
-									$sti[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-									if(!isset($st[$ia[$i]])) {
-										$st[$ia[$i]] = 0;
-									}
-									$st[$ia[$i]] += intval($sts['add_'.$ia[$i]]);
-								}else{
-									$sti[$ia[$i]] = 100-$sti[$ia[$i]];
-									$sti[$ia[$i]] = $sti[$ia[$i]] - $sti[$ia[$i]]/100*intval($sts['add_'.$ia[$i]]);
-									$sti[$ia[$i]] = 100-$sti[$ia[$i]];	
-																	
-									$st[$ia[$i]] = 100-$st[$ia[$i]];
-									$st[$ia[$i]] = $st[$ia[$i]] - $st[$ia[$i]]/100*intval($sts['add_'.$ia[$i]]);
-									$st[$ia[$i]] = 100-$st[$ia[$i]];
-								}
-								}
-							}
-							$i++;
-						}	
-						$i = 0;
-						while($i<count($ia))
-						{
-							if(isset($ia[$i]))
-							{
-								if(isset($sts['add_'.$ia[$i]])) 
-								{
-								if(!isset($s_vi[$ia[$i]])) {
-										$s_vi[$ia[$i]] = 0;
-									}
-								$s_vi[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								if(!isset($s_v[$ia[$i]])) {
-										$s_v[$ia[$i]] = 0;
-									}
-								$s_v[$ia[$i]] += intval($sts['sv_'.$ia[$i]]);
-								}
-							}
-							$i++;
-						}	
-					}elseif($e['timeUse']!=77){
-						//������� ������					
-						$this->endEffect($e['id'],$u);
-						$st['act'] = 1;
-					}
-				}
-			}
-				
-			//����� ����������
-			/*$bl = mysql_fetch_array(mysql_query('SELECT `id`,`level` FROM `users_paybonus` WHERE `id` = "'.$u['id'].'" LIMIT 1'));
-			$st['pbe'] = 0+$bl['level'];
-			if( $st['pbe'] > 1000 ) {
-				$st['pbe'] = 1000;
-			}
-			unset($bl);*/
-				
-			//���� ������
-			if( $st['clanpos'] > 0 ) {
-				if( $st['clanpos'] == 1 ) {
-					$st['s1'] += 5;
-					$st['s2'] += 5;
-					$st['s3'] += 5;
-					$st['s4'] += 5;
-					$st['s5'] += 5;
-					$st['s6'] += 5;
-					$st['m10'] += 10;
-					$st['m11'] += 10;
-				}elseif( $st['clanpos'] == 2 ) {
-					$st['s1'] += 3;
-					$st['s2'] += 3;
-					$st['s3'] += 3;
-					$st['s4'] += 3;
-					$st['s5'] += 3;
-					$st['s6'] += 3;
-					$st['m10'] += 5;
-					$st['m11'] += 5;
-				}elseif( $st['clanpos'] == 3 ) {
-					$st['s1'] += 1;
-					$st['s2'] += 1;
-					$st['s3'] += 1;
-					$st['s4'] += 1;
-					$st['s5'] += 1;
-					$st['s6'] += 1;
-					$st['m10'] += 3;
-					$st['m11'] += 3;
-				}
-			}
-				
-			//�������������� �� ������
-			
-			if(!isset($st['hpAll'])) {
-				$st['hpAll'] = 0;
-			}
-			$st['hpAll'] += $st['s4']*6;
-			
-			//$st['enAll'] += 10;
-			//$st['enAll'] += floor($st['s11']*10);
-			//$st['enAll'] += round($st['s4']*0.09);
-			
-			if(!isset($st['mpAll'])) {
-				$st['mpAll'] = 0;
-			}
-			@$st['mpAll'] += @$st['s6']*10;
-			
-			//������
-				if(!isset($st['m1'])) {
-					$st['m1'] = 0;
-				} $st['m1']	 += $st['s3']*5;
-				
-			
-			// ��.����-���� = 2.5
-				if(!isset($st['m2'])) {
-					$st['m2'] = 0;
-				} $st['m2']	 += $st['s3']*5;
-
-			// ��.������ = 2.5
-				if(!isset($st['m4'])) {
-					$st['m4'] = 0;
-				}
-				$st['m4']	 += $st['s2']*5;
-			
-			// ��.����-������ = 2.5
-				if(!isset($st['m5'])) {
-					$st['m5'] = 0;
-				}
-				$st['m5']	 += $st['s2']*5;
-			
-			
-			
-			if(!isset($st['za'])) {
-				$st['za'] = 0;
-			}
-			$st['za']	 += $st['s4']*1.5;	
-			
-			if(!isset($st['zm'])) {
-				$st['zm'] = 0;
-			}		
-			$st['zm']	 += $st['s4']*1.5;
-			
-			//��������
-			//�������� ������ "�������� ����. �����". ����
-				if(!isset($st['antm3'])) {
-    				$st['antm3'] = 0;
-  			 	}
-   				//$st['antm3']  += $st['s4']*1.0;
-			
-		
-			
-			if(!isset($st['m10'])) {
-				$st['m10'] = 0;
-			}
-			$st['m10'] += 0;
-			
-			if(!isset($st['m11'])) {
-				$st['m11'] = 0;
-			}
-			$st['m11'] += 0;
-			
-			if(!isset($st['m11a'])) {
-				$st['m11a'] = 0;
-			}
-			$st['m11a'] += 0;
-			
-			if(!isset($st['m7'])) {
-				$st['m7'] = 0;
-			}
-			$st['m7'] += 0;
-			
-			if(!isset($st['m8'])) {
-				$st['m8'] = 0;
-			}
-			$st['m8'] += 0;
-		
-			//������ ����������
-			$i = 0;
-			while($i<=count(@$coms['new']))
-			{
-				if(@isset($coms['new'][$i]))
-				{
-					//$coms[$i]['id'] - id ���������, $j - ���-�� ��������� ������� ���������
-					$j = @$coms['com'][$coms['new'][$i]];
-					$com = mysql_fetch_array(mysql_query('SELECT `id`,`com`,`name`,`x`,`data` FROM `complects` WHERE `com` = "'.((int)$coms['new'][$i]).'" AND `x` <= '.((int)$j).' ORDER BY  `x` DESC  LIMIT 1'));					
-					if(isset($com['id']))
-					{						
-						//��������� �������� ���������
-						$ij = 0;
-						$sti = $this->lookStats($com['data']);
-						while($ij<count($ia))
-						{
-							if(isset($ia[$ij]) && isset($sti[$ia[$ij]]))
-							{
-								$st[$ia[$ij]] += $sti[$ia[$ij]];
-							}
-							$ij++;
-						}	
-					}
-				}
-				$i++;
-			}
-		
-			//������ ������
-			//������ �������
-			if($u['autospell'] != '' && $u['autospell'] != 0 && $u['battle'] == 0) {
-				//��������� ������
-				$splink = '';
-				$spi = mysql_query('SELECT `id`,`item_id`,`inOdet` FROM `items_users` WHERE `inOdet` >= 40 AND `inOdet` <= 50 AND `uid` = "'.$u['id'].'" AND `delete` = 0 ORDER BY `item_id` DESC LIMIT 20');
-				while($pli = mysql_fetch_array($spi)) {
-					$splink .= $pli['item_id'].'-'.$pli['inOdet'].',';
-				}
-				$splink = rtrim($splink,',');
-				
-				//���������� ����� �������� �������
-				if( $u['autospell'] == 1 ) {
-					$u['autospell'] = $splink;
-					mysql_query('UPDATE `users` SET `autospell` = "'.$splink.'" WHERE `id` = "'.$u['id'].'" LIMIT 1');
-				}
-				
-				//������ ������ ������, ���� �� ���� � ���������
-				if( $u['autospell'] != $splink ) {
-					$spe1 = explode(',',$splink);
-					$spe2 = explode(',',$u['autospell']);
-					$i = 0;
-					while( $i <= 20 ) {
-						//
-						$spe1a = explode('-',$spe1[$i]);
-						$spe2a = explode('-',$spe2[$i]);
-						//
-						if(isset($spe1a[0])) {
-							$spe1g[$spe1a[1]] = $spe1a[0];
-						}
-						if(isset($spe2a[0])) {
-							$spe2g[$spe2a[1]] = $spe2a[0];
-						}
-						//
-						$i++;
-					}
-					$i = 40;
-					while( $i <= 50 ) {
-						if( $spe1g[$i] != $spe2g[$i] && $spe1g[$i] == 0 ) {
-							//echo '['.$spe2g[$i].'->'.$i.']';
-							$splu = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `item_id` = "'.$spe2g[$i].'" AND `inOdet` = 0 AND `delete` = 0 AND `inTransfer` = 0 AND `inShop` = 0 AND `uid` = "'.$u['id'].'" AND `inGroup` = 0 LIMIT 1'));
-							if(isset($splu['id'])) {
-								mysql_query('UPDATE `items_users` SET `inOdet` = "'.$i.'" WHERE `id` = "'.$splu['id'].'" LIMIT 1');
-							}
-						}
-						$i++;
-					}
-				}
-			}
-			
-
-			//������ ������
-			//���
-			//����
-			/*if($st['s1']>24 && $st['s1']<50){ $st['m10']  += 5;  }
-			if($st['s1']>49 && $st['s1']<75){ $st['m10']  += 10; }
-			if($st['s1']>74 && $st['s1']<100){ $st['m10']  += 17; }
-			if($st['s1']>99 && $st['s1']<125){ $st['m10']  += 25; }
-			if($st['s1']>124 && $st['s1']<150){ $st['m10'] += 25; $st['minAtack'] += 10; $st['maxAtack'] += 10; }
-			if($st['s1']>149 && $st['s1']<175){ $st['m10'] += 30; $st['minAtack'] += 10; $st['maxAtack'] += 10; }
-			if($st['s1']>174){ $st['m10'] += 30; $st['minAtack'] += 15; $st['maxAtack'] += 15; }*/
-			
-			if($st['s1']>24 && $st['s1']<50){  $st[1]['m2']  += 15; }
-			if($st['s1']>49 && $st['s1']<75){ $st[1]['pa2']  += 2; $st[1]['m2']  += 35; }
-			if($st['s1']>74 && $st['s1']<100){ $st[1]['pa2']  += 5; $st[1]['m2']  += 50; }
-			if($st['s1']>99 && $st['s1']<125){ $st[1]['pa2']  += 8; $st[1]['m2']  += 80;}
-			if($st['s1']>124 && $st['s1']<150){ $st[1]['pa2']  += 12; $st[1]['m2']  += 105; }
-			if($st['s1']>149 && $st['s1']<175){ $st[1]['pa2']  += 17; $st[1]['m7']  += 2; }
-			if($st['s1']>174){ $st[1]['pa2']  += 30; $st[1]['m7']  += 7; }
-			
-			//�������� 
-			if($st['s2']>24 && $st['s2']<50){ $st['m7']  += 5;  }
-			if($st['s2']>49 && $st['s2']<75){ $st['m7']  += 5; $st['m4']  += 35; $st['m2']  += 15; }
-			if($st['s2']>74 && $st['s2']<100){ $st['m7']  += 15; $st['m4']  += 35; $st['m2']  += 15; }
-			if($st['s2']>99 && $st['s2']<125){ $st['m7']  += 15; $st['m4']  += 105; $st['m2']  += 40; }
-			if($st['s2']>124 && $st['s2']<150) { $st['m7']  += 15; $st['m4']  += 105; $st['m2']  += 40; $st['m15'] += 5; }
-			if($st['s2']>149 && $st['s2']<175){ $st['m7']  += 20; $st['m4']  += 115; $st['m2']  += 40; $st['m15'] += 5; }
-			if($st['s2']>174){ $st['m7']  += 20; $st['m4']  += 120; $st['m2']  += 50; $st['m15'] += 7; }			
-			//��������
-			if($st['s3']>24 && $st['s3']<50){ $st['m3'] += 10; }
-			if($st['s3']>49 && $st['s3']<75){ $st['m3'] += 10; $st['m1'] += 35; $st['m5'] += 15; }
-			if($st['s3']>74 && $st['s3']<100){ $st['m3'] += 25; $st['m1'] += 35; $st['m5'] += 15; }
-			if($st['s3']>99 && $st['s3']<125){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; }
-			if($st['s3']>124 && $st['s3']<150){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; }
-			if($st['s3']>149 && $st['s3']<175){ $st['m3'] += 30; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; }
-			if($st['s3']>174){ $st['m3'] += 30; $st['m1'] += 120; $st['m5'] += 45; $st['m14'] += 7; }			
-			//������������
-			if($st['s4']>0){ $st['hpAll']   += 30;  }
-			if($st['s4']>24 && $st['s4']<50){ $st['hpAll']  += 50;  }
-			if($st['s4']>49 && $st['s4']<75){ $st['hpAll']  += 100; }
-			if($st['s4']>74 && $st['s4']<100){ $st['hpAll']  += 175; }
-			if($st['s4']>99 && $st['s4']<125){ $st['hpAll']  += 250; }
-			if($st['s4']>124 && $st['s4']<150){ $st['hpAll'] += 250; $st['za'] += 25; }
-			if($st['s4']>149 && $st['s4']<175){ $st['hpAll'] += 350; $st['za'] += 50; }
-			if($st['s4']>174){ $st['hpAll'] += 400; $st['za'] += 100; }
-			//�������� 
-			if($st['s5']>24 && $st['s5']<50){ $st['m11'] += 5; }
-			if($st['s5']>49 && $st['s5']<75){ $st['m11'] += 10;  }
-			if($st['s5']>74 && $st['s5']<100){ $st['m11'] += 17; }
-			if($st['s5']>99 && $st['s5']<125){ $st['m11'] += 25; }
-			if($st['s5']>124 && $st['s5']<150){ $st['m11'] += 35;  }
-			if($st['s5']>149 && $st['s5']<175){ $st['m11'] += 45; }
-			if($st['s5']>174){ $st['m11'] += 60; }
-			//��������
-			if($st['s6']>24 && $st['s6']<50){ $st['mpAll'] += 50; $st['speedmp'] +=100; }
-			if($st['s6']>49 && $st['s6']<75){ $st['mpAll'] += 100; $st['speedmp'] +=200; }
-			if($st['s6']>74 && $st['s6']<100){ $st['mpAll'] += 175; $st['speedmp'] += 350; }
-			if($st['s6']>99 && $st['s6']<125){ $st['mpAll'] += 250; $st['speedmp'] += 500; }
-			if($st['s6']>124 && $st['s6']<150) { $st['mpAll'] += 250; $st['speedmp'] += 500; $st['pzm'] += 3; }
-			if($st['s6']>149 && $st['s6']<175){ $st['mpAll'] += 300; $st['speedmp'] += 600; $st['pzm'] += 3; }
-			if($st['s6']>174){ $st['mpAll'] += 450; $st['speedmp'] += 700; $st['pzm'] += 5; }	
-						
-			//���� ������ ������ �����
-			if($hnd2==1 && $hnd1==1)
-			{
-				$st['zona']++;
-			}
-			
-			if($sht1==1)
-			{
-				$st['zonb']++;
-			}
-			
-			//$st['speedhp'] += $st['pbe'];
-			//$st['speedmp'] += $st['pbe'];
-			
-			/* �������� */
-			$i = 1;						
-			while($i<=7)
-			{				
-				if(!isset($st['pm'.$i])) {
-					$st['pm'.$i] = 0;
-				}
-				if(!isset($st['a'.$i])) {
-					$st['a'.$i] = 0;
-				}
-				if(!isset($st['mg'.$i])) {
-					$st['mg'.$i] = 0;
-				}
-				if(!isset($st['zm'.$i])) {
-					$st['zm'.$i] = 0;
-				}
-				if(isset($st['s5'])) {		$st['pm'.$i] += $st['s5']*0.5;	}
-				if(isset($st['m11a'])) {	$st['pm'.$i] += $st['m11a'];	}
-				if(isset($st['aall'])) {	$st['a'.$i] += $st['aall'];		}
-				if(isset($st['m2all'])) {	$st['mg'.$i] += $st['m2all'];	}
-				if(isset($st['zm'])) {		$st['zm'.$i] += $st['zm'];		}
-				if(isset($st['zma'])) {		$st['zm'.$i] += $st['zma'];		}
-				if($i<=4)
-				{					
-					if(!isset($st['mib'.$i])) {
-						$st['mib'.$i] = 0;
-					}
-					if(!isset($st['mab'.$i])) {
-						$st['mab'.$i] = 0;
-					}
-					if(!isset($st['mg'.$i])) {
-						$st['mg'.$i] = 0;
-					}
-					if(!isset($st['pm'.$i])) {
-						$st['pm'.$i] = 0;
-					}
-					if(!isset($st['pa'.$i])) {
-						$st['pa'.$i] = 0;
-					}
-					if(!isset($st['za'.$i])) {
-						$st['za'.$i] = 0;
-					}
-					$st['mib'.$i] += 0;
-					$st['mab'.$i] += 0;
-					if(isset($st['mall'])) {	$st['mg'.$i] += $st['mall'];	}
-					if(isset($st['m11'])) {		$st['pm'.$i] += $st['m11'];		}
-					if(isset($st['m10'])) {		$st['pa'.$i] += $st['m10'];		}
-					if(isset($st['za'])) {		$st['za'.$i] += $st['za'];		}
-				}				
-				$i++;
-			}
-			
-			//���������� ������ � ������
-			
-			$i = 1;
-			while( $i <= 7 ) {
-				@$st['yzm'.$i] += @$st['yzma'];
-				if( $i <= 4 ) {
-					@$st['yzm'.$i] += @$st['yzm'];//��������� ���� ������
-					@$st['yza'.$i] += @$st['yza']; //���� ������
-				}
-				//�������� �� ������ �� �����
-				if( isset($st['yza'.$i]) && $i <= 4 ) {
-					$st['za'.$i] = ($st['za'.$i]/100*(100+($st['yza'.$i])));
-					if( $st['za'.$i] < 0 ) {
-						$st['za'.$i] = 0;
-					}
-				}
-				//�������� �� ������ �� �����
-				if( isset($st['yzm'.$i]) ) {
-					$st['zm'.$i] = ($st['zm'.$i]/100*(100+($st['yzm'.$i])));
-					if( $st['zm'.$i] < 0 ) {
-						$st['zm'.$i] = 0;
-					}
-				}				
-				$i++;
-			}
-			
-			
-			
-			if(isset($st['hpVinos']) && $st['hpVinos'] != 0) {
-				$st['hpAll'] += round($st['hpVinos']*$st['s4']);
-			}
-			
-			if(isset($st['mpVinos']) && $st['mpVinos'] != 0) {
-				$st['mpAll'] += round($st['mpVinos']*$st['s6']);
-			}
-			
-			if(isset($st['hpProc']) && $st['hpProc'] != 0) {
-				$st['hpAll'] += round($st['hpAll']/100*$st['hpProc']);
-			}
-			
-			if(isset($st['mpProc']) && $st['mpProc'] != 0) {
-				$st['mpAll'] += round($st['mpAll']/100*$st['mpProc']);
-			}
-			
-			//�����. - 250 ��.
-			/*if( $u['level'] > 7 ) {
-				$st['speedhp'] -= 240;
-				$st['speedmp'] -= 240;
-			}*/
-			
-			//����� �������
-			if($st['hpNow']<0)	
-			{
-				$st['hpNow'] = 0;
-			}elseif($st['hpNow']>$st['hpAll'])
-			{
-				$st['hpNow'] = $st['hpAll'];
-			}
-			if($st['mpNow']<0)	
-			{
-				$st['mpNow'] = 0;
-			}elseif($st['mpNow']>$st['mpAll'])
-			{
-				$st['mpNow'] = $st['mpAll'];
-			}
-			
-			//���� ����� � �����
-			if($st['zona']<1){ $st['zona'] = 1; }
-			if($st['zona']>5){ $st['zona'] = 5; }
-			if($st['zonb']<1){ $st['zonb'] = 1; }
-			if($st['zonb']>3){ $st['zonb'] = 3; }
-			
-			$st['ozash'] = $oza;
-			$st['ozmsh'] = $ozm;
-			$st['weapon1'] = $hnd1;
-			$st['weapon2'] = $hnd2;
-			$st['sheld1']  = $sht1;
-			$st['sv_']	  = $s_v;
-			$st['sv_i']	 = $s_vi;
-			$st['dom']	  = $dom;		
-			$st['prsu']	 = $prsu;
-			
-			$st['x'] = $u['x'];
-			$st['y'] = $u['y'];
-			$st['s'] = $u['s'];
-			
-			//�������� �������
-			/*$st['reting'] = 0;
-			//
-			$st['reting'] += $st['hpAll'];
-			$st['reting'] += $st['mpAll'];
-			//
-			$st['reting'] += $st['m1'];
-			$st['reting'] += $st['m2'];
-			$st['reting'] += $st['m4'];
-			$st['reting'] += $st['m5'];
-			//
-			$st['reting'] += $st['m6']*10;
-			$st['reting'] += $st['m7']*10;
-			$st['reting'] += $st['m8']*10;
-			$st['reting'] += $st['m9']*10;
-			//
-			$st['reting'] += $st['a1']*7;
-			$st['reting'] += $st['a2']*7;
-			$st['reting'] += $st['a3']*7;
-			$st['reting'] += $st['a4']*7;
-			$st['reting'] += $st['a5']*7;
-			$st['reting'] += $st['a6']*7;
-			$st['reting'] += $st['a7']*7;
-			//
-			$st['reting'] += $st['mg1']*7;
-			$st['reting'] += $st['mg2']*7;
-			$st['reting'] += $st['mg3']*7;
-			$st['reting'] += $st['mg4']*7;
-			$st['reting'] += $st['mg5']*7;
-			$st['reting'] += $st['mg6']*7;
-			$st['reting'] += $st['mg7']*7;
-			//
-			$st['reting'] += $st['m3']*5;
-			$i8 = 1;
-			$st['reting'] += $st['za']*5;
-			$st['reting'] += $st['zm']*5;
-			//
-			$st['reting'] += $st['s5']*5;
-			$st['reting'] += $st['s6']*5;
-			//
-			while( $i8 < 8 ) {
-				$st['reting'] += $st['pa'.$i]*5;
-				$st['reting'] += $st['pm'.$i]*5;
-				//
-				$st['reting'] += $st['za'.$i]*10;
-				$st['reting'] += $st['zm'.$i]*10;
-				$i8++;
-			}
-			//
-			$i8 = 1;
-			while( $i8 < 5 ) {
-				$st['reting'] += $st['mib'.$i];
-				$st['reting'] += $st['mab'.$i];
-				$i8++;
-			}*/
-			
-			$st['reting'] = 1+ceil($st['reting']);
-			$st['reting'] = 1+$st['irka'];
-			
-			if($u['vip'] > 0) {
-				$st['exp'] += 25;
-				$st['speedhp'] += 100;
-				$st['speedmp'] += 100;
-				$st['repair_discount'] +=1;
-				$st['repair_r'] +=1;
-				$st['repair_z'] +=1;
-			}
-			
-			//����� �� �������
-			$rep1 = mysql_fetch_array(mysql_query('SELECT 
-			`add_slot`,`nu_sandcity`,`n_sandcity`,
-			`dl1`,`id`,`rep1`,`rep2`,`repcapitalcity`,`repdemonscity`,`repangelscity`,`repabandonedplain`,
-			`repdevilscity`,`repmooncity`,`repsuncity`,`repsandcity`,`repemeraldscity`,`repdreamscity`,`repizlom`,
-			`n_capitalcity`,`n_demonscity`,`n_suncity`,`nu_demonscity`,`nu_angelscity`,`nu_abandonedplain`,
-			`nu_capitalcity`,`nu_suncity`,`nu_devilscity`,`nu_dreamscity`,`add_stats`,`add_money`,`add_skills`,`add_skills2`,
-			`rep3`,`rep3_buy`,`repdragonscity`,`n_dragonscity`,`nu_dragonscity`,
-			(`repcapitalcity`+`repdemonscity`+`repangelscity`+`repsuncity`+`repdreamscity`+`repabandonedplain`+`repsandcity`) as allrep, 
-			(`nu_capitalcity`+`nu_demonscity`+`nu_angelscity`+`nu_suncity`+`nu_dreamscity`+`nu_abandonedplain`+`nu_sandcity`) as allnurep FROM `rep` WHERE `id` = "'.$u['id'].'" LIMIT 1'));
-   //��������
-   if($rep1['repdreamscity'] > 999 && $rep1['repdreamscity'] < 5000 ) {
-	   $st['m1'] += 25;
-	   $st['m4'] += 25;
-   }elseif($rep1['repdreamscity'] > 4999 && $rep1['repdreamscity'] < 10000) {
-	   $st['m1'] += 50;
-	   $st['m2'] += 25;
-	   $st['m4'] += 50;
-	   $st['m5'] += 25;
-   }elseif($rep1['repdreamscity'] > 9999) {
-	   $st['m1'] += 75;
-	   $st['m2'] += 50;
-	   $st['m4'] += 75;
-	   $st['m5'] += 50;
-   }
-   //�����
-   if($rep1['repizlom'] > 999 && $rep1['repizlom'] < 5000) {
-	   $st['speedhp'] += 50;
-	   $st['speedmp'] += 50;
-	   $st['speed_dungeon'] +=10;
-   }elseif($rep1['repizlom'] > 4999 && $rep1['repizlom'] < 10000) {
-	   $st['speedhp'] += 75;
-	   $st['speedmp'] += 75;
-	   $st['speed_dungeon'] +=20;
-   }elseif($rep1['repizlom'] > 9999) {
-	   $st['speedhp'] += 100;
-	   $st['speedmp'] += 100;
-	   $st['speed_dungeon'] += 30;
-   }
-   //������
-   if($rep1['repangelscity'] > 9999 && $rep1['repangelscity'] < 25000) {
-	   $st['exp'] += 5;
-	   /*$st['hpAll'] += 100;
-	   $st['mpAll'] += 100;*/
-   }elseif($rep1['repangelscity'] > 24999) {
-	   $st['exp'] += 10;
-	   /*$st['hpAll'] += 200;
-	   $st['mpAll'] += 200;*/
-   }
-   //���������
-   if($rep1['repdemonscity'] > 9999 && $rep1['repdemonscity'] < 25000) {
-	   $st['m10'] += 5;
-	   $st['zma'] += 50;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['m10'] += 10;
-	   $st['zma'] += 100;
-   }
-    //��������
-   if($rep1['repsuncity'] > 9999 && $rep1['repsuncity'] < 25000) {
-	   $st['m11'] += 5;
-	   $st['za'] += 50;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['m11'] += 10;
-	   $st['za'] += 100;
-   }
-   //������ ������ ���������
-   if($rep1['repcapitalcity'] > 9999 && $rep1['repcapitalcity'] < 25000) {
-	   $st['pza'] += 2;
-	   $st['pzm'] += 2;
-	   $st['mib1'] +=10;
-	   $st['mab1'] +=10;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['pza'] += 4;
-	   $st['pzm'] += 4;
-	   $st['mib1'] += 20;
-	   $st['mab1'] +=20;
-   }
-   //���� �������
-   if($rep1['repabandonedplain'] > 9999 && $rep1['repabandonedplain'] < 25000) {
-	   $st['mib1'] += 5;
-	   $st['mab3'] += 5;
-	   $st['mab4'] +=5;
-   }elseif($rep1['repdemonscity'] > 24999) {
-	   $st['mab1'] += 10;
-	   $st['mab3'] += 10;
-	   $st['mab4'] += 10;
-   }
-				
-			
-			//���������� ������ ��� �������
-			$st['maxves'] += 500;
-						
-			if( $st['silver'] >= 5 ) {
-				$st['exp'] += 50;
-			}
-			
-			if( $u['admin'] > 0 ) {
-				$st['speed_dungeon'] += 1000;
-				$st['speedhp'] += 1000000000000000;
-			}
-			/*if( date('H') >= 22 && date('H') <= 24 ) {
-				if($u['room']==9 && $u['room']==323 && $u['room']==1) {
-				$st['exp'] +=150;
-				}
-			}else*/if( date('H') >=22 && date('H') <= 10 ) {
-				$st['exp'] +=25;
-			}
-			
-			//��������� ������� ������
-			$st['reting'] = floor($st['reting']);
-			//if(@$st['btl_cof'] != @$st['reting']) {
-				//$st['btl_cof'] = $st['reting'];
-				//mysql_query('UPDATE `stats` SET `btl_cof` = "'.$st['reting'].'" WHERE `id` = "'.$st['id'].'" LIMIT 1');
-			//}
-			if(@$st['btl_cof'] != @$st['prckr']) {
-				$st['btl_cof'] = $st['prckr'];
-				mysql_query('UPDATE `stats` SET `btl_cof` = "'.$st['prckr'].'" WHERE `id` = "'.$st['id'].'" LIMIT 1');
-			}
-
-			if($st['hpAll'] < 1) {
-				$st['hpAll'] = 1;
-			}
-			
-			if($st['mpAll'] < 0) {
-				$st['mpAll'] = 0;
-			}
-
-			if($u['room'] == 411) {
-				//������, ������ �� ����� -25% ��
-				$shb = mysql_fetch_array(mysql_query('SELECT `id` FROM `items_users` WHERE `uid` = "'.$u['id'].'" AND `item_id` = 4910 AND `delete` = 0 LIMIT 1'));
-				if(isset($shb['id'])) {
-					$st['hpAll'] = round($st['hpAll']/100*75);
-				}
-			}
-		
-			if( stristr($u['login'], '(����� ') == true || (stristr($u['login'], '�������� �����') && $u['ip'] == '0') ) {
-				$st['this_animal'] = 1;
-			}else{
-				$st['this_animal'] = 0;
-			}
-			
-			$rt = array();
-			if($i1==1)
-			{
-				$rt[0] = $st;
-				$rt[1] = $st2; //������ �����
-			}else{
-				$rt = $st;
-			}
-			
-			if( $u['hpAll'] != $st['hpAll'] || $u['mpAll'] != $st['mpAll'] ) {
-				mysql_query('UPDATE `stats` SET `hpAll` = "'.$st['hpAll'].'",`mpAll` = "'.$st['mpAll'].'" WHERE `id` = "'.$u['id'].'" LIMIT 1');
-			}
-			
-			if( $btl_cache == true && $cache == false ) {
-				$dataca = array(
-					'st' => $st,
-					'st2' => $st2
-				);
-				$dataca = json_encode($dataca);
-				mysql_query('INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("'.$u['id'].'","'.$u['battle'].'","'.mysql_real_escape_string($dataca).'","'.time().'")');
-			}
-		}
-		
-		if( isset($cache) ) {
-			if( $i1 == 1 ) {
-				$rt = array( $cache['st'] , $cache['st2'] );
-			}else{
-				$rt = $cache['st'];
-			}
-		}
-		
-		return $rt;
-	}	
-	
-	public function send($color,$room,$city,$from,$to,$text,$time,$type,$toChat,$spam,$sound,$new = 1,$typeTime = 0,$global = 0)
-	{
-		mysql_query("INSERT INTO `chat` (`global`,`typeTime`,`new`,`sound`,`color`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`spam`) VALUES
-		('".$global."','".$typeTime."','".$new."','".$sound."','".$color."','".$city."','".$room."','".$from."','".$to."','".$text."','".$time."','".$type."','".$toChat."','".$spam."')");
-		$msg_id = mysql_insert_id();
-		return $msg_id;
-	}
-	
-	//�������� �������
-	public function testLevel()
-	{
-		global $c;
-		$rt = 0;
-		if( $this->info['exp'] > $c['expstop'] ) {
-			$this->info['exp'] = $c['expstop'];
-			mysql_query('UPDATE `stats` SET `exp` = "'.$c['expstop'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-		}
-		if(isset($this->stats['levels']['upLevel']))
-		{
-			$telvl = array();
-			$sp = mysql_query('SELECT `upLevel`,`exp` FROM `levels`');
-			while( $pl = mysql_fetch_array($sp) ) {
-				$telvl[$pl['upLevel']] = $pl['exp'];
-			}
-			if( $this->info['exp'] >= $telvl[$this->info['upLevel']] ) {					
-				$lvl  = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.$this->info['upLevel'].'" LIMIT 1'));			
-				$lvln = mysql_fetch_array(mysql_query('SELECT `duh`,`vinos`,`bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.($lvl['upLevel']+1).'" LIMIT 1'));
-				//������� ��������
-				if($this->info['exp']>12499 && $this->info['level']<=5 && $c['infinity5level'] == true)
-				{
-					$itm = mysql_fetch_array(mysql_query('SELECT `id`,`item_id`,`1price`,`2price`,`3price`,`uid`,`use_text`,`data`,`inOdet`,`inShop`,`delete`,`iznosNOW`,`iznosMAX`,`gift`,`gtxt1`,`gtxt2`,`kolvo`,`geniration`,`magic_inc`,`maidin`,`lastUPD`,`timeOver`,`overType`,`secret_id`,`time_create`,`inGroup`,`dn_delete`,`inTransfer`,`post_delivery`,`lbtl_`,`bexp`,`so`,`blvl` FROM `items_users` WHERE `item_id` = "1204" AND `delete` = "0" AND `uid` = "'.$this->info['id'].'" AND `inShop` = "0" AND `inTransfer` = "0" LIMIT 1'));
-					if(!isset($itm['id']) && $this->info['host_reg'] != 'noinfinity5' && $this->info['twink'] == 0)
-					{
-						$this->info['exp'] = 12499;
-						mysql_query('UPDATE `stats` SET `exp` = "12499" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						echo '<script>chat.sendMsg(["new","'.time().'","6","","'.$this->info['login'].'","��� �������� �� 6-�� ������� ��������� &quot;<b>�������� �������� [6]</b>&quot;.","Black","1","1","0"]);</script>';
-					}else{
-						
-						mysql_query('UPDATE `items_users` SET `delete` = "'.time().'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-						$text = '������� &quot;<b>�������� �������� [6]</b>&quot; ��� ������� �����������.';
-						echo '<script>chat.sendMsg(["new","'.time().'","6","","'.$this->info['login'].'","'.$text.'","Black","1","1","0"]);</script>';
-						//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1',".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$text."','".time()."','6','0')");
-					}
-	
-				}
-				//****************
-				$i = 0; $ult = 0;
-				//mysql_query('LOCK TABLES users,stats,mults,bank,referal_bous,levels,chat WRITE');
-				while($i!=1)
-				{
-					if($c['nolevel'] == true && $this->info['exp']>=$lvl['exp'] && isset($lvln['upLevel']))
-					{
-						$tlus = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `users` WHERE `real` = 1 AND `level` = "'.$this->info['level'].'" LIMIT 1'));
-						//����� ��� ��� �������, $lvln
-						if($tlus[0] < $this->info['level']*5) {
-							//������ �������� ���/���� ���� �� ����� 100 ���������� �������� ������
-							$this->info['exp'] = $lvl['exp']-1;
-							mysql_query('UPDATE `stats` SET `exp` = "'.$this->info['exp'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						}
-					}
-					if($this->info['exp']>=$lvl['exp'] && isset($lvln['upLevel']))
-					{					
-						if($lvl['nextLevel']>$this->info['level'])
-						{
-							//������ �������� ��������
-							/*
-							if($lvl['nextLevel']==8){
-								$text = '��� �������� �� 8 ������� �� ��������� ������� &quot;<b>������ ������ -����-</b>&quot;.';
-								echo '<script>chat.sendMsg(["new","'.time().'","6","","'.$this->info['login'].'","'.$text.'","Black","1","1","0"]);</script>';
-								$this->addItem(1190,$this->info['id'],'|sudba='.$this->info['login']);
-							}
-							*/
-							
-							//�������� ������������ 
-							$a4 = 1;
-							if($lvl['nextLevel']==9)
-							{
-								$a4 = 2;
-							}elseif($lvl['nextLevel']==10)
-							{
-								$a4 = 3;
-							}elseif($lvl['nextLevel']==11)
-							{
-								$a4 = 5;
-							}elseif($lvl['nextLevel']==12)
-							{
-								$a4 = 30;
-							}
-							
-							$this->stats['s4'] += $a4;
-							$sex1 = '';
-							if($this->info['sex']==1)
-							{
-								$sex1 = '��';
-							}
-							
-							$ult = 1;
-	
-							//��������
-							if($this->info['twink'] == 0 && (round($this->info['host_reg']) > 0 && ( $this->info['dieline'] == 0 || $this->info['dieline'] < $lvl['exp'] ))) {
-								$mtest = mysql_fetch_array(mysql_query('SELECT `id`,`uid`,`uid2`,`ip` FROM `mults` WHERE (`uid` = "'.$this->info['id'].'" AND `uid2` = "'.((int)$this->info['host_reg']).'") OR (`uid2` = "'.$this->info['id'].'" AND `uid` = "'.((int)$this->info['host_reg']).'") LIMIT 1'));
-								$rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$this->info['host_reg']).'" LIMIT 1'));
-								$rlogs = mysql_fetch_array(mysql_query('SELECT `id`,`ref_data` FROM `stats` WHERE `id` = "'.((int)$this->info['host_reg']).'" LIMIT 1'));								
-								
-								if(!isset($mtest['id']) && isset($rlog['id'])) {
-									$rtg = true;
-								}else{
-									$rtg = mysql_fetch_array(mysql_query('SELECT * FROM `ref_mult` WHERE `uid1` = "'.$rlog['id'].'" LIMIT 1'));
-									if(isset($rtg['id'])) {
-										if( $this->info['id'] == $rtg['uid2'] ) {
-											$rtg = true;
-										}else{
-											$rtg = false;
-										}
-									}else{
-										mysql_query('INSERT INTO `ref_mult` (`uid1`,`uid2`,`time`) VALUES (
-											"'.$rlog['id'].'" , "'.$this->info['id'].'","'.time().'"
-										)');
-										$rtg = true;
-									}
-								}
-								
-								if(($rtg == true || !isset($mtest['id'])) && isset($rlog['id']) && $this->info['activ'] == 0) {
-									$rfs['data'] = explode('|',$rlogs['ref_data']);
-									$ekr = '0.00';
-									$bn = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`level`,`add_bank`,`add_money`,`finish_battle`,`online`,`onlyOne`,`add_crystals` FROM `referal_bous` WHERE `type` = 1 AND `level` = "'.$lvl['nextLevel'].'" LIMIT 1'));
-									if(isset($bn['id']) && ($bn['add_bank'] > 0 || $bn['add_money'] > 0) ) {
-										$ekr = $bn['add_bank'];
-										$kr = $bn['add_money'];
-										$up = mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.mysql_real_escape_string($rlog['id']).'" LIMIT 1');
-										if($up) {
-											
-											//������� 1-�� ������
-											$krtxt = '';
-											if( $kr > 0 ) {
-												$krtxt .= ''.$kr.' ��';
-												if( $ekr > 0 ) {
-													$krtxt .= ', ';
-												}
-											}
-											if( $ekr > 0 ) {
-												$krtxt .= ''.$ekr.' ���';
-											}											
-											$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$lvl['nextLevel'].'! ��� ���������� '.$krtxt,-1,6,0,0,0,1);
-											$rlog['catch'] += $bn['add_bank'];
-											mysql_query('UPDATE `users` SET `catch` = "'.$rlog['catch'].'" WHERE `id` = "'.$rlog['id'].'" LIMIT 1');
-											//
-											if( (int)$rlog['host_reg'] > 0 ) {
-												//������� 2-�� ������
-												$llogin = $rlog['login'];
-												$ekr = round($bn['add_bank']*0.4,2);
-												$kr = round($bn['add_money']*0.4,2);
-												$rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$rlog['host_reg']).'" LIMIT 1'));
-												if( isset($rlog['id']) ) {
-													$krtxt = '';
-													if( $kr > 0 ) {
-														$krtxt .= ''.$kr.' ��';
-														if( $ekr > 0 ) {
-															$krtxt .= ', ';
-														}
-													}
-													if( $ekr > 0 ) {
-														$krtxt .= ''.$ekr.' ���';
-													}											
-													$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> (2-�� ������ �� &quot;'.$llogin.'&quot; ) ������'.$sex1.' ������ '.$lvl['nextLevel'].'! ��� ���������� '.$krtxt,-1,6,0,0,0,1);
-													$rlog['catch'] += $bn['add_bank'];
-													mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.$rlog['id'].'" LIMIT 1');
-													//
-													if( (int)$rlog['host_reg'] > 0 ) {
-														//������� 3-�� ������
-														$llogin2 = $rlog['login'];
-														$ekr = round($bn['add_bank']*0.2,2);
-														$kr = round($bn['add_money']*0.2,2);
-														$rlog = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`catch`,`host_reg` FROM `users` WHERE `id` = "'.((int)$rlog['host_reg']).'" LIMIT 1'));
-														if( isset($rlog['id']) ) {
-															$krtxt = '';
-															if( $kr > 0 ) {
-																$krtxt .= ''.$kr.' ��';
-																if( $ekr > 0 ) {
-																	$krtxt .= ', ';
-																}
-															}
-															if( $ekr > 0 ) {
-																$krtxt .= ''.$ekr.' ���';
-															}											
-															$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> (3-�� ������ �� &quot;'.$llogin2.'&quot; (������� '.$llogin.') ) ������'.$sex1.' ������ '.$lvl['nextLevel'].'! ��� ���������� '.$krtxt,-1,6,0,0,0,1);
-															$rlog['catch'] += $bn['add_bank'];
-															mysql_query('UPDATE `users` SET `money` = `money` + '.$kr.',`money2` = `money2` + '.$ekr.' WHERE `id` = "'.$rlog['id'].'" LIMIT 1');
-															//
-														}
-													}
-													//
-												}
-											}
-											
-										}else{
-											$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$lvl['nextLevel'].'! (������ ����������, ���������� � ������������� �������) �� ��� ���������� ���� �'.$bnk.' ���������� '.$ekr.' ��.',-1,6,0,0,0,1);
-										}
-									}
-									//
-									mysql_query("UPDATE `users` SET `referals` = `referals` + 10 WHERE `id` = '".mysql_real_escape_string($rlog['id'])."' LIMIT 1");
-									//
-								}elseif(isset($rlog['id'])){
-									$this->send('',$this->info['room'],$this->info['city'],'',$rlog['login'],'��� ������� <b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$lvl['nextLevel'].'! <small><font color=red>(�������� �� �����������, ���� � ��� ��������� IP! ��������� �� ����� 1 ������ ��������!)</font></small>',-1,6,0,0,0,1);
-								}
-							}
-							
-							
-							
-							/*
-							$tst = $this->lookStats($this->info['stats']);
-							$tst['s4'] += $a4;
-							$tst['s7'] += $lvl['duh'];
-							$this->info['stats'] = $this->impStats($tst);
-							*/
-						}
-						
-						/*if( $this->info['twink'] == 0 ) { 
-							if( $this->info['exp'] >= 300000 ) {
-								$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'�� ���������� ������ ������/����, �� ���������: <b>'.$lvl['money'].' ��.</b>',-1,6,0,0,0,1);
-							}
-						}*/
-						
-						$tst = $this->lookStats($this->info['stats']);
-						$tst['s4'] += $lvl['vinos'];
-						$tst['s7'] += $lvl['duh'];
-						$this->info['stats'] = $this->impStats($tst);
-						
-						$this->info['level'] = $lvl['nextLevel'];
-						$this->stats['levels'] = $lvln;
-						$this->info['ability'] += $lvl['ability'];
-						$this->info['skills'] += $lvl['skills'];
-						$this->info['sskills'] += $lvl['sskills'];
-						$this->info['nskills'] += $lvl['nskills'];
-						if( $this->info['twink'] == 0 ) {
-							//if( $this->info['level'] < 8 ) {
-								//������ �� ���� ���� 0-7 ���
-								//$this->info['money4'] = $lvl['money']+$this->info['money4'];
-							//}else{
-								$this->info['money'] = $lvl['money']+$this->info['money'];
-							//}
-						}
-						$lvl  = $lvln;
-						$lvln = mysql_fetch_array(mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel`="'.($lvl['upLevel']+1).'" LIMIT 1'));
-						$this->info['upLevel'] += 1;
-						$rt++;									
-					}else{
-						$i = 1;
-					}							
-				}
-				if($ult == 1) {
-					if( $this->info['level'] == 4 || $this->info['level'] == 8 ) {
-						//������ �������� �� ������
-						mysql_query('DELETE FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` LIKE "psh%"');
-						$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'����������� ����������� ������ � �������� � ����� ���������!!!!!!!!!!!!!!!.',-1,6,0,0,0,1);
-					}
-					/*if( $this->info['level'] > 0 && $this->info['level'] <= 5 ) {
-						$this->info['money4'] += 100;
-						mysql_query('UPDATE `users` SET `money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'�� ���������� ������ ������ �� ��������� '.$this->zuby(100,1).'',-1,6,0,0,0,1);
-					}*/
-					//if( isset($itm['id']) || $lvl['nextLevel'] != 6 ) {
-						//
-						/*$txti  = '������';
-						if( $this->info['sex'] == 1 ) {
-							$txti .= '��';
-						}
-						$txti .= ' '.$this->info['level'].' ������!<br>'.date('d.m.Y H:i').'';
-						//
-						mysql_query('INSERT INTO `users_ico` (
-							`uid`,`time`,`text`,`img`,`type`,`x`,`see`
-						) VALUES (
-							"'.$this->info['id'].'","'.time().'","'.$txti.'","pod_lvl'.$this->info['level'].'.gif","2","1","1"
-						)');*/
-						//
-						$this->send('',$this->info['room'],$this->info['city'],'','','<b>'.$this->info['login'].'</b> ������'.$sex1.' ������ '.$this->info['level'].'!',time(),6,0,0,0,1,2); // ������� ���
-						//}
-				}
-				//mysql_query('UNLOCK TABLES');
-				if($rt > 0) {
-					if( $this->info['level'] >= 10 ) {
-						//$this->info['stopexp'] = 1; //���������� �����
-						$this->info['stopexp'] = 0;
-					}else{
-						$this->info['stopexp'] = 0;
-					}
-					$upd = mysql_query('UPDATE `users` SET `stopexp` = "'.$this->info['stopexp'].'" , `level` = "'.$this->info['level'].'",`money` = "'.$this->info['money'].'",`money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					$upd = mysql_query('UPDATE `users_twink` SET `stopexp` = "'.$this->info['stopexp'].'" WHERE `uid` = "'.$this->info['id'].'" LIMIT 1');
-					if($upd)
-					{
-						mysql_query('UPDATE `stats` SET `ability` = "'.$this->info['ability'].'",`skills` = "'.$this->info['skills'].'",`nskills` = "'.$this->info['nskills'].'",`sskills` = "'.$this->info['sskills'].'",`stats` = "'.$this->info['stats'].'",`upLevel` = "'.$this->info['upLevel'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						$this->info['money'] = $this->r2($this->info['money']);
-					}
-					return 1;
-				}
-				//****************
-			}
-		}
-		/*------------*/
-		if($this->info['animal']>0)
-		{
-			//������� �����
-			$a = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `uid` = "'.$this->info['id'].'" AND `id` = "'.$this->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
-			if(isset($a['id']) && $a['level'] < 12)
-			{
-				$ea = array(
-					0=>0,
-					1=>110,
-					2=>410,
-					3=>1300,
-					4=>2500,
-					5=>5000,
-					6=>12500,
-					7=>30000,
-					8=>100000,
-					9=>3000000,
-					10=>10000000,
-					11=>50000000,
-					12=>150000000
-				);
-				$mx = array(
-					0=>140,
-					1=>400,
-					2=>500,
-					3=>650,
-					4=>700,
-					5=>1400,
-					6=>3000,
-					7=>6000,
-					8=>10000,
-					9=>16000,
-					10=>24000,
-					11=>40000,
-					12=>60000
-				);
-				$iz = 0;
-				while($iz!=-1)
-				{
-					if($ea[$a['level']+1]<=$a['exp'])
-					{
-						//��������� �������
-						$a['level']++;
-						$a['max_exp'] = $mx[$a['level']];				
-					}else{
-						if($iz>0)
-						{
-							$a['stats'] = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`exp`,`level`,`stats`,`bonus` FROM `levels_animal` WHERE `type` = "'.$a['type'].'" AND `level` = "'.$a['level'].'" LIMIT 1'));
-							$a['stats'] = $a['stats']['stats'];
-							$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'<b>'.$a['name'].'</b> ������ '.$a['level'].' ������!',time(),6,0,0,0,1);
-							mysql_query('UPDATE `users_animal` SET `stats` = "'.$a['stats'].'",`level`="'.$a['level'].'",`max_exp`="'.$a['max_exp'].'" WHERE `id` = "'.$a['id'].'" LIMIT 1');
-						}
-						$iz = -2;
-					}
-					if( $iz > 1000 ) {
-						$iz = -2;
-					}
-					$iz++;
-				}
-			}
-		}
-		/*------------*/
-	}
-	
-	public function r2($v)
-	{
-		$v = number_format($v, 2, '.', ' ');
-		return $v;
-	}
-		
-	public function regen($uid,$st,$i1)
-	{
-		if($uid!=$this->info['id'])
-		{
-			$u = mysql_fetch_array(mysql_query('SELECT `u`.`align`,`u`.`align2`,`u`.`clan`,`u`.`battle`,`u`.`animal`,`u`.`id`,`u`.`level`,`u`.`login`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`obraz`,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`id`="'.mysql_real_escape_string($uid).'" OR `u`.`login`="'.mysql_real_escape_string($uid).'" LIMIT 1'));
-			if(!isset($st['hpAll']))
-			{
-				$st = $this->getStats($uid,$i1);
-			}
-		}else{
-			$u  = $this->info;
-			if(isset($this->stats['hpAll']))
-			{
-				$st = $this->stats;
-			}elseif($st!=0)
-			{
-				
-			}else{
-				$st = $this->getStats($uid,$i1);
-			}
-		}
-		$btl = 0;
-		if($u['battle']>0)
-		{
-			//$btl = mysql_fetch_array(mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `id` = "'.$u['battle'].'" AND `team_win` = "-1" LIMIT 1'));
-		}
-		if($u['battle']==0 || (isset($btl['id']) && $btl['time_start']>$this->info['timereg']))
-		{
-			$sth = $u['minHP']; //����������� ����� �������������� � ������� HP
-			$stm = $u['minMP']; //����������� ����� �������������� � ������� MP
-			$sh = 0; //�������� ����������� �� � 1 ���.
-			$sm = 0; //�������� ����������� M� � 1 ���.
-			/*---����������(�����������)---*/
-			if(@$st['os9']>0){
-				if(@$st['os9']==5) {
-					@$st['os9']=6;
-				}
-				$sth = floor($u['minHP']-($u['minHP']/100)*($st['os9']*5));
-			}
-			/*---����������(�����������)---*/
-			/*---��������������(�����������)---*/
-			if(@$st['os10']>0){
-				$stm = floor($u['minMP']-($u['minMP']/100)*($st['os10']*5));
-			}
-			/*---��������������(�����������)---*/
-			if($u['battle']>0)
-			{
-				$this->info['timereg'] = $btl['time_start'];
-			}
-			
-			//������� ������ �����
-			//����� ����
-			$st['speedhp'] += 150;
-			$st['speedmp'] += 150;
-			
-			//hp
-			$sh = ($st['hpAll']/(60*$sth));
-			if(!isset($st['speedhp'])) { $st['speedhp'] = 0; }
-			if( (0.0001+$st['speedhp']+$st['levels']['hpRegen']) < 0.00001 ) {
-				$sh += ($sh/100)*0.00001;
-			}else{
-				$sh += ($sh/100)*(0.0001+$st['speedhp']+$st['levels']['hpRegen']);
-			}
-			$st['hpNow'] += $sh*(time()-$u['regHP']);
-			if($st['hpNow']<0)	
-			{
-				$st['hpNow'] = 0;
-			}elseif($st['hpNow']>$st['hpAll'])
-			{
-				$st['hpNow'] = $st['hpAll'];
-			}
-			//mp
-			$sm = ($st['mpAll']/(60*$stm));
-			if(!isset($st['speedmp'])) { $st['speedmp'] = 0; }
-			$sm += ($sm/100)*(1+$st['speedmp']+$st['levels']['mpRegen']);
-			$st['mpNow'] += $sm*(time()-$u['regMP']);
-			if($st['mpNow']<0)	
-			{
-				$st['mpNow'] = 0;
-			}elseif($st['mpNow']>$st['mpAll'])
-			{
-				$st['mpNow'] = $st['mpAll'];
-			}
-			//������� ����� ������ � ����
-			$upd = mysql_query('UPDATE `stats` SET `regHP`="'.time().'",`regMP`="'.time().'",`hpNow`="'.$st['hpNow'].'",`mpNow`="'.$st['mpNow'].'" WHERE `id` = "'.$u['id'].'" LIMIT 1');
-			if(!$upd)
-			{
-				return array(0=>0,1=>0);
-			}else{
-				if($this->info['id']==$u['id'])
-				{
-					$this->stats['regHP'] = time();
-					$this->stats['regMP'] = time();
-					$this->stats['hpNow'] = $st['hpNow'];
-					$this->stats['mpNow'] = $st['mpNow'];
-				}
-				return array(0=>$sh,1=>$sm,'hpNow'=>$st['hpNow'],'mpNow'=>$st['mpNow']);
-			}
-		}
-	}
-	
-	public function send_mime_mail($name_from, // ��� �����������
-	 	 	 	 	    $email_from, // email �����������
-	 	 	 	 	    $name_to, // ��� ����������
-	 	 	 	 	    $email_to, // email ����������
-	 	 	 	 	    $data_charset, // ��������� ���������� ������
-	 	 	 	 	    $send_charset, // ��������� ������
-	 	 	 	 	    $subject, // ���� ������
-	 	 	 	 	    $body // ����� ������
-	 	 	 	 	    )
-	   {
-	  $to = $this->mime_header_encode($name_to, $data_charset, $send_charset)
-					 . ' <' . $email_to . '>';
-	  $subject = $this->mime_header_encode($subject, $data_charset, $send_charset);
-	  $from =  $this->mime_header_encode($name_from, $data_charset, $send_charset)
-						 .' <' . $email_from . '>';
-	  if($data_charset != $send_charset) {
-		$body = iconv($data_charset, $send_charset, $body);
-	  } 
-	  $headers = "From: $from\r\n";
-	  $headers .= "Content-type: text/html; charset=$send_charset\r\n";
-	
-	  return mail($to, $subject, $body, $headers);
-	}
-	
-	public function mime_header_encode($str, $data_charset, $send_charset) {
-	  if($data_charset != $send_charset) {
-		$str = iconv($data_charset, $send_charset, $str);
-	  }
-	  return '=?' . $send_charset . '?B?' . base64_encode($str) . '?=';
-	}
-	
-public function set_cl_item($id, $user, $cl) {
-  $item_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "'.$user['id'].'" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `im`.`inslot` > 0 AND `iu`.`gift` = "" AND `iu`.`data` NOT LIKE "%frompisher=%" AND `iu`.`id` = "'.$id.'" LIMIT 1'));
-  $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1'));
-  if(isset($item_['id'])) {
-	 $po = $this->lookStats($item_['data']);
-	 if(isset($po['toclan'])) {
-	  $po['toclan1'] = explode('#', $po['toclan']);
-	  $po['toclan1'] = $po['toclan1'][0];
-	 }
-	 if(isset($po['sudba']) && $po['sudba'] != '0') {
-	   $r = '<font color="#FF0000"><b>������� ������ � ���� �������</b></font><br>';
-	 } elseif(isset($po['toclan']) && $po['toclan1'] != $user['clan']) {
-	   $r = '<font color="#FF0000"><b>������� � ��� ����������� �����...</b></font><br>';
-	 } elseif($user['inTurnir'] > 0 || $user['inTurnirnew'] > 0) {
-	   $r = '<font color="#FF0000"><b>�� ����� ������� � ������� ��������� ������������ �������� ���������.</b></font><br>';
-	 } else {
-	   if((isset($po['sudba']) && $po['sudba'] != '0') || isset($po['icos']) || isset($po['frompisher']) || isset($po['fromlaba']) || ($item_['gift'] != '' && $item_['gift'] != 0) ) {
-	 	 $r = '�� �������';
-	   } elseif(!isset($po['toclan'])) {
-	 	 $po['toclan'] = $user['clan'].'#'.$user['id'];
-	 	 $item_['data'] = $this->impStats($po);
-	 	 if(mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'", `data` = "'.$item_['data'].'" WHERE `id` = "'.$id.'" LIMIT 1')) {
-		  $r = '<font color="#FF0000"><b>�� ������� ������������ ������� &quot;'.$item_['name'].'&quot; �����</b></font><br />';
-		  $col = $this->itemsX(((int)$id));
-		  $this->addDelo(2, $user['id'],'&quot;<font color="green">System.transfer.MONEY</font>&quot;: ������� &quot;'.$item_['name'].'&quot; (#id : "'.$id.'") (x'.$col.') ��� ����������� ����� &quot;'.$res['name'].'&quot; ('.$res['id'].').', time(), $user['city'], 'System.transfer.clan', 0, 0);
-		  mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "4", "'.$user['login'].'", "'.$item_['name'].' (x'.$col.') �� : ['.$id.']", "'.$user['id'].'")');					
-	 	 } else {
-		  $r = '<font color="#FF0000"><b>�� �������...</b></font><br>';
-		}
-	   } else {
-	 	 if(mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'" WHERE `id` = "'.$id.'" LIMIT 1')) {
-		  $col = $this->itemsX(((int)$id));
-		  mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "3", "'.$user['login'].'", "'.$item_['name'].'" (x'.$col.') �� : ['.$id.'], "'.$user['id'].'")');
-		  $r = '<font color="#FF0000"><b>�� ������� ������� ������� &quot;'.$item_['name'].'&quot; � ��������� �����</b></font><br />';
-		} else {
-		  $r = '<font color="#FF0000"><b>�� �������...</b></font><br>';
-		}
-	   }
-	 }
-  } else {
-	 $r = '<font color="#FF0000"><b>������� �� ������.</b></font><br>';
-  }
-  return $r;
-}
-
-
-public function ungive_itm_cl($id, $user, $cl) {
-  $itm_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` >= 0 AND `iu`.`delete` = 0 AND `iu`.`id` = "'.$id.'" LIMIT 1'));
-  $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1'));
-  $user_itm = mysql_fetch_array(mysql_query('SELECT `id`,`bot`,`clone` FROM `stats` WHERE `id` = "'.$itm_['uid'].'" LIMIT 1'));
-  if( $user_itm['bot'] > 0 || $user_itm['clone'] > 0 || !isset($user_itm['id']) ) {
-	  $r = '<font color="#FF0000"><b>�� �� ������ ������ ������ �������, �� �� ����������� �����</b></font><br />';
-  }elseif(isset($itm_['id'])) {
-	 if($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
-	   if($itm_['inOdet'] != 0) { $o = ', `inOdet` = 0'; } else { $o = ''; }
-	   $r = '<font color="#FF0000"><b>�� ������� ������ ������� &quot;'.$itm_['name'].'&quot;</b></font><br />';
-	   $col = $this->itemsX(((int)$id));
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "6", "'.$user['login'].'", "'.$itm_['name'].' (x'.$col.') �� : ['.$id.'] | � ��������� : ['.$itm_['uid'].']", "'.$user['id'].'")');
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$res['id'].'" '.$o.' WHERE `id` = "'.$id.'" LIMIT 1');
-	 } else {
-	   $r = '<font color="#FF0000"><b>�� ����� ������� � ������� ��������� ������������ �������� ���������.</b></font><br />';
-	 }
-  } else {
-	 $r = '<font color="#FF0000"><b>������� �� ������.</b></font><br />';
-  }
-  return $r;
-}
-
-public function take_itm_cl($id, $user, $cl) {
-  $itm_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "-21'.$user['clan'].'" AND `iu`.`delete` = 0 AND `iu`.`id` = "'.$id.'" LIMIT 1'));
-  $res = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "'.$cl.'" LIMIT 1'));
-  if(isset($itm_['id'])) {
-	 $po = $this->lookStats($itm_['data']);
-	 if(isset($po['toclan'])) {
-	  $cls = explode('#', $po['toclan']);
-	  $cls = $cls[1];
-	 }
-	 if($user['inTurnir'] == 0 && $user['inTurnirnew'] == 0) {
-	   $col = $this->itemsX(((int)$id));
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "5", "'.$user['login'].'", "'.$itm_['name'].' (x'.$col.') �� : ['.$id.'] ������ : ['.$cls.']", "'.$user['id'].'")');
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "'.$user['id'].'" WHERE `id` = "'.$id.'" LIMIT 1');
-	   $r = '<font color="#FF0000"><b>�� ������� ����� ������� &quot;'.$itm_['name'].'&quot; �� ���������</b></font><br />';
-	 } else {
-	   $r = '<font color="#FF0000"><b>�� ����� ������� � ������� ��������� ������������ �������� ���������.</b></font><br />';
-	 }
-  } else {
-	 $r = '<font color="#FF0000"><b>������� �� ������.</b></font><br />'.$id; 
-  }
-  return $r;
-}
-
-public function rem_itm_cl($user, $cl, $type) {
-  $itms = mysql_query('SELECT * FROM `items_users` WHERE (`uid` = "-21'.$user['clan'].'" OR `data` LIKE "%toclan='.$user['clan'].'#%")');
-  while($pl = mysql_fetch_array($itms)) {
-	 $po = $this->lookStats($pl['data']);
-	 if(isset($po['toclan'])) {
-	  $cls = explode('#', $po['toclan']);
-	  $cls = $cls[1];
-	 }
-	 if($cls == $user['id']) {
-	   if($pl['uid'] != $user['id']) {
-	 	 if($pl['inOdet'] != 0) { mysql_query('UPDATE `items_users` SET `inOdet` = 0 WHERE `id` = "'.$pl['id'].'"'); }
-	   }
-	   unset($po['toclan']);
-	   $pl['data'] = $this->impStats($po);
-	   $col = $this->itemsX(((int)$pl['id']));
-	   $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$pl['item_id'].'"'));
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "'.$user['id'].'", `data` = "'.$pl['data'].'" WHERE `id` = "'.$pl['id'].'"');
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "'.$type.'", "'.$user['login'].'", "'.$it_n['name'].' (x'.$col.') �� : ['.$pl['id'].']", "'.$user['id'].'")');
-	 } elseif($cls != $user['id'] && $pl['uid'] == $user['id']) {
-	   $col = $this->itemsX(((int)$pl['id']));
-	   $it_n = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "'.$pl['item_id'].'"'));
-	   mysql_query('UPDATE `items_users` SET `lastUPD` = "'.time().'", `uid` = "-21'.$user['clan'].'" WHERE `id` = "'.$pl['id'].'"');
-	   mysql_query('INSERT INTO `clan_operations` (`clan`, `time`, `type`, `text`, `val`, `uid`) VALUES ("'.$res['id'].'", "'.time().'", "9", "'.$user['login'].'", "'.$it_n['name'].' (x'.$col.') �� : ['.$pl['id'].']", "'.$user['id'].'")');
-	 }
-  }
-}
-	
-	public function send_mail($to,$to_name,$from = 'support@new-combats.com',$name = '<b>���������� ����</b> 2',$title,$text) {
-		$this->send_mime_mail($name,
-	 	 	    $from,
-	 	 	    $to_name,
-	 	 	    $to,
-	 	 	    'CP1251',  // ���������, � ������� ��������� ������������ ������
-	 	 	    'KOI8-R', // ���������, � ������� ����� ���������� ������
-	 	 	    $title,
-	 	 	    $text); // \r\n
-	}
-	
-	public function roomInfo($id, $short=false) {
-		if($short==true){
-			$select = ' `id`, `name`, `code`, `city`, `timeGO`, `level`,`roomGo` ';
-		} else {
-			$select = ' * ';
-		}
-		$roomInfo = mysql_fetch_array(mysql_query('SELECT '.$select.' FROM `room` WHERE `id` = "'.$id.'" LIMIT 1'));
-		if($roomInfo['roomGo']) $roomInfo['roomGo'] = explode(',', $roomInfo['roomGo']);
-		if($roomInfo['level']) $roomInfo['level'] = explode('-', $roomInfo['level']);
-		return $roomInfo;
-	}
-	
-public function showAbils() {
-  $r = '';
-  $sp = mysql_fetch_array(mysql_query('SELECT * FROM `abils_user` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-  if(isset($sp['id'])) {
-	$r .= '';
-  } else {
-	mysql_query('INSERT INTO `abils_user` (`uid`) VALUES ("'.$this->info['id'].'")');
-  }
-  return $r;
-}
-	
-}
-
-
-$u = user::start();
-?>
\ No newline at end of file
diff --git a/modules_data/titul.php b/modules_data/titul.php
index 0d418e82..7f1a28b1 100644
--- a/modules_data/titul.php
+++ b/modules_data/titul.php
@@ -1,8 +1,3 @@
-<script>
-    let elem = document.getElementById('se-pre-con');
-    elem.parentNode.removeChild(elem);
-</script>
-
 <?php
 
 use Insallah\Db;
@@ -11,107 +6,17 @@ if (!defined('GAME')) {
     die();
 }
 
-const TIERS = 'Ранги';
-const PRIZE = 'Награда';
-
-$achievement_data = [
-    'zb' => [
-        'quest' => 'Выполнить задания бабки.',
-        'check' => ['Заданий', 5, 25, 50, 100, 250],
-        'prize' => ['Жетон <br>успеха <br>', 5, 20, 40, 60, 100],
-        'startlink' => 11
-    ],
-    'vx' => [
-        'quest' => 'Победить в хаотических боях.',
-        'check' => ['Побед', 50, 300, 400, 500, 1000],
-        'prize' => ['екр.', 25, 50, 75, 100, 200],
-        'startlink' => 21
-    ],
-    'snt' => [
-        'quest' => 'Открыть сундук трупожора.',
-        'check' => ['Открытий', 5, 25, 50, 100, 250],
-        'prize' => ['екр.', 10, 25, 50, 75, 200],
-        'startlink' => 31
-    ],
-    'rp' => [
-        'quest' => 'Получить руну при плавке плохих заготовок. [S]',
-        'check' => ['Рун', 5, 10, 25, 50, 100],
-        'prize' => ['Плохие <br> заготовки <br>', 5, 7, 10, 12, 15],
-        'startlink' => 41
-    ],
-    'rn' => [
-        'quest' => 'Получить руну при плавке нормальных заготовок. [M]',
-        'check' => ['Рун', 5, 10, 15, 25, 50],
-        'prize' => ['Нормальные <br> заготовки <br>', 5, 7, 9, 12, 15],
-        'startlink' => 51
-    ],
-    'rb' => [
-        'quest' => 'Получить руну при плавке идеальных заготовок. [L]',
-        'check' => ['Рун', 2, 5, 8, 11, 15],
-        'prize' => ['Идеальные <br> заготовки <br>', 2, 4, 6, 10, 15],
-        'startlink' => 61
-    ],
-    'pg' => [
-        'quest' => 'Поучаствовать в героическом сражении.',
-        'check' => ['Участий', 100, 200, 400, 600, 1000],
-        'prize' => ['Жетон <br>успеха <br>', 10, 20, 40, 60, 80],
-        'startlink' => 71
-    ],
-    'bv' => [
-        'quest' => 'Продать бабушке найденные вещи в пещере.',
-        'check' => ['Продаж', 5, 25, 50, 100, 250],
-        'prize' => ['кр.', 500, 1000, 2000, 4000, 5000],
-        'startlink' => 81
-    ],
-    'kw' => [
-        'quest' => 'Победить в клановой войне.',
-        'check' => ['Побед', 5, 10, 15, 20, 25],
-        'prize' => ['Свиток <br> кланового<br> опыта ', 1, 2, 5, 10, 15],
-        'startlink' => 91
-    ],
-    'pa' => [ # not implemented!
-        'quest' => 'Получить покровительство Ангела.',
-        'check' => ['Получено', 5, 25, 50, 100, 250],
-        'prize' => null,
-        'startlink' => null
-    ],
-    'bs' => [
-        'quest' => 'Победы в башне смерти.',
-        'check' => ['Побед', 1, 5, 10, 50, 500],
-        'prize' => ['екр.', 1, 5, 10, 50, 200],
-        'startlink' => 101
-    ],
-    'trn' => [ # not implemented!
-        'quest' => 'Победы в турнирах.',
-        'check' => ['Побед', 25, 50, 100, 200, 500],
-        'prize' => ['екр.', 25, 25, 25, 25, 50],
-        'startlink' => 111
-    ],
-];
-
-function table($rows, $class = '', $fill = false)
-{
-    $c = '';
-    $max_rows = sizeof(max($rows));
-
-    foreach ($rows as $row) {
-        if ($fill && sizeof($row) < $max_rows) {
-            $row = array_merge($row, array_fill(0, $max_rows - sizeof($row), ''));
-        }
-
-        $c .= '<tr><td>' . implode('</td><td>', $row) . '</td></tr>';
-    }
-
-    return (!empty($class) ? "<table class='$class'>" : '<table>') . $c . '</table>' . PHP_EOL;
+if (empty($u)) {
+    $u = user::start();
 }
 
-$ai = $u->achivInf($u->info['id'], 1);
+$a = new Achievements($u);
+$ai = $a->getCheckedInfo();
+
 if (isset($_GET['nagr'])) {
     $nagrtxt = 'За выполненное достижение Вы получили ';
-    if (
-        in_array($_GET['nagr'], [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]) &&
-        $u->info['level'] < 9
-    ) {
+
+    if ($a->hasNoTier4Access($_GET['nagr'])) {
         $nagrtxt = 'Вы не можете получить эту награду на этом уровне!';
     } elseif ( //бабка задание zb
         in_array($_GET['nagr'], [11, 12, 13, 14, 15]) &&
@@ -119,179 +24,106 @@ if (isset($_GET['nagr'])) {
         $ai['klaszb'] > $ai['zb_n']
     ) {
         $ai['zb_n'] += 1;
-        $u->rangup($u->info['id'], $ai['zb_n'], 'zb');
-        $i = 0;
-        while ($i < $achievement_data['zb']['prize'][$ai['zb_n']]) {
-            $u->addItem(10020, $u->info['id'], '');
-            $i++;
-        }
-        $nagrtxt .= 'Жетон успеха X' . $achievement_data['zb']['prize'][$ai['zb_n']];
+        $a->updateTier('zb_n');
+        $a->givePrizeItems(10020, 'zb');
+        $nagrtxt .= 'Жетон успеха X' . $a->getData()['zb']['prize'][$ai['zb_n']];
     } elseif ( //Хаот задание vx
         in_array($_GET['nagr'], [21, 22, 23, 24, 25]) &&
         in_array($ai['vx_n'], [0, 1, 2, 3, 4]) &&
         $ai['klasvx'] > $ai['vx_n']
     ) {
         $ai['vx_n'] += 1;
-        $u->rangup($u->info['id'], $ai['vx_n'], 'vx');
-        Db::sql('update users set money2 = money2 + ? where id = ?',
-            [$achievement_data['vx']['prize'][$ai['vx_n']], $u->info['id']]);
-        $nagrtxt .= $achievement_data['vx']['prize'][$ai['vx_n']] . $achievement_data['vx']['prize'][0];
+        $a->updateTier('vx_n');
+        $u->addEkr($a->getData()['vx']['prize'][$ai['vx_n']]);
+        $nagrtxt .= $a->getData()['vx']['prize'][$ai['vx_n']] . $a->getData()['vx']['prize'][0];
     } elseif ( //Сундуки трупожора snt
         in_array($_GET['nagr'], [31, 32, 33, 34, 35]) &&
         in_array($ai['snt_n'], [0, 1, 2, 3, 4]) &&
         $ai['klassnt'] > $ai['snt_n']
     ) {
         $ai['snt_n'] += 1;
-        $u->rangup($u->info['id'], $ai['snt_n'], 'snt');
-        Db::sql('update users set money2 = money2 + ? where id = ?',
-            [$achievement_data['snt']['prize'][$ai['snt_n']], $u->info['id']]);
-        $nagrtxt .= $achievement_data['snt']['prize'][$ai['snt_n']] . $achievement_data['snt']['prize'][0];
+        $a->updateTier('snt_n');
+        $u->addEkr($a->getData()['snt']['prize'][$ai['snt_n']]);
+        $nagrtxt .= $a->getData()['snt']['prize'][$ai['snt_n']] . $a->getData()['snt']['prize'][0];
     } elseif ( //Руны 8 лвл. rp
         in_array($_GET['nagr'], [41, 42, 43, 44, 45]) &&
         in_array($ai['rp_n'], [0, 1, 2, 3, 4]) &&
         $ai['klasrp'] > $ai['rp_n']
     ) {
         $ai['rp_n'] += 1;
-        $u->rangup($u->info['id'], $ai['rp_n'], 'rp');
-        $i = 0;
-        while ($i < $achievement_data['rp']['prize'][$ai['rp_n']]) {
-            $u->addItem(10038, $u->info['id'], '');
-            $i++;
-        }
-        $nagrtxt .= 'Плохие Заготовки X' . $achievement_data['rp']['prize'][$ai['rp_n']];
+        $a->updateTier('rp_n');
+        $a->givePrizeItems(10038, 'rp');
+        $nagrtxt .= 'Плохие Заготовки X' . $a->getData()['rp']['prize'][$ai['rp_n']];
     } elseif ( //Руны 9 лвл. rn
         in_array($_GET['nagr'], [51, 52, 53, 54, 55]) &&
         in_array($ai['rn_n'], [0, 1, 2, 3, 4]) &&
         $ai['klasrn'] > $ai['rn_n']
     ) {
         $ai['rn_n'] += 1;
-        $u->rangup($u->info['id'], $ai['rn_n'], 'rn');
-        $i = 0;
-        while ($i < $achievement_data['rn']['prize'][$ai['rn_n']]) {
-            $u->addItem(10039, $u->info['id'], '');
-            $i++;
-        }
-        $nagrtxt .= 'Нормальные Заготовки X' . $achievement_data['rn']['prize'][$ai['rn_n']];
+        $a->updateTier('rn_n');
+        $a->givePrizeItems(10039, 'rn');
+        $nagrtxt .= 'Нормальные Заготовки X' . $a->getData()['rn']['prize'][$ai['rn_n']];
     } elseif ( //Руны 10 лвл. rb
         in_array($_GET['nagr'], [61, 62, 63, 64, 65]) &&
         in_array($ai['rb_n'], [0, 1, 2, 3, 4]) &&
         $ai['klasrb'] > $ai['rb_n']
     ) {
         $ai['rb_n'] += 1;
-        $u->rangup($u->info['id'], $ai['rb_n'], 'rb');
-        $i = 0;
-        while ($i < $achievement_data['rb']['prize'][$ai['rb_n']]) {
-            $u->addItem(10040, $u->info['id'], '');
-            $i++;
-        }
-        $nagrtxt .= 'Идеальные Заготовки X' . $achievement_data['rb']['prize'][$ai['rb_n']];
+        $a->updateTier('rb_n');
+        $a->givePrizeItems(10040, 'rb');
+        $nagrtxt .= 'Идеальные Заготовки X' . $a->getData()['rb']['prize'][$ai['rb_n']];
     } elseif ( //Героик pg
         in_array($_GET['nagr'], [71, 72, 73, 74, 75]) &&
         in_array($ai['pg_n'], [0, 1, 2, 3, 4]) &&
         $ai['klaspg'] > $ai['pg_n']
     ) {
         $ai['pg_n'] += 1;
-        $u->rangup($u->info['id'], $ai['pg_n'], 'pg');
-        $i = 0;
-        while ($i < $achievement_data['pg']['prize'][$ai['pg_n']]) {
-            $u->addItem(10020, $u->info['id'], '');
-            $i++;
-        }
-        $nagrtxt .= 'Жетон Успеха X' . $achievement_data['pg']['prize'][$ai['pg_n']];
+        $a->updateTier('pg_n');
+        $a->givePrizeItems(10020, 'pg');
+        $nagrtxt .= 'Жетон Успеха X' . $a->getData()['pg']['prize'][$ai['pg_n']];
     } elseif ( //Продать бабушке найденные вещи в пещере bv
         in_array($_GET['nagr'], [81, 82, 83, 84, 85]) &&
         in_array($ai['bv_n'], [0, 1, 2, 3, 4]) &&
         $ai['klasbv'] > $ai['bv_n']
     ) {
         $ai['bv_n'] += 1;
-        $u->rangup($u->info['id'], $ai['bv_n'], 'bv');
-        Db::sql('update users set money = money + ? where id = ?',
-            [$achievement_data['bv']['prize'][$ai['bv_n']], $u->info['id']]);
-        $nagrtxt .= $achievement_data['bv']['prize'][$ai['bv_n']] . $achievement_data['bv']['prize'][0];
+        $a->updateTier('bv_n');
+        $u->addKr($a->getData()['bv']['prize'][$ai['bv_n']]);
+        $nagrtxt .= $a->getData()['bv']['prize'][$ai['bv_n']] . $a->getData()['bv']['prize'][0];
     } elseif ( //Клан вар kw
         in_array($_GET['nagr'], [91, 92, 93, 94, 95]) &&
         in_array($ai['kw_n'], [0, 1, 2, 3, 4]) &&
         $ai['klaskw'] > $ai['kw_n']
     ) {
         $ai['kw_n'] += 1;
-        $u->rangup($u->info['id'], $ai['kw_n'], 'kw');
-        $i = 0;
-        while ($i < $achievement_data['kw']['prize'][$ai['kw_n']]) {
-            $u->addItem(4917, $u->info['id'], '');
-            $i++;
-        }
-        $nagrtxt .= 'Клановый опыт +50000 X' . $achievement_data['kw']['prize'][$ai['kw_n']];
+        $a->updateTier('kw_n');
+        $a->givePrizeItems(4917, 'kw');
+        $nagrtxt .= 'Клановый опыт +50000 X' . $a->getData()['kw']['prize'][$ai['kw_n']];
     } elseif ( //Башня смерти задание bs
         in_array($_GET['nagr'], [101, 102, 103, 104, 105]) &&
         in_array($ai['bs_n'], [0, 1, 2, 3, 4]) &&
         $ai['klasbs'] > $ai['bs_n']
     ) {
         $ai['bs_n'] += 1;
-        $u->rangup($u->info['id'], $ai['bs_n'], 'bs');
-        Db::sql('update users set money2 = money2 + ? where id = ?',
-            [$achievement_data['bs']['prize'][$ai['bs_n']], $u->info['id']]);
-        $nagrtxt .= $achievement_data['bs']['prize'][$ai['bs_n']] . $achievement_data['bs']['prize'][0];
+        $a->updateTier('bs_n');
+        $u->addEkr($a->getData()['bs']['prize'][$ai['bs_n']]);
+        $nagrtxt .= $a->getData()['bs']['prize'][$ai['bs_n']] . $a->getData()['bs']['prize'][0];
     } elseif ( //Турниры победы trn
         in_array($_GET['nagr'], [111, 112, 113, 114, 115]) &&
         in_array($ai['trn_n'], [0, 1, 2, 3, 4]) &&
         $ai['klastrn'] > $ai['trn_n']
     ) {
         $ai['trn_n'] += 1;
-        $u->rangup($u->info['id'], $ai['trn_n'], 'trn');
-        Db::sql('update users set money2 = money2 + ? where id = ?',
-            [$achievement_data['trn']['prize'][$ai['trn_n']], $u->info['id']]);
-        $nagrtxt .= $achievement_data['trn']['prize'][$ai['trn_n']] . $achievement_data['trn']['prize'][0];
+        $a->updateTier('trn_n');
+        $u->addEkr($a->getData()['trn']['prize'][$ai['trn_n']]);
+        $nagrtxt .= $a->getData()['trn']['prize'][$ai['trn_n']] . $a->getData()['trn']['prize'][0];
     }
+    //Тоже бы вынести в класс чата.
+    Db::sql('insert into chat (new, city, room, `to`, `text`, `time`, type) values (?,?,?,?,?,?,?)',
+        [1, $u->info['city'], $u->info['room'], $u->info['login'], $nagrtxt, -1, 6]);
 
-    Db::sql('insert into chat (new, city, room, login, `to`, `text`, `time`, type, toChat) values (?,?,?,?,?,?,?,?,?)',
-        [1, $u->info['city'], $u->info['room'], $u->info['login'], $nagrtxt, -1, 6, 0]);
-    //-------------
-}
-function drawSunduk($nagr, $whatInside, $tier)
-{
-    return vsprintf('<img onclick="%s" onmouseover="%s" onmouseout="%s" onmousedown="%s" class="cp" src="%s" alt="Сундук">',
-        [
-            "location.href='\main.php?titul&nagr=$nagr'",
-            "top.hi(this, '<b>Сундук $tier ранга<hr>Содержит:<hr> $whatInside</b>', event, 2, 0, 1, 1, 'max-width:307px')",
-            "top.hic();",
-            "top.hic();",
-            "https://img.new-combats.com/i/titul/nagr$tier.gif"
-        ]);
 }
 
-$data = null;
-foreach ($achievement_data as $key => $value) {
-    $data .= '<h4>' . $ai['name' . $key] . '</h4>';
-    $data .= '<strong>' . $value[$key]['quest'] . '</strong>';
-    $data .= 'Сейчас у Вас Ранг: <strong>' . $ai['klas' . $key] . '</strong>';
-    $data .= 'Количество выполнений: <strong>' . $ai[$key] . ' =' . $ai['klasP' . $key] . '%</strong>';
-    $data .= table([
-        [TIERS, 1, 2, 3, 4, 5],
-        $value[$key]['check'],
-        array_merge([PRIZE], $value[$key]['prize'])
-    ], 'prizelist', true);
-    # If has new tier, AND only first 5 tiers AND prize is set.
-    if (
-        $ai['klas' . $key] > $ai[$key . '_n'] &&
-        in_array($ai[$key . '_n'], [0, 1, 2, 3, 4]) &&
-        !empty($value[$key]['prize']) &&
-        !empty($value[$key]['startlink'])
-    ) {
-        $data .= '<br>' . PRIZE . ':<br>';
-        if (in_array($value[$key]['prize'][0], ['екр.', 'кр.'])) {
-            $sundukName = $value[$key]['prize'][$ai[$key . '_n'] + 1] . $value[$key]['prize'][0];
-        } else {
-            $sundukName = $value[$key]['prize'][0] . $value[$key]['prize'][$ai[$key . '_n'] + 1];
-        }
-
-        $data .= drawSunduk(
-            $ai[$key . '_n'] + $value[$key]['startlink'],
-            $sundukName,
-            $ai[$key . '_n'] + $value[$key]['startlink']
-        );
-    }
-    $data .= '<hr>';
-}
 ?>
 
 <style>
@@ -299,7 +131,7 @@ foreach ($achievement_data as $key => $value) {
     table.prizelist {
         border-spacing: 1px;
         border-collapse: separate;
-        min-width: 500px;
+        min-width: 600px;
     }
 
     table.prizelist tr {
@@ -329,5 +161,9 @@ foreach ($achievement_data as $key => $value) {
 
 <H3>Достижения</H3>
 
-<?= $data;
-unset($data);
\ No newline at end of file
+<?= $a->getList(); ?>
+
+<script>
+    let elem = document.getElementById('se-pre-con');
+    elem.parentNode.removeChild(elem);
+</script>
-- 
2.45.2


From 6c3ca6b2cbc178d8db3ce2948695b9b5ba1d8c93 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sun, 26 Jun 2022 21:21:12 +0300
Subject: [PATCH 07/12] Closes #11

---
 _incl_data/class/Insallah/Core/Math.php |    9 +
 _incl_data/class/__magic.php            | 4390 ++++++++++-------------
 2 files changed, 1958 insertions(+), 2441 deletions(-)

diff --git a/_incl_data/class/Insallah/Core/Math.php b/_incl_data/class/Insallah/Core/Math.php
index f9279129..83a50b3c 100644
--- a/_incl_data/class/Insallah/Core/Math.php
+++ b/_incl_data/class/Insallah/Core/Math.php
@@ -14,4 +14,13 @@ class Math
     {
         return min(self::getPercentage($total, $number), 100);
     }
+
+    /** Number-20% and Number+20% */
+    public static function get20PercentRange($number)
+    {
+        return [
+            'min' => $number * ((100 - 20) / 100),
+            'max' => $number * ((100 - 20) / 100)
+        ];
+    }
 }
\ No newline at end of file
diff --git a/_incl_data/class/__magic.php b/_incl_data/class/__magic.php
index 3965cb88..a4c869fd 100644
--- a/_incl_data/class/__magic.php
+++ b/_incl_data/class/__magic.php
@@ -1,2489 +1,1997 @@
 <?php
-if(!defined('GAME'))
-{
-	die();
+if (!defined('GAME')) {
+    die();
 }
 ignore_user_abort(true);
-if(isset($_POST['useitemon'])) {
-	$_GET['login'] = $_POST['useitemon'];
+if (isset($_POST['useitemon'])) {
+    $_GET['login'] = $_POST['useitemon'];
 }
 
-class Magic {
-	
-	public $youuse = 0;
-	public $c_magic = array(4174, 4175, 4176, 4177, 4178, 4179, 4180);
-    public $e_magic = array(4185, 4186, 4187);
-	//���������� ����� ���
-	/*public function oslablenie($uid)
-	{
-		$ins = mysql_query('INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`timeUse`,`no_Ace`) VALUES ("5","'.$uid.'","���������� ����� ���","add_m10=-1000|add_m11=-1000","'.(time()-600+( 60 * 3 )).'",1)');
-		if($ins)
-		{
-			return true;
-		}else{
-			return false;
-		}
-	}
-	*/
-	//����������� (��������� ������ ����������� � �������� ��������� ����� �������)
-	/*public $pgtype = array(
-		//����������� �� ����
-		//1	=> 1, //����� ����������
-		//264	=> 1, //�������� ��������
-		//306 => 1, //������ ��������
-		//383 => 1, //���������
-		
-		//����������� �� ��������
-		//8	=> 2,
-		//265	=> 2,
-		//308 => 2, //������ ����
-		//385 => 2, //���������
-		
-		//����������� �� ��������
-		//7	=> 3,
-		//266	=> 3,
-		//307 => 3, //������ ������������
-		//384 => 3, //���������
-		
-		//����������� �� ���������
-		//9	=> 4,
-		//267	=> 4,
-		//309 => 4, //������ ������
-		//333 => 4,
-		//405 => 4, //���������
-		
-		//����������� �� ������ �� �����
-		//14	=> 5,
-		//27	=> 5,
-		//37	=> 5,
-		//361	=> 5,
-		
-		//����������� �� ������ �� �������� �����
-		//10 => 6,
-		//����������� �� ������ �� �������� �����
-		//12 => 7,
-		//����������� �� ������ �� ��������� �����
-		//13 => 8,
-		//����������� �� ������ �� �������� �����
-		//11 => 9,
-		
-		//����������� �� ������ �� �����
-		//28	=> 10,
-		//38	=> 10,
-		//362	=> 10,
-		//369 => 10,
-		
-		//����������� �� ������ �� ����
-		272 => 11,
-		370 => 11,
-		//����������� �� ������ �� ����
-		334 => 12,
-		275 => 12,
-		372 => 12,
-		//����������� �� ������ �� �������
-		274 => 13,
-		373 => 13,
-		//����������� �� ������ �� �����
-		273 => 14,
-		374 => 14,
-		
-		//�������������� ��������
-		268 => 15,
-		//�������������� ����
-		300 => 16,
-		
-		10000000000000 => 0
-	);*/
-	
-	/*����������� (��������� ������)
-	public $pgtype_second = array(		
-		//����������� �� ������ �� �����
-		14	=> array(6,7,8,9),
-		27	=> array(6,7,8,9),
-		37	=> array(6,7,8,9),
-		361	=> array(6,7,8,9),
-		
-		//����������� �� ������ �� �������� �����
-		10 => array(5,7,8,9),
-		//����������� �� ������ �� �������� �����
-		12 => array(6,5,8,9),
-		//����������� �� ������ �� ��������� �����
-		13 => array(6,7,5,9),
-		//����������� �� ������ �� �������� �����
-		11 => array(6,7,8,5),
-		
-		//����������� �� ������ �� �����
-		//28	=> 10,
-		//38	=> 10,
-		
-		//����������� �� ������ �� ����
-		272 => array( 10 , 11 , 12 , 13 , 14 ),
-		370 => array( 10 , 11 , 12 , 13 , 14 ),
-		//����������� �� ������ �� ����
-		334 => array( 10 , 11 , 12 , 13 , 14 ),
-		275 => array( 10 , 11 , 12 , 13 , 14 ),
-		372 => array( 10 , 11 , 12 , 13 , 14 ),
-		//����������� �� ������ �� �������
-		274 => array( 10 , 11 , 12 , 13 , 14 ),
-		373 => array( 10 , 11 , 12 , 13 , 14 ),
-		//����������� �� ������ �� �����
-		273 => array( 10 , 11 , 12 , 13 , 14 ),
-		374 => array( 10 , 11 , 12 , 13 , 14 ),
-		
-		//�������������� ��������
-		//268 => 15,
-		//�������������� ����
-		//300 => 16,
-		
-		10000000000000 => 0
-	);
-	
-	//��������� �����������
-	//�������� , ������������ ������� , ���������� ������ , ������� ������� ������ ������ ������� � ������ , ��� ����������� ���������
-	public $pgpar = array(
-		1 => array('����', 25, 29, 1.2, 's1', 301),
-		2 => array('��������', 25, 29, 1.2, 's2', 302),
-		3 => array('��������', 25, 29, 1.2, 's3', 303),
-		4 => array('���������', 25, 29, 1.2, 's5', 304),
-		
-		5 => array('������ �� �����', 25, 175, 1.2, 'za', 321),		
-		6 => array('������ �� �������� �����', 25, 98, 1.2, 'za1', 322),
-		7 => array('������ �� �������� �����', 25, 98, 1.2, 'za2', 323),
-		8 => array('������ �� ��������� �����', 25, 98, 1.2, 'za3', 324),
-		9 => array('������ �� �������� �����', 25, 98, 1.2, 'za4', 325),
-		
-		10 => array('������ �� �����', 25, 175, 1.2, 'zm', 326),		
-		11 => array('������ �� ����� ����', 25, 98, 1.2, 'zm1', 327),
-		12 => array('������ �� ����� ����', 25, 98, 1.2, 'zm3', 328),
-		13 => array('������ �� ����� �������', 25, 98, 1.2, 'zm2', 329),
-		14 => array('������ �� ����� �����', 25, 98, 1.2, 'zm4', 330),
-		
-		15 => array('�������������� HP', 25, 294, 1.2, 'speedhp', 331),
-		16 => array('�������������� MP', 25, 294, 1.2, 'speedmp', 332)
-	);
-	
-	//�������� ����� ��� ������������
-	public $pgel = array(
-		//����
-		1	=> array(5), //����� ����������
-		264	=> array(7),  //�������� ��������
-		306 => array(7),
-		383 => array(6),
-		//��������
-		8	=> array(5),
-		265	=> array(7),
-		308 => array(7),
-		385 => array(6),
-		//��������
-		7	=> array(5),
-		266	=> array(7),
-		307 => array(7),
-		384 => array(6),
-		//���������
-		9	=> array(5),
-		267	=> array(7),
-		309 => array(7),
-		333 => array(5),
-		405 => array(6),
-		//������ �� �����
-		14	=> array(12),
-		27	=> array(18),
-		37	=> array(25),
-		361 => array(45),
-		//������ �� �������� �����
-		10	=> array(12),
-		//������ �� �������� �����
-		11	=> array(12),
-		//������ �� �������� �����
-		12	=> array(12),
-		//������ �� ��������� �����
-		13	=> array(12),
-		//������ �� �����
-		369 => array(8),
-		28	=> array(18),
-		38	=> array(25),
-		362	=> array(45),
-		
-		//������ �� ����� ����
-		334 => array(18), //�������� �������
-		//
-		272 => array(12),
-		273 => array(12),
-		274 => array(12),
-		275 => array(12),
-		//
-		370 => array(20),
-		372 => array(20),
-		373 => array(20),
-		374 => array(20),
-		//
-		//�������������� ��
-		268 => array(75),
-		//�������������� ��
-		300 => array(75)
-	);
-	
-	//�������� ������� �����������
-	public $elrazgon = array( 405 => true , 383 => true , 384 => true , 385 => true );
-	
-	public function paguba( $eff ) {
-		//global $u;	
-		if(isset($this->pgtype[$eff['id2']])) {
-			global $u;
-			$re = '';
-			
-			$tp = $this->pgtype[$eff['id2']];
-			$tp_sec = $this->pgtype_second[$eff['id2']];
-			$v = $this->pgpar[$tp];
-			$el = $this->pgel[$eff['id2']];
-			$pgb = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "pgb'.$tp.'" AND `delete` = "0" AND `uid` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));	
-			if( is_array($tp_sec) ) {
-				$i = 0;
-				while( $i < count($tp_sec) ) {
-					if( $tp_sec[$i] > 0 ) {
-						$pgb_ref = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "pgb'.$tp_sec[$i].'" AND `delete` = "0" AND `uid` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));	
-						if( isset($pgb_ref['id']) ) {
-							$lvl = explode('[',$pgb['name']); 
-							$lvl = explode(']',$lvl[1]);
-							$lvl = $lvl[0];
-							mysql_query('UPDATE `eff_users` SET `deactiveTime` = "'.(time()+$eff['actionTime']).'", `timeUse` = "'.(time()+floor($lvl*$this->pgpar[$tp_sec[$i]][3]*86400)).'" WHERE `id` = "'.$pgb_ref['id'].'" LIMIT 1');
-						}
-					}
-					$i++;
-				}
-				unset($pgb_ref,$i);
-			}
-			if(!isset($pgb['id'])) {
-				//����������� ���, �� ��� ����� ���������, ���� 10%
-				$prc11 = 5;
-				if( $this->elrazgon[$eff['id2']] == true ) {
-					$prc11 = 101;
-				}
-				if(rand(0,100) < $prc11) {
-					//��������� �����������
-					$d = 'add_'.$v[4].'=-'.ceil($v[2]/$v[1]*1);
-					mysql_query('INSERT INTO `eff_users` (`v1`,`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`,`deactiveTime`) VALUES ("pgb'.$tp.'","0","'.$v[5].'","'.$u->info['id'].'","�������� ����������� [1]","'.(time()+floor($v[3]*86400)).'","'.$d.'","0","'.(time()+$eff['actionTime']).'")');
-				}
-			}else{
-				$lvl = explode('[',$pgb['name']); 
-				$lvl = explode(']',$lvl[1]);
-				$lvl = $lvl[0]; 
-				$prc11 = 7;
-				if( $this->elrazgon[$eff['id2']] == true ) {
-					$prc11 = 101;
-				}
-				//����������� ���� � �������� �������� ��� ������� 5% , ���� ������ 75% ������� ��������
-				if(rand(0,100)  < $prc11 && $lvl < $v[1]) {
-					//��������� ����� �����������
-					$lvl++;
-					$d = 'add_'.$v[4].'=-'.ceil($v[2]/$v[1]*$lvl);
-					mysql_query('DELETE FROM `eff_users` WHERE `id` = "'.$pgb['id'].'" LIMIT 1');
-					mysql_query('INSERT INTO `eff_users` (`v1`,`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`,`deactiveTime`) VALUES ("pgb'.$tp.'","0","'.$v[5].'","'.$u->info['id'].'","�������� ����������� ['.$lvl.']","'.(time()+floor($lvl*$v[3]*86400)).'","'.$d.'","0","'.(time()+$eff['actionTime']).'")');
-					$pgb = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "pgb'.$tp.'" AND `delete` = "0" AND `uid` = "'.$u->info['id'].'" RODER BY `id` DESC LIMIT 1'));			
-				}else{
-					//��������� ����� �����������
-					mysql_query('UPDATE `eff_users` SET `deactiveTime` = "'.(time()+$eff['actionTime']).'", `timeUse` = "'.(time()+floor($lvl*$v[3]*86400)).'" WHERE `id` = "'.$pgb['id'].'" LIMIT 1');
-				}
-				
-				
-				//�������������� ������ �����������
-				$eff['mdata'] = $u->lookStats($eff['mdata']);
-				$eff['mdata']['add_'.$v[4]] += floor($el[0]/$v[1]*$lvl);
-				$eff['mdata'] = $u->impStats($eff['mdata']);
-			}
-		}
-		return $eff;
-	}*/
+class Magic
+{
 
+    public $youuse = 0;
+    public $c_magic = [4174, 4175, 4176, 4177, 4178, 4179, 4180];
+    public $e_magic = [4185, 4186, 4187];
 
+    public function inBattleLog($txt, $usr = null)
+    {
+        global $u;
+        $lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "' . $u->info['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1'));
+        if (isset($lastHOD['id'])) {
+            $id_hod = $lastHOD['id_hod'];
+            if ($lastHOD['type'] != 6) {
+                $id_hod++;
+            }
+            mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time() . '","","","","","6")');
+        }
+    }
 
+    //Использование предмета
+    public function useItems($id)
+    {
+        global $u, $c, $code, $btl, $e_magic, $c_magic;
 
+        $itm = mysql_fetch_array(mysql_query('SELECT `iu`.`id` AS `iuid`,`im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "' . $u->info['id'] . '" AND `iu`.`inShop`="0" AND `iu`.`delete`="0" AND `iu`.`id` = "' . mysql_real_escape_string((int)$id) . '" LIMIT 1'));
+        $bs_is = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "' . $u->info['inTurnir'] . '" LIMIT 1'));
+        if (isset($itm['id'])) {
 
-	public function inBattleLog($txt,$usr=NULL) {
-		global $u;
-		$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-		if(isset($lastHOD['id'])) {
-			$id_hod = $lastHOD['id_hod'];
-			if($lastHOD['type']!=6) {
-				$id_hod++;
-			}
-			mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-		}
-	}
-
-
-	
-	//������������� ��������
-	public function useItems($id)
-	{
-		global $u, $c, $code, $btl, $e_magic, $c_magic;
-				
-		$itm = mysql_fetch_array(mysql_query('SELECT `iu`.`id` AS `iuid`,`im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.$u->info['id'].'" AND `iu`.`inShop`="0" AND `iu`.`delete`="0" AND `iu`.`id` = "'.mysql_real_escape_string((int)$id).'" LIMIT 1'));
-		$bs_is = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$u->info['inTurnir'].'" LIMIT 1'));
-        if(isset($itm['id']))
-		{
-			
-			if($itm['group'] == 1) {
-				//������ ���������
-				if($u->itemsX($itm['id'])>1) {
-					//����������� ������� �� ������
-					$u->unstack($itm['id'],1);
-					/*$itm = mysql_fetch_array(mysql_query('SELECT `iu`.`id` AS `iuid`,`im`.*, `iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1'));
-					if(!isset($itm['id'])) {
-						$this->error = '������ ��������� ��������...';
-					}else{
-						$itm['delete'] = 0;
-					}*/
-				}
-			}
-			
-			$st = $u->lookStats($itm['data']);
-			
-			if (isset($st['tr_lvl']) && $st['tr_lvl']> $u->info['level'])
-			{
-				$u->error = '�� ������� ���� ����� ������������ ������ ������� ';
-				$err='�� ������� ���� ����� ������������ ������ �������';
-				return $err;
-			}
-				
-			if($itm['magic_chance'] > 0 && $itm['magic_chance'] < 100) {
-			  $itm['magic_chance'] += floor($u->stats['s5']*3);
-			  if($itm['magic_chance'] >= 99) { $itm['magic_chance'] = 99; }
-			}
-            if(isset($bs_is['id'])) {
-              if(in_array($itm['item_id'], $e_magic) || in_array($itm['item_id'], $c_magic)) {
-                $itm['magic_chance'] += $bs_is['users'];
-                if($itm['magic_chance'] >= 99) { $itm['magic_chance'] = 99; }
-              }
+            if ($itm['group'] == 1) {
+                //Группа предметов
+                if ($u->itemsX($itm['id']) > 1) {
+                    //вытаскиваем предмет из группы
+                    $u->unstack($itm['id'], 1);
+                }
             }
 
-			if($itm['iznosNOW'] >= $itm['iznosMAX']) {
-				$u->error = '�� �������� �������...';
-			}elseif( $st['useOnlyInBattle'] == 1 && $u->info['battle'] == 0 ) {
-				//����� ������������ ������ � ��������
-				$u->error = '����� ������������ ������ � ��������';
-			}elseif( $u->info['battle'] > 0 && $itm['btl_zd'] > 0 ) {
-				//����� ������������ ������ � ��������
-				$u->error = '�������� ������������� ��� '.$itm['btl_zd'].' �����';
-			}elseif( $st['useOnlyInBattle'] == 1 && $u->info['battle'] > 0 && $u->stats['hpNow'] < 1 ) {
-				//����� ������������ ������ � ��������
-				$u->error = '�� �������, ������ ������������ �������� � ������';
-			} elseif($itm['magic_chance'] > 0 && rand(0, 100) > $itm['magic_chance']) {
+            $st = $u->lookStats($itm['data']);
+
+            if (isset($st['tr_lvl']) && $st['tr_lvl'] > $u->info['level']) {
+                $u->error = 'Вы слишком малы чтобы использовать данный предмет ';
+                $err = 'Вы слишком малы чтобы использовать данный предмет';
+                return $err;
+            }
+
+            if ($itm['magic_chance'] > 0 && $itm['magic_chance'] < 100) {
+                $itm['magic_chance'] += floor($u->stats['s5'] * 3);
+                if ($itm['magic_chance'] >= 99) {
+                    $itm['magic_chance'] = 99;
+                }
+            }
+            if (isset($bs_is['id'])) {
+                if (in_array($itm['item_id'], $e_magic) || in_array($itm['item_id'], $c_magic)) {
+                    $itm['magic_chance'] += $bs_is['users'];
+                    if ($itm['magic_chance'] >= 99) {
+                        $itm['magic_chance'] = 99;
+                    }
+                }
+            }
+
+            if ($itm['iznosNOW'] >= $itm['iznosMAX']) {
+                $u->error = 'Не осталось зарядов...';
+            } elseif ($st['useOnlyInBattle'] == 1 && $u->info['battle'] == 0) {
+                //Можно использовать только в поединке
+                $u->error = 'Можно использовать только в поединке';
+            } elseif ($u->info['battle'] > 0 && $itm['btl_zd'] > 0) {
+                //Можно использовать только в поединке
+                $u->error = 'Задержка использования еще ' . $itm['btl_zd'] . ' ходов';
+            } elseif ($st['useOnlyInBattle'] == 1 && $u->info['battle'] > 0 && $u->stats['hpNow'] < 1) {
+                //Можно использовать только в поединке
+                $u->error = 'Вы погибли, нельзя пользоваться свитками и магией';
+            } elseif ($itm['magic_chance'] > 0 && rand(0, 100) > $itm['magic_chance']) {
 
 
-				$u->error = '���� &quot;'.$itm['name'].'&quot; ������';
-				$itm['iznosNOW']++;
-				if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-				  mysql_query('UPDATE `items_users` SET `inGroup` = 0, `delete` = 0 WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-				mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-				$u->addDelo(1, $u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;:<B>(���� ������)</b> �������� ����������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);				
-			
-            } elseif(isset($st['usefromfile'])) {
-				
-				//���������� ��������
-				$st = $u->lookStats($itm['data']);
-				if( isset($st['zazuby']) && $_GET['login'] != $u->info['login'] ) {
-					//unset($st['useOnLogin']);
-					$_GET['login'] = $u->info['login'];
-				}
-				$jl = $_GET['login'];
-				$_GET['login'] = urlencode($_GET['login']);
-				//���������� �� ��������� (��� ����� ����)	
-				$_GET['login'] = str_replace('%',' ',$_GET['login']);
-				$_GET['login'] = str_replace('25','',$_GET['login']);
-				$jl = str_replace('%',' ',$jl);
-				$jl = str_replace('25','',$jl);
-				
-				if(isset($st['useOnLogin']) && $st['useOnLogin']==1) {
-					if( $u->info['inTurnir'] == 0 ) {
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}
-					}else{
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}
-					}
-				}
-				
-				if($st['usefromfile']==1) {
-					if($u->info['battle'] > 0) {
-						if(file_exists('../../_incl_data/class/magic/'.$itm['magic_inci'].'.php'))
-						{
-							require('../../_incl_data/class/magic/'.$itm['magic_inci'].'.php');
-						}else{
-							$u->error = '�� ������� ������������ ('.$itm['magic_inci'].'.b)';
-						}
-					}else{
-						if(file_exists('_incl_data/class/magic/'.$itm['magic_inci'].'.php'))
-						{
-							require('_incl_data/class/magic/'.$itm['magic_inci'].'.php');
-						}else{
-							$u->error = '�� ������� ������������ ('.$itm['magic_inci'].')';
-						}
-					}
-				}else{
-					if($itm['useInBattle'] > 0) {
-						if(file_exists('../../_incl_data/class/priems/'.$st['usefromfile'].'.php'))
-						{
-							require('../../_incl_data/class/priems/'.$st['usefromfile'].'.php');
-						}else{
-							$u->error = '�� ������� ������������ ('.$st['usefromfile'].'.)';
-						}
-					}else{
-						$u->error = '�� ������� ������������ ('.$st['usefromfile'].'!)';
-					}
-				}
-			}elseif($itm['type']==30)
-			{
-				//��������
-				$goodUse = 0; $use = array();
-				if(isset($st['moment']))
-				{
-					//������� ������������ ����������� (�������������� �� ��� ��)
-					if(isset($st['moment_hp'])) {
-						//��������������� ��������
-						if($u->stats['hpNow']<$u->stats['hpAll']) {
-							$goodUse = 1;
-							$use['moment_hp'] = $st['moment_hp'];
-							
-							if($u->stats['hpNow']+$use['moment_hp']>$u->stats['hpAll']) {
-								$use['moment_hp'] = ceil($u->stats['hpAll']-$u->stats['hpNow']);							
-							}
-							
-							$u->error .= '�� ������������ '.($use['moment_hp']).' HP.<br>';
-						}else{
-							$u->error = '���� �������� � ��� ��������� �������������<br>';
-							$goodUse = 0;
-						}
-					}	
-					
-					if(isset($st['moment_mp'])) {
-						//��������������� ��������
-						if($u->stats['mpNow'] < $u->stats['mpAll']) {
-							$goodUse = 1;
-							$use['moment_mp'] = $st['moment_mp'];
-							if($u->stats['mpNow']+$use['moment_mp'] > $u->stats['mpAll']) {
-							  $use['moment_mp'] = ceil($u->stats['mpAll']-$u->stats['mpNow']);							
-							}
-							$u->error .= '�� ������������ '.($use['moment_mp']).' MP.<br />';
-						} else {
-							$u->error = '���� ����� � ��� ��������� �������������';
-							$goodUse = 0;
-						}
-					}					
-					
-					if($itm['iznosNOW']>=$itm['iznosMAX'])
-					{
-						$u->error = '������� ��� ��������...';
-						$goodUse = 0;
-					}
-						
-					if(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-					{
-						$goodUse = 0;
-						$u->error = '�������� �� ����� ������������ ������ �������';
-					}
-								
-					//������� ������ � ��
-					if($goodUse==1)
-					{
-						$itm['iznosNOW']++;
-						$upd = mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-						if($upd) {
-							$u->stats['hpNow'] += $use['moment_hp'];
-							$u->info['hpNow'] += $use['moment_hp'];
-                            $u->stats['mpNow'] += $use['moment_mp'];
-							$u->info['mpNow'] += $use['moment_mp'];
-							if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-								mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->info['hpNow'].'", `mpNow` = "'.$u->info['mpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ������� &quot;'.$itm['name'].'&quot; (+'.$use['moment_hp'].' HP) [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-							$this->youuse++;
-							$u->error = '�� ������� ������������ ������� &quot;'.$itm['name'].'&quot;<br>'.$u->error.'';
-						}else{
-							$u->error = '�� ������� ������������ �������...';
-						}
-					}
-				}else{
-					//�������� � ��������������� ��������
-					$goodUse = 1;
-					if(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-					{
-						$goodUse = 0;
-						$u->error = '�������� �� ����� ������������ ������ �������';
-					}
-					if($goodUse==1)
-					{
-						$upd1 = 1;
-						$upd2 = 1;
-						//��������� ������ ���������
-						if(isset($st['onlyOne']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						if(isset($st['oneType']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `overType` = "'.$itm['overType'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						if($goodUse == 1)
-						{
-							$us = $this->add_eff($u->info['id'],$itm['magic_inc']);
-							if($us[0]==1)
-							{
-								$itm['iznosNOW']++;
-								if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-									mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-								}
-								mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-								$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-								$this->youuse++;
-								$u->error = '�� ������� ������������ ������� &quot;'.$itm['name'].'&quot;<br>'.$us[1].'';
-							}else{
-								$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-							}
-						}else{
-							$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-						}
-					}
-				}
-				//---------------
-			}elseif($itm['type']==29)
-			{
-				//���������� ��������
-				$st = $u->lookStats($itm['data']);
-				if( isset($st['zazuby']) && $_GET['login'] != $u->info['login'] ) {
-					//unset($st['useOnLogin']);
-					$_GET['login'] = $u->info['login'];
-				}
-				$jl = $_GET['login'];
-				$_GET['login'] = urlencode($_GET['login']);
-				//���������� �� ��������� (��� ����� ����)	
-				$_GET['login'] = str_replace('%',' ',$_GET['login']);
-				$_GET['login'] = str_replace('25','',$_GET['login']);
-				$jl = str_replace('%',' ',$jl);
-				$jl = str_replace('25','',$jl);
-				if($itm['magic_inci']=='nextuplvl') {
-					if($itm['iznosNOW']>=$itm['iznosMAX']) {
-						$u->error = '������ ��� ��������...';
-					}elseif( $u->info['battle'] > 0 ) {
-						//
-						$u->error = '�� �� ������ ������������ ������ � ���';
-					}else{
-						if( $u->info['twink'] > 0 ) {
-							$u->error = '����������� ������ �� �������� ���������';
-						}else{
-							mysql_query('UPDATE `users` SET `stopexp` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `users_twink` SET `stopexp` = 0 WHERE `uid` = "'.$u->info['id'].'" LIMIT 1');
-							$itm['iznosNOW']++;
-							if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-								mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-						}
-					}
-				}elseif(isset($st['useOnLogin']) && $st['useOnLogin']==1)
-				{
-					if( $u->info['inTurnir'] == 0 ) {
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}
-					}else{
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}
-					}
-					if(isset($usr['id']))
-					{
-						//�������� ���������
-						if($itm['iznosNOW']>=$itm['iznosMAX'])
-						{
-							$u->error = '������ ��� ��������...';
-						}elseif($itm['magic_inci']=='snowball')
-						{
-							if( $u->info['battle'] == 0 ) {
-								$usr = mysql_fetch_array(mysql_query('SELECT `st`.`clone`,`u`.`type_pers`,`u`.`bot_id`,`st`.`zv`,`u`.`inTurnir`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`battle` = 0 OR `u`.`battle` = "'.$u->info['battle'].'") AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-							}else{
-								$usr = mysql_fetch_array(mysql_query('SELECT `st`.`clone`,`u`.`type_pers`,`u`.`bot_id`,`st`.`zv`,`u`.`inTurnir`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`battle` = 0 OR `u`.`battle` = "'.$u->info['battle'].'") AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`battle` = "'.$u->info['battle'].'" LIMIT 1'));
-							}
-							if($usr['battle']>0 && $u->info['battle']!=$usr['battle'])
-							{
-								$u->error = '�������� ��������� � ���';
-							}elseif($usr['battle']>0) {
-								//�������� � ��������
-								if($usr['team'] != $u->info['team'] && $usr['hpNow'] > 0) {
-									$txt = 1;
-									
-									//���������
-									if($usr['bot_id'] >= 439 && $usr['bot_id'] <= 460) {
-										$txt = 500;
-									}elseif($usr['bot_id'] == 291 ) {
-										if($usr['hpNow'] < 961) {
-											$txt = 1982;
-										}elseif($usr['hpNow'] > 980 && $usr['hpNow'] < 1981) {
-											$txt = 1982;
-										}
-									}elseif($usr['id'] == 1008 ) {
-										$txt = $u->info['level']*250;
-									}
-									
-									$usr['hpNow'] -= $txt;
-									if($txt<0) {
-										$txt = '+'.$txt;
-									}elseif($txt==0) {
-										$txt = '--';
-									}else{
-										$txt = '-'.$txt;
-									}
-									if($usr['hpNow']<0)
-									{
-										$usr['hpNow'] = 0;
-									}
-									$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $usr['hpNow'];
-											$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-											if(isset($lastHOD['id']))
-											{
-												$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['hpNow']);
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] > $btl->stats[$btl->uids[$usr['id']]]['hpAll']) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $btl->stats[$btl->uids[$usr['id']]]['hpAll'];
-												}
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] < 1) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = 0;
-												}
-												$id_hod = $lastHOD['id_hod'];
-												if($lastHOD['type']!=6)
-												{
-													$id_hod++;
-												}
-												mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-												$itm['iznosNOW']++;
-												if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-													mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-												}
-												mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-												$txt = '<font color=#006699>'.$txt.'</font>';
-												if($u->info['sex']==1) {
-														$txt = '������ {u1} ������� ����� ����� � {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-												}else{
-														$txt = '������ {u1} ������ ����� ����� � {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-												}
-												mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-											}
-									
-									unset($txt);
-								}else{
-									$u->error = '������ ������������ �� ������� ���������';
-								}
-							}elseif($u->info['dnow']!=$usr['dnow'])
-							{
-								$u->error = '�������� ��������� � ������ �������';
-							}elseif($usr['id']==$u->info['id'])
-							{
-								$u->error = '������ �������� � ������ ����';
-							}elseif($usr['online']<time()-520 && $usr['battle'] == 0 && $usr['bot'] == 0)
-							{
-								$u->error = '�������� ��������� � �������� ���� ;)';
-							}elseif($usr['room']!=$u->info['room'])
-							{
-								$u->error = '�������� ��������� � ������ �������';
-							}elseif($usr['admin']>0 && $u->info['admin']==0)
-							{
-								$u->error = '������ �������� � �������';
-							}else{
-								$usr['hpNow'] -= 1000;
-								if($usr['hpNow']<0)
-								{
-									$usr['hpNow'] = 0;
-								}
-								$upd = mysql_query('UPDATE `stats` SET `hpNow` = "'.$usr['hpNow'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-								if($upd)
-								{
-									$sx = '��'; $sx2 = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '��'; $sx2 = '�';
-									}
-									$itm['iznosNOW']++;
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									$urs_st = $u->getStats($usr['id']);
-									$rtxt = '[img[items/snowball1.gif]] ����'.$sx.' &quot;'.$u->info['login'].'&quot; ������'.$sx2.' ����� ����� � &quot;'.$usr['login'].'&quot;. <font color=red><b>-1000</b></font> ['.floor($urs_st['hpNow']).'/'.$urs_st['hpAll'].']';
-									mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-									unset($sx,$sx2);
-								}else{
-									$u->error = '�� ������� ������ ������...';
-								}								
-							}
-						}elseif($itm['magic_inci']=='atack')
-						{	
-											//�������� ���������
-						$usta = $u->getStats($usr['id'],0); // ����� ����
-						$rgd = $u->regen($usr['id'],$usta,1);
-						$usta['hpNow'] = $rgd['hpNow'];
-						$usta['mpNow'] = $rgd['mpNow'];
-		                $minHp = floor($usta['hpAll']/100*33); // ����������� ����� �������� ���� ��� ������� ����� �������
-						$batlatest = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$usr['battle'].'" AND `team_win` = -1 LIMIT 1'));
-						$test = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_last` WHERE `uid` = "'.$u->info['id'].'" AND `battle_id` = "'.$usr['battle'].'" LIMIT 1'));
-                        if(isset($test['id'])) {
-                        	echo '������ ���������, �� ��� ���� � ���� ��������.';
-							}elseif( time() - $usr['timereg'] < 86400*10 )
-							{
-								$u->error = '�������� �� �������� �����������! ������ ������ ����������� � ��������� ���� � �������...';
-							}elseif($usr['atack']==1 || $usr['atack'] > time())
-							{
-								$u->error = '�� ��������� ����� ���������, ��������� ����� ��...';
-							}elseif($u->info['dnow']!=$usr['dnow'])
-							{
-								$u->error = '�������� ��������� � ������ ������� (������)';
-							}elseif($usr['inTurnirnew'] > 0)
-							{
-								$u->error = '�������� ��������� ������� � �������';
-							}elseif($u->info['battle']>0)
-							{
-								$u->error = '�� ��� ���������� � ���';
-							}elseif($usr['id']==$u->info['id'])
-							{
-								$u->error = '������ �������� �� ������ ����';
-							}elseif($usr['bot']==2) {
-								$u->error = '�� �������� ������� �� ���� '.$usr['login'].'';
-							}elseif($usr['online']<time()-120)
-							{
-								$u->error = '�������� �� � ����';
-							}elseif($usr['admin']==1)
-							{
-								$u->error = '�������� ����������...';
-							}elseif($usr['room']!=$u->info['room'] && $u->info['battle'] != $usr['battle'] && $u->info['battle'] > 0)
-							{
-								$u->error = '�������� ��������� � ������ �������!';
-							}elseif($usr['room']!=$u->info['room'])
-							{
-								$u->error = '�������� ��������� � ������ �������';
-							}elseif($batlatest['noatack']==1)
-							{
-								$u->error = '�������� ������� ������! �� �� ������ ���������!';
-							}elseif($minHp>$usta['hpNow'] && !isset($batlatest['id']))
-							{
-							//���� ��
-								$u->error = '�������� ������� ���� ('.floor($usta['hpNow']).'HP)';
-							}elseif($u->info['noatack']!=0)
-							{
-							//���� ��
-								$u->error = '� ���� ������� ��������� ���������.';
-							}else{
-								
-								if($usr['type_pers'] > 0) {
-									$kroww=$usr['type_pers'];
-								}elseif($itm['item_id']=='2391'){
-									$kroww=99;
-								}elseif($itm['item_id']=='11117'){
-									$kroww=222;
-								}else{
-									$kroww=0;
-								}
-								
-								$kulak = 0;
-								if( $itm['item_id'] == 4404 ) {
-									$kulak = 1;
-								}
-			                    if($u->info['inTurnir'] > 0) { $bsi = $u->info['inTurnir']; } else { $bsi = 0; }
-								$atc = $this->atackUser($u->info['id'],$usr['id'],$usr['team'],$usr['battle'], 0, $kroww, $kulak, $bsi);
-								if($atc > 0)
-								{
-									//���������� �������� � ���
-									$sx = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '�';
-									}
-									$itm['iznosNOW']++;
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									$rtxt = '[img[items/pal_button8.gif]] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ����� ��������� �� ��������� &quot;'.$usr['login'].'&quot;.';
-									mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','11','0','1')");	
-									//������, ��������� �����
-									
-									die('<script>top.frames[\'main\'].location = "main.php";</script>');
-								}else{
-									if( $u->error == '' ) {
-										$u->error = '�� ������� ������� �� ���������...';
-									}
-								}
-							}
-						 }elseif($itm['magic_inci']=='cureHP') {
-							//����� ��,MP
-								$po = $u->lookStats($itm['data']);
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									$bu = mysql_fetch_array(mysql_query('SELECT * FROM `spells` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
-									if(isset($bu['id'])) {
-										$u->error = '������ ������������ ������ ������ ���...';
-									}elseif( $usr['battle']!=$u->info['battle'] ) {
-										$u->error = '��������� ������������, �������� � ������ ��������...';
-									}elseif( $usr['team']!=$u->info['team'] ) {
-										$u->error = '��������� ������������ �� ����������...';
-									}elseif( $usr['hpNow'] < 1 ) {
-										$u->error = '��������� ������������ �� �������...';
-									}elseif( $u->info['hpNow'] < 1 ) {
-										$u->error = '��������� ������������, �� �������...';
-									}elseif($btl->info['noeff'] > 0 ) {
-										$u->error = '������ �� ������������� ������� ��������������';
-									}elseif( $po['magic_hpNow'] < 1 && $po['magic_mpNow'] < 1 ) {
-										$u->error = '��������� ������������, � ���������� ������ ��� �����...';
-									}elseif(($usr['battle']==$u->info['battle'] && ($u->info['team']==$usr['team'] && ($po['magic_hpNow']>0 || $po['magic_mpNow']>0))) && $usr['hpNow']>=1 && $u->info['hpNow']>=1) {
-										//�������
-										if(isset($po['magic_hpNow'])) {
-											
-											mysql_query('INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES (
-												"'.$u->info['battle'].'","'.$u->info['id'].'","'.time().'","'.$itm['item_id'].'","'.$itm['name'].'","1"
-											)');
-											
-											$txt = $po['magic_hpNow'];
-											
-											if($btl->stats[$btl->uids[$usr['id']]]['hpAll']-$btl->stats[$btl->uids[$usr['id']]]['hpNow'] < $txt) {
-												$txt = floor($btl->stats[$btl->uids[$usr['id']]]['hpAll']-$btl->stats[$btl->uids[$usr['id']]]['hpNow']);
-											}
-                                            //653 - 400
-                                            //253
-											//453 1306
-											$gdhh = round($txt/$btl->stats[$btl->uids[$usr['id']]]['hpAll']*5,2);
-											$gdhd = round($gdhh/$btl->users[$btl->uids[$usr['id']]]['tactic7']*100);
-											if($gdhd > 100) {
-											  $txt = floor($txt/100*$gdhd);
-											}
-											
-											if($btl->users[$btl->uids[$usr['id']]]['tactic7'] >= 1) {
-												if($txt > 0) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] += $txt;
-													$btl->users[$btl->uids[$usr['id']]]['tactic7'] -= $gdhh;
-													if($btl->users[$btl->uids[$usr['id']]]['tactic7'] < 0) {
-														$btl->users[$btl->uids[$usr['id']]]['tactic7'] = 0;
-													}
-												}
-												mysql_query('UPDATE `stats` SET `last_hp` = "'.$txt.'", `hpNow` = `hpNow` + '.$po['magic_hpNow'].', `tactic7` = "'.$btl->users[$btl->uids[$usr['id']]]['tactic7'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-												if($txt > 0) {
-													$txt = '+'.$txt;
-												} elseif($txt == 0){
-													$txt = '--';
-												}
-											} else {
-												$txt = '--';
-											}
-											$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-											if(isset($lastHOD['id']))
-											{
-												$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['hpNow']);
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] > $btl->stats[$btl->uids[$usr['id']]]['hpAll']) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $btl->stats[$btl->uids[$usr['id']]]['hpAll'];
-												}
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] < 1) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = 0;
-												}
-												$id_hod = $lastHOD['id_hod'];
-												if($lastHOD['type'] != 6)
-												{
-													$id_hod++;
-												}
-												$txt = '<font color=#006699>'.$txt.'</font>';
-												if($u->info['id']==$usr['id']) {
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}
-												}else{
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}
-												}
-												mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-											}									
-										}
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										
-										// ��������� � ��� ���
-										$sx = '��'; $sx2 = '';
-										if($u->info['sex']==1)
-										{
-											$sx = '��'; $sx2 = '�';
-										}
-										$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';										
-									}else{
-										$u->error = '������ ������������ �� ������� ���������';
-									}
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-									//�������
-									if(isset($po['magic_hpNow'])) {
-										mysql_query('UPDATE `stats` SET `hpNow` = `hpNow` + '.$po['magic_hpNow'].' WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-									}									
-									
-									$itm['iznosNOW']++;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									
-									// ��������� � ���
-									$sx = '��'; $sx2 = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '��'; $sx2 = '�';
-									}
-									$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';
-									$rtxt = '[img[items/'.$itm['img'].']] �������� &quot;'.$u->info['login'].'&quot; �����������'.$sx2.' &quot;'.$itm['name'].'&quot; �� &quot;'.$usr['login'].'&quot;.';
-					                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");
-								}
-						}elseif($itm['magic_inci']=='cureMP') {
-							//����� ��,MP
-								$po = $u->lookStats($itm['data']);
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									$bu = mysql_fetch_array(mysql_query('SELECT * FROM `spells` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
-									if(isset($bu['id'])) {
-										$u->error = '������ ������������ ������ ������ ���...';
-									}elseif($btl->info['noeff'] > 0 ) {
-									$u->error = '������ �� ������������� ������� ��������������';
-									}elseif(($usr['battle']==$u->info['battle'] && ($u->info['team']==$usr['team'] && ($po['magic_hpNow']>0 || $po['magic_mpNow']>0))) && $usr['hpNow']>1 && $u->info['hpNow']>=1) {
-										//�������
-										if(isset($po['magic_mpNow'])) {
-											
-											mysql_query('INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES (
-												"'.$u->info['battle'].'","'.$u->info['id'].'","'.time().'","'.$itm['item_id'].'","'.$itm['name'].'","1"
-											)');
-											
-											$txt = $po['magic_mpNow'];
-											
-											if($btl->stats[$btl->uids[$usr['id']]]['mpAll']-$btl->stats[$btl->uids[$usr['id']]]['mpNow'] < $txt) {
-												$txt = floor($btl->stats[$btl->uids[$usr['id']]]['mpAll']-$btl->stats[$btl->uids[$usr['id']]]['mpNow']);
-											}
-											
-											$gdhh = round($txt/$btl->stats[$btl->uids[$usr['id']]]['mpAll']*5);
-											$gdhd = round($gdhh/$btl->users[$btl->uids[$usr['id']]]['tactic7']*100);
-											if( $gdhd > 100 ) {
-												$txt = floor($txt/100*$gdhd);
-											}
-											
-											if($btl->users[$btl->uids[$usr['id']]]['tactic7'] >= 1) { // ��������� >= 1 , ���� ������� ���
-												if($txt > 0) {
-													$btl->stats[$btl->uids[$usr['id']]]['mpNow'] += $txt;
-													$btl->users[$btl->uids[$usr['id']]]['tactic7'] -= $gdhh;
-													if($btl->users[$btl->uids[$usr['id']]]['tactic7'] < 0) {
-														$btl->users[$btl->uids[$usr['id']]]['tactic7'] = 0;
-													}
-												}
-												mysql_query('UPDATE `stats` SET `mpNow` = `mpNow` + '.$txt.', `tactic7` = "'.$btl->users[$btl->uids[$usr['id']]]['tactic7'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-												if($txt>0) {
-													$txt = '+'.$txt;
-												}elseif($txt==0){
-													$txt = '--';
-												}
-											} else {
-												$txt = '--';
-											}
-											$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-											if(isset($lastHOD['id']))
-											{
-												$btl->stats[$btl->uids[$usr['id']]]['mpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['mpNow']);
-												if($btl->stats[$btl->uids[$usr['id']]]['mpNow'] > $btl->stats[$btl->uids[$usr['id']]]['mpAll']) {
-													$btl->stats[$btl->uids[$usr['id']]]['mpNow'] = $btl->stats[$btl->uids[$usr['id']]]['mpAll'];
-												}
-												if($btl->stats[$btl->uids[$usr['id']]]['mpNow']<1) {
-													$btl->stats[$btl->uids[$usr['id']]]['mpNow'] = 0;
-												}
-												$id_hod = $lastHOD['id_hod'];
-												if($lastHOD['type']!=6)
-												{
-													$id_hod++;
-												}
-												$txt = '<font color=#006699>'.$txt.'</font>';
-												if($u->info['id']==$usr['id']) {
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}
-												}else{
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}
-												}
-												mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-											}									
-										}
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										
-										// ��������� � ��� ���
-										$sx = '��'; $sx2 = '';
-										if($u->info['sex']==1)
-										{
-											$sx = '��'; $sx2 = '�';
-										}
-										$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';										
-									}else{
-										$u->error = '������ ������������ �� ������� ���������';
-									}
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-									//�������
-									if(isset($po['magic_mpNow'])) {
-										mysql_query('UPDATE `stats` SET `mpNow` = `mpNow` + '.$po['magic_mpNow'].' WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-									}									
-									
-									$itm['iznosNOW']++;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									
-									// ��������� � ���
-									$sx = '��'; $sx2 = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '��'; $sx2 = '�';
-									}
-									$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';
-									$rtxt = '[img[items/'.$itm['img'].']] �������� &quot;'.$u->info['login'].'&quot; �����������'.$sx2.' &quot;'.$itm['name'].'&quot; �� &quot;'.$usr['login'].'&quot;.';
-					                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");
-								}
-						}elseif($itm['magic_inci']=='lech_1' or $itm['magic_inci']=='lech_2' or $itm['magic_inci']=='lech_3'){
-						            
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-							
-									$travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="4" and `delete`="0" ORDER BY `v1` DESC LIMIT 1'));
-									//$type_lechenie = $travm['v1'];
-									$itm['magic_inci'] = 'lech_'.$travm['v1'];
-									if($itm['magic_inci']=='lech_1'){
-										$type_lechenie=1; // ��� ������ ������ �����
-										$text_msg='&quot;������ ������&quot;';
-										$text_msg2 = '������';
-									}elseif($itm['magic_inci']=='lech_2'){
-										$type_lechenie=2; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}elseif($itm['magic_inci']=='lech_3'){
-										$type_lechenie=3; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}
-									if($travm){
-										$lech_aa = array( 0 , 2 , 3 , 4 );
-										$travm_cep = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="335" and `delete`="0" and `v1`="'.$type_lechenie.'" LIMIT 1'));
-										if( $travm_cep['timeUse'] < time() - 360 ) {
-											unset($travm_cep);
-										}
-										
-										$cep_users = explode(',',$travm_cep['data']);
-										$it_i = 0;
-										$it_no = 0;
-										$it_users = '';
-										while( $it_i < count($cep_users) ) {
-											$it_u = $cep_users[$it_i];
-											if( $it_u == $u->info['id'] ) {
-												$it_no = 1;
-											}
-											$it_u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`room` FROM `users` WHERE `id` = "'.$it_u.'" LIMIT 1'));
-											if( isset($it_u['id']) ) {
-												$it_users .= ', '.$it_u['login'].'';
-											}
-											$it_i++;
-										}
-										$it_u = ltrim($it_u,', ');
-										
-										$lech_co = round($travm_cep['x']+1);
-										if( $it_no == 1 ) {
-											$u->error = '�� ��� ���� �� �������';
-										}elseif( $lech_co >= $lech_aa[$type_lechenie] ) {
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											
-											$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
+                $u->error = 'Каст &quot;' . $itm['name'] . '&quot; сгорел';
+                $itm['iznosNOW']++;
+                if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                    mysql_query('UPDATE `items_users` SET `inGroup` = 0, `delete` = 0 WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                }
+                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                $u->addDelo(1, $u->info['id'], '&quot;<font color="maroon">System.inventory</font>&quot;:<B>(КАСТ СГОРЕЛ)</b> Персонаж использовал &quot;' . $itm['name'] . '&quot; (' . $us[1] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0);
 
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1');
-									        
-											// ��������� � ���
-											$u->error = '�������� ������� �� '.$text_msg.'.';
-														$rtxt = '[img[items/cure'.$type_lechenie.'.gif]] ������ &quot;'.$u->info['login'].$it_users.'&quot; �������� �� '.$text_msg.' ������ &quot;'.$usr['login'].'&quot;.';
-					                                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-										}else{
-											if( isset($travm_cep['id']) ) {
-												$travm_cep['x']++;
-												$u->error = '�� �������������� � ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����)';
-												mysql_query('UPDATE `eff_users` SET `x` = "'.$travm_cep['x'].'"
-												,`data` = "'.$travm_cep['data'].','.$u->info['id'].'"
-												WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-											}else{
-												$u->error = '�� ������� ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����), � ��������� ������� ���� 5 �����, ����� ��������� ����������';
-												mysql_query('INSERT INTO `eff_users`
-												(
-													`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x`
-												) VALUES (
-													"335","'.$usr['id'].'","���� ���������","'.$u->info['id'].'","28","'.time().'","'.$u->info['id'].'","'.$type_lechenie.'","1"
-												)');
-											}
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											// ��������� � ���
-											$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
+            } elseif (isset($st['usefromfile'])) {
 
-										}
-									}else{
-										$u->error = '�������� �� ����� ������ ������.';
-									}
-								
-								}
+                //используем заклятие
+                $st = $u->lookStats($itm['data']);
+                if (isset($st['zazuby']) && $_GET['login'] != $u->info['login']) {
+                    //unset($st['useOnLogin']);
+                    $_GET['login'] = $u->info['login'];
+                }
+                $jl = $_GET['login'];
+                $_GET['login'] = urlencode($_GET['login']);
+                //используем на персонажа (все кроме себя)
+                $_GET['login'] = str_replace('%', ' ', $_GET['login']);
+                $_GET['login'] = str_replace('25', '', $_GET['login']);
+                $jl = str_replace('%', ' ', $jl);
+                $jl = str_replace('25', '', $jl);
 
-						        
-						}elseif($itm['magic_inci']=='lech_free_1' or $itm['magic_inci']=='lech_free_2' or $itm['magic_inci']=='lech_free_3'){
-						            
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-							
-									$travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="4" and `delete`="0" ORDER BY `v1` DESC LIMIT 1'));
-									//$type_lechenie = $travm['v1'];
-									//$itm['magic_inci'] = 'lech_free_'.$travm['v1'];
-									if($itm['magic_inci']=='lech_free_1'){
-										$type_lechenie=1; // ��� ������ ������ �����
-										$text_msg='&quot;������ ������&quot;';
-										$text_msg2 = '������';
-									}elseif($itm['magic_inci']=='lech_free_2'){
-										$type_lechenie=2; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}elseif($itm['magic_inci']=='lech_free_3'){
-										$type_lechenie=3; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}
-									if($travm['v1'] != $type_lechenie) {
-										$u->error = '������������ ������ ��� ������ ������.';
-									}elseif($travm['id']){
-										$lech_aa = array( 0 , 0 , 0 , 0 );
-										$travm_cep = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="335" and `delete`="0" and `v1`="'.$type_lechenie.'" LIMIT 1'));
-										if( $travm_cep['timeUse'] < time() - 360 ) {
-											unset($travm_cep);
-										}
-										
-										$cep_users = explode(',',$travm_cep['data']);
-										$it_i = 0;
-										$it_no = 0;
-										$it_users = '';
-										while( $it_i < count($cep_users) ) {
-											$it_u = $cep_users[$it_i];
-											if( $it_u == $u->info['id'] ) {
-												$it_no = 1;
-											}
-											$it_u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`room` FROM `users` WHERE `id` = "'.$it_u.'" LIMIT 1'));
-											if( isset($it_u['id']) ) {
-												$it_users .= ', '.$it_u['login'].'';
-											}
-											$it_i++;
-										}
-										$it_u = ltrim($it_u,', ');
-										
-										$lech_co = round($travm_cep['x']+1);
-										if( $it_no == 1 ) {
-											$u->error = '�� ��� ���� �� �������';
-										}elseif( $lech_co >= $lech_aa[$type_lechenie] ) {
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											
-											//$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
+                if (isset($st['useOnLogin']) && $st['useOnLogin'] == 1) {
+                    if ($u->info['inTurnir'] == 0) {
+                        if ($u->info['battle'] > 0) {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND `u`.`battle` = "' . $u->info['battle'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") LIMIT 1'));
+                        } else {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") LIMIT 1'));
+                        }
+                    } else {
+                        if ($u->info['battle'] > 0) {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND `u`.`battle` = "' . $u->info['battle'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") AND `u`.`inTurnir` > 0 LIMIT 1'));
+                        } else {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") AND `u`.`inTurnir` > 0 LIMIT 1'));
+                        }
+                    }
+                }
 
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1');
-									        
-											// ��������� � ���
-											$u->error = '�������� ������� �� '.$text_msg.'.';
-														$rtxt = '[img[items/cure'.$type_lechenie.'.gif]] ������ &quot;'.$u->info['login'].$it_users.'&quot; �������� �� '.$text_msg.' ������ &quot;'.$usr['login'].'&quot;.';
-					                                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-										}else{
-											if( isset($travm_cep['id']) ) {
-												$travm_cep['x']++;
-												$u->error = '�� �������������� � ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����)';
-												mysql_query('UPDATE `eff_users` SET `x` = "'.$travm_cep['x'].'"
-												,`data` = "'.$travm_cep['data'].','.$u->info['id'].'"
-												WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-											}else{
-												$u->error = '�� ������� ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����), � ��������� ������� ���� 5 �����, ����� ��������� ����������';
-												mysql_query('INSERT INTO `eff_users`
-												(
-													`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x`
-												) VALUES (
-													"335","'.$usr['id'].'","���� ���������","'.$u->info['id'].'","28","'.time().'","'.$u->info['id'].'","'.$type_lechenie.'","1"
-												)');
-											}
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											// ��������� � ���
-											$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
+                if ($st['usefromfile'] == 1) {
+                    if ($u->info['battle'] > 0) {
+                        if (file_exists('../../_incl_data/class/magic/' . $itm['magic_inci'] . '.php')) {
+                            require('../../_incl_data/class/magic/' . $itm['magic_inci'] . '.php');
+                        } else {
+                            $u->error = 'Не удалось использовать (' . $itm['magic_inci'] . '.b)';
+                        }
+                    } else {
+                        if (file_exists('_incl_data/class/magic/' . $itm['magic_inci'] . '.php')) {
+                            require('_incl_data/class/magic/' . $itm['magic_inci'] . '.php');
+                        } else {
+                            $u->error = 'Не удалось использовать (' . $itm['magic_inci'] . ')';
+                        }
+                    }
+                } else {
+                    if ($itm['useInBattle'] > 0) {
+                        if (file_exists('../../_incl_data/class/priems/' . $st['usefromfile'] . '.php')) {
+                            require('../../_incl_data/class/priems/' . $st['usefromfile'] . '.php');
+                        } else {
+                            $u->error = 'Не удалось использовать (' . $st['usefromfile'] . '.)';
+                        }
+                    } else {
+                        $u->error = 'Не удалось использовать (' . $st['usefromfile'] . '!)';
+                    }
+                }
+            } elseif ($itm['type'] == 30) {
+                //Эликсиры
+                $goodUse = 0;
+                $use = [];
+                if (isset($st['moment'])) {
+                    //Эликсир используется моментально (Восстановление НР или МР)
+                    if (isset($st['moment_hp'])) {
+                        //Восстанавливаем здоровье
+                        if ($u->stats['hpNow'] < $u->stats['hpAll']) {
+                            $goodUse = 1;
+                            $use['moment_hp'] = $st['moment_hp'];
 
-										}
-									}else{
-										$u->error = '�������� �� ����� ������ ������.';
-									}
-								
-								}
-
-						        
-						}else{
-							if( $u->info['id'] != $usr['id'] ) {
-								$lsct = mysql_fetch_array(mysql_query('SELECT `id_eff` FROM `eff_users` WHERE `uid` = "'.$usr['id'].'" AND `delete` = "0" AND (`overType` = "'.$itm['overType'].'" OR (`id_eff` = "'.$itm['magic_inc'].'" AND "'.(0+$st['onlyOne']).'" != "0")) LIMIT 1'));
-								$lsct['good'] = 1;
-								//�����
-								if( $lsct['id_eff'] >= 291 && $lsct['id_eff'] <= 296 && $itm['magic_inc'] >= 291 && $itm['magic_inc'] <= 296 ) {
-									if( $lsct['id_eff'] > $itm['magic_inc'] ) {
-										$u->error = '�� ��������� ���� ���� ����� �����!';
-										$lsct['good'] = 0;
-									}
-								}
-							}else{
-								$lsct['good'] = 1;
-							}
-							//������ ���������� �� ���������
-							if($lsct['good'] == 0) {
-								
-							} elseif($u->info['dnow'] != $usr['dnow']) {
-							  $u->error = '�������� ��������� � ������ ������� [������]';
-							}elseif($usr['room']==217 || $usr['room']==218 || $usr['room']==219) {
-	                         $u->error = '�������� '.$u->microLogin($usr['id'],1).' ��������� � ���������!';
-                            } elseif($usr['inTurnir'] != 0 && ($u->info['inTurnir'] != $usr['inTurnir'])) {
-							  $u->error = '��������� � ������� ����� ������...';
-							} elseif($usr['id']==$u->info['id'] && isset($st['useOnlyUser'])) {
-								$u->error = '������ ������������ ��� �������� �� ������ ����';
-							}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-							{
-								$u->error = '�������� ��������� � �������� ���� ;)';
-							}elseif($usr['room']!=$u->info['room'] && $usr['battle'] != $u->info['battle'] && $u->info['battle'] > 0)
-							{
-								$u->error = '�������� ��������� � ������ ������� ['.$usr['room'].' '.$u->info['room'].']';
-							}elseif($usr['admin']>0 && $u->info['admin']==0 && isset($st['useNoAdmin']))
-							{
-								$u->error = '������ ������������ ������ �������� �� �������';
-							}elseif($usr['battle']>0 && $u->info['battle']!=$usr['battle'])
-							{
-								$u->error = '�������� ��������� � ���';
-							}elseif(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-							{
-								$u->error = '�������� �� ����� ������������ ������ ��������';
-							}else{
-								//��������� ������ ���������
-								$goodUse = 1;
-								//
-								$tpsm = 0;
-								if( $itm['useInBattle'] == 0 && $usr['battle'] > 0 ) {
-									//������ �����
-									$goodUse = 0;
-								}else{
-									if( $usr['battle'] > 0 ) {
-										global $btl;
-										if($u->info['team'] != $btl->users[$btl->uids[$usr['id']]]['team'] ) {
-											if( $itm['useInBattle'] == 1 ) {
-												$goodUse = 0;
-											}
-											$tpsm = 2;
-										}elseif($u->info['team'] == $btl->users[$btl->uids[$usr['id']]]['team'] ) {
-											if( $itm['useInBattle'] == 2 ) {
-												$goodUse = 0;
-											}
-											$tpsm = 1;
-										}
-									}
-								}
-								//
-								if( $goodUse == 1 ) {
-									if(isset($st['onlyOne']))
-									{
-										//������� ������� �������
-										$goodUse = 0;
-										$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"');
-										if($upd1)
-										{										
-											$goodUse = 1;
-										}
-									}
-									if(isset($st['oneType']))
-									{
-										//������� ������� �������									
-										$goodUse = 0;
-										$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `delete` = "0" AND `overType` = "'.$itm['overType'].'"');
-										if($upd1)
-										{
-											$goodUse = 1;
-										}
-									}
-								}
-								//
-								if( $goodUse == 1 && $itm['magic_inc'] == 'unclone' ) {
-									//���������� �����
-									if($usr['clone'] > 0 && $usr['hpNow'] >= 1 && $usr['team'] != $u->info['team']) {
-										mysql_query('UPDATE `stats` SET `team` = "'.$u->info['team'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-										if( $u->info['sex'] == 0 ) {
-											$txt_m = '{u1} <b>��������� �����</b> {u2} �� ���� �������.';
-										}else{
-											$txt_m = '{u1} <b>����������</b> ����� {u2} �� ���� �������.';	
-										}
-										$this->inBattleLog($txt_m,$usr);
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.($itm['iznosNOW'] + 1).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										mysql_query('UPDATE `items_users` SET `btl_zd` = "1" WHERE `item_id` = "'.$itm['item_id'].'" AND `inOdet` > 0 AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" LIMIT 20');
-										$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot; �� &quot;'.$usr['login'].'&quot;';
-									}else{
-										$u->error = '�� �� ������ ������������ ������� ���������...';
-									}
-								}elseif($goodUse == 1)
-								{
-									$us = $this->add_eff($usr['id'],$itm['magic_inc']);
-									if($us[0]==1) {
-										$mmmid = mysql_insert_id();
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-											mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										}
-										if($u->info['id']!=$usr['id'])
-										{
-											$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') �� ��������� &quot;'.$usr['login'].'&quot; (id'.$usr['id'].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-											$u->addDelo(1,$usr['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� &quot;'.$u->info['login'].'&quot; (id'.$u->info['id'].') ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') �� ��������� [itm:'.$itm['id'].'].',time(),$usr['city'],'System.inventory',0,0);
-											$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot; �� ��������� &quot;'.$usr['login'].'&quot;<br>'.$us[1].'';
-											//$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ���������� &quot;'.$itm['name'].'&quot; �� ��������� &quot;'.$usr['login'].'&quot;.';
-											//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-										}else{
-											$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') �� ��������� ������ ���� [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-											$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot; �� ������ ����<br>'.$us[1].'';
-											
-											//$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ���������� &quot;'.$itm['name'].'&quot; �� ����.';
-											//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-											
-										}
-										//
-										if( $usr['battle'] > 0 ) {
-											//������� � ���
-											$txt_m = '';
-											if( $u->info['sex'] == 0 ) {
-												if($u->info['id']!=$usr['id']) {
-													$txt_m .= '{u1} �������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}.';
-												}else{
-													$txt_m .= '{u1} �������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����.';	
-												}
-											}else{
-												if($u->info['id']!=$usr['id']) {
-													$txt_m .= '{u1} ��������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}.';
-												}else{
-													$txt_m .= '{u1} ��������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����.';	
-												}
-											}
-											$this->inBattleLog($txt_m,$usr);
-											//
-											//�� ���������� ��� ������ ������ �������
-											//306 - ������������� , 307 - �������������
-											if( $tpsm == 1 ) {
-												//306
-												mysql_query('UPDATE `eff_users` SET `v1` = "priem",`v2` = "306",`timeUse` = "77",`hod` = "-1",`img2` = "'.$itm['img'].'" WHERE `id` = "'.$mmmid.'" LIMIT 1');
-											}elseif( $tpsm == 2 ) {
-												//307
-												mysql_query('UPDATE `eff_users` SET `v1` = "priem",`v2` = "307",`timeUse` = "77",`hod` = "-1",`img2` = "'.$itm['img'].'" WHERE `id` = "'.$mmmid.'" LIMIT 1');
-											}
-											//
-										}
-										//
-										$this->youuse++;
-									}else{
-										$u->error = '�� ������� ������������ "'.$itm['name'].'" ... ('.$itm['magin_inc'].' and '.$itm['magic_inci'].', ������ �� ��������)';
-									}
-								}else{
-									$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-								}
-							}
-						}
-					}else{
-						$u->error = '�������� "'.$jl.'" �� ������ � ���� ������ ('.$u->info['city'].')';
-					}
-				}elseif(isset($st['useOnItem']) && $st['useOnItem']==1)
-				{
-					//���������� �� �������
-					
-				}else{
-					//�� ����
-					$goodUse = 1;
-					if(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-					{
-						$goodUse = 0;
-						$u->error = '�������� �� ����� ������������ ������ ��������';
-					}
-					
-					if($itm['magic_inci'] == 'sanich2') {
-						if($u->info['battle'] == 0) {						
-							$sz = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "sanich2" AND `time` > '.(time()-4*60*60).' LIMIT 1',1);
-							if(!isset($sz['id'])) {														
-								$slech=rand(0,4);
-								$goodUse = 0;
-								if($slech==1){
-								//3083 �������� �� ������ �������
-								//$this->add_eff($u->info['id'],3083);
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 290 AND `delete` =0');
-								$this->add_eff($u->info['id'],290);
-								$echotext = '�������� �� ������ �������!';
-								$u->error = '�� �������� ����� �� '.$echotext.'';
-								}elseif($slech==2){
-								//5239 �������� ����������� ������
-								//$this->add_eff($u->info['id'],5239);
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 472 AND `delete` =0');
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 470 AND `delete` =0');
-								$this->add_eff($u->info['id'],472);
-								$echotext = '�������� ����������� ������!';
-								$u->error = '�� �������� ����� �� '.$echotext.'';
-								}elseif($slech==3){
-								//5069 �������� ��������� ������
-								//$this->add_eff($u->info['id'],470);
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 472 AND `delete` =0');
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 470 AND `delete` =0');
-								$this->add_eff($u->info['id'],470);
-								$echotext = '�������� ��������� ������!';
-								$u->error = '�� �������� ����� �� '.$echotext.'';
-								}elseif($slech==4){
-								//1463 �������� ������	
-								//$this->add_eff($u->info['id'],1463);
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 35 AND `delete` =0');
-								$this->add_eff($u->info['id'],35);
-								$echotext = '�������� ������!';
-								$u->error = '�� �������� ����� �� '.$echotext.'';
-								}else{
-									$slech=1;
-									
-									$echotext = '�� ������� ��������� ��������!';
-									$u->error = ' '.$echotext.' ';
-								}
-								
-								$itm['iznosNOW'] += $slech;
-								mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-								$u->addAction(time(),'sanich2',$slech);
-								
-								if($u->info['sex'] == 1) {
-										$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; ������������ &quot;'.$itm['name'].' ������&quot; � �������� ������ '.$echotext.' ������.';
-									}else{
-										$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; ����������� &quot;'.$itm['name'].' ������&quot; � ������� ������ '.$echotext.' ������.';
-									}
-								
-								
-								
-								/*
-								$slech = 0;
-								$strm = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 4 AND `delete` = "0" LIMIT 1'));
-								if(isset($strm['id'])) {
-									if($strm['v1'] == 1) {
-										$slech = 1;
-									}elseif($strm['v1'] == 2) {
-										$slech = 2;
-									}elseif($strm['v1'] == 3) {
-										$slech = 3;
-									}
-								}								
-								if($slech > 0) {
-									
-									$goodUse = 0;
-									
-									$slf = '������';
-									if($slech == 2) {
-										$slf = '�������';
-									}elseif($slech == 3) {
-										$slf = '�������';
-									}
-	
-									if($u->info['sex'] == 1) {
-										$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; ������������ &quot;'.$itm['name'].' ������&quot; � �������� �� '.$slf.' ������.';
-									}else{
-										$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; ����������� &quot;'.$itm['name'].' ������&quot; � ��������� �� '.$slf.' ������.';
-									}
-									mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-								
-									mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$strm['id'].'" LIMIT 1');
-									$u->error = '�� ������� ���������� �� '.$slf.' ������.';
-									$itm['iznosNOW'] += $slech;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									$u->addAction(time(),'sanich2',$slech);
-								}else{
-									$u->error = '� ��������� ��� ���������� ������ ������� ����� ��������';
-								}*/
-								
-							}else{
-								$u->error = '�������� ������������� '.$u->timeOut(($sz['time']+4*60*60)-time()).'.';
-							}							
-						}else{
-							$u->error = '���������� ������������ � ���';
-						}
-
-					}elseif($itm['magic_inci'] == 'sanich1' && $u->info['battle'] > 0) {
-						
-						$sz = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "sanich1" AND `time` > '.(time()-6*60).' LIMIT 1',1);
-						if(!isset($sz['id'])) {
-							$goodUse = 0;
-							$u->error = '�� ������� ������������ &quot;'.$itm['name'].'&quot;';
-							$z = 1;
-							while($z <= 5) {
-								$u->info['tactic'.$z]++;
-								if($u->info['tactic'.$z] > 25) {
-									$u->info['tactic'.$z] = 25;
-								}elseif($u->info['tactic'.$z] < 0) {
-									$u->info['tactic'.$z] = 0;
-								}
-								$z++;
-							}
-							if($u->info['sex'] == 1) {
-								$this->inBattleLog('{u1} ������������ &quot;<b>'.$itm['name'].' ������</b>&quot;.');
-							}else{
-								$this->inBattleLog('{u1} ����������� &quot;<b>'.$itm['name'].' ������</b>&quot;.');
-							}
-							mysql_query('UPDATE `stats` SET `tactic1` = "'.$u->info['tactic1'].'",`tactic2` = "'.$u->info['tactic2'].'",`tactic3` = "'.$u->info['tactic3'].'",`tactic4` = "'.$u->info['tactic4'].'",`tactic5` = "'.$u->info['tactic5'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							$itm['iznosNOW']++;
-							mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-							$u->addAction(time(),'sanich1',$u->info['battle']);
-						}else{
-							$u->error = '�������� ������������� '.$u->timeOut(($sz['time']+6*60)-time()).'.';
-						}
-										
-					}elseif($itm['magic_inci'] == 'sanich3' && $u->info['battle'] > 0) {
-						
-						$sz = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "sanich3" AND `time` > '.(time()-3*60*60).' LIMIT 1',1);
-						if(!isset($sz['id'])) {
-							
-							$usr = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`level`,`s`.`hpNow`,`s`.`team`,`u`.`login`,`u`.`sex` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`id` = "'.$u->info['enemy'].'" AND `u`.`battle` = "'.$u->info['battle'].'" LIMIT 1')); 
-							if(isset($usr['id']) && $usr['hpNow'] >= 1) {
-								$iznslvl = $usr['level'];
-								
-								$goodUse = 0;
-								$u->error = '�� ������� ������������ &quot;'.$itm['name'].'&quot; �� '.$usr['login'].'';
-								
-								if($u->info['sex'] == 1) {
-									$this->inBattleLog('{u1} ������������ &quot;<b>'.$itm['name'].' ������</b>&quot; �� {u2}.',$usr);
-								}else{
-									$this->inBattleLog('{u1} ����������� &quot;<b>'.$itm['name'].' ������</b>&quot; �� {u2}.',$usr);
-								}
-								
-								mysql_query('UPDATE `stats` SET `hpNow` = "'.$usr['hpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-								mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpNow'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-								$itm['iznosNOW'] += $iznslvl;
-								mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-								$u->addAction(time(),'sanich3',$u->info['battle']);
-							}else{
-								$u->error = '��� ����������� ����������';
-							}
-							
-						}else{
-							$u->error = '�������� ������������� '.$u->timeOut(($sz['time']+3*60*60)-time()).'.';
-						}
-										
-					}elseif($itm['magic_inci']=='lech')
-					{
-						$goodUse = 0;
-						    if($u->info['level']>=2 and $u->info['level']<=13){
-							    $travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$u->info['id'].'" and `id_eff`="4" and `delete`="0" LIMIT 1'));
-                                   if ($travm && $travm['v1'] ==4)
-									   $u->error = '� ��� ����������� ������, ��� ������� ������ ���� ��� �����.';
-								   elseif($travm) {
-										mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-											mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										}
-									}else{
-										$u->error = '� ��� ���� ������.';
-									}
-							}else{
-							    $u->error = '��� ������� �� �������� ��� ������������� ������.';
-							}
-						}
-									
-					
-					if($goodUse==1)
-					{
-						
-						$upd1 = 1;
-						$upd2 = 1;
-						//��������� ������ ���������
-						if(isset($st['onlyOne']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						if(isset($st['oneType']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `overType` = "'.$itm['overType'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						
-						if($itm['magic_inci']=='unclone')
-						{
-							//������ ������������
-							if( $u->info['hpNow'] < 1 ) {
-								$u->error = '��� �� ������� ���������� �����...';
-							}elseif( $u->info['battle'] == 0 ) {
-								$u->error = '����� ������������ ������ � ��������...';
-							}else{
-								//�����������
-								$u->error = '����������...';
-							}
-						}elseif($itm['magic_inci']=='cloneMe')
-						{
-							//������ ������������
-							if( true == false ) {
-								$u->error = '������ ������������ ��������� � ����� �������.';
-							}elseif( $u->info['hpNow'] < 1 ) {
-								$u->error = '�� ������� ����������� ���� ���� ;)';
-							}elseif( $u->info['battle'] == 0 ) {
-								$u->error = '����� ������������ ������ � ��������...';
-							}else{
-								$bot_cou = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `login` LIKE "%'.$u->info['login'].' (����%" AND `battle` = "'.$u->info['battle'].'" LIMIT 1'));
-								$bot_cou = $bot_cou[0]+1;
-								//��������� ����
-								$clone = array(
-									'id' => $u->info['id'],
-									'login' => $u->info['login'].' (���� '.$bot_cou.')',
-									'level' => $u->info['level'],
-									'city' => $u->info['city'],
-									'cityreg' => $u->info['cityreg'],
-									'name' => $u->info['name'],
-									'sex' => $u->info['sex'],
-									'deviz' => $u->info['deviz'],
-									'hobby' => $u->info['hobby'],
-									'time_reg' => $u->info['time_reg'],
-									'obraz' => $u->info['obraz'],
-									'stats' => $u->info['stats'],
-									'upLevel' => $u->info['upLevel'],
-									'priems' => $u->info['priems'],
-									'loclon' => true,
-                                    'inTurnir' => $u->info['inTurnir']
-								);
-								$bot = $u->addNewbot(1,NULL,$clone,NULL,true);
-								if( $bot > 0 ) {
-									mysql_query('UPDATE `stats` SET `team` = "'.$u->info['team'].'",`hpNow` = "'.$u->stats['hpNow'].'",`mpNow` = "'.$u->stats['mpNow'].'" WHERE `id` = "'.$bot.'" LIMIT 1');
-									mysql_query('UPDATE `users` SET `battle` = "'.$u->info['battle'].'" WHERE `id` = "'.$bot.'" LIMIT 1');
-									//��������� ���
-									if( $u->info['sex'] == 0 ) {
-										$txt_m = '{u1} ����������� &quot;'.$itm['name'].'&quot; � <b>������� �����</b>.';
-									}else{
-										$txt_m = '{u1} ������������ &quot;'.$itm['name'].'&quot; � <b>�������� �����</b>.';
-									}
-									$this->inBattleLog($txt_m,NULL);
-									if( $u->info['sex'] == 0 ) {
-										$txt_m = '<b>'.$u->info['login'].' (���� '.$bot_cou.')</b>['.$u->info['level'].'] �������� � ��������!';
-									}else{
-										$txt_m = '<b>'.$u->info['login'].' (���� '.$bot_cou.')</b>['.$u->info['level'].'] ��������� � ��������!';
-									}
-									$this->inBattleLog($txt_m,$usr_m);
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.($itm['iznosNOW'] + 1).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									mysql_query('UPDATE `items_users` SET `btl_zd` = "1" WHERE `item_id` = "'.$itm['item_id'].'" AND `inOdet` > 0 AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" LIMIT 20');
-									$u->error = '�������� &quot;'.$itm['name'].'&quot; ���� ������� ������������';
-								}else{
-									$u->error = '��������� ������������ ��������...';
-								}
-								unset($txt_m,$usr_m,$clone,$bot_cou,$bot);
-							}
-						
-                        } elseif($itm['magic_inci'] == 'scan') {
-                          if($u->info['inTurnir'] != 0) {
-                            $sp = mysql_query('SELECT `st`.*, `u`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `inTurnir` = "'.$u->info['inTurnir'].'"');
-                            while($pl = mysql_fetch_array($sp)) {
-                             $rrm = mysql_fetch_array(mysql_query('SELECT * FROM `bs_map` WHERE `x` = "'.$pl['x'].'" AND `y` = "'.$pl['y'].'"'));
-                             $trnt .= $pl['login'].' ������� : '.$rrm['name'].', ';
+                            if ($u->stats['hpNow'] + $use['moment_hp'] > $u->stats['hpAll']) {
+                                $use['moment_hp'] = ceil($u->stats['hpAll'] - $u->stats['hpNow']);
                             }
-                            $trnt = rtrim($trnt,', ');
-                            $it_ = $u->addItem(2435, $u->info['id'], 'noodet=1|noremont=1|sudba='.$u->info['login'].'');
-                            mysql_query('UPDATE `items_users` SET `use_text` = 500 WHERE `id` = "'.$it_.'" LIMIT 1');
-                            mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`,`type`) VALUES ("'.$it_.'","'.time().'","","'.mysql_real_escape_string($trnt).'","'.$u->info['city'].'","1","1")');
-                            mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-                            $u->error = '�� �������� �������...';
-                            
-                          } else {
-                            $u->error = '������������ ������ � ����� ������...';
-                          }
-                        }elseif($itm['magic_inci']=='tactic') {
-							//������ �������
-							if( $u->stats['hpNow'] >= 1 ) {
-							
-									$bu = mysql_fetch_array(mysql_query('SELECT * FROM `tactic` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
-									if(isset($bu['id'])) {
-										$u->error = '������ ������������ ������ ������ ���...';
-									}else{
-										//
-										mysql_query('INSERT INTO `tactic` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ("'.$u->info['battle'].'","'.$u->info['id'].'","'.time().'","'.$itm['item_id'].'","'.$itm['name'].'","1")');
-										//
-										mysql_query('INSERT INTO `battle_actions` (`uid`,`btl`,`time`,`vars`,`vals`) VALUES (
-											"'.$u->info['id'].'","'.$u->info['battle'].'","'.time().'","use_cast_tactic",""
+
+                            $u->error .= 'Вы восстановили ' . ($use['moment_hp']) . ' HP.<br>';
+                        } else {
+                            $u->error = 'Ваше здоровье и так полностью восстановлено<br>';
+                            $goodUse = 0;
+                        }
+                    }
+
+                    if (isset($st['moment_mp'])) {
+                        //Восстанавливаем здоровье
+                        if ($u->stats['mpNow'] < $u->stats['mpAll']) {
+                            $goodUse = 1;
+                            $use['moment_mp'] = $st['moment_mp'];
+                            if ($u->stats['mpNow'] + $use['moment_mp'] > $u->stats['mpAll']) {
+                                $use['moment_mp'] = ceil($u->stats['mpAll'] - $u->stats['mpNow']);
+                            }
+                            $u->error .= 'Вы восстановили ' . ($use['moment_mp']) . ' MP.<br />';
+                        } else {
+                            $u->error = 'Ваша манна и так полностью восстановлена';
+                            $goodUse = 0;
+                        }
+                    }
+
+                    if ($itm['iznosNOW'] >= $itm['iznosMAX']) {
+                        $u->error = 'Эликсир был испорчен...';
+                        $goodUse = 0;
+                    }
+
+                    if (($u->info['align'] == 2 || $u->info['haos'] > time()) && isset($st['nohaos'])) {
+                        $goodUse = 0;
+                        $u->error = 'Хаосники не могут использовать данный эликсир';
+                    }
+
+                    //Заносим данные в БД
+                    if ($goodUse == 1) {
+                        $itm['iznosNOW']++;
+                        $upd = mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                        if ($upd) {
+                            $u->stats['hpNow'] += $use['moment_hp'];
+                            $u->info['hpNow'] += $use['moment_hp'];
+                            $u->stats['mpNow'] += $use['moment_mp'];
+                            $u->info['mpNow'] += $use['moment_mp'];
+                            if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                            }
+                            mysql_query('UPDATE `stats` SET `hpNow` = "' . $u->info['hpNow'] . '", `mpNow` = "' . $u->info['mpNow'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                            $u->addDelo(1, $u->info['id'], '&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж использовал эликсир &quot;' . $itm['name'] . '&quot; (+' . $use['moment_hp'] . ' HP) [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0);
+                            $this->youuse++;
+                            $u->error = 'Вы успешно использовали эликсир &quot;' . $itm['name'] . '&quot;<br>' . $u->error . '';
+                        } else {
+                            $u->error = 'Не удалось использовать эликсир...';
+                        }
+                    }
+                } else {
+                    //Эликсиры с продолжительным эффектом
+                    $goodUse = 1;
+                    if (($u->info['align'] == 2 || $u->info['haos'] > time()) && isset($st['nohaos'])) {
+                        $goodUse = 0;
+                        $u->error = 'Хаосники не могут использовать данный эликсир';
+                    }
+                    if ($goodUse == 1) {
+                        $upd1 = 1;
+                        $upd2 = 1;
+                        //добавляем эффект персонажу
+                        if (isset($st['onlyOne'])) {
+                            //убираем прошлые эффекты
+                            $goodUse = 0;
+                            $upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"');
+                            if ($upd1) {
+                                $goodUse = 1;
+                            }
+                        }
+                        if (isset($st['oneType'])) {
+                            //убираем прошлые эффекты
+                            $goodUse = 0;
+                            $upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"');
+                            if ($upd1) {
+                                $goodUse = 1;
+                            }
+                        }
+                        if ($goodUse == 1) {
+                            $us = $this->add_eff($u->info['id'], $itm['magic_inc']);
+                            if ($us[0] == 1) {
+                                $itm['iznosNOW']++;
+                                if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                    mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                }
+                                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                $u->addDelo(1, $u->info['id'], '&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж использовал эликсир &quot;' . $itm['name'] . '&quot; (' . $us[1] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0);
+                                $this->youuse++;
+                                $u->error = 'Вы успешно использовали эликсир &quot;' . $itm['name'] . '&quot;<br>' . $us[1] . '';
+                            } else {
+                                $u->error = 'Не удалось использовать "' . $itm['name'] . '"';
+                            }
+                        } else {
+                            $u->error = 'Не удалось использовать "' . $itm['name'] . '"';
+                        }
+                    }
+                }
+                //---------------
+            } elseif ($itm['type'] == 29) {
+                //используем заклятие
+                $st = $u->lookStats($itm['data']);
+                if (isset($st['zazuby']) && $_GET['login'] != $u->info['login']) {
+                    //unset($st['useOnLogin']);
+                    $_GET['login'] = $u->info['login'];
+                }
+                $jl = $_GET['login'];
+                $_GET['login'] = urlencode($_GET['login']);
+                //используем на персонажа (все кроме себя)
+                $_GET['login'] = str_replace('%', ' ', $_GET['login']);
+                $_GET['login'] = str_replace('25', '', $_GET['login']);
+                $jl = str_replace('%', ' ', $jl);
+                $jl = str_replace('25', '', $jl);
+                if ($itm['magic_inci'] == 'nextuplvl') {
+                    if ($itm['iznosNOW'] >= $itm['iznosMAX']) {
+                        $u->error = 'Свиток был исполчен...';
+                    } elseif ($u->info['battle'] > 0) {
+                        //
+                        $u->error = 'Вы не можете использовать свиток в бою';
+                    } else {
+                        if ($u->info['twink'] > 0) {
+                            $u->error = 'Используйте свиток на основном персонаже';
+                        } else {
+                            mysql_query('UPDATE `users` SET `stopexp` = 0 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                            mysql_query('UPDATE `users_twink` SET `stopexp` = 0 WHERE `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                            $itm['iznosNOW']++;
+                            if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                            }
+                            mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                        }
+                    }
+                } elseif (isset($st['useOnLogin']) && $st['useOnLogin'] == 1) {
+                    if ($u->info['inTurnir'] == 0) {
+                        if ($u->info['battle'] > 0) {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND `u`.`battle` = "' . $u->info['battle'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") LIMIT 1'));
+                        } else {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") LIMIT 1'));
+                        }
+                    } else {
+                        if ($u->info['battle'] > 0) {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND `u`.`battle` = "' . $u->info['battle'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") AND `u`.`inTurnir` > 0 LIMIT 1'));
+                        } else {
+                            $usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") AND `u`.`inTurnir` > 0 LIMIT 1'));
+                        }
+                    }
+
+
+                    if (isset($usr['id'])) {
+                        //заклятье нападения
+                        if ($itm['iznosNOW'] >= $itm['iznosMAX']) {
+                            $u->error = 'Свиток был исполчен...';
+                        } elseif ($itm['magic_inci'] == 'snowball') {
+                            if ($u->info['battle'] == 0) {
+                                $usr = mysql_fetch_array(mysql_query('SELECT `st`.`clone`,`u`.`type_pers`,`u`.`bot_id`,`st`.`zv`,`u`.`inTurnir`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND (`u`.`battle` = 0 OR `u`.`battle` = "' . $u->info['battle'] . '") AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") LIMIT 1'));
+                            } else {
+                                $usr = mysql_fetch_array(mysql_query('SELECT `st`.`clone`,`u`.`type_pers`,`u`.`bot_id`,`st`.`zv`,`u`.`inTurnir`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "' . $u->info['city'] . '" AND (`u`.`battle` = 0 OR `u`.`battle` = "' . $u->info['battle'] . '") AND (`u`.`login`="' . mysql_real_escape_string($_GET['login']) . '" OR `u`.`login`="' . mysql_real_escape_string($jl) . '") AND `u`.`battle` = "' . $u->info['battle'] . '" LIMIT 1'));
+                            }
+                            if ($usr['battle'] > 0 && $u->info['battle'] != $usr['battle']) {
+                                $u->error = 'Персонаж находится в бою';
+                            } elseif ($usr['battle'] > 0) {
+                                //Кидаемся в поединке
+                                if ($usr['team'] != $u->info['team'] && $usr['hpNow'] > 0) {
+                                    $txt = 1;
+
+                                    //Отморозки
+                                    if ($usr['bot_id'] >= 439 && $usr['bot_id'] <= 460) {
+                                        $txt = 500;
+                                    } elseif ($usr['bot_id'] == 291) {
+                                        if ($usr['hpNow'] < 961) {
+                                            $txt = 1982;
+                                        } elseif ($usr['hpNow'] > 980 && $usr['hpNow'] < 1981) {
+                                            $txt = 1982;
+                                        }
+                                    } elseif ($usr['id'] == 1008) {
+                                        $txt = $u->info['level'] * 250;
+                                    }
+
+                                    $usr['hpNow'] -= $txt;
+                                    if ($txt < 0) {
+                                        $txt = '+' . $txt;
+                                    } elseif ($txt == 0) {
+                                        $txt = '--';
+                                    } else {
+                                        $txt = '-' . $txt;
+                                    }
+                                    if ($usr['hpNow'] < 0) {
+                                        $usr['hpNow'] = 0;
+                                    }
+                                    $btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $usr['hpNow'];
+                                    $lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "' . $u->info['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1'));
+                                    if (isset($lastHOD['id'])) {
+                                        $btl->stats[$btl->uids[$usr['id']]]['hpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['hpNow']);
+                                        if ($btl->stats[$btl->uids[$usr['id']]]['hpNow'] > $btl->stats[$btl->uids[$usr['id']]]['hpAll']) {
+                                            $btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $btl->stats[$btl->uids[$usr['id']]]['hpAll'];
+                                        }
+                                        if ($btl->stats[$btl->uids[$usr['id']]]['hpNow'] < 1) {
+                                            $btl->stats[$btl->uids[$usr['id']]]['hpNow'] = 0;
+                                        }
+                                        $id_hod = $lastHOD['id_hod'];
+                                        if ($lastHOD['type'] != 6) {
+                                            $id_hod++;
+                                        }
+                                        mysql_query('UPDATE `stats` SET `hpNow` = "' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                        $itm['iznosNOW']++;
+                                        if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                            mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                        }
+                                        mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                        $txt = '<font color=#006699>' . $txt . '</font>';
+                                        if ($u->info['sex'] == 1) {
+                                            $txt = 'Хитрая {u1} бросила кусок снега в {u2}. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']';
+                                        } else {
+                                            $txt = 'Хитрый {u1} бросил кусок снега в {u2}. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']';
+                                        }
+                                        mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time() . '","","","","","6")');
+                                    }
+
+                                    unset($txt);
+                                } else {
+                                    $u->error = 'Нельзя использовать на данного персонажа';
+                                }
+                            } elseif ($u->info['dnow'] != $usr['dnow']) {
+                                $u->error = 'Персонаж находится в другой комнате';
+                            } elseif ($usr['id'] == $u->info['id']) {
+                                $u->error = 'Нельзя кидаться в самого себя';
+                            } elseif ($usr['online'] < time() - 520 && $usr['battle'] == 0 && $usr['bot'] == 0) {
+                                $u->error = 'Персонаж находится в реальном мире ;)';
+                            } elseif ($usr['room'] != $u->info['room']) {
+                                $u->error = 'Персонаж находится в другой комнате';
+                            } elseif ($usr['admin'] > 0 && $u->info['admin'] == 0) {
+                                $u->error = 'Нельзя кидаться в Ангелов';
+                            } else {
+                                $usr['hpNow'] -= 1000;
+                                if ($usr['hpNow'] < 0) {
+                                    $usr['hpNow'] = 0;
+                                }
+                                $upd = mysql_query('UPDATE `stats` SET `hpNow` = "' . $usr['hpNow'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                if ($upd) {
+                                    $sx = 'ый';
+                                    $sx2 = '';
+                                    if ($u->info['sex'] == 1) {
+                                        $sx = 'ая';
+                                        $sx2 = 'а';
+                                    }
+                                    $itm['iznosNOW']++;
+                                    if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                        mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                    }
+                                    mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                    $urs_st = $u->getStats($usr['id']);
+                                    $rtxt = '[img[items/snowball1.gif]] Хитр' . $sx . ' &quot;' . $u->info['login'] . '&quot; бросил' . $sx2 . ' кусок снега в &quot;' . $usr['login'] . '&quot;. <font color=red><b>-1000</b></font> [' . floor($urs_st['hpNow']) . '/' . $urs_st['hpAll'] . ']';
+                                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+                                    unset($sx, $sx2);
+                                } else {
+                                    $u->error = 'Не удалось кинуть снежок...';
+                                }
+                            }
+                        } elseif ($itm['magic_inci'] == 'atack') {    //заклятье нападения
+
+                            $usta = $u->getStats($usr['id'], 0); // статы цели
+                            $rgd = $u->regen($usr['id'], $usta, 1);
+                            $usta['hpNow'] = $rgd['hpNow'];
+                            $usta['mpNow'] = $rgd['mpNow'];
+                            $minHp = floor($usta['hpAll'] / 100 * 33); // минимальный запас здоровья цели при котором можно напасть
+                            $batlatest = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $usr['battle'] . '" AND `team_win` = -1 LIMIT 1'));
+                            $test = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_last` WHERE `uid` = "' . $u->info['id'] . '" AND `battle_id` = "' . $usr['battle'] . '" LIMIT 1'));
+                            if (isset($test['id'])) {
+                                echo 'Нельзя вмешаться, вы уже были в этом поединке.';
+                            } elseif (time() - $usr['timereg'] < 86400 * 10) {
+                                $u->error = 'Нападать на новичков запрещается! Сейчас придет Мироздатель и превратит тебя в лягушку...';
+                            } elseif ($usr['atack'] == 1 || $usr['atack'] > time()) {
+                                $u->error = 'На персонаже метка нападения, нападайте через неё...';
+                            } elseif ($u->info['dnow'] != $usr['dnow']) {
+                                $u->error = 'Персонаж находится в другой комнате (пещере)';
+                            } elseif ($usr['inTurnirnew'] > 0) {
+                                $u->error = 'Персонаж принимает участие в турнире';
+                            } elseif ($u->info['battle'] > 0) {
+                                $u->error = 'Вы уже находитесь в бою';
+                            } elseif ($usr['id'] == $u->info['id']) {
+                                $u->error = 'Нельзя нападать на самого себя';
+                            } elseif ($usr['bot'] == 2) {
+                                $u->error = 'Не удалость напасть на бота ' . $usr['login'] . '';
+                            } elseif ($usr['online'] < time() - 120) {
+                                $u->error = 'Персонаж не в сети';
+                            } elseif ($usr['admin'] == 1) {
+                                $u->error = 'Уважайте хранителей...';
+                            } elseif ($usr['room'] != $u->info['room'] && $u->info['battle'] != $usr['battle'] && $u->info['battle'] > 0) {
+                                $u->error = 'Персонаж находится в другой комнате!';
+                            } elseif ($usr['room'] != $u->info['room']) {
+                                $u->error = 'Персонаж находится в другой комнате';
+                            } elseif ($batlatest['noatack'] == 1) {
+                                $u->error = 'Поединок защищен магией! Вы не можете вмешаться!';
+                            } elseif ($minHp > $usta['hpNow'] && !isset($batlatest['id'])) {
+                                //мало хп
+                                $u->error = 'Персонаж слишком слаб (' . floor($usta['hpNow']) . 'HP)';
+                            } elseif ($u->info['noatack'] != 0) {
+                                //мало хп
+                                $u->error = 'В этой комнате нападения запрещены.';
+                            } else {
+
+                                if ($usr['type_pers'] > 0) {
+                                    $kroww = $usr['type_pers'];
+                                } elseif ($itm['item_id'] == '2391') {
+                                    $kroww = 99;
+                                } elseif ($itm['item_id'] == '11117') {
+                                    $kroww = 222;
+                                } else {
+                                    $kroww = 0;
+                                }
+
+                                $kulak = 0;
+                                if ($itm['item_id'] == 4404) {
+                                    $kulak = 1;
+                                }
+                                if ($u->info['inTurnir'] > 0) {
+                                    $bsi = $u->info['inTurnir'];
+                                } else {
+                                    $bsi = 0;
+                                }
+                                $atc = $this->atackUser($u->info['id'], $usr['id'], $usr['team'], $usr['battle'], 0, $kroww, $kulak, $bsi);
+                                if ($atc > 0) {
+                                    //отправляем системку в чат
+                                    $sx = '';
+                                    if ($u->info['sex'] == 1) {
+                                        $sx = 'а';
+                                    }
+                                    $itm['iznosNOW']++;
+                                    if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                        mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                    }
+                                    mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                    $rtxt = '[img[items/pal_button8.gif]] &quot;' . $u->info['login'] . '&quot; использовал' . $sx . ' магию нападения на персонажа &quot;' . $usr['login'] . '&quot;.';
+                                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','11','0','1')");
+                                    //напали, обновляем экран
+
+                                    die('<script>top.frames[\'main\'].location = "main.php";</script>');
+                                } else {
+                                    if ($u->error == '') {
+                                        $u->error = 'Не удалось напасть на персонажа...';
+                                    }
+                                }
+                            }
+                        } elseif ($itm['magic_inci'] == 'cureHP') {
+                            //Реген НР,MP
+                            $po = $u->lookStats($itm['data']);
+                            if ($u->info['battle'] > 0) {
+                                //используем свиток в поединке
+                                $bu = mysql_fetch_array(mysql_query('SELECT * FROM `spells` WHERE `btl` = "' . $u->info['battle'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1'));
+                                if (isset($bu['id'])) {
+                                    $u->error = 'Нельзя использовать свиток каждый ход...';
+                                } elseif ($usr['battle'] != $u->info['battle']) {
+                                    $u->error = 'Неудалось использовать, персонаж в другом поединке...';
+                                } elseif ($usr['team'] != $u->info['team']) {
+                                    $u->error = 'Неудалось использовать на противника...';
+                                } elseif ($usr['hpNow'] < 1) {
+                                    $u->error = 'Неудалось использовать на мертвых...';
+                                } elseif ($u->info['hpNow'] < 1) {
+                                    $u->error = 'Неудалось использовать, вы погибли...';
+                                } elseif ($btl->info['noeff'] > 0) {
+                                    $u->error = 'Запрет на использования свитков восстановления';
+                                } elseif ($po['magic_hpNow'] < 1 && $po['magic_mpNow'] < 1) {
+                                    $u->error = 'Неудалось использовать, в магическом свитке нет магии...';
+                                } elseif (($usr['battle'] == $u->info['battle'] && ($u->info['team'] == $usr['team'] && ($po['magic_hpNow'] > 0 || $po['magic_mpNow'] > 0))) && $usr['hpNow'] >= 1 && $u->info['hpNow'] >= 1) {
+                                    //кастуем
+                                    if (isset($po['magic_hpNow'])) {
+
+                                        mysql_query('INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES (
+												"' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time() . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1"
+											)');
+
+                                        $txt = $po['magic_hpNow'];
+
+                                        if ($btl->stats[$btl->uids[$usr['id']]]['hpAll'] - $btl->stats[$btl->uids[$usr['id']]]['hpNow'] < $txt) {
+                                            $txt = floor($btl->stats[$btl->uids[$usr['id']]]['hpAll'] - $btl->stats[$btl->uids[$usr['id']]]['hpNow']);
+                                        }
+                                        //653 - 400
+                                        //253
+                                        //453 1306
+                                        $gdhh = round($txt / $btl->stats[$btl->uids[$usr['id']]]['hpAll'] * 5, 2);
+                                        $gdhd = round($gdhh / $btl->users[$btl->uids[$usr['id']]]['tactic7'] * 100);
+                                        if ($gdhd > 100) {
+                                            $txt = floor($txt / 100 * $gdhd);
+                                        }
+
+                                        if ($btl->users[$btl->uids[$usr['id']]]['tactic7'] >= 1) {
+                                            if ($txt > 0) {
+                                                $btl->stats[$btl->uids[$usr['id']]]['hpNow'] += $txt;
+                                                $btl->users[$btl->uids[$usr['id']]]['tactic7'] -= $gdhh;
+                                                if ($btl->users[$btl->uids[$usr['id']]]['tactic7'] < 0) {
+                                                    $btl->users[$btl->uids[$usr['id']]]['tactic7'] = 0;
+                                                }
+                                            }
+                                            mysql_query('UPDATE `stats` SET `last_hp` = "' . $txt . '", `hpNow` = `hpNow` + ' . $po['magic_hpNow'] . ', `tactic7` = "' . $btl->users[$btl->uids[$usr['id']]]['tactic7'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                            if ($txt > 0) {
+                                                $txt = '+' . $txt;
+                                            } elseif ($txt == 0) {
+                                                $txt = '--';
+                                            }
+                                        } else {
+                                            $txt = '--';
+                                        }
+                                        $lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "' . $u->info['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1'));
+                                        if (isset($lastHOD['id'])) {
+                                            $btl->stats[$btl->uids[$usr['id']]]['hpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['hpNow']);
+                                            if ($btl->stats[$btl->uids[$usr['id']]]['hpNow'] > $btl->stats[$btl->uids[$usr['id']]]['hpAll']) {
+                                                $btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $btl->stats[$btl->uids[$usr['id']]]['hpAll'];
+                                            }
+                                            if ($btl->stats[$btl->uids[$usr['id']]]['hpNow'] < 1) {
+                                                $btl->stats[$btl->uids[$usr['id']]]['hpNow'] = 0;
+                                            }
+                                            $id_hod = $lastHOD['id_hod'];
+                                            if ($lastHOD['type'] != 6) {
+                                                $id_hod++;
+                                            }
+                                            $txt = '<font color=#006699>' . $txt . '</font>';
+                                            if ($u->info['id'] == $usr['id']) {
+                                                if ($u->info['sex'] == 1) {
+                                                    $txt = '{u1} использовала &quot;<b>' . $itm['name'] . '</b>&quot; на себя. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']';
+                                                } else {
+                                                    $txt = '{u1} использовал &quot;<b>' . $itm['name'] . '</b>&quot; на себя. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']';
+                                                }
+                                            } else {
+                                                if ($u->info['sex'] == 1) {
+                                                    $txt = '{u1} использовала &quot;<b>' . $itm['name'] . '</b>&quot; на {u2}. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']';
+                                                } else {
+                                                    $txt = '{u1} использовал &quot;<b>' . $itm['name'] . '</b>&quot; на {u2}. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['hpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['hpAll'] . ']';
+                                                }
+                                            }
+                                            mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time() . '","","","","","6")');
+                                        }
+                                    }
+                                    $itm['iznosNOW']++;
+                                    mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+
+                                    // сообщение в лог боя
+                                    $sx = 'ый';
+                                    $sx2 = '';
+                                    if ($u->info['sex'] == 1) {
+                                        $sx = 'ая';
+                                        $sx2 = 'а';
+                                    }
+                                    $u->error = 'Свиток &quot;' . $itm['name'] . '&quot; был успешно использован.';
+                                } else {
+                                    $u->error = 'Нельзя использовать на данного персонажа';
+                                }
+                            } elseif ($u->info['dnow'] != $usr['dnow']) {
+                                $u->error = 'Персонаж находится в другой комнате [пещера]';
+                            } elseif ($usr['online'] < time() - 120 && $usr['bot'] == 0) {
+                                $u->error = 'Персонаж находится в реальном мире';
+                            } elseif ($usr['room'] != $u->info['room']) {
+                                $u->error = 'Персонаж находится в другой комнате';
+                            } elseif ($usr['battle'] != $u->info['battle']) {
+                                $u->error = 'Персонаж находится в поединке';
+                            } else {
+                                //кастуем
+                                if (isset($po['magic_hpNow'])) {
+                                    mysql_query('UPDATE `stats` SET `hpNow` = `hpNow` + ' . $po['magic_hpNow'] . ' WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                }
+
+                                $itm['iznosNOW']++;
+                                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+
+                                if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                    mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                }
+
+                                // сообщение в чат
+                                $sx = 'ый';
+                                $sx2 = '';
+                                if ($u->info['sex'] == 1) {
+                                    $sx = 'ая';
+                                    $sx2 = 'а';
+                                }
+                                $u->error = 'Свиток &quot;' . $itm['name'] . '&quot; был успешно использован.';
+                                $rtxt = '[img[items/' . $itm['img'] . ']] Персонаж &quot;' . $u->info['login'] . '&quot; использовал' . $sx2 . ' &quot;' . $itm['name'] . '&quot; на &quot;' . $usr['login'] . '&quot;.';
+                                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+                            }
+                        } elseif ($itm['magic_inci'] == 'cureMP') {
+                            //Реген НР,MP
+                            $po = $u->lookStats($itm['data']);
+                            if ($u->info['battle'] > 0) {
+                                //используем свиток в поединке
+                                $bu = mysql_fetch_array(mysql_query('SELECT * FROM `spells` WHERE `btl` = "' . $u->info['battle'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1'));
+                                if (isset($bu['id'])) {
+                                    $u->error = 'Нельзя использовать свиток каждый ход...';
+                                } elseif ($btl->info['noeff'] > 0) {
+                                    $u->error = 'Запрет на использования свитков восстановления';
+                                } elseif (($usr['battle'] == $u->info['battle'] && ($u->info['team'] == $usr['team'] && ($po['magic_hpNow'] > 0 || $po['magic_mpNow'] > 0))) && $usr['hpNow'] > 1 && $u->info['hpNow'] >= 1) {
+                                    //кастуем
+                                    if (isset($po['magic_mpNow'])) {
+
+                                        mysql_query('INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES (
+												"' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time() . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1"
+											)');
+
+                                        $txt = $po['magic_mpNow'];
+
+                                        if ($btl->stats[$btl->uids[$usr['id']]]['mpAll'] - $btl->stats[$btl->uids[$usr['id']]]['mpNow'] < $txt) {
+                                            $txt = floor($btl->stats[$btl->uids[$usr['id']]]['mpAll'] - $btl->stats[$btl->uids[$usr['id']]]['mpNow']);
+                                        }
+
+                                        $gdhh = round($txt / $btl->stats[$btl->uids[$usr['id']]]['mpAll'] * 5);
+                                        $gdhd = round($gdhh / $btl->users[$btl->uids[$usr['id']]]['tactic7'] * 100);
+                                        if ($gdhd > 100) {
+                                            $txt = floor($txt / 100 * $gdhd);
+                                        }
+
+                                        if ($btl->users[$btl->uids[$usr['id']]]['tactic7'] >= 1) { // поставить >= 1 , если требует дух
+                                            if ($txt > 0) {
+                                                $btl->stats[$btl->uids[$usr['id']]]['mpNow'] += $txt;
+                                                $btl->users[$btl->uids[$usr['id']]]['tactic7'] -= $gdhh;
+                                                if ($btl->users[$btl->uids[$usr['id']]]['tactic7'] < 0) {
+                                                    $btl->users[$btl->uids[$usr['id']]]['tactic7'] = 0;
+                                                }
+                                            }
+                                            mysql_query('UPDATE `stats` SET `mpNow` = `mpNow` + ' . $txt . ', `tactic7` = "' . $btl->users[$btl->uids[$usr['id']]]['tactic7'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                            if ($txt > 0) {
+                                                $txt = '+' . $txt;
+                                            } elseif ($txt == 0) {
+                                                $txt = '--';
+                                            }
+                                        } else {
+                                            $txt = '--';
+                                        }
+                                        $lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "' . $u->info['battle'] . '" ORDER BY `id_hod` DESC LIMIT 1'));
+                                        if (isset($lastHOD['id'])) {
+                                            $btl->stats[$btl->uids[$usr['id']]]['mpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['mpNow']);
+                                            if ($btl->stats[$btl->uids[$usr['id']]]['mpNow'] > $btl->stats[$btl->uids[$usr['id']]]['mpAll']) {
+                                                $btl->stats[$btl->uids[$usr['id']]]['mpNow'] = $btl->stats[$btl->uids[$usr['id']]]['mpAll'];
+                                            }
+                                            if ($btl->stats[$btl->uids[$usr['id']]]['mpNow'] < 1) {
+                                                $btl->stats[$btl->uids[$usr['id']]]['mpNow'] = 0;
+                                            }
+                                            $id_hod = $lastHOD['id_hod'];
+                                            if ($lastHOD['type'] != 6) {
+                                                $id_hod++;
+                                            }
+                                            $txt = '<font color=#006699>' . $txt . '</font>';
+                                            if ($u->info['id'] == $usr['id']) {
+                                                if ($u->info['sex'] == 1) {
+                                                    $txt = '{u1} использовала &quot;<b>' . $itm['name'] . '</b>&quot; на себя. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['mpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['mpAll'] . '] (Мана)';
+                                                } else {
+                                                    $txt = '{u1} использовал &quot;<b>' . $itm['name'] . '</b>&quot; на себя. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['mpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['mpAll'] . '] (Мана)';
+                                                }
+                                            } else {
+                                                if ($u->info['sex'] == 1) {
+                                                    $txt = '{u1} использовала &quot;<b>' . $itm['name'] . '</b>&quot; на {u2}. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['mpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['mpAll'] . '] (Мана)';
+                                                } else {
+                                                    $txt = '{u1} использовал &quot;<b>' . $itm['name'] . '</b>&quot; на {u2}. <b>' . $txt . '</b> [' . $btl->stats[$btl->uids[$usr['id']]]['mpNow'] . '/' . $btl->stats[$btl->uids[$usr['id']]]['mpAll'] . '] (Мана)';
+                                                }
+                                            }
+                                            mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $u->info['battle'] . '","' . ($id_hod) . '","{tm1} ' . $txt . '","login1=' . $u->info['login'] . '||t1=' . $u->info['team'] . '||login2=' . $usr['login'] . '||t2=' . $usr['team'] . '||time1=' . time() . '","","","","","6")');
+                                        }
+                                    }
+                                    $itm['iznosNOW']++;
+                                    mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+
+                                    // сообщение в лог боя
+                                    $sx = 'ый';
+                                    $sx2 = '';
+                                    if ($u->info['sex'] == 1) {
+                                        $sx = 'ая';
+                                        $sx2 = 'а';
+                                    }
+                                    $u->error = 'Свиток &quot;' . $itm['name'] . '&quot; был успешно использован.';
+                                } else {
+                                    $u->error = 'Нельзя использовать на данного персонажа';
+                                }
+                            } elseif ($u->info['dnow'] != $usr['dnow']) {
+                                $u->error = 'Персонаж находится в другой комнате [пещера]';
+                            } elseif ($usr['online'] < time() - 120 && $usr['bot'] == 0) {
+                                $u->error = 'Персонаж находится в реальном мире';
+                            } elseif ($usr['room'] != $u->info['room']) {
+                                $u->error = 'Персонаж находится в другой комнате';
+                            } elseif ($usr['battle'] != $u->info['battle']) {
+                                $u->error = 'Персонаж находится в поединке';
+                            } else {
+                                //кастуем
+                                if (isset($po['magic_mpNow'])) {
+                                    mysql_query('UPDATE `stats` SET `mpNow` = `mpNow` + ' . $po['magic_mpNow'] . ' WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                }
+
+                                $itm['iznosNOW']++;
+                                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+
+                                if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                    mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                }
+
+                                // сообщение в чат
+                                $sx = 'ый';
+                                $sx2 = '';
+                                if ($u->info['sex'] == 1) {
+                                    $sx = 'ая';
+                                    $sx2 = 'а';
+                                }
+                                $u->error = 'Свиток &quot;' . $itm['name'] . '&quot; был успешно использован.';
+                                $rtxt = '[img[items/' . $itm['img'] . ']] Персонаж &quot;' . $u->info['login'] . '&quot; использовал' . $sx2 . ' &quot;' . $itm['name'] . '&quot; на &quot;' . $usr['login'] . '&quot;.';
+                                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+                            }
+                        } elseif ($itm['magic_inci'] == 'lech_1' or $itm['magic_inci'] == 'lech_2' or $itm['magic_inci'] == 'lech_3') {
+
+                            if ($u->info['battle'] > 0) {
+                                //используем свиток в поединке
+
+                            } elseif ($u->info['dnow'] != $usr['dnow']) {
+                                $u->error = 'Персонаж находится в другой комнате [пещера]';
+                            } elseif ($usr['online'] < time() - 120 && $usr['bot'] == 0) {
+                                $u->error = 'Персонаж находится в реальном мире';
+                            } elseif ($usr['room'] != $u->info['room']) {
+                                $u->error = 'Персонаж находится в другой комнате';
+                            } elseif ($usr['battle'] != $u->info['battle']) {
+                                $u->error = 'Персонаж находится в поединке';
+                            } else {
+
+                                $travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="' . $usr['id'] . '" and `id_eff`="4" and `delete`="0" ORDER BY `v1` DESC LIMIT 1'));
+                                //$type_lechenie = $travm['v1'];
+                                $itm['magic_inci'] = 'lech_' . $travm['v1'];
+                                if ($itm['magic_inci'] == 'lech_1') {
+                                    $type_lechenie = 1; // тип травмы котору лечим
+                                    $text_msg = '&quot;Легкой травмы&quot;';
+                                    $text_msg2 = 'легких';
+                                } elseif ($itm['magic_inci'] == 'lech_2') {
+                                    $type_lechenie = 2; // тип травмы котору лечим
+                                    $text_msg = '&quot;Средней травмы&quot;';
+                                    $text_msg2 = 'средних';
+                                } elseif ($itm['magic_inci'] == 'lech_3') {
+                                    $type_lechenie = 3; // тип травмы котору лечим
+                                    $text_msg = '&quot;Тяжелой травмы&quot;';
+                                    $text_msg2 = 'тяжелых';
+                                }
+                                if ($travm) {
+                                    $lech_aa = [0, 2, 3, 4];
+                                    $travm_cep = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="' . $usr['id'] . '" and `id_eff`="335" and `delete`="0" and `v1`="' . $type_lechenie . '" LIMIT 1'));
+                                    if ($travm_cep['timeUse'] < time() - 360) {
+                                        unset($travm_cep);
+                                    }
+
+                                    $cep_users = explode(',', $travm_cep['data']);
+                                    $it_i = 0;
+                                    $it_no = 0;
+                                    $it_users = '';
+                                    while ($it_i < count($cep_users)) {
+                                        $it_u = $cep_users[$it_i];
+                                        if ($it_u == $u->info['id']) {
+                                            $it_no = 1;
+                                        }
+                                        $it_u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`room` FROM `users` WHERE `id` = "' . $it_u . '" LIMIT 1'));
+                                        if (isset($it_u['id'])) {
+                                            $it_users .= ', ' . $it_u['login'] . '';
+                                        }
+                                        $it_i++;
+                                    }
+                                    $it_u = ltrim($it_u, ', ');
+
+                                    $lech_co = round($travm_cep['x'] + 1);
+                                    if ($it_no == 1) {
+                                        $u->error = 'Вы уже один из лекарей';
+                                    } elseif ($lech_co >= $lech_aa[$type_lechenie]) {
+                                        mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1');
+                                        $itm['iznosNOW']++;
+                                        mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                        if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                            mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                        }
+
+                                        $rtxt = '[img[items/cure_g1.gif]] Лекарь &quot;' . $u->info['login'] . '&quot; кинул цепь исцеления на игрока &quot;' . $usr['login'] . '&quot;.';
+                                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+
+                                        //mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
+                                        mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1');
+
+                                        // сообщение в чат
+                                        $u->error = 'Персонаж излечен от ' . $text_msg . '.';
+                                        $rtxt = '[img[items/cure' . $type_lechenie . '.gif]] Лекари &quot;' . $u->info['login'] . $it_users . '&quot; вылечили от ' . $text_msg . ' игрока &quot;' . $usr['login'] . '&quot;.';
+                                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+                                    } else {
+                                        if (isset($travm_cep['id'])) {
+                                            $travm_cep['x']++;
+                                            $u->error = 'Вы присоединились к цепи исцеления для &quot;' . $text_msg . '&quot; (исцеление ' . $text_msg2 . ' травм)';
+                                            mysql_query('UPDATE `eff_users` SET `x` = "' . $travm_cep['x'] . '"
+												,`data` = "' . $travm_cep['data'] . ',' . $u->info['id'] . '"
+												WHERE `id` = "' . $travm_cep['id'] . '" LIMIT 1');
+                                        } else {
+                                            $u->error = 'Вы создали цепь исцеления для &quot;' . $text_msg . '&quot; (исцеление ' . $text_msg2 . ' травм), у остальных лекарей есть 5 минут, чтобы завершить заклинание';
+                                            mysql_query('INSERT INTO `eff_users`
+												(
+													`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x`
+												) VALUES (
+													"335","' . $usr['id'] . '","Цепь исцеления","' . $u->info['id'] . '","28","' . time() . '","' . $u->info['id'] . '","' . $type_lechenie . '","1"
+												)');
+                                        }
+                                        //mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
+                                        $itm['iznosNOW']++;
+                                        mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                        if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                            mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                        }
+                                        // сообщение в чат
+                                        $rtxt = '[img[items/cure_g1.gif]] Лекарь &quot;' . $u->info['login'] . '&quot; кинул цепь исцеления на игрока &quot;' . $usr['login'] . '&quot;.';
+                                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+
+                                    }
+                                } else {
+                                    $u->error = 'Персонаж не имеет данной травмы.';
+                                }
+
+                            }
+
+
+                        } elseif ($itm['magic_inci'] == 'lech_free_1' or $itm['magic_inci'] == 'lech_free_2' or $itm['magic_inci'] == 'lech_free_3') {
+
+                            if ($u->info['battle'] > 0) {
+                                //используем свиток в поединке
+
+                            } elseif ($u->info['dnow'] != $usr['dnow']) {
+                                $u->error = 'Персонаж находится в другой комнате [пещера]';
+                            } elseif ($usr['online'] < time() - 120 && $usr['bot'] == 0) {
+                                $u->error = 'Персонаж находится в реальном мире';
+                            } elseif ($usr['room'] != $u->info['room']) {
+                                $u->error = 'Персонаж находится в другой комнате';
+                            } elseif ($usr['battle'] != $u->info['battle']) {
+                                $u->error = 'Персонаж находится в поединке';
+                            } else {
+
+                                $travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="' . $usr['id'] . '" and `id_eff`="4" and `delete`="0" ORDER BY `v1` DESC LIMIT 1'));
+                                //$type_lechenie = $travm['v1'];
+                                //$itm['magic_inci'] = 'lech_free_'.$travm['v1'];
+                                if ($itm['magic_inci'] == 'lech_free_1') {
+                                    $type_lechenie = 1; // тип травмы котору лечим
+                                    $text_msg = '&quot;Легкой травмы&quot;';
+                                    $text_msg2 = 'легких';
+                                } elseif ($itm['magic_inci'] == 'lech_free_2') {
+                                    $type_lechenie = 2; // тип травмы котору лечим
+                                    $text_msg = '&quot;Средней травмы&quot;';
+                                    $text_msg2 = 'средних';
+                                } elseif ($itm['magic_inci'] == 'lech_free_3') {
+                                    $type_lechenie = 3; // тип травмы котору лечим
+                                    $text_msg = '&quot;Тяжелой травмы&quot;';
+                                    $text_msg2 = 'тяжелых';
+                                }
+                                if ($travm['v1'] != $type_lechenie) {
+                                    $u->error = 'Неподходящий свиток для данной травмы.';
+                                } elseif ($travm['id']) {
+                                    $lech_aa = [0, 0, 0, 0];
+                                    $travm_cep = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="' . $usr['id'] . '" and `id_eff`="335" and `delete`="0" and `v1`="' . $type_lechenie . '" LIMIT 1'));
+                                    if ($travm_cep['timeUse'] < time() - 360) {
+                                        unset($travm_cep);
+                                    }
+
+                                    $cep_users = explode(',', $travm_cep['data']);
+                                    $it_i = 0;
+                                    $it_no = 0;
+                                    $it_users = '';
+                                    while ($it_i < count($cep_users)) {
+                                        $it_u = $cep_users[$it_i];
+                                        if ($it_u == $u->info['id']) {
+                                            $it_no = 1;
+                                        }
+                                        $it_u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`room` FROM `users` WHERE `id` = "' . $it_u . '" LIMIT 1'));
+                                        if (isset($it_u['id'])) {
+                                            $it_users .= ', ' . $it_u['login'] . '';
+                                        }
+                                        $it_i++;
+                                    }
+                                    $it_u = ltrim($it_u, ', ');
+
+                                    $lech_co = round($travm_cep['x'] + 1);
+                                    if ($it_no == 1) {
+                                        $u->error = 'Вы уже один из лекарей';
+                                    } elseif ($lech_co >= $lech_aa[$type_lechenie]) {
+                                        mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1');
+                                        $itm['iznosNOW']++;
+                                        mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                        if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                            mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                        }
+
+                                        mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1');
+
+                                        // сообщение в чат
+                                        $u->error = 'Персонаж излечен от ' . $text_msg . '.';
+                                        $rtxt = '[img[items/cure' . $type_lechenie . '.gif]] Лекари &quot;' . $u->info['login'] . $it_users . '&quot; вылечили от ' . $text_msg . ' игрока &quot;' . $usr['login'] . '&quot;.';
+                                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+                                    } else {
+                                        if (isset($travm_cep['id'])) {
+                                            $travm_cep['x']++;
+                                            $u->error = 'Вы присоединились к цепи исцеления для &quot;' . $text_msg . '&quot; (исцеление ' . $text_msg2 . ' травм)';
+                                            mysql_query('UPDATE `eff_users` SET `x` = "' . $travm_cep['x'] . '"
+												,`data` = "' . $travm_cep['data'] . ',' . $u->info['id'] . '"
+												WHERE `id` = "' . $travm_cep['id'] . '" LIMIT 1');
+                                        } else {
+                                            $u->error = 'Вы создали цепь исцеления для &quot;' . $text_msg . '&quot; (исцеление ' . $text_msg2 . ' травм), у остальных лекарей есть 5 минут, чтобы завершить заклинание';
+                                            mysql_query('INSERT INTO `eff_users`
+												(
+													`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x`
+												) VALUES (
+													"335","' . $usr['id'] . '","Цепь исцеления","' . $u->info['id'] . '","28","' . time() . '","' . $u->info['id'] . '","' . $type_lechenie . '","1"
+												)');
+                                        }
+                                        $itm['iznosNOW']++;
+                                        mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                        if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                            mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                        }
+                                        // сообщение в чат
+                                        $rtxt = '[img[items/cure_g1.gif]] Лекарь &quot;' . $u->info['login'] . '&quot; кинул цепь исцеления на игрока &quot;' . $usr['login'] . '&quot;.';
+                                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $u->info['city'] . "','" . $u->info['room'] . "','','','" . $rtxt . "','" . time() . "','6','0','1')");
+
+                                    }
+                                } else {
+                                    $u->error = 'Персонаж не имеет данной травмы.';
+                                }
+
+                            }
+
+
+                        } else {
+                            if ($u->info['id'] != $usr['id']) {
+                                $lsct = mysql_fetch_array(mysql_query('SELECT `id_eff` FROM `eff_users` WHERE `uid` = "' . $usr['id'] . '" AND `delete` = "0" AND (`overType` = "' . $itm['overType'] . '" OR (`id_eff` = "' . $itm['magic_inc'] . '" AND "' . (0 + $st['onlyOne']) . '" != "0")) LIMIT 1'));
+                                $lsct['good'] = 1;
+                                //Касты
+                                if ($lsct['id_eff'] >= 291 && $lsct['id_eff'] <= 296 && $itm['magic_inc'] >= 291 && $itm['magic_inc'] <= 296) {
+                                    if ($lsct['id_eff'] > $itm['magic_inc']) {
+                                        $u->error = 'На персонаже есть каст лучше этого!';
+                                        $lsct['good'] = 0;
+                                    }
+                                }
+                            } else {
+                                $lsct['good'] = 1;
+                            }
+                            //просто используем на персонажа
+                            if ($lsct['good'] == 0) {
+
+                            } elseif ($u->info['dnow'] != $usr['dnow']) {
+                                $u->error = 'Персонаж находится в другой комнате [пещера]';
+                            } elseif ($usr['room'] == 217 || $usr['room'] == 218 || $usr['room'] == 219) {
+                                $u->error = 'Персонаж ' . $u->microLogin($usr['id'], 1) . ' находится в Общежитии!';
+                            } elseif ($usr['inTurnir'] != 0 && ($u->info['inTurnir'] != $usr['inTurnir'])) {
+                                $u->error = 'Участвует в турнире Башни смерти...';
+                            } elseif ($usr['id'] == $u->info['id'] && isset($st['useOnlyUser'])) {
+                                $u->error = 'Нельзя использовать это заклятие на самого себя';
+                            } elseif ($usr['online'] < time() - 120 && $usr['bot'] == 0) {
+                                $u->error = 'Персонаж находится в реальном мире ;)';
+                            } elseif ($usr['room'] != $u->info['room'] && $usr['battle'] != $u->info['battle'] && $u->info['battle'] > 0) {
+                                $u->error = 'Персонаж находится в другой комнате [' . $usr['room'] . ' ' . $u->info['room'] . ']';
+                            } elseif ($usr['admin'] > 0 && $u->info['admin'] == 0 && isset($st['useNoAdmin'])) {
+                                $u->error = 'Нельзя использовать данное заклятие на Ангелов';
+                            } elseif ($usr['battle'] > 0 && $u->info['battle'] != $usr['battle']) {
+                                $u->error = 'Персонаж находится в бою';
+                            } elseif (($u->info['align'] == 2 || $u->info['haos'] > time()) && isset($st['nohaos'])) {
+                                $u->error = 'Хаосники не могут использовать данное заклятие';
+                            } else {
+                                //добавляем эффект персонажу
+                                $goodUse = 1;
+                                //
+                                $tpsm = 0;
+                                if ($itm['useInBattle'] == 0 && $usr['battle'] > 0) {
+                                    //Нельзя юзать
+                                    $goodUse = 0;
+                                } else {
+                                    if ($usr['battle'] > 0) {
+                                        global $btl;
+                                        if ($u->info['team'] != $btl->users[$btl->uids[$usr['id']]]['team']) {
+                                            if ($itm['useInBattle'] == 1) {
+                                                $goodUse = 0;
+                                            }
+                                            $tpsm = 2;
+                                        } elseif ($u->info['team'] == $btl->users[$btl->uids[$usr['id']]]['team']) {
+                                            if ($itm['useInBattle'] == 2) {
+                                                $goodUse = 0;
+                                            }
+                                            $tpsm = 1;
+                                        }
+                                    }
+                                }
+                                //
+                                if ($goodUse == 1) {
+                                    if (isset($st['onlyOne'])) {
+                                        //убираем прошлые эффекты
+                                        $goodUse = 0;
+                                        $upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"');
+                                        if ($upd1) {
+                                            $goodUse = 1;
+                                        }
+                                    }
+                                    if (isset($st['oneType'])) {
+                                        //убираем прошлые эффекты
+                                        $goodUse = 0;
+                                        $upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $usr['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"');
+                                        if ($upd1) {
+                                            $goodUse = 1;
+                                        }
+                                    }
+                                }
+                                //
+                                if ($goodUse == 1 && $itm['magic_inc'] == 'unclone') {
+                                    //Переманить клона
+                                    if ($usr['clone'] > 0 && $usr['hpNow'] >= 1 && $usr['team'] != $u->info['team']) {
+                                        mysql_query('UPDATE `stats` SET `team` = "' . $u->info['team'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                        if ($u->info['sex'] == 0) {
+                                            $txt_m = '{u1} <b>переманил клона</b> {u2} на свою сторону.';
+                                        } else {
+                                            $txt_m = '{u1} <b>переманила</b> клона {u2} на свою сторону.';
+                                        }
+                                        $this->inBattleLog($txt_m, $usr);
+                                        mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . ($itm['iznosNOW'] + 1) . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                        mysql_query('UPDATE `items_users` SET `btl_zd` = "1" WHERE `item_id` = "' . $itm['item_id'] . '" AND `inOdet` > 0 AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" LIMIT 20');
+                                        $u->error = 'Вы успешно использовали заклинание &quot;' . $itm['name'] . '&quot; на &quot;' . $usr['login'] . '&quot;';
+                                    } else {
+                                        $u->error = 'Вы не можете переманивать данного персонажа...';
+                                    }
+                                } elseif ($goodUse == 1) {
+                                    $us = $this->add_eff($usr['id'], $itm['magic_inc']);
+                                    if ($us[0] == 1) {
+                                        $mmmid = mysql_insert_id();
+                                        $itm['iznosNOW']++;
+                                        mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                        if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                            mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                        }
+                                        if ($u->info['id'] != $usr['id']) {
+                                            $u->addDelo(1, $u->info['id'], '&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж использовал заклинание &quot;' . $itm['name'] . '&quot; (' . $us[1] . ') на персонажа &quot;' . $usr['login'] . '&quot; (id' . $usr['id'] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0);
+                                            $u->addDelo(1, $usr['id'], '&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж &quot;' . $u->info['login'] . '&quot; (id' . $u->info['id'] . ') использовал заклинание &quot;' . $itm['name'] . '&quot; (' . $us[1] . ') на персонажа [itm:' . $itm['id'] . '].', time(), $usr['city'], 'System.inventory', 0, 0);
+                                            $u->error = 'Вы успешно использовали заклинание &quot;' . $itm['name'] . '&quot; на персонажа &quot;' . $usr['login'] . '&quot;<br>' . $us[1] . '';
+                                        } else {
+                                            $u->addDelo(1, $u->info['id'], '&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж использовал заклинание &quot;' . $itm['name'] . '&quot; (' . $us[1] . ') на персонажа самого себя [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0);
+                                            $u->error = 'Вы успешно использовали заклинание &quot;' . $itm['name'] . '&quot; на самого себя<br>' . $us[1] . '';
+
+                                        }
+                                        //
+                                        if ($usr['battle'] > 0) {
+                                            //Заносим в лог
+                                            $txt_m = '';
+                                            if ($u->info['sex'] == 0) {
+                                                if ($u->info['id'] != $usr['id']) {
+                                                    $txt_m .= '{u1} воспользовался магией &quot;<b>' . $itm['name'] . '</b>&quot; на {u2}.';
+                                                } else {
+                                                    $txt_m .= '{u1} воспользовался магией &quot;<b>' . $itm['name'] . '</b>&quot; на себя.';
+                                                }
+                                            } else {
+                                                if ($u->info['id'] != $usr['id']) {
+                                                    $txt_m .= '{u1} воспользовалась магией &quot;<b>' . $itm['name'] . '</b>&quot; на {u2}.';
+                                                } else {
+                                                    $txt_m .= '{u1} воспользовалась магией &quot;<b>' . $itm['name'] . '</b>&quot; на себя.';
+                                                }
+                                            }
+                                            $this->inBattleLog($txt_m, $usr);
+                                            //
+                                            //По завершению боя эффект должен слетать
+                                            //306 - положительное , 307 - отрицательное
+                                            if ($tpsm == 1) {
+                                                //306
+                                                mysql_query('UPDATE `eff_users` SET `v1` = "priem",`v2` = "306",`timeUse` = "77",`hod` = "-1",`img2` = "' . $itm['img'] . '" WHERE `id` = "' . $mmmid . '" LIMIT 1');
+                                            } elseif ($tpsm == 2) {
+                                                //307
+                                                mysql_query('UPDATE `eff_users` SET `v1` = "priem",`v2` = "307",`timeUse` = "77",`hod` = "-1",`img2` = "' . $itm['img'] . '" WHERE `id` = "' . $mmmid . '" LIMIT 1');
+                                            }
+                                            //
+                                        }
+                                        //
+                                        $this->youuse++;
+                                    } else {
+                                        $u->error = 'Не удалось использовать "' . $itm['name'] . '" ... (' . $itm['magin_inc'] . ' and ' . $itm['magic_inci'] . ', Эффект не добавлен)';
+                                    }
+                                } else {
+                                    $u->error = 'Не удалось использовать "' . $itm['name'] . '"';
+                                }
+                            }
+                        }
+                    } else {
+                        $u->error = 'Персонаж "' . $jl . '" не найден в этом городе (' . $u->info['city'] . ')';
+                    }
+                } elseif (isset($st['useOnItem']) && $st['useOnItem'] == 1) {
+                    //используем на предмет
+
+                } else {
+                    //на себя
+                    $goodUse = 1;
+                    if (($u->info['align'] == 2 || $u->info['haos'] > time()) && isset($st['nohaos'])) {
+                        $goodUse = 0;
+                        $u->error = 'Хаосники не могут использовать данное заклятие';
+                    }
+
+                    if ($itm['magic_inci'] == 'sanich2') {
+                        if ($u->info['battle'] == 0) {
+                            $sz = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich2" AND `time` > ' . (time() - 4 * 60 * 60) . ' LIMIT 1', 1);
+                            if (!isset($sz['id'])) {
+                                $slech = rand(0, 4);
+                                $goodUse = 0;
+                                if ($slech == 1) {
+                                    //3083 Настойка на жучьей требухе
+                                    //$this->add_eff($u->info['id'],3083);
+                                    mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 290 AND `delete` =0');
+                                    $this->add_eff($u->info['id'], 290);
+                                    $echotext = 'Настойка на жучьей требухе!';
+                                    $u->error = 'Вы получили эфект от ' . $echotext . '';
+                                } elseif ($slech == 2) {
+                                    //5239 Амброзия подмастерья Владык
+                                    //$this->add_eff($u->info['id'],5239);
+                                    mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 472 AND `delete` =0');
+                                    mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 470 AND `delete` =0');
+                                    $this->add_eff($u->info['id'], 472);
+                                    $echotext = 'Амброзия подмастерья Владык!';
+                                    $u->error = 'Вы получили эфект от ' . $echotext . '';
+                                } elseif ($slech == 3) {
+                                    //5069 Амброзия Скучающих Владык
+                                    //$this->add_eff($u->info['id'],470);
+                                    mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 472 AND `delete` =0');
+                                    mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 470 AND `delete` =0');
+                                    $this->add_eff($u->info['id'], 470);
+                                    $echotext = 'Амброзия Скучающих Владык!';
+                                    $u->error = 'Вы получили эфект от ' . $echotext . '';
+                                } elseif ($slech == 4) {
+                                    //1463 Звездное Сияние
+                                    //$this->add_eff($u->info['id'],1463);
+                                    mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $u->info['id'] . '" AND `id_eff` = 35 AND `delete` =0');
+                                    $this->add_eff($u->info['id'], 35);
+                                    $echotext = 'Звездное Сияние!';
+                                    $u->error = 'Вы получили эфект от ' . $echotext . '';
+                                } else {
+                                    $slech = 1;
+
+                                    $echotext = 'Не удалось прочитать страницу!';
+                                    $u->error = ' ' . $echotext . ' ';
+                                }
+
+                                $itm['iznosNOW'] += $slech;
+                                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                $u->addAction(time(), 'sanich2', $slech);
+
+                                if ($u->info['sex'] == 1) {
+                                    $rtxt = '[img[items/' . $itm['img'] . ']] &quot;' . $u->info['login'] . '&quot; использовала &quot;' . $itm['name'] . ' Саныча&quot; и получила эффект ' . $echotext . ' травмы.';
+                                } else {
+                                    $rtxt = '[img[items/' . $itm['img'] . ']] &quot;' . $u->info['login'] . '&quot; использовал &quot;' . $itm['name'] . ' Саныча&quot; и получил эффект ' . $echotext . ' травмы.';
+                                }
+
+                            } else {
+                                $u->error = 'Задержка использования ' . $u->timeOut(($sz['time'] + 4 * 60 * 60) - time()) . '.';
+                            }
+                        } else {
+                            $u->error = 'Невозможно использовать в бою';
+                        }
+
+                    } elseif ($itm['magic_inci'] == 'sanich1' && $u->info['battle'] > 0) {
+
+                        $sz = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich1" AND `time` > ' . (time() - 6 * 60) . ' LIMIT 1', 1);
+                        if (!isset($sz['id'])) {
+                            $goodUse = 0;
+                            $u->error = 'Вы успешно использовали &quot;' . $itm['name'] . '&quot;';
+                            $z = 1;
+                            while ($z <= 5) {
+                                $u->info['tactic' . $z]++;
+                                if ($u->info['tactic' . $z] > 25) {
+                                    $u->info['tactic' . $z] = 25;
+                                } elseif ($u->info['tactic' . $z] < 0) {
+                                    $u->info['tactic' . $z] = 0;
+                                }
+                                $z++;
+                            }
+                            if ($u->info['sex'] == 1) {
+                                $this->inBattleLog('{u1} использовала &quot;<b>' . $itm['name'] . ' Саныча</b>&quot;.');
+                            } else {
+                                $this->inBattleLog('{u1} использовал &quot;<b>' . $itm['name'] . ' Саныча</b>&quot;.');
+                            }
+                            mysql_query('UPDATE `stats` SET `tactic1` = "' . $u->info['tactic1'] . '",`tactic2` = "' . $u->info['tactic2'] . '",`tactic3` = "' . $u->info['tactic3'] . '",`tactic4` = "' . $u->info['tactic4'] . '",`tactic5` = "' . $u->info['tactic5'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                            $itm['iznosNOW']++;
+                            mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                            $u->addAction(time(), 'sanich1', $u->info['battle']);
+                        } else {
+                            $u->error = 'Задержка использования ' . $u->timeOut(($sz['time'] + 6 * 60) - time()) . '.';
+                        }
+
+                    } elseif ($itm['magic_inci'] == 'sanich3' && $u->info['battle'] > 0) {
+
+                        $sz = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "sanich3" AND `time` > ' . (time() - 3 * 60 * 60) . ' LIMIT 1', 1);
+                        if (!isset($sz['id'])) {
+
+                            $usr = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`level`,`s`.`hpNow`,`s`.`team`,`u`.`login`,`u`.`sex` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`id` = "' . $u->info['enemy'] . '" AND `u`.`battle` = "' . $u->info['battle'] . '" LIMIT 1'));
+                            if (isset($usr['id']) && $usr['hpNow'] >= 1) {
+                                $iznslvl = $usr['level'];
+
+                                $goodUse = 0;
+                                $u->error = 'Вы успешно использовали &quot;' . $itm['name'] . '&quot; на ' . $usr['login'] . '';
+
+                                if ($u->info['sex'] == 1) {
+                                    $this->inBattleLog('{u1} использовала &quot;<b>' . $itm['name'] . ' Саныча</b>&quot; на {u2}.', $usr);
+                                } else {
+                                    $this->inBattleLog('{u1} использовал &quot;<b>' . $itm['name'] . ' Саныча</b>&quot; на {u2}.', $usr);
+                                }
+
+                                mysql_query('UPDATE `stats` SET `hpNow` = "' . $usr['hpNow'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                mysql_query('UPDATE `stats` SET `hpNow` = "' . $u->stats['hpNow'] . '" WHERE `id` = "' . $usr['id'] . '" LIMIT 1');
+                                $itm['iznosNOW'] += $iznslvl;
+                                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                $u->addAction(time(), 'sanich3', $u->info['battle']);
+                            } else {
+                                $u->error = 'Нет подходящего противника';
+                            }
+
+                        } else {
+                            $u->error = 'Задержка использования ' . $u->timeOut(($sz['time'] + 3 * 60 * 60) - time()) . '.';
+                        }
+
+                    } elseif ($itm['magic_inci'] == 'lech') {
+                        $goodUse = 0;
+                        if ($u->info['level'] >= 2 and $u->info['level'] <= 13) {
+                            $travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="' . $u->info['id'] . '" and `id_eff`="4" and `delete`="0" LIMIT 1'));
+                            if ($travm && $travm['v1'] == 4)
+                                $u->error = 'У вас неизлечимая травма, вам помогут только боги или время.';
+                            elseif ($travm) {
+                                mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $travm['id'] . '" LIMIT 1');
+                                $itm['iznosNOW']++;
+                                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                    mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                }
+                            } else {
+                                $u->error = 'У вас нету травмы.';
+                            }
+                        } else {
+                            $u->error = 'Ваш уровень не подходит для использования свитка.';
+                        }
+                    }
+
+
+                    if ($goodUse == 1) {
+
+                        $upd1 = 1;
+                        $upd2 = 1;
+                        //добавляем эффект персонажу
+                        if (isset($st['onlyOne'])) {
+                            //убираем прошлые эффекты
+                            $goodUse = 0;
+                            $upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `id_eff` = "' . $itm['magic_inc'] . '"');
+                            if ($upd1) {
+                                $goodUse = 1;
+                            }
+                        }
+                        if (isset($st['oneType'])) {
+                            //убираем прошлые эффекты
+                            $goodUse = 0;
+                            $upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `delete` = "0" AND `overType` = "' . $itm['overType'] . '"');
+                            if ($upd1) {
+                                $goodUse = 1;
+                            }
+                        }
+
+                        if ($itm['magic_inci'] == 'unclone') {
+                            //Свиток клонирования
+                            if ($u->info['hpNow'] < 1) {
+                                $u->error = 'Вам не удалось переманить клона...';
+                            } elseif ($u->info['battle'] == 0) {
+                                $u->error = 'Можно использовать только в поединке...';
+                            } else {
+                                //Преманиваем
+                                $u->error = 'Переманили...';
+                            }
+                        } elseif ($itm['magic_inci'] == 'cloneMe') {
+                            //Свиток клонирования
+                            if (true == false) {
+                                $u->error = 'Свитки клонирования запрещены в нашем проекте.';
+                            } elseif ($u->info['hpNow'] < 1) {
+                                $u->error = 'Вы успешно клонировали свой труп ;)';
+                            } elseif ($u->info['battle'] == 0) {
+                                $u->error = 'Можно использовать только в поединке...';
+                            } else {
+                                $bot_cou = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `login` LIKE "%' . $u->info['login'] . ' (клон%" AND `battle` = "' . $u->info['battle'] . '" LIMIT 1'));
+                                $bot_cou = $bot_cou[0] + 1;
+                                //Добавляем бота
+                                $clone = [
+                                    'id' => $u->info['id'],
+                                    'login' => $u->info['login'] . ' (клон ' . $bot_cou . ')',
+                                    'level' => $u->info['level'],
+                                    'city' => $u->info['city'],
+                                    'cityreg' => $u->info['cityreg'],
+                                    'name' => $u->info['name'],
+                                    'sex' => $u->info['sex'],
+                                    'deviz' => $u->info['deviz'],
+                                    'hobby' => $u->info['hobby'],
+                                    'time_reg' => $u->info['time_reg'],
+                                    'obraz' => $u->info['obraz'],
+                                    'stats' => $u->info['stats'],
+                                    'upLevel' => $u->info['upLevel'],
+                                    'priems' => $u->info['priems'],
+                                    'loclon' => true,
+                                    'inTurnir' => $u->info['inTurnir']
+                                ];
+                                $bot = $u->addNewbot(1, null, $clone, null, true);
+                                if ($bot > 0) {
+                                    mysql_query('UPDATE `stats` SET `team` = "' . $u->info['team'] . '",`hpNow` = "' . $u->stats['hpNow'] . '",`mpNow` = "' . $u->stats['mpNow'] . '" WHERE `id` = "' . $bot . '" LIMIT 1');
+                                    mysql_query('UPDATE `users` SET `battle` = "' . $u->info['battle'] . '" WHERE `id` = "' . $bot . '" LIMIT 1');
+                                    //Доабвляем лог
+                                    if ($u->info['sex'] == 0) {
+                                        $txt_m = '{u1} использовал &quot;' . $itm['name'] . '&quot; и <b>породил клона</b>.';
+                                    } else {
+                                        $txt_m = '{u1} использовала &quot;' . $itm['name'] . '&quot; и <b>породила клона</b>.';
+                                    }
+                                    $this->inBattleLog($txt_m, null);
+                                    if ($u->info['sex'] == 0) {
+                                        $txt_m = '<b>' . $u->info['login'] . ' (клон ' . $bot_cou . ')</b>[' . $u->info['level'] . '] вмешался в поединок!';
+                                    } else {
+                                        $txt_m = '<b>' . $u->info['login'] . ' (клон ' . $bot_cou . ')</b>[' . $u->info['level'] . '] вмешалась в поединок!';
+                                    }
+                                    $this->inBattleLog($txt_m, $usr_m);
+                                    mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . ($itm['iznosNOW'] + 1) . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                    mysql_query('UPDATE `items_users` SET `btl_zd` = "1" WHERE `item_id` = "' . $itm['item_id'] . '" AND `inOdet` > 0 AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" LIMIT 20');
+                                    $u->error = 'Заклятие &quot;' . $itm['name'] . '&quot; было успешно использовано';
+                                } else {
+                                    $u->error = 'Неудалось использовать заклятие...';
+                                }
+                                unset($txt_m, $usr_m, $clone, $bot_cou, $bot);
+                            }
+
+                        } elseif ($itm['magic_inci'] == 'scan') {
+                            if ($u->info['inTurnir'] != 0) {
+                                $sp = mysql_query('SELECT `st`.*, `u`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `inTurnir` = "' . $u->info['inTurnir'] . '"');
+                                while ($pl = mysql_fetch_array($sp)) {
+                                    $rrm = mysql_fetch_array(mysql_query('SELECT * FROM `bs_map` WHERE `x` = "' . $pl['x'] . '" AND `y` = "' . $pl['y'] . '"'));
+                                    $trnt .= $pl['login'] . ' Комната : ' . $rrm['name'] . ', ';
+                                }
+                                $trnt = rtrim($trnt, ', ');
+                                $it_ = $u->addItem(2435, $u->info['id'], 'noodet=1|noremont=1|sudba=' . $u->info['login'] . '');
+                                mysql_query('UPDATE `items_users` SET `use_text` = 500 WHERE `id` = "' . $it_ . '" LIMIT 1');
+                                mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`,`type`) VALUES ("' . $it_ . '","' . time() . '","","' . mysql_real_escape_string($trnt) . '","' . $u->info['city'] . '","1","1")');
+                                mysql_query('DELETE FROM `items_users` WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                $u->error = 'Вы получили выписку...';
+
+                            } else {
+                                $u->error = 'Используется только в Башне смерти...';
+                            }
+                        } elseif ($itm['magic_inci'] == 'tactic') {
+                            //Выдаем тактику
+                            if ($u->stats['hpNow'] >= 1) {
+
+                                $bu = mysql_fetch_array(mysql_query('SELECT * FROM `tactic` WHERE `btl` = "' . $u->info['battle'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1'));
+                                if (isset($bu['id'])) {
+                                    $u->error = 'Нельзя использовать свиток каждый ход...';
+                                } else {
+                                    //
+                                    mysql_query('INSERT INTO `tactic` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ("' . $u->info['battle'] . '","' . $u->info['id'] . '","' . time() . '","' . $itm['item_id'] . '","' . $itm['name'] . '","1")');
+                                    //
+                                    mysql_query('INSERT INTO `battle_actions` (`uid`,`btl`,`time`,`vars`,`vals`) VALUES (
+											"' . $u->info['id'] . '","' . $u->info['battle'] . '","' . time() . '","use_cast_tactic",""
 										)');
-										$u->info['tactic'.$st['addtac']] += $st['addtacv'];
-										mysql_query('UPDATE `stats` SET `tactic'.$st['addtac'].'` = "'.$u->info['tactic'.$st['addtac']].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-										//��������� ���
-										if( $u->info['sex'] == 0 ) {
-											$txt_m = '{u1} �������� ���������� &quot;<b>'.$itm['name'].'</b>&quot;.';
-										}else{
-											$txt_m = '{u1} ��������� ���������� &quot;<b>'.$itm['name'].'</b>&quot;.';
-										}
-										$this->inBattleLog($txt_m,NULL);
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.($itm['iznosNOW'] + 1).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										$u->error = '�������� &quot;'.$itm['name'].'&quot; ���� ������� ������������';
-									}
-							}else{
-								$u->error = '�� �������...';
-							}
-						}elseif($itm['magic_inci']=='add_animal')
-						{
-							if($u->info['animal']>0)
-							{
-								$u->error = '�� ������� ������������ "'.$itm['name'].'", � ��� ��� ���� �����.';
-							}else{
-								$anm = array('type'=>1,'name'=>'','obraz'=>'','stats'=>'','sex'=>0);
-								
-								//�������� ��� �����
-								
-								if($itm['name'] == '�������� ����') {
-									$anm['type'] = 2;
-								}elseif($itm['name'] == '�������� ��������') {
-									$anm['type'] = 3;
-								}elseif($itm['name'] == '�������� ����') {
-									$anm['type'] = 1;
-								}elseif($itm['name'] == '�������� �������') {
+                                    $u->info['tactic' . $st['addtac']] += $st['addtacv'];
+                                    mysql_query('UPDATE `stats` SET `tactic' . $st['addtac'] . '` = "' . $u->info['tactic' . $st['addtac']] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                    //Доабвляем лог
+                                    if ($u->info['sex'] == 0) {
+                                        $txt_m = '{u1} применил заклинание &quot;<b>' . $itm['name'] . '</b>&quot;.';
+                                    } else {
+                                        $txt_m = '{u1} применила заклинание &quot;<b>' . $itm['name'] . '</b>&quot;.';
+                                    }
+                                    $this->inBattleLog($txt_m, null);
+                                    mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . ($itm['iznosNOW'] + 1) . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                    $u->error = 'Заклятие &quot;' . $itm['name'] . '&quot; было успешно использовано';
+                                }
+                            } else {
+                                $u->error = 'Вы погибли...';
+                            }
+                        } elseif ($itm['magic_inci'] == 'add_animal') {
+                            if ($u->info['animal'] > 0) {
+                                $u->error = 'Не удалось использовать "' . $itm['name'] . '", у Вас уже есть зверь.';
+                            } else {
+                                $anm = ['type' => 1, 'name' => '', 'obraz' => '', 'stats' => '', 'sex' => 0];
 
-									$anm['type'] = 4;
-								}elseif($itm['name'] == '�������� �����') {
-									$anm['type'] = 6;
-								}elseif($itm['name'] == '�������� ���') {
-									$anm['type'] = 5;
-								}elseif($itm['name'] == '�������� �������') {
-									$anm['type'] = 7;
-								
-								if($anm['type']==1)
-								{
-									$anm['name'] = '���';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'20864.gif',2=>'21301.gif',3=>'21139.gif',4=>'20427.gif');
-									$anm['stats'] = 's1=2|s2=5|s3=2|s4=5|rinv=40|m9=5|m6=10';
-								}elseif($anm['type']==7)
-								{
-									$anm['name'] = '������';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'21338_pgtpdbx.gif');
-									$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';									
-								}									
-								}elseif($anm['type']==2)
-								{
-									$anm['name'] = '����';
-									$anm['sex'] = 1;
-									$anm['obraz'] = array(1=>'21415.gif',2=>'21722.gif',3=>'21550.gif');
-									$anm['stats'] = 's1=2|s2=2|s3=5|s4=5|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==3)
-								{
-									$anm['name'] = '�������';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'22277.gif',2=>'22265.gif',3=>'22333.gif',4=>'22298.gif');
-									$anm['stats'] = 's1=3|s2=10|s3=3|s4=4|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==4)
-								{
-									$anm['name'] = '�������';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'22177.gif',2=>'21976.gif',3=>'21877.gif');
-									$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==5)
-								{
-									$anm['name'] = '���';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'22352.gif',2=>'23024.gif',3=>'22900.gif',4=>'22501.gif',5=>'22700.gif');
-									$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==6)
-								{
-									$anm['name'] = '����';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'24000.gif',2=>'25000.gif',3=>'27000.gif',4=>'28000.gif');
-									$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';									
-								}
-								$anm['obraz'] = $anm['obraz'][rand(1,count($anm['obraz']))];
-								$anm['obraz'] = str_replace('.gif','',$anm['obraz']);
-								$anm['obraz'] = str_replace('.jpg','',$anm['obraz']);
-								$anm['obraz'] = str_replace('.png','',$anm['obraz']);
-								$ins = mysql_query('INSERT INTO `users_animal` (`type`,`name`,`uid`,`obraz`,`stats`,`sex`) VALUES ("'.$anm['type'].'","'.$anm['name'].'","'.$u->info['id'].'","'.$anm['obraz'].'","'.$anm['stats'].'","'.$anm['sex'].'")');
-								if($ins)
-								{
-									
-									$u->info['animal'] = mysql_insert_id();
-									mysql_query('UPDATE `users` SET `animal` = "'.$u->info['animal'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-									$u->error = '�� ������� ������������ "'.$itm['name'].'" � ������� - &quot;�� � ������ �� ���, ���� ���������&quot;.';
-									$itm['iznosNOW']++;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-								}else{
-									$u->error = '�� ������� ������������ "'.$itm['name'].'", ���-�� ����� �� ��� ...';
-								}
-							}
-						}elseif($goodUse == 1)
-						{
-							if($itm['magic_inc'] == '') {
-								$itm['magic_inc'] = $itm['magic_inci'];
-							}
-							$us = $this->add_eff($u->info['id'],$itm['magic_inc']);
-							if($us[0]==1)
-							{
-								$itm['iznosNOW']++;
-								mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-								if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-									mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-								}
-								$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-								$this->youuse++;
-								$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot;<br>'.$us[1].'';
-								//$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ���������� &quot;'.$itm['name'].'&quot; �� ����.';
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','11','0','1')");	
-							}else{
-								if($u->error != '') {
-									$u->error = '�� ������� ������������ "'.$itm['name'].'"...<br>'.$u->error;
-								}else{
-									$u->error = '�� ������� ������������ "'.$itm['name'].'"...';
-								}
-							}
-						}else{
-							if($u->error != '') {
-								$u->error = '�� ������� ������������ "'.$itm['name'].'"<br>'.$u->error;
-							}else{
-								$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-							}
-						}
-					}
-				 //------------------------------
-				}				
-			}
-			if( $goodUse == 1 ) {
-				mysql_query('UPDATE `items_users` SET `lastUPD` = '.time().' WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-			}
-		}else{
-			if ($id==5555)
-			{
-				mysql_query('UPDATE `stats` SET `seff` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				$u->error = '������ ����������';
-				
-			}elseif ($id==7777){
-				mysql_query('UPDATE `stats` SET `seff` = 1 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				$u->error = '������ ��������';
-			}else{
-				$u->error = '������� �� ������ � ���������';
-			}
-		
-		}
-	}
+                                //Выбираем тип зверя
+
+                                if ($itm['name'] == 'Призвать Сову') {
+                                    $anm['type'] = 2;
+                                } elseif ($itm['name'] == 'Призвать Светляка') {
+                                    $anm['type'] = 3;
+                                } elseif ($itm['name'] == 'Призвать Кота') {
+                                    $anm['type'] = 1;
+                                } elseif ($itm['name'] == 'Призвать Чертяку') {
+
+                                    $anm['type'] = 4;
+                                } elseif ($itm['name'] == 'Призвать Свина') {
+                                    $anm['type'] = 6;
+                                } elseif ($itm['name'] == 'Призвать Пса') {
+                                    $anm['type'] = 5;
+                                } elseif ($itm['name'] == 'Призвать Дракона') {
+                                    $anm['type'] = 7;
+
+                                    if ($anm['type'] == 1) {
+                                        $anm['name'] = 'Кот';
+                                        $anm['sex'] = 0;
+                                        $anm['obraz'] = [1 => '20864.gif', 2 => '21301.gif', 3 => '21139.gif', 4 => '20427.gif'];
+                                        $anm['stats'] = 's1=2|s2=5|s3=2|s4=5|rinv=40|m9=5|m6=10';
+                                    } elseif ($anm['type'] == 7) {
+                                        $anm['name'] = 'Дракон';
+                                        $anm['sex'] = 0;
+                                        $anm['obraz'] = [1 => '21338_pgtpdbx.gif'];
+                                        $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
+                                    }
+                                } elseif ($anm['type'] == 2) {
+                                    $anm['name'] = 'Сова';
+                                    $anm['sex'] = 1;
+                                    $anm['obraz'] = [1 => '21415.gif', 2 => '21722.gif', 3 => '21550.gif'];
+                                    $anm['stats'] = 's1=2|s2=2|s3=5|s4=5|rinv=40|m9=5|m6=10';
+                                } elseif ($anm['type'] == 3) {
+                                    $anm['name'] = 'Светляк';
+                                    $anm['sex'] = 0;
+                                    $anm['obraz'] = [1 => '22277.gif', 2 => '22265.gif', 3 => '22333.gif', 4 => '22298.gif'];
+                                    $anm['stats'] = 's1=3|s2=10|s3=3|s4=4|rinv=40|m9=5|m6=10';
+                                } elseif ($anm['type'] == 4) {
+                                    $anm['name'] = 'Чертяка';
+                                    $anm['sex'] = 0;
+                                    $anm['obraz'] = [1 => '22177.gif', 2 => '21976.gif', 3 => '21877.gif'];
+                                    $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
+                                } elseif ($anm['type'] == 5) {
+                                    $anm['name'] = 'Пес';
+                                    $anm['sex'] = 0;
+                                    $anm['obraz'] = [1 => '22352.gif', 2 => '23024.gif', 3 => '22900.gif', 4 => '22501.gif', 5 => '22700.gif'];
+                                    $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
+                                } elseif ($anm['type'] == 6) {
+                                    $anm['name'] = 'Свин';
+                                    $anm['sex'] = 0;
+                                    $anm['obraz'] = [1 => '24000.gif', 2 => '25000.gif', 3 => '27000.gif', 4 => '28000.gif'];
+                                    $anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';
+                                }
+                                $anm['obraz'] = $anm['obraz'][rand(1, count($anm['obraz']))];
+                                $anm['obraz'] = str_replace('.gif', '', $anm['obraz']);
+                                $anm['obraz'] = str_replace('.jpg', '', $anm['obraz']);
+                                $anm['obraz'] = str_replace('.png', '', $anm['obraz']);
+                                $ins = mysql_query('INSERT INTO `users_animal` (`type`,`name`,`uid`,`obraz`,`stats`,`sex`) VALUES ("' . $anm['type'] . '","' . $anm['name'] . '","' . $u->info['id'] . '","' . $anm['obraz'] . '","' . $anm['stats'] . '","' . $anm['sex'] . '")');
+                                if ($ins) {
+
+                                    $u->info['animal'] = mysql_insert_id();
+                                    mysql_query('UPDATE `users` SET `animal` = "' . $u->info['animal'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                    $u->error = 'Вы успешно использовали "' . $itm['name'] . '" и помните - &quot;Мы в ответе за тех, кого приручили&quot;.';
+                                    $itm['iznosNOW']++;
+                                    mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                    if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                        mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                    }
+                                    $u->addDelo(1, $u->info['id'], '&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж использовал заклинание &quot;' . $itm['name'] . '&quot; (' . $us[1] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0);
+                                } else {
+                                    $u->error = 'Не удалось использовать "' . $itm['name'] . '", что-то здесь не так ...';
+                                }
+                            }
+                        } elseif ($goodUse == 1) {
+                            if ($itm['magic_inc'] == '') {
+                                $itm['magic_inc'] = $itm['magic_inci'];
+                            }
+                            $us = $this->add_eff($u->info['id'], $itm['magic_inc']);
+                            if ($us[0] == 1) {
+                                $itm['iznosNOW']++;
+                                mysql_query('UPDATE `items_users` SET `iznosNOW` = "' . $itm['iznosNOW'] . '" WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+                                if ($itm['inGroup'] > 0 && $itm['delete'] == 0) {
+                                    mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
+                                }
+                                $u->addDelo(1, $u->info['id'], '&quot;<font color="maroon">System.inventory</font>&quot;: Персонаж использовал заклинание &quot;' . $itm['name'] . '&quot; (' . $us[1] . ') [itm:' . $itm['id'] . '].', time(), $u->info['city'], 'System.inventory', 0, 0);
+                                $this->youuse++;
+                                $u->error = 'Вы успешно использовали заклинание &quot;' . $itm['name'] . '&quot;<br>' . $us[1] . '';
+                            } else {
+                                if ($u->error != '') {
+                                    $u->error = 'Не удалось использовать "' . $itm['name'] . '"...<br>' . $u->error;
+                                } else {
+                                    $u->error = 'Не удалось использовать "' . $itm['name'] . '"...';
+                                }
+                            }
+                        } else {
+                            if ($u->error != '') {
+                                $u->error = 'Не удалось использовать "' . $itm['name'] . '"<br>' . $u->error;
+                            } else {
+                                $u->error = 'Не удалось использовать "' . $itm['name'] . '"';
+                            }
+                        }
+                    }
+                    //------------------------------
+                }
+            }
+            if ($goodUse == 1) {
+                mysql_query('UPDATE `items_users` SET `lastUPD` = ' . time() . ' WHERE `id` = "' . $itm['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
+            }
+        } else {
+            if ($id == 5555) {
+                mysql_query('UPDATE `stats` SET `seff` = 0 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                $u->error = 'Эфекты развернуты';
+
+            } elseif ($id == 7777) {
+                mysql_query('UPDATE `stats` SET `seff` = 1 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                $u->error = 'Эфекты свернуты';
+            } else {
+                $u->error = 'Предмет не найден в инвентаре';
+            }
+
+        }
+    }
 
 
-	public function add_eff($uid,$id,$is_no = NULL)
-	{
-		$g = array(0=>0,1=>'');
-		$eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$id.'" LIMIT 1'));	
-		
-		if($is_no != NULL) {
-			//��������� ������ ���������
-			if($eff['onlyOne'] > 0)
-			{
-				//������� ������� �������
-				$goodUse = 0;
-				$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$uid.'" AND `delete` = "0" AND `id_eff` = "'.$eff['id2'].'"');
-				if($upd1)
-				{
-					$goodUse = 1;
-				}
-			}
-			if($st['oneType'] > 0)
-			{
-				//������� ������� �������
-				$goodUse = 0;
-				$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$uid.'" AND `delete` = "0" AND `overType` = "'.$eff['overType'].'"');
-				if($upd2)
-				{
-					$goodUse = 1;
-				}
-			}
-		}
-		if($goodUse == 1 || $is_no == NULL) {
-			if(isset($eff['id2']))
-			{
-				//$eff = $this->paguba($eff);
-				$n = $eff['mname'];
-				$d = $eff['mdata'];
-				$ins = mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("'.$eff['oneType'].'","'.$eff['id2'].'","'.$uid.'","'.$n.'","'.time().'","'.$d.'","'.$eff['noAce'].'")');
-				if($ins)
-				{
-					$g[0] = 1;
-					$g[1] = '...';
-				}
-			}
-		}
-		return $g;
-	}
-	
-	//�������� ����������� � ��������, ���� �����������
-	public function testAlignAtack( $u1 , $u2 , $btl_test ) {
-		$r = true;
-		if( $btl_test['type'] != 500 && $btl_test['dn_id'] == 0 && $btl_test['team_win'] == -1 ) { 
-			$u1 = mysql_fetch_array(mysql_query('SELECT `id`,`align` FROM `users` WHERE `id` = "'.mysql_real_escape_string($u1).'" LIMIT 1'));
-			$u2 = mysql_fetch_array(mysql_query('SELECT `id`,`team` FROM `stats` WHERE `id` = "'.mysql_real_escape_string($u2).'" LIMIT 1'));
-			$u1['align'] = floor($u1['align']);
-			$tm = $tm[$u1['team']];
-			$no_align = array();
-			if( $u1['align'] == 1 ) {
-				$no_align[3] = true;
-			}elseif( $u1['align'] == 3 ) {
-				$no_align[1] = true;
-			}
-			
-			$sp = mysql_query('SELECT `u`.`align`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `st`.`id` = `u`.`id` WHERE `u`.`battle` = "'.$btl_test['id'].'" AND `st`.`team` != "'.$u2['team'].'"');
-			while( $pl = mysql_fetch_array($sp) ) {
-				if( $no_align[floor($pl['align'])] == true ) {
-					$r = false;
-				}
-			}
-		}
-		return $r;
-	}
-	
-	//�������� ������
-	public function testTravma( $uid , $vals ) {
-		$r = false;		
-		$tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "'.$uid.'" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1'));
-		if( isset($tr_pl['id']) && $tr_pl['v1'] >= $vals ) {
-			$r = true;
-		}
-		return $r;
-	}
-	
-	//������� ��������� �� ���������
-	public function atackUser($uid1, $uid2, $tm, $btl, $addExp = 0, $type = 0, $kulak = 0, $bsid = 0) {
-		global $u;
-		$usr = mysql_fetch_array(mysql_query('SELECT `u`.*,`s`.* FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`id` = "'.$uid2.'" LIMIT 1'));
-		$btl_test = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$btl.'" AND `team_win` = -1 LIMIT 1'));
-		//$u->info['clan'] - ��� $usr['clan'] - ��������� // �������
-		$clan_test = mysql_fetch_array(mysql_query('SELECT * FROM `clan_wars` WHERE ((`clan1`="'.$u->info['clan'].'" AND `clan2`="'.$usr['clan'].'") OR (`clan2`="'.$u->info['clan'].'" AND `clan1`="'.$usr['clan'].'")) AND `time_finish` > "'.time().'" LIMIT 1'));
-		$good = 0;
-		//������� ��-�� ������� ������ ��������
-		$efsno = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$uid2.'"
-		AND `name` LIKE "%����� ������%" AND `delete` = "0"
-		LIMIT 1'));		
-		//$check = mysql_fetch_array(mysql_query('SELECT * FROM `actions` WHERE `uid` = "'.$u->info['id'].'" AND `vars`= "end_trup" AND `time` > "'.(time()-3*60*60).'" ORDER BY `actions`.`time` DESC LIMIT 1;'));
-		$check = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
-		$check2 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE (`id_eff` = 479 OR `id_eff` = 480 OR `id_eff` = 481) AND `uid` = "'.$usr['id'].'" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
-		/*if( $usr['no_ip'] == 'trupojor' && $usr['level'] != $u->info['level'] ) {
-			$u->error = '������ �������� �� ������� ����� ������!';*/
-		if( $usr['no_ip'] == 'trupojor' && $usr['level'] ==9 && $u->info['level']>9 ) {
-			$u->error = '������ �������� �� ������� ����� ������!';
-		}elseif( $usr['no_ip'] == 'trupojor' && $usr['level'] ==10 && ($u->info['level']<10 || $u->info['level']>11 )) {
-			$u->error = '������ �������� �� ������� ����� ������!';
-		}elseif( $ua['no_ip'] == 'trupojor' && isset($check['id']) ) { //&& $ua['level'] >9
-			$u->error = '������ �������� �� ������� ���� ������ ���� � 3 ����!';
-		}elseif(isset($check2['id'])) { //&& $ua['level'] >9
-			$u->error = '�������� ����� ������ �� ���������!';
-		//}elseif( $u->info['level'] > $usr['level']+1 ) {
-			//$u->error = '�� ������� ������ ��� ����� ���';
-	    }elseif( $usr['level']==8 && $usr['no_ip'] != 'trupojor') {
-			$u->error = '�� 8-� ������ �������� ������.';
-		}elseif( $u->info['level'] != $usr['level'] && $usr['no_ip'] != 'trupojor' ) { //&& !isset ($clan_test['id'])
-			$u->error = '�������� ����� �� ���������� ������ ������ ������!!!';
-		}elseif( isset($btl_test['id']) && $btl_test['noatack'] > 0 ) {
-			$u->error = '�������� ������� ������! �� �� ������ ���������!';
-		}elseif($usr['level'] < 8) {
-			$u->error = '������� ��������� ��� ������� �����������...';
-		}elseif($u->info['level'] < 8) {
-			$u->error = '������������ ��� ���� ��� ����...';
-		}elseif( isset($efsno['id']) && $efsno['delete'] > 0 ) {
-			$u->error = '���������� �������, ��������� ���-�� �����...';
-		}elseif($usr['admin']==1 && $u->info['admin'] == 0 ) {
-			$u->error = '�������� ����������...';
-		}elseif($this->testTravma($uid2 , 3) == true) {
-			$u->error = '��������� ������ �����������, ������ �������!';
-		} elseif($this->testTravma($uid1 , 2) == true) {
-			$u->error = '�� ������������, ������ �������!';
-        } elseif($bsid != 0 && ($u->info['x'] != $usr['x'] || $u->info['y'] != $usr['y'] )) {
-            $u->error = '�� ���������� � ������ ��������...';
-		} elseif($usr['clan'] != 0 && ($usr['clan'] == $u->info['clan']) && $u->info['admin'] == 0) {
-			$u->error = '����� ����� ����� ��������.';
-		} elseif($btl != 0 && $btl_test['smert'] == 1 && $type != 222) {
-			$u->error = '�� �� ������ ��������� � ���� �������� ��������!';
-		} elseif($btl == 0) {
-			$s01 = $u->getStats($uid1,0);
-			if($s01['hpNow'] < floor($s01['hpAll']/100*33) ) {
-				$u->error = '������ �������, � ���������� �� �������������� ��������';
-			} else {
-				$addExp += $usr['bbexp'];
-				//effect �����������
-				if( $usr['no_ip'] == 'trupojor')
-					{
-						mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","'.$u->info['id'].'","������ �� ���������","zashitatk=1","'.time().'")');
-					}
-				//��� ���� ���
-				
-				//************
-				//�������� �� ���������
-				$timewait=rand(1,3);
-				//===�������� ������ �� ��������� � ���������� ��������� �������������
-				$dsl=mysql_query('SELECT * FROM `eff_users` WHERE (`id_eff` = 479 OR `id_eff` = 480 OR `id_eff` = 481) AND `uid` = "'.$u->info['id'].'" AND `delete` = 0 ORDER BY `overType` DESC;');
-				while( $dpl = mysql_fetch_array($dsl)) 
-				{
-					mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$dpl['id'].'";');
-				}
-				//=======
-				if ($type==222) //
-				{
-				$ins = mysql_query('INSERT INTO `battle` (`kulak`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`, `inTurnir`, `clan1`, `clan2`, `smert` ) VALUES (
-																		"'.$kulak.'",
-																		"'.$u->info['city'].'",
-																		"'.time().'",
-																		"'.$u->info['login'].','.$usr['login'].'",
-																		"'.(60*$timewait).'",
+    public function add_eff($uid, $id, $is_no = null)
+    {
+        $g = [0 => 0, 1 => ''];
+        $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $id . '" LIMIT 1'));
+
+        if ($is_no != null) {
+            //добавляем эффект персонажу
+            if ($eff['onlyOne'] > 0) {
+                //убираем прошлые эффекты
+                $goodUse = 0;
+                $upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $uid . '" AND `delete` = "0" AND `id_eff` = "' . $eff['id2'] . '"');
+                if ($upd1) {
+                    $goodUse = 1;
+                }
+            }
+            if ($st['oneType'] > 0) {
+                //убираем прошлые эффекты
+                $goodUse = 0;
+                $upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `uid` = "' . $uid . '" AND `delete` = "0" AND `overType` = "' . $eff['overType'] . '"');
+                if ($upd2) {
+                    $goodUse = 1;
+                }
+            }
+        }
+        if ($goodUse == 1 || $is_no == null) {
+            if (isset($eff['id2'])) {
+                //$eff = $this->paguba($eff);
+                $n = $eff['mname'];
+                $d = $eff['mdata'];
+                $ins = mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . $uid . '","' . $n . '","' . time() . '","' . $d . '","' . $eff['noAce'] . '")');
+                if ($ins) {
+                    $g[0] = 1;
+                    $g[1] = '...';
+                }
+            }
+        }
+        return $g;
+    }
+
+    //Проверка травмы
+    public function testTravma($uid, $vals)
+    {
+        $r = false;
+        $tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "' . $uid . '" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1'));
+        if (isset($tr_pl['id']) && $tr_pl['v1'] >= $vals) {
+            $r = true;
+        }
+        return $r;
+    }
+
+    private static function getDressedEkrTotalPrice($uid)
+    {
+        return \Insallah\Db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]);
+    }
+
+    private static function canAttack8Level($attacker, $target)
+    {
+        $aSum = self::getDressedEkrTotalPrice($attacker);
+        $tRange = \Insallah\Math::get20PercentRange(self::getDressedEkrTotalPrice($target));
+
+        return $aSum >= $tRange['min'] && $aSum <= $tRange['max'];
+    }
+
+    //создаем нападение на персонажа
+    public function atackUser($uid1, $uid2, $tm, $btl, $addExp = 0, $type = 0, $kulak = 0, $bsid = 0)
+    {
+        global $u;
+        $usr = mysql_fetch_array(mysql_query('SELECT `u`.*,`s`.* FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`id` = "' . $uid2 . '" LIMIT 1'));
+        $btl_test = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "' . $btl . '" AND `team_win` = -1 LIMIT 1'));
+        $clan_test = mysql_fetch_array(mysql_query('SELECT * FROM `clan_wars` WHERE ((`clan1`="' . $u->info['clan'] . '" AND `clan2`="' . $usr['clan'] . '") OR (`clan2`="' . $u->info['clan'] . '" AND `clan1`="' . $usr['clan'] . '")) AND `time_finish` > "' . time() . '" LIMIT 1'));
+        $good = 0;
+        //Эффекты из-за которых нельзя нападать
+        $efsno = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "' . $uid2 . '"
+		AND `name` LIKE "%Лепим снежок%" AND `delete` = "0"
+		LIMIT 1'));
+        $check = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `id_eff` = 478 AND `uid` = "' . $u->info['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
+        $check2 = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE (`id_eff` = 479 OR `id_eff` = 480 OR `id_eff` = 481) AND `uid` = "' . $usr['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC LIMIT 1;'));
+
+        $u->error = 'Нельзя нападать на монстра этого уровня!';
+
+        if ($usr['no_ip'] == 'trupojor' && $usr['level'] == 9 && $u->info['level'] > 9) {
+            $u->error = 'Нельзя нападать на монстра этого уровня!';
+        } elseif ($usr['no_ip'] == 'trupojor' && $usr['level'] == 10 && ($u->info['level'] < 10 || $u->info['level'] > 11)) {
+            $u->error = 'Нельзя нападать на монстра этого уровня!';
+        } elseif ($ua['no_ip'] == 'trupojor' && isset($check['id'])) { //&& $ua['level'] >9
+            $u->error = 'Нельзя нападать на монстра чаще одного раза в 3 часа!';
+        } elseif (isset($check2['id'])) { //&& $ua['level'] >9
+            $u->error = 'Персонаж имеет защиту от нападения!';
+        } elseif ($usr['level'] == 8 && $usr['no_ip'] != 'trupojor' && self::canAttack8Level($u->info['id'], $usr['id'])) {
+            $u->error = 'На 8-е уровни нападать нельзя.';
+        } elseif ($u->info['level'] != $usr['level'] && $usr['no_ip'] != 'trupojor') { //&& !isset ($clan_test['id'])
+            $u->error = 'Нападать можно на персонажей только своего уровня!!!';
+        } elseif (isset($btl_test['id']) && $btl_test['noatack'] > 0) {
+            $u->error = 'Поединок защищен магией! Вы не можете вмешаться!';
+        } elseif ($usr['level'] < 8) {
+            $u->error = 'Новички находятся под защитой Мироздателя...';
+        } elseif ($u->info['level'] < 8) {
+            $u->error = 'Тренируйтесь вам пока еще рано...';
+        } elseif (isset($efsno['id']) && $efsno['delete'] > 0) {
+            $u->error = 'Невозможно напасть, противник чем-то занят...';
+        } elseif ($usr['admin'] == 1 && $u->info['admin'] == 0) {
+            $u->error = 'Уважайте хранителей...';
+        } elseif ($this->testTravma($uid2, 3)) {
+            $u->error = 'Противник тяжело травмирован, нельзя напасть!';
+        } elseif ($this->testTravma($uid1, 2)) {
+            $u->error = 'Вы травмированы, нельзя напасть!';
+        } elseif ($bsid != 0 && ($u->info['x'] != $usr['x'] || $u->info['y'] != $usr['y'])) {
+            $u->error = 'Вы находитесь в разных комнатах...';
+        } elseif ($usr['clan'] != 0 && ($usr['clan'] == $u->info['clan']) && $u->info['admin'] == 0) {
+            $u->error = 'Чтите честь ваших сокланов.';
+        } elseif ($btl != 0 && $btl_test['smert'] == 1 && $type != 222) {
+            $u->error = 'Вы не можете вмешаться в этот кровавый поединок!';
+        } elseif ($btl == 0) {
+            $s01 = $u->getStats($uid1, 0);
+            if ($s01['hpNow'] < floor($s01['hpAll'] / 100 * 33)) {
+                $u->error = 'Нельзя напасть, у противника не восстановилось здоровье';
+            } else {
+                $addExp += $usr['bbexp'];
+                //effect ненападения
+                if ($usr['no_ip'] == 'trupojor') {
+                    mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time() . '")');
+                }
+                //тут клан вар
+
+                //************
+                //нападаем на персонажа
+                $timewait = rand(1, 3);
+                //===Удаление защиты от нападения в результате нападения пользователем
+                $dsl = mysql_query('SELECT * FROM `eff_users` WHERE (`id_eff` = 479 OR `id_eff` = 480 OR `id_eff` = 481) AND `uid` = "' . $u->info['id'] . '" AND `delete` = 0 ORDER BY `overType` DESC;');
+                while ($dpl = mysql_fetch_array($dsl)) {
+                    mysql_query('UPDATE `eff_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $dpl['id'] . '";');
+                }
+                //=======
+                if ($type == 222) //
+                {
+                    $ins = mysql_query('INSERT INTO `battle` (`kulak`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`, `inTurnir`, `clan1`, `clan2`, `smert` ) VALUES (
+																		"' . $kulak . '",
+																		"' . $u->info['city'] . '",
+																		"' . time() . '",
+																		"' . $u->info['login'] . ',' . $usr['login'] . '",
+																		"' . (60 * $timewait) . '",
 																		"99",
 																		"0",
 																		"0",
 																		"50",
 																		"9",
-																		"'.$addExp.'",
+																		"' . $addExp . '",
 																		"0", 
-																		"'.$bsid.'",
-																		"'.$u->info['clan'].'",
-																		"'.$usr['clan'].'",
+																		"' . $bsid . '",
+																		"' . $u->info['clan'] . '",
+																		"' . $usr['clan'] . '",
 																		"1"
-																		)');					
-				}
-				elseif (isset ($clan_test['id'])) //
-				{
-				$ins = mysql_query('INSERT INTO `battle` (`kulak`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`, `inTurnir`, `clan1`, `clan2` ) VALUES (
-																		"'.$kulak.'",
-																		"'.$u->info['city'].'",
-																		"'.time().'",
-																		"'.$u->info['login'].','.$usr['login'].'",
-																		"'.(60*$timewait).'",
+																		)');
+                } elseif (isset ($clan_test['id'])) //
+                {
+                    $ins = mysql_query('INSERT INTO `battle` (`kulak`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`, `inTurnir`, `clan1`, `clan2` ) VALUES (
+																		"' . $kulak . '",
+																		"' . $u->info['city'] . '",
+																		"' . time() . '",
+																		"' . $u->info['login'] . ',' . $usr['login'] . '",
+																		"' . (60 * $timewait) . '",
 																		"250",
 																		"0",
 																		"0",
 																		"50",
 																		"9",
-																		"'.$addExp.'",
+																		"' . $addExp . '",
 																		"0", 
-																		"'.$bsid.'",
-																		"'.$u->info['clan'].'",
-																		"'.$usr['clan'].'")');					
-				}
-				else
-				{
-				$ins = mysql_query('INSERT INTO `battle` (`kulak`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`, `inTurnir`) VALUES (
-																		"'.$kulak.'",
-																		"'.$u->info['city'].'",
-																		"'.time().'",
-																		"'.$u->info['login'].','.$usr['login'].'",
-																		"'.(60*$timewait).'",
-																		"'.$type.'",
+																		"' . $bsid . '",
+																		"' . $u->info['clan'] . '",
+																		"' . $usr['clan'] . '")');
+                } else {
+                    $ins = mysql_query('INSERT INTO `battle` (`kulak`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`, `inTurnir`) VALUES (
+																		"' . $kulak . '",
+																		"' . $u->info['city'] . '",
+																		"' . time() . '",
+																		"' . $u->info['login'] . ',' . $usr['login'] . '",
+																		"' . (60 * $timewait) . '",
+																		"' . $type . '",
 																		"0",
 																		"0",
 																		"50",
 																		"9",
-																		"'.$addExp.'",
-																		"0", "'.$bsid.'")');
-				}
-				unset($timewait);														
-				if($ins)
-				{
-					$btl_id = mysql_insert_id();
-					//��������� �� � �� �������
-					if($s01['level']<=7)
-					{
-						$s01['tactic7'] = floor(10/$s01['hpAll']*$s01['hpNow']);
-					}elseif($s01['level']==8)
-					{
-						$s01['tactic7'] = floor(20/$s01['hpAll']*$s01['hpNow']);
-					}elseif($s01['level']==9)
-					{
-						$s01['tactic7'] = floor(30/$s01['hpAll']*$s01['hpNow']);
-					}elseif($s01['level']>=10)
-					{
-						$s01['tactic7'] = floor(40/$s01['hpAll']*$s01['hpNow']);
-					}
-					$s01 = array( 'hpAll' => $s01['hpAll'] , 'hpNow' => $s01['hpNow'] , 'mpAll' => $s01['mpAll'] , 'mpNow' => $s01['mpNow']  );
-					$s02 = $u->getStats($uid2,0);
-					if($s02['level']<=7)
-					{
-						$s02['tactic7'] = floor(10/$s02['hpAll']*$s02['hpNow']);
-					}elseif($s02['level']==8)
-					{
-						$s02['tactic7'] = floor(20/$s02['hpAll']*$s02['hpNow']);
-					}elseif($s02['level']==9)
-					{
-						$s02['tactic7'] = floor(30/$s02['hpAll']*$s02['hpNow']);
-					}elseif($s02['level']>=10)
-					{
-						$s02['tactic7'] = floor(40/$s02['hpAll']*$s02['hpNow']);
-					}
-						
-					//����������, ��������
-					/*if( $s01['s7'] > 49 ) {
-						mysql_query("
-							INSERT INTO `eff_users` ( `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
-							( 22, '".$s01['id']."', '��������', 'add_spasenie=1', 0, 77, 0, '".$s01['id']."', 0, 'priem', 324, 'preservation.gif', 1, -1, '��������', 0, 0, '', 0, 0, 0, 1, 0);
-						");
-					}					
-					if( $s02['s7'] > 49 ) {
-						mysql_query("
-							INSERT INTO `eff_users` ( `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
-							( 22, '".$s02['id']."', '��������', 'add_spasenie=1', 0, 77, 0, '".$s02['id']."', 0, 'priem', 324, 'preservation.gif', 1, -1, '��������', 0, 0, '', 0, 0, 0, 1, 0);
-						");
-					}*/
-					//
-					
-					$s02 = array( 'hpAll' => $s02['hpAll'] , 'hpNow' => $s02['hpNow'] , 'mpAll' => $s02['mpAll'] , 'mpNow' => $s02['mpNow']  );				
-					
-					$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$uid1.'" OR `id` = "'.$uid2.'" LIMIT 2');
-							 mysql_query('UPDATE `stats` SET `lider` = "'.$btl_id.'",`tactic7` = "'.$s01['tactic7'].'",`hpNow` = "'.$s01['hpNow'].'",`mpNow` = "'.$s01['mpNow'].'",`team`="1",`zv` = "0" WHERE `id` = "'.$uid1.'" LIMIT 1');
-							 mysql_query('UPDATE `stats` SET `lider` = "'.$btl_id.'",`tactic7` = "'.$s02['tactic7'].'",`hpNow` = "'.$s02['hpNow'].'",`mpNow` = "'.$s02['mpNow'].'",`team`="2",`zv` = "0" WHERE `id` = "'.$uid2.'" LIMIT 1');
-					
-					if( $kulak > 0 || $btl_test['kulak'] > 0 ) {
-						mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE ( `uid` = "'.$uid1.'" OR `uid` = "'.$uid2.'" ) AND `delete` = "0"');
-					}
-					
-					$good = $btl_id;
-                    if($bsid != 0) {
-                        $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$u->info['inTurnir'].'" LIMIT 1'));
-                      if($u->info['sex'] == 0) {
-                        $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} ����� �� {u2} ��������� ��� <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  } else {
-	                    $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} ������ �� {u2} ��������� ��� <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  }
-                      $usr_real = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `clan`, `battle`, `level` FROM `users` WHERE (`inUser` = "'.$usr['id'].'" OR `id` = "'.$usr['id'].'") LIMIT 1'));
-                      if(!isset($usr_real['id'])) { $usr_real = $usr; }
-                      if(isset($usr_real['id'])) {
-                        $usrreal = '';
-                        if($usr_real['align'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/align/align'.$usr_real['align'].'.gif width=12 height=15 >'; }
-                        if($usr_real['clan'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/clan/'.$usr_real['clan'].'.gif width=24 height=15 >'; }
-                        $usrreal .= '<b>'.$usr_real['login'].'</b>['.$usr_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$usr_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-                      } else {
-                        $usrreal = '<i>���������</i>[??]';
-                      }
-                      $me_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$u->info['id'].'" AND `login` = "'.$u->info['login'].'" LIMIT 1'));
-                      if(isset($me_real['id'])) {
-					    $mereal = '';
-					    if($me_real['align'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/align/align'.$me_real['align'].'.gif width=12 height=15 >'; }
-					    if($me_real['clan'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/clan/'.$me_real['clan'].'.gif width=24 height=15 >'; }
-					    $mereal .= '<b>'.$me_real['login'].'</b>['.$me_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$me_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-				      } else {
-					    $mereal = '<i>���������</i>[??]';
-				      }
-                      $text = str_replace('{u1}', $mereal, $text);
-				      $text = str_replace('{u2}', $usrreal, $text);
-                      mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES (
-					  "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$bs['id'].'", "'.$bs['count'].'", "'.$bs['city'].'",
-					  "'.round($bs['money']*0.85,2).'","'.$i.'")');
-				      unset($text, $usrreal, $mereal, $usr_real, $me_real);
+																		"' . $addExp . '",
+																		"0", "' . $bsid . '")');
+                }
+                unset($timewait);
+                if ($ins) {
+                    $btl_id = mysql_insert_id();
+                    //Обновляем НР и МР игрокам
+                    if ($s01['level'] <= 7) {
+                        $s01['tactic7'] = floor(10 / $s01['hpAll'] * $s01['hpNow']);
+                    } elseif ($s01['level'] == 8) {
+                        $s01['tactic7'] = floor(20 / $s01['hpAll'] * $s01['hpNow']);
+                    } elseif ($s01['level'] == 9) {
+                        $s01['tactic7'] = floor(30 / $s01['hpAll'] * $s01['hpNow']);
+                    } elseif ($s01['level'] >= 10) {
+                        $s01['tactic7'] = floor(40 / $s01['hpAll'] * $s01['hpNow']);
                     }
-				}
-			}
-		}elseif( isset($btl_test['id']) && $btl_test['type'] == 500 && $usr['team'] == 1 ){
-			$u->error = '������ ��������� �� ������� ��������!';
-		}elseif( isset($btl_test['id']) && $btl_test['type'] == 250 && $u->info['clan'] != $btl_test['clan1'] && $u->info['clan'] != $btl_test['clan2']){
-			$u->error = '������ ������� � �������� ��� - ���� �� ����������� �������������� ������ ������!!!';		
-		}elseif( isset($btl_test['id']) && $btl_test['invis'] > 0 ){
-			$u->error = '������ ����������� � ��������� ���!';
-		}elseif( $btl_test['noatack'] > 0 ) {
-			$u->error = '� ���� �������� ������ �����������!';
-		}else{
-			
-			//����������� � ���
-			//effect �����������
-				if( $usr['no_ip'] == 'trupojor')
-					{
-						mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","'.$u->info['id'].'","������ �� ���������","zashitatk=1","'.time().'")');
-					}
-			$upd = mysql_query('UPDATE `users` SET `battle`="'.$btl.'" WHERE `id` = "'.$uid1.'" LIMIT 1');
-			if($upd)
-			{
-				
-				if( $kulak > 0 || $btl_test['kulak'] > 0 ) {
-					mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$uid1.'" AND `delete` = "0"');
-				}
-				
-				$uid1st = $u->getStats($uid1);
-				$uid1u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`clan`,`align`,`sex` FROM `users` WHERE `id` = "'.$uid1.'" LIMIT 1'));
-				
-				if($uid1u['level']<=7)
-				{
-					$uid1st['tactic7'] = floor((10+$uid1st['s7'])/$uid1st['hpAll']*$uid1st['hpNow']);
-				}elseif($uid1u['level']==8)
-				{
-					$uid1st['tactic7'] = floor((20+$uid1st['s7'])/$uid1st['hpAll']*$uid1st['hpNow']);
-				}elseif($uid1u['level']==9)
-				{
-					$uid1st['tactic7'] = floor((30+$uid1st['s7'])/$uid1st['hpAll']*$uid1st['hpNow']);
-				}elseif($uid1u['level']>=10)
-				{
-					$uid1st['tactic7'] = floor((40+$uid1st['s7'])/$uid1st['hpAll']*$uid1st['hpNow']);
-				}else{
-					$uid1st['tactic7'] = floor((10+$uid1st['s7'])/$uid1st['hpAll']*$uid1st['hpNow']);
-				}
-				
-				//����������, ��������
-				if( $uid1st['s7'] > 49 ) {
-					mysql_query('UPDATE `eff_users` SET `delete`="'.time().'" WHERE `uid` = "'.$uid1st['id'].'" AND `overType` = 101 AND `delete` = 0');
-					mysql_query("
+                    $s01 = ['hpAll' => $s01['hpAll'], 'hpNow' => $s01['hpNow'], 'mpAll' => $s01['mpAll'], 'mpNow' => $s01['mpNow']];
+                    $s02 = $u->getStats($uid2, 0);
+                    if ($s02['level'] <= 7) {
+                        $s02['tactic7'] = floor(10 / $s02['hpAll'] * $s02['hpNow']);
+                    } elseif ($s02['level'] == 8) {
+                        $s02['tactic7'] = floor(20 / $s02['hpAll'] * $s02['hpNow']);
+                    } elseif ($s02['level'] == 9) {
+                        $s02['tactic7'] = floor(30 / $s02['hpAll'] * $s02['hpNow']);
+                    } elseif ($s02['level'] >= 10) {
+                        $s02['tactic7'] = floor(40 / $s02['hpAll'] * $s02['hpNow']);
+                    }
+
+
+                    $s02 = ['hpAll' => $s02['hpAll'], 'hpNow' => $s02['hpNow'], 'mpAll' => $s02['mpAll'], 'mpNow' => $s02['mpNow']];
+
+                    $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $uid1 . '" OR `id` = "' . $uid2 . '" LIMIT 2');
+                    mysql_query('UPDATE `stats` SET `lider` = "' . $btl_id . '",`tactic7` = "' . $s01['tactic7'] . '",`hpNow` = "' . $s01['hpNow'] . '",`mpNow` = "' . $s01['mpNow'] . '",`team`="1",`zv` = "0" WHERE `id` = "' . $uid1 . '" LIMIT 1');
+                    mysql_query('UPDATE `stats` SET `lider` = "' . $btl_id . '",`tactic7` = "' . $s02['tactic7'] . '",`hpNow` = "' . $s02['hpNow'] . '",`mpNow` = "' . $s02['mpNow'] . '",`team`="2",`zv` = "0" WHERE `id` = "' . $uid2 . '" LIMIT 1');
+
+                    if ($kulak > 0 || $btl_test['kulak'] > 0) {
+                        mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE ( `uid` = "' . $uid1 . '" OR `uid` = "' . $uid2 . '" ) AND `delete` = "0"');
+                    }
+
+                    $good = $btl_id;
+                    if ($bsid != 0) {
+                        $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "' . $u->info['inTurnir'] . '" LIMIT 1'));
+                        if ($u->info['sex'] == 0) {
+                            $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} напал на {u2} завязался бой <a target=_blank href=/logs.php?log=' . $btl_id . ' >»»</a>';
+                        } else {
+                            $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} напала на {u2} завязался бой <a target=_blank href=/logs.php?log=' . $btl_id . ' >»»</a>';
+                        }
+                        $usr_real = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `clan`, `battle`, `level` FROM `users` WHERE (`inUser` = "' . $usr['id'] . '" OR `id` = "' . $usr['id'] . '") LIMIT 1'));
+                        if (!isset($usr_real['id'])) {
+                            $usr_real = $usr;
+                        }
+                        if (isset($usr_real['id'])) {
+                            $usrreal = '';
+                            if ($usr_real['align'] > 0) {
+                                $usrreal .= '<img src=https://img.new-combats.com/i/align/align' . $usr_real['align'] . '.gif width=12 height=15 >';
+                            }
+                            if ($usr_real['clan'] > 0) {
+                                $usrreal .= '<img src=https://img.new-combats.com/i/clan/' . $usr_real['clan'] . '.gif width=24 height=15 >';
+                            }
+                            $usrreal .= '<b>' . $usr_real['login'] . '</b>[' . $usr_real['level'] . ']<a target=_blank href=https://new-combats.com/info/' . $usr_real['id'] . ' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
+                        } else {
+                            $usrreal = '<i>Невидимка</i>[??]';
+                        }
+                        $me_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "' . $u->info['id'] . '" AND `login` = "' . $u->info['login'] . '" LIMIT 1'));
+                        if (isset($me_real['id'])) {
+                            $mereal = '';
+                            if ($me_real['align'] > 0) {
+                                $mereal .= '<img src=https://img.new-combats.com/i/align/align' . $me_real['align'] . '.gif width=12 height=15 >';
+                            }
+                            if ($me_real['clan'] > 0) {
+                                $mereal .= '<img src=https://img.new-combats.com/i/clan/' . $me_real['clan'] . '.gif width=24 height=15 >';
+                            }
+                            $mereal .= '<b>' . $me_real['login'] . '</b>[' . $me_real['level'] . ']<a target=_blank href=https://new-combats.com/info/' . $me_real['id'] . ' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
+                        } else {
+                            $mereal = '<i>Невидимка</i>[??]';
+                        }
+                        $text = str_replace('{u1}', $mereal, $text);
+                        $text = str_replace('{u2}', $usrreal, $text);
+                        mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES (
+					  "1", "' . mysql_real_escape_string($text) . '", "' . time() . '", "' . $bs['id'] . '", "' . $bs['count'] . '", "' . $bs['city'] . '",
+					  "' . round($bs['money'] * 0.85, 2) . '","' . $i . '")');
+                        unset($text, $usrreal, $mereal, $usr_real, $me_real);
+                    }
+                }
+            }
+        } elseif (isset($btl_test['id']) && $btl_test['type'] == 500 && $usr['team'] == 1) {
+            $u->error = 'Нельзя сражаться на стороне монстров!';
+        } elseif (isset($btl_test['id']) && $btl_test['type'] == 250 && $u->info['clan'] != $btl_test['clan1'] && $u->info['clan'] != $btl_test['clan2']) {
+            $u->error = 'Нельзя попасть в клановые бои - если вы неявляетесь представителем данных кланов!!!';
+        } elseif (isset($btl_test['id']) && $btl_test['invis'] > 0) {
+            $u->error = 'Нельзя вмешиваться в невидимый бой!';
+        } elseif ($btl_test['noatack'] > 0) {
+            $u->error = 'В этот поединок нельзя вмешиваться!';
+        } else {
+
+            //вмешиваемся в бой
+            //effect ненападения
+            if ($usr['no_ip'] == 'trupojor') {
+                mysql_query('INSERT INTO `eff_users` (`no_Ace`,`id_eff`,`overType`,`uid`,`name`,`data`,`timeUse`) VALUES ("1","479","112","' . $u->info['id'] . '","Защита от нападения","zashitatk=1","' . time() . '")');
+            }
+            $upd = mysql_query('UPDATE `users` SET `battle`="' . $btl . '" WHERE `id` = "' . $uid1 . '" LIMIT 1');
+            if ($upd) {
+
+                if ($kulak > 0 || $btl_test['kulak'] > 0) {
+                    mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "' . $uid1 . '" AND `delete` = "0"');
+                }
+
+                $uid1st = $u->getStats($uid1);
+                $uid1u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`clan`,`align`,`sex` FROM `users` WHERE `id` = "' . $uid1 . '" LIMIT 1'));
+
+                if ($uid1u['level'] <= 7) {
+                    $uid1st['tactic7'] = floor((10 + $uid1st['s7']) / $uid1st['hpAll'] * $uid1st['hpNow']);
+                } elseif ($uid1u['level'] == 8) {
+                    $uid1st['tactic7'] = floor((20 + $uid1st['s7']) / $uid1st['hpAll'] * $uid1st['hpNow']);
+                } elseif ($uid1u['level'] == 9) {
+                    $uid1st['tactic7'] = floor((30 + $uid1st['s7']) / $uid1st['hpAll'] * $uid1st['hpNow']);
+                } elseif ($uid1u['level'] >= 10) {
+                    $uid1st['tactic7'] = floor((40 + $uid1st['s7']) / $uid1st['hpAll'] * $uid1st['hpNow']);
+                } else {
+                    $uid1st['tactic7'] = floor((10 + $uid1st['s7']) / $uid1st['hpAll'] * $uid1st['hpNow']);
+                }
+
+                //Духовность, спасение
+                if ($uid1st['s7'] > 49) {
+                    mysql_query('UPDATE `eff_users` SET `delete`="' . time() . '" WHERE `uid` = "' . $uid1st['id'] . '" AND `overType` = 101 AND `delete` = 0');
+                    mysql_query("
 						INSERT INTO `eff_users` ( `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
-						( 22, '".$uid1st['id']."', '��������', 'add_spasenie=1', 101, 77, 0, '".$uid1st['id']."', 0, 'priem', 324, 'preservation.gif', 1, -1, '��������', 0, 0, '', 0, 0, 0, 1, 0);
+						( 22, '" . $uid1st['id'] . "', 'Спасение', 'add_spasenie=1', 101, 77, 0, '" . $uid1st['id'] . "', 0, 'priem', 324, 'preservation.gif', 1, -1, 'спасение', 0, 0, '', 0, 0, 0, 1, 0);
 					");
-				}
-				
-				
-				$btxt = '';
-				if( $uid1u['align'] > 0 ) {
-					$btxt = $btxt.'<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$uid1u['align'].'.gif >';
-				}
-				if( $uid1u['align2'] > 0 ) {
-					$btxt = $btxt.'<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$uid1u['align2'].'.gif >';
-				}
-				if( $uid1u['clan'] > 0 ) {
-					$btxt = $btxt.'<img width=24 height=15 src=https://img.new-combats.com/i/clan/'.$uid1u['clan'].'.gif >';
-				}
-				$btxt = $btxt.'<b>{u1}</b>['.$uid1u['level'].']<a href=info/'.$uid1u['id'].' target=_blank ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-				if( $uid1u['sex'] == 1 ) {
-					$btxt = $btxt.' ��������� � ��������.';
-				}else{
-					$btxt = $btxt.' �������� � ��������.';
-				}
-				
-				if( $kulak > 0 ) {
-					$btxt .= ' (�������� ���������)';
-				}
-				
-				$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$btl.'" ORDER BY `id_hod` DESC LIMIT 1'));
-				if(isset($lastHOD['id'])) {
-					$id_hod = $lastHOD['id_hod'];
-					if($lastHOD['type']!=6) {
-						$id_hod++;
-					}
-					mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$btl.'","'.($id_hod).'","{tm1} '.$btxt.'","login1='.$uid1st['login'].'||t1='.$uid1st['team'].'||login2='.$uid1st['login'].'||t2='.$uid1st['team'].'||time1='.time().'","","","","","6")');
-				}
-				
-				// ���� ����� animal_bonus ---------------------------------
-						if($u->info['animal'] > 0) {
-							$a = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `id` = "'.$u->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
-							if(isset($a['id'])) {
-								if($a['eda']>=1) {
-									$anl = mysql_fetch_array(mysql_query('SELECT `bonus` FROM `levels_animal` WHERE `type` = "'.$a['type'].'" AND `level` = "'.$a['level'].'" LIMIT 1'));
-									$anl = $anl['bonus'];
-									
-									$tpa = array(1=>'cat',2=>'owl',3=>'wisp',4=>'demon',5=>'dog',6=>'pig',7=>'dragon');
-									$tpa2 = array(1=>'����',2=>'����',3=>'��������',4=>'�������',5=>'���',6=>'�����',7=>'�������');
-									$tpa3 = array(1=>'������� ��������',2=>'�������� ����',3=>'���� ������',4=>'������������ ����',5=>'����',6=>'������ �����',7=>'�������');
-									
-									mysql_query('UPDATE `eff_users` SET `delete`="'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `overType` = 100 AND `delete` = 0');
-									mysql_query('INSERT INTO `eff_users` (`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`,`user_use`) VALUES ("-1","201","summon_pet_'.$tpa[$a['type']].'.gif",22,"'.$u->info['id'].'","'.$tpa3[$a['type']].' ['.$a['level'].']","'.$anl.'","100","77","priem","'.$u->info['id'].'")');
-									
-									if ($a['type']==6)
-										{
-											if($a['level']==1 || $a['level']==2 || $a['level']==3){$zhp=50;}
-											elseif($a['level']==4){$zhp=75;}
-											elseif($a['level']==5 || $a['level']==6){$zhp=125;}
-											elseif($a['level']==7 || $a['level']==8){$zhp=150;}
-											elseif($a['level']==9){$zhp=200;}elseif($a['level']==10){$zhp=300;}
-											else {$zhp=0;}
-											$u->info['hpNow']+=$zhp;
-											mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->info['hpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');									
-										}
-									
-									/*$anl = $u->lookStats($anl);
-									
-									$vLog = 'time1='.time().'||s1='.$u->info['sex'].'||t1='.$u->info['team'].'||login1='.$u->info['login'].'';
-									$vLog .= '||s2=1||t2='.$u->info['team'].'||login2='.$a['name'].' (����� '.$u->info['login'].')';
-									
-									$mas1 = array('time'=>time(),'battle'=>$btl,'id_hod'=>1,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
-									
-									$ba = '';
-									$i6 = 0;
-									while($i6<count($u->items['add'])) {
-										if(isset($anl['add_'.$u->items['add'][$i6]])) {
-											if($anl['add_'.$u->items['add'][$i6]] > 0) {
-												$ba .= $u->is[$u->items['add'][$i6]].': +'.$anl['add_'.$u->items['add'][$i6]].', ';
-											}
-										}
-										$i6++;
-									}
-									$ba = trim($ba,', ');
-									if($ba == '') {
-										$ba = '������ ����������';
-									}
-									*/
-									//$mas1['text'] = '{tm1} {u2} ������� �� ���������, � ������� �������� &quot;<b>'.$tpa3[$a['type']].' ['.$a['level'].']</b>&quot; �� {u1}. ('.$ba.')';
-									//$nxtlg[count($nxtlg)] = $mas1;
-									//mysql_query('UPDATE `users_animal` SET `eda` = `eda` - 1 WHERE `id` = "'.$a['id'].'" LIMIT 1');
-									//$btl->add_log($mas1);
-									//$btl->get_comment();*/
-								}else{
-									$u->send('',$u->info['room'],$u->info['city'],'',$u->info['login'],'<b>'.$a['name'].'</b> ��������� � ���...',time(),6,0,0,0,1);
-								}
-							}
-						}
-				// ���� ����� animal_bonus ---------------------------------
-				$ltm = array(1=>2, 2=>1);
-				mysql_query('UPDATE `stats` SET `hpNow` = "'.$uid1st['hpNow'].'",`mpNow` = "'.$uid1st['mpNow'].'",`team`="'.$ltm[$tm].'",`tactic7`="'.(0+$uid1st['tactic7']).'" WHERE `id` = "'.$uid1.'" LIMIT 1');
-				$good = $btl;
-				unset($uid1st);
-                if($bsid != 0) {
-                    $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$u->info['inTurnir'].'" LIMIT 1'));
-                      //$cloneuid=mysql_fetch_array(mysql_query('SELECT `uid` FROM `battle_users` WHERE `login` = "'.$u->info['login'].'" AND `battle` ="'.$btl.'" LIMIT 1')); // uid �����
-					  //mysql_query('UPDATE `stats` SET `tactic7`= 10.000 WHERE `id` = "'.$cloneuid.'" LIMIT 1');
-					  if($u->info['sex'] == 0) {
-                        $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} �������� � �������� ������ {u2} <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  } else {
-	                    $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} ��������� � �������� ������ {u2} <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  }
-                      $usr_real = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `clan`, `battle`, `level` FROM `users` WHERE `inUser` = "'.$usr['id'].'" LIMIT 1'));
-                      if(!isset($usr_real['id'])) { $usr_real = $usr; }
-                      if(isset($usr_real['id'])) {
-                        $usrreal = '';
-                        if($usr_real['align'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/align/align'.$usr_real['align'].'.gif width=12 height=15 >'; }
-                        if($usr_real['clan'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/clan/'.$usr_real['clan'].'.gif width=24 height=15 >'; }
-                        $usrreal .= '<b>'.$usr_real['login'].'</b>['.$usr_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$usr_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-                      } else {
-                        $mereal = '<i>���������</i>[??]';
-                      }
-                      $me_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$u->info['id'].'" AND `login` = "'.$u->info['login'].'" LIMIT 1'));
-                      if(isset($me_real['id'])) {
-					    $mereal = '';
-					    if($me_real['align'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/align/align'.$me_real['align'].'.gif width=12 height=15 >'; }
-					    if($me_real['clan'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/clan/'.$me_real['clan'].'.gif width=24 height=15 >'; }
-					    $mereal .= '<b>'.$me_real['login'].'</b>['.$me_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$me_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-				      } else {
-					    $mereal = '<i>���������</i>[??]';
-				      }
-                      $text = str_replace('{u1}', $mereal, $text);
-				      $text = str_replace('{u2}', $usrreal, $text);
-                      mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES (
-					  "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$bs['id'].'", "'.$bs['count'].'", "'.$bs['city'].'",
-					  "'.round($bs['money']*0.85,2).'","'.$i.'")');
-				      unset($text,$usrreal,$mereal,$usr_real,$me_real);
+                }
+
+
+                $btxt = '';
+                if ($uid1u['align'] > 0) {
+                    $btxt = $btxt . '<img width=12 height=15 src=https://img.new-combats.com/i/align/align' . $uid1u['align'] . '.gif >';
+                }
+                if ($uid1u['align2'] > 0) {
+                    $btxt = $btxt . '<img width=12 height=15 src=https://img.new-combats.com/i/align/align' . $uid1u['align2'] . '.gif >';
+                }
+                if ($uid1u['clan'] > 0) {
+                    $btxt = $btxt . '<img width=24 height=15 src=https://img.new-combats.com/i/clan/' . $uid1u['clan'] . '.gif >';
+                }
+                $btxt = $btxt . '<b>{u1}</b>[' . $uid1u['level'] . ']<a href=info/' . $uid1u['id'] . ' target=_blank ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
+                if ($uid1u['sex'] == 1) {
+                    $btxt = $btxt . ' вмешалась в поединок.';
+                } else {
+                    $btxt = $btxt . ' вмешался в поединок.';
+                }
+
+                if ($kulak > 0) {
+                    $btxt .= ' (Кулачное нападение)';
+                }
+
+                $lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "' . $btl . '" ORDER BY `id_hod` DESC LIMIT 1'));
+                if (isset($lastHOD['id'])) {
+                    $id_hod = $lastHOD['id_hod'];
+                    if ($lastHOD['type'] != 6) {
+                        $id_hod++;
                     }
-			}
-		}
-		return $good;
-	}
-	
-	//��������� �� ����������� �������
- public function magicCentralAttack() {
-   global $c, $code, $u, $re;
- }
+                    mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("' . time() . '","' . $btl . '","' . ($id_hod) . '","{tm1} ' . $btxt . '","login1=' . $uid1st['login'] . '||t1=' . $uid1st['team'] . '||login2=' . $uid1st['login'] . '||t2=' . $uid1st['team'] . '||time1=' . time() . '","","","","","6")');
+                }
+
+                // Бафф Зверя animal_bonus ---------------------------------
+                if ($u->info['animal'] > 0) {
+                    $a = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . $u->info['animal'] . '" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
+                    if (isset($a['id'])) {
+                        if ($a['eda'] >= 1) {
+                            $anl = mysql_fetch_array(mysql_query('SELECT `bonus` FROM `levels_animal` WHERE `type` = "' . $a['type'] . '" AND `level` = "' . $a['level'] . '" LIMIT 1'));
+                            $anl = $anl['bonus'];
+
+                            $tpa = [1 => 'cat', 2 => 'owl', 3 => 'wisp', 4 => 'demon', 5 => 'dog', 6 => 'pig', 7 => 'dragon'];
+                            $tpa2 = [1 => 'Кота', 2 => 'Совы', 3 => 'Светляка', 4 => 'Чертяки', 5 => 'Пса', 6 => 'Свина', 7 => 'Дракона'];
+                            $tpa3 = [1 => 'Кошачья Ловкость', 2 => 'Интуиция Совы', 3 => 'Сила Стихий', 4 => 'Демоническая Сила', 5 => 'Друг', 6 => 'Полная Броня', 7 => 'Инферно'];
+
+                            mysql_query('UPDATE `eff_users` SET `delete`="' . time() . '" WHERE `uid` = "' . $u->info['id'] . '" AND `overType` = 100 AND `delete` = 0');
+                            mysql_query('INSERT INTO `eff_users` (`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`,`user_use`) VALUES ("-1","201","summon_pet_' . $tpa[$a['type']] . '.gif",22,"' . $u->info['id'] . '","' . $tpa3[$a['type']] . ' [' . $a['level'] . ']","' . $anl . '","100","77","priem","' . $u->info['id'] . '")');
+
+                            if ($a['type'] == 6) {
+                                if ($a['level'] == 1 || $a['level'] == 2 || $a['level'] == 3) {
+                                    $zhp = 50;
+                                } elseif ($a['level'] == 4) {
+                                    $zhp = 75;
+                                } elseif ($a['level'] == 5 || $a['level'] == 6) {
+                                    $zhp = 125;
+                                } elseif ($a['level'] == 7 || $a['level'] == 8) {
+                                    $zhp = 150;
+                                } elseif ($a['level'] == 9) {
+                                    $zhp = 200;
+                                } elseif ($a['level'] == 10) {
+                                    $zhp = 300;
+                                } else {
+                                    $zhp = 0;
+                                }
+                                $u->info['hpNow'] += $zhp;
+                                mysql_query('UPDATE `stats` SET `hpNow` = "' . $u->info['hpNow'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                            }
+
+                        } else {
+                            $u->send('', $u->info['room'], $u->info['city'], '', $u->info['login'], '<b>' . $a['name'] . '</b> нуждается в еде...', time(), 6, 0, 0, 0, 1);
+                        }
+                    }
+                }
+                // Бафф Зверя animal_bonus ---------------------------------
+                $ltm = [1 => 2, 2 => 1];
+                mysql_query('UPDATE `stats` SET `hpNow` = "' . $uid1st['hpNow'] . '",`mpNow` = "' . $uid1st['mpNow'] . '",`team`="' . $ltm[$tm] . '",`tactic7`="' . (0 + $uid1st['tactic7']) . '" WHERE `id` = "' . $uid1 . '" LIMIT 1');
+                $good = $btl;
+                unset($uid1st);
+                if ($bsid != 0) {
+                    $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "' . $u->info['inTurnir'] . '" LIMIT 1'));
+                    if ($u->info['sex'] == 0) {
+                        $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} вмешался в поединок против {u2} <a target=_blank href=/logs.php?log=' . $btl_id . ' >»»</a>';
+                    } else {
+                        $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} вмешалась в поединок против {u2} <a target=_blank href=/logs.php?log=' . $btl_id . ' >»»</a>';
+                    }
+                    $usr_real = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `clan`, `battle`, `level` FROM `users` WHERE `inUser` = "' . $usr['id'] . '" LIMIT 1'));
+                    if (!isset($usr_real['id'])) {
+                        $usr_real = $usr;
+                    }
+                    if (isset($usr_real['id'])) {
+                        $usrreal = '';
+                        if ($usr_real['align'] > 0) {
+                            $usrreal .= '<img src=https://img.new-combats.com/i/align/align' . $usr_real['align'] . '.gif width=12 height=15 >';
+                        }
+                        if ($usr_real['clan'] > 0) {
+                            $usrreal .= '<img src=https://img.new-combats.com/i/clan/' . $usr_real['clan'] . '.gif width=24 height=15 >';
+                        }
+                        $usrreal .= '<b>' . $usr_real['login'] . '</b>[' . $usr_real['level'] . ']<a target=_blank href=https://new-combats.com/info/' . $usr_real['id'] . ' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
+                    } else {
+                        $mereal = '<i>Невидимка</i>[??]';
+                    }
+                    $me_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "' . $u->info['id'] . '" AND `login` = "' . $u->info['login'] . '" LIMIT 1'));
+                    if (isset($me_real['id'])) {
+                        $mereal = '';
+                        if ($me_real['align'] > 0) {
+                            $mereal .= '<img src=https://img.new-combats.com/i/align/align' . $me_real['align'] . '.gif width=12 height=15 >';
+                        }
+                        if ($me_real['clan'] > 0) {
+                            $mereal .= '<img src=https://img.new-combats.com/i/clan/' . $me_real['clan'] . '.gif width=24 height=15 >';
+                        }
+                        $mereal .= '<b>' . $me_real['login'] . '</b>[' . $me_real['level'] . ']<a target=_blank href=https://new-combats.com/info/' . $me_real['id'] . ' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
+                    } else {
+                        $mereal = '<i>Невидимка</i>[??]';
+                    }
+                    $text = str_replace('{u1}', $mereal, $text);
+                    $text = str_replace('{u2}', $usrreal, $text);
+                    mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES (
+					  "1", "' . mysql_real_escape_string($text) . '", "' . time() . '", "' . $bs['id'] . '", "' . $bs['count'] . '", "' . $bs['city'] . '",
+					  "' . round($bs['money'] * 0.85, 2) . '","' . $i . '")');
+                    unset($text, $usrreal, $mereal, $usr_real, $me_real);
+                }
+            }
+        }
+        return $good;
+    }
 }
 
 $magic = new Magic;
-- 
2.45.2


From 8e986b8032b8a1a60cf4ef35136c5d315a055d18 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Sun, 26 Jun 2022 23:36:47 +0300
Subject: [PATCH 08/12] Small fixes

---
 _incl_data/class/__user.php | 1781 ++----------------------------
 buttons.php                 | 2084 +++++++++++++++++++----------------
 2 files changed, 1213 insertions(+), 2652 deletions(-)

diff --git a/_incl_data/class/__user.php b/_incl_data/class/__user.php
index 3f7e0ea8..967e3cf3 100644
--- a/_incl_data/class/__user.php
+++ b/_incl_data/class/__user.php
@@ -6,7 +6,6 @@ if (!defined('GAME')) {
     die();
 }
 ignore_user_abort(true);
-//system('pkill www-data');
 
 function getdr($s, $v, $d)
 {
@@ -28,16 +27,12 @@ class user
     public $pokol = 2; //Акктуальное поколение предметов
     public $ekrcast = [
         310 => true, //Снадобье Забытых Мастеров
-
         33 => true, //Звездная Энергия
         34 => true, //Звездная Тяжесть
         35 => true, //Звездная Сияние
-
         42 => true, //Неуязвимость Оружию
         43 => true, //Неуязвимость Стихиям
-
         296 => true
-
     ];
     public $aves = ['now' => 0, 'max' => 0], $rep, $tfer, $error2 = '', $room = [], $bank = [], $align_nm = [
         1 => 'Свет',
@@ -74,18 +69,8 @@ class user
         'sv' => ['pza', 'pza1', 'pza2', 'pza3', 'pza4', 'pzm', 'pzm1', 'pzm2', 'pzm3', 'pzm4', 'pzm5', 'pzm6', 'pzm7', 'notravma', 'min_zonb', 'min_zona', 'nokrit', 'pog', 'min_use_mp', 'za1proc', 'za2proc', 'za3proc', 'za4proc', 'zaproc', 'zmproc', 'zm1proc', 'zm2proc', 'zm3proc', 'zm4proc', 'shopSale', 'shopSaleEkr', 's1', 's2', 's3', 's4', 's5', 's6', 's7', 's8', 's9', 's10', 's11', 'aall', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'm2all', 'mall', 'mg1', 'mg2', 'mg3', 'mg4', 'mg5', 'mg6', 'mg7', 'hpAll', 'mpAll', 'enAll', 'm1', 'm2', 'm3', 'm4', 'm5', 'm6', 'm7', 'm8', 'm9', 'm14', 'm15', 'm16', 'm17', 'm18', 'm19', 'm20', 'm21', 'pa1', 'pa2', 'pa3', 'pa4', 'pm1', 'pm2', 'pm3', 'pm4', 'pm5', 'pm6', 'pm7', 'min_use_mp', 'za', 'za1', 'za2', 'za3', 'za4', 'zma', 'zm', 'zm1', 'zm2', 'zm3', 'zm4', 'zm5', 'zm6', 'zm7', 'mib1', 'mab1', 'mib2', 'mab2', 'mib3', 'mab3', 'mib4', 'mab4', 'speedhp', 'speedmp', 'm10', 'm11', 'zona', 'zonb', 'maxves', 'minAtack', 'maxAtack', 'speeden']
     ];
 
-    /*
-						yrnhealmpprocmg3 - восставнавливает ману от урона по игроку, в % (магия воды)
-					*/
-
     public function sys_add($uid, $time, $type, $text, $data, $time_see)
     {
-        /*if(mysql_query('INSERT INTO `a_system` (`uid`,`time`,`type`,`text`,`data`,`time_see`) VALUES ("'.$uid.'","'.$time.'","'.$type.'","'.$text.'","'.$data.'","'.$time_see.'")')){
-
-		}else{
-			echo '.';
-		}
-		*/
     }
 
     public function repexp_add($id, $val)
@@ -165,12 +150,8 @@ class user
         $r = 1;
         if (floor($an) > 0) {
             $a = mysql_fetch_array(mysql_query('SELECT * FROM `users_align` WHERE `uid` = "' . $uid . '" AND (`delete` = "0" OR `delete` > "' . time() . '") LIMIT 1'));
-            if (isset($a['id'])) {
-                if (floor($a['align']) > 0) {
-                    if (floor($a['align']) != $an) {
-                        $r = 0;
-                    }
-                }
+            if (isset($a['id']) && floor($a['align']) > 0 && floor($a['align']) != $an) {
+                $r = 0;
             }
         }
         return $r;
@@ -361,99 +342,18 @@ class user
 
     public function add_buf($id, $tp, $uid = null, $mod = null)
     {
-        /*if($this->info['admin'] > 0) {
-			if($tp == 1) {
-
-				$cache = ob_get_contents();
-				ob_end_clean ();
-
-				//Добавляем новый
-				if($uid != '') {
-					$uid_f = floor($uid/1000);
-				}else{
-					$uid_f = '_m';
-				}
-
-				//Проверяем существование первой директории
-				if(!is_dir($id.'~a/'.$uid_f.'/') ) {
-					//создаем
-					mkdir($id.'~a/'.$uid_f.'/', 0700);
-				}
-
-				//Проверяем существование второй директории
-				if(!is_dir($id.'~a/'.$uid_f.'/'.$uid.'/') ) {
-					//создаем
-					mkdir($id.'~a/'.$uid_f.'/'.$uid.'/', 0700);
-				}
-
-				$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-
-				//Удаляем предыдущий экземпляр
-				if(file_exists($id)) {
-					$this->del_buf($id);
-				}
-
-				//Создаем файл
-				$fp = @fopen ($id, "w");
-				@fwrite($fp, $cache);
-				@fclose($fp);
-
-			}elseif($tp == 0) {
-				ob_start();
-			}
-		}*/
     }
 
     public function del_buf($id, $uid = null, $mod = null)
     {
-        /*if($uid != NULL && $mod != NULL) {
-			//генерируем ссылку
-			if((int)$uid > 0 && $uid != '') {
-				$uid_f = floor($uid/1000);
-			}else{
-				$uid_f = '_m_'.$uid;
-			}
-			$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-		}
-		if(file_exists($id)) {
-			unlink($id);
-		}*/
     }
 
     public function see_buf($id, $uid = null, $mod = null)
     {
-        /*if(file_exists($id)) {
-			if($uid != NULL && $mod != NULL) {
-				//генерируем ссылку
-				if($uid != '') {
-					$uid_f = floor($uid/1000);
-				}else{
-					$uid_f = '_m';
-				}
-				$id = $id.'~a/'.$uid_f.'/'.$uid.'/'.$mod.'_'.md5($mod).'.cach';
-			}
-			return file_get_contents($id);
-		}else{
-			return false;
-		}*/
     }
 
     public function sys_see($type)
     {
-        /*
-			$r = ''; $lid = $this->info['sys'];
-			$sp = mysql_query('SELECT `id`,`uid`,`time`,`type`,`text`,`data`,`time_see` FROM `a_system` WHERE `uid` = "'.$this->info['id'].'" AND `id` > "'.$this->info['sys'].'" ORDER BY `time` DESC LIMIT 20');
-			while($pl = mysql_fetch_array($sp)) {
-				$r .= 'top.tow('.$pl['id'].',"'.$pl['text'].'",'.$pl['time_see'].','.$pl['data'].');';
-				if($pl['id'] > $lid) {
-					$lid = $pl['id'];
-				}
-			}
-			if($lid > $this->info['sys']) {
-				mysql_query('UPDATE `users` SET `sys` = "'.$lid.'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-			}
-			return $r;
-			*/
     }
 
     public static function start()
@@ -519,14 +419,9 @@ class user
             while ($pl = mysql_fetch_array($sp)) {
                 $ur = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $pl['uid'] . '" LIMIT 1'));
                 $ub = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`room`,`name`,`sex`,`inUser`,`twink`,`lose`,`nich`,`win` FROM `users` WHERE `id` = "' . $ur['inUser'] . '" LIMIT 1'));
-                if (isset($ur['id']) && isset($ub['id'])) {
-                    if ($ub['lose'] > 0 || $ub['nich'] > 0) {
-                        //выкидываем из БС
-
-                    } else {
-                        $win = $ub;
-                        $winr = $ur;
-                    }
+                if (isset($ur['id']) && isset($ub['id']) && $ub['lose'] <= 0 && $ub['nich'] <= 0) {
+                    $win = $ub;
+                    $winr = $ur;
                 }
             }
 
@@ -757,24 +652,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 $bn = $st['a5'];
             }
             //Мощнность
-            //if( $x < 5 ) {
-            //$p['M'] = $st['pa'.$x];
-            //}else{
-            //	$p['M'] = $st['pm'.($x-4)];
-            //}
+
             $min = (($p['B'][0] + $sss + $p['W'][0]) * $p['T'] * (1 + 0.005 * $bn)) * (1 + $p['M'] / 100);
             $max = (($p['B'][1] + $sss + $p['W'][1]) * $p['T'] * (1 + 0.005 * $bn)) * (1 + $p['M'] / 100);
             //
             $kmin = ceil((2 * (1 + $st['m3'] / 100)) * $min);
             $kmax = ceil((2 * (1 + $st['m3'] / 100)) * $max);
-            /*
-				$r['Kmin'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['min']);
-				$r['Kmax'] = ceil( ( 2 * ( 1 + $p['K']/100 ) ) * $r['max']);
-				*/
-            //
-            //$min = $min*0.8;
-            //$max = $max*0.8;
-            //}
+
             $tp = [0 => ceil($min), 1 => ceil($max), 2 => ceil($kmin), 3 => ceil($kmax)];
         }
         return $tp;
@@ -1159,11 +1043,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
     public function getInfoById($id)
     {
-        $ch = mysql_fetch_array(mysql_query("SELECT `users`.*,`stats`.* FROM `users` INNER JOIN `stats` ON (`stats`.`id`=`users`.`id`) WHERE `users`.`id`='" . $id . "' OR
+        return mysql_fetch_array(mysql_query("SELECT `users`.*,`stats`.* FROM `users` INNER JOIN `stats` ON (`stats`.`id`=`users`.`id`) WHERE `users`.`id`='" . $id . "' OR
 			`users`.`login`= '" . mysql_real_escape_string($id) . "'"));
-
-
-        return $ch;
     }
 
     public function addItem($id, $uid, $md = null, $dn = null, $mxiznos = null, $nosudba = null, $plavka = null)
@@ -1187,11 +1068,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             }
 
 
-            if ($dn != null) {
-                //предмет с настройками из подземелья
-                if ($dn['dn_delete'] > 0) {
-                    $i['dn_delete'] = 1;
-                }
+            //предмет с настройками из подземелья
+            if ($dn != null && $dn['dn_delete'] > 0) {
+                $i['dn_delete'] = 1;
             }
             if ($mxiznos > 0) {
                 $i['iznosMAXi'] = $mxiznos;
@@ -1385,19 +1264,15 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 define('IP', $dip);
             }
 
-            if (isset($this->info['id']) && ($this->info['ip'] != IP || $this->info['banned'] > 0)) {
-                if ($_SERVER['REQUEST_URI'] != '/') {
-                    unset($this->info, $_COOKIE['login'], $_COOKIE['pass']);
-                    die('<script>top.location.href="https://new-combats.com/";</script>');
-                }
+            if (isset($this->info['id']) && ($this->info['ip'] != IP || $this->info['banned'] > 0) && $_SERVER['REQUEST_URI'] != '/') {
+                unset($this->info, $_COOKIE['login'], $_COOKIE['pass']);
+                die('<script>top.location.href="https://new-combats.com/";</script>');
             }
         }
 
-        if (isset($this->info['id'])) {
-            if ($this->info['exp'] > 300000 && $this->info['twink'] > 0) {
-                $this->info['exp'] = 300000;
-                mysql_query('UPDATE `users` SET `exp` = ' . $this->info['exp'] . ' WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
-            }
+        if (isset($this->info['id']) && $this->info['exp'] > 300000 && $this->info['twink'] > 0) {
+            $this->info['exp'] = 300000;
+            mysql_query('UPDATE `users` SET `exp` = ' . $this->info['exp'] . ' WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
         }
 
         if (isset($this->info['id']) && $this->info['inUser']) {
@@ -1652,20 +1527,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                             mysql_query('UPDATE `items_users` SET `inTransfer` = "0" WHERE (`uid` = "' . $this->tfer['uid1'] . '" OR `uid` = "' . $this->tfer['uid2'] . '") AND `inTransfer` > 0');
                             //Добавляем сообщение в чат
-                            if ($this->tfer['start2'] > 0) {
-
-
-                            }
                             unset($this->tfer, $upd);
                         }
-                    } else {
-                        if ($this->tfer['uid1'] == $this->info['id']) {
-                            //Передаем предметы другому игроку
-
-                        } elseif ($this->tfer['uid2'] == $this->info['id']) {
-                            //Принимаем передачу от другого игрока
-
-                        }
                     }
                 }
             }
@@ -1931,73 +1794,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
     public function onlineBonus()
     {
-        /*if( $this->info['inTurnir'] == 0 ){
-			$ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-			$tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1'));
-			$m = floor(($ts['time_all']-$tf['vals'])/60);
-			$h = floor($m/60);
-
-			if($h > 0 ) {
-				$ekr_add = round($h*0.45,2);
-				$bnks = mysql_fetch_array(mysql_query('SELECT `id`,`money2` FROM `bank` WHERE `uid` = "'.$this->info['id'].'" AND `block` = "0" ORDER BY `id` DESC LIMIT 1'));
-				if( isset($bnks['id']) ) {
-					$r .= ' Вы получили '.$ekr_add.' екр. (<small>Банк №'.$bnks['id'].'</small>) за '.$h.' ч. в онлайне!';
-					$this->info['catch'] += $ekr_add;
-					$bnks['money2'] += $ekr_add;
-					mysql_query('UPDATE `users` SET `catch` = "'.$this->info['catch'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					mysql_query('UPDATE `bank` SET `money2` = "'.$bnks['money2'].'" WHERE `id` = "'.$bnks['id'].'" LIMIT 1');
-					if(!isset($tf['id'])) {
-						$this->addAction(time(),'online_bonus_time',$ts['time_all']);
-					}elseif($tf['vals'] < $ts['time_all']) {
-						mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1');
-					}
-					mysql_query("INSERT INTO `chat` (`typeTime`,`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('2','1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','".time()."','6','0')");
-				}
-			}
-		}
-				/*$ts = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$this->info['id'].'" LIMIT 1'));
-				$tf = mysql_fetch_array(mysql_query('SELECT `id`,`time`,`vars`,`vals` FROM `actions` WHERE `uid` = "'.$this->info['id'].'" AND `vars` = "online_bonus_time" LIMIT 1'));
-				$m = floor(($ts['time_all']-$tf['vals'])/60);
-				$h = floor($m/60);
-
-				if($m > 0)
-				{
-					$this->stats = $this->getStats($this->info,0);
-					$r = '';
-					if(!isset($tf['id']))
-					{
-						$this->addAction(time(),'online_bonus_time',$ts['time_all']);
-					}elseif($tf['vals'] < $ts['time_all'])
-					{
-						mysql_query('UPDATE `actions` SET `vals` = "'.$ts['time_all'].'" WHERE `id` = "'.$tf['id'].'" LIMIT 1');
-					}
-
-					//Выдаем $m шт. предметов награды за онлайн
-					if($m > 0) {
-						$hrg = 1;
-						//$this->addItem(2130,$this->info['id'],'noodet=1|noremont=1');
-						$this->stats['enNow'] = $this->info['enNow'];
-						$enreg = round($m*(@$this->stats['enAll']/(60*$hrg)),7);
-						if($this->info['admin'] > 0) {
-							//
-						}
-
-						$this->stats['enNow'] += $enreg;
-						if($this->stats['enNow'] > $this->stats['enAll']) {
-							$this->stats['enNow'] = $this->stats['enAll'];
-							$enreg = 0;
-						}
-						$this->info['enNow'] = $this->stats['enNow'];
-						mysql_query('UPDATE `stats` SET `enNow` = "'.$this->stats['enNow'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-					}
-
-					/*if($this->info['id'] == 285838 || $this->info['admin'] > 0) {
-					$r .= '<strong><font color=red>Внимание!</font></strong> восстановлено энергии: <strong>'.$enreg.'</strong> ед. ['.$this->stats['enNow'].'/'.$this->stats['enAll'].']';
-
-					//Отправляем сообщение в чат
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$this->info['city']."','".$this->info['room']."','','".$this->info['login']."','".$r."','-1','5','0')");
-					}*/
-        //}
         return null;
     }
 
@@ -2006,15 +1802,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         if ($uid == null) {
             $uid = $this->info['id'];
         }
-        //mysql_query('LOCK TABLES actions WRITE');
         $ins = mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`,`vals`) VALUES ("' . $uid . '","' . $time . '","' . $this->info['city'] . '","' . $this->info['room'] . '","' . mysql_real_escape_string($vars) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '","' . mysql_real_escape_string($vls) . '")');
 
-        //mysql_query('UNLOCK TABLES');
-        if ($ins) {
-            return true;
-        } else {
-            return false;
-        }
+        return (bool)$ins;
     }
 
     public function testAction($filter, $tp)
@@ -2031,11 +1821,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
     public function takePersInfo($whr)
     {
-        $inf = mysql_fetch_array(mysql_query('SELECT 
+        return mysql_fetch_array(mysql_query('SELECT 
 		`u`.`id`,`u`.`login`,`u`.`login2`,`u`.`pass`,`u`.`pass2`,`u`.`repass`,`u`.`notrhod`,`u`.`emailconfirmation`,`u`.`securetime`,`u`.`sys`,`u`.`palpro`,`u`.`online`,`u`.`ip`,`u`.`ipreg`,`u`.`joinIP`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`banned`,`u`.`auth`,`u`.`align`,`u`.`align2`,`u`.`align_lvl`,`u`.`align_exp`,`u`.`mod_zvanie`,`u`.`clan`,`u`.`nextMsg`,`u`.`molch1`,`u`.`molch2`,`u`.`molch3`,`u`.`level`,`u`.`money`,`u`.`money2`,`u`.`money4`,`u`.`money3`,`u`.`battle`,`u`.`cityreg`,`u`.`invBlock`,`u`.`allLock`,`u`.`invBlockCode`,`u`.`zag`,`u`.`a1`,`u`.`q1`,`u`.`mail`,`u`.`name`,`u`.`bithday`,`u`.`sex`,`u`.`design`,`u`.`autospell`,`u`.`noplaw`,`u`.`city_real`,`u`.`icq`,`u`.`icq_hide`,`u`.`homepage`,`u`.`deviz`,`u`.`hobby`,`u`.`chatColor`,`u`.`timereg`,`u`.`add_smiles`,`u`.`obraz`,`u`.`win`,`u`.`win_bs`,`u`.`lose`,`u`.`nich`,`u`.`cityreg2`,`u`.`host`,`u`.`info_delete`,`u`.`dateEnter`,`u`.`afk`,`u`.`dnd`,`u`.`timeMain`,`u`.`clan_prava`,`u`.`addpr`,`u`.`marry`,`u`.`city2`,`u`.`invis`,`u`.`bot_id`,`u`.`haos`,`u`.`host_reg`,`u`.`inUser`,`u`.`inTurnir`,`u`.`inTurnirnew`,`u`.`jail`,`u`.`animal`,`u`.`vip`,`u`.`catch`,`u`.`frg`,`u`.`no_ip`,`u`.`type_pers`,`u`.`bot_room`,`u`.`clan_delay`,`u`.`bukmeker`,
 		`st`.`id`,`st`.`lider`,`st`.`btl_cof`,`st`.`last_hp`,`st`.`last_pr`,`st`.`smena`,`st`.`stats`,`st`.`hpAll`,`st`.`mpAll`,`st`.`hpNow`,`st`.`mpNow`,`st`.`enNow`,`st`.`transfers`,`st`.`regHP`,`st`.`regMP`,`st`.`showmenu`,`st`.`prmenu`,`st`.`ability`,`st`.`skills`,`st`.`sskills`,`st`.`nskills`,`st`.`exp`,`st`.`minHP`,`st`.`minMP`,`st`.`zv`,`st`.`dn`,`st`.`dnow`,`st`.`team`,`st`.`battle_yron`,`st`.`battle_exp`,`st`.`enemy`,`st`.`last_a`,`st`.`last_b`,`st`.`battle_text`,`st`.`upLevel`,`st`.`wipe`,`st`.`bagStats`,`st`.`timeGo`,`st`.`timeGoL`,`st`.`nextAct`,`st`.`active`,`st`.`bot`,`st`.`lastAlign`,`st`.`tactic1`,`st`.`tactic2`,`st`.`tactic3`,`st`.`tactic4`,`st`.`tactic5`,`st`.`tactic6`,`st`.`tactic7`,`st`.`x`,`st`.`y`,`st`.`s`,`st`.`battleEnd`,`st`.`priemslot`,`st`.`priems`,`st`.`priems_z`,`st`.`bet`,`st`.`clone`,`st`.`atack`,`st`.`bbexp`,`st`.`ref_data`,`st`.`res_x`,`st`.`res_y`,`st`.`res_s`,`st`.`bn_capitalcity`,`st`.`bn_demonscity`
 		FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE ' . $whr . ' LIMIT 1'));
-        return $inf;
     }
 
     public function addNewbot($id, $botDate, $clon, $logins_bot = null, $luser = null, $round = null)
@@ -2117,9 +1906,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $statss['m5'] = ceil($statss['m5'] * 0.75);
                         $statss['za'] = ceil($statss['za'] * 0.25);
 
-                        //$statss['yron_min']  -= $clon['level'] * 7;
-                        //$statss['yron_max']  -= $clon['level'] * 12;
-
                         $clon['stats'] = $this->impStats($statss);
                         unset($statss);
                     }
@@ -2776,9 +2562,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
                             if (isset($itm['data']) && $itm['data'] != '' && $c_itm == 0) {
                                 $po = $this->lookStats($itm['data']);
-                                //if(isset($po['complect'])) {
-                                //	if(isset($po['complect'])) $c_itm_data_a['complect'] = $po['complect'];
-                                //}
+
                                 if (isset($po['sudba'])) {
                                     if (isset($po['sudba'])) $c_itm_data_a['sudba'] = $po['sudba'];
                                 }
@@ -2934,17 +2718,13 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 }
 
                 //Скидка в государственный магазин 5%
-                if ($this->stats['silver'] >= 1) {
-                    if ($sid == 1) {
-                        $i['price_1'] = round($i['price_1'] / 100 * 95, 2);
-                    }
+                if ($this->stats['silver'] >= 1 && $sid == 1) {
+                    $i['price_1'] = round($i['price_1'] / 100 * 95, 2);
                 }
 
                 //Скидка в березку магазин 5%
-                if ($this->stats['silver'] >= 5) {
-                    if ($sid == 2) {
-                        $i['price_2'] = round($i['price_2'] / 100 * 95, 2);
-                    }
+                if ($this->stats['silver'] >= 5 && $sid == 2) {
+                    $i['price_2'] = round($i['price_2'] / 100 * 95, 2);
                 }
 
                 $price = $i['price_1'] * $x;
@@ -3189,48 +2969,30 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
 
     public function takeBonus()
     {
-        if (!isset($_GET['getb1w'])) {
-            /*$this->info['money'] += 25;
-				mysql_query('UPDATE `users` SET `money` = "'.$this->info['money'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				mysql_query('INSERT INTO `aaa_bonus` (`uid`,`time`) VALUES (
-					"'.$this->info['id'].'","'.(time()+1*3600).'"
-				)');
-				$this->error = 'Вам зачислено 25 кр.';*/
-        } else {
-            if ($_GET['getb1w'] == 3) {
-                $pensia1 = $this->pensia(false);
-                $pensia2 = $this->pensia(true);
-                if ($this->info['timeMain'] < time() - 15 * 60) {
-                    $afk = 1;
-                } else {
-                    $afk = 0;
-                }
-                if ($pensia2[0] == 1) {
-                    $this->info['money'] += $pensia2[1];
-                    mysql_query('UPDATE `users` SET `money` = `money` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
-                } else {
-                    $this->info['money2'] += $pensia2[1];
-                    mysql_query('UPDATE `users` SET `money2` = `money2` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
-                }
-                $this->error = 'Вам начислен бонус в размере ' . $pensia1 . '! ';
-                mysql_query('INSERT INTO `aaa_bonus` (
-						`uid`,`time`,`afk`,`type`,`money`
-					) VALUES (
-						"' . $this->info['id'] . '","' . (time() + 1 * 3600) . '","' . $afk . '","' . $pensia2[0] . '","' . $pensia2[1] . '"
-					)');
-
+        if (isset($_GET['getb1w']) && $_GET['getb1w'] == 3) {
+            $pensia1 = $this->pensia(false);
+            $pensia2 = $this->pensia(true);
+            $afk = $this->info['timeMain'] < time() - 15 * 60 ? 1 : 0;
+            if ($pensia2[0] == 1) {
+                $this->info['money'] += $pensia2[1];
+                mysql_query('UPDATE `users` SET `money` = `money` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
+            } else {
+                $this->info['money2'] += $pensia2[1];
+                mysql_query('UPDATE `users` SET `money2` = `money2` + "' . $pensia2[1] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
             }
+            $this->error = 'Вам начислен бонус в размере ' . $pensia1 . '! ';
+            mysql_query('INSERT INTO `aaa_bonus` (
+                    `uid`,`time`,`afk`,`type`,`money`
+                ) VALUES (
+                    "' . $this->info['id'] . '","' . (time() + 1 * 3600) . '","' . $afk . '","' . $pensia2[0] . '","' . $pensia2[1] . '"
+                )');
+
         }
     }
 
     public function addDelo($tp, $uid, $txt, $tm, $ct, $frm, $mo, $mi, $vvv = false)
     {
-        $inc = mysql_query("INSERT INTO `users_delo` (`dop`,`moneyOut`,`moneyIn`,`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . mysql_real_escape_string($vvv) . "','" . mysql_real_escape_string($mo) . "','" . mysql_real_escape_string($mi) . "','" . mysql_real_escape_string($uid) . "','" . $_SERVER['HTTP_X_REAL_IP'] . "','" . $ct . "','" . $tm . "','" . mysql_real_escape_string($txt) . "','" . mysql_real_escape_string($frm) . "'," . $tp . ")");
-        if ($inc) {
-            return true;
-        } else {
-            return false;
-        }
+        return mysql_query("INSERT INTO `users_delo` (`dop`,`moneyOut`,`moneyIn`,`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . mysql_real_escape_string($vvv) . "','" . mysql_real_escape_string($mo) . "','" . mysql_real_escape_string($mi) . "','" . mysql_real_escape_string($uid) . "','" . $_SERVER['HTTP_X_REAL_IP'] . "','" . $ct . "','" . $tm . "','" . mysql_real_escape_string($txt) . "','" . mysql_real_escape_string($frm) . "'," . $tp . ")");
     }
 
     public function newAct($test)
@@ -3267,7 +3029,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 if ($UpdMoney) {
                     $this->info['money'] -= $price;
                     $UpMoney2 = mysql_query('UPDATE `users` SET `money` = `money` + ' . $price . ' WHERE `id` = ' . $i2['uid'] . ' LIMIT 1');
-                    #$UpItems = mysql_query('UPDATE `items_users` SET `uid` = '.$this->info['id'].', `1price` = "'.$i1['price1'].'", `lastUPD` = "'.time().'", `inShop` = 0 WHERE `id` = '.$iid.' and `inShop` = 30 LIMIT 1');
 
                     $col = $this->itemsX($iid);
                     if ($col > 1) {
@@ -3348,119 +3109,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         return $r;
     }
 
-    /*public function commisionShop($sid,$preview = "full"){
-		global $c,$code,$sid;
-
-		switch ((int)$_GET['otdel']) {
-	 	 	 	 	 case 1:$typeOtdel = 18; break;
-	 	 	 	 	 case 2:$typeOtdel = 19; break;
-	 	 	 	 	 case 3:$typeOtdel = 20; break;
-	 	 	 	 	 case 4:$typeOtdel = 21; break;
-	 	 	 	 	 case 5:$typeOtdel = 22; break;
-	 	 	 	 	 case 6:$typeOtdel = 15; break;
-	 	 	 	 	 case 7:$typeOtdel = 12; break;
-	 	 	 	 	 case 8:$typeOtdel = 4; break;
-	 	 	 	 	 case 9:$typeOtdel = 5; break;
-	 	 	 	 	 case 10:$typeOtdel = 6; break;
-	 	 	 	 	 case 11:$typeOtdel = 1; break;
-	 	 	 	 	 case 12:$typeOtdel = 3; break;
-	 	 	 	 	 case 13:$typeOtdel = 8; break;
-	 	 	 	 	 case 14:$typeOtdel = 14; break;
-	 	 	 	 	 case 15:$typeOtdel = 13; break;
-	 	 	 	 	 case 16:$typeOtdel = 9; break;
-	 	 	 	 	 case 17:$typeOtdel = 10; break;
-	 	 	 	 	 case 18:$typeOtdel = 11; break;
-	 	 	 	 	 case 19:$typeOtdel = 29; break;
-	 	 	 	 	 case 20:$typeOtdel = 30; break;
-					case 1050:$typeOtdel = 1050; break;
-	 	 	 	 	 default :$typeOtdel = 18;
-		}
-
-
-		//
-
-		if( $typeOtdel == 1050 ) {
-			//Просмотр прочего
-			if($preview == "full") {
-
-			}else{
-				$sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND
-					`b`.`type` != "18" AND
-					`b`.`type` != "19" AND
-					`b`.`type` != "20" AND
-					`b`.`type` != "21" AND
-					`b`.`type` != "22" AND
-					`b`.`type` != "15" AND
-					`b`.`type` != "12" AND
-					`b`.`type` != "4" AND
-					`b`.`type` != "5" AND
-					`b`.`type` != "6" AND
-					`b`.`type` != "1" AND
-					`b`.`type` != "3" AND
-					`b`.`type` != "8" AND
-					`b`.`type` != "14" AND
-					`b`.`type` != "13" AND
-					`b`.`type` != "9" AND
-					`b`.`type` != "10" AND
-					`b`.`type` != "11" AND
-					`b`.`type` != "29" AND
-					`b`.`type` != "30"
-
-					GROUP BY `b`.`name`
-
-					');
-			}
-		}else{
-			//Вывод общего списка предметов
-			if($preview == "full") {
-
-			}else{
-				$sp = mysql_query('SELECT `a`.*,`b`.* FROM `items_users` AS `a` LEFT JOIN `items_main` AS `b` ON `a`.`item_id` = `b`.`id` WHERE `a`.`inShop` = "30" AND `b`.`type` = "'.mysql_real_escape_string($typeOtdel).'" GROUP BY `b`.`name` ORDER BY `b`.`name` DESC');
-			}
-			//
-		}
-		$cr = 'c8c8c8';
-		$i = 0;
-	 	 $steckCikl = 1;
-		while($pl = mysql_fetch_array($sp)) {
-			//
-			$is1 = '';
-			$is2 = '';
-			//
-			if($preview == "full") {
-
-			}else{
-				//Отоюражение в разделах
-				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` ASC LIMIT 1'));
-				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `1price` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `1price` DESC LIMIT 1'));
-				//
-				$is2 .= '<a target="_blank" href="https://new-combats.com/item/'.$pl['item_id'].'">'.$pl['name'].'</a> &nbsp; (Масса: '.$pl['massa'].')';
-				//$is2 .= '<br><strong>Цена: '.$pvr1[0].'-'.$pvr2[0].' кр.</strong> <small>(количество: 0)</small>';
-				//
-				//$pvr1 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` ASC LIMIT 1'));
-				//$pvr2 = mysql_fetch_array(mysql_query('SELECT `iznosNOW`,`iznosMAX` FROM `items_users` WHERE `inShop` = 30 AND `item_id` = "'.$pl['item_id'].'" ORDER BY `iznosNOW` DESC LIMIT 1'));
-				//
-				//$is2 .= '<br>Долговечность: '.floor($pvr1[0]).'-'.floor($pvr1[1]).'/'.floor($pvr2[0]).'-'.floor($pvr2[1]).'';
-				//
-				$is1 .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'"><br>';
-				$is1 .= '<a href="?toRent=3&otdel='.round($_GET['otdel']).'&itemid='.$pl['item_id'].'">подробнее</a><br>';
-			}
-			echo '<tr style="background-color:#'.$cr.';"><td width="100" style="padding:7px;" valign="middle" align="center">'.$is1.'</td><td style="padding:7px;" valign="top">'.$is2.'</td></tr>';
-			if( $cr == 'c8c8c8' ) {
-				$cr = 'd4d4d4';
-			}else{
-				$cr = 'c8c8c8';
-			}
-			$i++;
-		}
-		//
-		if( $i == 0 ) {
-			echo '<tr style="background-color:#'.$cr.';"><td style="padding:7px;" align="center" valign="top">Прилавок магазина пуст</td></tr>';
-		}
-		//
-	 	 //*   * * * * * * * * * *
-	 }*/
-
     public function commisionShop($sid, $preview = "full")
     {
         global $c, $code, $sid;
@@ -3829,67 +3477,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         $is2 .= '<br><strong>Свойства предмета:</strong>' . $tr;
                     }
 
-                    //Особенности
-                    /*
-					$tr = '';
-					$x = 1;
-					while($x<=4){
-						if($po['tya'.$x]>0){
-							$tyc = 'Ничтожно редки';
-							if($po['tya'.$x]>6){
-								$tyc = 'Редки';
-							}
-							if($po['tya'.$x]>14){
-								$tyc = 'Малы';
-							}
-							if($po['tya'.$x]>34){
-								$tyc = 'Временами';
-							}
-							if($po['tya'.$x]>79){
-								$tyc = 'Регулярны';
-							}
-							if($po['tya'.$x]>89){
-								$tyc = 'Часты';
-							}
-							if($po['tya'.$x]>=100){
-								$tyc = 'Всегда';
-							}
-							$tr .= '<br>• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-						}
-						$x++;
-					}
-					$x = 1;
-					while($x<=7){
-						if($po['tym'.$x]>0){
-							$tyc = 'Ничтожно редки';
-							if($po['tym'.$x]>6){
-								$tyc = 'Редки';
-							}
-							if($po['tym'.$x]>14){
-								$tyc = 'Малы';
-							}
-							if($po['tym'.$x]>34){
-								$tyc = 'Временами';
-							}
-							if($po['tym'.$x]>79){
-								$tyc = 'Регулярны';
-							}
-							if($po['tym'.$x]>89){
-								$tyc = 'Часты';
-							}
-							if($po['tym'.$x]>=100){
-								$tyc = 'Всегда';
-							}
-							$tr .= '<br>• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-						}
-						$x++;
-					}
-
-					if($tr!=''){
-						$is2 .= '<br><strong>Особенности:</strong>'.$tr;
-					}
-					*/
-
                     $tr = '';
 
                     if (isset($po['imposed']) && $po['imposed'] > 0) {
@@ -4081,13 +3668,9 @@ ORDER BY `1price`ASC , inGroupCount DESC');
         if ($this->info['admin'] > 0) {
             $ishp = mysql_fetch_array(mysql_query('SELECT * FROM `items_shop` WHERE `sid` = "' . mysql_real_escape_string($sid) . '" AND `r` = "' . mysql_real_escape_string($_GET['otdel']) . '" AND `item_id` = "' . mysql_real_escape_string($_GET['itmid']) . '" AND `kolvo` > 0 LIMIT 1'));
             if (isset($_GET['itmup'])) {
-                //mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']+1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']-1).'" LIMIT 1');
                 mysql_query('UPDATE `items_shop` SET `pos` = "' . ($ishp['pos'] - 1) . '" WHERE `sid` = "' . mysql_real_escape_string($sid) . '" AND `r` = "' . mysql_real_escape_string($_GET['otdel']) . '" AND `item_id` = "' . mysql_real_escape_string($_GET['itmid']) . '"  AND `kolvo` > 0 LIMIT 1');
             } elseif (isset($_GET['itmdown'])) {
-                //mysql_query('UPDATE `items_shop` SET `pos` = "'.($ishp['pos']-1).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `pos` = "'.($ishp['pos']+1).'" LIMIT 1');
                 mysql_query('UPDATE `items_shop` SET `pos` = "' . ($ishp['pos'] + 1) . '" WHERE `sid` = "' . mysql_real_escape_string($sid) . '" AND `r` = "' . mysql_real_escape_string($_GET['otdel']) . '" AND `item_id` = "' . mysql_real_escape_string($_GET['itmid']) . '"  AND `kolvo` > 0 LIMIT 1');
-            } elseif (isset($_GET['itmid'])) {
-                //mysql_query('UPDATE `items_shop` SET `pos` = "'.mysql_real_escape_string($_GET['itmpos']).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.mysql_real_escape_string($_GET['itmid']).'" LIMIT 1');
             }
         }
 
@@ -4097,38 +3680,13 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 		`ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby`
 		FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "' . mysql_real_escape_string($sid) . '" AND `ish`.`r` = "' . mysql_real_escape_string($_GET['otdel']) . '" ORDER BY `ish`.`pos` ASC');
 
-
-        /*
-		$cl = mysql_query('SELECT
-		`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-		`ish`.`iid`,`ish`.`item_id`,`ish`.`data2`,`ish`.`iznos`,`ish`.`pos`,`ish`.`cantBuy`,`ish`.`kolvo`,`ish`.`geniration`,`ish`.`magic_inc`,`ish`.`timeOver`,`ish`.`overType`,`ish`.`secret_id`,`ish`.`sid`,`ish`.`r`,`ish`.`price_1`,`ish`.`price_2`,`ish`.`price_3`,`ish`.`level`,`ish`.`tr_items`,`ish`.`max_buy`,`ish`.`real`,`ish`.`nozuby`
-		FROM `items_shop` AS `ish` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `ish`.`item_id`) WHERE `ish`.`sid` = "'.mysql_real_escape_string($sid).'" AND `ish`.`r` = "'.mysql_real_escape_string($_GET['otdel']).'" ORDER BY `ish`.`pos` ASC');
-		*/
-
         $cr = 'c8c8c8';
         $i = 0;
         $jid = 0;
         while ($pl = mysql_fetch_array($cl)) {
-            /*if($pl['price_1']==0 && $pl['price1']>0)
-			{
-				mysql_query('UPDATE `items_shop` SET `price_1` = "'.$pl['price1'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-			}
-			if($pl['price_2']==0 && $pl['price2']>0)
-			{
-				mysql_query('UPDATE `items_shop` SET `price_2` = "'.$pl['price2'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-			}*/
-
             if ($pl['kolvo'] > 0) {
                 $jid++;
-                //if( $pl['pos'] != $jid ) {
-                //	$pl['pos'] = $jid;
-                //	mysql_query('UPDATE `items_shop` SET `pos` = "'.($jid).'" WHERE `sid` = "'.mysql_real_escape_string($sid).'" AND `r` = "'.mysql_real_escape_string($_GET['otdel']).'" AND `item_id` = "'.$pl['id'].'" AND `kolvo` > 0 LIMIT 1');
-                //}
-                if ($cr == 'd4d4d4') {
-                    $cr = 'c8c8c8';
-                } else {
-                    $cr = 'd4d4d4';
-                }
+                $cr = $cr == 'd4d4d4' ? 'c8c8c8' : 'd4d4d4';
                 if ($pl['price_1'] < 0.01 && $pl['tr_items'] == '') {
                     $pl['price_1'] = $pl['price1'];
                 }
@@ -4149,13 +3707,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     $po['icos'] = 'WL';
                 }
 
-                /*
-				if($pl['level']==0 && $po['tr_lvl']>0)
-				{
-					mysql_query('UPDATE `items_shop` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-					mysql_query('UPDATE `items_main` SET `level` = "'.$po['tr_lvl'].'" WHERE `iid` = "'.$pl['id'].'" LIMIT 1');
-				}*/
-
                 if (($pl['type'] >= 18 && $pl['type'] <= 24) || $pl['type'] == 26 || $pl['type'] == 27) {
                     //Зоны блока +
                     $po['zonb']++;
@@ -4178,76 +3729,12 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                         $is1 .= '<span id="shopPlus' . $pl['id'] . '"></span><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_1'] . '\',\' кр.\');">купить</a> <a href="javascript:void(0);" onClick="top.payPlus(' . $pl['id'] . ');"><img style="width:11px; height:11px;" src="https://img.new-combats.com/i/up.gif" title="Купить несколько предметов"></a>';
                     }
                     //}
-                    if ($sid == 777 && $this->stats['silver'] > 1) {
-                        //$is1 .= '<br><a onClick="if(confirm(\'Совершить VIP-покупку?\')){ location.href = \'main.php?'.$plu.'otdel='.((int)$_GET['otdel']).'&buy_vip='.$pl['id'].'&sd4='.$this->info['nextAct'].'&rnd='.$code.'\'; }" href="javascript:void('.$pl['id'].');">VIP покупка ('.round($pl['price_2']/20,2).' екр.)</a> ';
+
+                    if ($pl['nozuby'] == 0 && $this->info['level'] > 0 && $this->info['level'] < 8 && $pl['level'] < 8 && $sid_zuby == 1 && $c['zuby']) {
+                        $is1 .= '<br><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&zuby=1&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_1'] . '\',\' (Зубы)\');">купить за зубы</a>';
                     }
-                    if ($pl['nozuby'] == 0) {
-                        if ($this->info['level'] > 0 && $this->info['level'] < 8) {
-                            if ($pl['level'] < 8 && $sid_zuby == 1 && $pl['nozuby'] == 0 && $c['zuby'] == true) {
-                                $is1 .= '<br><a href="javascript:void(' . $pl['id'] . ');" onClick="top.buyShopNow(' . $pl['id'] . ',\'?' . $plu . 'otdel=' . ((int)$_GET['otdel']) . '&zuby=1&buy=' . $pl['id'] . '&sd4=' . $this->info['nextAct'] . '&rnd=' . $code . '\',\'' . $pl['name'] . '\',\'' . $pl['price_1'] . '\',\' (Зубы)\');">купить за зубы</a>';
-                                /*if( $this->info['admin'] > 0 ) {
-									if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
-										mysql_query('UPDATE `items_shop` SET `nozuby` = 1 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-									}
-									$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">Запретить продажу за зубы</a>)</small>';
-								}*/
-                            }
-                        }
-                    }/*elseif( $this->info['admin'] > 0 ) {
-						if( isset($_GET['nozbpl']) && $pl['iid'] == $_GET['nozbpl'] ) {
-							mysql_query('UPDATE `items_shop` SET `nozuby` = 0 WHERE `iid` = "'.$pl['iid'].'" LIMIT 1');
-						}
-						$is1 .= '<br><br><small>(<a name="itmzub'.$pl['iid'].'" href="main.php?otdel='.((int)$_GET['otdel']).'&nozbpl='.$pl['iid'].'#itmzub'.$pl['iid'].'">Разрешить продажу за зубы</a>)</small>';
-					}*/
                 }
-                /*
-				if($this->info['admin'] > 0) {
-					$is1 .= '<br><br><small>Выберите тип предмета: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_class=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Отсутствует</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Танк</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Уворот</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Крит</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Силовик</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Универсал</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_class=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Маг</a></small>';
-				}
 
-				if($this->info['admin'] > 0) {
-					$is1 .= '<br><small>Выберите тип доминирования: <br>'.
-					'  <a href="?otdel='.$_GET['otdel'].'&add_aclass=0&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">Отсутствует</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=1&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Танком</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=2&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Уворотом</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=3&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Критом</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=4&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Силовиком</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=5&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Универсалом</a>'.
-					', <a href="?otdel='.$_GET['otdel'].'&add_aclass=6&itm_id='.$pl['id'].'#sit_'.$pl['id'].'">над Магом</a></small>';
-					//уровень доминирования
-
-				}
-
-				if($this->info['admin']>0) {
-					if(isset($_GET['add_class']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) {
-						mysql_query('UPDATE `items_main` SET `class` = "'.mysql_real_escape_string($_GET['add_class']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1');
-						$pl['class'] = $_GET['add_class'];
-					}
-					if(isset($_GET['add_aclass']) && isset($_GET['itm_id']) && $_GET['itm_id'] == $pl['id']) {
-						mysql_query('UPDATE `items_main` SET `anti_class` = "'.mysql_real_escape_string($_GET['add_aclass']).'" WHERE `id` = "'.$pl['item_id'].'" LIMIT 1');
-						$pl['anti_class'] = $_GET['add_aclass'];
-					}
-
-					if($pl['class'] > 0) {
-						$clnm = array('Отсутствует','Танк','Уворот','Крит','Силовик','Универсал','Маг');
-						$is1 .= '<br><br><small>Предмет для '.$clnm[$pl['class']].'а</small>';
-						unset($clnm);
-					}
-
-					if($pl['anti_class'] > 0) {
-						$clnm = array('Отсутствует','Танк','Уворот','Крит','Силовик','Универсал','Маг');
-						$is1 .= '<br><small>Доминирует над '.$clnm[$pl['anti_class']].'ом</small>';
-						unset($clnm);
-					}
-				}
-				*/
                 //название
 
                 if (isset($po['tr_align']) && !isset($po['tr_align_bs'])) {
@@ -4260,9 +3747,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     }
                 }
 
-                if (isset($po['tr_rep']) && isset($po['tr_dungeon'])) {
-                    //$pl['name'] .= '<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$po['tr_align'].'.gif >';
-                }
                 if (isset($po['renameadd']) && $po['renameadd'] != '') {
                     $pl['name'] .= ' (Предмет: ' . $po['renameadd'] . ')';
                 }
@@ -4573,79 +4057,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                 }
 
                 //Особенности
-                /*$tr = '';
-				$x = 1;
-				while($x<=4)
-				{
-					if($po['tya'.$x]>0)
-					{
-						$tyc = 'Ничтожно редки';
-						if($po['tya'.$x]>6)
-						{
-							$tyc = 'Редки';
-						}
-						if($po['tya'.$x]>14)
-						{
-							$tyc = 'Малы';
-						}
-						if($po['tya'.$x]>34)
-						{
-							$tyc = 'Временами';
-						}
-						if($po['tya'.$x]>79)
-						{
-							$tyc = 'Регулярны';
-						}
-						if($po['tya'.$x]>89)
-						{
-							$tyc = 'Часты';
-						}
-						if($po['tya'.$x]>=100)
-						{
-							$tyc = 'Всегда';
-						}
-						$tr .= '<br>• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-					}
-					$x++;
-				}
-				$x = 1;
-				while($x<=7)
-				{
-					if(@$po['tym'.$x]>0)
-					{
-						$tyc = 'Ничтожно редки';
-						if($po['tym'.$x]>6)
-						{
-							$tyc = 'Редки';
-						}
-						if($po['tym'.$x]>14)
-						{
-							$tyc = 'Малы';
-						}
-						if($po['tym'.$x]>34)
-						{
-							$tyc = 'Временами';
-						}
-						if($po['tym'.$x]>79)
-						{
-							$tyc = 'Регулярны';
-						}
-						if($po['tym'.$x]>89)
-						{
-							$tyc = 'Часты';
-						}
-						if($po['tym'.$x]>=100)
-						{
-							$tyc = 'Всегда';
-						}
-						$tr .= '<br>• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-					}
-					$x++;
-				}
-				if($tr!='')
-				{
-					$is2 .= '<br><strong>Особенности:</strong>'.$tr;
-				}*/
 
                 $tr = '';
 
@@ -4754,10 +4165,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     $is2 .= '<div>' . $po['info'] . '</div>';
                 }
 
-                if ($pl['maidin'] != '') {
-                    //	$is2 .= '<div>Сделано в '.$this->city_name[$pl['maidin']].'</div>';
-                }
-
                 if (isset($po['noremont'])) {
                     $is2 .= '<div style="color:brown;">Предмет не подлежит ремонту</div>';
                 }
@@ -4802,8 +4209,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     $is2 .= '<div style="color:brown;">Предмет куплен за зубы</div>';
                 }
 
-                //$is2 .= '<div>Сделано в '.$this->city_name[$this->info['city']].'</div>';
-
                 $is2 .= '</small>';
 
                 $crd = '';
@@ -4991,11 +4396,7 @@ ORDER BY `1price`ASC , inGroupCount DESC');
 		FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "' . ((int)$id) . '" AND `iu`.`uid` = "' . $uid . '" AND `iu`.`delete` = "0" AND `iu`.`inShop` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
         if (isset($itm['id'])) {
             $po = $this->lookStats($itm['data']);
-            /*
-		mf_stats
-		mf_mod
-		mf_mib
-*/
+
             //статы
             if ($_GET['mf'] == 's1' || $_GET['mf'] == 's2' || $_GET['mf'] == 's3' || $_GET['mf'] == 's5') {
                 if (isset($po['mf_stats']) && $po['mf_stats'] > 0 && isset($po['add_' . $_GET['mf']])) {
@@ -5033,7 +4434,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
                     mysql_query('UPDATE `items_users` SET `data` = "' . $po . '" WHERE `id` = "' . $itm['id'] . '" LIMIT 1');
                 }
             }
-
         }
     }
 
@@ -5156,13 +4556,6 @@ ORDER BY `1price`ASC , inGroupCount DESC');
             } else {
                 $upd = mysql_query('UPDATE `items_users` SET `inShop` = 1 WHERE `uid` = "' . $this->info['id'] . '" AND `inShop` != "30" AND `id` = "' . $id . '" AND `inOdet` = "0" AND `delete` = "0" ');
             }
-            if ($upd) { /*
-				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
-				$this->info['transfers']--;
-				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				$this->error = 'Предмет &quot;'.$itm['name'].''.$col.'&quot; перенесен из инвентаря';
-				*/
-            }
         } else {
             $this->error = 'Предмет не найден в рюкзаке';
         }
@@ -5185,13 +4578,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             } else {
                 $upd = mysql_query('UPDATE `items_users` SET `inShop` = 0 WHERE `uid` = "' . $this->info['id'] . '" AND `id` = "' . $id . '" AND `inShop` != "30" AND `inOdet` = "0" AND `delete` = "0" ');
             }
-            if ($upd) { /*
-				if($col>1) { $col = ' (x'.$col.')'; }else{ $col = ''; }
-				$this->error = 'Предмет &quot;'.$itm['name'].''.$col.'&quot; перенесен в инвентаря';
-				$this->info['transfers']--;
-				mysql_query('UPDATE `stats` SET `transfers` = "'.$this->info['transfers'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-				*/
-            }
         } else {
             $this->error = 'Предмет не найден в сундуке';
         }
@@ -5361,11 +4747,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 if ($rune['type'] == 5) {
                     $type_rune['мо'] = 5;
                 }
-                //
-                //$idt = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`img`,`type`,`inslot`,`2h`,`2too`,`iznosMAXi`,`inRazdel`,`price1`,`price2`,`price3`,`magic_chance`,`info`,`massa`,`level`,`magic_inci`,`overTypei`,`group`,`group_max`,`geni`,`ts`,`srok`,`class`,`class_point`,`anti_class`,`anti_class_point`,`max_text`,`useInBattle`,`lbtl`,`lvl_itm`,`lvl_exp`,`lvl_aexp` FROM `items_main` WHERE `id` = "'.$id['item_id'].'" LIMIT` 1'));
-                //if( $idt['type'] == 5 ){ $idt['type'] = 6; }
-                //$id['type'] = $idt['type'];
-                //
+
                 $type_rune = $type_rune[substr($rune['name'], -2, 2)];
                 if ($type_rune != $id['type'] && $type_rune != '') {
                     $type_rune2 = [
@@ -5410,9 +4792,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         }
                         $i++;
                     }
-                    //if( $rune['level'] > $data['tr_lvl'] ) {
-                    //	$data['tr_lvl'] = $rune['level'];
-                    //}
+
                     $data = $this->impStats($data);
                     mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                     mysql_query('UPDATE `items_users` SET `data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
@@ -5648,8 +5028,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                     unset($this->items['add'][$delk + $i]);
                                     $i++;
                                 }
-                                //$i++;
-                                //}
+
                             }
                         }
                         //Новая чарка
@@ -5705,15 +5084,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                         if ($rnda == 'mab1' || $rnda == 'mab2' || $rnda == 'mab3' || $rnda == 'mab4') {
                                             $data['add_' . str_replace('mab', 'mib', $rnda)] += $add[$tw . 'add' . $utp[$i] . '_' . $rnda];
                                         }
-                                        /*$jkh = 1;
-										while( $jkh <= 4 ) {
-											if($rnda == 'mib'.$jkh) {
-												$data['add_mab'.$jkh] += $add['add'.$utp[$i].'_'.$rnda];
-											}elseif($rnda == 'mab'.$jkh) {
-												$data['add_mib'.$jkh] += $add['add'.$utp[$i].'_'.$rnda];
-											}
-											$jkh++;
-										}*/
 
                                         $data['spell'] = $rune['id'];
                                         if (!isset($data['sudba'])) {
@@ -5725,19 +5095,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                             if ($data['spell_st_name'] == 'mab1' || $data['spell_st_name'] == 'mab2' || $data['spell_st_name'] == 'mab3' || $data['spell_st_name'] == 'mab4') {
                                                 $data['add_' . str_replace('mab', 'mib', $data['spell_st_name'])] -= $data['spell_st_val'];
                                             }
-                                            /*$jkh = 1;
-											while( $jkh <= 4 ) {
-												if( $data['spell_st_name'] == 'mib'.$jkh ) {
-													$data['add_' . str_replace('mib','mab',$data['spell_st_name'])] -= $data['spell_st_val'];
-												}elseif( $data['spell_st_name'] == 'mab'.$jkh ) {
-													$data['add_' . str_replace('mab','mib',$data['spell_st_name'])] -= $data['spell_st_val'];
-												}
-												$jkh++;
-											}*/
+
                                             if ($data['add_' . $data['spell_st_name']] == 0) {
                                                 unset($data['add_' . $data['spell_st_name']]);
                                             }
-                                            //die('Прошлое усиление: '.$data['spell_st_name'].' +'.$data['spell_st_val'].'<br>Попробуйте позже...');
                                         }
 
                                         $data['spell_id'] = $rune['item_id'];
@@ -5759,7 +5120,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                         $this->is['mab4'] = 'Броня ног';
                                         $this->error = 'Увеличина характеристика предмета &quot;' . $id['name'] . '&quot;, ' . $this->is[$rnda] . ': +' . $add[$tw . 'add' . $utp[$i] . '_' . $rnda];
 
-                                        //$this->error = '<br/><br/><br/>Увеличина характеристика предмета &quot;'.$id['name'].'&quot;, '.$this->is[$rnda].': +'.$add['add'.$utp[$i].'_'.$rnda]."<br/><br/>$:".$idt['2h']."<";
 
                                         unset($this->is['mab1'], $this->is['mab2'], $this->is['mab3'], $this->is['mab4']);
 
@@ -5865,10 +5225,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $data['upatack_name'] = $rune['name'];
                             $data['upatack_lvl'] = $add['upatack'];
                             $data['upatack_lvl'] = $add['upatack'];
-                            if (!isset($data['base_price1'])) {
-                                //$data['base_price1'] = $id['1price'];
-                                //$data['base_price2'] = $id['2price'];
-                            }
 
                             //Добавляем характеристики руны
                             $i = 0;
@@ -5879,31 +5235,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                                 $i++;
                             }
 
-                            if ($id_type == 22) {
-                                /*if (isset($add['add_m11']))
-								{
-									$data['add_m11'] += $add['add_m11'];
-								}*/
-                                $data['sv_yron_min'] += $add['upatack'];
-                                $data['sv_yron_max'] += $add['upatack'];
-                                //print_r($data);
-                                //die('Посохи временно не точатся.');
-                            } elseif ($id['2h'] == 1) {
-                                $data['sv_yron_min'] += $add['upatack'];
-                                $data['sv_yron_max'] += $add['upatack'];
-                            } else {
-                                $data['sv_yron_min'] += $add['upatack'];
-                                $data['sv_yron_max'] += $add['upatack'];
-                            }
-
-                            if (!isset($add['nosale']) && !isset($add['frompisher'])) {
-                                //$id['1price'] = $data['base_price1']+$rune['1price'];
-                                //$id['2price'] = $data['base_price2']+$rune['2price'];
-                            }
+                            $data['sv_yron_min'] += $add['upatack'];
+                            $data['sv_yron_max'] += $add['upatack'];
 
                             $this->addDelo(2, $this->info['id'], '&quot;<font color="#4863A0">System.remont.upatack</font>&quot;: Заточка &quot;' . $data['upatack_name'] . '&quot; была успешно <strong>встроена</strong> в предмет &quot;' . $id['name'] . '&quot; [itm:' . $id['id'] . ']', time(), $this->info['city'], 'System.remont.upatack', 0, 0);
 
-
                             $data = $this->impStats($data);
 
                             mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
@@ -5960,14 +5296,10 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         $data = $this->impStats($data);
                         mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $rune['id'] . '"  AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
                         mysql_query('UPDATE `items_users` SET `1price` = "' . $id['1price'] . '",`2price` = "' . $id['2price'] . '",`data` = "' . $data . '" WHERE `id` = "' . $id['id'] . '" AND `uid` = "' . $this->info['id'] . '" LIMIT 1');
-                        //$this->error = 'Заточка &quot;'.$id['name'].'&quot; прошла успешно! Колка:'.$data['tya1'].' Руб:'.$data['tya2'].' Дробь:'.$data['tya3'].' Реж:'.$data['tya4'].' ';
 
                     }
                 } elseif ($rune['type'] == 50) {
                     //Страничка саныча
-                    //$id['data'];
-                    //$rune['data'];
-                    //$id['item_id']
                     if ($id['item_id'] == 3196 || $id['item_id'] == 3197 || $id['item_id'] == 3198) {
 
 
@@ -6073,10 +5405,8 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             $r = false;
         } else {
             $btla = mysql_fetch_array(mysql_query('SELECT `id`,`team_win` FROM `battle` WHERE `id` = "' . mysql_real_escape_string($id) . '" LIMIT 1'));
-            if (isset($btla['id'])) {
-                if ($btla['team_win'] > -1) {
-                    $r = false;
-                }
+            if (isset($btla['id']) && $btla['team_win'] > -1) {
+                $r = false;
             }
         }
         return $r;
@@ -6117,8 +5447,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
             if ($j > 9 || $l > 2 || $v > 2) {
                 $r = false;
             }
-        } elseif ($this->stats['silver'] == 5) {
-            // сколько угодно
         }
         return $r;
     }
@@ -6267,9 +5595,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                 if ($po['toclan1'] > 0) {
                     $see1 = 0;
                 }
-                if ($this->itemsX($pl['id']) > 1) {
-                    #$see1 = 0;
-                }
                 if ($po['frompisher'] > 0) {
                     $see1 = 0;
                 }
@@ -6424,17 +5749,9 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                         } elseif ($po['tr_' . $n] > $this->stats[$n]) {
                             if ($n == 'align_bs' && $this->info['inTurnir'] > 0) {
                                 if ($po['tr_align_bs'] == '1') {
-                                    if ($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2) {
-                                        $pal = false;
-                                    } else {
-                                        $pal = true;
-                                    }
+                                    $pal = !($this->info['align_real'] <= 1 || $this->info['align_real'] >= 2);
                                 } elseif ($po['tr_align_bs'] == '3') {
-                                    if ($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4) {
-                                        $tar = false;
-                                    } else {
-                                        $tar = true;
-                                    }
+                                    $tar = !($this->info['align_real'] <= 3 || $this->info['align_real'] >= 4);
                                 }
                             }
                             if ($n == 'rep') {
@@ -6509,15 +5826,11 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             $z = '';
                         }
                         $tr .= '<br>• ' . $this->is[$n] . ': ' . $z . '' . $po['add_' . $n];
-                        if (isset($po['mf_stats']) && $po['mf_stats'] > 0) {
-                            if ($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5') {
-                                $tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=' . $n . '"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-                            }
+                        if (isset($po['mf_stats']) && $po['mf_stats'] > 0 && ($n == 's1' || $n == 's2' || $n == 's3' || $n == 's5')) {
+                            $tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=' . $n . '"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
                         }
-                        if (isset($po['mf_mod']) && $po['mf_mod'] > 0) {
-                            if ($n == 'm1' || $n == 'm2' || $n == 'm4' || $n == 'm5') {
-                                $tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=' . $n . '"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
-                            }
+                        if (isset($po['mf_mod']) && $po['mf_mod'] > 0 && ($n == 'm1' || $n == 'm2' || $n == 'm4' || $n == 'm5')) {
+                            $tr .= ' <a href="main.php?inv=1&otdel=' . $_GET['otdel'] . '&rstv=' . $pl['id'] . '&mf=' . $n . '"><img src="https://img.new-combats.com/i/up.gif" width="11" height="11"></a>';
                         }
                     }
                     $x++;
@@ -6586,63 +5899,7 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $is2 .= '<br><strong>Свойства предмета:</strong>' . $tr;
                 }
 
-                //Особенности
-                /*$tr = '';
-				$x = 1;
-				while($x<=4){
-					if(isset($po['tya'.$x]) && $po['tya'.$x]>0){
-						$tyc = 'Ничтожно редки';
-						if($po['tya'.$x]>6){
-							$tyc = 'Редки';
-						}
-						if($po['tya'.$x]>14){
-							$tyc = 'Малы';
-						}
-						if($po['tya'.$x]>34){
-							$tyc = 'Временами';
-						}
-						if($po['tya'.$x]>79){
-							$tyc = 'Регулярны';
-						}
-						if($po['tya'.$x]>89){
-							$tyc = 'Часты';
-						}
-						if($po['tya'.$x]>=100){
-							$tyc = 'Всегда';
-						}
-						$tr .= '<br>• '.$this->is['tya'.$x].': '.$tyc.' ('.$po['tya'.$x].'%)';
-					}
-					$x++;
-				}
-				$x = 1;
-				while($x<=7){
-					if(isset($po['tym'.$x]) && $po['tym'.$x]>0){
-						$tyc = 'Ничтожно редки';
-						if($po['tym'.$x]>6){
-							$tyc = 'Редки';
-						}
-						if($po['tym'.$x]>14){
-							$tyc = 'Малы';
-						}
-						if($po['tym'.$x]>34){
-							$tyc = 'Временами';
-						}
-						if($po['tym'.$x]>79){
-							$tyc = 'Регулярны';
-						}
-						if($po['tym'.$x]>89){
-							$tyc = 'Часты';
-						}
-						if($po['tym'.$x]>=100){
-							$tyc = 'Всегда';
-						}
-						$tr .= '<br>• '.$this->is['tym'.$x].': '.$tyc.' ('.$po['tym'.$x].'%)';
-					}
-					$x++;
-				}
-				if($tr!=''){
-					$is2 .= '<br><strong>Особенности:</strong>'.$tr;
-				}*/
+
                 if ($notr == 0) {
                     $d[0] = 1;
                     if ($pl['magic_inci'] != '' || $pl['magic_inc'] != '') {
@@ -6731,43 +5988,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $is2 .= $tr;
                 }
 
-                /*
-				if($pl['lvl_itm']>0) {
-					$is2 .= '<br><strong>Уровень развития</strong>: ['.$pl['blvl'].'/100]';
-				}
-
-				if($pl['so']>0) {
-					$is2 .= '<br>&bull; Очки развития предмета:';
-
-					$is2 .= '<div style="margin-left:20px;"><small>
-
-Сила: '.(0+$po['add_s1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s1']).' ОР</strong></small>
-<br>Ловкость: '.$po['add_s2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s2']).' ОР</strong></small>
-<br>Интуиция: '.$po['add_s3'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s3']).' ОР</strong></small>
-<br>Интеллект: '.$po['add_s5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(10+25*$po['add_s5']).' ОР</strong></small>
-
-<br>Мф. крит. удара: '.$po['add_m1'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=1"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m1']).' ОР</strong></small>
-<br>Мф. против крит. удара: '.$po['add_m2'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=2"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m2']).' ОР</strong></small>
-<br>Мф. увертывания: '.$po['add_m4'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=3"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m4']).' ОР</strong></small>
-<br>Мф. против увертывания: '.$po['add_m5'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=4"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(1+2*$po['add_m5']).' ОР</strong></small>
-
-<br>Броня головы: '.(0+$po['add_mib1']).'-'.(0+$po['add_mab1']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=5"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab1']).' ОР</strong></small>
-<br>Броня головы: '.(0+$po['add_mib2']).'-'.(0+$po['add_mab2']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=6"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab2']).' ОР</strong></small>
-<br>Броня головы: '.(0+$po['add_mib3']).'-'.(0+$po['add_mab3']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=7"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab3']).' ОР</strong></small>
-<br>Броня головы: '.(0+$po['add_mib4']).'-'.(0+$po['add_mab4']).' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=8"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_mab4']).' ОР</strong></small>
-
-<br>Мощность урона: '.$po['add_m10'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=9"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(4+4*$po['add_m10']).' ОР</strong></small>
-<br>Мощность магии: '.$po['add_m11a'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=11"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_m11a']).' ОР</strong></small>
-
-<br>Защита от урона: '.$po['add_za'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=10"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(5+5*$po['add_za']).' ОР</strong></small>
-<br>Защита от магии: '.$po['add_zm'].' <a href="?inv=1&itmid='.$pl['id'].'&otdel='.((int)$_GET['otdel']).'&ufs2mf=12"><img src="https://img.new-combats.com/i/plus.gif"></a> <small><strong>'.(4+4*$po['add_zm']).' ОР</strong></small>
-
-</small></div>';
-
-					$is2 .= '&bull; Осталось очков развития: '.$pl['so'].'';
-				}
-				*/
-
                 if (isset($po['free_stats']) && $po['free_stats'] > 0) {
                     $is2 .= '<br><strong>Распределение статов:</strong>';
                     $is2 .= '<div style="margin-left:20px;"><small>Сила: ' . $po['add_s1'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=1"><img src="https://img.new-combats.com/i/plus.gif"></a><br>Ловкость: ' . $po['add_s2'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=2"><img src="https://img.new-combats.com/i/plus.gif"></a><br>Интуиция: ' . $po['add_s3'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=3"><img src="https://img.new-combats.com/i/plus.gif"></a><br>Интеллект: ' . $po['add_s5'] . ' <a href="?inv=1&itmid=' . $pl['id'] . '&otdel=' . ((int)$_GET['otdel']) . '&ufs=5"><img src="https://img.new-combats.com/i/plus.gif"></a></small></div>';
@@ -6969,10 +6189,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $is2 .= '<div>' . $po['info'] . '</div>';
                 }
 
-                if ($pl['maidin'] != '') {
-                    //$is2 .= '<div>Сделано в '.$this->city_name[$pl['maidin']].'</div>';
-                }
-
                 if (isset($po['toclan'])) {
                     $po['toclan1'] = explode('#', $po['toclan']);
                     $clpo = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id` = "' . $po['toclan1'][0] . '" LIMIT 1'));
@@ -7025,7 +6241,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                             mysql_query('UPDATE `items_users` SET `time_create` = "' . $pl['time_create'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
                         }
                         $is2 .= '<div style="color:brown;">Предмет будет недоступен через ' . $this->timeOut($pl['time_create'] - time()) . '</div>';
-                        //$is2 .= '<div style="color:brown;">Предмет исчезнет через '.$this->timeOut($pl['time_create']-time()+86400*30).'</div>';
                     } else {
                         $is2 .= '<div style="color:brown;">Предмет недоступен, приобретите конкретный VIP</div>';
                         if (($pl['time_create'] - time() + 86400 * 30) < 1) {
@@ -7064,8 +6279,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
                     $is1 .= '<img src="https://img.new-combats.com/i/items/' . $pl['img'] . '" style="margin-bottom:5px;">';
                 }
 
-                //$is1 .= '<br><small>(id'.$pl['id'].')</small><br>';
-
                 $is1 .= '<br>';
 
                 if ($type == 81) {
@@ -7573,10 +6786,6 @@ FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`
         }
         //$grp = ' LIMIT 1';
         $r = mysql_num_rows(mysql_query('SELECT `iu`.`id` FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "' . $item['inShop'] . '" AND `iu`.`item_id` = "' . $item['item_id'] . '" AND `iu`.`uid` = "' . ($item['uid']) . '" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "' . ($item['inGroup']) . '" ' . $grp . ' '));
-        /*
-		$r = mysql_fetch_array(mysql_query('SELECT COUNT(`iu`.`id`) FROM `items_users` AS `iu` WHERE `iu`.`inShop` = "'.$item['inShop'].'" AND `iu`.`item_id` = "'.$item['item_id'].'" AND `iu`.`uid` = "'.($item['uid']).'" AND `iu`.`delete` = "0" AND `iu`.`inGroup` = "'.($item['inGroup']).'" '.$grp.' '));
-		$r = $r[0];
-		*/
         unset($item);
         return $r;
     }
@@ -7999,22 +7208,6 @@ LIMIT 1'));
         $lvar = '';
         $td = $this->lookStats($pl['data']);
 
-        /*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$lvar .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['add_mpAll']) && $td['add_mpAll']!=0)
-				{
-					if($td['add_mpAll']>0)
-					{
-						$td['add_mpAll'] = '+'.$td['add_mpAll'];
-					}
-					$lvar .= '<br>Уровень маны: '.$td['add_mpAll'].'';
-				}*/
         if (isset($td['sv_yron_max']) && $td['sv_yron_max'] > 0) {
             $lvar .= '<br>Урон: ' . $td['sv_yron_min'] . '-' . $td['sv_yron_max'] . '';
         }
@@ -8109,11 +7302,7 @@ LIMIT 1'));
             }
         }
         if ($pl['iznosMAX'] > 0) {
-            if ($pl['iznosMAXi'] >= 909999999) {
-                //$lvar .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
-            } else {
-                $lvar .= '<br>Долговечность: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']);
-            }
+            $lvar .= '<br>Долговечность: ' . floor($pl['iznosNOW']) . '/' . ceil($pl['iznosMAX']);
         }
 
         if ($po['battleUseZd'] > 0) {
@@ -8230,104 +7419,6 @@ LIMIT 1'));
 
                 $pl['name'] = $this->nameItemMf($pl, $td);
 
-                $lvar = '';
-                /*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']!=0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$lvar .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$lvar .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$lvar .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$lvar .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$lvar .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$lvar .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$lvar .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$lvar .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $pl['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$lvar .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$lvar .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
-				if($pl['iznosMAX']>0)
-				{
-	 	 	 	 	 if($pl['iznosMAXi'] == 999999999) {
-						$lvar .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
-					}else{
-						$lvar .= '<br>Долговечность: '.floor($pl['iznosNOW']).'/'.ceil($pl['iznosMAX']);
-					}
-				}
-
-				if( $po['battleUseZd'] > 0 ) {
-					$is2 .= '<br>Задержка использования: '.$this->timeOut($po['battleUseZd']).'';
-				}
-
-				if(isset($td['gravi'])) {
-					$td['gravitp'] = array(
-						18 => 'кинжале',
-						19 => 'топоре',
-						20 => 'молоте',
-						21 => 'клинке',
-						22 => 'посохе',
-						23 => 'луке',
-						24 => 'арбалете',
-						26 => 'рукоятке',
-						27 => 'предмете',
-						28 => 'предмете'
-					);
-					$lvar .= '<br>На '.$td['gravitp'][$pl['type']].' выгравирована надпись: '.$td['gravi'].'';
-					unset($td['gravitp']);
-				}*/
-
-                /*
-				if( $pl['inOdet'] == 3 ) {
-					if( $pl['2h'] == 1 ) {
-						if(@isset($sn['items_img'][$tp_img[14]])) {
-							$uimg2 = 'rimg/r'.$sn['items_img'][$tp_img[14]];
-							$witm[14] = '<img width="60" height="60" style="display:block;" title="Пустой слот щит" src="https://img.new-combats.com/'.$uimg2.'">';
-						}else{
-							$uimg2 = 'i/items/'.$pl['img'].'';
-							$witm[14] = '<img width="60" height="60" style="background-image:url(https://img.new-combats.com/i/items/w/w10.gif);display:block;filter:alpha(opacity=37);opacity:0.37;-moz-opacity:0.37;-khtml-opacity:0.37;" title="Пустой слот щит" src="https://img.new-combats.com/'.$uimg2.'">';
-						}
-						unset($uimg2);
-					}
-				}
-				*/
-
                 $lvar = $this->getInfoItemInfo($pl);
 
                 if (@isset($sn['items_img'][$tp_img[$pl['inOdet']]])) {
@@ -8386,140 +7477,11 @@ LIMIT 1'));
                 $wj[1]['name'] = $this->nameItemMf($wj[1], $td);
                 $wj1i .= '<strong>' . $wj[1]['name'] . '</strong>';
                 $wj1i .= $this->getInfoItemInfo($wj[1]);
-                /*
-				if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj1i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj1i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj1i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj1i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj1i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj1i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
 
-				if($wj[1]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[1]['iznosMAXi'] == 999999999) {
-						$wj1i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
-					}else{
-						$wj1i .= '<br>Долговечность: '.floor($wj[1]['iznosNOW']).'/'.ceil($wj[1]['iznosMAX']).'';
-					}
-				}*/
             }
             if (isset($wj[52]) && $wj[52] != false) {
                 $td = $this->lookStats($wj[52]['data']);
                 $wj[52]['name'] = $this->nameItemMf($wj[52], $td);
-                /*$wj1i = $wj1i;
-
-				if($wj[52]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[52]['iznosMAXi'] == 999999999) {
-						$wj1i = '<br>Долговечность: <font color=brown>неразрушимо</font ><br>'.$wj1i;
-					}else{
-						$wj1i = '<br>Долговечность: '.floor($wj[52]['iznosNOW']).'/'.ceil($wj[52]['iznosMAX']).''.$wj1i;
-					}
-				}
-
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj1i = '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).''.$wj1i;
-					}else{
-						$wj1i = '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).''.$wj1i;
-					}
-				}
-
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj1i = '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).''.$wj1i;
-					}else{
-						$wj1i = '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).''.$wj1i;
-					}
-				}
-
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj1i = '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).''.$wj1i;
-					}else{
-						$wj1i = '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).''.$wj1i;
-					}
-				}
-
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[1]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj1i = '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).''.$wj1i;
-					}else{
-						$wj1i = '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).''.$wj1i;
-					}
-				}
-
-				if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj1i = '<br>Уровень жизни: '.$td['add_hpAll'].''.$wj1i;
-				}
-
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj1i = '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].''.$wj1i;
-				}*/
 
 
                 $wj1i = '<strong>' . $wj[52]['name'] . '</strong>' . $wj1i;
@@ -8536,67 +7498,7 @@ LIMIT 1'));
                 $td = $this->lookStats($wj[6]['data']);
                 $wj[6]['name'] = $this->nameItemMf($wj[6], $td);
                 $wj4i .= '<strong>' . $wj[6]['name'] . '</strong>';
-                /*if($td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
-				}
-				if($td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if($td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if($td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if($td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if($td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[6]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
 
-				if($wj[6]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[6]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
-					}else{
-						$wj4i .= '<br>Долговечность: '.floor($wj[6]['iznosNOW']).'/'.ceil($wj[6]['iznosMAX']).'';
-					}
-				}*/
                 $wj4i .= $this->getInfoItemInfo($wj[6]);
                 if ($wj[5] != false || $wj[4] != false) {
                     $wj4i .= $br;
@@ -8607,68 +7509,7 @@ LIMIT 1'));
                 $td = $this->lookStats($wj[5]['data']);
                 $wj[5]['name'] = $this->nameItemMf($wj[5], $td);
                 $wj4i .= '<strong>' . $wj[5]['name'] . '</strong>';
-                /*if($td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[5]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
 
-				if($wj[5]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[5]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
-					}else{
-						$wj4i .= '<br>Долговечность: '.floor($wj[5]['iznosNOW']).'/'.ceil($wj[5]['iznosMAX']).'';
-					}
-				}
-				*/
                 $wj4i .= $this->getInfoItemInfo($wj[5]);
                 if ($wj[4] != false) {
                     $wj4i .= $br;
@@ -8679,90 +7520,15 @@ LIMIT 1'));
                 $td = $this->lookStats($wj[4]['data']);
                 $wj[4]['name'] = $this->nameItemMf($wj[4], $td);
                 $wj4i .= '<strong>' . $wj[4]['name'] . '</strong>';
-                /*if(isset($td['add_hpAll']) && $td['add_hpAll']!=0)
-				{
-					if($td['add_hpAll']>0)
-					{
-						$td['add_hpAll'] = '+'.$td['add_hpAll'];
-					}
-					$wj4i .= '<br>Уровень жизни: '.$td['add_hpAll'].'';
-				}
-				if(isset($td['sv_yron_max']) && $td['sv_yron_max']>0)
-				{
-					$wj4i .= '<br>Урон: '.$td['sv_yron_min'].'-'.$td['sv_yron_max'].'';
-				}
-				if(isset($td['add_mab1']) && $td['add_mab1']>0)
-				{
-					if($td['add_mib1']==$td['add_mab1'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab1']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня головы: '.$m1l.''.(0+$td['add_mab1']).'';
-					}else{
-						$wj4i .= '<br>Броня головы: '.(0+$td['add_mib1']).'-'.(0+$td['add_mab1']).'';
-					}
-				}
-				if(isset($td['add_mab2']) && $td['add_mab2']>0)
-				{
-					if($td['add_mib2']==$td['add_mab2'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab2']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня корпуса: '.$m1l.''.(0+$td['add_mab2']).'';
-					}else{
-						$wj4i .= '<br>Броня корпуса: '.(0+$td['add_mib2']).'-'.(0+$td['add_mab2']).'';
-					}
-				}
-				if(isset($td['add_mab3']) && $td['add_mab3']>0)
-				{
-					if($td['add_mib3']==$td['add_mab3'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab3']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня пояса: '.$m1l.''.(0+$td['add_mab3']).'';
-					}else{
-						$wj4i .= '<br>Броня пояса: '.(0+$td['add_mib3']).'-'.(0+$td['add_mab3']).'';
-					}
-				}
-				if(isset($td['add_mab4']) && $td['add_mab4']>0)
-				{
-					if($td['add_mib4']==$td['add_mab4'] && $wj[4]['geniration']==1)
-					{
-						$m1l = '+'; if($td['add_mab4']<0){ $m1l = ''; }
-						$wj4i .= '<br>Броня ног: '.$m1l.''.(0+$td['add_mab4']).'';
-					}else{
-						$wj4i .= '<br>Броня ног: '.(0+$td['add_mib4']).'-'.(0+$td['add_mab4']).'';
-					}
-				}
 
-				if($wj[4]['iznosMAX']>0)
-				{
-	 	 	 	 	 if($wj[4]['iznosMAXi'] == 999999999) {
-						$wj4i .= '<br>Долговечность: <font color=brown>неразрушимо</font > ';
-					}else{
-						$wj4i .= '<br>Долговечность: '.floor($wj[4]['iznosNOW']).'/'.ceil($wj[4]['iznosMAX']).'';
-					}
-				}*/
                 $wj4i .= $this->getInfoItemInfo($wj[4]);
             }
-            /*if($wj[6]!=false)
-			{
-				$wj[4]['img'] = $wj[6]['img'];
-				$wj[4]['id']  = $wj[6]['id'];
-				$wj[4]['inRazdel'] = $wj[6]['inRazdel'];
-			}elseif($wj[5]!=false)
-			{
-				$wj[4]['img'] = $wj[5]['img'];
-				$wj[4]['id']  = $wj[5]['id'];
-				$wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-			}elseif($wj[4]!=false)
-			{
 
-			}*/
             if ( /*$i1 == 1 &&*/ (($this->info['noplaw'] == 1 && !isset($_GET['hide_plaw'])) || ($this->info['noplaw'] == 0 && isset($_GET['hide_plaw'])))) {
                 if ($wj[5] != false) {
                     $wj[4]['img'] = $wj[5]['img'];
                     $wj[4]['id'] = $wj[5]['id'];
                     $wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-                } elseif ($wj[4] != false) {
-
                 }
             } else {
                 if ($wj[6] != false) {
@@ -8773,8 +7539,6 @@ LIMIT 1'));
                     $wj[4]['img'] = $wj[5]['img'];
                     $wj[4]['id'] = $wj[5]['id'];
                     $wj[4]['inRazdel'] = $wj[5]['inRazdel'];
-                } elseif ($wj[4] != false) {
-
                 }
             }
             if ($wj[1] != false || $wj[2] != false) {
@@ -8842,13 +7606,6 @@ LIMIT 1'));
             if ($u['animal'] > 0) {
                 $an = mysql_fetch_array(mysql_query('SELECT `id`,`type`,`name`,`uid`,`delete`,`inBattle`,`eda`,`exp`,`obraz`,`stats`,`level`,`sex`,`levelUp`,`pet_in_cage`,`max_exp`,`priems`,`bonus` FROM `users_animal` WHERE `id` = "' . $u['animal'] . '" AND `pet_in_cage` = 0 AND `delete` = "0" LIMIT 1'));
                 if (isset($an['id'])) {
-                    if ($i1 != 1) {
-                        //$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><a href="main.php?pet"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].'] (Посмотреть образ)"></a></div>';
-                    } else {
-                        if ($an['eda'] > 0) {
-                            //$anml = '<div style="position:absolute; width:40px; height:73px; z-index:3; top:147px; left:80px;"><img height="73" width="40" src="https://'.$c['img'].'/i/obraz/'.$an['sex'].'/'.$an['obraz'].'.gif" title="'.$an['name'].' ['.$an['level'].']"></div>';
-                        }
-                    }
                     $petimg = mysql_fetch_array(mysql_query('SELECT `id`,`img` FROM `obraz_pet` WHERE `uid` = "' . $u['id'] . '" AND `use` = 1 LIMIT 1'));
                     if (isset($petimg['id'])) {
                         $anml = '<img height="40" width="120" src="https://' . $c['img'] . '/pet/' . $petimg['img'] . '" onMouseOver="top.hi(this,\'<strong>' . $an['name'] . '</strong> <i>(' . $anan2[$an['type']] . ')</i><br>Уровень: ' . $an['level'] . '\',event,2,1,1,1,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();">';
@@ -9019,11 +7776,6 @@ LIMIT 1'));
                 }
             }
 
-            if ($sn['itmslvl'] == 0) {
-                //$ei = '<strong><u>Легкое вооружение</u></strong> (Эффект)<br>Осталось: <i>Бесконечно</i>';
-                //$eff .= '<img width="38" height="23" style="margin:1px;display:block;float:left;" src="https://img.new-combats.com/i/eff/light_armor.gif"onMouseOver="top.hi(this,\''.$ei.'\',event,0,1,1,1,\'\');" onMouseOut="top.hic(event);" onMouseDown="top.hic(event);" >';
-            }
-
             //здоровье
             if ($type_info == 1) {
                 $hptop = 0;
@@ -9175,30 +7927,13 @@ LIMIT 1'));
                 $rt[0] .= '<style> .inf2s { position:relative; filter: alpha(opacity=10); -moz-opacity: 0.10; -khtml-opacity: 0.10; opacity: 0.10; } .inf2s:hover { background-color:#e2e0e0;filter: alpha(opacity=70); -moz-opacity: 0.70; -khtml-opacity: 0.70; opacity: 0.70; } </style>';
 
                 $zag = '<img width="243" height="283" style="position:absolute;top:-1px;left:-1px;" src="https://img.new-combats.com/i/zag/' . $u['zag'] . '">';
-                /*
-				$witmn[1] = '<img style="display:block;" title="Пустой слот шлем" src="https://img.new-combats.com/i/items/w/w9.gif">';
-				$witmn[2] = '<img style="display:block;" title="Пустой слот наручи" src="https://img.new-combats.com/i/items/w/w13.gif">';
-				$witmn[3] = '<img style="display:block;" title="Пустой слот оружие" src="https://img.new-combats.com/i/items/w/w3.gif">';
-				$witmn[4] = '<img style="display:block;" title="Пустой слот броня" src="https://img.new-combats.com/i/items/w/w4.gif">';
-				$witmn[7] = '<img style="display:block;" title="Пустой слот пояс" src="https://img.new-combats.com/i/items/w/w5.gif">';
-				$witmn[8] = '<img style="display:block;" title="Пустой слот серьги" src="https://img.new-combats.com/i/items/w/w1.gif">';
-				$witmn[9] = '<img style="display:block;" title="Пустой слот ожерелье" src="https://img.new-combats.com/i/items/w/w2.gif">';
-				$witmn[10] = '<img style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[11] = '<img style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[12] = '<img style="display:block;" title="Пустой слот кольцо" src="https://img.new-combats.com/i/items/w/w6.gif">';
-				$witmn[13] = '<img style="display:block;" title="Пустой слот перчатки" src="https://img.new-combats.com/i/items/w/w11.gif">';
-				$witmn[14] = '<img style="display:block;" title="Пустой слот щит" src="https://img.new-combats.com/i/items/w/w10.gif">';
-				$witmn[16] = '<img style="display:block;" title="Пустой слот поножи" src="https://img.new-combats.com/i/items/w/w19.gif">';
-				$witmn[17] = '<img style="display:block;" title="Пустой слот обувь" src="https://img.new-combats.com/i/items/w/w12.gif">';
-*/
+
                 $j2 = 0;
                 while ($j2 <= 17) {
                     $witm[$j2] = '<div class="inf2s">' . $witm[$j2] . '</div>';
                     $j2++;
                 }
 
-                $eff = $eff;
-
             }
             //<div style="width:240px; padding:2px; border-bottom:1px solid #666666; border-right:1px solid #666666; border-left:1px solid #FFFFFF; border-top:1px solid #FFFFFF;">
             if ($type_info == 1) {
@@ -9556,16 +8291,6 @@ LIMIT 1'));
             if ($itm['group'] == 1) {
                 if ($this->itemsX($itm['id']) > 1) {
                     $this->unstack($itm['id'], 1);
-                    /*$itm = mysql_fetch_array(mysql_query('SELECT
-					`im`.`id`,`im`.`name`,`im`.`img`,`im`.`type`,`im`.`inslot`,`im`.`2h`,`im`.`2too`,`im`.`iznosMAXi`,`im`.`inRazdel`,`im`.`price1`,`im`.`price2`,`im`.`pricerep`,`im`.`magic_chance`,`im`.`info`,`im`.`massa`,`im`.`level`,`im`.`magic_inci`,`im`.`overTypei`,`im`.`group`,`im`.`group_max`,`im`.`geni`,`im`.`ts`,`im`.`srok`,`im`.`class`,`im`.`class_point`,`im`.`anti_class`,`im`.`anti_class_point`,`im`.`max_text`,`im`.`useInBattle`,`im`.`lbtl`,`im`.`lvl_itm`,`im`.`lvl_exp`,`im`.`lvl_aexp`,
-					`iu`.`id`,`iu`.`item_id`,`iu`.`1price`,`iu`.`2price`,`iu`.`uid`,`iu`.`use_text`,`iu`.`data`,`iu`.`inOdet`,`iu`.`inShop`,`iu`.`delete`,`iu`.`iznosNOW`,`iu`.`iznosMAX`,`iu`.`gift`,`iu`.`gtxt1`,`iu`.`gtxt2`,`iu`.`kolvo`,`iu`.`geniration`,`iu`.`magic_inc`,`iu`.`maidin`,`iu`.`lastUPD`,`iu`.`timeOver`,`iu`.`overType`,`iu`.`secret_id`,`iu`.`time_create`,`iu`.`time_sleep`,`iu`.`inGroup`,`iu`.`dn_delete`,`iu`.`inTransfer`,`iu`.`post_delivery`,`iu`.`lbtl_`,`iu`.`bexp`,`iu`.`so`,`iu`.`blvl`
-					FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" '.$au.' AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1'));
-					if(!isset($itm['id'])) {
-						$this->error = 'Группа предметов ошибочна...';
-						$notr++;
-					} else {
-						$itm['delete'] = 0;
-					}*/
                 }
             }
 
@@ -9999,25 +8724,6 @@ LIMIT 1'));
             $u = $this->info;
         }
 
-        /*if( $btl_cache == true ) {
-			$cache = $this->get_battle_cache( $u['id'],$u['battle'] );
-			if( $cache == false ) {
-				unset($cache);
-			}else{
-				$cache['st'] = $u + $cache['st'];
-			}
-		}*/
-
-        /*if( $u['battle'] > 0  ) {
-			$cache_items = $this->get_battle_cache( $u['id'],$u['battle'] );
-			if( $cache_items == false ) {
-				unset($cache_items);
-			}else{
-				$cache_items['st']['hpNow'] = $u['hpNow'];
-				$cache_items['st']['mpNow'] = $u['mpNow'];
-			}
-		}*/
-
         if (isset($u['id'], $u['stats']) && !isset($cache)) {
             $st = [];
             $s_vi = [];
@@ -10032,9 +8738,7 @@ LIMIT 1'));
             }
 
             if (!isset($cache_items)) {
-                //
-                //$st = new SplFixedArray(1024000);
-                //
+
                 $lvl = mysql_fetch_array(mysql_query('SELECT `bprice`,`upLevel`,`nextLevel`,`exp`,`money`,`money_bonus1`,`money_bonus2`,`ability`,`skills`,`nskills`,`sskills`,`expBtlMax`,`hpRegen`,`mpRegen`,`money2` FROM `levels` WHERE `upLevel` = "' . $u['upLevel'] . '" LIMIT 1'));
                 if (isset($lvl['upLevel'])) {
                     $st['levels'] = $lvl;
@@ -10141,21 +8845,6 @@ LIMIT 1'));
                             $st['irka'] += $pl['price1'];
                         }
                     }
-                    /* Доминирование */
-                    //$dom[count($dom)] = array($pl['inOdet'],$pl['class'],$pl['class_point'],$pl['anti_class'],$pl['anti_class_point'],$pl['level'],$u['level'],$pl['price2']);
-
-
-                    if ($pl['inOdet'] <= 18 && $pl['inOdet'] > 0) {
-                        /*if( $pl['2price'] > 0 ) {
-							$st['reting'] += $pl['2price']*12.5;
-						}elseif( $pl['price2'] > 0 ) {
-							$st['reting'] += $pl['price2']*12.5;
-						}elseif( $pl['1price'] > 0 ) {
-							$st['reting'] += $pl['1price'];
-						}elseif( $pl['price1'] > 0 ) {
-							$st['reting'] += $pl['price1'];
-						}*/
-                    }
 
 
                     $st['wp' . $pl['inOdet'] . 'id'] = $h;
@@ -10204,16 +8893,6 @@ LIMIT 1'));
                                 }
                             }
                         }
-                    } else {
-                        if ($pl['inOdet'] < 18 && $pl['inOdet'] > 0) {
-                            if ($pl['2price'] == 0 && $pl['price2'] == 0) {
-                                if ($pl['1price'] > 0) {
-                                    //$st['prckr'] += round($pl['1price']/3);
-                                } else {
-                                    //$st['prckr'] += round($pl['price1']/3);
-                                }
-                            }
-                        }
                     }
 
                     if ($pl['inOdet'] <= 18 && $pl['inOdet'] > 0) {
@@ -10221,10 +8900,6 @@ LIMIT 1'));
                         $st['reting'] += 1;
                     }
 
-                    if (isset($sti['add_oza'])) {
-
-                    }
-
                     $ko = 1;
                     while ($ko <= 4) {
                         if (isset($sti['add_oza' . $ko])) {
@@ -10499,27 +9174,6 @@ LIMIT 1'));
                         $i++;
                     }
                 }
-                /*if( $u['battle'] > 0 ) {
-					//Кэшируем
-					$cache_items = array(
-						'st' => $st,
-						'sti' => $sti,
-						's_v' => $s_v,
-						's_vi' => $s_vi
-					);
-					$cache_items = json_encode($cache_items);
-					mysql_query('INSERT INTO `battle_cache` (`uid`,`battle`,`data`,`time`) VALUES ("'.$u['id'].'","'.$u['battle'].'","'.mysql_real_escape_string($cache_items).'","'.time().'")');
-					unset($cache_items);
-				}*/
-            } else {
-                /*$st = $cache_items['st'];
-					unset($cache_items['st']);
-				$sti = $cache_items['sti'];
-					unset($cache_items['sti']);
-				$s_v = $cache_items['s_v'];
-					unset($cache_items['s_v']);
-				$s_vi = $cache_items['s_vi'];
-				unset($cache_items);*/
             }
 
             //
@@ -10558,12 +9212,7 @@ LIMIT 1'));
                             }
                         }
                     }
-                    //echo '['.date( 'd.m.Y H:i:s' , time() + round((($e['timeUse']+$e['timeAce']+$e['actionTime'])-time())/$c['effz'])*$c['effz']).']';
-                    if (true == false && $test_btl_info['noeff'] == 1 && isset($this->ekrcast[$e['id_eff']])) {
-                        //эффекты не действуют
-                    } elseif ($e['sleeptime'] != 0 && substr_count($e['v1'], 'pgb') > 0) {
-                        //Не отображаем действие пристрастия во время сна
-                    } elseif (($e['timeUse'] + $e['timeAce'] + $e['actionTime'] > time() || $e['timeUse'] == 77)) {
+                    if (($e['timeUse'] + $e['timeAce'] + $e['actionTime'] > time() || $e['timeUse'] == 77)) {
                         if ($e['v1'] == 'priem') {
                             $prsu[$e['v2']] = 0 + $prsu['x'];
                         }
@@ -10811,47 +9460,6 @@ LIMIT 1'));
                 }
             }
 
-            //Бонус покупателя
-            /*$bl = mysql_fetch_array(mysql_query('SELECT `id`,`level` FROM `users_paybonus` WHERE `id` = "'.$u['id'].'" LIMIT 1'));
-			$st['pbe'] = 0+$bl['level'];
-			if( $st['pbe'] > 1000 ) {
-				$st['pbe'] = 1000;
-			}
-			unset($bl);*/
-
-            //Клан абилки
-            /*
-			if( $st['clanpos'] > 0 ) {
-				if( $st['clanpos'] == 1 ) {
-					$st['s1'] += 5;
-					$st['s2'] += 5;
-					$st['s3'] += 5;
-					$st['s4'] += 0;
-					$st['s5'] += 5;
-					$st['s6'] += 0;
-					$st['m10'] += 10;
-					$st['m11'] += 10;
-				}elseif( $st['clanpos'] == 2 ) {
-					$st['s1'] += 3;
-					$st['s2'] += 3;
-					$st['s3'] += 3;
-					$st['s4'] += 0;
-					$st['s5'] += 3;
-					$st['s6'] += 0;
-					$st['m10'] += 5;
-					$st['m11'] += 5;
-				}elseif( $st['clanpos'] == 3 ) {
-					$st['s1'] += 1;
-					$st['s2'] += 1;
-					$st['s3'] += 1;
-					$st['s4'] += 0;
-					$st['s5'] += 1;
-					$st['s6'] += 0;
-					$st['m10'] += 3;
-					$st['m11'] += 3;
-				}
-			}*/
-
             //Характеристики от статов
 
             if (!isset($st['hpAll'])) {
@@ -10859,10 +9467,6 @@ LIMIT 1'));
             }
             $st['hpAll'] += $st['s4'] * 5;
 
-            //$st['enAll'] += 10;
-            //$st['enAll'] += floor($st['s11']*10);
-            //$st['enAll'] += round($st['s4']*0.09);
-
             if (!isset($st['mpAll'])) {
                 $st['mpAll'] = 0;
             }
@@ -10903,26 +9507,6 @@ LIMIT 1'));
             }
             $st['zm'] += $st['s4'] * 1.0;
 
-            /*if(!isset($st['pa1'])) {
-				$st['pa1'] = 0;
-			}
-			$st['pa1']	 += $st['s2']*0.1;
-
-			if(!isset($st['pa4'])) {
-				$st['pa4'] = 0;
-			}
-			$st['pa4']	 += $st['s3']*0.1;
-
-			if(!isset($st['pa3'])) {
-				$st['pa3'] = 0;
-			}
-			$st['pa3']	 += $st['s4']*0.1;
-
-			if(!isset($st['pa2'])) {
-				$st['pa2'] = 0;
-			}
-			$st['pa2']	 += $st['s1']*0.1;*/
-
             if (!isset($st['zaproc'])) { //Тут зм 'zaproc'=>'Защита от урона (%)','zmproc'=>'Защита от магии стихий (%)
                 $st['zaproc'] = 0;
             }
@@ -11038,13 +9622,6 @@ LIMIT 1'));
             //Бонусы статов
             //ТУТ
             //сила
-            /*if($st['s1']>24 && $st['s1']<50){ $st['m10']  += 5;  }
-			if($st['s1']>49 && $st['s1']<75){ $st['m10']  += 10; }
-			if($st['s1']>74 && $st['s1']<100){ $st['m10']  += 17; }
-			if($st['s1']>99 && $st['s1']<125){ $st['m10']  += 25; }
-			if($st['s1']>124 && $st['s1']<150){ $st['m10'] += 25; $st['minAtack'] += 10; $st['maxAtack'] += 10; }
-			if($st['s1']>149 && $st['s1']<175){ $st['m10'] += 30; $st['minAtack'] += 10; $st['maxAtack'] += 10; }
-			if($st['s1']>174){ $st['m10'] += 30; $st['minAtack'] += 15; $st['maxAtack'] += 15; }*/
 
             if ($st['s1'] > 24 && $st['s1'] < 50) {
                 $st['m2'] += 15;
@@ -11079,13 +9656,6 @@ LIMIT 1'));
             }
 
             //ловкость $st[1]['pa1']  += 2; $st['m7']  += 35;
-            /*if($st['s2']>24 && $st['s2']<50){ $st[1]['pa1']  += 2; }
-			if($st['s2']>49 && $st['s2']<75){ $st['m7']  += 5; $st['m4']  += 35; $st['m2']  += 15; }
-			if($st['s2']>74 && $st['s2']<100){ $st['m7']  += 15; $st['m4']  += 35; $st['m2']  += 15; }
-			if($st['s2']>99 && $st['s2']<125){ $st['m7']  += 15; $st['m4']  += 105; $st['m2']  += 40; }
-			if($st['s2']>124 && $st['s2']<150) { $st['m7']  += 15; $st['m4']  += 105; $st['m2']  += 40; $st['m15'] += 5; }
-			if($st['s2']>149 && $st['s2']<175){ $st['m7']  += 20; $st['m4']  += 115; $st['m2']  += 40; $st['m15'] += 5; }
-			if($st['s2']>174){ $st['m7']  += 20; $st['m4']  += 120; $st['m2']  += 50; $st['m15'] += 7; }*/
 
             if ($st['s2'] > 24 && $st['s2'] < 50) {
                 $st['pa1'] += 2;
@@ -11132,13 +9702,7 @@ LIMIT 1'));
             }
 
             //интуиция
-            /*if($st['s3']>24 && $st['s3']<50){ $st['m3'] += 10; }
-			if($st['s3']>49 && $st['s3']<75){ $st['m3'] += 10; $st['m1'] += 35; $st['m5'] += 15; }
-			if($st['s3']>74 && $st['s3']<100){ $st['m3'] += 25; $st['m1'] += 35; $st['m5'] += 15; }
-			if($st['s3']>99 && $st['s3']<125){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; }
-			if($st['s3']>124 && $st['s3']<150){ $st['m3'] += 25; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; }
-			if($st['s3']>149 && $st['s3']<175){ $st['m3'] += 30; $st['m1'] += 105; $st['m5'] += 45; $st['m14'] += 5; }
-			if($st['s3']>174){ $st['m3'] += 30; $st['m1'] += 120; $st['m5'] += 45; $st['m14'] += 7; }*/
+
             if ($st['s3'] > 24 && $st['s3'] < 50) {
                 $st['pa4'] += 2;
                 $st['m3'] += 2;
@@ -11191,14 +9755,7 @@ LIMIT 1'));
             }
 
             //выносливость
-            /*if($st['s4']>0){ $st['hpAll']   += 30;  }
-			if($st['s4']>24 && $st['s4']<50){ $st['hpAll']  += 50;  }
-			if($st['s4']>49 && $st['s4']<75){ $st['hpAll']  += 100; }
-			if($st['s4']>74 && $st['s4']<100){ $st['hpAll']  += 175; }
-			if($st['s4']>99 && $st['s4']<125){ $st['hpAll']  += 250; }
-			if($st['s4']>124 && $st['s4']<150){ $st['hpAll'] += 250; $st['za'] += 25; }
-			if($st['s4']>149 && $st['s4']<175){ $st['hpAll'] += 350; $st['za'] += 50; }
-			if($st['s4']>174){ $st['hpAll'] += 400; $st['za'] += 100; }*/
+
             if ($st['s4'] > 0) {
                 $st['hpAll'] += 30;
             }
@@ -11237,13 +9794,7 @@ LIMIT 1'));
                 $st['zm'] += 125;
             }
             //интелект
-            /*if($st['s5']>24 && $st['s5']<50){ $st['m11'] += 5; }
-			if($st['s5']>49 && $st['s5']<75){ $st['m11'] += 10;  }
-			if($st['s5']>74 && $st['s5']<100){ $st['m11'] += 17; }
-			if($st['s5']>99 && $st['s5']<125){ $st['m11'] += 25; }
-			if($st['s5']>124 && $st['s5']<150){ $st['m11'] += 35;  }
-			if($st['s5']>149 && $st['s5']<175){ $st['m11'] += 45; }
-			if($st['s5']>174){ $st['m11'] += 60; }*/
+
             if ($st['s5'] > 24 && $st['s5'] < 50) {
                 $st['m11'] += 10;
             }
@@ -11270,13 +9821,7 @@ LIMIT 1'));
                 $st['pzm'] += 5;
             }
             //мудрость
-            /*if($st['s6']>24 && $st['s6']<50){ $st['mpAll'] += 50; $st['speedmp'] +=100; }
-			if($st['s6']>49 && $st['s6']<75){ $st['mpAll'] += 100; $st['speedmp'] +=200; }
-			if($st['s6']>74 && $st['s6']<100){ $st['mpAll'] += 175; $st['speedmp'] += 350; }
-			if($st['s6']>99 && $st['s6']<125){ $st['mpAll'] += 250; $st['speedmp'] += 500; }
-			if($st['s6']>124 && $st['s6']<150) { $st['mpAll'] += 250; $st['speedmp'] += 500; $st['pzm'] += 3; }
-			if($st['s6']>149 && $st['s6']<175){ $st['mpAll'] += 300; $st['speedmp'] += 600; $st['pzm'] += 3; }
-			if($st['s6']>174){ $st['mpAll'] += 450; $st['speedmp'] += 700; $st['pzm'] += 5; }*/
+
             if ($st['s6'] > 24 && $st['s6'] < 50) {
                 $st['mpAll'] += 150;
                 $st['speedmp'] += 100;
@@ -11323,9 +9868,6 @@ LIMIT 1'));
                 $st['zonb']++;
             }
 
-            //$st['speedhp'] += $st['pbe'];
-            //$st['speedmp'] += $st['pbe'];
-
             /* Владения */
             $i = 1;
             while ($i <= 7) {
@@ -11440,10 +9982,7 @@ LIMIT 1'));
             }
 
             //Реген. - 250 ед.
-            /*if( $u['level'] > 7 ) {
-				$st['speedhp'] -= 240;
-				$st['speedmp'] -= 240;
-			}*/
+
 
             //конец бонусов
             if ($st['hpNow'] < 0) {
@@ -11485,62 +10024,6 @@ LIMIT 1'));
             $st['y'] = $u['y'];
             $st['s'] = $u['s'];
 
-            //Собираем рейтинг
-            /*$st['reting'] = 0;
-			//
-			$st['reting'] += $st['hpAll'];
-			$st['reting'] += $st['mpAll'];
-			//
-			$st['reting'] += $st['m1'];
-			$st['reting'] += $st['m2'];
-			$st['reting'] += $st['m4'];
-			$st['reting'] += $st['m5'];
-			//
-			$st['reting'] += $st['m6']*10;
-			$st['reting'] += $st['m7']*10;
-			$st['reting'] += $st['m8']*10;
-			$st['reting'] += $st['m9']*10;
-			//
-			$st['reting'] += $st['a1']*7;
-			$st['reting'] += $st['a2']*7;
-			$st['reting'] += $st['a3']*7;
-			$st['reting'] += $st['a4']*7;
-			$st['reting'] += $st['a5']*7;
-			$st['reting'] += $st['a6']*7;
-			$st['reting'] += $st['a7']*7;
-			//
-			$st['reting'] += $st['mg1']*7;
-			$st['reting'] += $st['mg2']*7;
-			$st['reting'] += $st['mg3']*7;
-			$st['reting'] += $st['mg4']*7;
-			$st['reting'] += $st['mg5']*7;
-			$st['reting'] += $st['mg6']*7;
-			$st['reting'] += $st['mg7']*7;
-			//
-			$st['reting'] += $st['m3']*5;
-			$i8 = 1;
-			$st['reting'] += $st['za']*5;
-			$st['reting'] += $st['zm']*5;
-			//
-			$st['reting'] += $st['s5']*5;
-			$st['reting'] += $st['s6']*5;
-			//
-			while( $i8 < 8 ) {
-				$st['reting'] += $st['pa'.$i]*5;
-				$st['reting'] += $st['pm'.$i]*5;
-				//
-				$st['reting'] += $st['za'.$i]*10;
-				$st['reting'] += $st['zm'.$i]*10;
-				$i8++;
-			}
-			//
-			$i8 = 1;
-			while( $i8 < 5 ) {
-				$st['reting'] += $st['mib'.$i];
-				$st['reting'] += $st['mab'.$i];
-				$i8++;
-			}*/
-
             $st['reting'] = 1 + ceil($st['reting']);
             $st['reting'] = 1 + $st['irka'];
 
@@ -11626,21 +10109,14 @@ LIMIT 1'));
                 $st['speed_dungeon'] += 1000;
                 $st['speedhp'] += 1000000000000000;
             }
-            /*if( date('H') >= 22 && date('H') <= 24 ) {
-				if($u['room']==9 && $u['room']==323 && $u['room']==1) {
-				$st['exp'] +=150;
-				}
-			}else*/
+
             if (date('H') >= 22 && date('H') <= 10) {
                 $st['exp'] += 25;
             }
 
             //Сохраняем рейтинг игрока
             $st['reting'] = floor($st['reting']);
-            //if(@$st['btl_cof'] != @$st['reting']) {
-            //$st['btl_cof'] = $st['reting'];
-            //mysql_query('UPDATE `stats` SET `btl_cof` = "'.$st['reting'].'" WHERE `id` = "'.$st['id'].'" LIMIT 1');
-            //}
+
             if (@$st['btl_cof'] != @$st['prckr']) {
                 $st['btl_cof'] = $st['prckr'];
                 mysql_query('UPDATE `stats` SET `btl_cof` = "' . $st['prckr'] . '" WHERE `id` = "' . $st['id'] . '" LIMIT 1');
@@ -11774,20 +10250,7 @@ LIMIT 1'));
                     }
                     if ($this->info['exp'] >= $lvl['exp'] && isset($lvln['upLevel'])) {
                         if ($lvl['nextLevel'] > $this->info['level']) {
-                            /*Выдаем бонусные предметы
-							if($lvl['nextLevel']==9){
-								$this->addItem(5021,$this->info['id'],'|sudba='.$this->info['login']);
-							}
-							if($lvl['nextLevel']==10){
-								$this->addItem(5022,$this->info['id'],'|sudba='.$this->info['login']);
-							}
-							if($lvl['nextLevel']==11){
-								$this->addItem(5023,$this->info['id'],'|sudba='.$this->info['login']);
-							}
-							if($lvl['nextLevel']==12){
-								$this->addItem(5023,$this->info['id'],'|sudba='.$this->info['login']);
-								$this->addItem(5023,$this->info['id'],'|sudba='.$this->info['login']);
-							}*/
+
                             //повышаем выносливость
                             $a4 = 1;
                             if ($lvl['nextLevel'] == 9) {
@@ -11916,22 +10379,8 @@ LIMIT 1'));
                                     $this->send('', $this->info['room'], $this->info['city'], '', $rlog['login'], 'Ваш реферал <strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $lvl['nextLevel'] . '! <small><font color=red>(Персонаж не активирован, либо у вас совпадают IP! Разрешено не более 1 такого реферала!)</font></small>', -1, 6, 0, 0, 0, 1);
                                 }
                             }
-
-
-                            /*
-							$tst = $this->lookStats($this->info['stats']);
-							$tst['s4'] += $a4;
-							$tst['s7'] += $lvl['duh'];
-							$this->info['stats'] = $this->impStats($tst);
-							*/
                         }
 
-                        /*if( $this->info['twink'] == 0 ) {
-							if( $this->info['exp'] >= 300000 ) {
-								$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'За достижение нового уровня/аппа, Вы получаете: <strong>'.$lvl['money'].' кр.</strong>',-1,6,0,0,0,1);
-							}
-						}*/
-
                         $tst = $this->lookStats($this->info['stats']);
                         $tst['s4'] += $lvl['vinos'];
                         $tst['s7'] += $lvl['duh'];
@@ -11944,10 +10393,6 @@ LIMIT 1'));
                         $this->info['sskills'] += $lvl['sskills'];
                         $this->info['nskills'] += $lvl['nskills'];
                         if ($this->info['twink'] == 0) {
-                            //if( $this->info['level'] < 8 ) {
-                            //Выдаем за аппы зубы 0-7 лвл
-                            //$this->info['money4'] = $lvl['money']+$this->info['money4'];
-                            //}else{
                             $this->info['money'] = $lvl['money'] + $this->info['money'];
                             $this->info['money2'] = $lvl['money2'] + $this->info['money2'];
                             //}
@@ -11966,24 +10411,7 @@ LIMIT 1'));
                         mysql_query('DELETE FROM `actions` WHERE `uid` = "' . $this->info['id'] . '" AND `vars` LIKE "psh%"');
                         $this->send('', $this->info['room'], $this->info['city'], '', $this->info['login'], 'Обязательно используйте свитки и эликсиры в своем инвентаре!!!!!!!!!!!!!!!.', -1, 6, 0, 0, 0, 1);
                     }
-                    /*if( $this->info['level'] > 0 && $this->info['level'] <= 5 ) {
-						$this->info['money4'] += 100;
-						mysql_query('UPDATE `users` SET `money4` = "'.$this->info['money4'].'" WHERE `id` = "'.$this->info['id'].'" LIMIT 1');
-						$this->send('',$this->info['room'],$this->info['city'],'',$this->info['login'],'За достижение нового уровня вы получаете '.$this->zuby(100,1).'',-1,6,0,0,0,1);
-					}*/
-                    //if( isset($itm['id']) || $lvl['nextLevel'] != 6 ) {
-                    //
-                    /*$txti  = 'Достиг';
-						if( $this->info['sex'] == 1 ) {
-							$txti .= 'ла';
-						}
-						$txti .= ' '.$this->info['level'].' уровня!<br>'.date('d.m.Y H:i').'';
-						//
-						mysql_query('INSERT INTO `users_ico` (
-							`uid`,`time`,`text`,`img`,`type`,`x`,`see`
-						) VALUES (
-							"'.$this->info['id'].'","'.time().'","'.$txti.'","pod_lvl'.$this->info['level'].'.gif","2","1","1"
-						)');*/
+
                     //
                     $this->send('', $this->info['room'], $this->info['city'], '', '', '<strong>' . $this->info['login'] . '</strong> достиг' . $sex1 . ' уровня ' . $this->info['level'] . '!', time(), 6, 0, 0, 0, 1, 2); // Наверно тут
                     //}
@@ -11996,7 +10424,6 @@ LIMIT 1'));
                     } else {
                         $this->info['stopexp'] = 0;
                     }
-                    $upd = mysql_query('UPDATE `users` SET `stopexp` = "' . $this->info['stopexp'] . '" , `level` = "' . $this->info['level'] . '",`money` = "' . $this->info['money'] . '",`money2` = "' . $this->info['money2'] . '",`money4` = "' . $this->info['money4'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
                     $upd = mysql_query('UPDATE `users_twink` SET `stopexp` = "' . $this->info['stopexp'] . '" WHERE `uid` = "' . $this->info['id'] . '" LIMIT 1');
                     if ($upd) {
                         mysql_query('UPDATE `stats` SET `ability` = "' . $this->info['ability'] . '",`skills` = "' . $this->info['skills'] . '",`nskills` = "' . $this->info['nskills'] . '",`sskills` = "' . $this->info['sskills'] . '",`stats` = "' . $this->info['stats'] . '",`upLevel` = "' . $this->info['upLevel'] . '" WHERE `id` = "' . $this->info['id'] . '" LIMIT 1');
@@ -12084,16 +10511,12 @@ LIMIT 1'));
             $u = $this->info;
             if (isset($this->stats['hpAll'])) {
                 $st = $this->stats;
-            } elseif ($st != 0) {
-
             } else {
                 $st = $this->getStats($uid, $i1);
             }
         }
         $btl = 0;
-        if ($u['battle'] > 0) {
-            //$btl = mysql_fetch_array(mysql_query('SELECT `id`,`time_start` FROM `battle` WHERE `id` = "'.$u['battle'].'" AND `team_win` = "-1" LIMIT 1'));
-        }
+
         if ($u['battle'] == 0 || (isset($btl['id']) && $btl['time_start'] > $this->info['timereg'])) {
             $sth = $u['minHP']; //Стандартное время восстановления в минутах HP
             $stm = $u['minMP']; //Стандартное время восстановления в минутах MP
@@ -12165,38 +10588,6 @@ LIMIT 1'));
         }
     }
 
-    public function send_mime_mail($name_from, // имя отправителя
-                                   $email_from, // email отправителя
-                                   $name_to, // имя получателя
-                                   $email_to, // email получателя
-                                   $data_charset, // кодировка переданных данных
-                                   $send_charset, // кодировка письма
-                                   $subject, // тема письма
-                                   $body // текст письма
-    )
-    {
-        $to = $this->mime_header_encode($name_to, $data_charset, $send_charset)
-            . ' <' . $email_to . '>';
-        $subject = $this->mime_header_encode($subject, $data_charset, $send_charset);
-        $from = $this->mime_header_encode($name_from, $data_charset, $send_charset)
-            . ' <' . $email_from . '>';
-        if ($data_charset != $send_charset) {
-            $body = iconv($data_charset, $send_charset, $body);
-        }
-        $headers = "From: $from\r\n";
-        $headers .= "Content-type: text/html; charset=$send_charset\r\n";
-
-        return mail($to, $subject, $body, $headers);
-    }
-
-    public function mime_header_encode($str, $data_charset, $send_charset)
-    {
-        if ($data_charset != $send_charset) {
-            $str = iconv($data_charset, $send_charset, $str);
-        }
-        return '=?' . $send_charset . '?B?' . base64_encode($str) . '?=';
-    }
-
     public function set_cl_item($id, $user, $cl)
     {
         $item_ = mysql_fetch_array(mysql_query('SELECT `iu`.*, `im`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON `iu`.`item_id` = `im`.`id` WHERE `iu`.`uid` = "' . $user['id'] . '" AND `iu`.`delete` = 0 AND `iu`.`inOdet` = 0 AND `iu`.`inShop` = 0 AND `im`.`inslot` > 0 AND `iu`.`gift` = "" AND `iu`.`data` NOT LIKE "%frompisher=%" AND `iu`.`id` = "' . $id . '" LIMIT 1'));
@@ -12325,25 +10716,9 @@ LIMIT 1'));
         }
     }
 
-    public function send_mail($to, $to_name, $from = 'support@new-combats.com', $name = '<strong>Бойцовский Клуб</strong> 2', $title, $text)
-    {
-        $this->send_mime_mail($name,
-            $from,
-            $to_name,
-            $to,
-            'CP1251',  // кодировка, в которой находятся передаваемые строки
-            'KOI8-R', // кодировка, в которой будет отправлено письмо
-            $title,
-            $text); // \r\n
-    }
-
     public function roomInfo($id, $short = false)
     {
-        if ($short == true) {
-            $select = ' `id`, `name`, `code`, `city`, `timeGO`, `level`,`roomGo` ';
-        } else {
-            $select = ' * ';
-        }
+        $select = $short ? ' `id`, `name`, `code`, `city`, `timeGO`, `level`,`roomGo` ' : ' * ';
         $roomInfo = mysql_fetch_array(mysql_query('SELECT ' . $select . ' FROM `room` WHERE `id` = "' . $id . '" LIMIT 1'));
         if ($roomInfo['roomGo']) $roomInfo['roomGo'] = explode(',', $roomInfo['roomGo']);
         if ($roomInfo['level']) $roomInfo['level'] = explode('-', $roomInfo['level']);
@@ -12364,6 +10739,4 @@ LIMIT 1'));
 
 }
 
-
 $u = user::start();
-?>
\ No newline at end of file
diff --git a/buttons.php b/buttons.php
index f7ef322d..5d6a6084 100644
--- a/buttons.php
+++ b/buttons.php
@@ -1,28 +1,24 @@
 <?php
-define('GAME',true);
+define('GAME', true);
 function er($e)
 {
-	 global $c;
-	 die('<html><head><meta name="msapplication-config" content="browserconfig.xml"><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><meta http-equiv="Content-Language" content="ru"><TITLE>��������� ������</TITLE></HEAD><BODY text="#FFFFFF"><p><font color=black>��������� ������: <pre>'.$e.'</pre><b><p><a href="https://'.$c[0].'/">�����</b></a><HR><p align="right">(c) <a href="https://'.$c[0].'/">'.$c[1].'</a></p></body></html>');
+    global $c;
+    die('<html><head><meta name="msapplication-config" content="browserconfig.xml"><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><meta http-equiv="Content-Language" content="ru"><TITLE>��������� ������</TITLE></HEAD><BODY text="#FFFFFF"><p><font color=black>��������� ������: <pre>' . $e . '</pre><b><p><a href="https://' . $c[0] . '/">�����</b></a><HR><p align="right">(c) <a href="https://' . $c[0] . '/">' . $c[1] . '</a></p></body></html>');
 }
 
 function GetRealIp()
 {
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) 
- {
-   $ip=$_SERVER['HTTP_CLIENT_IP'];
- }
- elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
- {
-  $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
- }
- else
- {
-   $ip=$_SERVER['REMOTE_ADDR'];
- }
- return $ip;
+    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
+        $ip = $_SERVER['HTTP_CLIENT_IP'];
+    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
+        $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
+    } else {
+        $ip = $_SERVER['REMOTE_ADDR'];
+    }
+    return $ip;
 }
-define('IP',GetRealIp());
+
+define('IP', GetRealIp());
 
 include_once('_incl_data/__config.php');
 include_once('_incl_data/class/__db_connect.php');
@@ -30,286 +26,250 @@ include_once('_incl_data/class/__user.php');
 include_once('_incl_data/class/__filter_class.php');
 include_once('_incl_data/class/__chat_class.php');
 
-ini_set( 'max_execution_time', '120' );
+ini_set('max_execution_time', '120');
 
-if(isset($_GET['showcode']))
-{
-	include('show_reg_img/security.php');
-	die();
+if (isset($_GET['showcode'])) {
+    include('show_reg_img/security.php');
+    die();
 }
 
-if($u->info['joinIP']==1 && $u->info['ip']!=IP)
-{
-	er('#���������� ��������������� � ������� ��������');
-}elseif(isset($_GET['exit']))
-{
-	setcookie('login','',time()-60*60*24*30,'',$c['host']);
-	setcookie('pass','',time()-60*60*24*30,'',$c['host']);
-	setcookie('login','',time()-60*60*24*30);
-	setcookie('pass','',time()-60*60*24*30);
-	mysql_query('UPDATE `users` SET `online` = "'.(time()-420).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1'); //520
-	die('<script>top.location = "https://'.$c['host'].'/";</script>');
-}elseif(!isset($u->info['id']))
-{
-	
-	/*setcookie('login','',time()-60*60*24*30,'',$c['host']);
-	setcookie('pass','',time()-60*60*24*30,'',$c['host']);
-	setcookie('login','',time()-60*60*24*30);
-	setcookie('pass','',time()-60*60*24*30);*/
-	
-	er('�������� �������� � ������������ id ���������<br>��������������� � ������� ��������.');
+if ($u->info['joinIP'] == 1 && $u->info['ip'] != IP) {
+    er('#���������� ��������������� � ������� ��������');
+} elseif (isset($_GET['exit'])) {
+    setcookie('login', '', time() - 60 * 60 * 24 * 30, '', $c['host']);
+    setcookie('pass', '', time() - 60 * 60 * 24 * 30, '', $c['host']);
+    setcookie('login', '', time() - 60 * 60 * 24 * 30);
+    setcookie('pass', '', time() - 60 * 60 * 24 * 30);
+    mysql_query('UPDATE `users` SET `online` = ' . (time() - 420) . ' WHERE `id` = ' . $u->info['id']); //520
+    die('<script>top.location = "https://' . $c['host'] . '/";</script>');
+} elseif (!isset($u->info['id'])) {
+    er('�������� �������� � ������������ id ���������<br>��������������� � ������� ��������.');
 }
 
-if($u->info['online'] < time()-60)
-{
-	$filter->setOnline($u->info['online'],$u->info['id'],0);
-	mysql_query("UPDATE `users` SET `online`='".time()."',`timeMain`='".time()."' WHERE `id`='".$u->info['id']."' LIMIT 1");	
+if ($u->info['online'] < time() - 60) {
+    $filter->setOnline($u->info['online'], $u->info['id'], 0);
+    mysql_query("UPDATE `users` SET `online`='" . time() . "',`timeMain`='" . time() . "' WHERE `id`='" . $u->info['id'] . "' LIMIT 1");
 }
 
-$u->stats = $u->getStats($u->info['id'],0);
+$u->stats = $u->getStats($u->info['id'], 0);
 
-if($u->info['activ']>0) {
-	include('activnew.php');
-	die();
+if ($u->info['activ'] > 0) {
+    include('activnew.php');
+    die();
 }
 
 ?>
 <!DOCTYPE html>
 <html lang="ru-RU">
 <head>
-<meta charset="windows-1251" />
-<title>���������� ���� Acombats</title>
-<meta name="description" content="����� ���������� ���� combats ������ 2. ����������� ������ � ���������� ���� � ��������. ������� ��� ������� � �������� � �������� ������� ������ ������� ��." />
-<meta name="keywords" content="���������� ���� ����, ���������� ���� ������, ���� ���������� ����, ������ ���������� ����, ���������� ���� ������ ����, ���������� ���� ���������� ����, ������ � ���������� ����, ���� ��, �� ����, ������ ��, ������ � ��, �� ������ ����, ����� ��, ����������� ���������� ����, ����������� ��, combats, �������, combats ru, combats com, OldBK, oldbk ru, oldbk com, �����, old bk, ��� ��, mycombats, rebk, recombats, oldcombats, obk2"/>
-<meta name="msapplication-config" content="browserconfig.xml" />
-<link href="https://img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
-<link rel="stylesheet" type="text/css" href="css/clu0b.css" />
-<link rel="stylesheet" type="text/css" href="css/windows.css" />
-<link rel="stylesheet" type="text/css" href="css/hack.css" />
-<!--[if IE]>
-<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
-<![endif]-->
-<script>
-var des = <?=(0+$u->info['design'])?>;
-var c = { 
-	noEr:0,
-	noErTmr:0,
-	url:'<?=$c['host']?>',
-	img:'img.new-combats.com',
-	uid:<?=(0+$u->info['id'])?>,
-	login:'<?=$u->info['login']?>',
-	city:'<?=$u->info['city']?>',
-	lvl:<?=$u->info['level']?>,
-	rnd:'<?=$code?>',
-	filter:0,
-	time:<?=time()?>,
-	pl:0,
-	align:<?=$u->info['align']?>,
-	clan:<?=$u->info['clan']?>,
-	admin:<?=$u->info['admin']?>,
-	sound:0,
-	money:<?=$u->info['money']?>
-}, sd4key = "<?=$u->info['nextAct']?>", lafstReg = {},enterUse = 0;
+    <meta charset="windows-1251"/>
+    <title>���������� ���� Acombats</title>
+    <meta name="description"
+          content="����� ���������� ���� combats ������ 2. ����������� ������ � ���������� ���� � ��������. ������� ��� ������� � �������� � �������� ������� ������ ������� ��."/>
+    <meta name="keywords"
+          content="���������� ���� ����, ���������� ���� ������, ���� ���������� ����, ������ ���������� ����, ���������� ���� ������ ����, ���������� ���� ���������� ����, ������ � ���������� ����, ���� ��, �� ����, ������ ��, ������ � ��, �� ������ ����, ����� ��, ����������� ���������� ����, ����������� ��, combats, �������, combats ru, combats com, OldBK, oldbk ru, oldbk com, �����, old bk, ��� ��, mycombats, rebk, recombats, oldcombats, obk2"/>
+    <meta name="msapplication-config" content="browserconfig.xml"/>
+    <link href="https://img.new-combats.com/css/main.css" rel="stylesheet" type="text/css">
+    <link rel="stylesheet" type="text/css" href="css/clu0b.css"/>
+    <link rel="stylesheet" type="text/css" href="css/windows.css"/>
+    <link rel="stylesheet" type="text/css" href="css/hack.css"/>
+    <!--[if IE]>
+    <script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+    <![endif]-->
+    <script>
+        var des = <?=(0 + $u->info['design'])?>;
+        var c = {
+            noEr: 0,
+            noErTmr: 0,
+            url: '<?=$c['host']?>',
+            img: 'img.new-combats.com',
+            uid: <?=(0 + $u->info['id'])?>,
+            login: '<?=$u->info['login']?>',
+            city: '<?=$u->info['city']?>',
+            lvl: <?=$u->info['level']?>,
+            rnd: '<?=$code?>',
+            filter: 0,
+            time: <?=time()?>,
+            pl: 0,
+            align: <?=$u->info['align']?>,
+            clan: <?=$u->info['clan']?>,
+            admin: <?=$u->info['admin']?>,
+            sound: 0,
+            money: <?=$u->info['money']?>
+        }, sd4key = "<?=$u->info['nextAct']?>", lafstReg = {}, enterUse = 0;
 
-function ctest(city) {
-	if(city != c['city']) {
-		top.location = '/bk';
-	}
-}
+        function ctest(city) {
+            if (city != c['city']) {
+                top.location = '/bk';
+            }
+        }
 
-function testKey(event)
-{
-	if(event.keyCode==10 || event.keyCode==13)
-	{
-		if(top.enterUse == 0)
-		{
-			chat.subSend();
-			top.enterUse = 1;
-			setTimeout('top.enterUse = 0',1000);
-		}
-	}
-}
-setInterval('c.time++',1000);
-</script>
-<script type="text/javascript" src="js/jquery.js"></script>
-<script>
-$.ajaxSetup({cache: false});
-$(window).error(function(){
-  return true;
-});
-var iusrno = {};
-function ignoreUser(u) {
-	if( iusrno[u] == undefined || iusrno[u] == 0 ) {
-		//top.iusrno[u] = 1;
-		$('#main').attr({'src':'main.php?friends=1&ignore=' + u + ''});
-	}else{
-		//top.iusrno[u] = 0;
-		$('#main').attr({'src':'main.php?friends=1&ignore=' + u + ''});
-	}
-}
-</script>
-<script type="text/javascript" src="js/jqueryrotate.js"></script>
-<script type="text/javascript" src="js/jquery.zclip.js"></script>
-<script type="text/javascript" src="js/jquery.cookie.js"></script>
-<script type="text/javascript" src="js/title.js"></script>
+        function testKey(event) {
+            if (event.keyCode == 10 || event.keyCode == 13) {
+                if (top.enterUse == 0) {
+                    chat.subSend();
+                    top.enterUse = 1;
+                    setTimeout('top.enterUse = 0', 1000);
+                }
+            }
+        }
 
-<script type="text/javascript" src="js/gameEngine.js?<?=time()?>"></script>
-<!-- <script type="text/javascript" src="js/chat-engine.js"></script> -->
-<script type="text/javascript" src="js/interface.js"></script>
-<script type="text/javascript" src="js/dataCenter.js"></script>
+        setInterval('c.time++', 1000);
+    </script>
+    <script type="text/javascript" src="js/jquery.js"></script>
+    <script>
+        $.ajaxSetup({cache: false});
+        $(window).error(function () {
+            return true;
+        });
+        var iusrno = {};
 
-<script type="text/javascript" src="js/onlineList.js"></script>
-<script type="text/javascript" src="js/hpregen.js"></script>
-<script type="text/javascript" src="js/jquery-fireHint.js"></script>
-<?
-//
-/*
-$fpi = mysql_fetch_array(mysql_query('SELECT * FROM `fastpanel` WHERE `uid` = "'.$u->info['id'].'" LIMIT 1'));
-if(isset($fpi['id'])) {
-	$i = 0;
-	$fpv = explode('|',$fpi['data']);
-	$fph = '';
-	while( $i <= 10 ) {
-		$id = $fpv[$i];
-		$id = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `id` = "'.mysql_real_escape_string($id).'" AND `delete` = 0 AND `inShop` = 0 LIMIT 1'));
-		if(isset($id['id'])) {
-			//���� ����
-			$idm = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.mysql_real_escape_string($id['item_id']).'" LIMIT 1'));
-			$idd = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.mysql_real_escape_string($idm['id']).'" LIMIT 1'));
-			//$po = ;
-			$fph .= 'top.addfastpanel(\''.$idm['id'].'\',\''.$idm['name'].'\',\''.$idm['type'].'\',\''.$id['1price'].'\',\''.$id['2price'].'\',\''.$u->city_name[$id['maidin']].'\',\''.$idm['img'].'\',\''.$id['item_id'].'\',\''.$idm['iznosNOW'].'\',\''.$idm['iznosMAX'].'\',\'1\',\'1\',\'1\',\'1\');';
-		}else{
-			//�����
-		}
-		$i++;
-	}
-	echo '<script>'.$fph.'</script>';
-}*/
-//
-if(  !isset($_COOKIE['d1c']) ) {
-	include('_incl_data/class/mobile.php');
-	$detect = new Mobile_Detect;
-	$deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
-	$_COOKIE['d1c'] = $deviceType;
-	setcookie('d1c',$deviceType,(time()+86400));
-}else{
-	$deviceType = $_COOKIE['d1c'];
-}
+        function ignoreUser(u) {
+            if (iusrno[u] == undefined || iusrno[u] == 0) {
+                $('#main').attr({'src': 'main.php?friends=1&ignore=' + u + ''});
+            } else {
+                $('#main').attr({'src': 'main.php?friends=1&ignore=' + u + ''});
+            }
+        }
+    </script>
+    <script type="text/javascript" src="js/jqueryrotate.js"></script>
+    <script type="text/javascript" src="js/jquery.zclip.js"></script>
+    <script type="text/javascript" src="js/jquery.cookie.js"></script>
+    <script type="text/javascript" src="js/title.js"></script>
 
-if( $deviceType == 'tablet' || $deviceType == 'phone' ) {
-	echo '<script type="text/javascript" src="js/jquery.nicescroll.js"></script>';
-?>
-<style type="text/css">
-#touchmain {
-	padding: 0px;
-	border: 0;
-	overflow: auto;
-	margin: 0px;
-}
-</style>
+    <script type="text/javascript" src="js/gameEngine.js?<?= time() ?>"></script>
+    <script type="text/javascript" src="js/interface.js"></script>
+    <script type="text/javascript" src="js/dataCenter.js"></script>
 
-<script>
-  $(document).ready(function() { 
-    $("#touchmain").niceScroll("#main",{autohidemode:false,boxzoom:false});	
-  });
-</script>
-<?
-}
-?>
-	<style type="text/css">
-		/* Additional classes examples */
-		.woman a {
-			color:#C33;
-		}
-		.woman a:hover {
-			color:#ff0000;
-		}
-		img { vertical-align:bottom; }
-		#tgf_loadingLine {
-			height:18px;
-			width:100%;
-			color:#776b4a;
-			background-color:#ddd5bf;
-			position:relative;
-		}
-		.tfpgs {
-			padding:5px;
-			background-color:#d4cbb4;
-			border-bottom:1px solid #988e73;
-			border-top:1px solid #eae3d0;
-			cursor:default;
-			text-align:center;
-		}
-		.tgf_msg0 { 
-			padding:5px;
-			background-color:#c6b893;
-			border-bottom:1px solid #988e73;
-			border-top:1px solid #eae3d0;
-			cursor:default;
-		}
-		.tgf_msg1 { 
-			padding:5px;
-			background-color:#d4cbb4;
-			border-bottom:1px solid #988e73;
-			border-top:1px solid #eae3d0;
-			cursor:default;
-		}
-		.tgf_msgt {
-			color:#988e73;
-			padding-left:2px;
-			padding-right:2px;
-			border-right:1px solid #b1a993;
-		}
-		.tf_btn1 {
-			background-color:#ddd5bf;
-			padding-left:10px;
-			padding-right:10px;
-			padding-bottom:3px;
-			padding-top:3px;
-			margin:1px;
-			color:#988e73;
-			cursor:pointer;
-		    -moz-border-radius: 4px;
-		    -webkit-border-radius: 4px;
-		    border-radius: 4px;
-		}
-		
-		.tf_btn1:hover {
-			background-color:#b7ae96;
-			color:#ddd5bf;
-			cursor:pointer;
-		}
-		
-		.tf_btn11 {
-			background-color:#988e73;
-			padding-left:10px;
-			padding-right:10px;
-			padding-bottom:3px;
-			padding-top:3px;
-			margin:1px;
-			color:#ddd5bf;
-			cursor:pointer;
-		    -moz-border-radius: 4px;
-		    -webkit-border-radius: 4px;
-		    border-radius: 4px;
-		}
-		.qel0 {
-			dispaly:none;
-			position:absolute;
-			z-index:100000;
-			border:4px solid #f5cc50;
-			border-top-left-radius: 4px;
-			border-top-right-radius: 4px;
-			border-bottom-right-radius: 4px;
-			border-bottom-left-radius: 4px;
-		}
-	</style>
-	<script>
-	function chatHello() {
-		<? if( $u->info['level'] >= 8) { ?>
-		chat.sendMsg(["new","<?=time()?>","1","","<?=$u->info['login']?>","global:<b style='background-color:#ffcccc'>&nbsp; ������������ � ����, �� �������� ������������� � �������� ������� �������!  <a href='https://new-combats.com/n' target='_blank'>������ �������</a> &nbsp;</b>","red","1","1","0"]);
-		<? }?>
-	}
+    <script type="text/javascript" src="js/onlineList.js"></script>
+    <script type="text/javascript" src="js/hpregen.js"></script>
+    <script type="text/javascript" src="js/jquery-fireHint.js"></script>
+    <?php
+
+    if (!isset($_COOKIE['d1c'])) {
+        include('_incl_data/class/mobile.php');
+        $detect = new Mobile_Detect;
+        $deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
+        $_COOKIE['d1c'] = $deviceType;
+        setcookie('d1c', $deviceType, (time() + 86400));
+    } else {
+        $deviceType = $_COOKIE['d1c'];
+    }
+
+    if ($deviceType == 'tablet' || $deviceType == 'phone') {
+        echo '<script type="text/javascript" src="js/jquery.nicescroll.js"></script>';
+        ?>
+        <style type="text/css">
+            #touchmain {
+                padding: 0;
+                border: 0;
+                overflow: auto;
+                margin: 0;
+            }
+        </style>
+
+        <script>
+            $(document).ready(function () {
+                $("#touchmain").niceScroll("#main", {autohidemode: false, boxzoom: false});
+            });
+        </script>
+        <?php
+    }
+    ?>
+    <style type="text/css">
+        /* Additional classes examples */
+        .woman a {
+            color: #C33;
+        }
+
+        .woman a:hover {
+            color: #ff0000;
+        }
+
+        img {
+            vertical-align: bottom;
+        }
+
+        #tgf_loadingLine {
+            height: 18px;
+            width: 100%;
+            color: #776b4a;
+            background-color: #ddd5bf;
+            position: relative;
+        }
+
+        .tfpgs {
+            padding: 5px;
+            background-color: #d4cbb4;
+            border-bottom: 1px solid #988e73;
+            border-top: 1px solid #eae3d0;
+            cursor: default;
+            text-align: center;
+        }
+
+        .tgf_msg0 {
+            padding: 5px;
+            background-color: #c6b893;
+            border-bottom: 1px solid #988e73;
+            border-top: 1px solid #eae3d0;
+            cursor: default;
+        }
+
+        .tgf_msg1 {
+            padding: 5px;
+            background-color: #d4cbb4;
+            border-bottom: 1px solid #988e73;
+            border-top: 1px solid #eae3d0;
+            cursor: default;
+        }
+
+        .tgf_msgt {
+            color: #988e73;
+            padding-left: 2px;
+            padding-right: 2px;
+            border-right: 1px solid #b1a993;
+        }
+
+        .tf_btn1 {
+            background-color: #ddd5bf;
+            padding: 3px 10px;
+            margin: 1px;
+            color: #988e73;
+            cursor: pointer;
+            -moz-border-radius: 4px;
+            -webkit-border-radius: 4px;
+            border-radius: 4px;
+        }
+
+        .tf_btn1:hover {
+            background-color: #b7ae96;
+            color: #ddd5bf;
+            cursor: pointer;
+        }
+
+        .tf_btn11 {
+            background-color: #988e73;
+            padding: 3px 10px;
+            margin: 1px;
+            color: #ddd5bf;
+            cursor: pointer;
+            -moz-border-radius: 4px;
+            -webkit-border-radius: 4px;
+            border-radius: 4px;
+        }
+
+        .qel0 {
+            dispaly: none;
+            position: absolute;
+            z-index: 100000;
+            border: 4px solid #f5cc50;
+            border-radius: 4px;
+        }
+    </style>
+    <script>
+        function chatHello() {
+            chat.sendMsg(["new", "<?=time()?>", "1", "", "<?=$u->info['login']?>", "global:<b style='background-color:#ffcccc'>&nbsp; ������������ � ����, �� �������� ������������� � �������� ������� �������!  <a href='https://new-combats.com/n' target='_blank'>������ �������</a> &nbsp;</b>", "red", "1", "1", "0"]);
+        }
     </script>
 </head>
 
@@ -317,619 +277,894 @@ if( $deviceType == 'tablet' || $deviceType == 'phone' ) {
 <div style="display:none" class="qel0" id="qel0"></div>
 <noscript>� ����� �������� ����������� ��������� <strong>javascript<strong></noscript>
 <style>
-/* ����� ������ */
-.CSSteam0	{ font-weight: bold; cursor:pointer; }
-.CSSteam1	{ font-weight: bold; color: #6666CC; cursor:pointer; }
-.CSSteam2	{ font-weight: bold; color: #B06A00; cursor:pointer; }
-.CSSteam3 	{ font-weight: bold; color: #269088; cursor:pointer; }
-.CSSteam4 	{ font-weight: bold; color: #A0AF20; cursor:pointer; }
-.CSSteam5 	{ font-weight: bold; color: #0F79D3; cursor:pointer; }
-.CSSteam6 	{ font-weight: bold; color: #D85E23; cursor:pointer; }
-.CSSteam7 	{ font-weight: bold; color: #5C832F; cursor:pointer; }
-.CSSteam8 	{ font-weight: bold; color: #842B61; cursor:pointer; }
-.CSSteam9 	{ font-weight: bold; color: navy; cursor:pointer; }
-.CSSvs 		{ font-weight: bold; }
-.buttons:hover { background-color:#EFEFEF; }
-.buttons:active { color:#777777; }
-.buttons { background-color:#E9E9E9; }
-.menutop2{color:#003366;} .menutop2:hover{
-	color:#446B93;
-}
-.klan { font-weight:bold; color: green; background-color: #99FFCC;}
-.redColor {
-	color: #FF0000;
-	font-weight: bold;
-}
-.borderWhite {
-	border: 1px solid #f2f0f0;
-}
-.date21	{
-	font-family: Courier;
-	font-size: 8pt;
-	text-decoration:underline;
-	font-weight:normal;
-	color: #007000;
-	background-color: #00FFAA
-}
+    /* ����� ������ */
+    .CSSteam0 {
+        font-weight: bold;
+        cursor: pointer;
+    }
+
+    .CSSteam1 {
+        font-weight: bold;
+        color: #6666CC;
+        cursor: pointer;
+    }
+
+    .CSSteam2 {
+        font-weight: bold;
+        color: #B06A00;
+        cursor: pointer;
+    }
+
+    .CSSteam3 {
+        font-weight: bold;
+        color: #269088;
+        cursor: pointer;
+    }
+
+    .CSSteam4 {
+        font-weight: bold;
+        color: #A0AF20;
+        cursor: pointer;
+    }
+
+    .CSSteam5 {
+        font-weight: bold;
+        color: #0F79D3;
+        cursor: pointer;
+    }
+
+    .CSSteam6 {
+        font-weight: bold;
+        color: #D85E23;
+        cursor: pointer;
+    }
+
+    .CSSteam7 {
+        font-weight: bold;
+        color: #5C832F;
+        cursor: pointer;
+    }
+
+    .CSSteam8 {
+        font-weight: bold;
+        color: #842B61;
+        cursor: pointer;
+    }
+
+    .CSSteam9 {
+        font-weight: bold;
+        color: navy;
+        cursor: pointer;
+    }
+
+    .CSSvs {
+        font-weight: bold;
+    }
+
+    .buttons:hover {
+        background-color: #EFEFEF;
+    }
+
+    .buttons:active {
+        color: #777777;
+    }
+
+    .buttons {
+        background-color: #E9E9E9;
+    }
+
+    .menutop2 {
+        color: #003366;
+    }
+
+    .menutop2:hover {
+        color: #446B93;
+    }
+
+    .klan {
+        font-weight: bold;
+        color: green;
+        background-color: #99FFCC;
+    }
+
+    .redColor {
+        color: #FF0000;
+        font-weight: bold;
+    }
+
+    .borderWhite {
+        border: 1px solid #f2f0f0;
+    }
+
+    .date21 {
+        font-family: Courier, serif;
+        font-size: 8pt;
+        text-decoration: underline;
+        font-weight: normal;
+        color: #007000;
+        background-color: #00FFAA
+    }
 
 
-.zoneCh_no {
-	float:left;
-	overflow:hidden;
-	height: 18px;
-	width: 18px;
-}
+    .zoneCh_no {
+        float: left;
+        overflow: hidden;
+        height: 18px;
+        width: 18px;
+    }
 
-.inpBtl {
-	color: #000000;
-	text-decoration: none;
-	background-color: #ECE9D8;
-	border: 1px solid #000000;    
-}
+    .inpBtl {
+        color: #000000;
+        text-decoration: none;
+        background-color: #ECE9D8;
+        border: 1px solid #000000;
+    }
 
-.zoneCh_yes {
-	float:left;
-	overflow:hidden;
-	height: 18px;
-	width: 18px;
-	background-color: #A9AFB1;
-}
-	
-body {
-	background-color: #e8e8e8;
-}
-.st1222 {
-	font-size: 18px;
-	color: #990000;
-	font-weight: bold;
-}
-.crop {
-	float:left;
-	overflow:hidden;
-	height: 18px;
-	width: 18px;
-}
+    .zoneCh_yes {
+        float: left;
+        overflow: hidden;
+        height: 18px;
+        width: 18px;
+        background-color: #A9AFB1;
+    }
 
-.radio_off {
-    margin-left:0px;
-}
+    body {
+        background-color: #e8e8e8;
+    }
 
-.radio_on {
-    margin-left:-18px;
-}
+    .st1222 {
+        font-size: 18px;
+        color: #990000;
+        font-weight: bold;
+    }
 
-.battle_hod_style {
-    border-bottom-width: 1px;
-    border-bottom-style: solid;
-    border-bottom-color: #AEAEAE;
-}
-.zbtn1l{	width:9px;	height:18px;	background: url(https://new-combats.com/tab.png) 0px 0px repeat-x;}
-.zbtn1r {	width:9px;	height:18px;	background: url(https://new-combats.com/tab.png) -18px 0px repeat-x;}
-.zbtn1r2 {	width:9px;	height:18px;	background: url(https://new-combats.com/tab.png) 18px 0px repeat-x;}
-.zbtn2l{	width:9px;	height:18px;	background: url(https://new-combats.com/tab.png) -36px 0px repeat-x;}
-.zbtn2r {	width:9px;	height:18px;	background: url(https://new-combats.com/tab.png) -54px 0px repeat-x;}
-.zbtn2r2 {	width:9px;	height:18px;	background: url(https://new-combats.com/tab.png) -90px 0px repeat-x;}
-.zbtn2r3 {	width:9px;	height:18px;	background: url(https://new-combats.com/tab.png) 54px 0px repeat-x;}
-.zbtn1c{	background-color: #808080;	border-top-width: 1px;	border-bottom-width: 1px;	border-top-style: solid;	border-bottom-style: solid;	border-top-color: #000000;	border-bottom-color: #000000;	color: #FFFFFF;	cursor:default;	padding-left:5px;	padding-right:5px;	FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif;}
-.zbtn2c{
-	background-color: #D5D2C9;
-	border-bottom-width: 1px;
-	border-bottom-style: solid;
-	border-bottom-color: #000000;
-	color: #000000;
-	cursor:default;
-	padding-left:5px;
-	padding-right:5px;
-	FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif;
-	font-weight: bold;
-}
+    .crop {
+        float: left;
+        overflow: hidden;
+        height: 18px;
+        width: 18px;
+    }
+
+    .radio_off {
+        margin-left: 0;
+    }
+
+    .radio_on {
+        margin-left: -18px;
+    }
+
+    .battle_hod_style {
+        border-bottom-width: 1px;
+        border-bottom-style: solid;
+        border-bottom-color: #AEAEAE;
+    }
+
+    .zbtn1l {
+        width: 9px;
+        height: 18px;
+        background: url(https://new-combats.com/tab.png) 0 0 repeat-x;
+    }
+
+    .zbtn1r {
+        width: 9px;
+        height: 18px;
+        background: url(https://new-combats.com/tab.png) -18px 0 repeat-x;
+    }
+
+    .zbtn1r2 {
+        width: 9px;
+        height: 18px;
+        background: url(https://new-combats.com/tab.png) 18px 0 repeat-x;
+    }
+
+    .zbtn2l {
+        width: 9px;
+        height: 18px;
+        background: url(https://new-combats.com/tab.png) -36px 0 repeat-x;
+    }
+
+    .zbtn2r {
+        width: 9px;
+        height: 18px;
+        background: url(https://new-combats.com/tab.png) -54px 0 repeat-x;
+    }
+
+    .zbtn2r2 {
+        width: 9px;
+        height: 18px;
+        background: url(https://new-combats.com/tab.png) -90px 0 repeat-x;
+    }
+
+    .zbtn2r3 {
+        width: 9px;
+        height: 18px;
+        background: url(https://new-combats.com/tab.png) 54px 0 repeat-x;
+    }
+
+    .zbtn1c {
+        background-color: #808080;
+        border-top-width: 1px;
+        border-bottom-width: 1px;
+        border-top-style: solid;
+        border-bottom-style: solid;
+        border-top-color: #000000;
+        border-bottom-color: #000000;
+        color: #FFFFFF;
+        cursor: default;
+        padding-left: 5px;
+        padding-right: 5px;
+        FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif;
+    }
+
+    .zbtn2c {
+        background-color: #D5D2C9;
+        border-bottom-width: 1px;
+        border-bottom-style: solid;
+        border-bottom-color: #000000;
+        color: #000000;
+        cursor: default;
+        padding-left: 5px;
+        padding-right: 5px;
+        FONT-FAMILY: Verdana, Arial, Helvetica, Tahoma, sans-serif;
+        font-weight: bold;
+    }
 </style>
-<?
-/*$yes = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "user_yes" LIMIT 1',1);
-if(!isset($yes['id']))
-{
-	//���������������� ����������
-	if(isset($_GET['yes']))
-	{
-		//��������
-		$u->addAction(time(),'user_yes','');
-		header('location: https://'.$c[$u->info['city']].'/bk');
-		die();
-	}
-	/*echo '<table width="100%" height="100%" style="position:absolute;z-index:100000;background-color:#d6d6d6;color:#333333" border="0" cellspacing="0" cellpadding="0"><tr><td align="center" valign="middle"><table width="700" border="0" cellspacing="0" cellpadding="0"><tr><td>
-<div align="left">
-<b>�������� �� �������� ��� ��� �� �����?<br>���������� ������� ���� ������ ������ ������������ ������� � ���������� ���:</b><br><br>
-&nbsp; ������ ����, ����� ��� ���� ����! �� �������� ������ � ���������� ����? ��, ����� ������, �� ������� ���� � ������� �������
-���� �������� "������ ���� ��" � �.�., � �� �����, ��������, ��� ����� �� ��� ����. ������ ����� ��������
-������� ��������� ����������, ������� ���������� �������� ��������. ������� � ���������� ����� ����
-����� ����� ��������, ���� ������������! ��� ������ �� �����! ���������� ��������, ���������, �����,
-�� � � ����-�� ������������ ������ ������ �� ������ �������� �� ���� �������. �������� ��� ��� ����������
-��� ������ � �� ������ ������ ����� �� ���������� ��� �������!<br>
-&nbsp; ���������� � ���� ������� �� ������������ �� ����� ����� ������ � ��������� � ��������� � ���� ����� �������
-�� �������� � ���������� �����������! ��� ���� ��������� ������������ �����, � �� ����� ��� ������ �������� ��������������� ��������.
-<br><br><center><a href="club.php?yes='.$code.'">� ��������� �������� � ���������� ���� �������</a></center><br><br>���� �� �����-���� �������� �� �� ��������, �� ���������� �������� ��� ���� � ����� �� ����������! �������! ;-)
-</div></td></tr></table></td></tr></table>';*/
-//}
-?>
+
 <script>
-if(window.top !== window.self)
-{
-	document.write = "";
-	window.top.location = window.self.location;
-	setTimeout(function(){ document.body.innerHTML='������ �������.'; },500);
-	window.self.onload=function(evt){
-	document.body.innerHTML='������ �������.';};
-}
-function cc(el) {
-	$(window).resize(function(){
-		$(el).css({
-				position:'absolute',
-				left: ($(document).width() - $(el).outerWidth())/2,
-				top: ($(document).height() - $(el).outerHeight())/2
-		});
-	});		
-	$(window).resize();
-}
+    if (window.top !== window.self) {
+        document.write = "";
+        window.top.location = window.self.location;
+        setTimeout(function () {
+            document.body.innerHTML = '������ �������.';
+        }, 500);
+        window.self.onload = function (evt) {
+            document.body.innerHTML = '������ �������.';
+        };
+    }
+
+    function cc(el) {
+        $(window).resize(function () {
+            $(el).css({
+                position: 'absolute',
+                left: ($(document).width() - $(el).outerWidth()) / 2,
+                top: ($(document).height() - $(el).outerHeight()) / 2
+            });
+        });
+        $(window).resize();
+    }
 </script>
-<? 
-	if($u->info['bithday'] == '01.01.1800') {
+<?php
+if ($u->info['bithday'] == '01.01.1800') {
+    ?>
+    <script>
+        function startRegistration() {
+            //if( goodread >= 9 ) {
+            $.post('reg.php', {
+                'ajax_reg': true,
+                'reg_login': $('#reg_login').val(),
+                'reg_mail': $('#reg_mail').val(),
+                'reg_dd': $('#reg_dd').val(),
+                'reg_mm': $('#reg_mm').val(),
+                'reg_yy': $('#reg_yy').val(),
+                'reg_sex': $('#reg_sex').val(),
+                'reg_pass': $('#reg_pass').val(),
+                'reg_pass2': $('#reg_pass2').val(),
+                'mail_post': $('#mail_post').attr('checked')
+            }, function (data) {
+                $('#errorreg').html(data);
+            });
+        }
+    </script>
+    <style>
+        .proza {
+            filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); /* IE 5.5+*/
+            -moz-opacity: 0.87; /* Mozilla 1.6 � ���� */
+            -khtml-opacity: 0.87; /* Konqueror 3.1, Safari 1.1 */
+            opacity: 0.87; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9+ */
+        }
+
+        .nobtn12 {
+            border: 0;
+            bottom: 80px;
+            left: 225px;
+            position: absolute;
+        }
+
+        .nobtn12:active {
+            bottom: 79px;
+        }
+
+        .inpreg1 {
+            padding: 2px;
+            font-size: 14px;
+            color: #003144;
+            background-color: #f6f4ec;
+            border: 1px solid #d1cdb8;
+            width: 178px;
+        }
+
+        .inpreg2 {
+            font-size: 12px;
+            color: #003144;
+            background-color: #f6f4ec;
+            border: 1px solid #d1cdb8;
+        }
+
+        #errorreg {
+            position: absolute;
+            width: 680px;
+            top: 0;
+            left: 0;
+            text-align: center;
+            color: red;
+            font-weight: bold;
+        }
+    </style>
+    <script>
+        cc('#regblock');
+    </script>
+    <?php
+} elseif ($u->info['active'] != '' && $u->info['mail'] == 'No E-mail') {
+    if ($error != '') {
+        echo '<script>alert("' . $error . '");</script>';
+    }
+    ?>
+    <!-- ACTIVE -->
+    <?php
+}
 ?>
 <script>
-function startRegistration() {
-	//if( goodread >= 9 ) {
-		$.post( 'reg.php' , {
-			'ajax_reg':true,
-			'reg_login':$('#reg_login').val(),
-			'reg_mail':$('#reg_mail').val(),
-			'reg_dd':$('#reg_dd').val(),
-			'reg_mm':$('#reg_mm').val(),
-			'reg_yy':$('#reg_yy').val(),
-			'reg_sex':$('#reg_sex').val(),
-			'reg_pass':$('#reg_pass').val(),
-			'reg_pass2':$('#reg_pass2').val(),
-			'mail_post':$('#mail_post').attr('checked')
-		} , function(data) { 
-			$('#errorreg').html( data );
-		});
-	/*}else{
-		alert('������������ � "������� ������ �������" ������! \n ��� ���������� ����� ������� ���! \n �� ��������� '+goodread+' �� 9 �������!');
-	}*/
-}
+    var lasts = [-1, -1];
+
+    function myexpLineTop27(e1, e2) {
+        $('#exp23mkrtkm').attr('title', "���� ���������" + "\n" + e1 + " / " + e2);
+        $('#exp23mkrtkm').html(Math.ceil(e1 / e2 * 100) + '%!');
+        if (Math.ceil(e1 / e2 * 100) < 1) {
+            $('#myexplin233').attr('width', '1%');
+        } else {
+            if (lasts[1] < e2) {
+                $('#myexplin233').css('width', '1%');
+            }
+            if (lasts[0] != e1 || lasts[1] != e2) {
+                $('#myexplin233').animate({'width': Math.ceil(e1 / e2 * 100) + '%'}, 3000);
+            }
+        }
+        lasts[0] = e1;
+        lasts[1] = e2;
+    }
+
+    var smlk1 = 0;
+
+    function smiles1load() {
+        if (smlk1 == 0) {
+            $('#btnsmlrz').html('<small>&nbsp; ����� �������� &nbsp;</small>');
+            smlk1 = 1;
+            $('#smilesDiv').hide();
+            $('#smilesDiv2').show();
+            $('#smilesDiv3').hide();
+        } else {
+            $('#btnsmlrz').html('<small>&nbsp; ������ �������� &nbsp;</small>');
+            smlk1 = 0;
+            $('#smilesDiv').show();
+            $('#smilesDiv2').hide();
+            $('#smilesDiv3').hide();
+        }
+    }
 </script>
 <style>
-.proza {
-	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=87); /* IE 5.5+*/
-	-moz-opacity: 0.87; /* Mozilla 1.6 � ���� */
-	-khtml-opacity: 0.87; /* Konqueror 3.1, Safari 1.1 */
-	opacity: 0.87; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9+ */
-}
-.nobtn12 {
-	border:0;
-	bottom:80px;
-	left:225px;
-	position:absolute;
-}
-.nobtn12:active {
-	bottom:79px;
-}
-.inpreg1 {
-	padding:2px;
-	font-size:14px;
-	color:#003144;
-	background-color:#f6f4ec;
-	border:1px solid #d1cdb8;
-	width:178px;
-}
-.inpreg2 {
-	font-size:12px;
-	color:#003144;
-	background-color:#f6f4ec;
-	border:1px solid #d1cdb8;
-}
-#errorreg {
-	position:absolute;
-	width:680px;
-	top:0;
-	left:0;
-	text-align:center;
-	color:red;
-	font-weight:bold;
-}
-</style>
-<script>
-	cc('#regblock');
-</script>
-<?
-	}elseif($u->info['active']!='' && $u->info['mail']=='No E-mail') {
-		if($error!='') {
-			echo '<script>alert("'.$error.'");</script>';
-		}	
-?>
-<!-- ACTIVE -->
-<?
-}
-?>
-<script>
-var lasts = [-1,-1];
-function myexpLineTop27(e1,e2) {
-		$('#exp23mkrtkm').attr('title',"���� ���������"+"\n"+e1+" / "+e2);
-		$('#exp23mkrtkm').html(Math.ceil(e1/e2*100)+'%!');		
-		if( Math.ceil(e1/e2*100) < 1 ) {
-			$('#myexplin233').attr('width','1%');
-		}else{
-			if( lasts[1] < e2 ) {
-				$('#myexplin233').css('width','1%');
-			}
-			if( lasts[0] != e1 || lasts[1] != e2 ) {
-				$('#myexplin233').animate({'width':Math.ceil(e1/e2*100)+'%'},3000);
-			}
-		}
-		lasts[0] = e1;
-		lasts[1] = e2;
-}
-var smlk1 = 0;
-function smiles1load() {
-	if( smlk1 == 0 ) {
-		$('#btnsmlrz').html('<small>&nbsp; ����� �������� &nbsp;</small>');
-		smlk1 = 1;
-		$('#smilesDiv').hide();
-		$('#smilesDiv2').show();
-		$('#smilesDiv3').hide();
-	}else{
-		$('#btnsmlrz').html('<small>&nbsp; ������ �������� &nbsp;</small>');
-		smlk1 = 0;
-		$('#smilesDiv').show();
-		$('#smilesDiv2').hide();
-		$('#smilesDiv3').hide();
-	}
-}
-</script>
-<style>
-#qsst {
-	position:absolute;
-	z-index:10000000;
-	cursor:default;
-	display:none;
-}
-#onbon {
-	position:absolute;
-	z-index:100;
-	cursor:default;
-	display:none;
-	bottom:30px;
-	left:18px;
-}
-#mini_qsst {
-	position:absolute;
-	z-index:100;
-	cursor:default;
-	display:none;
-	bottom:10px;
-	right:18px;
-}
+    #qsst {
+        position: absolute;
+        z-index: 10000000;
+        cursor: default;
+        display: none;
+    }
+
+    #onbon {
+        position: absolute;
+        z-index: 100;
+        cursor: default;
+        display: none;
+        bottom: 30px;
+        left: 18px;
+    }
+
+    #mini_qsst {
+        position: absolute;
+        z-index: 100;
+        cursor: default;
+        display: none;
+        bottom: 10px;
+        right: 18px;
+    }
 </style>
 <div id="qsst"></div>
-<div id="ttl" class="ttl_css" style="display:none;z-index:1111;" /></div>
-<div id="nfml" style="display:none;position:absolute;" /></div>
-<div id="persmenu" style="display:none;z-index:1110;" /></div>
+<div id="ttl" class="ttl_css" style="display:none;z-index:1111;"/>
+</div>
+<div id="nfml" style="display:none;position:absolute;"/>
+</div>
+<div id="persmenu" style="display:none;z-index:1110;"/>
+</div>
 <div id="windows" style="position:absolute;z-index:1101;"></div>
 <div id="wupbox" onmouseup="win.WstopDrag()" onmousemove="win.WmoveDrag(event)" onselectstart="return false"></div>
 <div id="chconfig">
-<center><b>��������� ����</b></center>
-<img title="��������� ����� (o_O)" src="https://<?=$c['img'];?>/1x1.gif" class="eLine"><br>
-�������� ����������: <SELECT id="chcf0"><OPTION value='-1'>�������</OPTION><OPTION value='1'>15 ���.</OPTION><OPTION selected value='2'>30 ���.</OPTION><OPTION value='3'>1 ���.</OPTION><OPTION value='4'>5 ���.</OPTION></SELECT><br>
-<div>���������� ������ ������: <SELECT id="chcf8"><OPTION value='0' selected>�� ������</OPTION><OPTION value='1'>�� ������</OPTION><OPTION value='2'>�� ���������</OPTION><OPTION value='3'>�� �����</OPTION></SELECT>
-<input name="chcf9" type="checkbox" id="chcf9" value="1"><small>�� ��������</small></div>
-<div><input name="chcf12" type="checkbox" id="chcf12" value="1"> �������� �������</div>
-<div style="display:<? if($u->info['admin']>0 || ($u->info['align']>1 && $u->info['align']<2) || ($u->info['align']>3 && $u->info['align']<4)) { echo ''; }else{ echo 'none;'; } ?>"><input name="chcf7" type="checkbox" id="chcf7" value="1"> <span title="�������� ��������� �� ���������� �� ������� �������� �������� ��������">��������� � ���������</span></div>
-<img title="��������� ����� (o_O)" src="https://<?=$c['img'];?>/1x1.gif" class="eLine">
-<div>&nbsp; &nbsp;&nbsp; <span><a href="javascript:void(0)" onclick="chat.ignorListOpen();chconf();">������ ������������</a></span></div>
+    <center><b>��������� ����</b></center>
+    <img title="��������� ����� (o_O)" src="https://<?= $c['img']; ?>/1x1.gif" class="eLine"><br>
+    �������� ����������: <SELECT id="chcf0">
+        <OPTION value='-1'>�������</OPTION>
+        <OPTION value='1'>15 ���.</OPTION>
+        <OPTION selected value='2'>30 ���.</OPTION>
+        <OPTION value='3'>1 ���.</OPTION>
+        <OPTION value='4'>5 ���.</OPTION>
+    </SELECT><br>
+    <div>���������� ������ ������: <SELECT id="chcf8">
+            <OPTION value='0' selected>�� ������</OPTION>
+            <OPTION value='1'>�� ������</OPTION>
+            <OPTION value='2'>�� ���������</OPTION>
+            <OPTION value='3'>�� �����</OPTION>
+        </SELECT>
+        <input name="chcf9" type="checkbox" id="chcf9" value="1"><small>�� ��������</small></div>
+    <div><input name="chcf12" type="checkbox" id="chcf12" value="1"> �������� �������</div>
+    <div style="display:<?php if ($u->info['admin'] > 0 || ($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4)) {
+        echo '';
+    } else {
+        echo 'none;';
+    } ?>"><input name="chcf7" type="checkbox" id="chcf7" value="1"> <span
+                title="�������� ��������� �� ���������� �� ������� �������� �������� ��������">��������� � ���������</span>
+    </div>
+    <img title="��������� ����� (o_O)" src="https://<?= $c['img']; ?>/1x1.gif" class="eLine">
+    <div>&nbsp; &nbsp;&nbsp; <span><a href="javascript:void(0)" onclick="chat.ignorListOpen();chconf();">������ ������������</a></span>
+    </div>
 </div>
-<!-- <div id="counters"></div> -->
 <!-- ������� -->
 <div id="actionDiv" style="position:absolute;"></div>
-<!--<div id="reline3" onselectstart="return false">
-	<img src="https://img.new-combats.com/1x1.gif" width="9" height="4" style="float:left; display:block; position:absolute; background-image:url(https://img.new-combats.com/i/lite/_top_24.gif);">
-	<img src="https://img.new-combats.com/1x1.gif" width="10" height="4" style="float:right; display:block; background-image:url(https://img.new-combats.com/i/lite/_top_28.gif);">
-</div>-->
+
 <div id="reline1" onselectstart="return false">
-    
-  <img src="https://img.new-combats.com/1x1.gif" width="9" height="4" style="float:left; display:block; position:absolute; background-image:url(https://img.new-combats.com/i/lite/_top_24.gif);">
-  <img src="https://img.new-combats.com/1x1.gif" width="10" height="4" style="float:right; display:block; background-image:url(https://img.new-combats.com/i/lite/_top_28.gif);">
+
+    <img src="https://img.new-combats.com/1x1.gif" width="9" height="4"
+         style="float:left; display:block; position:absolute; background-image:url(https://img.new-combats.com/i/lite/_top_24.gif);">
+    <img src="https://img.new-combats.com/1x1.gif" width="10" height="4"
+         style="float:right; display:block; background-image:url(https://img.new-combats.com/i/lite/_top_28.gif);">
 </div>
 <div id="reline2" onselectstart="return false"></div>
 <!-- ������� -->
 <div id="upbox" onselectstart="return false"></div>
-    <div style="position:absolute; top:0; left:0; height:37px; width:100%;" onselectstart="return false">
-    <div title="����� �����" style="display:none; position:absolute; left: 198px; top: 13px; width:24px; height:15px; background-image:url(https://img.new-combats.com/i/mail2.gif);" class="postdiv" id="postdiv"></div>
+<div style="position:absolute; top:0; left:0; height:37px; width:100%;" onselectstart="return false">
+    <div title="����� �����"
+         style="display:none; position:absolute; left: 198px; top: 13px; width:24px; height:15px; background-image:url(https://img.new-combats.com/i/mail2.gif);"
+         class="postdiv" id="postdiv"></div>
     <div style="background: url(https://img.new-combats.com/i/lite/capitalcity/top_lite_cap_11.gif) repeat-x bottom; ">
-     <table width="100%" border="0" cellspacing="0" cellpadding="0" style="background: url(https://img.new-combats.com/i/lite/top_lite_cap_03.gif) repeat-x top; ">
-        <tr>
-          <td align="left"><img src="https://img.new-combats.com/i/lite/capitalcity/top_lite_cap_01.gif" width="64" height="14" class="db" style="padding-left:15px;" /></td>
-          <td align="right" class="main_text" style="position: relative; width:225px"><table cellspacing="0" cellpadding="0" border="0" width="565">
-            <tr valign="bottom" align="center">
-              <td width="31" height="14"><img class="db" height="14" src="https://img.new-combats.com/i/lite/mennu112_06_lite.gif" width="31" /></td>
-              <td align="center"><table height="14" cellspacing="0" cellpadding="0" width="100%" background="https://img.new-combats.com/i/lite/mennu112_06.gif" border="0">
-                <tr align="middle">
-                  <td id="el1" class="main_text" onClick="this.style.backgroundColor='#404040'; this.style.color='#FFFFFF'; showtable('1');" align="center">������</td>
-                  <td width="1"><img class="db" height="11" src="https://img.new-combats.com/i/lite/mennu112_09.gif" width="1" /></td>
-                  <td id="el2" class="main_text" onClick="this.style.backgroundColor='#404040'; this.style.color='#FFFFFF'; showtable('2');" style="background:#404040; color:#FFFFFF;" align="center">��������</td>
-                  <td width="1"><img class="db" height="11" src="https://img.new-combats.com/i/lite/mennu112_09.gif" width="1" /></td>
-                  <td id="el3" class="main_text" onClick="if(confirm('����� �� ����?')){ top.location = '/bk?exit&rnd=<?=$code?>'; }"  align="center">�����</td>
-                </tr>
-              </table></td>
-              <td width="38"><img class="db" height="14" src="https://img.new-combats.com/i/lite/mennu112_04_lite.gif" width="37" /></td>
-            </tr>
-          </table>
-          </td>
-        </tr>
-        <tr>
-          <td align="left"><img style="display:block; float:left; margin-left:17px;" src="https://img.new-combats.com/i/lite/top_lite_cap_07.gif" width="15" height="17" /><img src="https://img.new-combats.com/i/lite/capitalcity/top_lite_cap_08.gif" width="152" height="17" class="db" /></td>
-          <td align="right">
-          <table cellspacing="0" cellpadding="0" width="565" style="background-image:url(https://img.new-combats.com/i/lite/top_lite_cap_15.gif);" border="0">
+        <table width="100%" border="0" cellspacing="0" cellpadding="0"
+               style="background: url(https://img.new-combats.com/i/lite/top_lite_cap_03.gif) repeat-x top; ">
             <tr>
-              <td align="right" class="menutop"><table width="100%" border="0" cellpadding="0" cellspacing="0">
-                  <tr>
-                    <td width="20"><img class="db" src="https://img.new-combats.com/i/lite/top_lite_13.gif" width="20" height="17" /></td>
-                    <td align="center" valign="top" background="https://img.new-combats.com/i/lite/top_lite_low_15.gif" style="font-size:10px;">
-                        <span style="display:none; text-align:center;" id="menu1"> <a href="/main.php?referals" target="main" class="menutop" style="color:green">�������</a> | <a href="https://new-combats.com/forum/" target="_blank" class="menutop">�����</a> | <a href="https://new-combats.com/encicl/law.html" target="_blank" class="menutop"><font color=red>������</font></a> | <a href="https://new-combats.com/rating_pers" target="_blank" class="menutop">�������</a> | <a href="https://new-combats.com/rating_clans" target="_blank" class="menutop">�����</a> | <a href="main.php?security" target="main" class="menutop" style="color:green">������������</a> | <a href="https://new-combats.com/news_script/lib/pisheri.html" target="_blank" class="menutop"><font color=darkgreen>�� � �������</font></a> </span>
-                        <span style="display:; text-align:center;" id="menu2"><a href="/main.php?inv=1&rn=<?=$c[9]?>" target="main" class="menutop">���������</a> |<span style="display:; text-align:center;" id="menu2"><a href="main.php?titul" target="main" class="menutop" style="color:green"> ����������</a> | <a href="/main.php?skills=1&side=5" target="main" class="menutop">������</a> | <a href="/main.php?zayvka=1" target="main" class="menutop">��������</a> | <a href="/forum/?read=10957&rnd=1" target="_blank" class="menutop" style="color:red">���� �������</a> | <a href="/n" target="_blank" class="menutop" style="color:blue">�������</a> | <a href="settings" target="_blank" class="menutop">������</a></span>
-                    </td>
-                    <td width="22"><img class="db" src="https://img.new-combats.com/i/lite/top_lite_18.gif" width="22" height="17" /></td>
-                  </tr>             
-                </table></td>
+                <td align="left"><img src="https://img.new-combats.com/i/lite/capitalcity/top_lite_cap_01.gif"
+                                      width="64" height="14" class="db" style="padding-left:15px;"/></td>
+                <td align="right" class="main_text" style="position: relative; width:225px">
+                    <table cellspacing="0" cellpadding="0" border="0" width="565">
+                        <tr valign="bottom" align="center">
+                            <td width="31" height="14"><img class="db" height="14"
+                                                            src="https://img.new-combats.com/i/lite/mennu112_06_lite.gif"
+                                                            width="31"/></td>
+                            <td align="center">
+                                <table height="14" cellspacing="0" cellpadding="0" width="100%"
+                                       background="https://img.new-combats.com/i/lite/mennu112_06.gif" border="0">
+                                    <tr align="middle">
+                                        <td id="el1" class="main_text"
+                                            onClick="this.style.backgroundColor='#404040'; this.style.color='#FFFFFF'; showtable('1');"
+                                            align="center">������
+                                        </td>
+                                        <td width="1"><img class="db" height="11"
+                                                           src="https://img.new-combats.com/i/lite/mennu112_09.gif"
+                                                           width="1"/></td>
+                                        <td id="el2" class="main_text"
+                                            onClick="this.style.backgroundColor='#404040'; this.style.color='#FFFFFF'; showtable('2');"
+                                            style="background:#404040; color:#FFFFFF;" align="center">��������
+                                        </td>
+                                        <td width="1"><img class="db" height="11"
+                                                           src="https://img.new-combats.com/i/lite/mennu112_09.gif"
+                                                           width="1"/></td>
+                                        <td id="el3" class="main_text"
+                                            onClick="if(confirm('����� �� ����?')){ top.location = '/bk?exit&rnd=<?= $code ?>'; }"
+                                            align="center">�����
+                                        </td>
+                                    </tr>
+                                </table>
+                            </td>
+                            <td width="38"><img class="db" height="14"
+                                                src="https://img.new-combats.com/i/lite/mennu112_04_lite.gif"
+                                                width="37"/></td>
+                        </tr>
+                    </table>
+                </td>
             </tr>
-          </table></td>
-        </tr>
-      </table>
+            <tr>
+                <td align="left"><img style="display:block; float:left; margin-left:17px;"
+                                      src="https://img.new-combats.com/i/lite/top_lite_cap_07.gif" width="15"
+                                      height="17"/><img
+                            src="https://img.new-combats.com/i/lite/capitalcity/top_lite_cap_08.gif" width="152"
+                            height="17" class="db"/></td>
+                <td align="right">
+                    <table cellspacing="0" cellpadding="0" width="565"
+                           style="background-image:url(https://img.new-combats.com/i/lite/top_lite_cap_15.gif);"
+                           border="0">
+                        <tr>
+                            <td align="right" class="menutop">
+                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
+                                    <tr>
+                                        <td width="20"><img class="db"
+                                                            src="https://img.new-combats.com/i/lite/top_lite_13.gif"
+                                                            width="20" height="17"/></td>
+                                        <td align="center" valign="top"
+                                            background="https://img.new-combats.com/i/lite/top_lite_low_15.gif"
+                                            style="font-size:10px;">
+                                            <span style="display:none; text-align:center;" id="menu1"> <a
+                                                        href="/main.php?referals" target="main" class="menutop"
+                                                        style="color:green">�������</a> | <a
+                                                        href="https://new-combats.com/forum/" target="_blank"
+                                                        class="menutop">�����</a> | <a
+                                                        href="https://new-combats.com/encicl/law.html" target="_blank"
+                                                        class="menutop"><font color=red>������</font></a> | <a
+                                                        href="https://new-combats.com/rating_pers" target="_blank"
+                                                        class="menutop">�������</a> | <a
+                                                        href="https://new-combats.com/rating_clans" target="_blank"
+                                                        class="menutop">�����</a> | <a href="main.php?security"
+                                                                                       target="main" class="menutop"
+                                                                                       style="color:green">������������</a> | <a
+                                                        href="https://new-combats.com/news_script/lib/pisheri.html"
+                                                        target="_blank" class="menutop"><font color=darkgreen>�� � �������</font></a> </span>
+                                            <span style="display:; text-align:center;" id="menu2"><a
+                                                        href="/main.php?inv=1&rn=<?= $c[9] ?>" target="main"
+                                                        class="menutop">���������</a> |<span
+                                                        style="display:; text-align:center;" id="menu2"><a
+                                                            href="main.php?titul" target="main" class="menutop"
+                                                            style="color:green"> ����������</a> | <a
+                                                            href="/main.php?skills=1&side=5" target="main"
+                                                            class="menutop">������</a> | <a href="/main.php?zayvka=1"
+                                                                                            target="main"
+                                                                                            class="menutop">��������</a> | <a
+                                                            href="/forum/?read=10957&rnd=1" target="_blank"
+                                                            class="menutop" style="color:red">���� �������</a> | <a
+                                                            href="/n" target="_blank" class="menutop"
+                                                            style="color:blue">�������</a> | <a href="settings"
+                                                                                                target="_blank"
+                                                                                                class="menutop">������</a></span>
+                                        </td>
+                                        <td width="22"><img class="db"
+                                                            src="https://img.new-combats.com/i/lite/top_lite_18.gif"
+                                                            width="22" height="17"/></td>
+                                    </tr>
+                                </table>
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
     </div>
     <table class="deleteStyles" width="100%" border="0" cellspacing="0" cellpadding="0">
-      <tr>
-        <td width="15" height="6"><img class="db" src="https://img.new-combats.com/i/lite/_lit_20.gif" width="15" height="6" /></td>
-        <td background="https://img.new-combats.com/i/lite/_top_20s.gif"></td>
-        <td width="24" height="6"><img class="db" src="https://img.new-combats.com/i/lite/_lit_27.gif" width="24" height="6" /></td>
-      </tr>
+        <tr>
+            <td width="15" height="6"><img class="db" src="https://img.new-combats.com/i/lite/_lit_20.gif" width="15"
+                                           height="6"/></td>
+            <td background="https://img.new-combats.com/i/lite/_top_20s.gif"></td>
+            <td width="24" height="6"><img class="db" src="https://img.new-combats.com/i/lite/_lit_27.gif" width="24"
+                                           height="6"/></td>
+        </tr>
     </table>
     <!-- -->
 </div>
 <table id="globalMain" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
-  <tr id="headerTd">
-    <td height="31" width="9" bgcolor="#D6D6D6"></td>
-    <td height="31" bgcolor="#D6D6D6">&nbsp;</td>
-    <td height="31" width="12" bgcolor="#D6D6D6"></td>
-  </tr>
-  <tr id="sectionTd">
-    <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_24.gif"></td>
-    <td valign="top" bgcolor="#e2e0e0" id="main_td">
-    <div id="touchmain" style="margin-top:3px;">
-    	<iframe id="main" name="main" src="main.php" frameborder="0" style="display:block;padding-top:0px;padding:0;margin:0;width:100%;border:0;" scrolling="auto"></iframe>
-    </div>
-    </td>
-    <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_28.gif"></td>
-  </tr>
-  <tr class="allChat">
-    <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_24.gif"></td>
-    <td id="chat" valign="top" height="40%" bgcolor="#eeeeee">
-    <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" style="border-top:1px solid #CCCCCC">
-      <tr>
-        <td valign="top" id="chat_block" style="position:relative;border-top:1px solid #808080"><!-- display:block;-->
-            <div id="mini_qsst" onClick="top.qn_slk()" style="cursor:pointer"></div>
-            <div id="onbon"></div>
-            <div id="chat_menus" unselectable="on" onselectstart="return false;" style="display:block;position:absolute; right:0px; top:3px; padding-right:20px; height:18px; text-align:right; white-space:nowrap;">
-              	<!-- -->
-                <table border="0" style="margin-top:-3px;" align="right" cellpadding="0" cellspacing="0">
-                    <tr>
-                      <td>
-                        <div id="chat_menu" style="text-align:right; white-space:nowrap;">
-                            <? /*<div id="addbs" style="float:left;display:;"><a href="javascript:top.add_cb(0,'new',0,0);"><img src="addmn.gif" width="16" height="16" title="�������� ����� �������" /></a></div>*/ ?>
+    <tr id="headerTd">
+        <td height="31" width="9" bgcolor="#D6D6D6"></td>
+        <td height="31" bgcolor="#D6D6D6">&nbsp;</td>
+        <td height="31" width="12" bgcolor="#D6D6D6"></td>
+    </tr>
+    <tr id="sectionTd">
+        <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_24.gif"></td>
+        <td valign="top" bgcolor="#e2e0e0" id="main_td">
+            <div id="touchmain" style="margin-top:3px;">
+                <iframe id="main" name="main" src="main.php" frameborder="0"
+                        style="display:block;padding:0;margin:0;width:100%;border:0;"
+                        scrolling="auto"></iframe>
+            </div>
+        </td>
+        <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_28.gif"></td>
+    </tr>
+    <tr class="allChat">
+        <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_24.gif"></td>
+        <td id="chat" valign="top" height="40%" bgcolor="#eeeeee">
+            <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"
+                   style="border-top:1px solid #CCCCCC">
+                <tr>
+                    <td valign="top" id="chat_block" style="position:relative;border-top:1px solid #808080">
+                        <!-- display:block;-->
+                        <div id="mini_qsst" onClick="top.qn_slk()" style="cursor:pointer"></div>
+                        <div id="onbon"></div>
+                        <div id="chat_menus" unselectable="on" onselectstart="return false;"
+                             style="display:block;position:absolute; right:0; top:3px; padding-right:20px; height:18px; text-align:right; white-space:nowrap;">
+                            <!-- -->
+                            <table border="0" style="margin-top:-3px;" align="right" cellpadding="0" cellspacing="0">
+                                <tr>
+                                    <td>
+                                        <div id="chat_menu" style="text-align:right; white-space:nowrap;">
+                                        </div>
+                                    </td>
+                                    <td style="display:none;" id="scroll_none" width="3"></td>
+                                </tr>
+                            </table>
+                            <!-- -->
                         </div>
-                      </td>
-                      <td style="display:none;" id="scroll_none" width="3"></td>
-                    </tr>
-                </table>
-                <!-- -->
-              </div>
 
-        <div id="ttSmiles" onselectstart="return false" style="display:none;z-index:1100;" />
-        	<div id="smilesDiv">�������� ���������</div>
-            <div id="smilesDiv2" style="display:none">
-            <?
-            echo '<center><small>����� �������� �������� ������ � <a href="/ekr.php" target="_blank">������������ ������</a><br>�������� ��������, ���� ��������� ������� �� �����������</small></center><hr>';
-			//
-			if( $u->info['add_smiles'] == '' ) { ?>
-            <center><br><br><br><br><br><br><br><font color="grey">� ��� ��� ������ ���������</font></center>
-            <? }else{
-								
-				$ex = explode(',',$u->info['add_smiles']);
-				$i = 0;
-				while( $i < count($ex) ) {
-					echo '<img src="https://img.new-combats.com/i/smile/'.$ex[$i].'.gif" title=":'.$ex[$i].':" style="cursor:pointer" onclick="chat.addSmile(\''.$ex[$i].'\');"> ';
-					$i++;
-				}
-				
-			} ?>
-            </div>
-            <div id="smilesDiv3" style="display:none">
-            
-            </div>
-            <div align="center" style="padding-left:5px; padding-right:5px;">
-            <button class="btn fl" style="display:none; padding:0; margin:0; margin-top:5px; margin-right:2px;" disabled="disabled"><small>&nbsp; ������ &nbsp;</small></button>
-            <button class="btn fl" style="padding:0; margin:0; margin-top:5px;" id="btnsmlrz" onClick="smiles1load();"><small>&nbsp; ������ �������� &nbsp;</small></button>
-            <button class="btn fr" style="padding:0; margin:0; margin-top:5px;" onClick="chat.lookSmiles()"><small>&nbsp; ������� &nbsp;</small></button>
-            </div>
-        </div>
-        
-          <div id="chat_list" style="cursor:default;">
-                <div id="canals">
-                	<div id="canal5"></div>
-                    <div id="canal6" style="display:none;"></div>
-                </div>
-          </div>        
+                        <div id="ttSmiles" onselectstart="return false" style="display:none;z-index:1100;"/>
+                        <div id="smilesDiv">�������� ���������</div>
+                        <div id="smilesDiv2" style="display:none">
+                            <?php
+                            echo '<center><small>����� �������� �������� ������ � <a href="/ekr.php" target="_blank">������������ ������</a><br>�������� ��������, ���� ��������� ������� �� �����������</small></center><hr>';
+                            //
+                            if ($u->info['add_smiles'] == '') { ?>
+                                <center><br><br><br><br><br><br><br><font color="grey">� ��� ��� ������ ���������</font>
+                                </center>
+                            <?php } else {
+
+                                $ex = explode(',', $u->info['add_smiles']);
+                                $i = 0;
+                                while ($i < count($ex)) {
+                                    echo '<img src="https://img.new-combats.com/i/smile/' . $ex[$i] . '.gif" title=":' . $ex[$i] . ':" style="cursor:pointer" onclick="chat.addSmile(\'' . $ex[$i] . '\');"> ';
+                                    $i++;
+                                }
+
+                            } ?>
+                        </div>
+                        <div id="smilesDiv3" style="display:none">
+
+                        </div>
+                        <div align="center" style="padding-left:5px; padding-right:5px;">
+                            <button class="btn fl"
+                                    style="display:none; padding:0; margin: 5px 2px 0 0;"
+                                    disabled="disabled"><small>&nbsp; ������ &nbsp;</small></button>
+                            <button class="btn fl" style="padding:0; margin: 5px 0 0;" id="btnsmlrz"
+                                    onClick="smiles1load();"><small>&nbsp; ������ �������� &nbsp;</small></button>
+                            <button class="btn fr" style="padding:0; margin: 5px 0 0;"
+                                    onClick="chat.lookSmiles()"><small>&nbsp; ������� &nbsp;</small></button>
+                        </div>
+                        </div>
+
+                        <div id="chat_list" style="cursor:default;">
+                            <div id="canals">
+                                <div id="canal5"></div>
+                                <div id="canal6" style="display:none;"></div>
+                            </div>
+                        </div>
+                    </td>
+                    <td width="350" valign="top" bgcolor="#faf2f2"
+                        style="border-left:2px solid #CCCCCC;border-top:1px solid #808080" id="online">
+                        <div id="online_list" style="cursor:default;">
+                            <div align="center" style="margin-top:5px;">
+                                <button class="btn" id="robtn" onClick="chat.reflesh()">��������</button>
+                                <button TYPE=button class="btn"
+                                        onClick="window.open('https://new-combats.com/monitoring', 'monitoring', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')"
+                                        title="������� ������\��������"><img
+                                            src="https://img.new-combats.com/i/fighttype0.gif" width="20" height="20">
+                                </button>
+                            </div>
+                            <font class="db" style="padding:0 0 8px 0;font-size: 10pt; color:#8f0000;"><b
+                                        id="roomName"></b></font>
+                            <div id="onlist"></div>
+                            <div style="padding:5px;margin-top:5px;">
+                                <div><label><input type="checkbox" value="1" checked id="autoRefOnline">���������
+                                        �������.</label></div>
+                                <div><label><input name="chcf10" type="checkbox" id="chcf10" checked value="0">��������
+                                        ���� �������</label></div>
+                            </div>
+                        </div>
+                    </td>
+                </tr>
+            </table>
         </td>
-        <td width="350" valign="top" bgcolor="#faf2f2" style="border-left:2px solid #CCCCCC;border-top:1px solid #808080" id="online">
-        <div id="online_list" style="cursor:default;">
-          <div align="center" style="margin-top:5px;">
-          	<button class="btn" id="robtn" onClick="chat.reflesh()">��������</button>
-          	<button  TYPE=button class="btn" onClick="window.open('https://new-combats.com/monitoring', 'monitoring', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')" title="������� ������\��������"><img src="https://img.new-combats.com/i/fighttype0.gif" width="20" height="20"></button>
-          </div>
-          <font class="db" style="padding:0px 0 8px 0;font-size: 10pt; color:#8f0000;"><b id="roomName"></b></font>
-          <div id="onlist"></div>
-          <div style="padding:5px;margin-top:5px;">
-              <!-- <div><label><input type="checkbox" value="1" <? if( $u->info['level'] < 8 ) { ?>checked<? } ?> id="autoRefOnline">��������� �������.</label></div>-->
-			  <div><label><input type="checkbox" value="1" checked id="autoRefOnline">��������� �������.</label></div>
-              <? if( $u->info['admin'] > 0 ) { ?>
-              <!--<div><label><input name="chcf10" type="checkbox" id="chcf10" <? if( $u->info['level'] < 8 ) { ?>checked<? } ?> value="0">�������� ���� �������</label></div>-->
-			  <div><label><input name="chcf10" type="checkbox" id="chcf10" checked value="0">�������� ���� �������</label></div>
-          	  <? } ?>
-          </div>
-        </div>
-      </td>
-      </tr>
-    </table>
-    </td>
-    <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_28.gif"></td>
-  </tr>
-  <tr class="allChat">
-    <td class="deleteStyles" height="30" valign="bottom"><img class="db" src="https://img.new-combats.com/i/lite/bkf_l_r1_02.gif" width="9" height="30"></td>
-    <td height="30" bgcolor="#E9E9E9" background="https://img.new-combats.com/i/buttons/chat_bg.gif">
-    <table width="100%" height="26" border="0" cellspacing="0" cellpadding="0">
-      <tr>
-        <td width="30"><img <? if( $u->info['admin'] > 0 ) { ?> onclick="top.frames['main'].location.href='map.php';" <? } ?> class="db" src="https://img.new-combats.com/b___.gif" width="30" height="30" title="���"></td>
-        <td style="display:none;" width="100" align="center" id="trader1"><div id="trader" style="border:1px solid #CCCCCC;padding:2px; margin-left:-2px; width:90%;" class="klan"><small id="moneyGM"><b>�������� ���</b></small></div></td>
-        <td><input type="hidden" name="trader" id="trader_val" value="0"><input onmouseup="top.chat.inObj=undefined;" type="text" name="textmsg" id="textmsg" maxlength="240" onKeyPress="top.testKey(event)" style="width:100%;font-size:11pt;margin-bottom:2px; border-radius: 5px; -webkit-border-radius: 5px;	-moz-border-radius: 5px;" /></td>
-        <td width="6">&nbsp;</td>
-        <td width="30"><img onClick="chat.subSend();" src="https://img.new-combats.com/1x1.gif" class="db cp chatBtn2_1"></td>
-        <td width="5">
-        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="1" height="1" id="Sound" align="middle">
-			<param name="allowScriptAccess" value="always" />
-			<param name="movie" value="flash/Sound2.1.swf" />
-			<param name="quality" value="high" />
-			<param name="scale" value="noscale" />
-			<param name="wmode" value="transparent" />
-			<embed src="flash/Sound2.1.swf" quality="high" scale="noscale" wmode="transparent" width="1" height="1" name="Sound" id="Sound2" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" />
-        </object>
+        <td class="deleteStyles" bgcolor="#D6D6D6" background="https://img.new-combats.com/i/lite/_top_28.gif"></td>
+    </tr>
+    <tr class="allChat">
+        <td class="deleteStyles" height="30" valign="bottom"><img class="db"
+                                                                  src="https://img.new-combats.com/i/lite/bkf_l_r1_02.gif"
+                                                                  width="9" height="30"></td>
+        <td height="30" bgcolor="#E9E9E9" background="https://img.new-combats.com/i/buttons/chat_bg.gif">
+            <table width="100%" height="26" border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                    <td width="30">
+                        <img <?php if ($u->info['admin'] > 0) { ?> onclick="top.frames['main'].location.href='map.php';" <?php } ?>
+                                class="db" src="https://img.new-combats.com/b___.gif" width="30" height="30"
+                                title="���"></td>
+                    <td style="display:none;" width="100" align="center" id="trader1">
+                        <div id="trader" style="border:1px solid #CCCCCC;padding:2px; margin-left:-2px; width:90%;"
+                             class="klan"><small id="moneyGM"><b>�������� ���</b></small></div>
+                    </td>
+                    <td><input type="hidden" name="trader" id="trader_val" value="0"><input
+                                onmouseup="top.chat.inObj=undefined;" type="text" name="textmsg" id="textmsg"
+                                maxlength="240" onKeyPress="top.testKey(event)"
+                                style="width:100%;font-size:11pt;margin-bottom:2px; border-radius: 5px; -webkit-border-radius: 5px;	-moz-border-radius: 5px;"/>
+                    </td>
+                    <td width="6">&nbsp;</td>
+                    <td width="30"><img onClick="chat.subSend();" src="https://img.new-combats.com/1x1.gif"
+                                        class="db cp chatBtn2_1"></td>
+                    <td width="5">
+                        <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+                                codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
+                                width="1" height="1" id="Sound" align="middle">
+                            <param name="allowScriptAccess" value="always"/>
+                            <param name="movie" value="flash/Sound2.1.swf"/>
+                            <param name="quality" value="high"/>
+                            <param name="scale" value="noscale"/>
+                            <param name="wmode" value="transparent"/>
+                            <embed src="flash/Sound2.1.swf" quality="high" scale="noscale" wmode="transparent" width="1"
+                                   height="1" name="Sound" id="Sound2" align="middle" allowScriptAccess="always"
+                                   type="application/x-shockwave-flash"
+                                   pluginspage="https://www.macromedia.com/go/getflashplayer"/>
+                        </object>
+                    </td>
+                    <?php if ($u->info['level'] > 9) { ?>
+                        <td width="30">
+                            <button onClick="chat.voiceMessage()" title="�������� ��������� ���������" id="record">
+                                ������
+                            </button>
+                        </td>
+
+                    <?php } ?>
+                    <td width="30"><img onClick="chat.clear();" class="db cp" title="�������� ������ �����"
+                                        src="https://img.new-combats.com/i/buttons/chatBtn3.gif"></td>
+                    <td width="30"><img onClick="chat.filterMsg();" id="chbtn1"
+                                        title="���������� � ���� ������ ��������� ������������ ���"
+                                        src="https://img.new-combats.com/1x1.gif" class="db cp chatBtn1_1"></td>
+                    <td width="30"><img onClick="chat.systemMsg();" id="chbtn4"
+                                        title="���������� � ���� ��������� ���������"
+                                        src="https://img.new-combats.com/1x1.gif"
+                                        class="db cp chatBtn4_<?php if (isset($_COOKIE['citySys']) && $_COOKIE['citySys'] == 1) {
+                                            echo 2;
+                                        } else {
+                                            echo 1;
+                                        } ?>"></td>
+                    <td width="30"><img id="chbtn6" onClick="chat.translitChat()"
+                                        title="��������������� �������� � ������� �����"
+                                        src="https://img.new-combats.com/1x1.gif" class="db cp chatBtn6_1"></td>
+                    <td width="30"><img id="chbtn7" onClick="chat.soundChat()" src="https://img.new-combats.com/1x1.gif"
+                                        title="�����" class="db cp chatBtn7_1"></td>
+                    <td width="10">&nbsp;</td>
+                    <td width="30"><img id="chbtn8" class="db cp chatBtn8_1" onClick="chat.lookSmiles()"
+                                        title="��������" src="https://img.new-combats.com/1x1.gif"></td>
+                    <td width="16" bgcolor="#BAB7B3"><img src="https://img.new-combats.com/i/buttons/chat_explode.gif"
+                                                          width="16" height="30" class="db"/></td>
+                    <td width="30"><img onclick="top.getUrl('main','main.php?inv=1&rnd='+c.rnd);" class="db cp"
+                                        title="���������" src="https://img.new-combats.com/i/buttons/chatBtn13.gif">
+                    </td>
+                    <?php if ($u->info['level'] > 7) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?transfer=1&rnd='+c.rnd);" class="db cp"
+                                            title="��������" src="https://img.new-combats.com/i/buttons/chatBtn16.gif">
+                        </td>
+                    <?php } ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?add_eff=1&rnd='+c.rnd);" class="db cp"
+                                            title="������" src="https://img.new-combats.com/i/buttons/chatBtn151.gif">
+                        </td>
+                    <?php
+                    if ($u->info['align'] == 50 || $u->info['align2'] == 50 || $u->info['admin'] == 1) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?alhp=1&rnd='+c.rnd);" class="db cp"
+                                            src="https://img.new-combats.com/i/buttons/chatBtn20.gif"></td>
+                    <?php }
+                    if ($u->info['align'] >= 1.1 && $u->info['align'] < 2) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?light=1&rnd='+c.rnd);" class="db cp"
+                                            title="������ ��������"
+                                            src="https://img.new-combats.com/i/buttons/chatBtn15.gif"></td>
+                    <?php }
+                    if ($u->info['align'] >= 3.01 && $u->info['align'] < 4) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?dark=1&rnd='+c.rnd);" class="db cp"
+                                            title="������ �������"
+                                            src="https://img.new-combats.com/i/buttons/chatBtn10.gif"></td>
+                    <?php }
+                    if ($u->info['vip'] > time() || $u->stats['silvers'] > 0 || $u->stats['bronze'] > 0 || $u->stats['gold'] > 0) { ?>
+                        <!-- VIP -->
+                        <td width="30"><img onClick="top.getUrl('main','main.php?vip=1&rnd='+c.rnd);" class="db cp"
+                                            src="https://img.new-combats.com/i/buttons/a___ang17.gif"
+                                            onMouseOver="top.hi(this,'<b>������ ��������� ������ <?= $u->info['login'] ?></b>',event,3,0,1,0,'');"
+                                            onMouseOut="top.hic();" onMouseDown="top.hic();"></td></td>
+
+                    <?php } ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?friends=1&rnd='+c.rnd);" class="db cp"
+                                            title="������" src="https://img.new-combats.com/i/buttons/chatBtn12.gif">
+                        </td>
+                    <?php if ($u->info['align'] >= 1 && $u->info['align'] < 2) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?1_panel=1&rnd='+c.rnd);" class="db cp"
+                                            title="������ �����"
+                                            src="https://img.new-combats.com/i/buttons/chatBtn15.gif"></td>
+                    <?php }
+                    if ($u->info['align'] >= 3 && $u->info['align'] < 4) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?3_panel=1&rnd='+c.rnd);" class="db cp"
+                                            title="������ ����"
+                                            src="https://img.new-combats.com/i/buttons/chatBtn10.gif"></td>
+                    <?php }
+                    if ($u->info['align'] == 7) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?7_panel=1&rnd='+c.rnd);" class="db cp"
+                                            title="������ ������������"
+                                            src="https://img.new-combats.com/i/buttons/a___neutral.gif"></td>
+                    <?php }
+                    if ($u->info['bukmeker'] == 1 || $u->info['admin'] == 1) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?bukmeker=1&rnd='+c.rnd);" class="db cp"
+                                            title="������ ��������� "
+                                            src="https://img.new-combats.com/i/buttons/bukmek.gif"></td>
+                    <?php }
+
+                    if ($u->info['clan'] > 0) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?clan=1&rnd='+c.rnd);" class="db cp"
+                                            title="����" src="https://img.new-combats.com/i/buttons/chatBtn14.gif"></td>
+                    <?php }
+                    if ($u->info['admin'] > 0) { ?>
+                        <td width="30"><img onClick="top.getUrl('main','main.php?admin=1&rnd='+c.rnd);" class="db cp"
+                                            src="https://img.new-combats.com/i/buttons/chatBtn19.gif"></td>
+                    <?php } ?>
+                    <td width="30"><img onclick="window.open('ekr.php')" class="db cp" title="������� ������������"
+                                        src="https://img.new-combats.com/i/buttons/a___nak.gif"></td>
+
+
+                    <!-- ����� -->
+                    <td width="71" id="tdDate">
+                        <button id="contentDate"></button>
+                    </td>
+                    <!-- ����� -->
+
+                </tr>
+            </table>
         </td>
-		<?if($u->info['level']>9){ ?>
-			
-
-        <td width="30"><button onClick="chat.voiceMessage()" title="�������� ��������� ���������" id="record">������</button></td>
-		
-
-        <? } ?>
-		<td width="30"><img onClick="chat.clear();" class="db cp" title="�������� ������ �����" src="https://img.new-combats.com/i/buttons/chatBtn3.gif"></td>
-        <td width="30"><img onClick="chat.filterMsg();" id="chbtn1" title="���������� � ���� ������ ��������� ������������ ���" src="https://img.new-combats.com/1x1.gif" class="db cp chatBtn1_1"></td>
-        <td width="30"><img onClick="chat.systemMsg();" id="chbtn4" title="���������� � ���� ��������� ���������" src="https://img.new-combats.com/1x1.gif" class="db cp chatBtn4_<? if(isset($_COOKIE['citySys']) && $_COOKIE['citySys']==1){ echo 2; }else{ echo 1; } ?>"></td>
-        <td width="30"><img id="chbtn6" onClick="chat.translitChat()" title="��������������� �������� � ������� �����" src="https://img.new-combats.com/1x1.gif" class="db cp chatBtn6_1"></td>
-        <td width="30"><img id="chbtn7" onClick="chat.soundChat()" src="https://img.new-combats.com/1x1.gif" title="�����" class="db cp chatBtn7_1"></td>
-        <td width="10">&nbsp;</td>
-        <td width="30"><img id="chbtn8" class="db cp chatBtn8_1" onClick="chat.lookSmiles()" title="��������" src="https://img.new-combats.com/1x1.gif"></td>
-        <!--<td width="30"><img id="chbtn8" class="cp" title="������ �������� �������" onClick="fastpanel()" src="https://img.new-combats.com/b___cl1.gif"></td>-->
-        <td width="16" bgcolor="#BAB7B3"><img src="https://img.new-combats.com/i/buttons/chat_explode.gif" width="16" height="30" class="db" /></td>
-        <td width="30"><img onclick="top.getUrl('main','main.php?inv=1&rnd='+c.rnd);" class="db cp" title="���������" src="https://img.new-combats.com/i/buttons/chatBtn13.gif"></td>
-		<?   if($u->info['level']>7){ ?>
-        <td width="30"><img onClick="top.getUrl('main','main.php?transfer=1&rnd='+c.rnd);" class="db cp" title="��������" src="https://img.new-combats.com/i/buttons/chatBtn16.gif"></td>
-        <? } if($u->info['level']>=0){ ?>
-		<!--�������� online
-        <td width="30"><img onClick="top.getUrl('main','main.php?alh=1&rnd='+c.rnd);" class="db cp" src="https://img.new-combats.com/i/buttons/chatBtn9.gif"></td>-->
-		<td width="30"><img onClick="top.getUrl('main','main.php?add_eff=1&rnd='+c.rnd);" class="db cp" title="������" src="https://img.new-combats.com/i/buttons/chatBtn151.gif"></td>
-        <? } if($u->info['align']==50 || $u->info['align2']==50 || $u->info['admin'] == 1) {?>
-		<td width="30"><img onClick="top.getUrl('main','main.php?alhp=1&rnd='+c.rnd);" class="db cp" src="https://img.new-combats.com/i/buttons/chatBtn20.gif"></td>
-		<?}  if($u->info['align']>=1.1 && $u->info['align']<2 ){ ?>
-        <td width="30"><img onClick="top.getUrl('main','main.php?light=1&rnd='+c.rnd);" class="db cp" title="������ ��������" src="https://img.new-combats.com/i/buttons/chatBtn15.gif"></td>
-        <? } if($u->info['align']>=3.01 && $u->info['align']<4){ ?>
-        <td width="30"><img onClick="top.getUrl('main','main.php?dark=1&rnd='+c.rnd);" class="db cp" title="������ �������" src="https://img.new-combats.com/i/buttons/chatBtn10.gif"></td>
-        <? } if($u->info['vip']>time() || $u->stats['silvers']>0 || $u->stats['bronze']>0 || $u->stats['gold']>0 ){ ?>
-		<!-- VIP -->
-       <td width="30"><img onClick="top.getUrl('main','main.php?vip=1&rnd='+c.rnd);" class="db cp"  src="https://img.new-combats.com/i/buttons/a___ang17.gif" onMouseOver="top.hi(this,'<b>������ ��������� ������ <?=$u->info['login']?></b>',event,3,0,1,0,'');" onMouseOut="top.hic();" onMouseDown="top.hic();"> </td></td>
-
-        <? } if($u->info['level']>= 0){ ?>
-        <td width="30"><img onClick="top.getUrl('main','main.php?friends=1&rnd='+c.rnd);" class="db cp" title="������" src="https://img.new-combats.com/i/buttons/chatBtn12.gif"></td>
-		<?}  if($u->info['align']>=1 && $u->info['align']<2){ ?>
-		<td width="30"><img onClick="top.getUrl('main','main.php?1_panel=1&rnd='+c.rnd);" class="db cp" title="������ �����" src="https://img.new-combats.com/i/buttons/chatBtn15.gif"></td>
-		<?}  if($u->info['align']>=3 && $u->info['align']<4){ ?>
-		<td width="30"><img onClick="top.getUrl('main','main.php?3_panel=1&rnd='+c.rnd);" class="db cp" title="������ ����" src="https://img.new-combats.com/i/buttons/chatBtn10.gif"></td>
-		<?}  if($u->info['align']==7) { ?>
-		<td width="30"><img onClick="top.getUrl('main','main.php?7_panel=1&rnd='+c.rnd);" class="db cp" title="������ ������������" src="https://img.new-combats.com/i/buttons/a___neutral.gif"></td>
-		<? } if($u->info['bukmeker']==1 || $u->info['admin']==1){ ?>
-        <td width="30"><img onClick="top.getUrl('main','main.php?bukmeker=1&rnd='+c.rnd);" class="db cp" title="������ ��������� " src="https://img.new-combats.com/i/buttons/bukmek.gif"></td>
-	   <? } if($u->info['admin'] > 0 || $u->info['align'] == 50){ ?>
-		<!--�������
-        <td width="30"><img onClick="top.getUrl('main','main.php?notepad=1&rnd='+c.rnd);" class="db cp" src="https://img.new-combats.com/b_notepad.gif"></td>-->
-		<? } if($u->info['level']>-1){ ?>
-
-        <? } if($u->info['clan']>0){ ?>
-        <td width="30"><img onClick="top.getUrl('main','main.php?clan=1&rnd='+c.rnd);" class="db cp" title="����" src="https://img.new-combats.com/i/buttons/chatBtn14.gif"></td>
-        <? } if($u->info['admin']>0){ ?>
-        <td width="30"><img onClick="top.getUrl('main','main.php?admin=1&rnd='+c.rnd);" class="db cp" src="https://img.new-combats.com/i/buttons/chatBtn19.gif"></td>
-        <? } ?>
-        <!--
-        <td width="30"><img onClick="top.getUrl('main','main.php?bagreport=1&rnd='+c.rnd);" class="db cp" src="https://img.new-combats.com/i/buttons/chatBtnBugs.gif"></td>
-        -->
-        <!--<td width="30"><img onClick="if(confirm('����� �� ����?')){ top.location = '/bk?exit&rnd=<?=$code?>'; }" class="db cp" src="https://img.new-combats.com/i/buttons/chatBtn11.gif"></td>-->
-		<td width="30"><img onclick="window.open('ekr.php')" class="db cp" title="������� ������������" src="https://img.new-combats.com/i/buttons/a___nak.gif"></td>
-
-
-		<!-- ����� -->
-		<td width="71" id="tdDate">
-			<button id="contentDate"></button>
-		</td>
-		<!-- ����� -->
-
-      </tr>
-    </table>
-    </td>
-    <td class="deleteStyles" height="30" align="right" bgcolor="#D6D6D6"><img class="db" src="https://img.new-combats.com/i/lite/bkf_l_r1_06.gif" width="9" height="30"></td>
-  </tr>
-  <tr id="deleteFooter">
-    <td height="5" bgcolor="#D6D6D6" style="background:url(https://img.new-combats.com/sand_mid_31.png);"></td>
-    <td height="5" bgcolor="#D6D6D6" style="background:url(https://img.new-combats.com/sand_mid_31.png);"><!-- iFrames zone --></td>
-    <td height="5" bgcolor="#D6D6D6" style="background:url(https://img.new-combats.com/sand_mid_31.png);"></td>
-  </tr>
+        <td class="deleteStyles" height="30" align="right" bgcolor="#D6D6D6"><img class="db"
+                                                                                  src="https://img.new-combats.com/i/lite/bkf_l_r1_06.gif"
+                                                                                  width="9" height="30"></td>
+    </tr>
+    <tr id="deleteFooter">
+        <td height="5" bgcolor="#D6D6D6" style="background:url(https://img.new-combats.com/sand_mid_31.png);"></td>
+        <td height="5" bgcolor="#D6D6D6" style="background:url(https://img.new-combats.com/sand_mid_31.png);">
+            <!-- iFrames zone --></td>
+        <td height="5" bgcolor="#D6D6D6" style="background:url(https://img.new-combats.com/sand_mid_31.png);"></td>
+    </tr>
 </table>
 <p id="timerVoiceMess" hidden></p>
 
 <!-- ������ -->
 <script>
-	// ����
-	var intervalClear
-    var timeoutClear 
-	var $button = document.getElementById("contentDate")
-	var $div = document.createElement("div")
-	$div.id = "divFullDate"
+    // ����
+    var intervalClear
+    var timeoutClear
+    var $button = document.getElementById("contentDate")
+    var $div = document.createElement("div")
+    $div.id = "divFullDate"
     document.body.append($div)
-	$div.hidden = true
+    $div.hidden = true
 
 
-	var date = new Date()
+    var date = new Date()
     var currentSec = (60 - date.getUTCSeconds()) * 1000
-    
+
     asyncInterval()
-    async function asyncInterval () {
-        
+
+    async function asyncInterval() {
+
         timeMSK()
-        
-        var promise = await new Promise ( (resolve, reject) => {
-            setTimeout( () => {
+
+        var promise = await new Promise((resolve, reject) => {
+            setTimeout(() => {
                 timeMSK()
                 resolve("��� ������")
             }, currentSec)
         })
-        
-        setInterval( () => timeMSK(), 60000)
-    }
-    
-    function timeMSK (hover = false) {
 
-        var mskTime = (new Date).toLocaleTimeString('ru-RU', { timeZone: 'Europe/Moscow'})
+        setInterval(() => timeMSK(), 60000)
+    }
+
+    function timeMSK(hover = false) {
+
+        var mskTime = (new Date).toLocaleTimeString('ru-RU', {timeZone: 'Europe/Moscow'})
         $button.textContent = mskTime.match(/\d{2}:\d{2}/i)[0]
 
         if (hover) {
-            var fullDate = (new Date).toLocaleDateString('ru-RU', { timeZone: 'Europe/Moscow'})
+            var fullDate = (new Date).toLocaleDateString('ru-RU', {timeZone: 'Europe/Moscow'})
             var [day, month, year] = fullDate.match(/\b\d{2,4}\b/gi)
-            
-            var objDate = { year: +year,  month: +month-1, day: +day }
+
+            var objDate = {year: +year, month: +month - 1, day: +day}
             var todayDay = new Date(objDate.year, objDate.month, objDate.day).getUTCDay()
-			// In objDate.day make ++ 
+            // In objDate.day make ++
 
             return {
                 date: divFullDateTime(objDate),
@@ -937,52 +1172,77 @@ function smiles1load() {
                 redDay: todayDay === 5 || todayDay === 6 || todayDay === 0
             }
         }
-	}    
-	
-	function divFullDateTime ({ year, month, day }) {
-		var strMonth = ""
+    }
 
-		switch (month) {
-			case 0: strMonth = "������"; break
-			case 1: strMonth = "�������"; break
-			case 2: strMonth = "�����"; break
-			case 3: strMonth = "������"; break
-			case 4: strMonth = "���"; break
-			case 5: strMonth = "����"; break
-			case 6: strMonth = "����"; break
-			case 7: strMonth = "�������"; break
-			case 8: strMonth = "��������"; break
-			case 9: strMonth = "�������"; break
-			case 10: strMonth = "������"; break
-			case 11: strMonth = "�������"; break
-			default: break
-		}
-		return `${day} ${strMonth} ${year}` 
-	}
+    function divFullDateTime({year, month, day}) {
+        var strMonth = ""
 
-	function everySecondsUpdate () {
-		var { date, time, redDay } = timeMSK(true)
+        switch (month) {
+            case 0:
+                strMonth = "������";
+                break
+            case 1:
+                strMonth = "�������";
+                break
+            case 2:
+                strMonth = "�����";
+                break
+            case 3:
+                strMonth = "������";
+                break
+            case 4:
+                strMonth = "���";
+                break
+            case 5:
+                strMonth = "����";
+                break
+            case 6:
+                strMonth = "����";
+                break
+            case 7:
+                strMonth = "�������";
+                break
+            case 8:
+                strMonth = "��������";
+                break
+            case 9:
+                strMonth = "�������";
+                break
+            case 10:
+                strMonth = "������";
+                break
+            case 11:
+                strMonth = "�������";
+                break
+            default:
+                break
+        }
+        return `${day} ${strMonth} ${year}`
+    }
 
-		$div.innerHTML = `<p>${time}</p>
+    function everySecondsUpdate() {
+        var {date, time, redDay} = timeMSK(true)
+
+        $div.innerHTML = `<p>${time}</p>
 		<p id="dateRed">${date}</p>`
 
-		document.getElementById("dateRed").style.color = redDay ? "red" : ""
-	}
+        document.getElementById("dateRed").style.color = redDay ? "red" : ""
+    }
 
-    $button.addEventListener("mouseover", function (event) {    
+    $button.addEventListener("mouseover", function (event) {
 
-        timeoutClear = setTimeout( () => {
+        timeoutClear = setTimeout(() => {
 
             $div.hidden = false
-			var $trTop = $button.parentElement.getBoundingClientRect().top
-			var $tdLeft = document.getElementById("tdDate").offsetLeft
-				
-			$div.style.top = `${$trTop - ($button.offsetHeight * 2.1)}px`
-			$div.style.left = `${($tdLeft - ($div.offsetWidth - $button.offsetWidth)) + 10}px`
+            var $trTop = $button.parentElement.getBoundingClientRect().top
+            var $tdLeft = document.getElementById("tdDate").offsetLeft
 
-			everySecondsUpdate()
-			
-            intervalClear = setInterval( () => everySecondsUpdate(), 1000)
+            $div.style.top = `${$trTop - ($button.offsetHeight * 2.1)}px`
+            $div.style.left = `${($tdLeft - ($div.offsetWidth - $button.offsetWidth)) + 10}px`
+
+            everySecondsUpdate()
+
+            intervalClear = setInterval(() => everySecondsUpdate(), 1000)
         }, 550)
     })
 
@@ -993,97 +1253,25 @@ function smiles1load() {
     })
 </script>
 
-<?
-if($u->info['active']!='' && $u->info['mail']!='No E-mail')
-{
-	$yes = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "user_active_good" LIMIT 1',1);
-	$yes2 = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "user_active_send" LIMIT 1',1);
-	if($u->info['login'] != '-LEL-')
-	{
-		mysql_query('UPDATE `stats` SET `active` = "" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-	}
-	
-	/*
-	function send_mime_mail($name_from, // ��� �����������
-                       $email_from, // email �����������
-                       $name_to, // ��� ����������
-                       $email_to, // email ����������
-                       $data_charset, // ��������� ���������� ������
-                       $send_charset, // ��������� ������
-                       $subject, // ���� ������
-                       $body // ����� ������
-                       )
-	   {
-	  $to = mime_header_encode($name_to, $data_charset, $send_charset)
-					 . ' <' . $email_to . '>';
-	  $subject = mime_header_encode($subject, $data_charset, $send_charset);
-	  $from =  mime_header_encode($name_from, $data_charset, $send_charset)
-						 .' <' . $email_from . '>';
-	  if($data_charset != $send_charset) {
-		$body = iconv($data_charset, $send_charset, $body);
-	  }
-	  $headers = "From: $from\r\n";
-	  $headers .= "Content-type: text/plain; charset=$send_charset\r\n";
-	
-	  return mail($to, $subject, $body, $headers);
-	}
-	
-	function mime_header_encode($str, $data_charset, $send_charset) {
-	  if($data_charset != $send_charset) {
-		$str = iconv($data_charset, $send_charset, $str);
-	  }
-	  return '=?' . $send_charset . '?B?' . base64_encode($str) . '?=';
-	}
-
-	if(!isset($yes2['id']))
-	{
-		//���������� ������
-		echo '<script>chat.sendMsg(["new","'.time().'","6","","'.$u->info['login'].'","<small>�� ��� �������� ���� <b>'.$u->info['mail'].'</b> ���������� ������ � ����������� �� ��������� ��������. (������ ������� � ������� 15 �����, � ���-�� ��������� ������ &quot;����&quot;)</small>","Black","1","1","0"]);</script>';
-		//$u->addAction(time(),'user_active_send',$u->info['mail']);
-		// ����������		
-		send_mime_mail('www.new-combats.com',
-               'support@new-combats.com',
-               ''.$u->info['login'].'',
-               $u->info['mail'],
-               'CP1251',  // ���������, � ������� ��������� ������������ ������
-               'KOI8-R', // ���������, � ������� ����� ���������� ������
-               '��������� ��������� '.$u->info['login'].'',
-               "������������! �� ����� ���� ������ ��������� � ����� ����! \r\n ��� ��������: ".$u->info['login']." [0] \r\n ������ ��� ���������: https://capitalcity.new-combats.com/bk?active=".$u->info['active'].".\r\n\r\n� ���������, �������������!");
-		$u->addAction(time(),'user_active_send',$u->info['mail']);
-		
-	}elseif(!isset($yes['id']))
-	{
-		//���������������� ����������
-		if(isset($_GET['active']) && $u->info['active'] == $_GET['active'])
-		{
-			//��������
-			$u->addAction(time(),'user_active_good',$u->info['mail']);
-			mysql_query('UPDATE `stats` SET `active` = "" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			die('<script>top.location = "https://'.$c[$u->info['city']].'/bk";</script>');
-		}
-	}
-	*/
+<?php
+if ($u->info['active'] != '' && $u->info['mail'] != 'No E-mail') {
+    $yes = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "user_active_good" LIMIT 1', 1);
+    $yes2 = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vars` = "user_active_send" LIMIT 1', 1);
+    if ($u->info['login'] != '-LEL-') {
+        mysql_query('UPDATE `stats` SET `active` = \'\' WHERE `id` = ' . $u->info['id'] . ' LIMIT 1');
+    }
 }
 ?>
 <script>
-startEngine();
-chat.testTimer(false);
-setTimeout('chat.nozpros=0;',20);
-<? if( $u->info['design'] == 1 ) { ?>
-/*
-top.add_cb(1,'���',1,'ch1','<br>');
-top.add_cb(5,'���',1,'ch5','<br>');
-top.add_cb(3,'���',1,'ch3','<br><div id="battle_logg"></div>');
-top.add_cb(4,'��������� ���������',1,'ch4','<br>');
-*/
-
-<? } ?>
+    startEngine();
+    chat.testTimer(false);
+    setTimeout('chat.nozpros=0;', 20);
 </script>
 
 <script type="text/javascript" src="css/stylesMobile.js"></script>
 
 </body>
 </html>
-<?
+<?php
 unset($db);
 ?>
-- 
2.45.2


From 1666e391609ee102761fa96c6b53e2437b50e1a8 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Mon, 27 Jun 2022 01:09:53 +0300
Subject: [PATCH 09/12] Closes #13

---
 online.php | 151 +++++++++++++++++++++++++++--------------------------
 1 file changed, 76 insertions(+), 75 deletions(-)

diff --git a/online.php b/online.php
index a81063fd..92e7655c 100644
--- a/online.php
+++ b/online.php
@@ -22,7 +22,8 @@ if ($u->info['bithday'] == '01.01.1800') {
 }
 
 if ($u->info['admin'] == 0) {
-    unset($_GET['r3']);
+    //Эта перемычка ЗАПРЕЩАЕТ просмотр всех пользователей чата одновременно по запросу.
+    //unset($_GET['r3']);
 }
 
 if ($u->info['online'] < time() - 60) {
@@ -79,7 +80,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
         $x = explode(" ", $buf);
         $newbuf = '';
         for ($j = 0; $j < count($x); $j++) {
-            $uname = '&lt;���������� ������&gt;';
+            $uname = '&lt;Внутренняя ссылка&gt;';
             //
             if (strripos($x[$j], 'new-combats.com/info/')) {
                 $ulogin = explode('/info/', $x[$j]);
@@ -87,19 +88,19 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                 $ulogin = mysql_fetch_array(mysql_query('SELECT `login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" OR `login` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
                 if (isset($ulogin['login'])) {
                     $ulogin = htmlspecialchars($ulogin['login']);
-                    $uname = '<font color=#831db7>&lt;���������� � &quot;' . $ulogin . '&quot;&gt;</font>';
+                    $uname = '<font color=#831db7>&lt;Информация о &quot;' . $ulogin . '&quot;&gt;</font>';
                 }
-            } elseif (strripos($x[$j], 'audio_1610649509.mp3')) { //��� �����
-                $uname = '<font color=#FF851B>&lt;��������� ���������&gt;</font>';
+            } elseif (strripos($x[$j], 'audio_1610649509.mp3')) { //ТУТ аудио
+                $uname = '<font color=#FF851B>&lt;Голосовое сообщение&gt;</font>';
             } elseif (strripos($x[$j], 'new-combats.com/item/')) {
                 $ulogin = explode('/item/', $x[$j]);
                 $ulogin = $ulogin[1];
                 $ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `items_main` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
                 if (isset($ulogin['name'])) {
                     $ulogin = htmlspecialchars($ulogin['name']);
-                    $uname = '<font color=#5f9b00>&lt;������� &quot;' . $ulogin . '&quot;&gt;</font>';
+                    $uname = '<font color=#5f9b00>&lt;Предмет &quot;' . $ulogin . '&quot;&gt;</font>';
                 } else {
-                    $uname = '<font color=#5f9b00>&lt;���������� ���������&gt;</font>';
+                    $uname = '<font color=#5f9b00>&lt;Библиотека предметов&gt;</font>';
                 }
             } elseif (strripos($x[$j], 'new-combats.com/news')) {
                 $ulogin = explode('/news', $x[$j]);
@@ -108,9 +109,9 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                 $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `events_news` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
                 if (isset($ulogin['title'])) {
                     $ulogin = htmlspecialchars($ulogin['title']);
-                    $uname = '<font color=#b57300>&lt;������� &quot;' . $ulogin . '&quot;&gt;</font>';
+                    $uname = '<font color=#b57300>&lt;Новость &quot;' . $ulogin . '&quot;&gt;</font>';
                 } else {
-                    $uname = '<font color=#b57300>&lt;��������� �����&gt;</font>';
+                    $uname = '<font color=#b57300>&lt;Новостная лента&gt;</font>';
                 }
             } elseif (strripos($x[$j], 'new-combats.com/lib')) {
                 $ulogin = explode('/lib', $x[$j]);
@@ -120,9 +121,9 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                 $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `library_content` WHERE `url_name` = "' . mysql_real_escape_string($ulogin) . '" AND `moder` > 0 LIMIT 1'));
                 if (isset($ulogin['title'])) {
                     $ulogin = htmlspecialchars($ulogin['title']);
-                    $uname = '<font color=#4c6e00>&lt;���������� &quot;' . $ulogin . '&quot;&gt;</font>';
+                    $uname = '<font color=#4c6e00>&lt;Библиотека &quot;' . $ulogin . '&quot;&gt;</font>';
                 } else {
-                    $uname = '<font color=#4c6e00>&lt;����������&gt;</font>';
+                    $uname = '<font color=#4c6e00>&lt;Библиотека&gt;</font>';
                 }
             } elseif (strripos($x[$j], 'new-combats.com/forum')) {
                 $ulogin = explode('/forum?read=', $x[$j]);
@@ -133,7 +134,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                 $ulogin = mysql_fetch_array(mysql_query('SELECT `title` FROM `forum_msg` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" AND `delete` = 0 LIMIT 1'));
                 if (isset($ulogin['title'])) {
                     $ulogin = htmlspecialchars($ulogin['title']);
-                    $uname = '<font color=#0055b5>&lt;����� &quot;' . $ulogin . '&quot;&gt;</font>';
+                    $uname = '<font color=#0055b5>&lt;Форум &quot;' . $ulogin . '&quot;&gt;</font>';
                 } else {
                     $ulogin = explode('/forum?r=', $x[$j]);
                     $ulogin = $ulogin[1];
@@ -142,9 +143,9 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                     //
                     $ulogin = mysql_fetch_array(mysql_query('SELECT `name` FROM `forum_menu` WHERE `id` = "' . mysql_real_escape_string($ulogin) . '" LIMIT 1'));
                     if (isset($ulogin['name'])) {
-                        $uname = '<font color=#0055b5>&lt;����������� ������ &quot;' . $ulogin['name'] . '&quot;&gt;</font>';
+                        $uname = '<font color=#0055b5>&lt;Конференция форума &quot;' . $ulogin['name'] . '&quot;&gt;</font>';
                     } else {
-                        $uname = '<font color=#0055b5>&lt;����� �������&gt;</font>';
+                        $uname = '<font color=#0055b5>&lt;Форум проекта&gt;</font>';
                     }
                 }
             }
@@ -197,13 +198,13 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
 
         if ($u->info['molch1'] < time()) {
 
-            //�������� �� ���� �� 5 �����
+            //Молчанка за флуд на 5 минут
             $u->info['molch1'] = time() + 1200;
-            $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �������� �� ���� �� 20 ����� </small>","Black","1","1","0"]);';
+            $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за спам на 20 минут </small>","Black","1","1","0"]);';
 
             mysql_query('UPDATE `users` SET `molch1` = "' . $u->info['molch1'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
             mysql_query("UPDATE `chat` SET `delete` = 1 WHERE `login` = '" . $u->info['login'] . "' LIMIT 1000");
-            $_POST['msg'] = '� ������ ' . $u->info['login'] . ' � ���� ����� ������������� https://new-combats.com/info/' . $u->info['id'] . '';
+            $_POST['msg'] = 'Я спамер ' . $u->info['login'] . ' и меня нужно заблокировать https://new-combats.com/info/' . $u->info['id'] . '';
 
             mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
 				"0",
@@ -226,7 +227,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
 				"0",
 				"0")');
 
-            $_POST['msg'] = '��� ����� ������! ���� �������!';
+            $_POST['msg'] = 'Это супер проект! Всем успехов!';
 
             mysql_query('INSERT INTO `chat` (`nosee`,`invis`,`da`,`delete`,`molch`,`new`,`login`,`to`,`city`,`room`,`time`,`type`,`spam`,`text`,`toChat`,`color`,`typeTime`,`sound`,`global`) VALUES (
 				"0",
@@ -251,11 +252,11 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
 
         }
     } elseif ($lmg[0] > 0) {
-        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �� ������ ���������� ��� ����� ���������... </small>","Black","1","1","0"]);';
+        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять так часто сообщения... </small>","Black","1","1","0"]);';
         if ($u->info['molch1'] < time()) {
             if ($u->info['molch1'] < -5) {
                 $u->info['molch1'] = time() + 300;
-                $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �������� �� ���� �� 5 ����� </small>","Black","1","1","0"]);';
+                $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы наказаны за флуд на 5 минут </small>","Black","1","1","0"]);';
             } elseif ($u->info['molch1'] < 0) {
                 $u->info['molch1']--;
             } else {
@@ -264,10 +265,10 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
             mysql_query('UPDATE `users` SET `molch1` = "' . $u->info['molch1'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
         }
     } elseif ((preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to']) || preg_match("/private \[(.*?)\]/", $_POST['msg'], $msg['to'])) && $u->info['exp'] < 150000) {
-        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �� ������ ���������� ������ �� ���������� 150000 �����.</small>","Black","1","1","0"]);';
+        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не можете отправлять приват до достижения 150000 опыта.</small>","Black","1","1","0"]);';
 
     } else {
-        //���������� ������
+        //Записываем данные
         $msg['time'] = time();
         $msg['spam'] = 0;
         $msg['type'] = 1;
@@ -284,7 +285,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
         $msg['da'] = 0;
         $msg['color'] = $u->info['chatColor'];
 
-        //��������� ���� ���������
+        //Нормируем типы сообщений
         if (preg_match("/private\[(.*?)\]/", $_POST['msg'], $msg['to'])) {
             $msg['to'] = $msg['to'][1];
             $_POST['msg'] = str_replace('private[' . $msg['to'] . ']', 'private [' . $msg['to'] . ']', $_POST['msg']);
@@ -304,7 +305,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
             $msg['type'] = 2;
             $_POST['msg'] = str_replace('to [' . $msg['to'] . ']', ' ', $_POST['msg']);
         }
-        if ($u->info['admin'] == 0) {  //��� SPAM
+        if ($u->info['admin'] == 0) {  //ТУТ SPAM
             if ($msg['to'] != '' && !isset($admq['id'])) {
                 $admq = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "' . mysql_real_escape_string($msg['to']) . '" AND `admin` > 0 LIMIT 1'));
                 if ($msg['type'] != 3) {
@@ -312,11 +313,11 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                 }
             }
             if (!isset($admq['id'])) {
-                $msg['fspam'] = $filter->spamFiltr(str_replace('�����', '.', str_replace('��', 'ru', $_POST['msg'])));
+                $msg['fspam'] = $filter->spamFiltr(str_replace('точка', '.', str_replace('ру', 'ru', $_POST['msg'])));
                 if ($msg['fspam'] != '0') {
                     $msg['spam'] = 1;
                     $msg['delete'] = 1;
-                    $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. ��������� ������� ����� �������� � ���������� ���������.</small>","Black","1","1","0"]);';
+                    $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Повторные попытки могут привести к блокировке персонажа.</small>","Black","1","1","0"]);';
                 }
 
                 if ($msg['spam'] == 1 && $u->info['molch1'] < time() && $u->info['admin'] == 0) {
@@ -332,12 +333,12 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                     if ($mban['vals'] + 1 < 2) {
                         $msg['fspam'] = str_replace('%', '</b>,<b>', $msg['fspam']);
                         $msg['fspam'] = '<b>' . ltrim($msg['fspam'], '0</b>,<b>') . '</b>';
-                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. ����������� �����: ' . $msg['fspam'] . '. �������������� [' . ($mban['vals'] + 1) . '/1]</small>","Black","1","1","0"]);';
+                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Запрещенные слова: ' . $msg['fspam'] . '. Предупреждения [' . ($mban['vals'] + 1) . '/1]</small>","Black","1","1","0"]);';
                     } else {
-                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>� ����� ���� ����������� �������� ������ �� ��������������� �������. �� �������� �� ��������� ������ �������.</small>","Black","1","1","0"]);';
-                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','0','','','<b>��������������</b>: �������� " . $u->info['login'] . " [" . $u->info['level'] . "] ��� ������� �� ��������� ������ �������.','-1','6','0')");
+                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>В нашем чате запрещается сообщать ссылки на атльтернативные проекты. Вы наказаны за нарушение правил общения.</small>","Black","1","1","0"]);';
+                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $u->info['city'] . "','0','','','<b>Автоинформатор</b>: Персонаж " . $u->info['login'] . " [" . $u->info['level'] . "] был наказан за нарушение правил общения.','-1','6','0')");
                         mysql_query('UPDATE `users` SET `molch1` = "' . (time() + 1 * 60 * 60) . '",`molch2` = "' . (time() + 1 * 60 * 60) . '",`info_delete` = "' . (time() + 1 * 60 * 60) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                        $rtxt = $rang . ' &quot;' . $u->info['login'] . '&quot; <small><font color=red>��������������</font></small>: ' . $msg['text'] . ' [' . $msg['fspam'] . '].';
+                        $rtxt = $rang . ' &quot;' . $u->info['login'] . '&quot; <small><font color=red>Автоинформатор</font></small>: ' . $msg['text'] . ' [' . $msg['fspam'] . '].';
                         mysql_query("INSERT INTO `users_delo` (`uid`,`ip`,`city`,`time`,`text`,`login`,`type`) VALUES ('" . $u->info['id'] . "','" . $_SERVER['REMOTE_ADDR'] . "','" . $u->info['city'] . "','" . time() . "','" . $rtxt . "','" . $u->info['login'] . "',0)");
                     }
                 }
@@ -349,12 +350,12 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
 
         $qix = mysql_fetch_array(mysql_query('SELECT `id` FROM `friends` WHERE `ignor` > 0 AND `login_ignor` = "' . mysql_real_escape_string($pl['login']) . '" AND (`user_ignor` = "' . $u->info['login'] . '" OR `user` = "' . $u->info['id'] . '") LIMIT 1'));
         if (isset($qix['id'])) {
-            $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<b>��� �������� � �����</b>: �� �� ������ ���������� ��������� ��������� &quot;' . htmlspecialchars($msg['to']) . '&quot;.","Black","1","1","0"]);';
+            $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<b>Вас добавили в игнор</b>: Вы не можете отправлять сообщения персонажу &quot;' . htmlspecialchars($msg['to']) . '&quot;.","Black","1","1","0"]);';
             $msg['cancel']++;
         }
         if ($msg['type'] == 3 && $msg['to'] == 'klan') {
             if ($u->info['clan'] == 0) {
-                $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>�� �� ��������� ������ ������ �� <b>������</b> � �� ������ �������� �� ����� ������.</small>","Black","1","1","0"]);';
+                $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Вы не являетесь частью одного из <b>Кланов</b> и не можете общаться по этому каналу.</small>","Black","1","1","0"]);';
                 $msg['cancel']++;
             } else {
                 $msg['to'] = 'k' . $u->info['clan'];
@@ -388,27 +389,27 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                 $msg['to'] = '';
                 $msg['type'] = 21;
                 if ($msw == 'USER IS FALSE') {
-                    $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>��������� ��� � ������ �������.</small>","Black","1","1","0"]);';
+                    $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small>Персонажа нет в данной комнате.</small>","Black","1","1","0"]);';
                     $nosend = 1;
                 }
             } elseif ($chat->str_count($_POST['msg'], 3) == '/e ') {
                 $msg['type'] = 21;
                 $_POST['msg'] = ltrim($_POST['msg'], '/e ');
-            } elseif ($chat->str_count($_POST['msg'], 3) == '/� ') {
+            } elseif ($chat->str_count($_POST['msg'], 3) == '/е ') {
                 $msg['type'] = 21;
-                $_POST['msg'] = ltrim($_POST['msg'], '/� ');
+                $_POST['msg'] = ltrim($_POST['msg'], '/е ');
             } elseif ($chat->str_count($_POST['msg'], 4) == ' /e ') {
                 $msg['type'] = 21;
                 $_POST['msg'] = ltrim($_POST['msg'], ' /e ');
-            } elseif ($chat->str_count($_POST['msg'], 4) == ' /� ') {
+            } elseif ($chat->str_count($_POST['msg'], 4) == ' /е ') {
                 $msg['type'] = 21;
-                $_POST['msg'] = ltrim($_POST['msg'], ' /� ');
+                $_POST['msg'] = ltrim($_POST['msg'], ' /е ');
             }
 
             if ($nosend == 0) {
 
-                //������� ��������
-                $_POST['msg'] = str_replace('%usersmile%-', '%us�rsmil�%-', $_POST['msg']);
+                //Именные смайлики
+                $_POST['msg'] = str_replace('%usersmile%-', '%usеrsmilе%-', $_POST['msg']);
                 $usml = explode(',', $u->info['add_smiles']);
                 $i = 0;
                 while ($i < count($usml)) {
@@ -427,7 +428,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                     $msg['nosee'] = round($u->info['host_reg']);
                     if ($msg['nosee'] == 0) {
                         $msg['nosee'] = -1;
-                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small><b>� ����� ������ ������ �������, ������� � ���� �������� � 8-�� ������.</b> </small>","red","1","1","0"]);';
+                        $r['js'] .= 'chat.sendMsg(["new","' . time() . '","6","","' . $u->info['login'] . '","<small><b>В целях борьбы против рекламы, общение в чате доступно с 8-го уровня.</b> </small>","red","1","1","0"]);';
                     }
                 }
 
@@ -455,18 +456,18 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
             }
         }
 
-        if ($msg['type'] == 2 && mb_convert_case($msg['to'], MB_CASE_LOWER) == '�����������') {
-            if (preg_match("/�������/i", mb_convert_case($_POST['msg'], MB_CASE_LOWER))) {
+        if ($msg['type'] == 2 && mb_convert_case($msg['to'], MB_CASE_LOWER) == 'комментатор') {
+            if (preg_match("/анекдот/i", mb_convert_case($_POST['msg'], MB_CASE_LOWER))) {
                 $text_com = '';
                 $sp_all = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `a_com_act` WHERE `act` = "' . $com_act . '" AND `time` > "' . time() . '" LIMIT 5'));
                 if ($sp_all[0] > 0) {
                     if (rand(0, 100) < 75) {
                         $text_com = [
-                            '������� ����������! ... ��� ��������, �������� �� ���������!',
-                            '�������... ������ ���-������ �����',
-                            '����� �����...',
-                            '��� ���� ����, �� �� �� ����������...',
-                            '� ���� �� ����������� ������� ���� &quot;������&quot;... ��...'
+                            'Отстань попрошайка! ... Ищу анекдоты, интернет не маленький!',
+                            'Подожди... Сейчас что-нибудь найду',
+                            'Почти нашел...',
+                            'Вот один есть, но он не интересный...',
+                            'А свет на центральной площади тьму &quot;пинает&quot;... Эх...'
                         ];
                         $text_com = $text_com[rand(0, (count($text_com) - 1))];
                     }
@@ -480,19 +481,19 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
                         $text_com = str_replace("<br />", "<br />&nbsp; &nbsp; ", $text_com);
                         $text_com = str_ireplace("\r\n", "", $text_com);
                         $text_com = str_replace("", "", $text_com);
-                        $text_com = '<font color=red><b>�������</b></font>:<br>&nbsp; &nbsp; ' . $text_com . '<br>';
+                        $text_com = '<font color=red><b>Анекдот</b></font>:<br>&nbsp; &nbsp; ' . $text_com . '<br>';
                     } else {
-                        $text_com = '������� �� ������ �������...';
+                        $text_com = 'Анекдот из головы вылетел...';
                     }
                     mysql_query('INSERT INTO `a_com_act` (`act`,`time`,`uid`) VALUES ("0","' . (time() + 60) . '","' . $u->info['id'] . '")');
                 }
                 if ($text_com != '') {
-                    mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("' . $text_com . '","�����������","' . $u->info['login'] . '","' . $u->info['city'] . '","' . $u->info['room'] . '","2","' . time() . '","1")');
+                    mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("' . $text_com . '","Комментатор","' . $u->info['login'] . '","' . $u->info['city'] . '","' . $u->info['room'] . '","2","' . time() . '","1")');
                 }
             } else {
                 include('commentator.php');
                 if ($comment != '') {
-                    mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("' . $comment . '","�����������","' . $u->info['login'] . '","' . $u->info['city'] . '","' . $u->info['room'] . '","2","' . time() . '","1")');
+                    mysql_query('INSERT INTO `chat` (`text`,`login`,`to`,`city`,`room`,`type`,`time`,`new`) VALUES ("' . $comment . '","Комментатор","' . $u->info['login'] . '","' . $u->info['city'] . '","' . $u->info['room'] . '","2","' . time() . '","1")');
                 }
             }
         }
@@ -501,7 +502,7 @@ if (isset($_POST['msg']) && str_replace(' ', '', $_POST['msg']) != '') {
 
 }
 
-//�������� ������ ������
+//Получаем список онлайн
 if ($_GET['r1'] != 0) {
     $sp = mysql_query('SELECT `u`.`pass`,`u`.`sex`,`s`.`dnow`,`u`.`timeMain`,`s`.`bot`,`s`.`atack`,`u`.`afk`,`u`.`dnd`,`u`.`banned`,`u`.`molch1`,`u`.`room`,`u`.`id`,`u`.`city`,`u`.`cityreg`,`u`.`online`,`u`.`align`,`u`.`clan`,`u`.`login`,`u`.`level`,`u`.`inTurnir`,`u`.`battle`,`u`.`invis`,`u`.`inUser`,`s`.`x`,`s`.`y` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE ((`u`.`room` = "' . $u->info['room'] . '" AND "' . mysql_real_escape_string((int)$_GET['r3']) . '" != "1") OR ("' . mysql_real_escape_string((int)$_GET['r3']) . '" = "1" AND `pass` NOT LIKE "%saint%")) AND `mail`!="No E-mail" AND `room` != "303" ORDER BY `u`.`inUser` DESC,`u`.`online` DESC,`u`.`login` DESC LIMIT 1000');
     $ar_id = 0;
@@ -620,7 +621,7 @@ function json_fix_cyr($json_str)
 }
 
 
-//�������� ���������
+//Получаем сообщения
 if (isset($_GET['mid']) && !isset($_POST['mid'])) {
     $_POST['mid'] = $_GET['mid'];
 }
@@ -719,7 +720,7 @@ while ($pl = mysql_fetch_array($sp)) {
         $pl['city'] = $u->info['city'];
     }
 
-    //�������� �� ������ � ���������
+    //Проверки на доступ к просмотру
     if (
         ((
                 (
@@ -784,7 +785,7 @@ while ($pl = mysql_fetch_array($sp)) {
         }
         unset($n, $j, $ex);
     }
-    //�������� ��������� (�� ���� �������)
+    //Клановое сообщение (по всем городам)
     if ($pl['type'] == -3 && ($pl['to'] == 'k' . $u->info['clan'] || $u->info['admin'] > 0)) {
         $pl['type'] = 3;
         if ($pl['to'] == 'k' . $u->info['clan']) {
@@ -795,7 +796,7 @@ while ($pl = mysql_fetch_array($sp)) {
         $see = 0;
     }
 
-    //��������� ��������� ������ � ���� �������
+    //Системное сообщение только в этой комнате
     if (
         $pl['type'] == 6 &&
         $pl['room'] > 0 &&
@@ -805,17 +806,17 @@ while ($pl = mysql_fetch_array($sp)) {
         $see = 0;
     }
 
-    //��������� ��������� �� ����� ������
+    //Системное сообщение по всему городу
     if ($pl['type'] == 8 && $pl['city'] != $u->info['city'] && $pl['global'] == 0) {
         $see = 0;
     }
 
-    //��������� � ���������
+    //Сообщение с молчанкой
     if ($pl['molch'] > 0) {
         $see = 0;
     }
 
-    //��������� ���������� � ������ �������
+    //Сообщение отправлено в другой комнате
     if (
         (
             $pl['type'] == 1 ||
@@ -833,17 +834,17 @@ while ($pl = mysql_fetch_array($sp)) {
         $see = 0;
     }
 
-    //��������� ������, � ������ ������
+    //Сообщение прочее, в другом городе
     if ($pl['city'] != $u->info['city'] && $pl['global'] == 0) {
         $see = 0;
     }
 
-    //������
+    //Глобал
     if ($pl['global'] == 1 && $pl['city'] == $u->info['city'] && $pl['type'] != -3) {
         $see = 1;
     }
 
-    //�������� ���������
+    //Пещерное сообщение
     if ($pl['dn'] > 0 && $u->info['dnow'] != $pl['dn']) {
         $see = 0;
     }
@@ -858,9 +859,9 @@ while ($pl = mysql_fetch_array($sp)) {
         $see = 0;
     } else {
         if ($pl['nosee'] != 0 && $pl['login'] != $u->info['login']) {
-            $noseein = '������';
+            $noseein = 'скрыто';
             if ($u->info['id'] == $pl['nosee']) {
-                $noseein = '��� �������';
+                $noseein = 'ваш реферал';
             }
             $pl['text'] = '<span style=\"padding:0 5px 0 5px;background-color:#FFC;\"><font color=red><small>[' . $noseein . ']</small></font> ' . $pl['text'] . '</span>';
             if ($u->info['admin'] > 0 || $modr == 1) {
@@ -916,31 +917,31 @@ while ($pl = mysql_fetch_array($sp)) {
             if (preg_match_all("/item\[(.*?)\]/", $pl['text'], $reimg)) {
                 $k = 0;
                 while ($k <= count($reimg[1])) {
-                    $pl['text'] = str_replace('item[' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">�������</b>', $pl['text']);
+                    $pl['text'] = str_replace('item[' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'Функция временно недоступна!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">Предмет</b>', $pl['text']);
                     $k++;
                 }
             }
-            if (preg_match_all("/\.(?:mp3)$/i", $pl['text'], $reimg)) //��� ����� audio
+            if (preg_match_all("/\.(?:mp3)$/i", $pl['text'], $reimg)) //ТУТ аудио audio
             {
                 $k = 0;
                 while ($k <= count($reimg[1])) {
-                    $pl['text'] = str_replace('item[' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">����� ������</b>', $pl['text']);
+                    $pl['text'] = str_replace('item[' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'Функция временно недоступна!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">Аудио запись</b>', $pl['text']);
                     $k++;
                 }
             }
             if (preg_match_all("/item \[(.*?)\]/", $pl['text'], $reimg)) {
                 $k = 0;
                 while ($k <= count($reimg[1])) {
-                    $pl['text'] = str_replace('item [' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'������� �������� ����������!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">�������</b>', $pl['text']);
+                    $pl['text'] = str_replace('item [' . $reimg[1][$k] . ']', '<b oncontextmenu=\"return false;\" onClick=\"alert(\'Функция временно недоступна!\');\" style=\"cursor:pointer;\" class=\"itemsInfo\">Предмет</b>', $pl['text']);
                     $k++;
                 }
             }
 
             if ($pl['type'] != 3 && ($pl['invis'] == 1 || $pl['invis'] > time())) {
                 if ($u->info['admin'] == 0) {
-                    $pl['login'] = '<b><i>���������</i></b>';
+                    $pl['login'] = '<b><i>Невидимка</i></b>';
                 } else {
-                    $pl['login'] = '<b><i>���������</i></b></a> <small>(' . $pl['login'] . ')</small>';
+                    $pl['login'] = '<b><i>Невидимка</i></b></a> <small>(' . $pl['login'] . ')</small>';
                 }
 
             }
@@ -964,14 +965,14 @@ if ($rsys != '') {
     $r['js'] .= $rsys;
 }
 unset($rsys);
-//���������� ����
+//Генерируем ключ
 $r['key'] = md5($u->room['name'] . '+' . $ar_id . '+' . $ar_lvl . '+' . $ar_all);
 unset($ar_id, $ar_lvl);
 if ($_COOKIE['chatCfg12'] == 0) {
     $_GET['key'] = time();
 }
 if ($r['key'] == $_GET['key']) {
-    //������ ������ �������� ����������
+    //Список онлайн остается неизменным
     unset($r['rn'], $r['list'], $r['key'], $r['xu']);
 } elseif ($_GET['r1'] != 0) {
     $r['rn'] = iconv('cp1251', 'utf-8', $u->room['name']);
@@ -987,7 +988,7 @@ if ($posts > 0) {
     $r['js'] .= ' $("#postdiv").hide();';
 }
 
-//����������� �������� � ����
+//Предложения вступить в клан
 $sp = mysql_query('SELECT * FROM `clan_add` WHERE `uid` = "' . $u->info['id'] . '" AND `yes` = 0 AND `no` = 0');
 while ($pl = mysql_fetch_array($sp)) {
     $clns = mysql_fetch_array(mysql_query('SELECT `id`,`name`,`align` FROM `clan` WHERE `id` = "' . $pl['clan'] . '" LIMIT 1'));
@@ -996,7 +997,7 @@ while ($pl = mysql_fetch_array($sp)) {
 }
 unset($clns);
 
-//����������� �� �����
+//Предложение на обмен
 $trf = mysql_fetch_array(mysql_query('SELECT * FROM `transfers` WHERE `uid2` = "' . $u->info['id'] . '" AND `start2` = 0 AND `cancel1` = 0 AND `cancel2` = 0 LIMIT 1'));
 if (isset($trf['id'])) {
     $utf = mysql_fetch_array(mysql_query('SELECT `login` FROM `users` WHERE `id` = "' . $trf['uid1'] . '" LIMIT 1'));
@@ -1007,7 +1008,7 @@ if (isset($trf['id'])) {
     }
 }
 
-//������������ ������
+//Перекодируем строки
 if ($r['js'] != null) {
     $r['js'] = iconv('cp1251', 'utf-8', $r['js']);
 } else {
-- 
2.45.2


From dc710a8cb19f02053444b6545e2b234157b134f2 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Mon, 27 Jun 2022 14:44:30 +0300
Subject: [PATCH 10/12] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D1=80=D1=83=D0=B1?=
 =?UTF-8?q?=D0=B8=D0=BB=20=D1=81=D1=87=D1=91=D1=82=D1=87=D0=B8=D0=BA=20?=
 =?UTF-8?q?=D1=83=D1=87=D0=B0=D1=81=D1=82=D0=B8=D0=B9=20=D0=B2=20=D1=82?=
 =?UTF-8?q?=D1=83=D1=80=D0=BD=D0=B8=D1=80=D0=B0=D1=85=20#12?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 _incl_data/class/Achievements.php             | 16 +++++++++++++-
 .../Insallah/Tournament/TournamentModel.php   |  5 ++++-
 modules_data/titul.php                        | 22 +++++++++----------
 3 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/_incl_data/class/Achievements.php b/_incl_data/class/Achievements.php
index 71102dd4..b77335e6 100644
--- a/_incl_data/class/Achievements.php
+++ b/_incl_data/class/Achievements.php
@@ -199,11 +199,25 @@ class Achievements
         return $this->info;
     }
 
-    public function updateTier($name)
+    private function addOne($name)
     {
         Db::sql("update users_achiv set $name = $name + 1 where id = ?", [$this->user->info['id']]);
     }
 
+    public function updateTier($name)
+    {
+        if (in_array($name, array_keys($this->data))) {
+            $this->addOne($name . '_n');
+        }
+    }
+
+    public function updateCounter($name)
+    {
+        if (in_array($name, array_keys($this->data))) {
+            $this->addOne($name);
+        }
+    }
+
     /**
      * @return array[]
      */
diff --git a/_incl_data/class/Insallah/Tournament/TournamentModel.php b/_incl_data/class/Insallah/Tournament/TournamentModel.php
index 7985b0b7..619e7dbb 100644
--- a/_incl_data/class/Insallah/Tournament/TournamentModel.php
+++ b/_incl_data/class/Insallah/Tournament/TournamentModel.php
@@ -1,6 +1,9 @@
 <?php
 
 namespace Insallah;
+use Achievements;
+use user;
+
 class TournamentModel
 {
 
@@ -182,11 +185,11 @@ class TournamentModel
         $db = new Db();
         $db::sql('update tournaments_users set death_time = unix_timestamp() where uid = ?', [$uid]);
         self::teleport($uid, 9);
+        (new Achievements(user::start()))->updateCounter('trn');
     }
 
     /**
      * Узнаём id турнира по id игрока.
-     * todo Проверить, возможно можно обращаться к уровню игрока.
      *
      * @param int $uid
      *
diff --git a/modules_data/titul.php b/modules_data/titul.php
index 7f1a28b1..fbf4200e 100644
--- a/modules_data/titul.php
+++ b/modules_data/titul.php
@@ -24,7 +24,7 @@ if (isset($_GET['nagr'])) {
         $ai['klaszb'] > $ai['zb_n']
     ) {
         $ai['zb_n'] += 1;
-        $a->updateTier('zb_n');
+        $a->updateTier('zb');
         $a->givePrizeItems(10020, 'zb');
         $nagrtxt .= 'Жетон успеха X' . $a->getData()['zb']['prize'][$ai['zb_n']];
     } elseif ( //Хаот задание vx
@@ -33,7 +33,7 @@ if (isset($_GET['nagr'])) {
         $ai['klasvx'] > $ai['vx_n']
     ) {
         $ai['vx_n'] += 1;
-        $a->updateTier('vx_n');
+        $a->updateTier('vx');
         $u->addEkr($a->getData()['vx']['prize'][$ai['vx_n']]);
         $nagrtxt .= $a->getData()['vx']['prize'][$ai['vx_n']] . $a->getData()['vx']['prize'][0];
     } elseif ( //Сундуки трупожора snt
@@ -42,7 +42,7 @@ if (isset($_GET['nagr'])) {
         $ai['klassnt'] > $ai['snt_n']
     ) {
         $ai['snt_n'] += 1;
-        $a->updateTier('snt_n');
+        $a->updateTier('snt');
         $u->addEkr($a->getData()['snt']['prize'][$ai['snt_n']]);
         $nagrtxt .= $a->getData()['snt']['prize'][$ai['snt_n']] . $a->getData()['snt']['prize'][0];
     } elseif ( //Руны 8 лвл. rp
@@ -51,7 +51,7 @@ if (isset($_GET['nagr'])) {
         $ai['klasrp'] > $ai['rp_n']
     ) {
         $ai['rp_n'] += 1;
-        $a->updateTier('rp_n');
+        $a->updateTier('rp');
         $a->givePrizeItems(10038, 'rp');
         $nagrtxt .= 'Плохие Заготовки X' . $a->getData()['rp']['prize'][$ai['rp_n']];
     } elseif ( //Руны 9 лвл. rn
@@ -60,7 +60,7 @@ if (isset($_GET['nagr'])) {
         $ai['klasrn'] > $ai['rn_n']
     ) {
         $ai['rn_n'] += 1;
-        $a->updateTier('rn_n');
+        $a->updateTier('rn');
         $a->givePrizeItems(10039, 'rn');
         $nagrtxt .= 'Нормальные Заготовки X' . $a->getData()['rn']['prize'][$ai['rn_n']];
     } elseif ( //Руны 10 лвл. rb
@@ -69,7 +69,7 @@ if (isset($_GET['nagr'])) {
         $ai['klasrb'] > $ai['rb_n']
     ) {
         $ai['rb_n'] += 1;
-        $a->updateTier('rb_n');
+        $a->updateTier('rb');
         $a->givePrizeItems(10040, 'rb');
         $nagrtxt .= 'Идеальные Заготовки X' . $a->getData()['rb']['prize'][$ai['rb_n']];
     } elseif ( //Героик pg
@@ -78,7 +78,7 @@ if (isset($_GET['nagr'])) {
         $ai['klaspg'] > $ai['pg_n']
     ) {
         $ai['pg_n'] += 1;
-        $a->updateTier('pg_n');
+        $a->updateTier('pg');
         $a->givePrizeItems(10020, 'pg');
         $nagrtxt .= 'Жетон Успеха X' . $a->getData()['pg']['prize'][$ai['pg_n']];
     } elseif ( //Продать бабушке найденные вещи в пещере bv
@@ -87,7 +87,7 @@ if (isset($_GET['nagr'])) {
         $ai['klasbv'] > $ai['bv_n']
     ) {
         $ai['bv_n'] += 1;
-        $a->updateTier('bv_n');
+        $a->updateTier('bv');
         $u->addKr($a->getData()['bv']['prize'][$ai['bv_n']]);
         $nagrtxt .= $a->getData()['bv']['prize'][$ai['bv_n']] . $a->getData()['bv']['prize'][0];
     } elseif ( //Клан вар kw
@@ -96,7 +96,7 @@ if (isset($_GET['nagr'])) {
         $ai['klaskw'] > $ai['kw_n']
     ) {
         $ai['kw_n'] += 1;
-        $a->updateTier('kw_n');
+        $a->updateTier('kw');
         $a->givePrizeItems(4917, 'kw');
         $nagrtxt .= 'Клановый опыт +50000 X' . $a->getData()['kw']['prize'][$ai['kw_n']];
     } elseif ( //Башня смерти задание bs
@@ -105,7 +105,7 @@ if (isset($_GET['nagr'])) {
         $ai['klasbs'] > $ai['bs_n']
     ) {
         $ai['bs_n'] += 1;
-        $a->updateTier('bs_n');
+        $a->updateTier('bs');
         $u->addEkr($a->getData()['bs']['prize'][$ai['bs_n']]);
         $nagrtxt .= $a->getData()['bs']['prize'][$ai['bs_n']] . $a->getData()['bs']['prize'][0];
     } elseif ( //Турниры победы trn
@@ -114,7 +114,7 @@ if (isset($_GET['nagr'])) {
         $ai['klastrn'] > $ai['trn_n']
     ) {
         $ai['trn_n'] += 1;
-        $a->updateTier('trn_n');
+        $a->updateTier('trn');
         $u->addEkr($a->getData()['trn']['prize'][$ai['trn_n']]);
         $nagrtxt .= $a->getData()['trn']['prize'][$ai['trn_n']] . $a->getData()['trn']['prize'][0];
     }
-- 
2.45.2


From 3a12248bdaa7f33c9cf4bff9b16a275cad8170f9 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Tue, 28 Jun 2022 15:19:59 +0300
Subject: [PATCH 11/12] =?UTF-8?q?=D0=A0=D0=B0=D1=81=D1=81=D0=B8=D0=BD?=
 =?UTF-8?q?=D1=85=D1=80=D0=BE=D0=BD=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8=D0=B9?=
 =?UTF-8?q?=20Tournament.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../class/Insallah/Tournament/Tournament.php  | 106 +++++++++-------
 .../Insallah/Tournament/TournamentModel.php   | 114 +++++++++++++-----
 inf.php                                       |   2 +-
 3 files changed, 151 insertions(+), 71 deletions(-)

diff --git a/_incl_data/class/Insallah/Tournament/Tournament.php b/_incl_data/class/Insallah/Tournament/Tournament.php
index 2e1045ab..f22c9926 100644
--- a/_incl_data/class/Insallah/Tournament/Tournament.php
+++ b/_incl_data/class/Insallah/Tournament/Tournament.php
@@ -1,12 +1,33 @@
 <?php
-/** todo
- * В каком-то месте проверять по крону не протух ли турнир!
- */
 
 namespace Insallah;
 
 class Tournament
 {
+    const IS_ENABLED = true;
+    const SEND_CHAT_MESSAGE = 3;
+    const START_TOURNAMENT = 6;
+    const PRIZE1 = 25;
+    const PRIZE2 = 10;
+    const PRIZE3 = 5;
+    const MIN_EXP = 175000;
+    const CHAT_MESSAGE = 'Внимание! Турнир для %d уровня открыт! Поспешите принять участие в Зале Воинов!';
+    const VICTORY_MESSAGE = 'Турнир для %d уровней завершён! Первое место: %s. Второе место: %s. Третье место: %s.';
+    const DELAY1 = '+12hour';
+    const DELAY2 = '+6hour';
+    const DELAY3 = '+3hour';
+
+    /** Формула рассчёта разрешённой стоимости одетых предметов.
+     *
+     * @param int $int
+     *
+     * @return float|int
+     */
+    public static function ekrOverpriceFormula($int)
+    {
+        return ($int - 7) * 151;
+    }
+
     /**
      * Проверяем может ли игрок учавствовать в турнире и либо присоединяем его, либо обламываем.
      *
@@ -18,7 +39,13 @@ class Tournament
     {
         /** Возвращает level, или 0 если провалены проверки. */
         $userLevel = TournamentModel::getUserLevel($user_id);
-        if ($userLevel === 0) {
+        if (
+            $userLevel === 0 ||
+            TournamentModel::isEkrOverpriced($user_id, $userLevel) ||
+            !TournamentModel::isEnoughExperience($user_id) ||
+            TournamentModel::IsRestrictedToJoin($user_id) ||
+            TournamentModel::isStarted($user_id)
+        ) {
             return;
         }
 
@@ -28,36 +55,35 @@ class Tournament
         }
 
         TournamentModel::joinTournament($user_id, $userLevel);
+        $mq++;
 
-        /** На третьем участнике пишем уведомление в чат. */
-        if ($mq === 2) {
-            TournamentModel::sysMessage("Внимание! Идёт набор бойцов на турнир " . $userLevel . " уровня! Поспешите!");
+        if ($mq == self::SEND_CHAT_MESSAGE) {
+            TournamentModel::sysMessage(sprintf(self::CHAT_MESSAGE, $userLevel));
         }
 
-        /** На двенадцатом участнике начинаем турнир. */
-        if ($mq === 11) {
+        if ($mq == self::START_TOURNAMENT) {
             TournamentModel::startTournament($userLevel);
-            $this->check_members($userLevel);
         }
     }
 
     /**
-     * Проверяем есть ли ещё участники турнира. Если есть, отправляем драться. Если остался последний - значит он
-     * победитель.
-     * todo Обработать ничью!
-     *
-     * @param int $tournament_id
-     *
+     * Проверка для крона\конфига. Выбивает проигравших и перезапускает поединки во всех турнирах.
      * @return void
      */
-    private function check_members($tournament_id)
+    public function startAllBattles()
     {
-        $active_fighters = TournamentModel::getFreeFighters($tournament_id);
-        if (count($active_fighters) > 1) {
-            $this->start_battle($active_fighters);
-        } else {
-            TournamentModel::removeFighter($active_fighters[0]); // выбиваем победителя
-            $this->victory($tournament_id);
+        $db = new Db();
+        $db::sql('delete from tournaments where start_time + date_add(start_time,interval 30 minute) < unix_timestamp()');
+        TournamentModel::removeFighter(TournamentModel::getLooser());
+        $tournament_levels = $db::getColumn('select tid from tournaments where start_time = -1');
+        foreach ($tournament_levels as $level) {
+            $alive_fighters = TournamentModel::getFreeFighters($level);
+            if (count($alive_fighters) > 1) {
+                $this->start_battle($alive_fighters);
+            } elseif (count($alive_fighters) === 1) {
+                TournamentModel::removeFighter($alive_fighters[0]);
+                $this->victory($level);
+            }
         }
     }
 
@@ -78,22 +104,6 @@ class Tournament
         }
     }
 
-    /**
-     * Вызывается при проигрыше боя или при уходе в оффлайн.
-     *
-     * @param int $user_id
-     *
-     * @return void
-     */
-    public function kick_user($user_id)
-    {
-        if (empty($user_id)) {
-            return;
-        }
-        TournamentModel::removeFighter($user_id);
-        $this->check_members(TournamentModel::getTournamentIdByUserId($user_id)); //перезапуск выбора противника для поединка
-    }
-
     /**
      * Награждаем победителей турнира, чистим базу.
      *
@@ -104,9 +114,21 @@ class Tournament
     private function victory($tournament_id)
     {
         $winners = TournamentModel::getWinners($tournament_id);
+        sleep(1);
+        TournamentModel::givePrizeItems($winners[1], self::PRIZE1);
+        TournamentModel::givePrizeItems($winners[2], self::PRIZE2);
+        TournamentModel::givePrizeItems($winners[3], self::PRIZE3);
+        sleep(1);
+        TournamentModel::giveDelay($winners[1], strtotime(self::DELAY1));
+        TournamentModel::giveDelay($winners[2], strtotime(self::DELAY2));
+        TournamentModel::giveDelay($winners[3], strtotime(self::DELAY3));
+        sleep(1);
+        TournamentModel::sysMessage(sprintf(self::VICTORY_MESSAGE,
+            $tournament_id,
+            TournamentModel::uidToLogin($winners[1]),
+            TournamentModel::uidToLogin($winners[2]),
+            TournamentModel::uidToLogin($winners[3])));
+        sleep(3);
         TournamentModel::destroyTournament($tournament_id);
-        TournamentModel::givePrizeItems($winners[1], 25);
-        TournamentModel::givePrizeItems($winners[2], 10);
-        TournamentModel::givePrizeItems($winners[3], 5);
     }
 }
\ No newline at end of file
diff --git a/_incl_data/class/Insallah/Tournament/TournamentModel.php b/_incl_data/class/Insallah/Tournament/TournamentModel.php
index 619e7dbb..5f31d6d7 100644
--- a/_incl_data/class/Insallah/Tournament/TournamentModel.php
+++ b/_incl_data/class/Insallah/Tournament/TournamentModel.php
@@ -1,8 +1,6 @@
 <?php
 
 namespace Insallah;
-use Achievements;
-use user;
 
 class TournamentModel
 {
@@ -17,18 +15,60 @@ class TournamentModel
      */
     public static function getUserLevel($uid)
     {
-        $db = new Db;
+        $db = new Db();
         $level = $db::getValue('select level from users where id = ? and level between 8 and 12 and battle = 0', [$uid]);
-        if (!$level) {
-            return 0;
+        return $level ? $level : 0;
+    }
+
+    /**
+     * @param int $uid
+     * @param int $level
+     *
+     * @return bool
+     */
+    public static function isEkrOverpriced($uid, $level = null)
+    {
+        $db = new Db();
+        if (is_null($level)) {
+            $level = $db::getValue('select level from users where id = ?', [$uid]);
         }
-        $ekr_total = $db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]);
-        $exp = $db::getValue('select exp from stats where id = ?', [$uid]);
-        // Вот правда не знаю проканает или нет.
-        if ($ekr_total > ($level - 7) * 150 || $exp < 250000) {
-            return 0;
+        $wearedItemsEkrPrice = $db::getValue('select sum(2price) from items_users where inOdet > 0 and uid = ?', [$uid]);
+        return $wearedItemsEkrPrice > Tournament::ekrOverpriceFormula($level);
+    }
+
+    /**
+     * @param int $uid
+     *
+     * @return bool
+     */
+    public static function isEnoughExperience($uid)
+    {
+        $db = new Db();
+        return $db::getValue('select exp from stats where id = ?', [$uid]) >= Tournament::MIN_EXP;
         }
-        return $level;
+
+    /**
+     * @param int $uid
+     *
+     * @return bool
+     */
+    public static function IsRestrictedToJoin($uid)
+    {
+        $db = new Db();
+        $delayEffect = $db::getValue('select count(*) from eff_users where uid = ? and id_eff = 486 and `delete` = 0', [$uid]);
+        return (bool)$delayEffect;
+    }
+
+    /**
+     * @param $tid
+     *
+     * @return bool
+     */
+    public static function isStarted($tid)
+    {
+        $db = new Db();
+        $status = $db::getValue('select count(*) from tournaments where start_time = -1 and tid = ?', [$tid]);
+        return (bool)$status;
     }
 
     /**
@@ -111,7 +151,8 @@ class TournamentModel
     public static function getFightersTeams(array $fighters_list)
     {
         $db = new Db();
-        return array_chunk($db::getRows('select id from users where battle = 0 and id in (?)', [implode(', ', $fighters_list)]), 2);
+        $query = sprintf("select id from users where battle = 0 and id in (%s)", implode(', ', $fighters_list));
+        return array_chunk($db::getColumn($query), 2);
     }
 
     /**
@@ -124,7 +165,7 @@ class TournamentModel
     public static function getFreeFighters($tid)
     {
         $db = new Db();
-        return $db::getRows('select uid from tournaments_users where tid = ? and death_time = 0 order by rand()', [$tid]);
+        return $db::getColumn('select uid from tournaments_users where tid = ? and death_time = 0 order by rand()', [$tid]);
     }
 
     /**
@@ -137,14 +178,12 @@ class TournamentModel
     public static function getWinners($tid)
     {
         $db = new Db();
-        $arr = [];
-        array_unshift($arr, '');
-        unset($arr[0]);
-        $winners = $db::getRows('select uid from tournaments_users where tid = ? order by death_time desc limit 3', [$tid]);
-        foreach ($winners as $winner) {
-            $arr[] = $winner['uid'];
-        }
-        return $arr;
+        $winners = $db::getColumn('select uid from tournaments_users where tid = ? order by death_time desc limit 3', [$tid]);
+        return [
+            1 => $winners[0],
+            2 => $winners[1],
+            3 => $winners[2]
+        ];
     }
 
     /**
@@ -166,10 +205,10 @@ class TournamentModel
                  limit 1) as last_battle 
             where 
                 battle_users.battle = last_battle.id and 
-                battle_users.team != last_battle.team_win';
+                battle_users.team != last_battle.team_win and
+                battle_users.uid in (select uid from tournaments_users where death_time = 0)';
         $db = new Db;
         $row = $db::getRow($query);
-        $db::sql('delete from battle where id = ?', [$row['battle']]);
         return $row['uid'];
     }
 
@@ -182,10 +221,13 @@ class TournamentModel
      */
     public static function removeFighter($uid)
     {
+        if (!$uid) return;
         $db = new Db();
-        $db::sql('update tournaments_users set death_time = unix_timestamp() where uid = ?', [$uid]);
+        $db::sql('update tournaments_users set death_time = unix_timestamp() where death_time = 0 and uid = ?', [$uid]);
         self::teleport($uid, 9);
-        (new Achievements(user::start()))->updateCounter('trn');
+        //fixme: Классы не подключаются друг к другу. Нужно менять архитектуру игры. :(
+        Db::sql("update users_achiv set trn = trn + 1 where id = ?", [$uid]);
+        //(new Achievements(\user::start()))->updateCounter('trn');
     }
 
     /**
@@ -252,15 +294,17 @@ class TournamentModel
     /**
      * Нет проверок $message потому что оно всегда задаётся в коде и игрок на него не влияет.
      *
-     * @param string $city
      * @param string $message
      *
      * @return void
      */
-    public static function sysMessage($message, $city = 'capitalcity')
+    public static function sysMessage($message)
     {
+        if (!empty($message)) {
         $db = new Db();
-        $db::sql('insert into chat (city, room, time, type, text, new, da) values (?, 0, unix_timestamp(), 6, ?, 1, 1)', [$city, $message]);
+            $message = "<span style='font-weight: bold; color: forestgreen;'>$message</span>";
+            $db::sql('insert into chat (time, type, text, new, da) values (unix_timestamp(), 6, ?, 1, 1)', [$message]);
+        }
     }
 
     /**
@@ -285,4 +329,18 @@ class TournamentModel
             $stmt->execute($args);
         }
     }
+
+    /** Эффект-ограничитель на участие в турнире.
+     * @param $uid
+     * @param $unix_time
+     *
+     * @return void
+     */
+    public static function giveDelay($uid, $unix_time)
+    {
+        $db = new Db();
+        $query = 'insert into eff_users (id_eff, uid, name, timeUse) VALUES (?,?,?,?)';
+        $args = [486, $uid, 'Призёр городского турнира!', $unix_time];
+        $db::sql($query, $args);
+    }
 }
\ No newline at end of file
diff --git a/inf.php b/inf.php
index 03a08e8e..b0f502ea 100644
--- a/inf.php
+++ b/inf.php
@@ -1350,7 +1350,7 @@ $kp = array(
 						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers3.gif" onMouseOver="top.hi(this,\'<b>Начинающий Помощник Администрации</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 				 }
-				 $ai = (new Achievements($u))->getInfo(); //Титулы $ico[3]
+				 $ai = (new \Insallah\Achievements($u))->getInfo(); //Титулы $ico[3]
 	
 				 if(isset($ai['id']) && $inf['banned']==0 && ($ai['zb']>0 || $ai['vx']>0 || $ai['snt']>0 || $ai['rp']>0 || $ai['rn']>0 || $ai['rb']>0 || $ai['pg']>0 || $ai['bv']>0 || $ai['kw']>0 || $ai['pa']>0))
 					{
-- 
2.45.2


From 25d939274c913abf00c60c543fc2c6be4f6ab633 Mon Sep 17 00:00:00 2001
From: Ivor Barhansky <me@lopar.space>
Date: Fri, 1 Jul 2022 15:37:52 +0300
Subject: [PATCH 12/12] =?UTF-8?q?=D0=A1=D0=B8=D1=85=D1=80=D0=BE=D0=BD?=
 =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=20=D0=B0=D0=BA?=
 =?UTF-8?q?=D1=82=D1=83=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=B2=D0=B5?=
 =?UTF-8?q?=D1=80=D1=81=D0=B8=D0=B5=D0=B9.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 _incl_data/__config.php                       |   15 +-
 _incl_data/class/Achievements.php             |  240 -
 _incl_data/class/Insallah/Achievements.php    |  264 +
 _incl_data/class/Insallah/Core/Math.php       |    3 +-
 .../class/Insallah/Tournament/Tournament.php  |   21 +-
 .../Insallah/Tournament/TournamentModel.php   |   69 +-
 _incl_data/class/__reg0.php                   |  338 -
 _incl_data/class/__zv.php                     | 6636 ++++++++---------
 cron_killusers.php                            |   25 -
 inf.php                                       |  792 +-
 items_info.php                                |    8 +-
 jx/battle/refresh2.php                        |    4 -
 modules_data/location/__magic.php             | 2306 ------
 modules_data/location/__zv.php                | 2352 +++---
 modules_data/location/ab/hram.php             |  267 +-
 modules_data/location/an/bank.php             |  368 +-
 modules_data/location/bank.php                |  410 +-
 modules_data/location/bk.php.bac              |    4 +-
 modules_data/location/btl_.php                |    2 +-
 modules_data/location/remont.php              |  353 +-
 modules_data/location/tournaments_lobby.php   |   31 +-
 modules_data/titul.php                        |    1 +
 tournament_test.php                           |   42 -
 23 files changed, 5702 insertions(+), 8849 deletions(-)
 delete mode 100644 _incl_data/class/Achievements.php
 create mode 100644 _incl_data/class/Insallah/Achievements.php
 delete mode 100644 _incl_data/class/__reg0.php
 delete mode 100644 modules_data/location/__magic.php
 delete mode 100644 tournament_test.php

diff --git a/_incl_data/__config.php b/_incl_data/__config.php
index d24cebb9..ecc7f242 100644
--- a/_incl_data/__config.php
+++ b/_incl_data/__config.php
@@ -45,7 +45,7 @@ $c['zuby'] = false; //
 $c['limitedexp'] = false; //����� �����
 $c['infinity5level'] = false; //������ 5 ������
 $c['expstop'] = 2999999; //9; //���� �� ������� ��������������� 11 149999999
-$c['expstopu'] = 499999999; //���� �� ������� ���������������
+$c['expstopu'] = 2999999; //���� �� ������� ���������������
 $c['noobgade'] = false; //��� ����� (������)
 $c['bonusonline'] = true; //����� �� ������
 $c['bonusonline_kof'] = 1; //��������� �� �� ���
@@ -92,6 +92,8 @@ $c['w'] = date('w');
 $c['m'] = date('m');
 
 $code = '1';
+$c['counters'] = '';
+$c['counters_noFrm'] = '';
 $c['securetime'] = 0; //����� ���������� ���������� ������ ������ (������ ������ �� ����� ������ ������ ���)
 
 $c['copyright'] = 'Copyright � ' . date('Y') . ' � ����� ���������� ���� �';
@@ -100,9 +102,8 @@ if (isset($_GET['version'])) {
     die('Version: ' . $c['ver']);
 }
 
-/** �������. ����� ������������. */
-require_once 'class/Insallah/Core/Db.php';
-require_once 'class/Insallah/Tournament/Tournament.php';
-require_once 'class/Insallah/Tournament/TournamentModel.php';
-(new \Insallah\Tournament())->kick_user(\Insallah\TournamentModel::getLooser());
-/** * */
\ No newline at end of file
+// ��� ���� ���������, ���� ��� ������������ �������.
+require_once 'class/Insallah/Config.php';
+
+//������ ����� ��� �������.
+if (\Insallah\Tournament::IS_ENABLED) (new \Insallah\Tournament())->startAllBattles();
\ No newline at end of file
diff --git a/_incl_data/class/Achievements.php b/_incl_data/class/Achievements.php
deleted file mode 100644
index b77335e6..00000000
--- a/_incl_data/class/Achievements.php
+++ /dev/null
@@ -1,240 +0,0 @@
-<?php
-
-use Insallah\Db;
-use Insallah\Math;
-use Insallah\Table;
-
-class Achievements
-{
-    private $user;
-    private $info;
-    private $data = [
-        'zb' => [
-            'questname' => 'Ежедн.Задания',
-            'quest' => 'Выполнить задания бабки.',
-            'check' => ['Заданий', 5, 25, 50, 100, 250],
-            'prize' => ['Жетон <br>успеха <br>', 5, 20, 40, 60, 100],
-            'startlink' => 11
-        ],
-        'vx' => [
-            'questname' => 'Хаотические бои',
-            'quest' => 'Победить в хаотических боях.',
-            'check' => ['Побед', 50, 300, 400, 500, 1000],
-            'prize' => ['екр.', 25, 50, 75, 100, 200],
-            'startlink' => 21
-        ],
-        'snt' => [
-            'questname' => 'Сундук трупожора',
-            'quest' => 'Открыть сундук трупожора.',
-            'check' => ['Открытий', 5, 25, 50, 100, 250],
-            'prize' => ['екр.', 10, 25, 50, 75, 200],
-            'startlink' => 31
-        ],
-        'rp' => [
-            'questname' => 'Руны 8 лвл.',
-            'quest' => 'Получить руну при плавке плохих заготовок. [S]',
-            'check' => ['Рун', 5, 10, 25, 50, 100],
-            'prize' => ['Плохие <br> заготовки <br>', 5, 7, 10, 12, 15],
-            'startlink' => 41
-        ],
-        'rn' => [
-            'questname' => 'Руны 9 лвл.',
-            'quest' => 'Получить руну при плавке нормальных заготовок. [M]',
-            'check' => ['Рун', 5, 10, 15, 25, 50],
-            'prize' => ['Нормальные <br> заготовки <br>', 5, 7, 9, 12, 15],
-            'startlink' => 51
-        ],
-        'rb' => [
-            'questname' => 'Руны 10 лвл.',
-            'quest' => 'Получить руну при плавке идеальных заготовок. [L]',
-            'check' => ['Рун', 2, 5, 8, 11, 15],
-            'prize' => ['Идеальные <br> заготовки <br>', 2, 4, 6, 10, 15],
-            'startlink' => 61
-        ],
-        'pg' => [
-            'questname' => 'Героич. Сражения',
-            'quest' => 'Поучаствовать в героическом сражении.',
-            'check' => ['Участий', 100, 200, 400, 600, 1000],
-            'prize' => ['Жетон <br>успеха <br>', 10, 20, 40, 60, 80],
-            'startlink' => 71
-        ],
-        'bv' => [
-            'questname' => 'Продажи Бабушке',
-            'quest' => 'Продать бабушке найденные вещи в пещере.',
-            'check' => ['Продаж', 5, 25, 50, 100, 250],
-            'prize' => ['кр.', 500, 1000, 2000, 4000, 5000],
-            'startlink' => 81
-        ],
-        'kw' => [
-            'questname' => 'Клан Поединки',
-            'quest' => 'Победить в клановой войне.',
-            'check' => ['Побед', 5, 10, 15, 20, 25],
-            'prize' => ['Свиток <br> кланового<br> опыта ', 1, 2, 5, 10, 15],
-            'startlink' => 91
-        ],
-        'pa' => [ # not implemented!
-            'questname' => 'Покровительство',
-            'quest' => 'Получить покровительство Ангела.',
-            'check' => ['Получено', 5, 25, 50, 100, 250],
-            'prize' => null,
-            'startlink' => null
-        ],
-        'bs' => [
-            'questname' => 'Башня смерти',
-            'quest' => 'Победы в башне смерти.',
-            'check' => ['Побед', 1, 5, 10, 50, 500],
-            'prize' => ['екр.', 1, 5, 10, 50, 200],
-            'startlink' => 101
-        ],
-        'trn' => [ # not implemented!
-            'questname' => null,
-            'quest' => 'Победы в турнирах.',
-            'check' => ['Побед', 25, 50, 100, 200, 500],
-            'prize' => ['екр.', 25, 25, 25, 25, 50],
-            'startlink' => 111
-        ],
-    ];
-
-    public function __construct(user $user)
-    {
-        $this->user = $user;
-        $this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]);
-    }
-
-    private function prizeName($int, $string)
-    {
-        return in_array($string, ['екр.', 'кр.']) ? $int . ' ' . $string : $string . ' ' . $int;
-    }
-
-    private function drawSunduk($nagr, $whatInside, $tier)
-    {
-        return vsprintf('<img onclick="%s" onmouseover="%s" onmouseout="%s" onmousedown="%s" class="cp" src="%s" alt="Сундук">',
-            [
-                "location.href='\main.php?titul&nagr=$nagr'",
-                "top.hi(this, '<b>Сундук $tier ранга<hr>Содержит:<hr> $whatInside</b>', event, 2, 0, 1, 1, 'max-width:307px')",
-                "top.hic();",
-                "top.hic();",
-                "https://img.new-combats.com/i/titul/nagr$tier.gif"
-            ]);
-    }
-
-    public function getList()
-    {
-        $string = '';
-        $this->calculateCurrent(1);
-
-        foreach ($this->data as $key => $value) {
-            //Бля, какую херню приходится городить!
-            //Первое число = требование следующего тира минус требование текущего тира (надо набрать)
-            //Второе число = количество достижений минус требование текущего тира (набрал)
-            //Требования текущего тира отнимаются чтобы каждый тир начинал считать процент с 0.
-            //Пизды дать тому, кто так уебански называет переменные, что нужно полдня въезжать что происходит.
-            //И хер поменяешь - всё сломается. FFUUUUUUUUUUUUUU!!! Ins.
-            $percentToSuccess = Math::get100Percentage(
-                $value['check'][$this->info['klas' . $key] + 1] - $value['check'][$this->info['klas' . $key]],
-                $this->info[$key] - $value['check'][$this->info['klas' . $key]]
-            );
-            //klas$name динамически рассчитыватся исходя из $name в базе
-            $string .= '<h4>' . empty($value['questname']) ? $value['quest'] : $value['questname'] . '</h4>';
-            $string .= '<strong>' . $value['quest'] . '</strong><br>';
-            $string .= 'Текущий Ранг: <strong>' . $this->info['klas' . $key] . '</strong> ';
-            $string .= 'Количество ' . mb_strtolower($value['check'][0]) . ': <strong>' . $this->info[$key] . ' =' . $percentToSuccess . '%</strong>';
-
-            $string .= Table::get([
-                ['Ранги', 1, 2, 3, 4, 5],
-                $value['check'],
-                [
-                    'Награда',
-                    $this->prizeName($value['prize'][1], $value['prize'][0]),
-                    $this->prizeName($value['prize'][2], $value['prize'][0]),
-                    $this->prizeName($value['prize'][3], $value['prize'][0]),
-                    $this->prizeName($value['prize'][4], $value['prize'][0]),
-                    $this->prizeName($value['prize'][5], $value['prize'][0])
-                ]
-            ], 'prizelist', true);
-            # If has new tier, AND only first 5 tiers AND prize is set.
-            if (
-                $this->info['klas' . $key] > $this->info[$key . '_n'] &&
-                in_array($this->info[$key . '_n'], [0, 1, 2, 3, 4]) &&
-                !empty($value['prize']) &&
-                !empty($value['startlink'])
-            ) {
-                $string .= '<br>Награда:<br>';
-                $string .= $this->drawSunduk(
-                    $this->info[$key . '_n'] + $value['startlink'],
-                    $this->prizeName($value['prize'][$this->info[$key . '_n'] + 1], $value['prize'][0]),
-                    $this->info[$key . '_n'] + 1
-                );
-            }
-            $string .= '<hr>';
-        }
-        return $string;
-    }
-
-    private function calculateCurrent($check = null)
-    {
-        $this->info['bs'] = $this->user->info['win_bs'];
-        foreach ($this->info as $k => $v) {
-            if (empty($this->info[$k]) && is_null($check)) {
-                continue;
-            }
-            $this->info["klas$k"] = 0;
-            for ($i = 1; $i <= 5; $i++) {
-                if ($this->info[$k] >= $this->data[$k]['check'][$i]) {
-                    $this->info["klas$k"] = $i;
-                }
-            }
-        }
-    }
-
-    public function getInfo()
-    {
-        $this->calculateCurrent();
-        return $this->info;
-    }
-
-    public function getCheckedInfo()
-    {
-        $this->calculateCurrent(1);
-        return $this->info;
-    }
-
-    private function addOne($name)
-    {
-        Db::sql("update users_achiv set $name = $name + 1 where id = ?", [$this->user->info['id']]);
-    }
-
-    public function updateTier($name)
-    {
-        if (in_array($name, array_keys($this->data))) {
-            $this->addOne($name . '_n');
-        }
-    }
-
-    public function updateCounter($name)
-    {
-        if (in_array($name, array_keys($this->data))) {
-            $this->addOne($name);
-        }
-    }
-
-    /**
-     * @return array[]
-     */
-    public function getData()
-    {
-        return $this->data;
-    }
-
-    public function hasNoTier4Access($nagr)
-    {
-        return $this->user->info['level'] < 9 && in_array($nagr, [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]);
-    }
-
-    public function givePrizeItems($itemId, $aType)
-    {
-        for ($i = 1; $i <= $this->data[$aType]['prize'][$this->info[$aType . '_n'] + 1]; $i++) {
-            $this->user->addItem($itemId, $this->user->info['id']);
-        }
-    }
-}
\ No newline at end of file
diff --git a/_incl_data/class/Insallah/Achievements.php b/_incl_data/class/Insallah/Achievements.php
new file mode 100644
index 00000000..9fdbd3eb
--- /dev/null
+++ b/_incl_data/class/Insallah/Achievements.php
@@ -0,0 +1,264 @@
+<?php
+
+namespace Insallah;
+
+class Achievements
+{
+    private $user;
+    private $info;
+    private $data = [
+        'zb' => [
+            'questname' => '�����.�������',
+            'quest' => '��������� ������� �����.',
+            'check' => ['�������', 5, 25, 50, 100, 250],
+            'prize' => ['����� <br>������ <br>', 5, 20, 40, 60, 100],
+            'startlink' => 11
+        ],
+        'vx' => [
+            'questname' => '����������� ���',
+            'quest' => '�������� � ����������� ����.',
+            'check' => ['�����', 50, 300, 400, 500, 1000],
+            'prize' => ['���.', 25, 50, 75, 100, 200],
+            'startlink' => 21
+        ],
+        'snt' => [
+            'questname' => '������ ���������',
+            'quest' => '������� ������ ���������.',
+            'check' => ['��������', 5, 25, 50, 100, 250],
+            'prize' => ['���.', 10, 25, 50, 75, 200],
+            'startlink' => 31
+        ],
+        'rp' => [
+            'questname' => '���� 8 ���.',
+            'quest' => '�������� ���� ��� ������ ������ ���������. [S]',
+            'check' => ['���', 5, 10, 25, 50, 100],
+            'prize' => ['������ <br> ��������� <br>', 5, 7, 10, 12, 15],
+            'startlink' => 41
+        ],
+        'rn' => [
+            'questname' => '���� 9 ���.',
+            'quest' => '�������� ���� ��� ������ ���������� ���������. [M]',
+            'check' => ['���', 5, 10, 15, 25, 50],
+            'prize' => ['���������� <br> ��������� <br>', 5, 7, 9, 12, 15],
+            'startlink' => 51
+        ],
+        'rb' => [
+            'questname' => '���� 10 ���.',
+            'quest' => '�������� ���� ��� ������ ��������� ���������. [L]',
+            'check' => ['���', 2, 5, 8, 11, 15],
+            'prize' => ['��������� <br> ��������� <br>', 2, 4, 6, 10, 15],
+            'startlink' => 61
+        ],
+        'pg' => [
+            'questname' => '������. ��������',
+            'quest' => '������������� � ����������� ��������.',
+            'check' => ['�������', 100, 200, 400, 600, 1000],
+            'prize' => ['����� <br>������ <br>', 10, 20, 40, 60, 80],
+            'startlink' => 71
+        ],
+        'bv' => [
+            'questname' => '������� �������',
+            'quest' => '������� ������� ��������� ���� � ������.',
+            'check' => ['������', 5, 25, 50, 100, 250],
+            'prize' => ['��.', 500, 1000, 2000, 4000, 5000],
+            'startlink' => 81
+        ],
+        'kw' => [
+            'questname' => '���� ��������',
+            'quest' => '�������� � �������� �����.',
+            'check' => ['�����', 5, 10, 15, 20, 25],
+            'prize' => ['������ <br> ���������<br> ����� ', 1, 2, 5, 10, 15],
+            'startlink' => 91
+        ],
+        'pa' => [ # not implemented!
+            'questname' => '���������������',
+            'quest' => '�������� ��������������� ������.',
+            'check' => ['��������', 5, 25, 50, 100, 250],
+            'prize' => null,
+            'startlink' => null
+        ],
+        'bs' => [
+            'questname' => '����� ������',
+            'quest' => '������ � ����� ������.',
+            'check' => ['�����', 1, 5, 10, 50, 500],
+            'prize' => ['���.', 1, 5, 10, 50, 200],
+            'startlink' => 101
+        ],
+        'trn' => [ # not implemented!
+            'questname' => '�������',
+            'quest' => '�������������� � ��������.',
+            'check' => ['�����', 25, 50, 100, 200, 500],
+            'prize' => ['���.', 25, 25, 25, 25, 50],
+            'startlink' => 111
+        ],
+    ];
+
+    public function __construct(\user $user)
+    {
+        $this->user = $user;
+        $this->info = Db::getRow('select * from users_achiv where id = ?', [$user->info['id']]);
+    }
+
+    private function prizeName($int, $string)
+    {
+        return in_array($string, ['���.', '��.']) ? $int . ' ' . $string : $string . ' ' . $int;
+    }
+
+    private function drawSunduk($nagr, $whatInside, $tier)
+    {
+        return vsprintf('<img onclick="%s" onmouseover="%s" onmouseout="%s" onmousedown="%s" class="cp" src="%s" alt="������">',
+            [
+                "location.href='\main.php?titul&nagr=$nagr'",
+                "top.hi(this, '<b>������ $tier �����<hr>��������:<hr> $whatInside</b>', event, 2, 0, 1, 1, 'max-width:307px')",
+                "top.hic();",
+                "top.hic();",
+                "https://img.new-combats.com/i/titul/nagr$tier.gif"
+            ]);
+    }
+
+    public function getList()
+    {
+        $string = '';
+        $this->calculateCurrent(1);
+
+        foreach ($this->data as $key => $value) {
+            //���, ����� ����� ���������� ��������!
+            //������ ����� = ���������� ���������� ���� ����� ���������� �������� ���� (���� �������)
+            //������ ����� = ���������� ���������� ����� ���������� �������� ���� (������)
+            //���������� �������� ���� ���������� ����� ������ ��� ������� ������� ������� � 0.
+            //����� ���� ����, ��� ��� �������� �������� ����������, ��� ����� ������ �������� ��� ����������.
+            //� ��� ��������� - �� ���������. FFUUUUUUUUUUUUUU!!! Ins.
+            $percentToSuccess = Math::get100Percentage(
+                $value['check'][$this->info['klas' . $key] + 1] - $value['check'][$this->info['klas' . $key]],
+                $this->info[$key] - $value['check'][$this->info['klas' . $key]]
+            );
+            $questname = empty($value['questname']) ? $value['quest'] : $value['questname'];
+            $string .= '<h4>' . $questname . '</h4>';
+            $string .= '<strong>' . $value['quest'] . '</strong><br>';
+            $string .= '������� ����: <strong>' . $this->info['klas' . $key] . '</strong> ';
+            $string .= '���������� ' . mb_strtolower($value['check'][0]) . ': <strong>' . $this->info[$key] . ' =' . $percentToSuccess . '%</strong>';
+
+            $string .= Table::get([
+                ['�����', 1, 2, 3, 4, 5],
+                $value['check'],
+                [
+                    '�������',
+                    $this->prizeName($value['prize'][1], $value['prize'][0]),
+                    $this->prizeName($value['prize'][2], $value['prize'][0]),
+                    $this->prizeName($value['prize'][3], $value['prize'][0]),
+                    $this->prizeName($value['prize'][4], $value['prize'][0]),
+                    $this->prizeName($value['prize'][5], $value['prize'][0])
+                ]
+            ], 'prizelist', true);
+            # If has new tier, AND only first 5 tiers AND prize is set.
+            if (
+                $this->info['klas' . $key] > $this->info[$key . '_n'] &&
+                in_array($this->info[$key . '_n'], [0, 1, 2, 3, 4]) &&
+                !empty($value['prize']) &&
+                !empty($value['startlink'])
+            ) {
+                $string .= '<br>�������:<br>';
+                $string .= $this->drawSunduk(
+                    $this->info[$key . '_n'] + $value['startlink'],
+                    $this->prizeName($value['prize'][$this->info[$key . '_n'] + 1], $value['prize'][0]),
+                    $this->info[$key . '_n'] + 1
+                );
+            }
+            $string .= '<hr>';
+        }
+        return $string;
+    }
+
+    private function calculateCurrent($check = null)
+    {
+        $this->info['bs'] = $this->user->info['win_bs'];
+        foreach ($this->info as $k => $v) {
+            if (
+                empty($this->info[$k]) &&
+                is_null($check) ||
+                $k === 'id' ||
+                !in_array($k, array_keys($this->data))
+            ) {
+                continue;
+            }
+
+            $this->info["klas$k"] = 0;
+            $this->info["name$k"] = $this->data[$k]['questname'];
+            $this->info["klasP$k"] = Math::get100Percentage($this->data[$k]['check'][1], $this->info[$k]);
+
+            for ($i = 1; $i <= 5; $i++) {
+                if ($this->info[$k] >= $this->data[$k]['check'][$i]) {
+                    $this->info["klas$k"] = $i;
+                    if ($i === 5) {
+                        # �� 5 ����� ������ �������� ��������.
+                        $this->info["klasP$k"] = 100;
+                    } else {
+                        $this->info["klasP$k"] = Math::get100Percentage(
+                            $this->data[$k]['check'][$i + 1] - $this->data[$k]['check'][$i],
+                            $this->info[$k] - $this->data[$k]['check'][$i]
+                        );
+                    }
+                }
+            }
+        }
+    }
+
+    public function getInfo($user_id = null)
+    {
+        if (!is_null($user_id)) {
+            $this->info = Db::getRow('select * from users_achiv where id = ?', [$user_id]);
+        }
+        $this->calculateCurrent();
+        return $this->info;
+    }
+
+    public function getCheckedInfo()
+    {
+        $this->calculateCurrent(1);
+        return $this->info;
+    }
+
+    private function addOne($name)
+    {
+        Db::sql("update users_achiv set $name = $name + 1 where id = ?", [$this->user->info['id']]);
+    }
+
+    public function updateTier($name)
+    {
+        if (in_array($name, array_keys($this->data))) {
+            $this->addOne($name . '_n');
+        }
+    }
+
+    public function updateCounter($name)
+    {
+        if (in_array($name, array_keys($this->data))) {
+            $this->addOne($name);
+        }
+    }
+
+    /**
+     * @return array[]
+     */
+    public function getData()
+    {
+        return $this->data;
+    }
+
+    public function hasNoTier4Access($nagr)
+    {
+        return $this->user->info['level'] < 9 && in_array($nagr, [14, 15, 24, 25, 34, 35, 44, 45, 54, 55, 64, 65, 74, 75, 84, 85, 94, 95, 104, 105]);
+    }
+
+    public function givePrizeItems($itemId, $aType)
+    {
+        for ($i = 1; $i <= $this->data[$aType]['prize'][$this->info[$aType . '_n'] + 1]; $i++) {
+            $this->user->addItem($itemId, $this->user->info['id']);
+        }
+    }
+
+    public function getTypes()
+    {
+        return array_keys($this->data);
+    }
+}
\ No newline at end of file
diff --git a/_incl_data/class/Insallah/Core/Math.php b/_incl_data/class/Insallah/Core/Math.php
index 83a50b3c..790d8573 100644
--- a/_incl_data/class/Insallah/Core/Math.php
+++ b/_incl_data/class/Insallah/Core/Math.php
@@ -10,6 +10,7 @@ class Math
         return $total > 0 ? round(($number * 100) / $total, 2) : 0;
     }
 
+
     public static function get100Percentage($total, $number)
     {
         return min(self::getPercentage($total, $number), 100);
@@ -20,7 +21,7 @@ class Math
     {
         return [
             'min' => $number * ((100 - 20) / 100),
-            'max' => $number * ((100 - 20) / 100)
+            'max' => $number * ((100 + 20) / 100)
         ];
     }
 }
\ No newline at end of file
diff --git a/_incl_data/class/Insallah/Tournament/Tournament.php b/_incl_data/class/Insallah/Tournament/Tournament.php
index f22c9926..c9a6147a 100644
--- a/_incl_data/class/Insallah/Tournament/Tournament.php
+++ b/_incl_data/class/Insallah/Tournament/Tournament.php
@@ -6,18 +6,18 @@ class Tournament
 {
     const IS_ENABLED = true;
     const SEND_CHAT_MESSAGE = 3;
-    const START_TOURNAMENT = 6;
+    const START_TOURNAMENT = 5;
     const PRIZE1 = 25;
     const PRIZE2 = 10;
     const PRIZE3 = 5;
     const MIN_EXP = 175000;
-    const CHAT_MESSAGE = 'Внимание! Турнир для %d уровня открыт! Поспешите принять участие в Зале Воинов!';
-    const VICTORY_MESSAGE = 'Турнир для %d уровней завершён! Первое место: %s. Второе место: %s. Третье место: %s.';
+    const CHAT_MESSAGE = '��������! ������ ��� %d ������ ������! ��������� ������� ������� � ���� ������!';
+    const VICTORY_MESSAGE = '������ ��� %d ������� ��������! ������ �����: %s. ������ �����: %s. ������ �����: %s.';
     const DELAY1 = '+12hour';
     const DELAY2 = '+6hour';
     const DELAY3 = '+3hour';
 
-    /** Формула рассчёта разрешённой стоимости одетых предметов.
+    /** ������� �������� ����������� ��������� ������ ���������.
      *
      * @param int $int
      *
@@ -29,7 +29,7 @@ class Tournament
     }
 
     /**
-     * Проверяем может ли игрок учавствовать в турнире и либо присоединяем его, либо обламываем.
+     * ��������� ����� �� ����� ������������ � ������� � ���� ������������ ���, ���� ����������.
      *
      * @param int $user_id
      *
@@ -37,7 +37,7 @@ class Tournament
      */
     public function join($user_id)
     {
-        /** Возвращает level, или 0 если провалены проверки. */
+        /** ���������� level, ��� 0 ���� ��������� ��������. */
         $userLevel = TournamentModel::getUserLevel($user_id);
         if (
             $userLevel === 0 ||
@@ -67,7 +67,7 @@ class Tournament
     }
 
     /**
-     * Проверка для крона\конфига. Выбивает проигравших и перезапускает поединки во всех турнирах.
+     * �������� ��� �����\�������. �������� ����������� � ������������� �������� �� ���� ��������.
      * @return void
      */
     public function startAllBattles()
@@ -79,16 +79,17 @@ class Tournament
         foreach ($tournament_levels as $level) {
             $alive_fighters = TournamentModel::getFreeFighters($level);
             if (count($alive_fighters) > 1) {
+                shuffle($alive_fighters);
                 $this->start_battle($alive_fighters);
             } elseif (count($alive_fighters) === 1) {
-                TournamentModel::removeFighter($alive_fighters[0]);
+                TournamentModel::removeFighter($alive_fighters[0], true);
                 $this->victory($level);
             }
         }
     }
 
     /**
-     * Получаем пары бойцов и начинаем их поединки.
+     * �������� ���� ������ � �������� �� ��������.
      *
      * @param array $fighters_list
      *
@@ -105,7 +106,7 @@ class Tournament
     }
 
     /**
-     * Награждаем победителей турнира, чистим базу.
+     * ���������� ����������� �������, ������ ����.
      *
      * @param int $tournament_id
      *
diff --git a/_incl_data/class/Insallah/Tournament/TournamentModel.php b/_incl_data/class/Insallah/Tournament/TournamentModel.php
index 5f31d6d7..3a3b90a6 100644
--- a/_incl_data/class/Insallah/Tournament/TournamentModel.php
+++ b/_incl_data/class/Insallah/Tournament/TournamentModel.php
@@ -6,8 +6,8 @@ class TournamentModel
 {
 
     /**
-     * проверка уровня, стоимости эквипа, прочие проверки, что персонаж свободен
-     * таймер ожидания 30 минут
+     * �������� ������, ��������� ������, ������ ��������, ��� �������� ��������
+     * ������ �������� 30 �����
      *
      * @param int $uid
      *
@@ -17,7 +17,7 @@ class TournamentModel
     {
         $db = new Db();
         $level = $db::getValue('select level from users where id = ? and level between 8 and 12 and battle = 0', [$uid]);
-        return $level ? $level : 0;
+        return $level ?: 0;
     }
 
     /**
@@ -72,7 +72,7 @@ class TournamentModel
     }
 
     /**
-     * Считаем сколько игроков ждут в заявке на турнир.
+     * ������� ������� ������� ���� � ������ �� ������.
      *
      * @param int $tid
      *
@@ -85,7 +85,7 @@ class TournamentModel
     }
 
     /**
-     * Создание нового турнира.
+     * �������� ������ �������.
      *
      * @param int $tid
      *
@@ -98,7 +98,7 @@ class TournamentModel
     }
 
     /**
-     * Игрок присоединяется к турниру и телепортируется в турнирную комнату.
+     * ����� �������������� � ������� � ��������������� � ��������� �������.
      *
      * @param int $uid
      * @param int $tid
@@ -107,7 +107,7 @@ class TournamentModel
      */
     public static function joinTournament($uid, $tid)
     {
-        /** Кастомные комнаты 25008 - 25012. */
+        /** ��������� ������� 25008 - 25012. */
         $room_id = 25000 + $tid;
         $db = new Db();
         $db::sql('insert into tournaments_users (tid, uid) values (?, ?)', [$tid, $uid]);
@@ -115,7 +115,7 @@ class TournamentModel
     }
 
     /**
-     * Старт турнира.
+     * ����� �������.
      *
      * @param int $tid
      *
@@ -128,7 +128,7 @@ class TournamentModel
     }
 
     /**
-     * Чистим базы от прошедшего турнира.
+     * ������ ���� �� ���������� �������.
      *
      * @param int $tid
      *
@@ -137,12 +137,12 @@ class TournamentModel
     public static function destroyTournament($tid)
     {
         $db = new Db();
-        //Убедиться что в базе настроен foreign_keys и последует автоочистка tournaments_users !!!
+        //��������� ��� � ���� �������� foreign_keys � ��������� ����������� tournaments_users !!!
         $db::sql('delete from tournaments where tid = ?', [$tid]);
     }
 
     /**
-     * Получаем список бойцов и бьём их на пары. Возвращаем списки пар + 1 последний без пары если есть.
+     * �������� ������ ������ � ���� �� �� ����. ���������� ������ ��� + 1 ��������� ��� ���� ���� ����.
      *
      * @param array $fighters_list
      *
@@ -156,7 +156,7 @@ class TournamentModel
     }
 
     /**
-     * Выбираем живых бойцов не сражающихся в данный момент.
+     * �������� ����� ������ �� ����������� � ������ ������.
      *
      * @param int $tid
      *
@@ -165,11 +165,11 @@ class TournamentModel
     public static function getFreeFighters($tid)
     {
         $db = new Db();
-        return $db::getColumn('select uid from tournaments_users where tid = ? and death_time = 0 order by rand()', [$tid]);
+        return $db::getColumn('select uid from tournaments_users where tid = ? and death_time = 0 order by uid', [$tid]);
     }
 
     /**
-     * Выбираем победителей. Смещаем массив, чтобы возврат шёл с единицы.
+     * �������� �����������. ������� ������, ����� ������� ��� � �������.
      *
      * @param int $tid
      *
@@ -187,7 +187,7 @@ class TournamentModel
     }
 
     /**
-     * Пробуем выкусить проигравшего в последней турнирной битве и удалить эту самую битву во избежание.
+     * ������� �������� ������������ � ��������� ��������� ����� � ������� ��� ����� ����� �� ���������.
      * @return mixed
      */
     public static function getLooser()
@@ -213,25 +213,26 @@ class TournamentModel
     }
 
     /**
-     * Выбывший из турнира покидает комнату и получает время смерти.
+     * �������� �� ������� �������� ������� � �������� ����� ������.
      *
      * @param int $uid
      *
      * @return void
      */
-    public static function removeFighter($uid)
+    public static function removeFighter($uid, $winner = false)
     {
         if (!$uid) return;
+        $winner_timer_add = $winner? 500 : 0; # ��������� ������ ���� ���������.
         $db = new Db();
-        $db::sql('update tournaments_users set death_time = unix_timestamp() where death_time = 0 and uid = ?', [$uid]);
+        $db::sql('update tournaments_users set death_time = unix_timestamp() + ? where death_time = 0 and uid = ?', [$winner_timer_add, $uid]);
         self::teleport($uid, 9);
-        //fixme: Классы не подключаются друг к другу. Нужно менять архитектуру игры. :(
+        //fixme: ������ �� ������������ ���� � �����. ����� ������ ����������� ����. :(
         Db::sql("update users_achiv set trn = trn + 1 where id = ?", [$uid]);
         //(new Achievements(\user::start()))->updateCounter('trn');
     }
 
     /**
-     * Узнаём id турнира по id игрока.
+     * ����� id ������� �� id ������.
      *
      * @param int $uid
      *
@@ -244,10 +245,10 @@ class TournamentModel
     }
 
     /**
-     * Попробуем стартонуть поединок.
-     * 25000 - Уникальный id поединка под турниры.
-     * noinc - запрет на вмешательство
-     * invis - невидимый бой
+     * ��������� ���������� ��������.
+     * 25000 - ���������� id �������� ��� �������.
+     * noinc - ������ �� �������������
+     * invis - ��������� ���
      *
      * @param int $uid1
      * @param int $uid2
@@ -257,15 +258,21 @@ class TournamentModel
     public static function startBattle($uid1, $uid2)
     {
         $db = new Db();
+        $check = Db::getValue('select count(*) from users where id in (?, ?) and battle = 0', [$uid1, $uid2]);
+        if ((int)$check !== 2) {
+            return;
+        }
+
         $db::exec('insert into battle (city, time_start, timeout, type, invis, noinc, travmChance, typeBattle) 
         values (\'capitalcity\', unix_timestamp(), 60, 0, 1, 1, 0, 25000)');
+        $bid = $db::lastInsertId(); // �����!
         $db::sql('update stats set team = 1, hpNow = hpAll, mpNow = mpAll where id = ?', [$uid1]);
         $db::sql('update stats set team = 2, hpNow = hpAll, mpNow = mpAll where id = ?', [$uid2]);
-        $db::sql('update users set battle = ? where id in (?, ?)', [$db::lastInsertId(), $uid1, $uid2]);
+        $db::sql('update users set battle = ? where id in (?, ?)', [$bid, $uid1, $uid2]);
     }
 
     /**
-     * Узнаём логин персонажа по его id.
+     * ����� ����� ��������� �� ��� id.
      *
      * @param int $uid
      *
@@ -278,7 +285,7 @@ class TournamentModel
     }
 
     /**
-     * Телепорт по комнатам.
+     * �������� �� ��������.
      *
      * @param int $uid
      * @param int $room_id
@@ -292,7 +299,7 @@ class TournamentModel
     }
 
     /**
-     * Нет проверок $message потому что оно всегда задаётся в коде и игрок на него не влияет.
+     * ��� �������� $message ������ ��� ��� ������ ������� � ���� � ����� �� ���� �� ������.
      *
      * @param string $message
      *
@@ -308,7 +315,7 @@ class TournamentModel
     }
 
     /**
-     * Генерирует множественный запрос сразу на $quantity однотипных предметов в инвентарь пользователя $uid.
+     * ���������� ������������� ������ ����� �� $quantity ���������� ��������� � ��������� ������������ $uid.
      *
      * @param int $uid
      * @param int $quantity
@@ -330,7 +337,7 @@ class TournamentModel
         }
     }
 
-    /** Эффект-ограничитель на участие в турнире.
+    /** ������-������������ �� ������� � �������.
      * @param $uid
      * @param $unix_time
      *
@@ -340,7 +347,7 @@ class TournamentModel
     {
         $db = new Db();
         $query = 'insert into eff_users (id_eff, uid, name, timeUse) VALUES (?,?,?,?)';
-        $args = [486, $uid, 'Призёр городского турнира!', $unix_time];
+        $args = [486, $uid, '����� ���������� �������!', $unix_time];
         $db::sql($query, $args);
     }
 }
\ No newline at end of file
diff --git a/_incl_data/class/__reg0.php b/_incl_data/class/__reg0.php
deleted file mode 100644
index b523ffa8..00000000
--- a/_incl_data/class/__reg0.php
+++ /dev/null
@@ -1,338 +0,0 @@
-<?
-if(!defined('GAME'))
-{
-	die();
-}
-
-class register
-{
-	public function testLogin($v)
-	{
-		
-	}
-	
-	public function en_ru($txt)
-	{
-		$g = false;
-		$en = preg_match("/^(([a-zA-Z _-])+)$/i", $txt);
-		$ru = preg_match("/^(([�-��-� _-])+)$/i", $txt);
-		if(($ru && $en) || (!$ru && !$en))
-		{
-			$g = true;
-		}
-		return $g;
-	}
-	public function testStep()
-	{
-		global $c,$reg,$error,$filter,$chat,$reg_d,$noup,$youip;
-		$stp = 1;
-		if(isset($_POST['step']) && isset($reg['id']))
-		{
-			$upd = '';
-			
-			$lr = mysql_fetch_array(mysql_query('SELECT `id`,`ipreg` FROM `users` WHERE `cityreg`="capitalcity" AND `timereg`>"'.(time()-60*60*1).'" AND `ipreg` = "'.mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']).'" LIMIT 1'));
-			if(isset($_COOKIE['reg_capitalcity']) || (int)$_COOKIE['reg_capitalcity']>time() || isset($lr['id']))
-			{
-				$error .= '������� � ������ IP ��� ��������������� ��������. � ������ IP ������ ��������� ����������� ���������� �� ����, ��� ��� � ���. ���������� �����.<br>'; $_POST['step'] = 1;
-			}
-			
-			if($error=='')
-			{
-				
-				$reg_bonus = false;
-				/*if(isset($_POST['register_code']))
-				{
-					$cd = mysql_fetch_array(mysql_query('SELECT * FROM `register_code` WHERE `code` = "'.mysql_real_escape_string($_POST['register_code']).'" AND `time_finish` = "0" AND `use` = "0" LIMIT 1'));
-					if(isset($cd['id']) && $cd['use']==0)
-					{
-						$reg_bonus = true;
-						$upd = mysql_query('UPDATE `register_code` SET `use` = "'.$reg['id'].'",`time_start`="'.time().'" WHERE `id` = "'.$cd['id'].'" LIMIT 1');
-						if($upd && $reg['id']>0)
-						{
-							$uz = mysql_fetch_array(mysql_query('SELECT `id`,`login` FROM `users` WHERE `id` = "'.mysql_real_escape_string($cd['uid']).'" LIMIT 1'));
-							if(!isset($uz['id']))
-							{
-								$uz['login'] = '<i>���������</i>';
-							}
-							$error .= '�� ������� ������������ ����������� �� '.$uz['login'].'. ������ �� ������ ������������������. ��� ��������� ������ �� ��� �����������.<br>';
-							mysql_query("UPDATE `items_users` SET `data`='info=��� �����������: <b>".$cd['code']."</b><br>��� ����� ����������� ����������� �� ������� ���� ����� ���������.<br><div style=\"color:brown;\">���-�� �������������� �� ������ �����������. ����: ".date('d.n.Y H:i',time())."</div>' WHERE `secret_id` = '".$cd['code']."' LIMIT 1");
-							$cd['use'] = $reg['id'];
-							
-							if($cd['time_create']<time()-60*60)
-							{
-								$error .= '��������������� ��� ���������.<br>';
-								$reg_bonus = false;
-							}
-						}else{
-							$error .= '������ �������������. ���������� �����...';
-						}					
-					}else{
-						$error .= '��������������� ��� ��� ����������� �����, ���� �� ����������.<br>';
-					}
-				}	
-				
-				$cd = mysql_fetch_array(mysql_query('SELECT * FROM `register_code` WHERE `use` = "'.$reg['id'].'" AND `time_finish` = "0" LIMIT 1'));
-				if(!isset($cd['id']))
-				{
-					$reg_bonus = false;
-					$error .= '������� �� ������. (����������� � ��������� ������������)<br>';
-				}else{
-					$reg_bonus = true;
-					$cdi = mysql_fetch_array(mysql_query('SELECT * FROM `items_users` WHERE `secret_id` = "'.$cd['code'].'" AND `delete` = "0" AND `inShop` = "0" LIMIT 1'));
-					if(!isset($cdi['id']))
-					{
-						$reg_bonus = false;
-						$error .= '������� �� ������.';
-					}
-				}	
-				
-				
-				//$reg_bonus = true;
-				
-				//����������� ������� �����������
-				if($reg_bonus==false)
-				{
-					$error .= '<form action="register.php" method="post">����������� ������ �� �����������. ������� ��� �����������:<br><input name="register_code" type="text" style="width:200px;"> <input type="submit" value="������ ���"></form>'; $_POST['step'] = 1;
-				}
-				*/
-			}
-			
-			$reg_bonus = true;
-			
-			if($_POST['step']>1)
-			{
-				//����������� ������
-				$nologin = array(0=>'�����',1=>'angel',2=>'�������������',3=>'administration',4=>'�����������',5=>'�����������',6=>'��������',7=>'���������',8=>'����������',9=>'����������',10=>'�����������',11=>'��������',12=>'���� �����������',13=>'����������',14=>'��������������',15=>'���������',16=>'����������');
-				$blacklist = "!@#$%^&*()\+��|/'`\"";
-				$sr = '_-���������������������������������1234567890';
-				$i = 0;
-				while($i<count($nologin))
-				{
-					if(preg_match("/".$nologin[$i]."/i",$filter->mystr($reg_d[0])))
-					{
-						$error .= '��������, ����������, ������ ���.<br>'; $_POST['step'] = 1; $i = count($nologin);
-					}
-					$i++;
-				}
-				$reg_d[0] = str_replace('  ',' ',$reg_d[0]);
-				//����� �� 4 �� 20 ��������
-				if(strlen($reg_d[0])>20) 
-				{ 
-					$error .= '����� ������ ��������� �� ����� 20 ��������.<br>'; $_POST['step'] = 1;
-				}
-				if(strlen($reg_d[0])<4) 
-				{ 
-					$error .= '����� ������ ��������� �� ����� 4 ��������.<br>'; $_POST['step'] = 1;
-				}
-				//���� �������
-				$er = $this->en_ru($reg_d[0]);
-				if($er==true)
-				{
-					$error .= '� ������ ��������� ������������ ������ ����� ������ �������� �������� ��� �����������. ������ ���������.<br>'; $_POST['step'] = 1;
-				}
-				//����������� �������
-				if(strpos($sr,$reg_d[0]))
-				{
-					$error .= '����� �������� ����������� �������.<br>'; $_POST['step'] = 1;
-				}				
-				//��������� � ����
-				$log = mysql_fetch_array(mysql_query('SELECT `id` from `users` where `login`="'.mysql_real_escape_string($reg_d[0]).'" LIMIT 1'));
-				$log2 = mysql_fetch_array(mysql_query('SELECT `id` from `lastNames` where `login`="'.mysql_real_escape_string($reg_d[0]).'" LIMIT 1'));
-				if(isset($log['id']) || isset($log2['id']))
-				{
-					$error .= '����� '.$reg_d[0].' ��� �����, �������� ������.<br>'; $_POST['step'] = 1;
-				}
-				//�����������
-				if(substr_count($reg_d[0],' ')+substr_count($reg_d[0],'-')+substr_count($reg_d[0],'_')>2)
-				{
-					$error .= '�� ����� ���� ������������ ������������ (������, ����, ������ �������������).<br>'; $_POST['step'] = 1;
-				}
-				$reg_d[0] = trim($reg_d[0],' ');				
-				
-				
-				if($_POST['step']!=1)
-				{
-					$stp = 2; $noup = 0;
-				}
-			}
-			if($_POST['step']>2)
-			{
-				//��������� ������
-				if(strlen($reg_d[1])<6 || strlen($reg_d[1])>30)
-				{
-					$error .= '����� ������ �� ����� ���� ������ 6 �������� ��� ����� 30 ��������.<br>'; $_POST['step'] = 2;
-				}
-				if($reg_d[1]!=$reg_d[2])
-				{
-					$error .= '� ������ ������ ����� ������ ������, ��� ��������. �� ������ ��� �� ��� ����� �������, ������ ������������.<br>'; $_POST['step'] = 2;
-				}
-				if(preg_match('/'.$reg_d[0].'/i',$reg_d[1]))
-				{
-					$error .= '������ �������� �������� ������.<br>'; $_POST['step'] = 2;
-				}
-				if($_POST['step']!=2)
-				{
-					$stp = 3; $noup = 0;
-				}
-			}
-			if($_POST['step']>3)
-			{
-				//��������� e-mail
-				if(strlen($reg_d[3])<6 || strlen($reg_d[3])>50)
-				{
-					$error .= 'E-mail �� ����� ���� ������ 6-� �������� � ������ 50-��.<br>'; $_POST['step'] = 3;
-				}
-				
-				if(!preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $reg_d[3]))
-				{
-					$error .= '�� ������� ���� ��������� E-mail.<br>'; $_POST['step'] = 3;
-				}
-				
-				$reg_d[4] = $chat->str_count($reg_d[4],30);
-				$reg_d[5] = $chat->str_count($reg_d[5],30);
-				
-				if($_POST['step']!=3)
-				{
-					$stp = 4; $noup = 0;
-				}
-			}
-			if($_POST['step']>4)
-			{
-				//���, ���, �����, ����� � �.�.
-				$er = $this->en_ru($reg_d[6]);
-				if($er==true || strlen($reg_d[6])<2)
-				{
-					$error .= '������� ���� �������� ���!<br>'; $_POST['step'] = 4;
-				}
-				
-				$reg_d[6] = $chat->str_count($reg_d[6],90);
-				$reg_d[7] = round($reg_d[7]);
-				$reg_d[8] = round($reg_d[8]);
-				$reg_d[9] = round($reg_d[9]);
-				
-				if($reg_d[7]<1 || $reg_d[7]>31 || $reg_d[8]<1 || $reg_d[8]>12 || $reg_d[9]<1920 || $reg_d[9]>2006)
-				{
-					$error .= '������ � ��������� ��� ��������.<br>'; $_POST['step'] = 4;
-				}
-				
-				if($reg_d[15]!=0 && $reg_d[15]!=1)
-				{
-					$error .= '�� ������� �� ������ ���.<br>'; $_POST['step'] = 4;
-				}
-				
-				if($reg_d[14]!='Black' && $reg_d[14]!='Blue' && $reg_d[14]!='Fuchsia' && $reg_d[14]!='Gray' && $reg_d[14]!='Green' && $reg_d[14]!='Maroon' && $reg_d[14]!='Navy' && $reg_d[14]!='Olive' && $reg_d[14]!='Purple' && $reg_d[14]!='Teal' && $reg_d[14]!='Orange' && $reg_d[14]!='Chocolate' && $reg_d[14]!='DarkKhaki' && $reg_d[14]!='SandyBrown')
-				{
-					$error .= '�� ������� �� ������ ���� ��������� � ����.<br>'; $_POST['step'] = 4;
-				}				
-				
-				if($_POST['step']!=4)
-				{
-					$stp = 5; $noup = 0;
-				}			
-			}
-			if($_POST['step']>5)
-			{
-				//���������� � �������� 
-				if(!isset($_POST['law_'.$reg['id']]) || $_POST['law_'.$reg['id']]!='on')
-				{
-					$error .= '��������, ��� �������� ������ ������ �����, �� �� ������ ���������������� ���� ��������.<br>'; $_POST['step'] = 5;
-				}
-				
-				if(!isset($_POST['law2_'.$reg['id']]) || $_POST['law2_'.$reg['id']]!='on')
-				{
-					$error .= '��������, ��� �������� <u>���������� � �������������� ������� ���� '.$c['title'].'</u>, �� �� ������ ���������������� ��������.<br>'; $_POST['step'] = 5;
-				}
-				
-				if($_POST['code']!=$_SESSION['code'] || $_SESSION['code']<100 || $_POST['code']=='')
-				{
-					$error .= '������ �������� ����.<br>'; $_POST['step'] = 5;
-				}
-				
-				if($_POST['step']!=5)
-				{
-					//���������� ����������� � �������� � ����
-					
-					if($filter->spamFiltr($reg_d[13])!=0)
-					{
-						$reg_d[13] = '';
-					}
-					if($filter->spamFiltr($reg_d[10])!=0)
-					{
-						$reg_d[10] = '';
-					}
-					if($filter->spamFiltr($reg_d[6])!=0)
-					{
-						$reg_d[6] = '';
-					}
-					
-					if((int)$reg['referal'] > 0) {
-						mysql_query("UPDATE `users` SET `referals` = `referals` + 1 WHERE `id` = '".mysql_real_escape_string((int)$reg['referal'])."' LIMIT 1");
-					}
-					
-					$ins = mysql_query("INSERT INTO `users` (`host_reg`,`room`,`login`,`pass`,`ipreg`,`ip`,`city`,`cityreg`,`a1`,`q1`,`mail`,`name`,`bithday`,`sex`,`city_real`,`icq`,`icq_hide`,`deviz`,`chatColor`,`timereg`) VALUES (
-					'".mysql_real_escape_string($reg['referal'])."',
-					'0',
-					'".$reg_d[0]."',
-					'".md5($reg_d[1])."',
-					'".$_SERVER['HTTP_X_REAL_IP']."',
-					'".$_SERVER['HTTP_X_REAL_IP']."',
-					'capitalcity',
-					'capitalcity',
-					'".$reg_d[4]."',
-					'".$reg_d[5]."',
-					'".$reg_d[3]."',
-					'".$reg_d[6]."',
-					'".$reg_d[7].".".$reg_d[8].".".$reg_d[9]."',
-					'".$reg_d[15]."',
-					'".$reg_d[10]."',
-					'".$reg_d[11]."',
-					'".$reg_d[12]."',
-					'".$reg_d[13]."',
-					'".$reg_d[14]."',
-					'".time()."')");
-					if($ins)
-					{
-						$uid = mysql_insert_id();
-						mysql_query("INSERT INTO `online` (`uid`,`timeStart`) VALUES ('".$uid."','".time()."')");
-						mysql_query("INSERT INTO `stats` (`id`,`stats`) VALUES ('".$uid."','s1=3|s2=3|s3=3|s4=3|rinv=40|m9=5|m6=10')");
-						//��������� ��������
-						mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','1','add_hpAll=3',10,2,'capitalcity',".time().")");
-						mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','73','add_mib3=1|add_mab3=1|add_mib4=1|add_mab4=1',20,2,'capitalcity',".time().")");
-						mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','724','moment=1|moment_hp=100|nohaos=1|musor=2|noremont=1',100,2,'capitalcity',".time().")");
-						mysql_query("INSERT INTO `items_users` (`uid`,`item_id`,`data`,`iznosMAX`,`geniration`,`maidin`,`time_create`) VALUES ('".$uid."','865','tr_lvl=1|useOnLogin=1|musor=1|noremont=1',50,2,'capitalcity',".time().")");
-						
-						$text = '������������� �������: ������ ��������� �������, ������� ����� � ������������ ����������� � ����� � ���� ����! :-)';
-						mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
-						$text = '�� �������� ������� [img[items/pot_cureHP100_20.gif]][1] &quot;����� �����&quot;, �� ��������� � ���������, � ������� &quot;��������&quot;';
-						mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
-						$text = '�� �������� ������� [img[items/pal_button8.gif]][1] &quot;���������&quot;, �� ��������� � ���������, � ������� &quot;��������&quot;';
-						mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('capitalcity','0','','".$reg_d[0]."','".$text."','".time()."','11','0')");
-						
-						if(isset($_COOKIE['login']) || isset($_COOKIE['pass']))
-						{
-							setcookie('login','',time()-60*60*24,'',$c['host']);
-							setcookie('pass','',time()-60*60*24,'',$c['host']);
-						}
-						setcookie('login',$reg_d[0],time()+60*60*24*7,'',$c['host']);
-						setcookie('pass',md5($reg_d[1]),time()+60*60*24*7,'',$c['host']);
-						setcookie('auth',md5($reg_d[1].'AUTH'.$_SERVER['HTTP_X_REAL_IP']),time()+60*60*24*365,'',$c['host']);
-						setcookie('reg_capitalcity',true,time()+60*60,'',$c['host']);
-						$chat->send('',1,'capitalcity','','','��� ������������ �������: [login:'.$reg_d[0].']',time(),12,1,0,0);
-						mysql_query("UPDATE `users` SET `online`='".time()."' WHERE `id` = '".$uid."' LIMIT 1");
-						mysql_query("UPDATE `register_code` SET `reg_id`='".$uid."',`time_finish`='".time()."' WHERE `id` = '".$cd['id']."' LIMIT 1");
-						mysql_query("UPDATE `items_users` SET `delete`='".time()."' WHERE `secret_id` = '".$cd['code']."' LIMIT 1");
-						mysql_query('DELETE FROM `register` WHERE `id` = "'.$reg['id'].'" LIMIT 1');
-						header('location: https://new-combats.com/bk');						
-						die('����������� ������ �������...');
-					}else{
-						$error .= '������ �����������. ���������� �����...<br>';
-					}
-				}			
-			}
-		}
-		return $stp;
-	}
-}
-
-$r = new register;
-?>
\ No newline at end of file
diff --git a/_incl_data/class/__zv.php b/_incl_data/class/__zv.php
index 45227123..ca34e581 100644
--- a/_incl_data/class/__zv.php
+++ b/_incl_data/class/__zv.php
@@ -1,425 +1,381 @@
 <?
-if(!defined('GAME')) { die(); }
+if (!defined('GAME')) {
+    die();
+}
 
-	class Balancer
+class Balancer
+{
+    public static function balance($items, $key)
     {
-            public static function balance($items, $key)
-            {
-                    $result = array();
-                    
-					$maxWeight = floor(self::sum($items, $key) / 2);
-                    
-					$numItems = count($items);
-                   
-                    $sack = self::buildSack($numItems, $maxWeight);
-                   
-                    for ($n = 1; $n <= $numItems; $n++)
-                    {
-                            // loop all items
-                            for ($weight = 1; $weight <= $maxWeight; $weight++)
-                            {
-                                    $a = $sack[$n - 1][$weight]['value'];
-                                    $b = null;
-                                    $value = $items[$n - 1][$key];
-                                    if ($value <= $weight)
-                                    {
-                                            $b = $value + $sack[$n - 1][$weight - $value]['value'];
-                                    }
-                                    $sack[$n][$weight]['value'] = ($b === null ? $a : max($a, $b));
-                                    $sack[$n][$weight]['take'] = ($b === null ? false : $b > $a);
-                            }
-                    }
-                   
-                    $setA = array();
-                    $setB = array();
-                   
-                    for ($n = $numItems, $weight = $maxWeight; $n > 0; $n--)
-                    {
-                            $item = $items[$n - 1];
-                            $value = $item[$key];
-                            if ($sack[$n][$weight]['take'])
-                            {
-                                    $setA[] = $item;
-                                    $weight = $weight - $value;
-                            }
-                            else
-                            {
-                                    $setB[] = $item;
-									$weight = $weight - $value;
-                            }
-                    }
-                   
-                    return array($setA, $setB);
+        $result = [];
+
+        $maxWeight = floor(self::sum($items, $key) / 2);
+
+        $numItems = count($items);
+
+        $sack = self::buildSack($numItems, $maxWeight);
+
+        for ($n = 1; $n <= $numItems; $n++) {
+            // loop all items
+            for ($weight = 1; $weight <= $maxWeight; $weight++) {
+                $a = $sack[$n - 1][$weight]['value'];
+                $b = null;
+                $value = $items[$n - 1][$key];
+                if ($value <= $weight) {
+                    $b = $value + $sack[$n - 1][$weight - $value]['value'];
+                }
+                $sack[$n][$weight]['value'] = ($b === null ? $a : max($a, $b));
+                $sack[$n][$weight]['take'] = ($b !== null && $b > $a);
             }
-           
-            protected static function sum($items, $key)
-            {
-                    $sum = 0;
-                    foreach ($items as $item)
-                    {
-                            $sum += $item[$key];
-                    }
-                    return $sum;
-            }
-           
-            protected static function buildSack($width, $height)
-            {
-                    $sack = array();
-                    for ($x = 0; $x <= $width; $x++)
-                    {
-                            $sack[$x] = array();
-                            for ($y = 0; $y <= $height; $y++) {
-                                    $sack[$x][$y] = array(
-                                            'value' => 0,
-                                            'take' => false
-                                    );
-                            }
-                    }
-                    return $sack;
+        }
+
+        $setA = [];
+        $setB = [];
+
+        for ($n = $numItems, $weight = $maxWeight; $n > 0; $n--) {
+            $item = $items[$n - 1];
+            $value = $item[$key];
+            if ($sack[$n][$weight]['take']) {
+                $setA[] = $item;
+            } else {
+                $setB[] = $item;
             }
+            $weight = $weight - $value;
+        }
+
+        return [$setA, $setB];
     }
 
-unset($_POST['kingfight'],$_POST['nobot'],$_POST['mut_clever']);
+    protected static function sum($items, $key)
+    {
+        $sum = 0;
+        foreach ($items as $item) {
+            $sum += $item[$key];
+        }
+        return $sum;
+    }
+
+    protected static function buildSack($width, $height)
+    {
+        $sack = [];
+        for ($x = 0; $x <= $width; $x++) {
+            $sack[$x] = [];
+            for ($y = 0; $y <= $height; $y++) {
+                $sack[$x][$y] = [
+                    'value' => 0,
+                    'take' => false
+                ];
+            }
+        }
+        return $sack;
+    }
+}
+
+unset($_POST['kingfight'], $_POST['nobot'], $_POST['mut_clever']);
 
 session_start();
 
-function add_effn($uid,$id)
-	{
-		$g = array(0=>0,1=>'');
-		$eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$id.'" LIMIT 1'));	
-		if(isset($eff['id2']))
-		{
-			$n = $eff['mname'];
-			$d = $eff['mdata'];
-			$ins = mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`) VALUES ("'.$eff['oneType'].'","'.$eff['id2'].'","'.$uid.'","'.$n.'","'.time().'","'.$d.'")');
-			if($ins)
-			{
-				$g[0] = 1;
-				$g[1] = '...';
-			}
-		}
-		return $g;
-	}
-
-//if( $u->info['id'] == 1008000 || $u->info['admin'] > 0 || $u->stats['silver'] > 0 ) {
-$u->info['no_zv_key'] = true;
-//}
-$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "'.$u->info['align'].'" LIMIT 1'));
-if(isset($_POST['code21'])) { }
-
-if(isset($_GET['del_z_time']) && $_GET['del_z_time'] != NULL) {
-  $zay = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id` = "'.$u->info['zv'].'" AND `creator` = "'.$u->info['id'].'" AND `start` = 0 AND `cancel` = 0 AND `btl_id` = 0 ORDER BY `id` DESC LIMIT 1'));
-  if(isset($zay['id']) && $zay['priz'] == 0) {
-	  $colls = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$zay['id'].'"'));
-	  $cs = $colls[0];
-	  if(isset($zay['id'])) {
-		if($u->info['zv'] == $zay['id'] && ($zay['creator'] == $u->info['id'])) {
-		  if($cs == 1) {
-			mysql_query('UPDATE `stats` SET `zv` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			mysql_query('DELETE FROM `zayvki` WHERE `id` = "'.$zay['id'].'" LIMIT 1');
-			$test_s = '������ �������...';
-		  } else {
-			$test_s = '���-�� ����� ��� ��� ��������� � ������ ������.';
-		  }
-		} else {
-		  $test_s = '�� �� � ���� ������ , ���� �� �� � �������.';	
-		}
-	  } else {
-		$test_s = '������ �� �������...';
-	  }
-  }
+function add_effn($uid, $id)
+{
+    $g = [0 => 0, 1 => ''];
+    $eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "' . $id . '" LIMIT 1'));
+    if (isset($eff['id2'])) {
+        $n = $eff['mname'];
+        $d = $eff['mdata'];
+        $ins = mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`) VALUES ("' . $eff['oneType'] . '","' . $eff['id2'] . '","' . $uid . '","' . $n . '","' . time() . '","' . $d . '")');
+        if ($ins) {
+            $g[0] = 1;
+            $g[1] = '...';
+        }
+    }
+    return $g;
 }
 
-class zayvki {
-	public $zv_see,$error,$z1n = array(4=>'���������',5=>'���������'),$z2n = array(4=>'����������',5=>'����������');
-	
-	public function testTravm() {
-		global $u;
-		$r = 0;
-		$tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1'));
-		if( isset($tr_pl['id']) ) {
-			//��������� �������
-			if( $tr_pl['v1'] == 1 ) {
-				//��� ��
-			}elseif( $tr_pl['v1'] == 2 ) {
-				$r = 1;
-			}elseif( $tr_pl['v1'] == 3 ) {
-				$r = 2;
-			}
-		}
-		return $r;
-	}
-	
-	public function test()
-	{
-		global $code,$c,$u;
-		
-		if( $u->info['zv'] > 0 ) {
-			$test_zv = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id` = "'.$u->info['zv'].'" LIMIT 1'));
-			if(!isset($test_zv['id'])) {
-				$u->info['zv'] = 0;	
-			}else{
-				if( $test_zv['cancel'] > 0 || $test_zv['btl_id'] > 0 ) {
-					$u->info['zv'] = 0;	
-				}
-				if( $test_zv['time'] < time() - 3600 ) {
-					$u->info['zv'] = 0;	
-				}
-			}
-			if( $u->info['zv'] == 0 ) {
-				mysql_query('UPDATE `stats` SET `zv` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-			}
-		}
-		
-		
-		//��������� ������� � ���� ������
-		$sp = mysql_query('SELECT * FROM `turnirs` WHERE `status` != "-1"');
-		while($pl = mysql_fetch_array($sp)) {
-			
-			//������ �������
-			if($pl['status'] == 0 && $pl['time'] > time() ) {
-				if( floor(($pl['time']-time())/60) <= 2 && $pl['chat'] > 0 ) {
-					//�������� 1 ���.
-					//$r = '<font color=red><b>�������:</b> �� ������ ������� �������� 1 ������.</font> ';				
-					//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
-					mysql_query('UPDATE `turnirs` SET `chat` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				}elseif( floor(($pl['time']-time())/60) <= 5 && $pl['chat'] > 1 ) {
-					//�������� 5 ���.
-					$r = '<font color=red><b>�������:</b> �� ������ ������� �������� 5 �����.</font> ';				
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
-					mysql_query('UPDATE `turnirs` SET `chat` = "1" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				}elseif( floor(($pl['time']-time())/60) <= 10 && $pl['chat'] > 2 ) {
-					//�������� 10 ���.
-					$r = '<font color=red><b>�������:</b> �� ������ ������� �������� 10 �����.</font> ';				
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
-					mysql_query('UPDATE `turnirs` SET `chat` = "2" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				}elseif( floor(($pl['time']-time())/60) <= 15 && $pl['chat'] > 3 ) {
-					//�������� 15 ���.
-					$r = '<font color=red><b>�������:</b> �� ������ ������� �������� 15 �����.</font> ';				
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','".$r."','".time()."','6','0')");
-					mysql_query('UPDATE `turnirs` SET `chat` = "3" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				}
-			}
-			if($pl['status'] == 0 && $pl['time'] < time()) {
-				if($pl['users_in'] > 1) {
-					//������ �������
-					mysql_query('UPDATE `turnirs` SET `time` = "'.(time() + $pl['time3']).'",`status` = "1" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					//mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `inTurnirnew` = "'.$pl['id'].'"');
-					
-					$usp = mysql_query('SELECT * FROM `users` WHERE `inTurnirnew` = "'.$pl['id'].'" LIMIT '.$pl['users_in']);
-					while($ur = mysql_fetch_array($usp))
-					{
-							mysql_query('INSERT INTO `users` (`login`,`room`,`name`,`sex`,`level`,`inTurnirnew`,`bithday`,`activ`) VALUES ("'.$ur['login'].'","318","'.$ur['name'].'","'.$ur['sex'].'","'.$t['level'].'","'.$pl['id'].'","01.01.2001","0")');
-							$uri = mysql_insert_id();
-							mysql_query('INSERT INTO `users_turnirs` (`uid`,`bot`,`turnir`) VALUES ("'.$ur['id'].'","'.$uri.'","'.$pl['id'].'")');
-							$zid = 0;
-							$x1 = 0;
-							$y1 = 0;
-							mysql_query('INSERT INTO `stats` (`upLevel`,`dnow`,`id`,`stats`,`exp`,`ability`,`skills`,`x`,`y`) VALUES ("98","'.$zid.'","'.$uri.'","s1=3|s2=3|s3=3|s4=3|s5=0|s6=0|rinv=40|m9=5|m6=10","0","0","0",'.$x1.','.$y1.')');
-							mysql_query('UPDATE `users` SET `inUser` = "'.$uri.'" WHERE `id` = "'.$ur['id'].'" LIMIT 1');	
-							//��������� ������� �������� ������ � ������ ������������
-							
-					}
-					
-				}else{
-					//������ �������
-					mysql_query('UPDATE `turnirs` SET `time` = "'.(time() + $pl['time2']).'",`users_in` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `inTurnirnew` = "'.$pl['id'].'"');
-				}
-			}
-			
-		}
-		
-		//��������� ��������� � ��������� ��� � ���� ������		
-		$sp = mysql_query('SELECT * FROM `zayvki` AS `z` WHERE /*`z`.`city` = "'.$u->info['city'].'" AND*/ `z`.`btl_id` = "0" AND `z`.`cancel` = "0" AND `z`.`start` = "0" AND (`z`.`razdel` = 4 OR `z`.`razdel` = 5) ORDER BY `z`.`id` DESC LIMIT 22');
-		while($pl = mysql_fetch_array($sp))
-		{
-			$uz = mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$pl['id'].'"');
-			$tm1 = array();
-			$tm2 = array();
-			$i = array();
-			$toChat = '';
-			$toChat2 = '';
-			$toWhere = '';
-			while($t = mysql_fetch_array($uz))
-			{
-				if(!isset(${'tm'.$t['team']})){ ${'tm'.$t['team']} = array(); }
-				if(!isset($i[$t['team']])){ $i[$t['team']] = 0; }
-				${'tm'.$t['team']}[$i[$t['team']]] = $t;
-				$toChat .= ''.$t['login'].',';
-				$toWhere .= 'OR `id` = "'.$t['id'].'" ';
-				if($pl['razdel'] == 5 && $pl['time_start']-180 < time()-$pl['time'] && $pl['send'] == 0) {
-					$toChat2 .= ''.$u->microLogin2($t).', ';	
-				}
-				$i[$t['team']]++;
-			}
-			//
-			/*if($pl['razdel'] == 5 && $pl['time_start']-180 < time()-$pl['time'] && $pl['send'] == 0) {
-				if( $toChat2 != '' ) {
-					$toChat2 = rtrim($toChat2,', ');
-					$text = '<font color=red >��������!</font> ( '.$toChat2.' ) ('.$pl['min_lvl_1'].'-'.$pl['max_lvl_1'].') <img src=https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif width=20 height=20 > <font color=grey > ��������� ��� �������� ����� <b>3.0</b> ���., ������� 3 ���.</font>';
-					mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES (
-					'1','".$zv['city']."','','','','".$text."','".time()."','6','0')");
-				}
-				mysql_query('UPDATE `zayvki` SET `send` = 1 WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-			}*/
-			//
-			
-			if( $pl['razdel'] == 5 ) {
-				$col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'"'));
-           	  	$cols = $col_p[0];
-				if( $cols >= $pl['maxplayers'] ) {
-					$pl['time_start'] = time()-$pl['time']-1;
-				}						
-			}
-			
-			if($pl['time_start'] < time()-$pl['time'] || ($pl['razdel']==4 && $i[1]>=$pl['tm1max'] && $i[2]>=$pl['tm2max']))
-			{
-				$toChat = rtrim($toChat,',');
-				$toWhere = ltrim($toWhere,'OR ');
-				if($pl['razdel']==4)
-				{
-					//������
-					if(!isset($i[1]) || !isset($i[2]) || (!isset($i[3]) && $pl['teams'] == 3))
-					{
-						//������ �� �������
-						$this->cancelGroup($pl,$toChat);
-					}else{
-						//�������� ��������
-						$this->startBattle($pl['id'],$toChat.'|-|'.$toWhere);
-					}
-				}elseif($pl['razdel']==5)
-				{
-					//�����
-					//
-					$i = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'" LIMIT 1'));
-					if($i[0] < 4 && ($i[0] < 2 || $pl['fastfight'] == 0))
-					{
-						//������ �� �������
-						$this->cancelGroup($pl,$toChat);
-					}else{
-						//�������� ��������
-						$this->startBattle($pl['id'],$toChat.'|-|'.$toWhere);
-					}
-				}
-			}
-		}
-	}
-	
-	public function testCronZv()
-	{
-		global $code,$c,$u;
-		
-		$back_test = false;
-		
-		//��������� ������� � ���� ������
-		$sp = mysql_query('SELECT * FROM `turnirs` WHERE `status` != "-1"');
-		while($pl = mysql_fetch_array($sp)) {
-			
-			//������ �������
-			if($pl['status'] == 0 && $pl['time'] < time()) {
-				if($pl['users_in'] > 1) {
-					//������ �������
-					mysql_query('UPDATE `turnirs` SET `time` = "'.(time() + $pl['time3']).'",`status` = "1" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					//mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `inTurnirnew` = "'.$pl['id'].'"');
-					
-					$usp = mysql_query('SELECT * FROM `users` WHERE `inTurnirnew` = "'.$pl['id'].'" LIMIT '.$pl['users_in']);
-					while($ur = mysql_fetch_array($usp))
-					{
-							mysql_query('INSERT INTO `users` (`login`,`room`,`name`,`sex`,`level`,`inTurnirnew`,`bithday`,`activ`) VALUES ("'.$ur['login'].'","318","'.$ur['name'].'","'.$ur['sex'].'","'.$t['level'].'","'.$pl['id'].'","01.01.2001","0")');
-							$uri = mysql_insert_id();
-							mysql_query('INSERT INTO `users_turnirs` (`uid`,`bot`,`turnir`) VALUES ("'.$ur['id'].'","'.$uri.'","'.$pl['id'].'")');
-							$zid = 0;
-							$x1 = 0;
-							$y1 = 0;
-							mysql_query('INSERT INTO `stats` (`upLevel`,`dnow`,`id`,`stats`,`exp`,`ability`,`skills`,`x`,`y`) VALUES ("98","'.$zid.'","'.$uri.'","s1=3|s2=3|s3=3|s4=3|s5=0|s6=0|rinv=40|m9=5|m6=10","0","0","0",'.$x1.','.$y1.')');
-							mysql_query('UPDATE `users` SET `inUser` = "'.$uri.'" WHERE `id` = "'.$ur['id'].'" LIMIT 1');	
-							//��������� ������� �������� ������ � ������ ������������
-							
-					}
-					
-				}else{
-					//������ �������
-					mysql_query('UPDATE `turnirs` SET `time` = "'.(time() + $pl['time2']).'",`users_in` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `inTurnirnew` = "'.$pl['id'].'"');
-				}
-			}
-			
-		}
-		
-		//��������� ��������� � ��������� ��� � ���� ������		
-		$sp = mysql_query('SELECT * FROM `zayvki` AS `z` WHERE `z`.`btl_id` = "0" AND `z`.`cancel` = "0" AND `z`.`start` = "0" AND (`z`.`razdel` = 4 OR `z`.`razdel` = 5) ORDER BY `z`.`id` DESC LIMIT 1000');
-		while($pl = mysql_fetch_array($sp))
-		{
-			$uz = mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$pl['id'].'"');
-			$tm1 = array();
-			$tm2 = array();
-			$i = array();
-			$toChat = '';
-			$toWhere = '';
-			while($t = mysql_fetch_array($uz))
-			{
-				if(!isset(${'tm'.$t['team']})){ ${'tm'.$t['team']} = array(); }
-				if(!isset($i[$t['team']])){ $i[$t['team']] = 0; }
-				${'tm'.$t['team']}[$i[$t['team']]] = $t;
-				$toChat .= ''.$t['login'].',';
-				$toWhere .= 'OR `id` = "'.$t['id'].'" ';
-				$i[$t['team']]++;
-			}
-			if($pl['time_start'] <= time()-$pl['time'] || ($pl['razdel']==4 && $i[1]>=$pl['tm1max'] && $i[2]>=$pl['tm2max']))
-			{
-				$toChat = rtrim($toChat,',');
-				$toWhere = ltrim($toWhere,'OR ');
-				if($pl['razdel']==4)
-				{
-					//������
-					if(!isset($i[1]) || !isset($i[2]))
-					{
-						//������ �� �������
-						$this->cancelGroup($pl,$toChat);
-					}else{
-						//�������� ��������
-						$this->startBattle($pl['id'],$toChat.'|-|'.$toWhere);
-					}
-				}elseif($pl['razdel']==5)
-				{
-					//�����
-					$i = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'" LIMIT 1'));
-					if($i[0] < 4 && ($pl['fastfight'] == 0 || $i[0] < 2))
-					{
-						$rcf = mysql_fetch_array(mysql_query('SELECT `id`,`btl_cof` FROM `stats` WHERE `zv` = "'.$pl['id'].'" ORDER BY `btl_cof` DESC LIMIT 1'));
-						$rcf = $rcf['btl_cof'];
-						//������ �� �������
-						//��������� ����������� �������
-						$lvl_btl_exp = array(
-							0 =>           0,
-							1 =>         110,
-							2 =>         420,
-							3 =>        1300,
-							4 =>        2500,
-							5 =>        5000,
-							6 =>       12500,
-							7 =>       30000,
-							8 =>      300000,
-							9 =>     3000000,
-							10 =>   10000000,
-							11 =>   52000000,
-							12 =>   63000000,
-							13 =>  182000000,
-							14 =>  212000000,
-							15 =>  352000000,
-							16 =>  504000000,
-							17 => 1187000000,
-							18 => 2455000000,
-							19 => 4387000000,
-							20 => 6355000000,							
-							21 =>15500000000,							
-							22 =>755500000000
-						);
-						$bot_users = array();
-						
-						if( $pl['min_lvl_1'] <= 8 && $pl['max_lvl_1'] <= 8 && $pl['nobot'] == 0) {
-							$bsp = mysql_query('SELECT
+$u->info['no_zv_key'] = true;
+$moder = mysql_fetch_array(mysql_query('SELECT * FROM `moder` WHERE `align` = "' . $u->info['align'] . '" LIMIT 1'));
+
+if (isset($_GET['del_z_time']) && $_GET['del_z_time'] != null) {
+    $zay = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id` = "' . $u->info['zv'] . '" AND `creator` = "' . $u->info['id'] . '" AND `start` = 0 AND `cancel` = 0 AND `btl_id` = 0 ORDER BY `id` DESC LIMIT 1'));
+    if (isset($zay['id']) && $zay['priz'] == 0) {
+        $colls = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $zay['id'] . '"'));
+        $cs = $colls[0];
+        if ($u->info['zv'] == $zay['id'] && ($zay['creator'] == $u->info['id'])) {
+            if ($cs == 1) {
+                mysql_query('UPDATE `stats` SET `zv` = 0 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                mysql_query('DELETE FROM `zayvki` WHERE `id` = "' . $zay['id'] . '" LIMIT 1');
+                $test_s = '������ �������...';
+            } else {
+                $test_s = '���-�� ����� ��� ��� ��������� � ������ ������.';
+            }
+        } else {
+            $test_s = '�� �� � ���� ������ , ���� �� �� � �������.';
+        }
+    }
+}
+
+class zayvki
+{
+    public $zv_see, $error, $z1n = [4 => '���������', 5 => '���������'], $z2n = [4 => '����������', 5 => '����������'];
+
+    public function testTravm()
+    {
+        global $u;
+        $r = 0;
+        $tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "' . $u->info['id'] . '" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1'));
+        if (isset($tr_pl['id'])) {
+            //��������� �������
+            if ($tr_pl['v1'] == 1) {
+                //��� ��
+            } elseif ($tr_pl['v1'] == 2) {
+                $r = 1;
+            } elseif ($tr_pl['v1'] == 3) {
+                $r = 2;
+            }
+        }
+        return $r;
+    }
+
+    public function test()
+    {
+        global $code, $c, $u;
+
+        if ($u->info['zv'] > 0) {
+            $test_zv = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id` = "' . $u->info['zv'] . '" LIMIT 1'));
+            if (!isset($test_zv['id'])) {
+                $u->info['zv'] = 0;
+            } else {
+                if ($test_zv['cancel'] > 0 || $test_zv['btl_id'] > 0) {
+                    $u->info['zv'] = 0;
+                }
+                if ($test_zv['time'] < time() - 3600) {
+                    $u->info['zv'] = 0;
+                }
+            }
+            if ($u->info['zv'] == 0) {
+                mysql_query('UPDATE `stats` SET `zv` = 0 WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+            }
+        }
+
+        //��������� ������� � ���� ������
+        $sp = mysql_query('SELECT * FROM `turnirs` WHERE `status` != "-1"');
+        while ($pl = mysql_fetch_array($sp)) {
+
+            //������ �������
+            if ($pl['status'] == 0 && $pl['time'] > time()) {
+                if (floor(($pl['time'] - time()) / 60) <= 2 && $pl['chat'] > 0) {
+                    mysql_query('UPDATE `turnirs` SET `chat` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                } elseif (floor(($pl['time'] - time()) / 60) <= 5 && $pl['chat'] > 1) {
+                    //�������� 5 ���.
+                    $r = '<font color=red><b>�������:</b> �� ������ ������� �������� 5 �����.</font> ';
+                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','" . $r . "','" . time() . "','6','0')");
+                    mysql_query('UPDATE `turnirs` SET `chat` = "1" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                } elseif (floor(($pl['time'] - time()) / 60) <= 10 && $pl['chat'] > 2) {
+                    //�������� 10 ���.
+                    $r = '<font color=red><b>�������:</b> �� ������ ������� �������� 10 �����.</font> ';
+                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','" . $r . "','" . time() . "','6','0')");
+                    mysql_query('UPDATE `turnirs` SET `chat` = "2" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                } elseif (floor(($pl['time'] - time()) / 60) <= 15 && $pl['chat'] > 3) {
+                    //�������� 15 ���.
+                    $r = '<font color=red><b>�������:</b> �� ������ ������� �������� 15 �����.</font> ';
+                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','capitalcity','','','','" . $r . "','" . time() . "','6','0')");
+                    mysql_query('UPDATE `turnirs` SET `chat` = "3" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                }
+            }
+            if ($pl['status'] == 0 && $pl['time'] < time()) {
+                if ($pl['users_in'] > 1) {
+                    //������ �������
+                    mysql_query('UPDATE `turnirs` SET `time` = "' . (time() + $pl['time3']) . '",`status` = "1" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                    $usp = mysql_query('SELECT * FROM `users` WHERE `inTurnirnew` = "' . $pl['id'] . '" LIMIT ' . $pl['users_in']);
+                    while ($ur = mysql_fetch_array($usp)) {
+                        mysql_query('INSERT INTO `users` (`login`,`room`,`name`,`sex`,`level`,`inTurnirnew`,`bithday`,`activ`) VALUES ("' . $ur['login'] . '","318","' . $ur['name'] . '","' . $ur['sex'] . '","' . $t['level'] . '","' . $pl['id'] . '","01.01.2001","0")');
+                        $uri = mysql_insert_id();
+                        mysql_query('INSERT INTO `users_turnirs` (`uid`,`bot`,`turnir`) VALUES ("' . $ur['id'] . '","' . $uri . '","' . $pl['id'] . '")');
+                        $zid = 0;
+                        $x1 = 0;
+                        $y1 = 0;
+                        mysql_query('INSERT INTO `stats` (`upLevel`,`dnow`,`id`,`stats`,`exp`,`ability`,`skills`,`x`,`y`) VALUES ("98","' . $zid . '","' . $uri . '","s1=3|s2=3|s3=3|s4=3|s5=0|s6=0|rinv=40|m9=5|m6=10","0","0","0",' . $x1 . ',' . $y1 . ')');
+                        mysql_query('UPDATE `users` SET `inUser` = "' . $uri . '" WHERE `id` = "' . $ur['id'] . '" LIMIT 1');
+                        //��������� ������� �������� ������ � ������ ������������
+                    }
+                } else {
+                    //������ �������
+                    mysql_query('UPDATE `turnirs` SET `time` = "' . (time() + $pl['time2']) . '",`users_in` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                    mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `inTurnirnew` = "' . $pl['id'] . '"');
+                }
+            }
+        }
+
+        //��������� ��������� � ��������� ��� � ���� ������
+        $sp = mysql_query('SELECT * FROM `zayvki` AS `z` WHERE /*`z`.`city` = "' . $u->info['city'] . '" AND*/ `z`.`btl_id` = "0" AND `z`.`cancel` = "0" AND `z`.`start` = "0" AND (`z`.`razdel` = 4 OR `z`.`razdel` = 5) ORDER BY `z`.`id` DESC LIMIT 22');
+        while ($pl = mysql_fetch_array($sp)) {
+            $uz = mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $pl['id'] . '"');
+            $tm1 = [];
+            $tm2 = [];
+            $i = [];
+            $toChat = '';
+            $toChat2 = '';
+            $toWhere = '';
+            while ($t = mysql_fetch_array($uz)) {
+                if (!isset(${'tm' . $t['team']})) {
+                    ${'tm' . $t['team']} = [];
+                }
+                if (!isset($i[$t['team']])) {
+                    $i[$t['team']] = 0;
+                }
+                ${'tm' . $t['team']}[$i[$t['team']]] = $t;
+                $toChat .= '' . $t['login'] . ',';
+                $toWhere .= 'OR `id` = "' . $t['id'] . '" ';
+                if ($pl['razdel'] == 5 && $pl['time_start'] - 180 < time() - $pl['time'] && $pl['send'] == 0) {
+                    $toChat2 .= '' . $u->microLogin2($t) . ', ';
+                }
+                $i[$t['team']]++;
+            }
+
+            if ($pl['razdel'] == 5) {
+                $col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $pl['id'] . '"'));
+                $cols = $col_p[0];
+                if ($cols >= $pl['maxplayers']) {
+                    $pl['time_start'] = time() - $pl['time'] - 1;
+                }
+            }
+
+            if ($pl['time_start'] < time() - $pl['time'] || ($pl['razdel'] == 4 && $i[1] >= $pl['tm1max'] && $i[2] >= $pl['tm2max'])) {
+                $toChat = rtrim($toChat, ',');
+                $toWhere = ltrim($toWhere, 'OR ');
+                if ($pl['razdel'] == 4) {
+                    //������
+                    if (!isset($i[1]) || !isset($i[2]) || (!isset($i[3]) && $pl['teams'] == 3)) {
+                        //������ �� �������
+                        $this->cancelGroup($pl, $toChat);
+                    } else {
+                        //�������� ��������
+                        $this->startBattle($pl['id'], $toChat . '|-|' . $toWhere);
+                    }
+                } elseif ($pl['razdel'] == 5) {
+                    //�����
+                    //
+                    $i = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $pl['id'] . '" LIMIT 1'));
+                    if ($i[0] < 4 && ($i[0] < 2 || $pl['fastfight'] == 0)) {
+                        //������ �� �������
+                        $this->cancelGroup($pl, $toChat);
+                    } else {
+                        //�������� ��������
+                        $this->startBattle($pl['id'], $toChat . '|-|' . $toWhere);
+                    }
+                }
+            }
+        }
+    }
+
+    public function testCronZv()
+    {
+        global $code, $c, $u;
+
+        $back_test = false;
+
+        //��������� ������� � ���� ������
+        $sp = mysql_query('SELECT * FROM `turnirs` WHERE `status` != "-1"');
+        while ($pl = mysql_fetch_array($sp)) {
+
+            //������ �������
+            if ($pl['status'] == 0 && $pl['time'] < time()) {
+                if ($pl['users_in'] > 1) {
+                    //������ �������
+                    mysql_query('UPDATE `turnirs` SET `time` = "' . (time() + $pl['time3']) . '",`status` = "1" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+
+                    $usp = mysql_query('SELECT * FROM `users` WHERE `inTurnirnew` = "' . $pl['id'] . '" LIMIT ' . $pl['users_in']);
+                    while ($ur = mysql_fetch_array($usp)) {
+                        mysql_query('INSERT INTO `users` (`login`,`room`,`name`,`sex`,`level`,`inTurnirnew`,`bithday`,`activ`) VALUES ("' . $ur['login'] . '","318","' . $ur['name'] . '","' . $ur['sex'] . '","' . $t['level'] . '","' . $pl['id'] . '","01.01.2001","0")');
+                        $uri = mysql_insert_id();
+                        mysql_query('INSERT INTO `users_turnirs` (`uid`,`bot`,`turnir`) VALUES ("' . $ur['id'] . '","' . $uri . '","' . $pl['id'] . '")');
+                        $zid = 0;
+                        $x1 = 0;
+                        $y1 = 0;
+                        mysql_query('INSERT INTO `stats` (`upLevel`,`dnow`,`id`,`stats`,`exp`,`ability`,`skills`,`x`,`y`) VALUES ("98","' . $zid . '","' . $uri . '","s1=3|s2=3|s3=3|s4=3|s5=0|s6=0|rinv=40|m9=5|m6=10","0","0","0",' . $x1 . ',' . $y1 . ')');
+                        mysql_query('UPDATE `users` SET `inUser` = "' . $uri . '" WHERE `id` = "' . $ur['id'] . '" LIMIT 1');
+                        //��������� ������� �������� ������ � ������ ������������
+
+                    }
+
+                } else {
+                    //������ �������
+                    mysql_query('UPDATE `turnirs` SET `time` = "' . (time() + $pl['time2']) . '",`users_in` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                    mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `inTurnirnew` = "' . $pl['id'] . '"');
+                }
+            }
+
+        }
+
+        //��������� ��������� � ��������� ��� � ���� ������
+        $sp = mysql_query('SELECT * FROM `zayvki` AS `z` WHERE `z`.`btl_id` = "0" AND `z`.`cancel` = "0" AND `z`.`start` = "0" AND (`z`.`razdel` = 4 OR `z`.`razdel` = 5) ORDER BY `z`.`id` DESC LIMIT 1000');
+        while ($pl = mysql_fetch_array($sp)) {
+            $uz = mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $pl['id'] . '"');
+            $tm1 = [];
+            $tm2 = [];
+            $i = [];
+            $toChat = '';
+            $toWhere = '';
+            while ($t = mysql_fetch_array($uz)) {
+                if (!isset(${'tm' . $t['team']})) {
+                    ${'tm' . $t['team']} = [];
+                }
+                if (!isset($i[$t['team']])) {
+                    $i[$t['team']] = 0;
+                }
+                ${'tm' . $t['team']}[$i[$t['team']]] = $t;
+                $toChat .= '' . $t['login'] . ',';
+                $toWhere .= 'OR `id` = "' . $t['id'] . '" ';
+                $i[$t['team']]++;
+            }
+            if ($pl['time_start'] <= time() - $pl['time'] || ($pl['razdel'] == 4 && $i[1] >= $pl['tm1max'] && $i[2] >= $pl['tm2max'])) {
+                $toChat = rtrim($toChat, ',');
+                $toWhere = ltrim($toWhere, 'OR ');
+                if ($pl['razdel'] == 4) {
+                    //������
+                    if (!isset($i[1]) || !isset($i[2])) {
+                        //������ �� �������
+                        $this->cancelGroup($pl, $toChat);
+                    } else {
+                        //�������� ��������
+                        $this->startBattle($pl['id'], $toChat . '|-|' . $toWhere);
+                    }
+                } elseif ($pl['razdel'] == 5) {
+                    //�����
+                    $i = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $pl['id'] . '" LIMIT 1'));
+                    if ($i[0] < 4 && ($pl['fastfight'] == 0 || $i[0] < 2)) {
+                        $rcf = mysql_fetch_array(mysql_query('SELECT `id`,`btl_cof` FROM `stats` WHERE `zv` = "' . $pl['id'] . '" ORDER BY `btl_cof` DESC LIMIT 1'));
+                        $rcf = $rcf['btl_cof'];
+                        //������ �� �������
+                        //��������� ����������� �������
+                        $lvl_btl_exp = [
+                            0 => 0,
+                            1 => 110,
+                            2 => 420,
+                            3 => 1300,
+                            4 => 2500,
+                            5 => 5000,
+                            6 => 12500,
+                            7 => 30000,
+                            8 => 300000,
+                            9 => 3000000,
+                            10 => 10000000,
+                            11 => 52000000,
+                            12 => 63000000,
+                            13 => 182000000,
+                            14 => 212000000,
+                            15 => 352000000,
+                            16 => 504000000,
+                            17 => 1187000000,
+                            18 => 2455000000,
+                            19 => 4387000000,
+                            20 => 6355000000,
+                            21 => 15500000000,
+                            22 => 755500000000
+                        ];
+                        $bot_users = [];
+
+                        if ($pl['min_lvl_1'] <= 8 && $pl['max_lvl_1'] <= 8 && $pl['nobot'] == 0) {
+                            $bsp = mysql_query('SELECT
 								`u`.`id`,
 								`u`.`login`,
 								`u`.`level`,
@@ -430,921 +386,785 @@ class zayvki {
 								`s`.`upLevel`,
 								`s`.`priems`,
 								`s`.`btl_cof`
-							FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`exp` >= '.$lvl_btl_exp[$pl['min_lvl_1']].' AND `s`.`exp` < '.$lvl_btl_exp[$pl['max_lvl_1']+1].' AND `s`.`bot` = "0" ORDER BY `s`.`btl_cof` DESC LIMIT 50');
-							while( $bpl = mysql_fetch_array($bsp) ) {
-								$bot_users[] = $bpl;
-							}
-						}
-							
-						$mincs = 4;
-						if( $pl['fastfight'] > 0 ) {
-							$mincs = 2;
-						}
-											
-						if( count($bot_users) == 0 ) {
-							if($i[0] < 4 && ($pl['fastfight'] == 0 || $i[0] < 2)) {
-								$text = ' �� ������� ������ �������� �� �������: ������ �� �������. ('.$pl['id'].': '.count($bot_users).' '.$lvl_btl_exp[$pl['min_lvl_1']].'-'.$lvl_btl_exp[$pl['max_lvl_1']+1].')';
-								mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$zv['city']."','','','LEL','".$text."','".time()."','6','0')");
-								$this->cancelGroup($pl,$toChat);
-							}
-						}else{							
-							$j = 0; $k = 0;
-							$bot_users_new = array();
-							while( $j < $mincs-$i[0] ) {
-								$botlg = $bot_users[rand(0,count($bot_users)-1)];
-								$j++;
-								$clone = array(
-									'id' => $botlg['id'],
-									'login' => '���� (���� '.$j.')',
-									'level' => $botlg['level'],
-									'city' => $pl['city'],
-									'cityreg' => $pl['city'],
-									'name' => '����',
-									'sex' => $botlg['sex'],
-									'deviz' => '',
-									'hobby' => '',
-									'time_reg' => time(),
-									'obraz' => $botlg['obraz'],
-									'stats' => $botlg['stats'],
-									'upLevel' => $botlg['upLevel'],
-									'priems' => $botlg['priems'],
-									'loclon' => true
-								);
-								$bot = $u->addNewbot(1,NULL,$clone,NULL,true);
-								if( $bot > 0 ) {
-									mysql_query('UPDATE `stats` SET `btl_cof` = "'.$botlg['btl_cof'].'",`zv` = "'.$pl['id'].'",`hpNow` = "100000",`mpNow` = "100000" WHERE `id` = "'.$bot.'" LIMIT 1');
-									mysql_query('UPDATE `users` SET `room` = "303",`battle` = "0" WHERE `id` = "'.$bot.'" LIMIT 1');
-									$k++;
-								}
-							}
-							unset($bot_users,$bpl,$bsp,$bot);
-							//$this->cancelGroup($pl,$toChat);
-							if( $k+$i[0] >= 4 || ($pl['fastfight'] == 0 || $k+$i[0] >= 2) ) {
-								$back_test = true;
-								//$this->startBattle($pl['id'],$toChat.'|-|'.$toWhere);
-							}
-						}
-					}else{
-						//�������� ��������
-						$this->startBattle($pl['id'],$toChat.'|-|'.$toWhere);
-					}
-				}
-			}
-		}
-		
-		if( $back_test == true ) {
-			$this->testCronZv();
-		}
-		
-	}
-	
-	public function userInfo()
-	{
-		global $u,$c;
-			$r = '';
-			if($u->stats['mpAll']>0)
-			{
-				$pm = $u->stats['mpNow']/$u->stats['mpAll']*100;
-			}
-			$ph = $u->stats['hpNow']/$u->stats['hpAll']*100;
-			$dp = '';
-			if($u->stats['mpAll']<=0)
-			{
-				$dp = 'margin-top:13px;';
-			}
-			$r .= '<table border="0" cellspacing="0" cellpadding="0" height="20">
-<tr><td valign="middle"> &nbsp; <font>'.$u->microLogin($u->info['id'],1).'</font> &nbsp; </td>
+							FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`exp` >= ' . $lvl_btl_exp[$pl['min_lvl_1']] . ' AND `s`.`exp` < ' . $lvl_btl_exp[$pl['max_lvl_1'] + 1] . ' AND `s`.`bot` = "0" ORDER BY `s`.`btl_cof` DESC LIMIT 50');
+                            while ($bpl = mysql_fetch_array($bsp)) {
+                                $bot_users[] = $bpl;
+                            }
+                        }
+
+                        $mincs = 4;
+                        if ($pl['fastfight'] > 0) {
+                            $mincs = 2;
+                        }
+
+                        if (count($bot_users) == 0) {
+                            if ($i[0] < 4 && ($pl['fastfight'] == 0 || $i[0] < 2)) {
+                                $text = ' �� ������� ������ �������� �� �������: ������ �� �������. (' . $pl['id'] . ': ' . count($bot_users) . ' ' . $lvl_btl_exp[$pl['min_lvl_1']] . '-' . $lvl_btl_exp[$pl['max_lvl_1'] + 1] . ')';
+                                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $zv['city'] . "','','','LEL','" . $text . "','" . time() . "','6','0')");
+                                $this->cancelGroup($pl, $toChat);
+                            }
+                        } else {
+                            $j = 0;
+                            $k = 0;
+                            $bot_users_new = [];
+                            while ($j < $mincs - $i[0]) {
+                                $botlg = $bot_users[rand(0, count($bot_users) - 1)];
+                                $j++;
+                                $clone = [
+                                    'id' => $botlg['id'],
+                                    'login' => '���� (���� ' . $j . ')',
+                                    'level' => $botlg['level'],
+                                    'city' => $pl['city'],
+                                    'cityreg' => $pl['city'],
+                                    'name' => '����',
+                                    'sex' => $botlg['sex'],
+                                    'deviz' => '',
+                                    'hobby' => '',
+                                    'time_reg' => time(),
+                                    'obraz' => $botlg['obraz'],
+                                    'stats' => $botlg['stats'],
+                                    'upLevel' => $botlg['upLevel'],
+                                    'priems' => $botlg['priems'],
+                                    'loclon' => true
+                                ];
+                                $bot = $u->addNewbot(1, null, $clone, null, true);
+                                if ($bot > 0) {
+                                    mysql_query('UPDATE `stats` SET `btl_cof` = "' . $botlg['btl_cof'] . '",`zv` = "' . $pl['id'] . '",`hpNow` = "100000",`mpNow` = "100000" WHERE `id` = "' . $bot . '" LIMIT 1');
+                                    mysql_query('UPDATE `users` SET `room` = "303",`battle` = "0" WHERE `id` = "' . $bot . '" LIMIT 1');
+                                    $k++;
+                                }
+                            }
+                            unset($bot_users, $bpl, $bsp, $bot);
+                            if ($k + $i[0] >= 4 || ($pl['fastfight'] == 0 || $k + $i[0] >= 2)) {
+                                $back_test = true;
+                            }
+                        }
+                    } else {
+                        //�������� ��������
+                        $this->startBattle($pl['id'], $toChat . '|-|' . $toWhere);
+                    }
+                }
+            }
+        }
+
+        if ($back_test) {
+            $this->testCronZv();
+        }
+
+    }
+
+    public function userInfo()
+    {
+        global $u, $c;
+        $r = '';
+        if ($u->stats['mpAll'] > 0) {
+            $pm = $u->stats['mpNow'] / $u->stats['mpAll'] * 100;
+        }
+        $ph = $u->stats['hpNow'] / $u->stats['hpAll'] * 100;
+        $dp = '';
+        if ($u->stats['mpAll'] <= 0) {
+            $dp = 'margin-top:13px;';
+        }
+        $r .= '<table border="0" cellspacing="0" cellpadding="0" height="20">
+<tr><td valign="middle"> &nbsp; <font>' . $u->microLogin($u->info['id'], 1) . '</font> &nbsp; </td>
 <td valign="middle" width="120">
-<div style="position:relative;'.$dp.'"><div id="vhp'.($u->info['id']).'" title="������� �����" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> '.floor($u->stats['hpNow']).'/'.$u->stats['hpAll'].'</div>
+<div style="position:relative;' . $dp . '"><div id="vhp' . ($u->info['id']) . '" title="������� �����" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . floor($u->stats['hpNow']) . '/' . $u->stats['hpAll'] . '</div>
 <div title="������� �����" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-<div class="hp_3 senohp" style="height:9px; width:'.floor(120/100*$ph).'px; position:absolute; top:-10px; z-index:11;" id="lhp'.($u->info['id']).'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+<div class="hp_3 senohp" style="height:9px; width:' . floor(120 / 100 * $ph) . 'px; position:absolute; top:-10px; z-index:11;" id="lhp' . ($u->info['id']) . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 <div title="������� �����" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>
 ';
 
-if($u->stats['mpAll']>0)
-{
-	$r .= '<div id="vmp'.($u->info['id']).'" title="������� ����" align="left" class="seemp" style="position:absolute; top:0px; width:120px; height:10px; z-index:12;"> '.floor($u->stats['mpNow']).'/'.$u->stats['mpAll'].'</div>
+        if ($u->stats['mpAll'] > 0) {
+            $r .= '<div id="vmp' . ($u->info['id']) . '" title="������� ����" align="left" class="seemp" style="position:absolute; top:0px; width:120px; height:10px; z-index:12;"> ' . floor($u->stats['mpNow']) . '/' . $u->stats['mpAll'] . '</div>
 <div title="������� ����" class="hpborder" style="position:absolute; top:0px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-<div class="hp_mp senohp" style="height:9px; position:absolute; top:0px; width:'.floor(120/100*$pm).'px; z-index:11;" id="lmp'.($u->info['id']).'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+<div class="hp_mp senohp" style="height:9px; position:absolute; top:0px; width:' . floor(120 / 100 * $pm) . 'px; z-index:11;" id="lmp' . ($u->info['id']) . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 <div title="������� ����" class="hp_none" style="position:absolute; top:0px; width:120px; height:10px; z-index:10;"></div>';
-}
-$r .= '</div></td></tr></table>';
-		unset($stt,$ph,$pm);
-		return $r;
-	}
-	
-	public function cancelGroup($zv,$uids)
-	{
-		global $u;
-		
-		if( $zv['priz'] > 0 ) {
-			$sp = mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "'.$zv['id'].'"');
-		}
-		$upd = mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `zv` = "'.$zv['id'].'"');
-		if($upd)
-		{
-			$upd = mysql_query('UPDATE `zayvki` SET `cancel` = "'.time().'" WHERE `id` = "'.$zv['id'].'"');
-			if($upd && $uids != '')
-			{
-				if( $zv['priz'] > 0 ) {
-					while( $pl = mysql_fetch_array($sp) ) {
-						//������ �� 1 ������
-						if( $zv['type'] == 33 ) //��� ����� �� �������� ������� ��������� � ������ �����
-							{
-							$pld = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `inUser` = "'.$pl['id'].'"'));
-							if (isset($pld['id']))
-							{
-								mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "'.$pld['id'].'" LIMIT 1');
-								$u->addItem(4754,$pld['id'],'');
-								$uids=$pld['id'];
-								mysql_query('DELETE FROM `users` WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								mysql_query('DELETE FROM `stats` WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-								mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$pl['id'].'" LIMIT 100');
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$pl['id'].'" LIMIT 100');
-							}
-							}
-						else
-							{
-							$u->addItem(4754,$pl['id'],'');
-							}
-					}
-					$text = ' �� ������� ������ �������� �� �������: ������ �� �������. �� ��������� �������� ����� (�1)';
-				}else{
-					$text = ' �� ������� ������ �������� �� �������: ������ �� �������.';
-				}
-				mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$zv['city']."','','','".$uids."','".$text."','".time()."','6','0')");
-			}
-		}
-	}
-	
-	public function add()
-	{
-		global $u,$c,$code;
-		if(isset($_GET['r']) && $u->info['inTurnirnew']==0)
-		{
-			$r = round(intval($_GET['r']));
-			if($r>=1 && $r<=5)
-			{
-				$az = 1;
-				if($r==1 && $u->info['level']>0){	$az = 0; $this->error = '�� ��� ������� �� ��������� ;)';	}
-				if(($r==2 || $r==3)  && $u->info['level']<1){	$az = 0; $this->error = '�� ��� �� ������� �� ��������� ;)';	}
-				if(($r==4 || $r==5)  && $u->info['level']<2){	$az = 0; $this->error = '� '.$this->z1n[$r].' ��� ������ �� ������� ������.';	}
-				if(!isset($_POST['stavkakredit'])){ $_POST['stavkakredit'] = 0; }
-				$money = (int)($_POST['stavkakredit']*100);
-				$money = round(($money/100),2);
-				                
-                if( $this->testTravm() == 1 &&  $_POST['k'] != 1 ) {
-					$this->error = '�� ������������. � ������ �������� �������� �������� ���.';
-					$az = 0;
-				}elseif( $this->testTravm() == 2 ) {
-					$this->error = '�� ������������. � ������ �������� ���������� ���������.';
-					$az = 0;
-				}elseif($u->info['hpNow']<$u->stats['hpAll']/100*30 && ($r>=1 || $r<=3)) {
-					$this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
-					$az = 0;
-				} elseif($r==3 && $money>0 && $u->info['level']<4) {
-					$this->error = '��� �� ������ ���������� � 4-�� ������';
-					$az = 0;
-				} elseif($r==3 && $money<0.5 && $money>0) {
-					$this->error = '����������� ������ 0.50 ��.';
-					$az = 0;
-				} elseif($r==3 && $money>30) {
-					$this->error = '������������ ������ 30.00 ��.';
-					$az = 0;
-				} elseif($r==3 && $money>$u->info['money']) {
-					$this->error = '� ��� ������������ �����, ����� ������ ������';
-					$az = 0;
-				}
-				if($u->info['zv']>0){ $az = 0; $this->error = '�� ��� �������� � ������.'; }
-				if($az==1)
-				{
-					$nz = array();
-					$nz['city'] = $u->info['city'];
-					$nz['creator'] = $u->info['id'];
-					$nz['type'] = 0;
-					if($_POST['k']==1){	$nz['type'] = 1; }
-					if($_POST['k']==2){	$nz['type'] = 6; $nz['travmaChance'] = 100; }
-					$_POST['timeout'] = round(intval(mysql_real_escape_string($_POST['timeout'])));
-					if($_POST['timeout']==1 || $_POST['timeout']==2 || $_POST['timeout']==3 || $_POST['timeout']==4 || $_POST['timeout']==5)
-					{
-						$nz['timeout'] = $_POST['timeout']*60;
-					}else{
-						$nz['timeout'] = 3*60;
-					}
-					if($r==3)
-					{
-						if($_POST['onlyfor']!='')
-						{
-							$nz['withUser'] = mysql_real_escape_string($_POST['onlyfor']);
-						}
-					}
-					$nz['razdel'] = $r;
-					$nz['time_start'] = 0;
-					$nz['min_lvl_1'] = 0;
-					$nz['min_lvl_2'] = 0;
-					$nz['max_lvl_1'] = 21;
-					$nz['max_lvl_2'] = 21;
-					$nz['tm1max'] = 0;
-					$nz['tm2max'] = 0;
-					$nz['invise'] = 0;
-					$nz['money'] = 0;
-					$nz['comment'] = '';
-					$nz['tm1'] = 0;
-					$nz['tm2'] = 0;
-					$nz['otmorozok'] = 0;
-					$gad = 1;
-					if($r==3)
-					{
-						$nz['money'] = $money;
-					}
-					if($r==5 && $u->info['level']>1)
-					{
-						//��������� ���
-						if($_POST['startime2'])
-						{
-							$nz['time_start'] = (int)$_POST['startime2'];
-							$nz['comment'] = substr($_POST['cmt'], 0, 40);
-							$nz['comment'] = str_replace('"','&quot;',$nz['comment']);
-							$nz['comment'] = htmlspecialchars($nz['comment'],NULL,'cp1251');
-							if($nz['time_start']!=180 && $nz['time_start']!=300 && $nz['time_start']!=600 && $nz['time_start']!=900 && $nz['time_start']!=1200 && $nz['time_start']!=1800)
-							{
-								$nz['time_start'] = 600;
-							}
-							
-							if(isset($_POST['mut_hidden']))
-							{
-								$nz['invise'] = 1;
-							}
-							if(isset($_POST['noinc']))	{
-								$nz['noinc'] = 1;
-							}
-							if(isset($_POST['fastfight']))	{
-								$nz['fastfight'] = 1;
-							}
-							if(isset($_POST['otmorozok'])) {
-								$nz['otmorozok'] = 1;
-							}
-							if(isset($_POST['nobot']))	{
-								$nz['nobot'] = 1;
-							}
-							if(isset($_POST['kingfight']))	{
-								$nz['kingfight'] = 1;
-							}
-							if(isset($_POST['arand']))	{
-								$nz['arand'] = 1;
-							}
-							if(isset($_POST['travma']))	{
-								$nz['travmaChance'] = 100;
-							}
-							if(isset($_POST['noatack']))	{
-								$nz['noatack'] = 1;
-							}
-							if(isset($_POST['noeff']))	{
-								$nz['noeff'] = 1;
-							}
-							if(isset($_POST['smert']))	{
-								$nz['smert'] = 1;
-							}
-							if(isset($_POST['noart']))	{
-								$nz['noart'] = 1;
-							}
-							if( $nz['kingfight'] == 1 && $nz['fastfight'] == 1 ) {
-								$nz['kingfight'] = 0;
-							}
-							
-							$nz['timeout'] = (int)$_POST['timeout'];
-							if($nz['timeout']!=1 && $nz['timeout']!=2 && $nz['timeout']!=3 && $nz['timeout']!=4 && $nz['timeout']!=5)
-							{
-								$nz['timeout'] = 3;
-							}
-							
-							//���������� ������ ��������
-							$lvl = (int)$_POST['levellogin1'];
-							if($lvl == 0)
-							{
-								$nz['min_lvl_1'] = 2;
-								$nz['max_lvl_1'] = 21;
-							}elseif($lvl == 3)
-							{
-								$nz['min_lvl_1'] = $u->info['level'];
-								$nz['max_lvl_1'] = $u->info['level'];
-								$nz['min_lvl_2'] = $nz['min_lvl_1'];
-								$nz['max_lvl_2'] = $nz['min_lvl_2'];
-							}elseif($lvl == 6)
-							{
-								$nz['min_lvl_1'] = $u->info['level']-1;
-								$nz['max_lvl_2'] = $u->info['level']+1;
-							}else{
-								$nz['min_lvl_1'] = 2;
-								$nz['max_lvl_1'] = 2;
-							}
-							
-							if((int)$_POST['k']==1)
-							{
-								//�������� ���
-								$nz['type'] = 1;
-							}
-							if((int)$_POST['k']==2)
-							{
-								//�������� ���
-								$nz['type'] = 6;
-								$nz['travmaChance'] = 1;
-							}
-							$nz['timeout'] = $nz['timeout']*60;
-							
-							$nz['tm1'] = $u->stats['reting'];
-							
-							if( $u->info['no_zv_key'] != true ) { 
-								if( $_POST['code21'] == 0 || $_POST['code21'] != $_SESSION['code2'] || $_SESSION['code2'] == 0 || !isset($_SESSION['code2']) ) {
-									$this->error = '������������ ��� �������������';
-									$gad = 0;
-								}
-							}
-							
-						}else{
-							$gad = 0; $this->error = '���-�� �� ���...<br>';
-						}
-					}elseif($r==4 && $u->info['level']>1)
-					{
-						//��������� ���
-						//'Array ( [startime] => 300 [timeout] => 1 [nlogin1] => 11 [levellogin1] => 0 [nlogin2] => 11 [levellogin2] => 0 [k] => 1 [travma] => on [mut_clever] => on [cmt] => ���� [open] => ������ ��������! :) )';
-						//����� ������� � ��������� ������ �� ��������� ���
-						if($_POST['startime'])
-						{
-							$nz['time_start'] = (int)$_POST['startime'];
-							$nz['comment'] = substr($_POST['cmt'], 0, 40);
-							$nz['comment'] = str_replace('"','&quot;',$nz['comment']);
-							if($nz['time_start']!=300 && $nz['time_start']!=600 && $nz['time_start']!=900 && $nz['time_start']!=1200 && $nz['time_start']!=1800)
-							{
-								$nz['time_start'] = 600;
-							}
-							
-							$nz['timeout'] = (int)$_POST['timeout'];
-							if($nz['timeout']!=1 && $nz['timeout']!=2 && $nz['timeout']!=3 && $nz['timeout']!=4 && $nz['timeout']!=5)
-							{
-								$nz['timeout'] = 3;
-							}
-							
-							$nz['timeout'] = $nz['timeout']*60;
-							
-							$nz['tm1max'] = (int)$_POST['nlogin1'];
-							if($nz['tm1max']<1 || $nz['tm1max']>99)
-							{
-								$this->error .= '�������� ���-�� ���������<br>';
-								$gad = 0;
-							}
-							
-							$nz['tm2max'] = (int)$_POST['nlogin2'];
-							if($nz['tm2max']<1 || $nz['tm2max']>99)
-							{
-								$this->error .= '�������� ���-�� �����������<br>';
-								$gad = 0;
-							}
-							
-							if( $this->testTravm() == 1 &&  $_POST['k'] != 1 ) {
-								$this->error = '�� ������������. � ������ �������� �������� �������� ���.';
-								$gad = 0;
-							}elseif( $this->testTravm() == 2 ) {
-								$this->error = '�� ������������. � ������ �������� ���������� ���������.';
-								$gad = 0;
-							}elseif($nz['tm1max']+$nz['tm2max']<3)
-							{
-								$this->error .= '������ 1 �� 1 �������� � ������� ���������� ��� ���������� ���<br>';
-								$gad = 0;
-							}
-														
-							//���������� ������ ��������
-							$lvl = (int)$_POST['levellogin1'];
-							if($lvl == 0)
-							{
-								$nz['min_lvl_1'] = 2;
-								$nz['max_lvl_1'] = 21;
-							}elseif($lvl == 1)
-							{
-								$nz['min_lvl_1'] = 2;
-								$nz['max_lvl_1'] = $u->info['level'];
-							}elseif($lvl == 2)
-							{
-								$nz['min_lvl_1'] = 2;
-								$nz['max_lvl_1'] = $u->info['level']-1;
-							}elseif($lvl == 3)
-							{
-								$nz['min_lvl_1'] = $u->info['level'];
-								$nz['max_lvl_1'] = $u->info['level'];
-							}elseif($lvl == 4)
-							{
-								$nz['min_lvl_1'] = $u->info['level'];
-								$nz['max_lvl_1'] = $u->info['level']+1;
-							}elseif($lvl == 5)
-							{
-								$nz['min_lvl_1'] = $u->info['level']-1;
-								$nz['max_lvl_1'] = $u->info['level'];
-							}elseif($lvl == 6)
-							{
-								$nz['min_lvl_1'] = $u->info['level']-1;
-								$nz['max_lvl_1'] = $u->info['level']+1;
-							}elseif($lvl == 6){
-								$nz['min_lvl_1'] = 99;
-							}else{
-								$this->error = '���-�� �� ���...<br>';
-								$gad = 0;
-							}
-							
-							//���������� ������ ����������
-							$lvl = (int)$_POST['levellogin2'];
-							if($lvl == 0)
-							{
-								$nz['min_lvl_2'] = 2;
-								$nz['max_lvl_2'] = 21;
-							}elseif($lvl == 1)
-							{
-								$nz['min_lvl_2'] = 2;
-								$nz['max_lvl_2'] = $u->info['level'];
-							}elseif($lvl == 2)
-							{
-								$nz['min_lvl_2'] = 2;
-								$nz['max_lvl_2'] = $u->info['level']-1;
-							}elseif($lvl == 3)
-							{
-								$nz['min_lvl_2'] = $u->info['level'];
-								$nz['max_lvl_2'] = $u->info['level'];
-							}elseif($lvl == 4)
-							{
-								$nz['min_lvl_2'] = $u->info['level'];
-								$nz['max_lvl_2'] = $u->info['level']+1;
-							}elseif($lvl == 5)
-							{
-								$nz['min_lvl_2'] = $u->info['level']-1;
-								$nz['max_lvl_2'] = $u->info['level'];
-							}elseif($lvl == 6)
-							{
-								$nz['min_lvl_2'] = $u->info['level']-1;
-								$nz['max_lvl_2'] = $u->info['level']+1;
-							}elseif($lvl == 6){
-								$nz['min_lvl_2'] = 99;
-							}else{
-								$this->error = '���-�� �� ���...<br>';
-								$gad = 0;
-							}
-							
-							if($nz['min_lvl_1']<2){ $nz['min_lvl_1'] = 2; }
-							if($nz['max_lvl_1']>21){ $nz['max_lvl_1'] = 21; }
-							if($nz['min_lvl_2']<2){ $nz['min_lvl_2'] = 2; }
-							if($nz['max_lvl_2']>21){ $nz['max_lvl_2'] = 21; }
-														
-							if((int)$_POST['k']==1)
-							{
-								//�������� ���
-								$nz['type'] = 1;
-							}
-							if((int)$_POST['k']==2)
-							{
-								//�������� ���
-								$nz['type'] = 6;
-								$nz['travmaChance'] = 100;
-							}
-							
-						}else{
-							$gad = 0;
-							$this->error = '���-�� �� ���...<br>';
-						}
-					}
-					
-					$bt2 = (int)$_POST['bots2'];
-					if($bt2!=0 && $r==4 && $u->info['level']>1){ $bt2 = 1; $nz['min_lvl_2'] = $u->info['level']; $nz['max_lvl_2'] = $u->info['level']; $nz['min_lvl_1'] = $u->info['level']; $nz['max_lvl_1'] = $u->info['level'];  }else{ $bt2 = 0; }				
-					/*if( ($u->info['level'] == 8 || $u->info['level'] == 9) && $r == 5 ) {
-						$test_zv_lvl = mysql_fetch_array(mysql_query('SELECT `id` FROM `zayvki` WHERE `city` = "'.$u->info['city'].'" AND `cancel` = "0" AND `min_lvl_1` = '.$u->info['level'].' AND `max_lvl_1` = '.$u->info['level'].' AND `btl_id` = 0 AND `razdel` = 5 LIMIT 1'));
-						if( isset($test_zv_lvl['id']) ) {
-							$gad = 0;
-							$this->error = '������ ��� ������ ������ ��� ����. ������� ��.';
-						}
-					}*/
-					//$test_zvl = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `creator` = "'.$u->info['id'].'" AND `start` = 0 AND `cancel` = 0 LIMIT 1'));										
-					//if(isset($test_zvl['id'])) {
-					//	$gad = 0;
-					//	$this->error = '�� ��� ������ ������... � '.$test_zvl['id'].'<br>';
-					//}
-					if($gad==1)
-					{
-						if(!isset($nz['withUser'])){ $nz['withUser'] = ''; }
-						$nz['time_create_zv'] = time();
-						if( $nz['razdel'] == 4 || $nz['razdel'] == 5 ) {
-							//��������� ����� ��� �����
-							$nz['time_create_zv'] = strtotime(date('d.m.Y H:i',$nz['time_create_zv']).':00',$nz['time_create_zv']);
-						}elseif( $nz['razdel'] == 3 ) {
-							$nz['noinc'] = 1;	
-						}
-						$nz['teams'] = 2;
-						$nz['align1'] = 0;
-						$nz['align2'] = 0;
-						$nz['align3'] = 0;
-						if( isset($_POST['3align']) ) {
-							$nz['teams'] = 3;
-							$nz['min_lvl_1'] = 2;
-							$nz['min_lvl_2'] = 2;
-							$nz['max_lvl_1'] = 21;
-							$nz['max_lvl_2'] = 21;
-							//
-							if( floor($u->info['align']) == 3 ) {
-								$nz['align1'] = 3;
-								$nz['align2'] = 1;
-								$nz['align3'] = 7;
-							}elseif( floor($u->info['align']) == 7 ) {
-								$nz['align1'] = 7;
-								$nz['align2'] = 1;
-								$nz['align3'] = 3;
-							}else{
-								$nz['align1'] = 1;
-								$nz['align2'] = 3;
-								$nz['align3'] = 7;
-							}
-							//
-						}
-						//
-						if( $nz['razdel'] == 2 && isset($_POST['commentfiz'])) {
-							$nz['comment'] = htmlspecialchars($_POST['commentfiz'],NULL,'cp1251');
-						}
-						//
-						if( $nz['razdel'] == 5 ) {
-							$nz['maxplayers'] = array(
-								6 => 6,
-								8 => 8,
-								10 => 10,
-								12 => 12,
-								14 => 14,
-								16 => 16,
-								18 => 18,
-								20 => 20,
-								40 => 40								
-							);
-							if(isset($nz['players'][$_POST['players']])) {
-								$nz['maxplayers'];
-							}else{
-								$nz['maxplayers'] = $nz['maxplayers'][$_POST['players']];
-							}
-						}
-						//
-						$ins = mysql_query('INSERT INTO `zayvki` (`maxplayers`,`otmorozok`,`align1`,`align2`,`align3`,`teams`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`noinc`,`bot1`,`bot2`,`time`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`tm1max`,`tm2max`,`travmaChance`,`invise`,`razdel`,`comment`,`money`,`withUser`,`tm1`,`tm2`) VALUES (
-																"'.$nz['maxplayers'].'",
-																"'.$nz['otmorozok'].'",
-																"'.$nz['align1'].'",
-																"'.$nz['align2'].'",
-																"'.$nz['align3'].'",																
-																"'.$nz['teams'].'",
-																"'.$nz['smert'].'",
-																"'.$nz['noart'].'",
-																"'.$nz['noeff'].'",
-																"'.$nz['noatack'].'",
-																"'.$nz['arand'].'",
-																"'.$nz['kingfight'].'",
-																"'.$nz['nobot'].'",
-																"'.$nz['fastfight'].'",
-																"'.$nz['noinc'].'",
+        }
+        $r .= '</div></td></tr></table>';
+        unset($stt, $ph, $pm);
+        return $r;
+    }
+
+    public function cancelGroup($zv, $uids)
+    {
+        global $u;
+
+        if ($zv['priz'] > 0) {
+            $sp = mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $zv['id'] . '"');
+        }
+        $upd = mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `zv` = "' . $zv['id'] . '"');
+        if ($upd) {
+            $upd = mysql_query('UPDATE `zayvki` SET `cancel` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '"');
+            if ($upd && $uids != '') {
+                if ($zv['priz'] > 0) {
+                    while ($pl = mysql_fetch_array($sp)) {
+                        //������ �� 1 ������
+                        if ($zv['type'] == 33) //��� ����� �� �������� ������� ��������� � ������ �����
+                        {
+                            $pld = mysql_fetch_array(mysql_query('SELECT `id` FROM `users` WHERE `inUser` = "' . $pl['id'] . '"'));
+                            if (isset($pld['id'])) {
+                                mysql_query('UPDATE `users` SET `inUser` = "0" WHERE `id` = "' . $pld['id'] . '" LIMIT 1');
+                                $u->addItem(4754, $pld['id'], '');
+                                $uids = $pld['id'];
+                                mysql_query('DELETE FROM `users` WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                                mysql_query('DELETE FROM `stats` WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                                mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $pl['id'] . '" LIMIT 100');
+                                mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $pl['id'] . '" LIMIT 100');
+                            }
+                        } else {
+                            $u->addItem(4754, $pl['id'], '');
+                        }
+                    }
+                    $text = ' �� ������� ������ �������� �� �������: ������ �� �������. �� ��������� �������� ����� (�1)';
+                } else {
+                    $text = ' �� ������� ������ �������� �� �������: ������ �� �������.';
+                }
+                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $zv['city'] . "','','','" . $uids . "','" . $text . "','" . time() . "','6','0')");
+            }
+        }
+    }
+
+    public function add()
+    {
+        global $u, $c, $code;
+        if (isset($_GET['r']) && $u->info['inTurnirnew'] == 0) {
+            $r = round(intval($_GET['r']));
+            if (in_array($r, [1, 4, 5, 8, 10])) {
+                $az = 1;
+                if ($r == 1 && $u->info['level'] > 0) {
+                    $az = 0;
+                    $this->error = '�� ��� ������� �� ��������� ;)';
+                }
+                if (($r == 4 || $r == 5) && $u->info['level'] < 2) {
+                    $az = 0;
+                    $this->error = '� ' . $this->z1n[$r] . ' ��� ������ �� ������� ������.';
+                }
+
+                if ($this->testTravm() == 1 && $_POST['k'] != 1) {
+                    $this->error = '�� ������������. � ������ �������� �������� �������� ���.';
+                    $az = 0;
+                } elseif ($this->testTravm() == 2) {
+                    $this->error = '�� ������������. � ������ �������� ���������� ���������.';
+                    $az = 0;
+                } elseif ($u->info['hpNow'] < $u->stats['hpAll'] / 100 * 30 && ($r >= 1 || $r <= 3)) {
+                    $this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
+                    $az = 0;
+                }
+                if ($u->info['zv'] > 0) {
+                    $az = 0;
+                    $this->error = '�� ��� �������� � ������.';
+                }
+                if ($az == 1) {
+                    $nz = [];
+                    $nz['city'] = $u->info['city'];
+                    $nz['creator'] = $u->info['id'];
+                    $nz['type'] = 0;
+                    if ($_POST['k'] == 1) {
+                        $nz['type'] = 1;
+                    }
+                    if ($_POST['k'] == 2) {
+                        $nz['type'] = 6;
+                        $nz['travmaChance'] = 100;
+                    }
+                    $_POST['timeout'] = round(intval(mysql_real_escape_string($_POST['timeout'])));
+                    if ($_POST['timeout'] == 1 || $_POST['timeout'] == 2 || $_POST['timeout'] == 3 || $_POST['timeout'] == 4 || $_POST['timeout'] == 5) {
+                        $nz['timeout'] = $_POST['timeout'] * 60;
+                    } else {
+                        $nz['timeout'] = 3 * 60;
+                    }
+
+                    $nz['razdel'] = $r;
+                    $nz['time_start'] = 0;
+                    $nz['min_lvl_1'] = 0;
+                    $nz['min_lvl_2'] = 0;
+                    $nz['max_lvl_1'] = 21;
+                    $nz['max_lvl_2'] = 21;
+                    $nz['tm1max'] = 0;
+                    $nz['tm2max'] = 0;
+                    $nz['invise'] = 0;
+                    $nz['money'] = 0;
+                    $nz['comment'] = '';
+                    $nz['tm1'] = 0;
+                    $nz['tm2'] = 0;
+                    $nz['otmorozok'] = 0;
+                    $gad = 1;
+
+                    if ($r == 5 && $u->info['level'] > 1) {
+                        //��������� ���
+                        if ($_POST['startime2']) {
+                            $nz['time_start'] = (int)$_POST['startime2'];
+                            $nz['comment'] = substr($_POST['cmt'], 0, 40);
+                            $nz['comment'] = str_replace('"', '&quot;', $nz['comment']);
+                            $nz['comment'] = htmlspecialchars($nz['comment'], null, 'cp1251');
+                            if ($nz['time_start'] != 180 && $nz['time_start'] != 300 && $nz['time_start'] != 600 && $nz['time_start'] != 900 && $nz['time_start'] != 1200 && $nz['time_start'] != 1800) {
+                                $nz['time_start'] = 600;
+                            }
+
+                            if (isset($_POST['mut_hidden'])) {
+                                $nz['invise'] = 1;
+                            }
+                            if (isset($_POST['noinc'])) {
+                                $nz['noinc'] = 1;
+                            }
+                            if (isset($_POST['fastfight'])) {
+                                $nz['fastfight'] = 1;
+                            }
+                            if (isset($_POST['otmorozok'])) {
+                                $nz['otmorozok'] = 1;
+                            }
+                            if (isset($_POST['nobot'])) {
+                                $nz['nobot'] = 1;
+                            }
+                            if (isset($_POST['kingfight'])) {
+                                $nz['kingfight'] = 1;
+                            }
+                            if (isset($_POST['arand'])) {
+                                $nz['arand'] = 1;
+                            }
+                            if (isset($_POST['travma'])) {
+                                $nz['travmaChance'] = 100;
+                            }
+                            if (isset($_POST['noatack'])) {
+                                $nz['noatack'] = 1;
+                            }
+                            if (isset($_POST['noeff'])) {
+                                $nz['noeff'] = 1;
+                            }
+                            if (isset($_POST['smert'])) {
+                                $nz['smert'] = 1;
+                            }
+                            if (isset($_POST['noart'])) {
+                                $nz['noart'] = 1;
+                            }
+                            if ($nz['kingfight'] == 1 && $nz['fastfight'] == 1) {
+                                $nz['kingfight'] = 0;
+                            }
+
+                            $nz['timeout'] = (int)$_POST['timeout'];
+                            if ($nz['timeout'] != 1 && $nz['timeout'] != 2 && $nz['timeout'] != 3 && $nz['timeout'] != 4 && $nz['timeout'] != 5) {
+                                $nz['timeout'] = 3;
+                            }
+
+                            //���������� ������ ��������
+                            $lvl = (int)$_POST['levellogin1'];
+                            if ($lvl == 0) {
+                                $nz['min_lvl_1'] = 2;
+                                $nz['max_lvl_1'] = 21;
+                            } elseif ($lvl == 3) {
+                                $nz['min_lvl_1'] = $u->info['level'];
+                                $nz['max_lvl_1'] = $u->info['level'];
+                                $nz['min_lvl_2'] = $nz['min_lvl_1'];
+                                $nz['max_lvl_2'] = $nz['min_lvl_2'];
+                            } elseif ($lvl == 6) {
+                                $nz['min_lvl_1'] = $u->info['level'] - 1;
+                                $nz['max_lvl_2'] = $u->info['level'] + 1;
+                            } else {
+                                $nz['min_lvl_1'] = 2;
+                                $nz['max_lvl_1'] = 2;
+                            }
+
+                            if ((int)$_POST['k'] == 1) {
+                                //�������� ���
+                                $nz['type'] = 1;
+                            }
+                            if ((int)$_POST['k'] == 2) {
+                                //�������� ���
+                                $nz['type'] = 6;
+                                $nz['travmaChance'] = 1;
+                            }
+                            $nz['timeout'] = $nz['timeout'] * 60;
+                            $nz['tm1'] = $u->stats['reting'];
+
+                            if (!$u->info['no_zv_key'] && ($_POST['code21'] == 0 || $_POST['code21'] != $_SESSION['code2'] || $_SESSION['code2'] == 0 || !isset($_SESSION['code2']))) {
+                                $this->error = '������������ ��� �������������';
+                                $gad = 0;
+                            }
+                        } else {
+                            $gad = 0;
+                            $this->error = '���-�� �� ���...<br>';
+                        }
+                    } elseif ($r == 4 && $u->info['level'] > 1) {
+                        //��������� ���
+                        //����� ������� � ��������� ������ �� ��������� ���
+                        if ($_POST['startime']) {
+                            $nz['time_start'] = (int)$_POST['startime'];
+                            $nz['comment'] = substr($_POST['cmt'], 0, 40);
+                            $nz['comment'] = str_replace('"', '&quot;', $nz['comment']);
+                            if ($nz['time_start'] != 300 && $nz['time_start'] != 600 && $nz['time_start'] != 900 && $nz['time_start'] != 1200 && $nz['time_start'] != 1800) {
+                                $nz['time_start'] = 600;
+                            }
+
+                            $nz['timeout'] = (int)$_POST['timeout'];
+                            if ($nz['timeout'] != 1 && $nz['timeout'] != 2 && $nz['timeout'] != 3 && $nz['timeout'] != 4 && $nz['timeout'] != 5) {
+                                $nz['timeout'] = 3;
+                            }
+
+                            $nz['timeout'] = $nz['timeout'] * 60;
+
+                            $nz['tm1max'] = (int)$_POST['nlogin1'];
+                            if ($nz['tm1max'] < 1 || $nz['tm1max'] > 99) {
+                                $this->error .= '�������� ���-�� ���������<br>';
+                                $gad = 0;
+                            }
+
+                            $nz['tm2max'] = (int)$_POST['nlogin2'];
+                            if ($nz['tm2max'] < 1 || $nz['tm2max'] > 99) {
+                                $this->error .= '�������� ���-�� �����������<br>';
+                                $gad = 0;
+                            }
+
+                            if ($this->testTravm() == 1 && $_POST['k'] != 1) {
+                                $this->error = '�� ������������. � ������ �������� �������� �������� ���.';
+                                $gad = 0;
+                            } elseif ($this->testTravm() == 2) {
+                                $this->error = '�� ������������. � ������ �������� ���������� ���������.';
+                                $gad = 0;
+                            } elseif ($nz['tm1max'] + $nz['tm2max'] < 3) {
+                                $this->error .= '������ 1 �� 1 �������� � ������� ���������� ��� ���������� ���<br>';
+                                $gad = 0;
+                            }
+
+                            //���������� ������ ��������
+                            $lvl = (int)$_POST['levellogin1'];
+                            if ($lvl == 0) {
+                                $nz['min_lvl_1'] = 2;
+                                $nz['max_lvl_1'] = 21;
+                            } elseif ($lvl == 1) {
+                                $nz['min_lvl_1'] = 2;
+                                $nz['max_lvl_1'] = $u->info['level'];
+                            } elseif ($lvl == 2) {
+                                $nz['min_lvl_1'] = 2;
+                                $nz['max_lvl_1'] = $u->info['level'] - 1;
+                            } elseif ($lvl == 3) {
+                                $nz['min_lvl_1'] = $u->info['level'];
+                                $nz['max_lvl_1'] = $u->info['level'];
+                            } elseif ($lvl == 4) {
+                                $nz['min_lvl_1'] = $u->info['level'];
+                                $nz['max_lvl_1'] = $u->info['level'] + 1;
+                            } elseif ($lvl == 5) {
+                                $nz['min_lvl_1'] = $u->info['level'] - 1;
+                                $nz['max_lvl_1'] = $u->info['level'];
+                            } elseif ($lvl == 6) {
+                                $nz['min_lvl_1'] = $u->info['level'] - 1;
+                                $nz['max_lvl_1'] = $u->info['level'] + 1;
+                                $nz['min_lvl_1'] = 99;
+                            } else {
+                                $this->error = '���-�� �� ���...<br>';
+                                $gad = 0;
+                            }
+
+                            //���������� ������ ����������
+                            $lvl = (int)$_POST['levellogin2'];
+                            if ($lvl == 0) {
+                                $nz['min_lvl_2'] = 2;
+                                $nz['max_lvl_2'] = 21;
+                            } elseif ($lvl == 1) {
+                                $nz['min_lvl_2'] = 2;
+                                $nz['max_lvl_2'] = $u->info['level'];
+                            } elseif ($lvl == 2) {
+                                $nz['min_lvl_2'] = 2;
+                                $nz['max_lvl_2'] = $u->info['level'] - 1;
+                            } elseif ($lvl == 3) {
+                                $nz['min_lvl_2'] = $u->info['level'];
+                                $nz['max_lvl_2'] = $u->info['level'];
+                            } elseif ($lvl == 4) {
+                                $nz['min_lvl_2'] = $u->info['level'];
+                                $nz['max_lvl_2'] = $u->info['level'] + 1;
+                            } elseif ($lvl == 5) {
+                                $nz['min_lvl_2'] = $u->info['level'] - 1;
+                                $nz['max_lvl_2'] = $u->info['level'];
+                            } elseif ($lvl == 6) {
+                                $nz['min_lvl_2'] = $u->info['level'] - 1;
+                                $nz['max_lvl_2'] = $u->info['level'] + 1;
+                                $nz['min_lvl_2'] = 99;
+                            } else {
+                                $this->error = '���-�� �� ���...<br>';
+                                $gad = 0;
+                            }
+
+                            if ($nz['min_lvl_1'] < 2) {
+                                $nz['min_lvl_1'] = 2;
+                            }
+                            if ($nz['max_lvl_1'] > 21) {
+                                $nz['max_lvl_1'] = 21;
+                            }
+                            if ($nz['min_lvl_2'] < 2) {
+                                $nz['min_lvl_2'] = 2;
+                            }
+                            if ($nz['max_lvl_2'] > 21) {
+                                $nz['max_lvl_2'] = 21;
+                            }
+
+                            if ((int)$_POST['k'] == 1) {
+                                //�������� ���
+                                $nz['type'] = 1;
+                            }
+                            if ((int)$_POST['k'] == 2) {
+                                //�������� ���
+                                $nz['type'] = 6;
+                                $nz['travmaChance'] = 100;
+                            }
+
+                        } else {
+                            $gad = 0;
+                            $this->error = '���-�� �� ���...<br>';
+                        }
+                    }
+
+                    $bt2 = (int)$_POST['bots2'];
+                    if ($bt2 != 0 && $r == 4 && $u->info['level'] > 1) {
+                        $bt2 = 1;
+                        $nz['min_lvl_2'] = $u->info['level'];
+                        $nz['max_lvl_2'] = $u->info['level'];
+                        $nz['min_lvl_1'] = $u->info['level'];
+                        $nz['max_lvl_1'] = $u->info['level'];
+                    } else {
+                        $bt2 = 0;
+                    }
+
+                    if ($gad == 1) {
+                        if (!isset($nz['withUser'])) {
+                            $nz['withUser'] = '';
+                        }
+                        $nz['time_create_zv'] = time();
+                        if ($nz['razdel'] == 4 || $nz['razdel'] == 5) {
+                            //��������� ����� ��� �����
+                            $nz['time_create_zv'] = strtotime(date('d.m.Y H:i', $nz['time_create_zv']) . ':00', $nz['time_create_zv']);
+                        } elseif ($nz['razdel'] == 3) {
+                            $nz['noinc'] = 1;
+                        }
+                        $nz['teams'] = 2;
+                        $nz['align1'] = 0;
+                        $nz['align2'] = 0;
+                        $nz['align3'] = 0;
+                        if (isset($_POST['3align'])) {
+                            $nz['teams'] = 3;
+                            $nz['min_lvl_1'] = 2;
+                            $nz['min_lvl_2'] = 2;
+                            $nz['max_lvl_1'] = 21;
+                            $nz['max_lvl_2'] = 21;
+                            //
+                            if (floor($u->info['align']) == 3) {
+                                $nz['align1'] = 3;
+                                $nz['align2'] = 1;
+                                $nz['align3'] = 7;
+                            } elseif (floor($u->info['align']) == 7) {
+                                $nz['align1'] = 7;
+                                $nz['align2'] = 1;
+                                $nz['align3'] = 3;
+                            } else {
+                                $nz['align1'] = 1;
+                                $nz['align2'] = 3;
+                                $nz['align3'] = 7;
+                            }
+                            //
+                        }
+                        //
+                        if ($nz['razdel'] == 2 && isset($_POST['commentfiz'])) {
+                            $nz['comment'] = htmlspecialchars($_POST['commentfiz'], null, 'cp1251');
+                        }
+                        //
+                        if ($nz['razdel'] == 5) {
+                            $nz['maxplayers'] = [
+                                6 => 6,
+                                8 => 8,
+                                10 => 10,
+                                12 => 12,
+                                14 => 14,
+                                16 => 16,
+                                18 => 18,
+                                20 => 20,
+                                40 => 40
+                            ];
+                            if (isset($nz['players'][$_POST['players']])) {
+                                $nz['maxplayers'];
+                            } else {
+                                $nz['maxplayers'] = $nz['maxplayers'][$_POST['players']];
+                            }
+                        }
+                        //
+                        $ins = mysql_query('INSERT INTO `zayvki` (`maxplayers`,`otmorozok`,`align1`,`align2`,`align3`,`teams`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`noinc`,`bot1`,`bot2`,`time`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`tm1max`,`tm2max`,`travmaChance`,`invise`,`razdel`,`comment`,`money`,`withUser`,`tm1`,`tm2`) VALUES (
+																"' . $nz['maxplayers'] . '",
+																"' . $nz['otmorozok'] . '",
+																"' . $nz['align1'] . '",
+																"' . $nz['align2'] . '",
+																"' . $nz['align3'] . '",																
+																"' . $nz['teams'] . '",
+																"' . $nz['smert'] . '",
+																"' . $nz['noart'] . '",
+																"' . $nz['noeff'] . '",
+																"' . $nz['noatack'] . '",
+																"' . $nz['arand'] . '",
+																"' . $nz['kingfight'] . '",
+																"' . $nz['nobot'] . '",
+																"' . $nz['fastfight'] . '",
+																"' . $nz['noinc'] . '",
 																"0",
-																"'.((int)$bt2).'",
-																"'.$nz['time_create_zv'].'",
-																"'.$nz['city'].'",
-																"'.$nz['creator'].'",
-																"'.$nz['type'].'",
-																"'.$nz['time_start'].'",
-																"'.mysql_real_escape_string($nz['timeout']).'",
-																"'.mysql_real_escape_string($nz['min_lvl_1']).'",
-																"'.mysql_real_escape_string($nz['min_lvl_2']).'",															
-																"'.mysql_real_escape_string($nz['max_lvl_1']).'",
-																"'.mysql_real_escape_string($nz['max_lvl_2']).'",
-																"'.mysql_real_escape_string($nz['tm1max']).'",
-																"'.mysql_real_escape_string($nz['tm2max']).'",
-																"'.$nz['travmaChance'].'",
-																"'.$nz['invise'].'",
-																"'.$nz['razdel'].'",
-																"'.mysql_real_escape_string($nz['comment']).'",
-																"'.mysql_real_escape_string($nz['money']).'",
-																"'.$nz['withUser'].'","'.$nz['tm1'].'","'.$nz['tm2'].'")');
-						$zid = mysql_insert_id();
-						if($ins)
-						{
-							mysql_query('UPDATE `stats` SET `zv`="'.$zid.'",`team`="1" WHERE `id`="'.$u->info['id'].'" LIMIT 1');
-							$u->info['zv'] = $zid;
-							$this->error = '������ �� ��� ������';
-						}else{
-							$this->error = '�� �� ������ ������ ������...'.$ins;
-						}
-					}
-				}
-			}
-		}
-	}
+																"' . ((int)$bt2) . '",
+																"' . $nz['time_create_zv'] . '",
+																"' . $nz['city'] . '",
+																"' . $nz['creator'] . '",
+																"' . $nz['type'] . '",
+																"' . $nz['time_start'] . '",
+																"' . mysql_real_escape_string($nz['timeout']) . '",
+																"' . mysql_real_escape_string($nz['min_lvl_1']) . '",
+																"' . mysql_real_escape_string($nz['min_lvl_2']) . '",															
+																"' . mysql_real_escape_string($nz['max_lvl_1']) . '",
+																"' . mysql_real_escape_string($nz['max_lvl_2']) . '",
+																"' . mysql_real_escape_string($nz['tm1max']) . '",
+																"' . mysql_real_escape_string($nz['tm2max']) . '",
+																"' . $nz['travmaChance'] . '",
+																"' . $nz['invise'] . '",
+																"' . $nz['razdel'] . '",
+																"' . mysql_real_escape_string($nz['comment']) . '",
+																"' . mysql_real_escape_string($nz['money']) . '",
+																"' . $nz['withUser'] . '","' . $nz['tm1'] . '","' . $nz['tm2'] . '")');
+                        $zid = mysql_insert_id();
+                        if ($ins) {
+                            mysql_query('UPDATE `stats` SET `zv`="' . $zid . '",`team`="1" WHERE `id`="' . $u->info['id'] . '" LIMIT 1');
+                            $u->info['zv'] = $zid;
+                            $this->error = '������ �� ��� ������';
+                        } else {
+                            $this->error = '�� �� ������ ������ ������...' . $ins;
+                        }
+                    }
+                }
+            }
+        }
+    }
 
-	//������������� ���
-	public function addBot()
-	{
-		global $u,$c,$code;
-		/*$trEn = 1;
-		
-		if($u->info['level'] == 0) {
-			/*
-				14 ����� �� ���
-				8 �����
-			*/
-			//$trEn = 0;
-		//}elseif($u->info['level'] == 1) {
-			/*
-				27 ����� �� ���
-				12 �����
-			*/
-			//$trEn = 1;
-		//}elseif($u->info['level'] == 2) {
-			/*
-				27 ����� �� ���
-				12 �����
-			*/
-			//$trEn = 1;
-		//}elseif($u->info['level'] == 3) {
-			/*
-				27 ����� �� ���
-				12 �����
-			*/
-			//$trEn = 1;
-		//}elseif($u->info['level'] == 4) {
-			/*
-				27 ����� �� ���
-				12 �����
-			*/
-			//$trEn = 1;
-		//}else{
-		//	$trEn = floor($u->info['level']+(1.25*$u->info['level']));
-		//}
-		
-		//if($u->info['level']>5 && $u->info['admin']==0) {
-		if(($u->info['level'] <= $c['bot_level'] || $u->info['admin'] > 0) && $u->info['exp'] != 12499) {
-		//if($trEn > $u->info['enNow']) {
-			$bot = $u->addNewbot($id['id'],NULL,$u->info['id'],NULL,true);
-		}else{
-			$bot = false;
-		}
-		if($bot==false)
-		{
-			//if($trEn > $u->info['enNow']) {
-			//	$this->error = '������������� ������� ������� ��� ������ ��������. ���������: '.$trEn.' ��., � ��� ['.floor(0+$u->info['enNow']).'/'.(0+$u->stats['enAll']).']<br>'.
-			//					'<small>��� ���������� ������ ������� - ��������� �������������� "�������", ���� �������������� ���������� � ����������!</small>';
-			//}else{
-				$this->error = '��� � ���������, �������, ������� � ������� ����������� ���������� ������ ��� ���������� ������ 8 ������...<br>�� ������� ������������ ����� ����, ��� ���� ���-�� �� �����������...<br>';
-			//}
-		}elseif($u->info['hpNow']<$u->stats['hpAll']/100*30 && ($r>=1 || $r<=3))
-		{
-			$this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
-			$az = 0;
-		}elseif($u->info['align'] == 2)
-		{
-			$this->error = '�������� �� ����� ��������� �����';
-			$az = 0;
-		}elseif($bot==false)
-		{
-			echo '<br><font color=red>Cannot start battle (no prototype "ND0Clone")</font><br>';
-		}else{
-			//������� �������� � �����
-			$expB = 0;
-			$btl = array('smert' => 0,'noart' => 0,'noeff' => 0,'otmorozok'=>0,'noatack' => 0,'priz' => 0 , 'arand' => 0,'kingfight' => 0,'nobot' => 0,'fastfight' => 0,'players'=>'','timeout'=>60,'type'=>0,'invis'=>0,'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>$expB,'money'=>0,'money3'=>0);
-			$ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`clone`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`,`priz`) VALUES (
-												"'.$btl['otmorozok'].'",
-												"'.$btl['smert'].'",
-												"'.$btl['noart'].'",
-												"'.$btl['noeff'].'",
-												"'.$btl['noatack'].'",
-												"'.$btl['arand'].'",
-												"'.$btl['kingfight'].'",
-												"'.$btl['nobot'].'",
-												"'.$btl['fastfight'].'",												
-												"1",
-												"'.$u->info['city'].'",
-												"'.time().'",
-												"'.$btl['players'].'",
-												"'.$btl['timeout'].'",
-												"'.$btl['type'].'",
-												"'.$btl['invis'].'",
-												"'.$btl['noinc'].'",
-												"'.$btl['travmChance'].'",
-												"'.$btl['typeBattle'].'",
-												"'.$btl['addExp'].'",
-												"'.$btl['money'].'",
-												"'.$btl['priz'].'")');
-			if($ins)
-			{
-				$btl_id = mysql_insert_id();
-				//��������� ������ � ��������	
-				$u->info['enNow'] -= $trEn;					
-				$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" OR `id` = "'.$bot.'" LIMIT 2');
-				mysql_query('UPDATE `stats` SET `team`="1",`enNow` = "'.$u->info['enNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpAll'].'",`team`="2" WHERE `id` = "'.$bot.'" LIMIT 1');
-				//���� ��� ��������, �� ������� ����
-				if($btl['type']==1)
-				{
-					mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
-					mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$bot.'" AND `inOdet`!=0');
-				}
-				
-				//��������� ������, ��� ��� �������
-				$u->info['battle'] = $btl_id;
-				//���������� ��������� � ��� ���� ������
-				mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$u->info['login']."','".time()."','11','0','117')");
-				die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
-			}else{
-				$this->error = 'Cannot start battle (no prototype "ABD0Clone")';
-			}	
-		}
-	}
+    //������������� ���
+    public function addBot()
+    {
+        global $u, $c, $code;
 
-	//������������� ���
-	public function addBotClone($uid)
-	{
-		global $u,$c,$code;
-		
-		//if($u->info['level']>5 && $u->info['admin']==0) {
-		if($u->info['online'] > 0) {
-		//if($trEn > $u->info['enNow']) {
-			$bot = $u->addNewbot($id['id'],NULL,$uid,NULL,false);
-		}else{
-			$bot = false;
-		}
-		if($bot==false)
-		{
-			//if($trEn > $u->info['enNow']) {
-			//	$this->error = '������������� ������� ������� ��� ������ ��������. ���������: '.$trEn.' ��., � ��� ['.floor(0+$u->info['enNow']).'/'.(0+$u->stats['enAll']).']<br>'.
-			//					'<small>��� ���������� ������ ������� - ��������� �������������� "�������", ���� �������������� ���������� � ����������!</small>';
-			//}else{
-				//$this->error = '��� � ���������, �������, ������� � ������� ����������� ���������� ������ ��� ���������� ������ 8 ������...<br>�� ������� ������������ ����� ����, ��� ���� ���-�� �� �����������...<br>';
-				$this->error = '�� ���������� ������ ��������';
-			//}
-		}elseif($u->info['hpNow']<$u->stats['hpAll']/100*30 && ($r>=1 || $r<=3))
-		{
-			$this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
-			$az = 0;
-		}elseif($u->info['align'] == 2)
-		{
-			$this->error = '�������� �� ����� ��������� �����';
-			$az = 0;
-		}elseif($bot==false)
-		{
-			echo '<br><font color=red>Cannot start battle (no prototype "ND0Clone")</font><br>';
-		}else{
-			//������� �������� � �����
-			$expB = 0;
-			$btl = array('priz' => 0 , 'smert' => 0,'noart' => 0,'noeff' => 0,'noatack' => 0,'arand' => 0,'kingfight' => 0,'nobot' => 0,'fastfight' => 0,'players'=>'','timeout'=>60,'type'=>0,'invis'=>0,'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>$expB,'money'=>0,'money3'=>0);
-			$ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`priz`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`clone`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
-												"'.$btl['otmorozok'].'",
-												"'.$btl['priz'].'",
-												"'.$btl['smert'].'",
-												"'.$btl['noart'].'",
-												"'.$btl['noeff'].'",
-												"'.$btl['noatack'].'",
-												"'.$btl['arand'].'",
-												"'.$btl['kingfight'].'",
-												"'.$btl['nobot'].'",
-												"'.$btl['fastfight'].'",												
+        if (($u->info['level'] <= $c['bot_level'] || $u->info['admin'] > 0) && $u->info['exp'] != 12499) {
+            $bot = $u->addNewbot($id['id'], null, $u->info['id'], null, true);
+        } else {
+            $bot = false;
+        }
+        if (!$bot) {
+            $this->error = '��� � ���������, �������, ������� � ������� ����������� ���������� ������ ��� ���������� ������ 8 ������...<br>�� ������� ������������ ����� ����, ��� ���� ���-�� �� �����������...<br>';
+        } elseif ($u->info['hpNow'] < $u->stats['hpAll'] / 100 * 30 && ($r == 1)) {
+            $this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
+            $az = 0;
+        } elseif ($u->info['align'] == 2) {
+            $this->error = '�������� �� ����� ��������� �����';
+            $az = 0;
+        } elseif (!$bot) {
+            echo '<br><font color=red>Cannot start battle (no prototype "ND0Clone")</font><br>';
+        } else {
+            //������� �������� � �����
+            $expB = 0;
+            $btl = ['smert' => 0, 'noart' => 0, 'noeff' => 0, 'otmorozok' => 0, 'noatack' => 0, 'priz' => 0, 'arand' => 0, 'kingfight' => 0, 'nobot' => 0, 'fastfight' => 0, 'players' => '', 'timeout' => 60, 'type' => 0, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0, 'money3' => 0];
+            $ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`clone`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`,`priz`) VALUES (
+												"' . $btl['otmorozok'] . '",
+												"' . $btl['smert'] . '",
+												"' . $btl['noart'] . '",
+												"' . $btl['noeff'] . '",
+												"' . $btl['noatack'] . '",
+												"' . $btl['arand'] . '",
+												"' . $btl['kingfight'] . '",
+												"' . $btl['nobot'] . '",
+												"' . $btl['fastfight'] . '",												
 												"1",
-												"'.$u->info['city'].'",
-												"'.time().'",
-												"'.$btl['players'].'",
-												"'.$btl['timeout'].'",
+												"' . $u->info['city'] . '",
+												"' . time() . '",
+												"' . $btl['players'] . '",
+												"' . $btl['timeout'] . '",
+												"' . $btl['type'] . '",
+												"' . $btl['invis'] . '",
+												"' . $btl['noinc'] . '",
+												"' . $btl['travmChance'] . '",
+												"' . $btl['typeBattle'] . '",
+												"' . $btl['addExp'] . '",
+												"' . $btl['money'] . '",
+												"' . $btl['priz'] . '")');
+            if ($ins) {
+                $btl_id = mysql_insert_id();
+                //��������� ������ � ��������
+                $u->info['enNow'] -= $trEn;
+                $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" OR `id` = "' . $bot . '" LIMIT 2');
+                mysql_query('UPDATE `stats` SET `team`="1",`enNow` = "' . $u->info['enNow'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                mysql_query('UPDATE `stats` SET `hpNow` = "' . $u->stats['hpAll'] . '",`team`="2" WHERE `id` = "' . $bot . '" LIMIT 1');
+                //��������� ������, ��� ��� �������
+                $u->info['battle'] = $btl_id;
+                //���������� ��������� � ��� ���� ������
+                mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','" . $u->info['room'] . "','" . $u->info['login'] . "','" . time() . "','11','0','117')");
+                die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
+            } else {
+                $this->error = 'Cannot start battle (no prototype "ABD0Clone")';
+            }
+        }
+    }
+
+    //������������� ���
+    public function addBotClone($uid)
+    {
+        global $u, $c, $code;
+
+        if ($u->info['online'] > 0) {
+            $bot = $u->addNewbot($id['id'], null, $uid, null, false);
+        } else {
+            $bot = false;
+        }
+        if (!$bot) {
+            $this->error = '�� ���������� ������ ��������';
+        } elseif ($u->info['hpNow'] < $u->stats['hpAll'] / 100 * 30 && ($r >= 1 || $r <= 3)) {
+            $this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
+            $az = 0;
+        } elseif ($u->info['align'] == 2) {
+            $this->error = '�������� �� ����� ��������� �����';
+            $az = 0;
+        } elseif (!$bot) {
+            echo '<br><font color=red>Cannot start battle (no prototype "ND0Clone")</font><br>';
+        } else {
+            //������� �������� � �����
+            $expB = 0;
+            $btl = ['priz' => 0, 'smert' => 0, 'noart' => 0, 'noeff' => 0, 'noatack' => 0, 'arand' => 0, 'kingfight' => 0, 'nobot' => 0, 'fastfight' => 0, 'players' => '', 'timeout' => 60, 'type' => 0, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0, 'money3' => 0];
+            $ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`priz`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`clone`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+												"' . $btl['otmorozok'] . '",
+												"' . $btl['priz'] . '",
+												"' . $btl['smert'] . '",
+												"' . $btl['noart'] . '",
+												"' . $btl['noeff'] . '",
+												"' . $btl['noatack'] . '",
+												"' . $btl['arand'] . '",
+												"' . $btl['kingfight'] . '",
+												"' . $btl['nobot'] . '",
+												"' . $btl['fastfight'] . '",												
+												"1",
+												"' . $u->info['city'] . '",
+												"' . time() . '",
+												"' . $btl['players'] . '",
+												"' . $btl['timeout'] . '",
 												"564",
-												"'.$btl['invis'].'",
-												"'.$btl['noinc'].'",
-												"'.$btl['travmChance'].'",
-												"'.$btl['typeBattle'].'",
-												"'.$btl['addExp'].'",
-												"'.$btl['money'].'")');
-			if($ins)
-			{
-				$btl_id = mysql_insert_id();
-				//��������� ������ � ��������	
-				$u->info['enNow'] -= $trEn;					
-				$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" OR `id` = "'.$bot.'" LIMIT 2');
-				mysql_query('UPDATE `stats` SET `team`="1",`enNow` = "'.$u->info['enNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "'.$bot.'" LIMIT 1');
-				//���� ��� ��������, �� ������� ����
-				if($btl['type']==1)
-				{
-					mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
-					mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$bot.'" AND `inOdet`!=0');
-				}
-				
-				//��������� ������, ��� ��� �������
-				$u->info['battle'] = $btl_id;
-				//���������� ��������� � ��� ���� ������
-				mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$u->info['login']."','".time()."','11','0','117')");
-				die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
-			}else{
-				$this->error = 'Cannot start battle (no prototype "ABD0Clone")';
-			}	
-		}
-	}
+												"' . $btl['invis'] . '",
+												"' . $btl['noinc'] . '",
+												"' . $btl['travmChance'] . '",
+												"' . $btl['typeBattle'] . '",
+												"' . $btl['addExp'] . '",
+												"' . $btl['money'] . '")');
+            if ($ins) {
+                $btl_id = mysql_insert_id();
+                //��������� ������ � ��������
+                $u->info['enNow'] -= $trEn;
+                $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" OR `id` = "' . $bot . '" LIMIT 2');
+                mysql_query('UPDATE `stats` SET `team`="1",`enNow` = "' . $u->info['enNow'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot . '" LIMIT 1');
+                //���� ��� ��������, �� ������� ����
+                if ($btl['type'] == 1) {
+                    mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $u->info['id'] . '" AND `inOdet`!=0');
+                    mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $bot . '" AND `inOdet`!=0');
+                }
 
-	
-	//������
-	public function startIzlom($id2,$lvl)
-	{
-		global $u,$c,$code;
-			$lvl = (int)$lvl;
-			
-			if( $lvl == 8 ) {
-				/*
+                //��������� ������, ��� ��� �������
+                $u->info['battle'] = $btl_id;
+                //���������� ��������� � ��� ���� ������
+                mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','" . $u->info['room'] . "','" . $u->info['login'] . "','" . time() . "','11','0','117')");
+                die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
+            } else {
+                $this->error = 'Cannot start battle (no prototype "ABD0Clone")';
+            }
+        }
+    }
+
+    //������
+    public function startIzlom($id2, $lvl)
+    {
+        global $u, $c, $code;
+        $lvl = (int)$lvl;
+
+        if ($lvl == 8) {
+            /*
 				�������� �������
 				��������� �����������
 				����
 				�������� �������
 				*/
-				$bots = array( '��������','��������� ������','��������� ������','��������� ������','������� ����','���������� ����','������ ����' );
-			}
-			
-			$id2 = rand(0,(count($bots)-1));			
-			$id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "'.$bots[$id2].'" AND `level` <= "'.$u->info['level'].'" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1'));
-			$logins_bot = array();
-			$bot = $u->addNewbot($id['id'],NULL,NULL,$logins_bot,NULL);
-			
-			if(isset($id['id']) && $bot != false)
-			{
-				$logins_bot = $bot['logins_bot'];
-				//������� �������� � �����
-				$expB = -$bot['expB'];
-				$btl = array('priz'=>'','players'=>'','otmorozok'=>0,'timeout'=>60,'type'=>9,'invis'=>0,'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>$expB,'money'=>0,'izlom'=>(int)$id2,'izlomLvl'=>(int)$lvl);
-				$ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`priz`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`,`izlom`,`izlomLvl`) VALUES (
-													"'.$btl['otmorozok'].'",
-													"'.$btl['priz'].'",
-													"'.$btl['smert'].'",
-													"'.$btl['noart'].'",
-													"'.$btl['noeff'].'",
-													"'.$btl['noatack'].'",
-													"'.$btl['arand'].'",
-													"'.$btl['kingfight'].'",
-													"'.$btl['nobot'].'",
-													"'.$btl['fastfight'].'",
-													"'.$u->info['city'].'",
-													"'.time().'",
-													"'.$btl['players'].'",
-													"'.$btl['timeout'].'",
-													"'.$btl['type'].'",
-													"'.$btl['invis'].'",
-													"'.$btl['noinc'].'",
-													"'.$btl['travmChance'].'",
-													"'.$btl['typeBattle'].'",
-													"'.$btl['addExp'].'",
-													"'.$btl['money'].'","'.$btl['izlom'].'","'.$btl['izlomLvl'].'")');
-				if($ins)
-				{
-					$btl_id = mysql_insert_id();
-					//��������� ������ � ��������						
-					$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" OR `id` = "'.$bot['id'].'" LIMIT 2');
-					mysql_query('UPDATE `stats` SET `team`="1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-					mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "'.$bot['id'].'" LIMIT 1');
-					//���� ��� ��������, �� ������� ����
-					if($btl['type']==1)
-					{
-						mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
-						mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$bot['id'].'" AND `inOdet`!=0');
-					}
-					
-					//��������� ������, ��� ��� �������
-					$u->info['battle'] = $btl_id;
-					
-					//��������� ��� 2 ����
-					$id2 = rand(0,(count($bots)-1));			
-					$id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "'.$bots[$id2].'" AND `level` <= "'.$u->info['level'].'" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1'));
-					$bot = $u->addNewbot($id['id'],NULL,NULL,$logins_bot,NULL);
-					if(isset($id['id']) && $bot != false) {
-						$logins_bot = $bot['logins_bot'];
-						mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$bot['id'].'" LIMIT 1');
-						mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "'.$bot['id'].'" LIMIT 1');
-					}
-					$id2 = rand(0,(count($bots)-1));			
-					$id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "'.$bots[$id2].'" AND `level` <= "'.$u->info['level'].'" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1'));
-					$bot = $u->addNewbot($id['id'],NULL,NULL,$logins_bot,NULL);
-					if(isset($id['id']) && $bot != false) {
-						$logins_bot = $bot['logins_bot'];
-						mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$bot['id'].'" LIMIT 1');
-						mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "'.$bot['id'].'" LIMIT 1');
-					}
-					
-					//���������� ��������� � ��� ���� ������
-					mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$u->info['login']."','".time()."','11','0','117')");
-					die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
-				}else{
-					$this->error = 'Cannot start battle (no prototype "ABD0'.$id['id'].'")';
-				}				
-			}else{
-				echo '<br><font color=red>Cannot start battle (no prototype "ND0IZ'.$lvl.'")</font><br>';
-			}
-	}
+            $bots = ['��������', '��������� ������', '��������� ������', '��������� ������', '������� ����', '���������� ����', '������ ����'];
+        }
 
-	public function startBattle($id,$vars = NULL)
-	{
-		global $c,$code,$u;
-		$z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="'.$id.'" AND `start` = "0" AND `cancel` = "0" AND (`time` > "'.(time()-60*60*2).'" OR `razdel` > 3) LIMIT 1'));
-		if ($z['type']==33)
-			{
-				sleep(5);
-			}
-		mysql_query('START TRANSACTION');
-		mysql_query("LOCK TABLES
+        $id2 = rand(0, (count($bots) - 1));
+        $id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "' . $bots[$id2] . '" AND `level` <= "' . $u->info['level'] . '" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1'));
+        $logins_bot = [];
+        $bot = $u->addNewbot($id['id'], null, null, $logins_bot, null);
+
+        if (isset($id['id']) && $bot) {
+            $logins_bot = $bot['logins_bot'];
+            //������� �������� � �����
+            $expB = -$bot['expB'];
+            $btl = ['priz' => '', 'players' => '', 'otmorozok' => 0, 'timeout' => 60, 'type' => 9, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0, 'izlom' => (int)$id2, 'izlomLvl' => (int)$lvl];
+            $ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`priz`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`,`izlom`,`izlomLvl`) VALUES (
+													"' . $btl['otmorozok'] . '",
+													"' . $btl['priz'] . '",
+													"' . $btl['smert'] . '",
+													"' . $btl['noart'] . '",
+													"' . $btl['noeff'] . '",
+													"' . $btl['noatack'] . '",
+													"' . $btl['arand'] . '",
+													"' . $btl['kingfight'] . '",
+													"' . $btl['nobot'] . '",
+													"' . $btl['fastfight'] . '",
+													"' . $u->info['city'] . '",
+													"' . time() . '",
+													"' . $btl['players'] . '",
+													"' . $btl['timeout'] . '",
+													"' . $btl['type'] . '",
+													"' . $btl['invis'] . '",
+													"' . $btl['noinc'] . '",
+													"' . $btl['travmChance'] . '",
+													"' . $btl['typeBattle'] . '",
+													"' . $btl['addExp'] . '",
+													"' . $btl['money'] . '","' . $btl['izlom'] . '","' . $btl['izlomLvl'] . '")');
+            if ($ins) {
+                $btl_id = mysql_insert_id();
+                //��������� ������ � ��������
+                $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" OR `id` = "' . $bot['id'] . '" LIMIT 2');
+                mysql_query('UPDATE `stats` SET `team`="1" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
+
+                //��������� ������, ��� ��� �������
+                $u->info['battle'] = $btl_id;
+
+                //��������� ��� 2 ����
+                $id2 = rand(0, (count($bots) - 1));
+                $id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "' . $bots[$id2] . '" AND `level` <= "' . $u->info['level'] . '" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1'));
+                $bot = $u->addNewbot($id['id'], null, null, $logins_bot, null);
+                if (isset($id['id']) && $bot) {
+                    $logins_bot = $bot['logins_bot'];
+                    mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
+                    mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
+                }
+                $id2 = rand(0, (count($bots) - 1));
+                $id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "' . $bots[$id2] . '" AND `level` <= "' . $u->info['level'] . '" AND `pishera` != "" AND `active` = "1" ORDER BY `level` DESC LIMIT 1'));
+                $bot = $u->addNewbot($id['id'], null, null, $logins_bot, null);
+                if (isset($id['id']) && $bot) {
+                    $logins_bot = $bot['logins_bot'];
+                    mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
+                    mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
+                }
+
+                //���������� ��������� � ��� ���� ������
+                mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','" . $u->info['room'] . "','" . $u->info['login'] . "','" . time() . "','11','0','117')");
+                die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
+            } else {
+                $this->error = 'Cannot start battle (no prototype "ABD0' . $id['id'] . '")';
+            }
+        } else {
+            echo '<br><font color=red>Cannot start battle (no prototype "ND0IZ' . $lvl . '")</font><br>';
+        }
+    }
+
+    public function startBattle($id, $vars = null)
+    {
+        global $c, $code, $u;
+        $z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="' . $id . '" AND `start` = "0" AND `cancel` = "0" AND (`time` > "' . (time() - 60 * 60 * 2) . '" OR `razdel` > 3) LIMIT 1'));
+        if ($z['type'] == 33) {
+            sleep(5);
+        }
+        mysql_query('START TRANSACTION');
+        mysql_query("LOCK TABLES
 		`aaa_monsters` WRITE,
 		`actions` WRITE,
 		`bank` WRITE,
@@ -1418,812 +1238,730 @@ $r .= '</div></td></tr></table>';
 		`user_ico` WRITE,
 		`users_twink` WRITE,
 		`zayvki` WRITE;");
-		$z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="'.$id.'" AND `start` = "0" AND `cancel` = "0" AND (`time` > "'.(time()-60*60*2).'" OR `razdel` > 3) LIMIT 1'));
-		if(isset($z['id']))
-		{
-			$vars = explode('|-|',$vars);
-			if($z['razdel']>=4 && $z['razdel']<=5)
-			{
-				//������ ���������� ��� ���������� ���
-				$btl_id = 0;
-				//$txtz = '';
-				if($z['razdel']==5) 
-				{
-					
-					//����, �������� �� ������� � �������
-					//$sp = mysql_query('SELECT `s`.`id`,`s`.`team`,`s`.`upLevel`,`s`.`btl_cof`,`s`.`exp` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`zv` = "'.$z['id'].'" ORDER BY `u`.`online` DESC LIMIT 200');
+        $z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="' . $id . '" AND `start` = "0" AND `cancel` = "0" AND (`time` > "' . (time() - 60 * 60 * 2) . '" OR `razdel` > 3) LIMIT 1'));
+        if (isset($z['id'])) {
+            $vars = explode('|-|', $vars);
+            if ($z['razdel'] >= 4 && $z['razdel'] <= 5) {
+                //������ ���������� ��� ���������� ���
+                $btl_id = 0;
+                //$txtz = '';
+                if ($z['razdel'] == 5) {
+                    $sp = mysql_query('SELECT `s`.`id`,`s`.`team`,`s`.`upLevel`,`s`.`btl_cof`,`s`.`exp` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`zv` = "' . $z['id'] . '" ORDER BY `s`.`btl_cof` DESC LIMIT 200');
+                    $tsr = rand(0, 100);
+                    if ($tsr >= 70 && $z['type'] != 33) {
+                        $ii = -1;
+                        while ($pl = mysql_fetch_array($sp)) {
+                            $ii++;
+                            $pld[$ii] = $pl;
+                        }
+                        $yy = $ii;
+                        $jj = $ii;//������� c �����
+                        $ii = 0;
+                        $teamA = 0;
+                        $teamAbtlconf = 0;
+                        $teamB = 0;
+                        $teamBbtlconf = 0;
+                        while ($yy > -1) {
+                            if ($ii == 0 || $teamAbtlconf <= $teamBbtlconf) {
+                                if (isset ($pld[$ii])) {
+                                    $teamnew = 1;
+                                    $teamAbtlconf = $teamAbtlconf + $pld[$ii]['btl_cof'];
+                                    $teamA++;
+                                    $idi = $ii;
+                                    mysql_query('UPDATE `stats` SET `team` = "' . $teamnew . '" WHERE `id` = "' . $pld[$idi]['id'] . '" LIMIT 1');
+                                }
+                                $ii++;
+                            } elseif (($teamB - $teamA) <= 0) {
+                                if (isset ($pld[$ii])) {
+                                    $teamnew = 2;
+                                    $teamBbtlconf = $teamBbtlconf + $pld[$ii]['btl_cof'];
+                                    $teamB++;
+                                    $idi = $ii;
+                                    mysql_query('UPDATE `stats` SET `team` = "' . $teamnew . '" WHERE `id` = "' . $pld[$idi]['id'] . '" LIMIT 1');
+                                }
+                                $ii++;
+                            } else {
+                                if (isset ($pld[$ii])) {
+                                    $teamnew = 1;
+                                    $teamAbtlconf = $teamAbtlconf + $pld[$jj]['btl_cof'];
+                                    $teamA++;
+                                    $idi = $jj;
+                                    mysql_query('UPDATE `stats` SET `team` = "' . $teamnew . '" WHERE `id` = "' . $pld[$idi]['id'] . '" LIMIT 1');
+                                }
+                                $jj--;
+                            }
+                            $yy--;
+                        }
+                    } else {
+                        $balansteamA = 0;
+                        $balansteamB = 0;
+                        while ($pl = mysql_fetch_array($sp)) {
+                            $teamnew = rand(1, 2);
+                            if ($balansteamA != $balansteamB) {
+                                if ($balansteamA > $balansteamB) {
+                                    $teamnew = 2;
+                                } else {
+                                    $teamnew = 1;
+                                }
+                            }
+                            mysql_query('UPDATE `stats` SET `team` = "' . $teamnew . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                            if ($teamnew == 1) {
+                                $balansteamA += 1;
+                            } else {
+                                $balansteamB += 1;
+                            }
+                        }
+                    }
+                    unset($sp, $pl);
+                }
+                $btl = [
+                    'otmorozok' => $z['otmorozok'],
+                    'priz' => $z['priz'], 'smert' => $z['smert'], 'noart' => $z['noart'], 'noeff' => $z['noeff'], 'noatack' => $z['noatack'], 'arand' => $z['arand'], 'kingfight' => $z['kingfight'],
+                    'players' => '', 'timeout' => $z['timeout'], 'type' => $z['type'], 'travmChance' => $z['travmChance'], 'invis' => $z['invise'], 'noinc' => 0, 'typeBattle' => 0, 'addExp' => $z['exp'], 'money' => 0, 'money3' => 0];
+                //��� ����� ���
+                $ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`priz`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`razdel`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+													"' . $z['otmorozok'] . '",
+													"' . $z['priz'] . '",
+													"' . $z['smert'] . '",
+													"' . $z['noart'] . '",
+													"' . $z['noeff'] . '",
+													"' . $z['noatack'] . '",
+													"' . $z['arand'] . '",
+													"' . $z['kingfight'] . '",
+													"' . $z['nobot'] . '",
+													"' . $z['fastfight'] . '",												
+													"' . $z['razdel'] . '",
+													"' . $z['city'] . '",
+													"' . time() . '",
+													"' . mysql_real_escape_string($btl['players']) . '",
+													"' . mysql_real_escape_string($btl['timeout']) . '",
+													"' . mysql_real_escape_string($btl['type']) . '",
+													"' . mysql_real_escape_string($btl['invis']) . '",
+													"' . mysql_real_escape_string($btl['noinc']) . '",
+													"' . mysql_real_escape_string($z['travmChance']) . '",
+													"' . mysql_real_escape_string($btl['typeBattle']) . '",
+													"' . mysql_real_escape_string($btl['addExp']) . '",
+													"' . mysql_real_escape_string($btl['money']) . '")');
+                $btl_id = mysql_insert_id();
+                if ($btl_id > 0) {
 
-					$sp = mysql_query('SELECT `s`.`id`,`s`.`team`,`s`.`upLevel`,`s`.`btl_cof`,`s`.`exp` FROM `stats` AS `s` LEFT JOIN `users` AS `u` ON `u`.`id` = `s`.`id` WHERE `s`.`zv` = "'.$z['id'].'" ORDER BY `s`.`btl_cof` DESC LIMIT 200');
-					
-					
-					$tsr = rand(0,100);
-					if($tsr >= 70 && $z['type']!=33) 
-					{
-						
-					
-					$ii=-1;
-					while($pl = mysql_fetch_array($sp))
-					{
-						$ii++;
-						$pld[$ii]=$pl;
-						
-					}
-					
-					$yy=$ii;
-					$jj=$ii;//������� c �����
-					$ii=0;
-					$teamA=0;
-					$teamAbtlconf=0;
-					$teamB=0;
-					$teamBbtlconf=0;
-					while($yy > -1 )
-					{
-						
-						
-						if ($ii == 0)
-						{
-						  if (isset ($pld[$ii])){
-						  $teamnew=1;
-						  $teamAbtlconf=$teamAbtlconf+$pld[$ii]['btl_cof'];
-						  $teamA++;
-						  $idi=$ii;
-						  mysql_query('UPDATE `stats` SET `team` = "'.$teamnew.'" WHERE `id` = "'.$pld[$idi]['id'].'" LIMIT 1');
-						  }
-						  $ii++;
-						}
-						elseif($teamAbtlconf<=$teamBbtlconf)
-						{
-						  if (isset ($pld[$ii])){
-						  $teamnew=1;
-						  $teamAbtlconf=$teamAbtlconf+$pld[$ii]['btl_cof'];
-						  $teamA++;
-						  $idi=$ii;
-						  mysql_query('UPDATE `stats` SET `team` = "'.$teamnew.'" WHERE `id` = "'.$pld[$idi]['id'].'" LIMIT 1');
-						  }
-						  $ii++;
-						}
-						elseif($teamAbtlconf>$teamBbtlconf && ($teamB-$teamA) <= 0)
-						{
-						  if (isset ($pld[$ii])){
-						  $teamnew=2;
-						  $teamBbtlconf=$teamBbtlconf+$pld[$ii]['btl_cof'];
-						  $teamB++;
-						  $idi=$ii;
-						  mysql_query('UPDATE `stats` SET `team` = "'.$teamnew.'" WHERE `id` = "'.$pld[$idi]['id'].'" LIMIT 1');
-						  }
-						  $ii++;
-						}
-						else
-						{
-						  if (isset ($pld[$ii])){
-						  $teamnew=1;
-						  $teamAbtlconf=$teamAbtlconf+$pld[$jj]['btl_cof'];
-						  $teamA++;
-						  $idi=$jj;
-						  mysql_query('UPDATE `stats` SET `team` = "'.$teamnew.'" WHERE `id` = "'.$pld[$idi]['id'].'" LIMIT 1');
-						  }
-						  $jj--;
-						}
-							
-						$yy--;
-						
-					}
-					
-					}
-					
-					else
-					
-					{
-						
-					
-					
-					$balansteamA=0;
-					$balansteamB=0;
-					while($pl = mysql_fetch_array($sp)) 
-					{
-					  
-					  $teamnew=rand(1,2);
-					  
- 					  if ($balansteamA != $balansteamB)
-					  {
-					    if ($balansteamA > $balansteamB) {$teamnew=2;} else {$teamnew=1;};
-					  };
-					  
-					  mysql_query('UPDATE `stats` SET `team` = "'.$teamnew.'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-					  if ($teamnew==1){$balansteamA+=1;}else{$balansteamB+=1;};
-					};
-					
-					}
-					
-					
-					
-					unset($sp,$pl);	
-					//
-				}
-				
-				//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$u->info['city']."','','','','[battle_type[".$z['razdel']."]]".$txtz."','".time()."','6','0')");
-				
-				$btl = array(
-				'otmorozok' => $z['otmorozok'],
-				'priz' => $z['priz'],'smert' => $z['smert'],'noart' => $z['noart'],'noeff' => $z['noeff'],'noatack' => $z['noatack'],'arand' => $z['arand'],'kingfight' => $z['kingfight'],
-				'players'=>'','timeout'=>$z['timeout'],'type'=>$z['type'],'travmChance'=>$z['travmChance'],'invis'=>$z['invise'],'noinc'=>0,'typeBattle'=>0,'addExp'=>$z['exp'],'money'=>0,'money3'=>0);
-				//��� ����� ���
-				$ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`priz`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`razdel`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
-													"'.$z['otmorozok'].'",
-													"'.$z['priz'].'",
-													"'.$z['smert'].'",
-													"'.$z['noart'].'",
-													"'.$z['noeff'].'",
-													"'.$z['noatack'].'",
-													"'.$z['arand'].'",
-													"'.$z['kingfight'].'",
-													"'.$z['nobot'].'",
-													"'.$z['fastfight'].'",												
-													"'.$z['razdel'].'",
-													"'.$z['city'].'",
-													"'.time().'",
-													"'.mysql_real_escape_string($btl['players']).'",
-													"'.mysql_real_escape_string($btl['timeout']).'",
-													"'.mysql_real_escape_string($btl['type']).'",
-													"'.mysql_real_escape_string($btl['invis']).'",
-													"'.mysql_real_escape_string($btl['noinc']).'",
-													"'.mysql_real_escape_string($z['travmChance']).'",
-													"'.mysql_real_escape_string($btl['typeBattle']).'",
-													"'.mysql_real_escape_string($btl['addExp']).'",
-													"'.mysql_real_escape_string($btl['money']).'")');
-				$btl_id = mysql_insert_id();
-				if($btl_id>0)
-				{
-					
-					//���� ��� ��������, �� ������� ����
-					if($z['type']==1) {
-						$sp = mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "'.$z['id'].'"');
-						while($pl = mysql_fetch_array($sp)) {
-							mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$pl['id'].'" AND `inOdet`!=0');
-						}
-					}elseif($z['type']==51) { //�������� ��� ��� �����
-						$sp = mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "'.$z['id'].'"');
-						while($pl = mysql_fetch_array($sp)) {
-							mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$pl['id'].'" AND `2price` > 0');
-						}
-					}
-					
-					//��������� ������ � ��������						
-					$upd1  = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "'.$z['id'].'"');
-					$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE '.$vars[1].'');
-										
-					//��������� ������, ��� ��� �������
-					$upd = mysql_query('UPDATE `zayvki` SET `start` = "'.time().'",`btl_id` = "'.$btl_id.'" WHERE `id` = "'.$z['id'].'" LIMIT 1');
-					$u->info['battle'] = $btl_id;
-					//���������� ��������� � ��� ���� ������
-					mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','-1','".$vars[0]."','".time()."','11','0','117')");
-					/*
-					die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
-					*/
-				}
-			}elseif($z['razdel']>=1 && $z['razdel']<=3)
-			{
-				//������ PvP
-				if($u->info['team']==1 && $u->info['zv']==$z['id'])
-				{
-					$zu = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `zv`="'.$z['id'].'" AND `team` = "2" LIMIT 1'));
-					if(isset($zu['id']))
-					{
-						$uz = mysql_fetch_array(mysql_query('SELECT `login`,`money` FROM `users` WHERE `id`="'.$zu['id'].'" LIMIT 1'));
-						if($zu['clone'] > 0) {
-							//��������� �����
-							$bot = $u->addNewbot(1,NULL,$zu['clone'],NULL,true);
-							if($bot > 0) {
-								mysql_query('DELETE FROM `users` WHERE `id` = "'.$zu['id'].'" LIMIT 1');
-								mysql_query('DELETE FROM `stats` WHERE `id` = "'.$zu['id'].'" LIMIT 1');
-								mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$zu['id'].'" LIMIT 100');
-								mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$zu['id'].'" LIMIT 100');
-								
-								mysql_query('UPDATE `stats` SET `zv` = "'.$z['id'].'",`team` = 2 WHERE `id` = "'.$bot.'" LIMIT 1');
-																							
-								$zu = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `zv`="'.$z['id'].'" AND `team` = "2" LIMIT 1'));
-								$uz = mysql_fetch_array(mysql_query('SELECT `login`,`money` FROM `users` WHERE `id`="'.$zu['id'].'" LIMIT 1'));
-							}
-						}
-						
-						//������� ��������						
-						$btl_id = 0;
-						if($uz['money']<$z['money'] || $u->info['money']<$z['money'])
-						{
-							$z['money'] = 0;
-						}
-						$btl = array('otmorozok' => $z['otmorozok'],'players'=>'','timeout'=>$z['timeout'],'type'=>$z['type'],'travmChance'=>$z['travmChance'],'invis'=>0,'noinc'=>0,'typeBattle'=>0,'addExp'=>0,'money'=>round($z['money'],2),'money3'=>0);
-						$ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
-															"'.mysql_real_escape_string($btl['otmorozok']).'",
-															"'.mysql_real_escape_string($btl['smert']).'",
-															"'.mysql_real_escape_string($btl['noart']).'",
-															"'.mysql_real_escape_string($btl['noeff']).'",
-															"'.mysql_real_escape_string($btl['noatack']).'",
-															"'.mysql_real_escape_string($btl['arand']).'",
-															"'.mysql_real_escape_string($btl['kingfight']).'",
-															"'.mysql_real_escape_string($btl['nobot']).'",
-															"'.mysql_real_escape_string($btl['fastfight']).'",	
-															"'.$u->info['city'].'",
-															"'.time().'",
-															"'.mysql_real_escape_string($btl['players']).'",
-															"'.mysql_real_escape_string($btl['timeout']).'",
-															"'.mysql_real_escape_string($btl['type']).'",
-															"'.mysql_real_escape_string($btl['invis']).'",
-															"'.mysql_real_escape_string($btl['noinc']).'",
-															"'.mysql_real_escape_string($btl['travmChance']).'",
-															"'.mysql_real_escape_string($btl['typeBattle']).'",
-															"'.mysql_real_escape_string($btl['addExp']).'",
-															"'.mysql_real_escape_string($btl['money']).'")');
-						$btl_id = mysql_insert_id();
-						if($ins)
-						{
-							//��������� ������ � ��������						
-							$upd1  = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "'.$z['id'].'" LIMIT 2');
-							$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" OR `id` = "'.$zu['id'].'" LIMIT 2');
-							
-							//���� ��� ��������, �� ������� ����
-							if($z['type']==1) {
-								mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
-								mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$zu['id'].'" AND `inOdet`!=0');
-							}
-							
-							//��������� ������, ��� ��� �������
-							$upd = mysql_query('UPDATE `zayvki` SET `start` = "'.time().'",`btl_id` = "'.$btl_id.'" WHERE `id` = "'.$z['id'].'" LIMIT 1');
+                    //���� ��� ��������, �� ������� ����
+                    if ($z['type'] == 1) {
+                        $sp = mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $z['id'] . '"');
+                        while ($pl = mysql_fetch_array($sp)) {
+                            mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $pl['id'] . '" AND `inOdet`!=0');
+                        }
+                    } elseif ($z['type'] == 51) { //�������� ��� ��� �����
+                        $sp = mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $z['id'] . '"');
+                        while ($pl = mysql_fetch_array($sp)) {
+                            mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $pl['id'] . '" AND `2price` > 0');
+                        }
+                    }
 
-							$u->info['battle'] = $btl_id;
-							
-							//���������� ��������� � ��� ���� ������
-							mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$uz['login']."','".time()."','11','0','117')");
-							die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
-						}else{
-							$this->error = '������ �������� �����.';
-						}	
-					}else{
-						$this->error = '�� �� ������ ������ ��������, ���� ������ ����� �� ������.';
-					}
-				}else{
-					$this->error = '�� �� ������ ������ ��������.';
-				}
-			}
-		}	
-		mysql_query('UNLOCK TABLES');
-		mysql_query('COMMIT');
-	}
+                    //��������� ������ � ��������
+                    $upd1 = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "' . $z['id'] . '"');
+                    $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE ' . $vars[1] . '');
 
-	public function cancelzv()
-	{
-		global $u,$c,$code,$zi;
-		if(isset($_GET['cancelzv'],$zi['id']) && $zi['razdel']>=1 && $zi['razdel']<=3)
-		{
-			$enemy = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team` = "2" LIMIT 1'));
-			if(isset($enemy['id']))
-			{
-				if($zi['razdel']>=1 && $zi['razdel']<=3)
-				{
-					if($u->info['team']==1)
-					{
-						//���������� �� ������ + ����� ��������� � ���
-						$upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "'.$enemy['id'].'" LIMIT 1');
-						if($upd)
-						{
-							mysql_query('UPDATE `users` SET `otk` = (`otk` + 1) WHERE `id` = "'.$zi['id'].'" LIMIT 1');
-							$this->error = '�� �������� '.$enemy['login'].' � ��������';
-							//���������� ��������� � ���
-							$sa = '';
-							if($u->info['sex']==2)
-							{
-								$sa = '�';
-							}
-							$text = ' [login:'.$u->info['login'].'] �������'.$sa.' ��� � ��������.';
-							mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$enemy['city']."','','','".$enemy['login']."','".$text."','".time()."','6','0')");
-						}
-					}elseif($u->info['id']==$enemy['id'] && $zi['start']==0)
-					{
-						//���������� �� ������ + ����� ��������� � ���
-						$upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "'.$enemy['id'].'" LIMIT 1');
-						if($upd)
-						{
-							$uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`login`,`u`.`city`,`u`.`room`,`u`.`id`,`st`.`zv`,`st`.`team` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team` = "1" LIMIT 1'));
-							if(isset($uz['id']))
-							{
-								$this->error = '�� �������� ���� ������ �� ���.';
-								//���������� ��������� � ���
-								$sa = '';
-								if($u->info['sex']==2)
-								{
-									$sa = '�';
-								}
-								$text = ' [login:'.$u->info['login'].'] �������'.$sa.' ���� ������ �� ���.';
-								mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$uz['city']."','','','".$uz['login']."','".$text."','".time()."','6','0')");
-							}
-							$u->info['zv'] = 0;
-							$u->info['team'] = 0;
-						}
-					}
-					if($enemy['bot'] == 1) {
-						//������� ���� , �������� � �������
-						mysql_query('DELETE FROM `users` WHERE `id` = "'.$enemy['id'].'" LIMIT 1');
-						mysql_query('DELETE FROM `stats` WHERE `id` = "'.$enemy['id'].'" LIMIT 1');
-						mysql_query('DELETE FROM `items_users` WHERE `uid` = "'.$enemy['id'].'" LIMIT 100');
-						mysql_query('DELETE FROM `eff_users` WHERE `uid` = "'.$enemy['id'].'" LIMIT 100');
-					}
-				}
-			}else{
-				if($zi['razdel']>=1 && $zi['razdel']<=3 && $u->info['team']==1)
-				{
-					//������� ������ �� ���
-					$upd = mysql_query('UPDATE `zayvki` SET `cancel` = "'.time().'" WHERE `id` = "'.$zi['id'].'" LIMIT 1');
-					if($upd)
-					{
-						mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-						$this->error = '�� �������� ���� ������';
-						$zi = false;
-						$u->info['zv'] = 0;
-					}
-				}
-			}
-			
-		}
-	}
-	
-	public function see()
-	{
-		global $u,$c,$code,$zi,$cron;
-		if(isset($_GET['r']) && ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) )
-		{
-			$r = round(intval($_GET['r']));
-			if(($r>=1 && $r<=5) || $r==8)
-			{
-				$this->zv_see = 1;
-				if($u->room['FR']==0 && $u->room['zvsee']==0)
-				{
-					echo '<br><br><br><b><font color="black"><center>������ ������ ����� ������ � �������� ����������� �����</center></font></b>'; $this->zv_see = 0;
-				}elseif($r==1 && $u->info['level']>0)
-				{
-					echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>'; $this->zv_see = 0;
-				}elseif($r>1 && $r<6 && $u->info['level']<1)
-				{
-					echo '<br><br><br><b><font color="black"><center>�� ��� �� ������� �� ��������� ;)</center></font></b>'; $this->zv_see = 0;
-				}elseif($r>3 && $r<6 && $u->info['level']<2)
-				{
-					echo '<br><br><br><b><font color="black"><center>� '.$this->z1n[$r].' ��� ������ �� ������� ������.</center></font></b>'; $this->zv_see = 0;
-				}elseif($r==1 && $u->info['level']>0)
-				{
-					echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>'; $this->zv_see = 0;
-				}elseif($r==8 && $u->info['level'] < 1)
-				{
-					echo '<br><br><br><b><font color="black"><center>��������� ������� � ������� ������ � ������� ������.</center></font></b>'; $this->zv_see = 0;
-				}elseif($u->info['zv']>0 && $u->info['battle']==0 && $r != 8)
-				{
-					if($zi['razdel']==1 || $zi['razdel']==2 || $zi['razdel']==3)
-					{
-						echo '
+                    //��������� ������, ��� ��� �������
+                    $upd = mysql_query('UPDATE `zayvki` SET `start` = "' . time() . '",`btl_id` = "' . $btl_id . '" WHERE `id` = "' . $z['id'] . '" LIMIT 1');
+                    $u->info['battle'] = $btl_id;
+                    //���������� ��������� � ��� ���� ������
+                    mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','-1','" . $vars[0] . "','" . time() . "','11','0','117')");
+
+                }
+            } elseif ($z['razdel'] >= 1 && $z['razdel'] <= 3) {
+                //������ PvP
+                if ($u->info['team'] == 1 && $u->info['zv'] == $z['id']) {
+                    $zu = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `zv`="' . $z['id'] . '" AND `team` = "2" LIMIT 1'));
+                    if (isset($zu['id'])) {
+                        $uz = mysql_fetch_array(mysql_query('SELECT `login`,`money` FROM `users` WHERE `id`="' . $zu['id'] . '" LIMIT 1'));
+                        if ($zu['clone'] > 0) {
+                            //��������� �����
+                            $bot = $u->addNewbot(1, null, $zu['clone'], null, true);
+                            if ($bot > 0) {
+                                mysql_query('DELETE FROM `users` WHERE `id` = "' . $zu['id'] . '" LIMIT 1');
+                                mysql_query('DELETE FROM `stats` WHERE `id` = "' . $zu['id'] . '" LIMIT 1');
+                                mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $zu['id'] . '" LIMIT 100');
+                                mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $zu['id'] . '" LIMIT 100');
+
+                                mysql_query('UPDATE `stats` SET `zv` = "' . $z['id'] . '",`team` = 2 WHERE `id` = "' . $bot . '" LIMIT 1');
+
+                                $zu = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `zv`="' . $z['id'] . '" AND `team` = "2" LIMIT 1'));
+                                $uz = mysql_fetch_array(mysql_query('SELECT `login`,`money` FROM `users` WHERE `id`="' . $zu['id'] . '" LIMIT 1'));
+                            }
+                        }
+
+                        //������� ��������
+                        $btl_id = 0;
+                        if ($uz['money'] < $z['money'] || $u->info['money'] < $z['money']) {
+                            $z['money'] = 0;
+                        }
+                        $btl = ['otmorozok' => $z['otmorozok'], 'players' => '', 'timeout' => $z['timeout'], 'type' => $z['type'], 'travmChance' => $z['travmChance'], 'invis' => 0, 'noinc' => 0, 'typeBattle' => 0, 'addExp' => 0, 'money' => round($z['money'], 2), 'money3' => 0];
+                        $ins = mysql_query('INSERT INTO `battle` (`otmorozok`,`smert`,`noart`,`noeff`,`noatack`,`arand`,`kingfight`,`nobot`,`fastfight`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+															"' . mysql_real_escape_string($btl['otmorozok']) . '",
+															"' . mysql_real_escape_string($btl['smert']) . '",
+															"' . mysql_real_escape_string($btl['noart']) . '",
+															"' . mysql_real_escape_string($btl['noeff']) . '",
+															"' . mysql_real_escape_string($btl['noatack']) . '",
+															"' . mysql_real_escape_string($btl['arand']) . '",
+															"' . mysql_real_escape_string($btl['kingfight']) . '",
+															"' . mysql_real_escape_string($btl['nobot']) . '",
+															"' . mysql_real_escape_string($btl['fastfight']) . '",	
+															"' . $u->info['city'] . '",
+															"' . time() . '",
+															"' . mysql_real_escape_string($btl['players']) . '",
+															"' . mysql_real_escape_string($btl['timeout']) . '",
+															"' . mysql_real_escape_string($btl['type']) . '",
+															"' . mysql_real_escape_string($btl['invis']) . '",
+															"' . mysql_real_escape_string($btl['noinc']) . '",
+															"' . mysql_real_escape_string($btl['travmChance']) . '",
+															"' . mysql_real_escape_string($btl['typeBattle']) . '",
+															"' . mysql_real_escape_string($btl['addExp']) . '",
+															"' . mysql_real_escape_string($btl['money']) . '")');
+                        $btl_id = mysql_insert_id();
+                        if ($ins) {
+                            //��������� ������ � ��������
+                            $upd1 = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "' . $z['id'] . '" LIMIT 2');
+                            $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" OR `id` = "' . $zu['id'] . '" LIMIT 2');
+
+                            //���� ��� ��������, �� ������� ����
+                            if ($z['type'] == 1) {
+                                mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $u->info['id'] . '" AND `inOdet`!=0');
+                                mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $zu['id'] . '" AND `inOdet`!=0');
+                            }
+
+                            //��������� ������, ��� ��� �������
+                            $upd = mysql_query('UPDATE `zayvki` SET `start` = "' . time() . '",`btl_id` = "' . $btl_id . '" WHERE `id` = "' . $z['id'] . '" LIMIT 1');
+
+                            $u->info['battle'] = $btl_id;
+
+                            //���������� ��������� � ��� ���� ������
+                            mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','" . $u->info['room'] . "','" . $uz['login'] . "','" . time() . "','11','0','117')");
+                            die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
+                        } else {
+                            $this->error = '������ �������� �����.';
+                        }
+                    } else {
+                        $this->error = '�� �� ������ ������ ��������, ���� ������ ����� �� ������.';
+                    }
+                } else {
+                    $this->error = '�� �� ������ ������ ��������.';
+                }
+            }
+        }
+        mysql_query('UNLOCK TABLES');
+        mysql_query('COMMIT');
+    }
+
+    public function cancelzv()
+    {
+        global $u, $c, $code, $zi;
+        if (isset($_GET['cancelzv'], $zi['id']) && $zi['razdel'] >= 1 && $zi['razdel'] <= 3) {
+            $enemy = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team` = "2" LIMIT 1'));
+            if (isset($enemy['id'])) {
+                if ($u->info['team'] == 1) {
+                    //���������� �� ������ + ����� ��������� � ���
+                    $upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "' . $enemy['id'] . '" LIMIT 1');
+                    if ($upd) {
+                        mysql_query('UPDATE `users` SET `otk` = (`otk` + 1) WHERE `id` = "' . $zi['id'] . '" LIMIT 1');
+                        $this->error = '�� �������� ' . $enemy['login'] . ' � ��������';
+                        //���������� ��������� � ���
+                        $sa = '';
+                        if ($u->info['sex'] == 2) {
+                            $sa = '�';
+                        }
+                        $text = ' [login:' . $u->info['login'] . '] �������' . $sa . ' ��� � ��������.';
+                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $enemy['city'] . "','','','" . $enemy['login'] . "','" . $text . "','" . time() . "','6','0')");
+                    }
+                } elseif ($u->info['id'] == $enemy['id'] && $zi['start'] == 0) {
+                    //���������� �� ������ + ����� ��������� � ���
+                    $upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "' . $enemy['id'] . '" LIMIT 1');
+                    if ($upd) {
+                        $uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`login`,`u`.`city`,`u`.`room`,`u`.`id`,`st`.`zv`,`st`.`team` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team` = "1" LIMIT 1'));
+                        if (isset($uz['id'])) {
+                            $this->error = '�� �������� ���� ������ �� ���.';
+                            //���������� ��������� � ���
+                            $sa = '';
+                            if ($u->info['sex'] == 2) {
+                                $sa = '�';
+                            }
+                            $text = ' [login:' . $u->info['login'] . '] �������' . $sa . ' ���� ������ �� ���.';
+                            mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $uz['city'] . "','','','" . $uz['login'] . "','" . $text . "','" . time() . "','6','0')");
+                        }
+                        $u->info['zv'] = 0;
+                        $u->info['team'] = 0;
+                    }
+                }
+                if ($enemy['bot'] == 1) {
+                    //������� ���� , �������� � �������
+                    mysql_query('DELETE FROM `users` WHERE `id` = "' . $enemy['id'] . '" LIMIT 1');
+                    mysql_query('DELETE FROM `stats` WHERE `id` = "' . $enemy['id'] . '" LIMIT 1');
+                    mysql_query('DELETE FROM `items_users` WHERE `uid` = "' . $enemy['id'] . '" LIMIT 100');
+                    mysql_query('DELETE FROM `eff_users` WHERE `uid` = "' . $enemy['id'] . '" LIMIT 100');
+                }
+            } else {
+                if ($u->info['team'] == 1) {
+                    //������� ������ �� ���
+                    $upd = mysql_query('UPDATE `zayvki` SET `cancel` = "' . time() . '" WHERE `id` = "' . $zi['id'] . '" LIMIT 1');
+                    if ($upd) {
+                        mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                        $this->error = '�� �������� ���� ������';
+                        $zi = false;
+                        $u->info['zv'] = 0;
+                    }
+                }
+            }
+        }
+    }
+
+    public function see()
+    {
+        global $u, $c, $code, $zi, $cron;
+        if (isset($_GET['r']) && ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id']))) {
+            $r = round(intval($_GET['r']));
+            if (in_array($r, [1, 4, 5, 8, 10])) {
+                $this->zv_see = 1;
+                if ($u->room['FR'] == 0 && $u->room['zvsee'] == 0) {
+                    echo '<br><br><br><b><font color="black"><center>������ ������ ����� ������ � �������� ����������� �����</center></font></b>';
+                    $this->zv_see = 0;
+                } elseif ($r == 1 && $u->info['level'] > 0) {
+                    echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>';
+                    $this->zv_see = 0;
+                } elseif ($r > 1 && $r < 6 && $u->info['level'] < 1) {
+                    echo '<br><br><br><b><font color="black"><center>�� ��� �� ������� �� ��������� ;)</center></font></b>';
+                    $this->zv_see = 0;
+                } elseif ($r > 3 && $r < 6 && $u->info['level'] < 2) {
+                    echo '<br><br><br><b><font color="black"><center>� ' . $this->z1n[$r] . ' ��� ������ �� ������� ������.</center></font></b>';
+                    $this->zv_see = 0;
+                } elseif ($r == 1 && $u->info['level'] > 0) {
+                    echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>';
+                    $this->zv_see = 0;
+                } elseif ($r == 8 && $u->info['level'] < 1) {
+                    echo '<br><br><br><b><font color="black"><center>��������� ������� � ������� ������ � ������� ������.</center></font></b>';
+                    $this->zv_see = 0;
+                } elseif ($r == 10) {
+                    if (\Insallah\Tournament::IS_ENABLED) {
+                    /** ������� by Insallah*/
+                    # ������ �� F5
+                    if (!isset($_SESSION['bypass'])) {
+                        $_SESSION['bypass'] = mt_rand();
+                    }
+                    if ($_SERVER['REQUEST_METHOD'] === 'POST' && $_POST['key'] == $_SESSION['bypass']) {
+                        unset($_SESSION['bypass']);
+                        if (array_key_exists('tournament_start', $_POST)) {
+                            (new \Insallah\Tournament())->join($u->info['id']);
+                        }
+                    }
+                    ##
+                    # ��������� ������ ������ ��������.
+                    $db = new \Insallah\Db();
+                    $tournamentsList = $db::getRows('select * from tournaments');
+                    $tournaments = '<ul>';
+                    foreach ($tournamentsList as $tournament) {
+                        $time = $tournament['start_time'] === -1 ? '������ ��� �������!' : date('G:i', $tournament['start_time']);
+                        $tournament_members_id = \Insallah\TournamentModel::getFreeFighters($tournament['tid']);
+                        $members = [];
+                        foreach ($tournament_members_id as $member) {
+                            $members[] = \Insallah\TournamentModel::uidToLogin($member);
+                        }
+                        $tournaments .= sprintf("<li>������ ��� %d �������.<br>����� ������ ������: %s<br>���������: %s</li>",
+                            $tournament['tid'], $time, implode(', ', $members));
+                    }
+                    $tournaments .= '</ul>';
+                    ?>
+                    <div>
+                        <strong style="color: red;">��������!</strong>
+                        <ul>
+                            <li style="color: blue;">� ������ �������� ���� ������������� � �������, �������� ��� - <u>����������</u>!</li>
+                            <?php if(\Insallah\TournamentModel::isEkrOverpriced($u->info['id'])): ?>
+                            <li>��������� ���������, ������ �� ��� �� ������ ��������� <?= \Insallah\Tournament::ekrOverpriceFormula($u->info['level']) ?> ������������.</li>
+                            <?php endif; ?>
+                            <?php if($u->info['exp'] < \Insallah\Tournament::MIN_EXP): ?>
+                            <li>� ��� ������ ���� �� ����� <?= \Insallah\Tournament::MIN_EXP ?> �����.</li>
+                            <?php endif; ?>
+                            <li style="color: blue;">������ ��������, ����� � ������ �������� <?= \Insallah\Tournament::START_TOURNAMENT ?> �������.</li>
+							<li style="color: blue;">������ �������� 1, 2 � 3 ����� ������� 25, 15, 5 �������� ������, � ��� �� �������� �� ������� � ������� 12 �����, 6 � 3 ���� ��������������!</li>
+                        </ul>
+                    </div>
+                    <?php if(!empty($tournamentsList)): ?>
+                    <div>
+                        <strong>�������� �������.</strong><br>
+                        <?= $tournaments ?>
+                    </div>
+                    <?php endif; ?>
+                    <?php if (!\Insallah\TournamentModel::getTournamentIdByUserId($u->info['id']) || !\Insallah\TournamentModel::isStarted($u->info['level'])): ?>
+                        <form method="post">
+                            <input type="submit" name="tournament_start" value="������� ������� � �������">
+                            <input type="hidden" name="key" value="<?= $_SESSION['bypass'] ?>">
+                        </form>
+                    <?php else: ?>
+                        �� �����������.
+                    <?php endif; ?>
+                    <?php
+                    } else {
+                        ?>
+                        <div>
+                            <strong style="color: crimson;">� ������ ������ ������� �� ����������!</strong>
+                        </div>
+                        <?php
+                    }
+                    /** ����� �������� �� Insallah. */
+                } elseif ($u->info['zv'] > 0 && $u->info['battle'] == 0 && $r != 8) {
+                    if ($zi['razdel'] == 1 || $zi['razdel'] == 2 || $zi['razdel'] == 3) {
+                        echo '
 						<table width="100%" border="0" cellspacing="0" cellpadding="0">
 						  <tr>
 							<td valign="top">';
-							
-							if($u->info['team']==1)
-							{
-								$uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team`="2" LIMIT 1'));
-								if(!isset($uz['id']))
-								{
-									//���� ����� �� ������
-									echo '<div style="float:left;"><div style="float:left;">�� ��� ������ ������ �� ���  <INPUT class="btn btn-danger" onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&cancelzv\';" TYPE=submit name=close value="�������� ������"></div>';
-								}else{
-									//���� ���-�� ������
-									$sa = '';
-									if($uz['sex']==2)
-									{
-										$sa = '�';
-									}
-									echo '<script> zv_Priem = '.(0+$uz['id']).';</script><font color="red"><b>���� ������ ������'.$sa.' '.$ca.'</font></b> '.$u->microLogin($uz['id'],1).'</a><font color="red"><b> ������ ����������� ���? </b></font><INPUT class="btn btn-success" onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&startBattle\';" TYPE=submit name=close value="�����������"> <INPUT class="btn btn-danger" onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&cancelzv\';" TYPE=submit name=close value="��������">';
-								}
-							}else{
-								$uz = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team`="1" LIMIT 1'));
-								if(isset($uz['id']))
-								{
-									echo '������� ������������� ��� �� '.$u->microLogin($uz['id'],1).' <INPUT class="btn" onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&cancelzv\';" TYPE=submit name=close value="�������� ������">';
-								}else{
-									//������� ������
-									
-								}
-							}
-							
-							echo '</td>
-							<td align="right" valign="top">
-								<!-- <div style="float:right;"><INPUT class="btn" onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"></div> -->
-							</td>
-						  </tr>
-						</table></div>';						
-					}else{
-						$tm_start = floor(($zi['time']+$zi['time_start']-time())/6)/10;
-						$tm_start = $this->rzv($tm_start);
-						echo '<!-- <div style="float:right;"><INPUT class="btn" onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"></div> -->
-						<b>������� ������ '.$this->z2n[$zi['razdel']].' ���</b>';
-						$sv0 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$zi['id'].'" LIMIT 100'));
-						/*if($sv0[0] <= 1)
-						{
-							if(isset($_GET['cancelzvnow']))
-							{
-								echo ' <b><font color="red">������ �� ��� ��������</font></b>';
-								mysql_query('UPDATE `zayvki` SET `cancel` = "'.time().'" WHERE `id` = "'.$u->info['zv'].'" LIMIT 1');
-								$u->info['zv'] = 0;
-								mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');								
-							}else{
-								echo ' <a href="main.php?zayvka&r='.$_GET['r'].'&cancelzvnow&rnd='.$code.'" title="�������� ������">��������</a>';
-							}
-						}*/
-						unset($sv0);
-						echo '<br>��� ��� �������� ����� '.$tm_start.' ���.';
-					}
-				}elseif($r==8) {
-					//�������
-					
-					$ttur = array(
-						0 => '������ ����� �����!',
-						1 => '������ ��� �� ����!',
-						2 => '������ �����!'				
-					);
-										
-					if(isset($_POST['trn1']) && $u->room['zvsee']==0) {
-						if($u->info['inTurnirnew'] == 0) {
-							$totr = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "'.mysql_real_escape_string($_POST['trn1']).'" AND `status` = "0" LIMIT 1'));
-							if(isset($totr['id'])) {
-								mysql_query('UPDATE `users` SET `inTurnirnew` = "'.$totr['id'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-								mysql_query('UPDATE `turnirs` SET `users_in` = `users_in` + 1 WHERE `id` = "'.$totr['id'].'" LIMIT 1');
-								$u->info['inTurnirnew'] = $totr['id'];
-								$this->error = '�� ���������� �� ������� � �������.';
-							} else {
-								$this->error = '������ �� ������ �� �������.';
-							}
-						}else{
-							$this->error = '�� ��� ���������� � ������ �� ������.';
-						}
-					}elseif(isset($_GET['cancel13']) && $u->room['zvsee']==0) {
-						if($u->info['inTurnirnew'] > 0) {
-							$totr = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "'.mysql_real_escape_string($u->info['inTurnirnew']).'" AND `status` = "0" LIMIT 1'));
-							if(isset($totr['id'])) {
-								mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-								mysql_query('UPDATE `turnirs` SET `users_in` = `users_in` - 1 LIMIT 1');
-								$u->info['inTurnirnew'] = 0;
-								$this->error = '�� ���������� �� ������ �� ������.';
-							}else{
-								$this->error = '������ ���������� �� ������ �������� � �������.';
-							}
-						}else{
-							$this->error = '�� �� ���������� ������� �� � ����� �� ��������.';
-						}
-					}
-					
-					$dv = '';
-					$trse = '';
-					
-					if($u->info['inTurnirnew'] > 0) {
-						$pl = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "'.$u->info['inTurnirnew'].'" LIMIT 1'));
-						if(!isset($pl['id'])) {
-							mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							echo '���-�� �� ���... �������� ��������.';
-						}else{
-							$dv = '<b><u>��������� ������� ['.$pl['users_in'].']</u></b>:<br>';
-							$spu = mysql_query('SELECT `u`.`id`,`u`.`align`,`u`.`login`,`u`.`clan`,`u`.`level`,`u`.`city`,`u`.`online`,`u`.`sex`,`u`.`cityreg`,`u`.`palpro`,`u`.`invis` FROM `users` AS `u` WHERE `u`.`inTurnirnew` = "'.$pl['id'].'" LIMIT '.$pl['users_in']);
-							$i = 1;
-							while($plu = mysql_fetch_array($spu)) {
-								$dv .= '<div style="padding:3px;">'.$i.'. '.$u->microLogin($plu,2).'</div>';
-								$i++;
-							}
-							echo '
+
+                        if ($u->info['team'] == 1) {
+                            $uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team`="2" LIMIT 1'));
+                            if (!isset($uz['id'])) {
+                                //���� ����� �� ������
+                                echo '<div style="float:left;"><div style="float:left;">�� ��� ������ ������ �� ���  <INPUT class="btn btn-danger" onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&cancelzv\';" TYPE=submit name=close value="�������� ������"></div>';
+                            } else {
+                                //���� ���-�� ������
+                                $sa = '';
+                                if ($uz['sex'] == 2) {
+                                    $sa = '�';
+                                }
+                                echo '<script> zv_Priem = ' . (0 + $uz['id']) . ';</script><font color="red"><b>���� ������ ������' . $sa . ' ' . $ca . '</font></b> ' . $u->microLogin($uz['id'], 1) . '</a><font color="red"><b> ������ ����������� ���? </b></font><INPUT class="btn btn-success" onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&startBattle\';" TYPE=submit name=close value="�����������"> <INPUT class="btn btn-danger" onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&cancelzv\';" TYPE=submit name=close value="��������">';
+                            }
+                        } else {
+                            $uz = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team`="1" LIMIT 1'));
+                            if (isset($uz['id'])) {
+                                echo '������� ������������� ��� �� ' . $u->microLogin($uz['id'], 1) . ' <INPUT class="btn" onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&cancelzv\';" TYPE=submit name=close value="�������� ������">';
+                            }
+                        }
+                        echo '</td><td align="right" valign="top"></td></tr></table></div>';
+                    } else {
+                        $tm_start = floor(($zi['time'] + $zi['time_start'] - time()) / 6) / 10;
+                        $tm_start = $this->rzv($tm_start);
+                        echo '<b>������� ������ ' . $this->z2n[$zi['razdel']] . ' ���</b>';
+                        echo '<br>��� ��� �������� ����� ' . $tm_start . ' ���.';
+                    }
+                } elseif ($r == 8) {
+                    //�������
+
+                    $ttur = [
+                        0 => '������ ����� �����!',
+                        1 => '������ ��� �� ����!',
+                        2 => '������ �����!'
+                    ];
+
+                    if (isset($_POST['trn1']) && $u->room['zvsee'] == 0) {
+                        if ($u->info['inTurnirnew'] == 0) {
+                            $totr = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "' . mysql_real_escape_string($_POST['trn1']) . '" AND `status` = "0" LIMIT 1'));
+                            if (isset($totr['id'])) {
+                                mysql_query('UPDATE `users` SET `inTurnirnew` = "' . $totr['id'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                mysql_query('UPDATE `turnirs` SET `users_in` = `users_in` + 1 WHERE `id` = "' . $totr['id'] . '" LIMIT 1');
+                                $u->info['inTurnirnew'] = $totr['id'];
+                                $this->error = '�� ���������� �� ������� � �������.';
+                            } else {
+                                $this->error = '������ �� ������ �� �������.';
+                            }
+                        } else {
+                            $this->error = '�� ��� ���������� � ������ �� ������.';
+                        }
+                    } elseif (isset($_GET['cancel13']) && $u->room['zvsee'] == 0) {
+                        if ($u->info['inTurnirnew'] > 0) {
+                            $totr = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "' . mysql_real_escape_string($u->info['inTurnirnew']) . '" AND `status` = "0" LIMIT 1'));
+                            if (isset($totr['id'])) {
+                                mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                mysql_query('UPDATE `turnirs` SET `users_in` = `users_in` - 1 LIMIT 1');
+                                $u->info['inTurnirnew'] = 0;
+                                $this->error = '�� ���������� �� ������ �� ������.';
+                            } else {
+                                $this->error = '������ ���������� �� ������ �������� � �������.';
+                            }
+                        } else {
+                            $this->error = '�� �� ���������� ������� �� � ����� �� ��������.';
+                        }
+                    }
+
+                    $dv = '';
+                    $trse = '';
+
+                    if ($u->info['inTurnirnew'] > 0) {
+                        $pl = mysql_fetch_array(mysql_query('SELECT * FROM `turnirs` WHERE `id` = "' . $u->info['inTurnirnew'] . '" LIMIT 1'));
+                        if (!isset($pl['id'])) {
+                            mysql_query('UPDATE `users` SET `inTurnirnew` = "0" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                            echo '���-�� �� ���... �������� ��������.';
+                        } else {
+                            $dv = '<b><u>��������� ������� [' . $pl['users_in'] . ']</u></b>:<br>';
+                            $spu = mysql_query('SELECT `u`.`id`,`u`.`align`,`u`.`login`,`u`.`clan`,`u`.`level`,`u`.`city`,`u`.`online`,`u`.`sex`,`u`.`cityreg`,`u`.`palpro`,`u`.`invis` FROM `users` AS `u` WHERE `u`.`inTurnirnew` = "' . $pl['id'] . '" LIMIT ' . $pl['users_in']);
+                            $i = 1;
+                            while ($plu = mysql_fetch_array($spu)) {
+                                $dv .= '<div style="padding:3px;">' . $i . '. ' . $u->microLogin($plu, 2) . '</div>';
+                                $i++;
+                            }
+                            echo '
 							<script type="text/javascript">
 							function MM_jumpMenu(targ,selObj,restore){ //v3.0
 							  eval("location=\'"+selObj.options[selObj.selectedIndex].value+"\'");
 							  if (restore) selObj.selectedIndex=0;
 							}
 							</script>
-							<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r='.$r.'&rnd='.$code.'\'>
-							<input type="hidden" name="add_new_zv" id="add_new_zv" value="'.floor(time()/3).'" />
+							<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '\'>
+							<input type="hidden" name="add_new_zv" id="add_new_zv" value="' . floor(time() / 3) . '" />
 							<TABLE width=100% cellspacing=0 cellpadding=0>
 								  <TR>
 									<TD valign=top>
-										<font color="red"><b>'.$this->error.'</b></font>
+										<font color="red"><b>' . $this->error . '</b></font>
 										<div style="border-bottom:#b2b2b2 solid 1px;padding:5px;">
-										������ ������� ����� '.$u->timeOut($pl['time']-time()).' <INPUT class="btn" onClick="location=\'main.php?zayvka&r=8&cancel13&tlvl='.$pl['level'].'&rnd='.$code.'\';" TYPE=button name=tmp value="����������">
+										������ ������� ����� ' . $u->timeOut($pl['time'] - time()) . ' <INPUT class="btn" onClick="location=\'main.php?zayvka&r=8&cancel13&tlvl=' . $pl['level'] . '&rnd=' . $code . '\';" TYPE=button name=tmp value="����������">
 										</div>
 										<div style="border-bottom:#b2b2b2 solid 1px;padding:5px;margin-bottom:5px;">
-										'.$dv.'
+										' . $dv . '
 										</div>
 										</TD>
-									<TD align=right valign=top>&nbsp;<!-- <INPUT class="btn" onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&tlvl='.$tlvl.'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"> --></TD>
+									<TD align=right valign=top>&nbsp;</TD>
 								  </TR>
 								</TABLE>
 								</FORM>';
-						}
-					}else{
-						$tlvl = 4;
-						$i = 4;
-						$trnmz = array(4=>'����������',5=>'����������',6=>'���.\���.');
-						while($i <= 6) {
-							if($_GET['tlvl'] == $i) {
-								$trse .= '<option value="https://new-combats.com/main.php?zayvka&r=8&tlvl='.$i.'" selected="selected">'.$trnmz[$i].'</option>';
-								$tlvl = $i;
-							}else{
-								$trse .= '<option value="https://new-combats.com/main.php?zayvka&r=8&tlvl='.$i.'">'.$trnmz[$i].'</option>';
-							}
-							$i++;
-						}						
-						$prb = '<INPUT class="btn" TYPE="submit" name=open value="������� �������">';										
-						echo '<style>.zvnkj { padding:5px; }</style>';						
-						$sp = mysql_query('SELECT * FROM `turnirs` WHERE `status` = "0" AND `level` = "'.$tlvl.'"');
-						$j = 0;
-						while($pl = mysql_fetch_array($sp)) {
-							$j++;
-							$dinf = '������ ����� '.$u->timeOut($pl['time']-time()).'';
-							$dv .= '<label><div class="zvnkj">';							
-							if($u->room['zvsee']==0) {
-								$dv .= '<input type="radio" name="trn1" id="trn1_'.$j.'" value="'.$pl['id'].'">';
-							}
-							$dv .= ' ���������� ������. ���������� �������: '.$pl['users_in'].' ���. | '.$dinf.'</div></label>';
-						}											
-						if($dv == '') {
-							$dv = '������ �������� ��� ������� ���� ����...';
-						}										
-						echo '
+                        }
+                    } else {
+                        $tlvl = 4;
+                        $i = 4;
+                        $trnmz = [4 => '����������', 5 => '����������', 6 => '���.\���.'];
+                        while ($i <= 6) {
+                            if ($_GET['tlvl'] == $i) {
+                                $trse .= '<option value="https://new-combats.com/main.php?zayvka&r=8&tlvl=' . $i . '" selected="selected">' . $trnmz[$i] . '</option>';
+                                $tlvl = $i;
+                            } else {
+                                $trse .= '<option value="https://new-combats.com/main.php?zayvka&r=8&tlvl=' . $i . '">' . $trnmz[$i] . '</option>';
+                            }
+                            $i++;
+                        }
+                        $prb = '<INPUT class="btn" TYPE="submit" name=open value="������� �������">';
+                        echo '<style>.zvnkj { padding:5px; }</style>';
+                        $sp = mysql_query('SELECT * FROM `turnirs` WHERE `status` = "0" AND `level` = "' . $tlvl . '"');
+                        $j = 0;
+                        while ($pl = mysql_fetch_array($sp)) {
+                            $j++;
+                            $dinf = '������ ����� ' . $u->timeOut($pl['time'] - time()) . '';
+                            $dv .= '<label><div class="zvnkj">';
+                            if ($u->room['zvsee'] == 0) {
+                                $dv .= '<input type="radio" name="trn1" id="trn1_' . $j . '" value="' . $pl['id'] . '">';
+                            }
+                            $dv .= ' ���������� ������. ���������� �������: ' . $pl['users_in'] . ' ���. | ' . $dinf . '</div></label>';
+                        }
+                        if ($dv == '') {
+                            $dv = '������ �������� ��� ������� ���� ����...';
+                        }
+                        echo '
 						<script type="text/javascript">
 						function MM_jumpMenu(targ,selObj,restore){ //v3.0
 						  eval("location=\'"+selObj.options[selObj.selectedIndex].value+"\'");
 						  if (restore) selObj.selectedIndex=0;
 						}
 						</script>
-						<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r='.$r.'&rnd='.$code.'\'>
-						<input type="hidden" name="add_new_zv" id="add_new_zv" value="'.floor(time()/3).'" />
+						<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '\'>
+						<input type="hidden" name="add_new_zv" id="add_new_zv" value="' . floor(time() / 3) . '" />
 						<TABLE width=100% cellspacing=0 cellpadding=0>
 							  <TR>
 								<TD valign=top>
-									<font color="red"><b>'.$this->error.'</b></font>
+									<font color="red"><b>' . $this->error . '</b></font>
 									<div style="border-bottom:#b2b2b2 solid 1px;padding:5px;">
 									��� �������:
 										  <SELECT NAME=turlevel onChange="MM_jumpMenu(null,this,0)">
-											'.$trse.'
+											' . $trse . '
 										 </SELECT>
-										 '.$prb.'
+										 ' . $prb . '
 									</div>
 									<div style="border-bottom:#b2b2b2 solid 1px;padding:5px;margin-bottom:5px;">
-									'.$dv.'
+									' . $dv . '
 									</div>
-									'.$prb.'
+									' . $prb . '
 									</TD>
-								<TD align=right valign=top><!-- <INPUT class="btn" onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&tlvl='.$tlvl.'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"> --></TD>
+								<TD align=right valign=top></TD>
 							  </TR>
 							</TABLE>
 							</FORM>';
-					}
-				}elseif($r==1 || $r==2 || $r==3)
-				{
-					//�������,����������,����������
-					$zi = array(1=>'���� �� �� �������� ������� ������, �� ��� ��� ��� ������������ ������ ��� ���������� ����.',2=>'����� �� ������ ����� ���� ���������� ���������� ��� ��������.',3=>'���� �� �������������� � ���-�� ������������ � ��������, �� ����� ����� ������ ������.');
-					$dv = '';
-					if($u->room['zvsee']==0) {
-					if($r==3) {
-						$dv = '<br>����� ����������
-									  <INPUT TYPE=text NAME=onlyfor maxlength=30 size=12>
-									  <BR>
-									  ��� �� ������, ������
-									  <INPUT TYPE=text NAME=stavkakredit size=6 maxlength=10> &nbsp; <INPUT class="btn" TYPE=submit name=open value="������ ������">';
-					}else{
-						if($u->info['level'] <= $c['bot_level'])
-						{
-							$dv = '<b><font color="green">������������� ��� �������� �� '.($c['bot_level']+1).'-�� ������.</font></b> <INPUT class="btn btn-inverse" onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&bot='.$u->info['nextAct'].'\';" TYPE=button name=clone value="������ ��� � ������">';
-						}else{
-							$dv = '';
-							if( $u->info['admin'] > 0 ) {
-								$dv .= ' &nbsp; <b><font color="green">������������� ��� �������� �� '.($c['bot_level']+1).'-�� ������.</font></b> <INPUT class="btn btn-inverse" onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&bot='.$u->info['nextAct'].'\';" TYPE=button name=clone value="������ ��� � ������">';
-							}
-							
-							if ($u->info['level']<9) 
-								{
-									$tstw=' ��� <b>8</b> ������� ����������';
-								}
-							else
-								{
-									$tstw='<input type="text" value="" name="commentfiz" id="commentfiz" style="width:244px; padding:3px;">';
-								}
-							$dv .= '<br>
+                    }
+                } elseif ($r == 1) {
+                    //�������, ���������� � ���������� ���������. ���. 29.05.22
+                    $zi = [
+                        1 => '���� �� �� �������� ������� ������, �� ��� ��� ��� ������������ ������ ��� ���������� ����.',
+                    ];
+                    $dv = '';
+                    if ($u->room['zvsee'] == 0) {
+                        if ($u->info['level'] <= $c['bot_level'] || $u->info['admin'] > 0) {
+                            $dv = '<b><font color="green">������������� ��� �������� �� ' . ($c['bot_level'] + 1) . '-�� ������.</font></b> <INPUT class="btn btn-inverse" onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&bot=' . $u->info['nextAct'] . '\';" TYPE=button name=clone value="������ ��� � ������">';
+                        } else {
+                            if ($u->info['level'] < 9) {
+                                $tstw = ' ��� <b>8</b> ������� ����������';
+                            } else {
+                                $tstw = '<input type="text" value="" name="commentfiz" id="commentfiz" style="width:244px; padding:3px;">';
+                            }
+                            $dv .= '<br>
 							<div>
 							<div style="padding-top:5px;">
-							����������� � ��� '.$tstw.'
+							����������� � ��� ' . $tstw . '
 							
 							</div>
 							</div>
 							<div style="padding-top:5px;"><INPUT class="btn" TYPE=submit name=open value="������ ������"></div>';
-							//if($u->info['level'] <= 9 || $u->info['admin']>0 /*|| ($u->stats['silver']>0 && $u->info['level']<8) || ($u->stats['silver'] >= 2 && $u->info['level']<9)*/ )
-							//if( $u->info['admin'] > 0 ) {
-							//	$dv .= ' <INPUT class="btn" onClick="console_clonelogin();" TYPE=button name=clone value="�������� ��� (��� �������)">';
-							//}
-						}
-						if( $u->info['admin'] > 0 ) {
-							
-							if( isset($_GET['adminbotatack']) ) {
-								$bot_atack = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "'.mysql_real_escape_string($_GET['adminbotatack']).'" LIMIT 1'));
-								if( isset($bot_atack['id']) ) {
-									$logins_bot = array();
-									$k = $u->addNewbot($bot_atack['id'],NULL,NULL,$logins_bot);
-									if( isset($k['id']) ) {
-										$expB = 0;
-										$btl = array(
-											'players'=>'',
-											'timeout'=>180,
-											'type'=>0,
-											'invis'=>0,
-											'noinc'=>0,
-											'travmChance'=>0,
-											'typeBattle'=>0,
-											'addExp'=>$expB,
-											'money'=>0
-										);
-	
-										$ins = mysql_query('INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+                        }
+                        if ($u->info['admin'] > 0) {
+                            if (isset($_GET['adminbotatack'])) {
+                                $bot_atack = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `id` = "' . mysql_real_escape_string($_GET['adminbotatack']) . '" LIMIT 1'));
+                                if (isset($bot_atack['id'])) {
+                                    $logins_bot = [];
+                                    $k = $u->addNewbot($bot_atack['id'], null, null, $logins_bot);
+                                    if (isset($k['id'])) {
+                                        $expB = 0;
+                                        $btl = [
+                                            'players' => '',
+                                            'timeout' => 180,
+                                            'type' => 0,
+                                            'invis' => 0,
+                                            'noinc' => 0,
+                                            'travmChance' => 0,
+                                            'typeBattle' => 0,
+                                            'addExp' => $expB,
+                                            'money' => 0
+                                        ];
+
+                                        $ins = mysql_query('INSERT INTO `battle` (`dungeon`,`dn_id`,`x`,`y`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
 														"0",
 														"0",
 														"0",
 														"0",
-														"'.$u->info['city'].'",
-														"'.time().'",
-														"'.$btl['players'].'",
-														"'.$btl['timeout'].'",
-														"'.$btl['type'].'",
-														"'.$btl['invis'].'",
-														"'.$btl['noinc'].'",
-														"'.$btl['travmChance'].'",
-														"'.$btl['typeBattle'].'",
-														"'.$btl['addExp'].'",
-														"'.$btl['money'].'")');
-										$btl_id = mysql_insert_id();
-										mysql_query('UPDATE `users` SET `battle` = "'.$btl_id.'" WHERE `id` = "'.$k['id'].'" OR `id` = "'.$u->info['id'].'" LIMIT 2');
-										mysql_query('UPDATE `stats` SET `team` = "2" WHERE `id` = "'.$k['id'].'" LIMIT 1');
-										mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-										//header('location: main.php');
-										//die();
-										die('<script>top.frames[\'main\'].location = "main.php";</script>');
-									}
-								}
-							}
-							
-							$dv .= '<script type="text/javascript">
+														"' . $u->info['city'] . '",
+														"' . time() . '",
+														"' . $btl['players'] . '",
+														"' . $btl['timeout'] . '",
+														"' . $btl['type'] . '",
+														"' . $btl['invis'] . '",
+														"' . $btl['noinc'] . '",
+														"' . $btl['travmChance'] . '",
+														"' . $btl['typeBattle'] . '",
+														"' . $btl['addExp'] . '",
+														"' . $btl['money'] . '")');
+                                        $btl_id = mysql_insert_id();
+                                        mysql_query('UPDATE `users` SET `battle` = "' . $btl_id . '" WHERE `id` = "' . $k['id'] . '" OR `id` = "' . $u->info['id'] . '" LIMIT 2');
+                                        mysql_query('UPDATE `stats` SET `team` = "2" WHERE `id` = "' . $k['id'] . '" LIMIT 1');
+                                        mysql_query('UPDATE `stats` SET `team` = "1" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                        die('<script>top.frames[\'main\'].location = "main.php";</script>');
+                                    }
+                                }
+                            }
+
+                            $dv .= '<script type="text/javascript">
 function MM_jumpMenu(targ,selObj,restore){ //v3.0
   eval("location=\'main.php?zayvka=1&r=2&rnd=1&adminbotatack="+selObj.options[selObj.selectedIndex].value+"\'");
   if (restore) selObj.selectedIndex=0;
 }
 </script><form name="form55" id="form55">';
-							
-							$dv .= '<hr>��� � ��������: <select style="font-size:12px;" onChange="MM_jumpMenu(\'parent\',this,0)" name="botadminatack"><option value="0">------ �������� ������� �� ������ ------</option>';
-							
-							$sp_m = mysql_query('SELECT * FROM `test_bot` WHERE `pishera` != 0 ORDER BY `id` ASC');
-							while($pl_m = mysql_fetch_array($sp_m) ) {
-								$dv .= '<option value="'.$pl_m['id'].'">'.$pl_m['id'].' [ '.$pl_m['align'].' ] - '.$pl_m['login'].' ['.$pl_m['level'].'] '.$pl_m['pishera'].'</option>';
-							}
-							$dv .= '</select></form>';
-						}
-					}
-					if($u->info['level'] > $c['bot_level']) {
-						$dv = '<FIELDSET id="hidezv1" style="display:none; border-color:#FFF; width:100%;">
-									  <LEGEND><B style="color:#8f0000">������ ������ �� ���</B> </LEGEND>�������
-										  <SELECT NAME=timeout style="padding:3px;">
-											<OPTION value=1>1 ���.
-											<OPTION value=2>2 ���.
-											<OPTION value=3 SELECTED>3 ���.
-											<OPTION value=4>4 ���.
-											<OPTION value=5>5 ���.
-										 </SELECT>
-										  ��� ���
-										  <SELECT NAME=k>
-											<OPTION value=0>� �������
-											<OPTION value=1>��������
-											<OPTION value=2><font color=red><b>��������</font></b>
-										</SELECT>'.$dv.'</FIELDSET><div id="hidezv1_btn"><INPUT class="btn" onclick="openfizrmk();" TYPE=button name=open value="������ ������ �� ���"></div>';
-					}
-					
-					echo '
-					<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r='.$r.'&rnd='.$code.'\'>
-					<input type="hidden" name="add_new_zv" id="add_new_zv" value="'.floor(time()/3).'" />
+
+                            $dv .= '<hr>��� � ��������: <select style="font-size:12px;" onChange="MM_jumpMenu(\'parent\',this,0)" name="botadminatack"><option value="0">------ �������� ������� �� ������ ------</option>';
+
+                            $sp_m = mysql_query('SELECT * FROM `test_bot` WHERE `pishera` != 0 ORDER BY `id` ASC');
+                            while ($pl_m = mysql_fetch_array($sp_m)) {
+                                $dv .= '<option value="' . $pl_m['id'] . '">' . $pl_m['id'] . ' [ ' . $pl_m['align'] . ' ] - ' . $pl_m['login'] . ' [' . $pl_m['level'] . '] ' . $pl_m['pishera'] . '</option>';
+                            }
+                            $dv .= '</select></form>';
+                        }
+
+                        echo '
+					<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '\'>
+					<input type="hidden" name="add_new_zv" id="add_new_zv" value="' . floor(time() / 3) . '" />
 					<TABLE width=100% cellspacing=0 cellpadding=0>
 						  <TR>
-							<TD valign=top><!--'.$zi[$r].'<BR>-->
+							<TD valign=top><!--' . $zi[$r] . '<BR>-->
 								<table cellspacing=0 cellpadding=0>
 								  <tr>
 									<td>
-									  '.$dv.'
+									  ' . $dv . '
 									</td>
 								  </tr>
 								</table></TD>
-							<TD align=right valign=top><!-- <INPUT class="btn" onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"> --></TD>
+							<TD align=right valign=top></TD>
 						  </TR>
 						</TABLE>
 						</FORM>';
-						}
-				}elseif($r==4)
-				{
-					if($u->room['zvsee']==0) {
-					//���������
-					echo '<span id="hidezv1_btn"><INPUT class="btn" onClick="openfizrmk();" TYPE=button name=tmp value="������ ������ �� ��������� ���"  style="margin:3px;"></span>
-						  <!-- <INPUT class="btn" onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'&sort=\'+document.all.value+\'\';" TYPE=button name=tmp value="��������"  style="float:right;"> -->';
-					?>
-<FIELDSET id="hidezv1" style="display:none; border-color:#FFF; width:500px;">
-<LEGEND><B style="color:#8f0000">������ ������ �� ��������� ���</B> </LEGEND>
-<!--<div style="float:right;">
-	<INPUT class="btn" onClick="location='main.php?zayvka&r=<? echo $_GET['r']; ?>&rnd=<? echo $code; ?>';" TYPE=button name=tmp value="��������">
-</div>-->
-<form method="post" action="main.php?zayvka&r=<? echo $_GET['r']; ?>&add_group&rnd=<? echo $code; ?>">
-<table>
-  <tr>
-    <td>
-      ������ ��� �����
-      <select style="padding:2px;" name="startime">
-          <option value="300">5 ����� </option>
-        <option value="600">10 ����� </option>
-        <!--<option value="900">15 ����� </option>
-        <option value="1200">20 ����� </option>
-        <option value="1800">30 ����� </option>-->
-      </select>
-      &nbsp;&nbsp;&nbsp;&nbsp;�������
-      <select style="padding:2px;" name="timeout">
-        <option value="1">1 ���.</option>
-        <option value="2">2 ���.</option>
-        <option value="3">3 ���.</option>
-        <!--<option value="4">4 ���.</option>
-        <option value="5">5 ���.</option>-->
-      </select>
-      <br />
-      ���� �������
-      <input  style="padding:2px;" type="text" name="nlogin1" size="3" maxlength="2" /> ������� <select style="padding:2px;" name="levellogin1">
-        <option value="0">����� </option>
-        <option value="1">������ ����� � ���� </option>
-        <option value="2">������ ���� ����� ������ </option>
-        <option value="3">������ ����� ������ </option>
-        <option value="4">�� ������ ���� ����� ��� �� ������� </option>
-        <option value="5">�� ������ ���� ����� ��� �� ������� </option>
-        <option value="6">��� ������� +/- 1 </option>
-        <option value="99">��� ���� </option>
-        <option value="98">��� ���������� </option>
-      </select>
-      <br />
-      ���������� &nbsp;
-      <input  style="padding:2px;" type="text" name="nlogin2" size="3" maxlength="2" />
-      �������
-      <select style="padding:2px;" name="levellogin2">
-        <option value="0">����� </option>
-        <option value="1">������ ����� � ���� </option>
-        <option value="2">������ ���� ����� ������ </option>
-        <option value="3">������ ����� ������ </option>
-        <option value="4">�� ������ ���� ����� ��� �� ������� </option>
-        <option value="5">�� ������ ���� ����� ��� �� ������� </option>
-        <option value="6">��� ������� +/- 1 </option>
-        <option value="99">������ ���� </option>
-        <option value="98">������ ���������� </option>
-      </select>
-      <br />     
-      <input type="checkbox" name="travma" />
-      <label for="travma">��� ��� ������ <font class="dsc">(����������� ������� �������� ������������)</font></label><br />
-      ����������� � ���
-      <? if ($u->info['level']<9)
-	  {?> ��� <b>8</b> ������� ����������
-	  <? }else{?>
-	  <input type="text" style="padding:2px;" name="cmt" maxlength="40" size="40" />
-      <? }?>
-	</td>
-  </tr>
-  <tr>
-    <td align="left"><input class="btn" type="submit" value="������ ������" name="open" />
-    </td>
-  </tr>
-</table>
-</form>
-</FIELDSET>
-                    <?
-					}
-				}elseif($r==5)
-				{
-					if($u->room['zvsee']==0) {
-					echo '<div id="hidezv1_btn"><INPUT class="btn" onClick="openfizrmk();" TYPE=button name=tmp value="������ ������ �� ��������� ���"  style="margin:3px;"></div>
-					<!-- ���-�� � ��������� ���� �������� ���������� <b>��������������</b> <a href="https://events.new-combats.com/?page_id=1&paged=&st=25" target="_blank">���������</a>.<br> -->
-						  <form action="main.php?zayvka=1&r='.$_GET['r'].'&start_haot&rnd='.$code.'" method="post" style="margin:0px; padding:0px;">
+                    }
+                } elseif ($r == 4) {
+                    if ($u->room['zvsee'] == 0) { //��������� ?>
+                        <span id="hidezv1_btn"><INPUT class="btn" onClick="openfizrmk();" TYPE=button name=tmp
+                                                      value="������ ������ �� ��������� ���" style="margin:3px;"></span>
+                        <FIELDSET id="hidezv1" style="display:none; border-color:#FFF; width:500px;">
+                            <LEGEND><B style="color:#8f0000">������ ������ �� ��������� ���</B></LEGEND>
+                            <form method="post"
+                                  action="main.php?zayvka&r=<?= $_GET['r'] ?>&add_group&rnd=<?= $code ?>">
+                                <table>
+                                    <tr>
+                                        <td>
+                                            ������ ��� �����
+                                            <select style="padding:2px;" name="startime">
+                                                <option value="300">5 �����</option>
+                                                <option value="600">10 �����</option>
+                                            </select>
+                                            &nbsp;&nbsp;&nbsp;&nbsp;�������
+                                            <select style="padding:2px;" name="timeout">
+                                                <option value="1">1 ���.</option>
+                                                <option value="2">2 ���.</option>
+                                                <option value="3">3 ���.</option>
+                                            </select>
+                                            <br/>
+                                            ���� �������
+                                            <input style="padding:2px;" type="text" name="nlogin1" size="3"
+                                                   maxlength="2"/> �������
+                                            <select style="padding:2px;" name="levellogin1">
+                                                <option value="0">�����</option>
+                                                <option value="1">������ ����� � ����</option>
+                                                <option value="2">������ ���� ����� ������</option>
+                                                <option value="3">������ ����� ������</option>
+                                                <option value="4">�� ������ ���� ����� ��� �� �������</option>
+                                                <option value="5">�� ������ ���� ����� ��� �� �������</option>
+                                                <option value="6">��� ������� +/- 1</option>
+                                                <option value="99">��� ����</option>
+                                                <option value="98">��� ����������</option>
+                                            </select>
+                                            <br/>
+                                            ���������� &nbsp;
+                                            <input style="padding:2px;" type="text" name="nlogin2" size="3"
+                                                   maxlength="2"/>
+                                            �������
+                                            <select style="padding:2px;" name="levellogin2">
+                                                <option value="0">�����</option>
+                                                <option value="1">������ ����� � ����</option>
+                                                <option value="2">������ ���� ����� ������</option>
+                                                <option value="3">������ ����� ������</option>
+                                                <option value="4">�� ������ ���� ����� ��� �� �������</option>
+                                                <option value="5">�� ������ ���� ����� ��� �� �������</option>
+                                                <option value="6">��� ������� +/- 1</option>
+                                                <option value="99">������ ����</option>
+                                                <option value="98">������ ����������</option>
+                                            </select>
+                                            <br/>
+                                            <input type="checkbox" name="travma"/>
+                                            <label for="travma">��� ��� ������ <font class="dsc">(����������� �������
+                                                    �������� ������������)</font></label><br/>
+                                            ����������� � ���
+                                            <? if ($u->info['level'] < 9) {
+                                                ?> ��� <b>8</b> ������� ����������
+                                            <? } else { ?>
+                                                <input type="text" style="padding:2px;" name="cmt" maxlength="40"
+                                                       size="40">
+                                            <? } ?>
+                                        </td>
+                                    </tr>
+                                    <tr>
+                                        <td align="left">
+                                            <input class="btn" type="submit" value="������ ������" name="open">
+                                        </td>
+                                    </tr>
+                                </table>
+                            </form>
+                        </FIELDSET>
+                        <?
+                    }
+                } elseif ($r == 5) {
+                    if ($u->room['zvsee'] == 0) {
+                        echo '<div id="hidezv1_btn"><INPUT class="btn" onClick="openfizrmk();" TYPE=button name=tmp value="������ ������ �� ��������� ���"  style="margin:3px;"></div>
+						  <form action="main.php?zayvka=1&r=' . $_GET['r'] . '&start_haot&rnd=' . $code . '" method="post" style="margin:0px; padding:0px;">
+						  <input type="hidden" name="timeout" value="1">
 						  <div style="display:none; width:600px;" id="hidezv1">
 										  <br>
 										  <FIELDSET style="border-color:#FFF;">
@@ -2232,18 +1970,6 @@ function MM_jumpMenu(targ,selObj,restore){ //v3.0
 											<SELECT name="startime2">
 											<OPTION selected value="180">3 ������
 											  <OPTION value="300">5 �����
-											 <!-- <OPTION value="900">10 �����
-											  <OPTION value="900">15 �����
-											  <OPTION value="1200">20 �����
-											  <OPTION value="1800">30 �����</OPTION>-->
-											</SELECT>
-											�������
-											<SELECT name="timeout">
-											  <OPTION selected value="1">1 ���.
-											  <!--<OPTION value="2">2 ���.
-											  <OPTION value="3">3 ���.
-											  <OPTION value="4">4 ���.
-											  <OPTION value="5">5 ���.</OPTION>-->
 											</SELECT>
 											�������
 											<SELECT name="players">
@@ -2251,11 +1977,6 @@ function MM_jumpMenu(targ,selObj,restore){ //v3.0
 											  <OPTION value="8">8</OPTION>
 											  <OPTION value="10">10</OPTION>
 											  <OPTION value="12">12</OPTION>
-											  <!--<OPTION value="14">14</OPTION>
-											  <OPTION value="16">16</OPTION>
-											  <OPTION value="18">18</OPTION>
-											  <OPTION value="20">20</OPTION>
-											  <OPTION value="40">40</OPTION>-->
 											</SELECT>
 											<BR>
 											������ ������   ��
@@ -2268,1585 +1989,1286 @@ function MM_jumpMenu(targ,selObj,restore){ //v3.0
 											<BR>
 											<INPUT type="checkbox" name="travma">
 											��� ���   ������ <font color="#777">(����������� ������� ��������   ������������)</font><BR>
-											<!--<INPUT type="checkbox" name="mut_clever">����������� ����   (����������� ���� ��� ��������� ����������)<BR>-->
-											<!--<INPUT type="checkbox" name="noart">-->
-											<!--�������� ��� ���������� (����������� ��������� �������� � ����� ����������)<BR>-->
 											<INPUT  type="checkbox" name="noatack"> �������� �������� <font color="#777">(��� ����� ���������� �� ���������)</font><BR>
 											<INPUT  type="checkbox" name="noeff">
 											������ �� ������������� ������� �������������� �� � ����<BR>
-											<!--<INPUT type="checkbox" name="kingfight">�������� �������� (<b>�� ��������� � ������� ���������</b>)<BR>-->
-											<!--<INPUT type="checkbox" name="nobot">�������� ��� �����<BR>-->
-											<!--<INPUT type="checkbox" name="fastfight">
-											������� �������� (��� ������ �������� ��������� ������� ��� ������)<BR>-->
-											<!--<INPUT type="checkbox" name="arand"> ������������� ������ ��������� �������<BR>-->
 											';
-											if( date('m') == 12 || date('m') == 1 || date('m') == 2 ) {
-												//���������
-												//echo '<INPUT type="checkbox" name="otmorozok"> <img src="https://img.new-combats.com/snow.gif" width="12" height="12"> ��� � ����������� (�� ��������� ������� ��������� ���������, +1.00 ��. �������)<BR>';	
-											}
-											if( $u->info['no_zv_key'] != true ) { 
-												echo '<img src="https://new-combats.com/show_reg_img/security2.php?id='.time().'" width="70" height="20"> ��� �������������: <input style="width:40px;" type="text" value="" name="code21">';
-											}
-											/*echo '<INPUT type="checkbox" name="mut_hidden">
-											��������� ��� (�� �����   ����������� �� � ������, �� � ���. +5% �����)					�
-									  		<BR>';*/
-											
-											if ($u->info['level']<9) 
-												{
-													$tstw=' ��� <b>8</b> ������� ����������';
-												}
-											else
-												{
-													$tstw='<INPUT maxLength="40" size="40" name="cmt">';
-												}
-											echo'
-											����������� � ��� '.$tstw.'
+                        if (!$u->info['no_zv_key']) {
+                            echo '<img src="https://new-combats.com/show_reg_img/security2.php?id=' . time() . '" width="70" height="20"> ��� �������������: <input style="width:40px;" type="text" value="" name="code21">';
+                        }
+                        $tstw = $u->info['level'] < 9 ? ' ��� <b>8</b> ������� ����������' : '<INPUT maxLength="40" size="40" name="cmt">';
+                        echo '����������� � ��� ' . $tstw . '
 											<BR><INPUT class="btn" value="������ ������" type="submit" name="open">
 										  </FIELDSET>
 										</DIV>
 						  </div></form>';
-					}
-				}				
-			}elseif($r==6)
-			{
-				//�������
-				$x = 1;
-				$html = '';
-				$p = 0;
-				$_GET['from'] = round((int)$_GET['from']);
-				if($_GET['from']>1 && $_GET['from']<50)
-				{
-					$p = $_GET['from']-1;
-				}
-				$xx = mysql_num_rows(mysql_query('SELECT `id` FROM `battle` WHERE `type` != 329 AND /*`city` = "'.$u->info['city'].'" AND*/ `team_win` = "-1" AND `time_over` = "0" AND `start1` > 0'));
-				$px = $p*15;
-				if($p>ceil($xx/15))
-				{
-					$p = ceil($xx/15);
-				}
-				$sp = mysql_query('SELECT * FROM `battle` WHERE `type` != 329 AND /*`city` = "'.$u->info['city'].'" AND */`team_win` = "-1" AND `time_over` = "0" AND `start1` > 0 ORDER BY  `time_start` DESC  LIMIT '.((int)$px).',15');
-				while($pl = mysql_fetch_array($sp))
-				{
-					//<SPAN style=\'color: red; font-weight: bold;\'>������</SPAN>
-					$tm = ''; $tmu = array(); $tms = array();
-					$spi = mysql_query('SELECT `u`.`login`,`st`.`id`,`st`.`team`,`u`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "'.$pl['id'].'"');
-					while($pli = mysql_fetch_array($spi))
-					{
-						if(!isset($tmu[$pli['team']]))
-						{
-							$tms[count($tms)] = $pli['team'];
-						}
-						$tmu[$pli['team']][count($tmu[$pli['team']])] = $pli['id'];
-					}
-					$i = 0;
-					while($i<count($tms))
-					{
-						$tmsu = '';
-						$j = 0;
-						while($j<count($tmu[$tms[$j]]))
-						{
-							if($tmu[$tms[$i]][$j]>0)
-							{
-								$tmsu .= $u->microLogin($tmu[$tms[$i]][$j],1).', ';
-							}
-							$j++;
-						}
-						$tmsu = rtrim($tmsu,', ');
-						$tm .= $tmsu;
-						if($i+1!=count($tms))
-						{
-							$tm .= ' <SPAN style=\'color: red; font-weight: bold;\'>������</SPAN> ';
-						}
-						$i++;
-					}
-					if( $tm != '' ) {
-						$html .= ($p+$x).'. <font class=date>'.date('d.m.y H:i',$pl['time_start']).'</font> '.$tm.' <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['typeBattle'].'.gif" WIDTH=20 HEIGHT=20 ALT="���������� ���"> <A HREF="logs.php?log='.$pl['id'].'&rnd='.$code.'" target=_blank>��</A><BR>';
-					}
-					$x++;
-				}
-				?>
-<table width="100%" cellspacing="0" cellpadding="0">
-  <tr>
-    <td valign="top" align="center"><h3>������ ������� ���� �� <?=date('d.m.Y');?> (����� <?=$xx;?>)</h3></td>
-    <td valign="top" align="right"><!-- <input class="btn" type="submit" value="��������" onClick="" name="tklogs" /> --></td>
-  </tr>
-</table>
-<? if($html==''){ echo '<div align="center">� ��������� ������ ���� ���...</div>'; }else{ echo '<div>'.$html.'</div>'; } ?>
-<TABLE width=100% cellspacing=0 cellpadding=0><TR>
-<TD align=left><? if($p>0 && $xx>15){ ?><A HREF="?zayvka=1&r=6&from=<?=($p-1);?>">�� ���������� ��������</A><? } ?>&nbsp;</TD>
-<TD align=right><? if($p*15-$xx>0){ ?><A HREF="?zayvka=1&r=6&from=<?=($p+1);?>">��������� �������� ��</A><? } ?>&nbsp;</TD>
-</TR></TABLE>
-<?
-			}elseif($r==7)
-			{
-				//�����������
-				$btl = '';
-				$dt = time();
-				if(isset($_GET['logs2']))
-				{
-					$dt = round((int)$_GET['logs2']);
-				}
-				$dt = strtotime(date('d F Y',$dt).' 00:00:00');
-				$slogin = $u->info['login'];
-				if(isset($_GET['filter']))
-				{
-					$slogin = $_GET['filter'];
-				}
-				if(isset($_POST['filter']))
-				{
-					$slogin = $_POST['filter'];
-				}
-				$slogin = str_replace('"','',$slogin);
-				$slogin = str_replace("'",'',$slogin);
-				$slogin = str_replace('\\','',$slogin);
-				$see = '<TABLE width=100% cellspacing=0 cellpadding=0><TR>
-<TD valign=top>&nbsp;<A HREF="?filter='.$slogin.'&zayvka=1&r=7&logs2='.($dt-86400).'">� ���������� ����</A></TD>
-<TD valign=top align=center><H3>������ � ����������� ���� �� '.date('d.m.Y',$dt).'</H3></TD>
-<TD  valign=top align=right><A HREF="?filter='.$slogin.'&zayvka=1&r=7&logs2='.($dt+86400).'">��������� ���� �</A>&nbsp;</TD>
+                    }
+                }
+            } elseif ($r == 6) {
+                //�������
+                $x = 1;
+                $html = '';
+                $p = 0;
+                $_GET['from'] = round((int)$_GET['from']);
+                if ($_GET['from'] > 1 && $_GET['from'] < 50) {
+                    $p = $_GET['from'] - 1;
+                }
+                $xx = mysql_num_rows(mysql_query('SELECT `id` FROM `battle` WHERE `type` != 329 AND `team_win` = "-1" AND `time_over` = "0" AND `start1` > 0'));
+                $px = $p * 15;
+                if ($p > ceil($xx / 15)) {
+                    $p = ceil($xx / 15);
+                }
+                $sp = mysql_query('SELECT * FROM `battle` WHERE `type` != 329 AND `team_win` = "-1" AND `time_over` = "0" AND `start1` > 0 ORDER BY  `time_start` DESC  LIMIT ' . ((int)$px) . ',15');
+                while ($pl = mysql_fetch_array($sp)) {
+                    $tm = '';
+                    $tmu = [];
+                    $tms = [];
+                    $spi = mysql_query('SELECT `u`.`login`,`st`.`id`,`st`.`team`,`u`.`id` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`battle` = "' . $pl['id'] . '"');
+                    while ($pli = mysql_fetch_array($spi)) {
+                        if (!isset($tmu[$pli['team']])) {
+                            $tms[count($tms)] = $pli['team'];
+                        }
+                        $tmu[$pli['team']][count($tmu[$pli['team']])] = $pli['id'];
+                    }
+                    $i = 0;
+                    while ($i < count($tms)) {
+                        $tmsu = '';
+                        $j = 0;
+                        while ($j < count($tmu[$tms[$j]])) {
+                            if ($tmu[$tms[$i]][$j] > 0) {
+                                $tmsu .= $u->microLogin($tmu[$tms[$i]][$j], 1) . ', ';
+                            }
+                            $j++;
+                        }
+                        $tmsu = rtrim($tmsu, ', ');
+                        $tm .= $tmsu;
+                        if ($i + 1 != count($tms)) {
+                            $tm .= ' <SPAN style=\'color: red; font-weight: bold;\'>������</SPAN> ';
+                        }
+                        $i++;
+                    }
+                    if ($tm != '') {
+                        $html .= ($p + $x) . '. <font class=date>' . date('d.m.y H:i', $pl['time_start']) . '</font> ' . $tm . ' <IMG SRC="https://img.new-combats.com/i/fighttype' . $pl['typeBattle'] . '.gif" WIDTH=20 HEIGHT=20 ALT="���������� ���"> <A HREF="logs.php?log=' . $pl['id'] . '&rnd=' . $code . '" target=_blank>��</A><BR>';
+                    }
+                    $x++;
+                }
+                ?>
+                <table width="100%" cellspacing="0" cellpadding="0">
+                    <tr>
+                        <td valign="top" align="center"><h3>������ ������� ���� �� <?= date('d.m.Y'); ?>
+                                (����� <?= $xx; ?>)</h3></td>
+                        <td valign="top" align="right"></td>
+                    </tr>
+                </table>
+                <? if ($html == '') {
+                    echo '<div align="center">� ��������� ������ ���� ���...</div>';
+                } else {
+                    echo '<div>' . $html . '</div>';
+                } ?>
+                <TABLE width=100% cellspacing=0 cellpadding=0>
+                    <TR>
+                        <TD align=left><? if ($p > 0 && $xx > 15) { ?><A HREF="?zayvka=1&r=6&from=<?= ($p - 1); ?>">��
+                                ���������� ��������</A><? } ?>&nbsp;
+                        </TD>
+                        <TD align=right><? if ($p * 15 - $xx > 0) { ?><A HREF="?zayvka=1&r=6&from=<?= ($p + 1); ?>">
+                                    ��������� �������� ��</A><? } ?>&nbsp;
+                        </TD>
+                    </TR>
+                </TABLE>
+                <?
+            } elseif ($r == 7) {
+                //�����������
+                $btl = '';
+                $dt = time();
+                if (isset($_GET['logs2'])) {
+                    $dt = round((int)$_GET['logs2']);
+                }
+                $dt = strtotime(date('d F Y', $dt) . ' 00:00:00');
+                $slogin = $u->info['login'];
+                if (isset($_GET['filter'])) {
+                    $slogin = $_GET['filter'];
+                }
+                if (isset($_POST['filter'])) {
+                    $slogin = $_POST['filter'];
+                }
+                $slogin = str_replace('"', '', $slogin);
+                $slogin = str_replace("'", '', $slogin);
+                $slogin = str_replace('\\', '', $slogin);
+                $see = '<TABLE width=100% cellspacing=0 cellpadding=0><TR>
+<TD valign=top>&nbsp;<A HREF="?filter=' . $slogin . '&zayvka=1&r=7&logs2=' . ($dt - 86400) . '">� ���������� ����</A></TD>
+<TD valign=top align=center><H3>������ � ����������� ���� �� ' . date('d.m.Y', $dt) . '</H3></TD>
+<TD  valign=top align=right><A HREF="?filter=' . $slogin . '&zayvka=1&r=7&logs2=' . ($dt + 86400) . '">��������� ���� �</A>&nbsp;</TD>
 </TR><TR><TD colspan=3 align=center>
-<form method="POST" action="main.php?zayvka=1&r=7&rnd='.$code.'">
-�������� ������ ��� ���������: <INPUT TYPE=text NAME=filter value="'.$slogin.'"> �� <INPUT TYPE=text NAME=logs size=12 value="'.date('d.m.Y',$dt).'"> <INPUT class="btn" TYPE=submit value="������!">
+<form method="POST" action="main.php?zayvka=1&r=7&rnd=' . $code . '">
+�������� ������ ��� ���������: <INPUT TYPE=text NAME=filter value="' . $slogin . '"> �� <INPUT TYPE=text NAME=logs size=12 value="' . date('d.m.Y', $dt) . '"> <INPUT class="btn" TYPE=submit value="������!">
 </form>
 </TD>
 </TR></TABLE>';
-				$usr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`city` FROM `users` WHERE `login` = "'.mysql_real_escape_string($slogin).'" LIMIT 1'));
-				if(isset($usr['id']))
-				{
-					$tms = $dt;
-					$tmf = $dt+86400; 
-					$sp = mysql_query('SELECT * FROM `battle_last` WHERE `time` >= '.$tms.' AND `time` < '.$tmf.' AND `uid` = "'.$usr['id'].'" ORDER BY `id` DESC');
-					$j = 1;
-					$jk = 0;
-					$btl_lst = array();
-					while($pl = mysql_fetch_array($sp))
-					{
-						$b = mysql_fetch_array(mysql_query('SELECT * FROM `battle_end` WHERE `battle_id` = "'.$pl['battle_id'].'" LIMIT 1'));
-						$tm = '';
-						if( isset($btl_lst[$b['id']]) ) {
-							
-						}elseif(isset($b['id']))
-						{
-							$tms = array(); $ts = array();
-							$spi = mysql_query('SELECT * FROM `battle_last` WHERE `battle_id` = "'.$pl['battle_id'].'"');
-							while($pli = mysql_fetch_array($spi))
-							{
-								if(!isset($tms[$pli['team']]))
-								{
-									$ts[count($ts)] = $pli['team'];
-								}
-								$tms[$pli['team']][count($tms[$pli['team']])] = $pli;
-							}
-							$k = 0;
-							while($k<count($ts))
-							{
-								$g = $ts[$k];
-								$h = 0;
-								$tm2 = '';
-								while($h<count($tms[$g]))
-								{
-									if($tms[$g][$h]['uid']>0)
-									{
-										if($tms[$g][$h]['align']>0)
-										{
-											$tm2 .= '<img src="https://img.new-combats.com/i/align/align'.$tms[$g][$h]['align'].'.gif">';
-										}
-										$tm2 .= '<b>'.$tms[$g][$h]['login'].'</b> ['.$tms[$g][$h]['lvl'].']<a href="info/'.$tms[$g][$h]['uid'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif"></a>, ';
-									}
-									$h++;
-								}
-								$tm2 = rtrim($tm2,', ');
-								$btlg = mysql_fetch_array(mysql_query('SELECT `id`,`team_win` FROM `battle` WHERE `id` = "'.$pl['battle_id'].'" LIMIT 1'));
-								if(isset($btlg['id']) && $g == $btlg['team_win']) {
-									$tm2 .= ' <img width="20" height="20" src="https://img.new-combats.com/i/flag.gif" title="������"> ';
-								}
-								$tm .= $tm2;
-								if($k+1<count($ts) && $tm2!='' && $ts[$k+1]>0)
-								{
-									$tm .= ' <font color=red><b>������</b></font> ';
-								}
-								$k++;
-							}
-						}
-						if( !isset($btl_lst[$b['id']]) ) {
-							$btl_lst[$b['id']] = true;
-							if($tm == '')
-							{
-								$tm = '������ �������� ��������';	
-							}
-							$jk++;
-							$btl .= $jk.'. <font class=date>'.date('d.m.y H:i',$pl['time']).'</font> '.$tm.' <A HREF="logs.php?log='.$pl['battle_id'].'&rnd='.$code.'" target=_blank>��</A><br>';
-						}
-						$j++;
-					}
-				}
-				if($btl=='')
-				{
-					$see .= '<CENTER><BR><BR><B>� ���� ���� �� ���� ����, ��� ��, ��������� ����� ������� ������...</B><BR><BR><BR></CENTER><HR><BR>';
-				}else{
-					$see .= $btl;
-				}
-				
-				echo $see;
-			}else{
-				if((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id']))
-				{
-					echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
-				}
-			}
-		}else{
-			if((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id']))
-			{
-				echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
-			}
-		}
-	}
-	
-	public function rzv($v)
-	{
-		$v = explode('.',$v);
-		if(!isset($v[1]))
-		{
-			$v = $v[0].'.0';
-		}else{
-			$v = $v[0].'.'.$v[1];
-		}
-		return $v;
-	}
-	
-	public function rzInfo($id)
-	{
-		global $u;
-		$r = '';
-		$w = mysql_num_rows(mysql_query('SELECT * FROM `zayvki` WHERE `time` > '.(time()-7200).' /*AND `city` = "'.$u->info['city'].'"*/ AND `cancel` = "0" AND `start` = "0" AND `razdel` = "'.$id.'" AND (`min_lvl_1` <= '.$u->info['level'].' OR `min_lvl_2` <= '.$u->info['level'].') AND (`max_lvl_1` >= '.$u->info['level'].' OR `max_lvl_2` >= '.$u->info['level'].')'));
-		if($w>0)
-		{
-			$r = ' <small><font color="grey">('.$w.')</font></small>';
-		}
-		return $r;
-	}
-	
-	public function testzvu($id,$tm,$bt)
-	{
-		$r = 0;
-		if($bt==0)
-		{
-			$r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "'.$id.'" AND `team` = "'.$tm.'"'));
-		}else{
-			$r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "'.$id.'" AND `team` = "'.$tm.'" AND `bot` = "2"'));
-		}
-		return $r;
-	}
-	
-	public function seeZv()
-	{
-		global $u,$c,$code,$zi;
-		if(isset($_GET['r']) && $this->zv_see==1)
-		{
-			$r = round(intval($_GET['r']));
-			if($r>=1 && $r<=5)
-			{
-				//������ ������
-				$i = 0;
-				$cl = mysql_query('SELECT * FROM `zayvki` WHERE `razdel` = "'.mysql_real_escape_string($r).'" AND `start` = "0" AND `cancel` = "0" AND `time` > "'.(time()-60*60*2).'" /*AND `city` = "'.$u->info['city'].'"*/ ORDER BY `id` DESC');
-				$zvb = '';
-				if($r==4 || $r==5)
-				{
-						/*echo '<table cellspacing="0" cellpadding="0" align="right"><tr><td>
-						<FIELDSET><LEGEND>���������� ������</LEGEND>
-						&nbsp;<INPUT TYPE=radio ID=A1 name="all" value=0 checked> <LABEL FOR=A1>����� ������</LABEL><BR>
-						&nbsp;<INPUT TYPE=radio ID=A2 name="all" value=1> <LABEL FOR=A2>���</LABEL>
-						</FIELDSET>
-						</td></tr></table><br>';*/
-				}
-				while($pl = mysql_fetch_array($cl))
-				{
-					if($pl['razdel']==5)
-			{
-						//��� ��������� ��� �������
-						if ($pl['type']==33)
-				{	
-						//if( $u->info['admin'] == 1 ) 
-					//{
-							if( $pl['min_lvl_1'] < 2 ) {
-							$pl['min_lvl_1'] = 2;
-						}
-						if( $pl['max_lvl_1'] > 21 ) {
-							$pl['max_lvl_1'] = 21;
-						}
-						//������ ���������� ���
-						$tm = '';
-						$tmStart = floor(($pl['time']+$pl['time_start']-time())/6)/10;
-						//if( $u->info['admin'] > 0 ) {
-							if((($pl['time']+$pl['time_start'])/10) != (int)(($pl['time']+$pl['time_start'])/10)) {
-								$pl['time'] = ceil($pl['time']/60)*60;
-								mysql_query('UPDATE `zayvki` SET `time` = "'.$pl['time'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						//}
-						$tmStart = $this->rzv($tmStart);
-						
-						$users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "'.$pl['id'].'"');
-						$col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'"'));
-						$cols = $col_p[0];
-						while($s = mysql_fetch_array($users))
-						{
-							$tm .= $u->microLogin($s['id'],1).', ';
-						}
-						
-						$rad = '';
-						
-						$tm = rtrim($tm,', ');
-						
-						if(!isset($zi['id']) && $u->room['zvsee'] == 0 && $u->info['inTurnirnew'] == 0) {
-							$rad = '<input type="radio" name="btl_go" id="btl_go'.$pl['id'].'" value="'.$pl['id'].'"> ';
-						}
-						
-						$n1tv = '';
-						$unvs = '';
-						if($pl['invise']==1)
-						{
-							//��������� ���
-							$tm = '<i>���������</i>';
-							$unvs = 0;
-							
-								$usrszv = '';
-								//if( $u->info['admin'] > 0 ) {
-									$spzm = mysql_query('SELECT `id`,`team` FROM `stats` WHERE `zv` = "'.$pl['id'].'" AND `id` != "'.$pl['creator'].'"');
-									while( $plzm = mysql_fetch_array($spzm) ) {
-										if($u->info['admin'] > 0 || ($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4) ) {
-											$usrszv .= ','.$u->microLogin($plzm['id'],1).'';
-										}
-										$unvs++;
-									}
-								//}
-								$tm = '<font color=grey><span style="color:maroon">'.$u->microLogin($pl['creator'],1).'</span>'.$usrszv.'</font> - '.$tm;
-							
-							$unvs = ' ����������: '.(1+$unvs).' ���. ';
-							$n1tv = ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="���������">';
-						}
-						//
-						if( $pl['kingfight'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/king.gif" title="�������� ��������">';
-						}
-						if($pl['travmaChance'] == 100 ){
-							$n1tv .= '<img src="https://img.new-combats.com/fighttype6.gif" title="�������� ��������">';
-						}
-						if( $pl['noatack'] == 1 ) {
-							//$n1tv .= ' <img src="https://img.new-combats.com/closefight.gif" title="� ��� ������ ���������">';
-							$n1tv .= ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="�������� ���">';
-						}
-						if( $pl['nobot'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/nobot.gif" title="� ��� �� �������� ����">';
-						}
-						if( $pl['fastfight'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/fastfight.gif" title="��� ������ ��� ���������� ������� 2 ������">';
-						}
-						if( $pl['noeff'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/svitok4.png" width="20" height="20" title="������ �� ������������� ������� �������������� �� � ����">';
-						}
-						if( $pl['arand'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/random.png" width="20" height="20" title="������������� ������ ��������� �������">';
-						}
-						if( $pl['noart'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/noart.png" width="20" height="20" title="��� ��� ����������">';
-						}
-						if( $pl['otmorozok'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/snow.gif" width="20" height="20" title="� ��� ����� ��������� ���������">';
-						}
-						//
-						if($pl['comment'] != '') {
-						  $dl = '';
-						  if(($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom']==0) {
-						    $dl .= ' (<a href="main.php?zayvka=1&r=5&delcom='.$pl['id'].'&key='.$u->info['nextAct'].'&rnd='.$code.'">������� �����������</a>)';          if(isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
-				              mysql_query('UPDATE `zayvki` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				              $pl['dcom'] = $u->info['id'];
-			                }
-						  }
-						  if($pl['dcom'] > 0) { $dl = '<font color="grey"><i>����������� ������ �����������</i></font>'; }
-						  if($pl['dcom'] > 0) {
-							if($moder['boi'] == 1 || $u->info['admin'] > 0) {
-				              $pl['comment'] = '[ ����� ����������� : <font color="red">'.$pl['comment'].'</font>]&nbsp;';
-			                } else {
-				              $pl['comment'] = '';
-			                 }
-		                   }
-						$zv_comm = ' '.$pl['comment'].''.$dl.' ';
-						} else {
-						  $zv_comm = '';
-						}
-						if( $pl['priz'] == 1 ) {
-							$imn = '';
-							if( $pl['min_lvl_1'] == 10 ) {
-								$imn .= ' ��. Jora Kardan';
-							}
-							$zv_comm = ' <a href="https://new-combats.com/n/567/" target="_blank"><span style="color:#e65700;" title="��������� �������� ������, ��� ������ �������� ������ �� �����, ��� ������ ������ ������� �� ������ "><b>(����������� ��������'.$imn.')</b></span></a>';
-						}
-						if($r == 5 && ($pl['creator'] == $u->info['id']) && $cols < 2 && $pl['priz'] == 0) {
-						  $del_q = '&nbsp;&nbsp;<a href="main.php?zayvka=1&r=5&del_z_time='.$pl['id'].'&rnd='.$code.'"><img src="https://img.new-combats.com/i/clear.gif" title="������� ������" /></a>';
-						} else {
-						  $del_q = '';
-						}
-						$lvldt = '';
-						if( $pl['min_lvl_1'] != $pl['max_lvl_2'] ) {
-							$lvldt .= ''.$pl['min_lvl_1'].'-'.$pl['max_lvl_2'].' ��. ';
-						}else{
-							$lvldt .= ''.$pl['min_lvl_1'].' ��. ';
-						}
-						$lvldt .= (0+$cols).'/'.$pl['maxplayers'].'';
-						$zvb .= ''.$rad.'<font class="date">'.date('H:i',$pl['time']).'</font> <font color="green"><b><i>('.$lvldt.')</i></b></font> ��� ���: <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif" WIDTH="20" HEIGHT="20" title="��������� ���">'.$n1tv.' (������� <b>'.($pl['timeout']/60).' ���.</b>) <b>'.$zv_comm.'</b> <font class="dsc"><i><font color="green">('.$unvs.'��� �������� ����� <B>'.$tmStart.'</B> ���.)</font> </font></i> '.$mon.' <i>���������:</i> '.$tm.' '.$del_q.'<br />';						
-						
-					//}
-					//else {}
-				}
-						else
-						{
-						if( $pl['min_lvl_1'] < 2 ) {
-							$pl['min_lvl_1'] = 2;
-						}
-						if( $pl['max_lvl_1'] > 21 ) {
-							$pl['max_lvl_1'] = 21;
-						}
-						//������ ���������� ���
-						$tm = '';
-						$tmStart = floor(($pl['time']+$pl['time_start']-time())/6)/10;
-						//if( $u->info['admin'] > 0 ) {
-							if((($pl['time']+$pl['time_start'])/10) != (int)(($pl['time']+$pl['time_start'])/10)) {
-								$pl['time'] = ceil($pl['time']/60)*60;
-								mysql_query('UPDATE `zayvki` SET `time` = "'.$pl['time'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-							}
-						//}
-						$tmStart = $this->rzv($tmStart);
-						
-						$users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "'.$pl['id'].'"');
-						$col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$pl['id'].'"'));
-						$cols = $col_p[0];
-						while($s = mysql_fetch_array($users))
-						{
-							$tm .= $u->microLogin($s['id'],1).', ';
-						}
-						
-						$rad = '';
-						
-						$tm = rtrim($tm,', ');
-						
-						if(!isset($zi['id']) && $u->room['zvsee'] == 0 && $u->info['inTurnirnew'] == 0) {
-							$rad = '<input type="radio" name="btl_go" id="btl_go'.$pl['id'].'" value="'.$pl['id'].'"> ';
-						}
-						
-						$n1tv = '';
-						$unvs = '';
-						if($pl['invise']==1)
-						{
-							//��������� ���
-							$tm = '<i>���������</i>';
-							$unvs = 0;
-							
-								$usrszv = '';
-								//if( $u->info['admin'] > 0 ) {
-									$spzm = mysql_query('SELECT `id`,`team` FROM `stats` WHERE `zv` = "'.$pl['id'].'" AND `id` != "'.$pl['creator'].'"');
-									while( $plzm = mysql_fetch_array($spzm) ) {
-										if($u->info['admin'] > 0 || ($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4) ) {
-											$usrszv .= ','.$u->microLogin($plzm['id'],1).'';
-										}
-										$unvs++;
-									}
-								//}
-								$tm = '<font color=grey><span style="color:maroon">'.$u->microLogin($pl['creator'],1).'</span>'.$usrszv.'</font> - '.$tm;
-							
-							$unvs = ' ����������: '.(1+$unvs).' ���. ';
-							$n1tv = ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="���������">';
-						}
-						//
-						if( $pl['kingfight'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/king.gif" title="�������� ��������">';
-						}
-						if($pl['travmaChance'] == 100 ){
-							$n1tv .= '<img src="https://img.new-combats.com/fighttype6.gif" title="�������� ��������">';
-						}
-						if( $pl['noatack'] == 1 ) {
-							//$n1tv .= ' <img src="https://img.new-combats.com/closefight.gif" title="� ��� ������ ���������">';
-							$n1tv .= ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="�������� ���">';
-						}
-						if( $pl['nobot'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/nobot.gif" title="� ��� �� �������� ����">';
-						}
-						if( $pl['fastfight'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/fastfight.gif" title="��� ������ ��� ���������� ������� 2 ������">';
-						}
-						if( $pl['noeff'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/svitok4.png" width="20" height="20" title="������ �� ������������� ������� �������������� �� � ����">';
-						}
-						if( $pl['arand'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/random.png" width="20" height="20" title="������������� ������ ��������� �������">';
-						}
-						if( $pl['noart'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/noart.png" width="20" height="20" title="��� ��� ����������">';
-						}
-						if( $pl['otmorozok'] == 1 ) {
-							$n1tv .= ' <img src="https://img.new-combats.com/snow.gif" width="20" height="20" title="� ��� ����� ��������� ���������">';
-						}
-						//
-						if($pl['comment'] != '') {
-						  $dl = '';
-						  if(($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom']==0) {
-						    $dl .= ' (<a href="main.php?zayvka=1&r=5&delcom='.$pl['id'].'&key='.$u->info['nextAct'].'&rnd='.$code.'">������� �����������</a>)';          if(isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
-				              mysql_query('UPDATE `zayvki` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				              $pl['dcom'] = $u->info['id'];
-			                }
-						  }
-						  if($pl['dcom'] > 0) { $dl = '<font color="grey"><i>����������� ������ �����������</i></font>'; }
-						  if($pl['dcom'] > 0) {
-							if($moder['boi'] == 1 || $u->info['admin'] > 0) {
-				              $pl['comment'] = '[ ����� ����������� : <font color="red">'.$pl['comment'].'</font>]&nbsp;';
-			                } else {
-				              $pl['comment'] = '';
-			                 }
-		                   }
-						$zv_comm = ' '.$pl['comment'].''.$dl.' ';
-						} else {
-						  $zv_comm = '';
-						}
-						if( $pl['priz'] == 1 ) {
-							$imn = '';
-							if( $pl['min_lvl_1'] == 10 ) {
-								$imn .= ' ��. Jora Kardan';
-							}
-							$zv_comm = ' <a href="https://new-combats.com/n/567/" target="_blank"><span style="color:#e65700;" title="��������� �������� ������, ��� ������ �������� ������ �� �����, ��� ������ ������ ������� �� ������ "><b>(����������� ��������'.$imn.')</b></span></a>';
-						}
-						if($r == 5 && ($pl['creator'] == $u->info['id']) && $cols < 2 && $pl['priz'] == 0) {
-						  $del_q = '&nbsp;&nbsp;<a href="main.php?zayvka=1&r=5&del_z_time='.$pl['id'].'&rnd='.$code.'"><img src="https://img.new-combats.com/i/clear.gif" title="������� ������" /></a>';
-						} else {
-						  $del_q = '';
-						}
-						$lvldt = '';
-						if( $pl['min_lvl_1'] != $pl['max_lvl_2'] ) {
-							$lvldt .= ''.$pl['min_lvl_1'].'-'.$pl['max_lvl_2'].' ��. ';
-						}else{
-							$lvldt .= ''.$pl['min_lvl_1'].' ��. ';
-						}
-						$lvldt .= (0+$cols).'/'.$pl['maxplayers'].'';
-						$zvb .= ''.$rad.'<font class="date">'.date('H:i',$pl['time']).'</font> <font color="green"><b><i>('.$lvldt.')</i></b></font> ��� ���: <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif" WIDTH="20" HEIGHT="20" title="��������� ���">'.$n1tv.' (������� <b>'.($pl['timeout']/60).' ���.</b>) <b>'.$zv_comm.'</b> <font class="dsc"><i><font color="green">('.$unvs.'��� �������� ����� <B>'.$tmStart.'</B> ���.)</font> </font></i> '.$mon.' <i>���������:</i> '.$tm.' '.$del_q.'<br />';						
-						
-						}
-			}			elseif($pl['razdel']==4)
-					{
-						if( $pl['min_lvl_1'] < 2 ) {
-							$pl['min_lvl_1'] = 2;
-						}
-						if( $pl['max_lvl_1'] > 21 ) {
-							$pl['max_lvl_1'] = 21;
-						}
-						if( $pl['min_lvl_2'] < 2 ) {
-							$pl['min_lvl_2'] = 2;
-						}
-						if( $pl['max_lvl_2'] > 21 ) {
-							$pl['max_lvl_2'] = 21;
-						}
-						//������ ���������� ���
-						$tm1 = '';
-						$tm2 = '';
-						$tmStart = floor(($pl['time']+$pl['time_start']-time())/6)/10;
-						$tmStart = $this->rzv($tmStart);
-						
-						//�������� � ������, ���������� ��� ����������
-						//���� �������� ��� ���������
-						$xx2 = $this->testzvu($pl['id'],2,0);
-						if($pl['bot2']>0 && $xx2 < $pl['tm2max'])
-						{
-							//��������� ����� �� ������ �������
-							$spb = mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`bot` = 3 AND `u`.`level` = "'.$pl['min_lvl_2'].'" AND `u`.`battle` = 0 AND `st`.`zv` = 0 LIMIT 100');
-							$logins_bot = array();
-							while($plb = mysql_fetch_array($spb))
-							{
-								if($xx2 < $pl['tm2max'] && rand(0,10000)<5000 && rand(0,10000)>5000)
-								{
-									$bt = $u->addNewbot(0,'',$plb['id']);
-									$logins_bot = $bt['logins_bot'];
-									if($bt>0)
-									{
-										mysql_query('UPDATE `stats` SET `zv` = "'.$pl['id'].'",`team` = "2" WHERE `id` = "'.$bt.'" LIMIT 1');
-										$xx2++;
-									}
-								}
-							}
-							unset($plb,$spb,$logins_bot,$bt);
-						}
-						unset($xx2);						
-						
-						//���������� �������
-						$users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "'.$pl['id'].'"');
-						$tmc = array();
-						while($s = mysql_fetch_array($users))
-						{
-							${'tm'.$s['team']} .= $u->microLogin($s['id'],1).', ';
-							$tmc[$s['team']]++;
-						}					
-						
-						if($tm1=='')
-						{
-							$tm2 = '<font color="#777"><i>������ ���� �� �������</i></font>';
-						}else{
-							$tm1 = rtrim($tm1,', ');
-						}
-						
-						if($tm2=='')
-						{
-							$tm2 = '<font color="#777"><i>������ ���� �� �������</i></font>';
-						}else{
-							$tm2 = rtrim($tm2,', ');
-						}
-						//
-						if( $pl['teams'] == 3 ) {							
-							if($tm3=='')
-							{
-								$tm2 = '<font color="#777"><i>������ ���� �� �������</i></font>';
-							}else{
-								$tm3 = rtrim($tm3,', ');
-							}
-							
-							$ttl1 = '';
-							$ttl2 = '';
-							$ttl3 = '';
-							
-							if( $pl['align1'] == 3 ) { $ttl1 = '����';
-							}elseif( $pl['align1'] == 7 ) { $ttl1 = '��������'; }else{
-								$ttl1 = '����';
-							}
-							if( $pl['align2'] == 3 ) { $ttl2 = '����';
-							}elseif( $pl['align2'] == 7 ) { $ttl2 = '��������'; }else{
-								$ttl2 = '����';
-							}
-							if( $pl['align3'] == 3 ) { $ttl3 = '����';
-							}elseif( $pl['align3'] == 7 ) { $ttl3 = '��������'; }else{
-								$ttl3 = '����';
-							}
-							
-							$tm1 = '<img src="https://img.new-combats.com/i/align/align'.$pl['align1'].'.gif"> '.$ttl1.': ' . $tm1;
-							$tm2 = '<img src="https://img.new-combats.com/i/align/align'.$pl['align2'].'.gif"> '.$ttl2.': ' . $tm2;
-							$tm3 = '<img src="https://img.new-combats.com/i/align/align'.$pl['align3'].'.gif"> '.$ttl3.': ' . $tm3;
-							
-						}
-						//
-						$rad = '';
-						if(!isset($zi['id']) && $u->room['zvsee']==0)
-						{
-							$rad = '<input type="radio" name="groupClick" id="groupClick" value="'.$pl['id'].'"> ';
-						}
-						if($pl['comment']!=''){
-						$dl = '';
-						  if(($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom']==0) {
-						    $dl .= ' (<a href="main.php?zayvka=1&r=4&delcom='.$pl['id'].'&key='.$u->info['nextAct'].'&rnd='.$code.'">������� �����������</a>)';          if(isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
-				              mysql_query('UPDATE `zayvki` SET `dcom` = "'.$u->info['id'].'" WHERE `id` = "'.$pl['id'].'" LIMIT 1');
-				              $pl['dcom'] = $u->info['id'];
-			                }
-						  }
-						  if($pl['dcom'] > 0) { $dl = '<font color="grey"><i>����������� ������ �����������</i></font>'; }
-						  if($pl['dcom'] > 0) {
-							if($moder['boi'] == 1 || $u->info['admin'] > 0) {
-				              $pl['comment'] = '[ ����� ����������� : <font color="red">'.$pl['comment'].'</font>]&nbsp;';
-			                } else {
-				              $pl['comment'] = '';
-			                 }
-		                   }
-						$zv_comm = ''.$pl['comment'].''.$dl.'';
-						}else{$zv_comm='';}
-						if( $pl['teams'] == 3 ) {
-							$zv_comm .= ' <a href="https://new-combats.com/lib/turnir-sklonnostei/" target="_blank"><span style="color:#543666;" title="� ������� ��������� ��� ����������: ����, ����, ��������. ���������� ���������� �������� ��������� ������������� �� ���������� ���."><b>(������ ���� �����������)</b></span></a>';
-						}
-						//$zvb .= ''.$rad.'<font class="date">'.date('H:i',$pl['time']).'</font> <i>(<font color=green>'.(0+$tmc[1]).'/<B>'.$pl['tm1max'].'</font></b>)<b></i> (</b>'.$pl['min_lvl_1'].'-'.$pl['max_lvl_1'].'<b>) �� </b><font title="������� �������" color=green>'.(0+$tmc[2]).'/<b>'.$pl['tm2max'].'</font> (</b>'.$pl['min_lvl_2'].'-'.$pl['max_lvl_2'].'<b>)';
-						
-						
-						$zvb .= ''.$rad.'<font class="date">'.date('H:i',$pl['time']).'</font> ';
-						//
-						$zvb .= '(<font color=green>'.(0+$tmc[1]).'/<b>'.$pl['tm1max'].'</b></font>)';
-						$zvb .= ' '.$tm1;
-						$zvb .= ' <font color="green"><b><i>(';
-						if( $pl['min_lvl_1'] == $pl['max_lvl_1'] ) {
-							$zvb .= $pl['min_lvl_1'];
-						}else{
-							$zvb .= $pl['min_lvl_1'].'-'.$pl['max_lvl_1'];
-						}
-						$zvb .= ' ��.)</i></b></font>';
-						//
-						$zvb .= ' <i>������</i> ';
-						//
-						$zvb .= '(<font color=green>'.(0+$tmc[2]).'/<b>'.$pl['tm2max'].'</b></font>)';
-						$zvb .= ' '.$tm2;
-						$zvb .= ' <font color="green"><b><i>(';
-						if( $pl['min_lvl_2'] == $pl['max_lvl_2'] ) {
-							$zvb .= $pl['min_lvl_2'];
-						}else{
-							$zvb .= $pl['min_lvl_2'].'-'.$pl['max_lvl_2'];
-						}
-						$zvb .= ' ��.)</i></b></font>';
-						//
-						$zvb .= ' ��� ���: <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif" WIDTH="20" HEIGHT="20" title="��������� ���"> (�������: <b>'.($pl['timeout']/60).' ���.</b>) ';
-						$zvb .= ' <b>'.$zv_comm.'</b> ';
-						$zvb .= ' <font color="green"><i>(��� �������� ����� <b>'.$tmStart.'</b>)</i></font> '.$mon.'<BR>';
-						//
-						//$zvb .= ' <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif" WIDTH="20" HEIGHT="20" title="��������� ���"> <font class="dsc"><i>��� �������� ����� <B>'.$tmStart.'</B> ���., ������� '.($pl['timeout']/60).' ���. '.$zv_comm.'</font></i>'.$mon.'<BR>';
-						
-						/*if( $pl['teams'] == 3 ) {
-							$zvb .= ' �� '.$pl['tm2max'].' (</b>'.$pl['min_lvl_2'].'-'.$pl['max_lvl_2'].'<b>)';
-						}
-						$zvb .= '</B> ('.$tm1.') <font class="dsc"><i><span style=\'color:red; font-weight:bold;\'>������</span></font></i> ('.$tm2.')';
-						if( $pl['teams'] == 3 ) {
-							$zvb .= ' <font class="dsc"><i><span style=\'color:red; font-weight:bold;\'>������</span></font></i> ('.$tm3.')';
-						}*/
-						
-						//$zvb .= ' <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif" WIDTH="20" HEIGHT="20" title="��������� ���"> <font class="dsc"><i>��� �������� ����� <B>'.$tmStart.'</B> ���., ������� '.($pl['timeout']/60).' ���. '.$zv_comm.'</font></i>'.$mon.'<BR>';
-					}elseif($pl['razdel']>=1 && $pl['razdel']<=3)
-					{
-						$uz = mysql_fetch_array(mysql_query('SELECT `u`.`banned`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$pl['id'].'" AND `st`.`team`="1" LIMIT 1'));
-						if(isset($uz['id']))
-						{
-							$uze = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$pl['id'].'" AND `st`.`team` = "2" LIMIT 1'));
-							$d1 = '';
-							if($uz['id']==$u->info['id'] || $uze['id']==$u->info['id'] || $u->info['level'] <= $c['bot_level'])
-							{
-								$d1 = 'disabled="disabled"';
-							}
-							//if($uz['clan'] == $u->info['clan'] && $u->info['clan'] != 0) { $d1 = 'disabled="disabled"'; }
-							if(!isset($uze['id']) || $u->info['zv'] == $pl['id'])
-							{
-								$enm = '';
-								
-								if(isset($uze['id']))
-								{									
-									$enm = ' ������ '.$u->microLogin($uze['id'],1).'';
-								}
-								if($uz['banned']>0)
-								{
-									$pl['id'] = 0;
-									$d1 = 'disabled="disabled"';
-									$zvb .= '<span style="text-decoration:line-through;">';
-								}
-								$dp1 = '';
-								if($pl['money']>0)
-								{
-									$dp1 = ' ��� �� ������, ������: <b>'.$u->round2($pl['money']).' ��.</b>';
-								}
-								if($u->room['zvsee'] == 0) {
-									$zvb .= '<input name="btl_go" '.$d1.' type="radio" value="'.$pl['id'].'" />';
-								}
-								$mbcom = '';
-								if( $pl['comment'] != '' ) {
-									$mbcom = ' <b>'.$pl['comment'].'</b>';
-								}
-								$zvb .= '<font class="date">'.date('H:i',$pl['time']).'</font> '.$u->microLogin($uz['id'],1).' '.$enm.'  ��� ���: <img src="https://img.new-combats.com/i/fighttype'.($pl['type']).'.gif"> ( ������� <b>'.round($pl['timeout']/60).' ���.</b>'.$dp1.' '.$mon.')'.$mbcom.'<br>';
-								if($uz['banned']>0) { $zvb .= '</span>'; }
-							}
-						}
-					}
-					$i++;
-				}
-				if($i==0)
-				{
-					//������ ���
-					if($u->room['zvsee'] > 0) {
-						echo '<br><br><br><div align="center"><b>� ������ ������� ��� �� ����� ������</b></div>';
-					}
-				}else{
-					if(!isset($zi['id']) && $u->room['zvsee']==0)
-					{
-						if($_GET['r'] == 5) {
-							if( $u->info['no_zv_key'] != true ) { 
-												
-								echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r='.$r.'&rnd='.$code.'"><br>
-								<img src="https://new-combats.com/show_reg_img/security2.php?id='.time().'" width="70" height="20"> ��� �������������: <input style="width:40px;" type="text" value="" name="code21"> 
-								<input class="btn" name="" type="submit" value="������� ������� � ���������" /><br>'.$zvb.' <img src="https://new-combats.com/show_reg_img/security2.php?id='.time().'" width="70" height="20"> ��� �������������: <input style="width:40px;" type="text" value="" name="code22"> 
+                $usr = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`city` FROM `users` WHERE `login` = "' . mysql_real_escape_string($slogin) . '" LIMIT 1'));
+                if (isset($usr['id'])) {
+                    $tms = $dt;
+                    $tmf = $dt + 86400;
+                    $sp = mysql_query('SELECT * FROM `battle_last` WHERE `time` >= ' . $tms . ' AND `time` < ' . $tmf . ' AND `uid` = "' . $usr['id'] . '" ORDER BY `id` DESC');
+                    $j = 1;
+                    $jk = 0;
+                    $btl_lst = [];
+                    while ($pl = mysql_fetch_array($sp)) {
+                        $b = mysql_fetch_array(mysql_query('SELECT * FROM `battle_end` WHERE `battle_id` = "' . $pl['battle_id'] . '" LIMIT 1'));
+                        $tm = '';
+                        if (isset($b['id'])) {
+                            $tms = [];
+                            $ts = [];
+                            $spi = mysql_query('SELECT * FROM `battle_last` WHERE `battle_id` = "' . $pl['battle_id'] . '"');
+                            while ($pli = mysql_fetch_array($spi)) {
+                                if (!isset($tms[$pli['team']])) {
+                                    $ts[count($ts)] = $pli['team'];
+                                }
+                                $tms[$pli['team']][count($tms[$pli['team']])] = $pli;
+                            }
+                            $k = 0;
+                            while ($k < count($ts)) {
+                                $g = $ts[$k];
+                                $h = 0;
+                                $tm2 = '';
+                                while ($h < count($tms[$g])) {
+                                    if ($tms[$g][$h]['uid'] > 0) {
+                                        if ($tms[$g][$h]['align'] > 0) {
+                                            $tm2 .= '<img src="https://img.new-combats.com/i/align/align' . $tms[$g][$h]['align'] . '.gif">';
+                                        }
+                                        $tm2 .= '<b>' . $tms[$g][$h]['login'] . '</b> [' . $tms[$g][$h]['lvl'] . ']<a href="info/' . $tms[$g][$h]['uid'] . '" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif"></a>, ';
+                                    }
+                                    $h++;
+                                }
+                                $tm2 = rtrim($tm2, ', ');
+                                $btlg = mysql_fetch_array(mysql_query('SELECT `id`,`team_win` FROM `battle` WHERE `id` = "' . $pl['battle_id'] . '" LIMIT 1'));
+                                if (isset($btlg['id']) && $g == $btlg['team_win']) {
+                                    $tm2 .= ' <img width="20" height="20" src="https://img.new-combats.com/i/flag.gif" title="������"> ';
+                                }
+                                $tm .= $tm2;
+                                if ($k + 1 < count($ts) && $tm2 != '' && $ts[$k + 1] > 0) {
+                                    $tm .= ' <font color=red><b>������</b></font> ';
+                                }
+                                $k++;
+                            }
+                        }
+                        if (!isset($btl_lst[$b['id']])) {
+                            $btl_lst[$b['id']] = true;
+                            if ($tm == '') {
+                                $tm = '������ �������� ��������';
+                            }
+                            $jk++;
+                            $btl .= $jk . '. <font class=date>' . date('d.m.y H:i', $pl['time']) . '</font> ' . $tm . ' <A HREF="logs.php?log=' . $pl['battle_id'] . '&rnd=' . $code . '" target=_blank>��</A><br>';
+                        }
+                        $j++;
+                    }
+                }
+                if ($btl == '') {
+                    $see .= '<CENTER><BR><BR><B>� ���� ���� �� ���� ����, ��� ��, ��������� ����� ������� ������...</B><BR><BR><BR></CENTER><HR><BR>';
+                } else {
+                    $see .= $btl;
+                }
+                echo $see;
+            } else {
+                if ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) {
+                    echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
+                }
+            }
+        } else {
+            if ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) {
+                echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
+            }
+        }
+    }
+
+    public function rzv($v)
+    {
+        $v = explode('.', $v);
+        if (!isset($v[1])) {
+            $v = $v[0] . '.0';
+        } else {
+            $v = $v[0] . '.' . $v[1];
+        }
+        return $v;
+    }
+
+    public function rzInfo($id)
+    {
+        global $u;
+        $r = '';
+        $w = mysql_num_rows(mysql_query('SELECT * FROM `zayvki` WHERE `time` > ' . (time() - 7200) . ' AND `cancel` = "0" AND `start` = "0" AND `razdel` = "' . $id . '" AND (`min_lvl_1` <= ' . $u->info['level'] . ' OR `min_lvl_2` <= ' . $u->info['level'] . ') AND (`max_lvl_1` >= ' . $u->info['level'] . ' OR `max_lvl_2` >= ' . $u->info['level'] . ')'));
+        if ($w > 0) {
+            $r = ' <small><font color="grey">(' . $w . ')</font></small>';
+        }
+        return $r;
+    }
+
+    public function testzvu($id, $tm, $bt)
+    {
+        $r = 0;
+        if ($bt == 0) {
+            $r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $id . '" AND `team` = "' . $tm . '"'));
+        } else {
+            $r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $id . '" AND `team` = "' . $tm . '" AND `bot` = "2"'));
+        }
+        return $r;
+    }
+
+    public function seeZv()
+    {
+        global $u, $c, $code, $zi;
+        if (isset($_GET['r']) && $this->zv_see == 1) {
+            $r = round(intval($_GET['r']));
+            if ($r >= 1 && $r <= 5) {
+                //������ ������
+                $i = 0;
+                $cl = mysql_query('SELECT * FROM `zayvki` WHERE `razdel` = "' . mysql_real_escape_string($r) . '" AND `start` = "0" AND `cancel` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '" /*AND `city` = "' . $u->info['city'] . '"*/ ORDER BY `id` DESC');
+                $zvb = '';
+
+                while ($pl = mysql_fetch_array($cl)) {
+                    if ($pl['razdel'] == 5) {
+                        if ($pl['min_lvl_1'] < 2) {
+                            $pl['min_lvl_1'] = 2;
+                        }
+                        if ($pl['max_lvl_1'] > 21) {
+                            $pl['max_lvl_1'] = 21;
+                        }
+                        $tm = '';
+                        $tmStart = floor(($pl['time'] + $pl['time_start'] - time()) / 6) / 10;
+                        if ((($pl['time'] + $pl['time_start']) / 10) != (int)(($pl['time'] + $pl['time_start']) / 10)) {
+                            $pl['time'] = ceil($pl['time'] / 60) * 60;
+                            mysql_query('UPDATE `zayvki` SET `time` = "' . $pl['time'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                        }
+                        $tmStart = $this->rzv($tmStart);
+                        $users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "' . $pl['id'] . '"');
+                        $col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $pl['id'] . '"'));
+                        $cols = $col_p[0];
+                        while ($s = mysql_fetch_array($users)) {
+                            $tm .= $u->microLogin($s['id'], 1) . ', ';
+                        }
+                        $rad = '';
+                        $tm = rtrim($tm, ', ');
+                        if (!isset($zi['id']) && $u->room['zvsee'] == 0 && $u->info['inTurnirnew'] == 0) {
+                            $rad = '<input type="radio" name="btl_go" id="btl_go' . $pl['id'] . '" value="' . $pl['id'] . '"> ';
+                        }
+                        $n1tv = '';
+                        $unvs = '';
+                        if ($pl['invise'] == 1) {
+                            //��������� ���
+                            $tm = '<i>���������</i>';
+                            $unvs = 0;
+
+                            $usrszv = '';
+                            //if( $u->info['admin'] > 0 ) {
+                            $spzm = mysql_query('SELECT `id`,`team` FROM `stats` WHERE `zv` = "' . $pl['id'] . '" AND `id` != "' . $pl['creator'] . '"');
+                            while ($plzm = mysql_fetch_array($spzm)) {
+                                if ($u->info['admin'] > 0 || ($u->info['align'] > 1 && $u->info['align'] < 2) || ($u->info['align'] > 3 && $u->info['align'] < 4)) {
+                                    $usrszv .= ',' . $u->microLogin($plzm['id'], 1) . '';
+                                }
+                                $unvs++;
+                            }
+                            //}
+                            $tm = '<font color=grey><span style="color:maroon">' . $u->microLogin($pl['creator'], 1) . '</span>' . $usrszv . '</font> - ' . $tm;
+
+                            $unvs = ' ����������: ' . (1 + $unvs) . ' ���. ';
+                            $n1tv = ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="���������">';
+                        }
+                        if ($pl['kingfight'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/king.gif" title="�������� ��������">';
+                        }
+                        if ($pl['travmaChance'] == 100) {
+                            $n1tv .= '<img src="https://img.new-combats.com/fighttype6.gif" title="�������� ��������">';
+                        }
+                        if ($pl['noatack'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="�������� ���">';
+                        }
+                        if ($pl['nobot'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/nobot.gif" title="� ��� �� �������� ����">';
+                        }
+                        if ($pl['fastfight'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/fastfight.gif" title="��� ������ ��� ���������� ������� 2 ������">';
+                        }
+                        if ($pl['noeff'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/svitok4.png" width="20" height="20" title="������ �� ������������� ������� �������������� �� � ����">';
+                        }
+                        if ($pl['arand'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/random.png" width="20" height="20" title="������������� ������ ��������� �������">';
+                        }
+                        if ($pl['noart'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/noart.png" width="20" height="20" title="��� ��� ����������">';
+                        }
+                        if ($pl['otmorozok'] == 1) {
+                            $n1tv .= ' <img src="https://img.new-combats.com/snow.gif" width="20" height="20" title="� ��� ����� ��������� ���������">';
+                        }
+                        if ($pl['comment'] != '') {
+                            $dl = '';
+                            if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+                                $dl .= ' (<a href="main.php?zayvka=1&r=5&delcom=' . $pl['id'] . '&key=' . $u->info['nextAct'] . '&rnd=' . $code . '">������� �����������</a>)';
+                                if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+                                    mysql_query('UPDATE `zayvki` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                                    $pl['dcom'] = $u->info['id'];
+                                }
+                            }
+                            if ($pl['dcom'] > 0) {
+                                $dl = '<font color="grey"><i>����������� ������ �����������</i></font>';
+                            }
+                            if ($pl['dcom'] > 0) {
+                                if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+                                    $pl['comment'] = '[ ����� ����������� : <font color="red">' . $pl['comment'] . '</font>]&nbsp;';
+                                } else {
+                                    $pl['comment'] = '';
+                                }
+                            }
+                            $zv_comm = ' ' . $pl['comment'] . '' . $dl . ' ';
+                        } else {
+                            $zv_comm = '';
+                        }
+                        if ($pl['priz'] == 1) {
+                            $imn = '';
+                            if ($pl['min_lvl_1'] == 10) {
+                                $imn .= ' ��. Jora Kardan';
+                            }
+                            $zv_comm = ' <a href="https://new-combats.com/n/567/" target="_blank"><span style="color:#e65700;" title="��������� �������� ������, ��� ������ �������� ������ �� �����, ��� ������ ������ ������� �� ������ "><b>(����������� ��������' . $imn . ')</b></span></a>';
+                        }
+                        if ($r == 5 && ($pl['creator'] == $u->info['id']) && $cols < 2 && $pl['priz'] == 0) {
+                            $del_q = '&nbsp;&nbsp;<a href="main.php?zayvka=1&r=5&del_z_time=' . $pl['id'] . '&rnd=' . $code . '"><img src="https://img.new-combats.com/i/clear.gif" title="������� ������" /></a>';
+                        } else {
+                            $del_q = '';
+                        }
+                        $lvldt = '';
+                        if ($pl['min_lvl_1'] != $pl['max_lvl_2']) {
+                            $lvldt .= '' . $pl['min_lvl_1'] . '-' . $pl['max_lvl_2'] . ' ��. ';
+                        } else {
+                            $lvldt .= '' . $pl['min_lvl_1'] . ' ��. ';
+                        }
+                        $lvldt .= (0 + $cols) . '/' . $pl['maxplayers'] . '';
+                        $zvb .= $rad . '<font class="date">' . date('H:i', $pl['time']) . '</font> <font color="green"><b><i>(' . $lvldt . ')</i></b></font> ��� ���: <IMG SRC="https://img.new-combats.com/i/fighttype' . $pl['type'] . '.gif" WIDTH="20" HEIGHT="20" title="��������� ���">' . $n1tv . ' (������� <b>' . ($pl['timeout'] / 60) . ' ���.</b>) <b>' . $zv_comm . '</b> <font class="dsc"><i><font color="green">(' . $unvs . '��� �������� ����� <B>' . $tmStart . '</B> ���.)</font> </font></i> ' . $mon . ' <i>���������:</i> ' . $tm . ' ' . $del_q . '<br />';
+                    } elseif ($pl['razdel'] == 4) {
+                        if ($pl['min_lvl_1'] < 2) {
+                            $pl['min_lvl_1'] = 2;
+                        }
+                        if ($pl['max_lvl_1'] > 21) {
+                            $pl['max_lvl_1'] = 21;
+                        }
+                        if ($pl['min_lvl_2'] < 2) {
+                            $pl['min_lvl_2'] = 2;
+                        }
+                        if ($pl['max_lvl_2'] > 21) {
+                            $pl['max_lvl_2'] = 21;
+                        }
+                        //������ ���������� ���
+                        $tm1 = '';
+                        $tm2 = '';
+                        $tmStart = floor(($pl['time'] + $pl['time_start'] - time()) / 6) / 10;
+                        $tmStart = $this->rzv($tmStart);
+
+                        //�������� � ������, ���������� ��� ����������
+                        //���� �������� ��� ���������
+                        $xx2 = $this->testzvu($pl['id'], 2, 0);
+                        if ($pl['bot2'] > 0 && $xx2 < $pl['tm2max']) {
+                            //��������� ����� �� ������ �������
+                            $spb = mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`bot` = 3 AND `u`.`level` = "' . $pl['min_lvl_2'] . '" AND `u`.`battle` = 0 AND `st`.`zv` = 0 LIMIT 100');
+                            $logins_bot = [];
+                            while ($plb = mysql_fetch_array($spb)) {
+                                if ($xx2 < $pl['tm2max'] && rand(0, 10000) < 5000 && rand(0, 10000) > 5000) {
+                                    $bt = $u->addNewbot(0, '', $plb['id']);
+                                    $logins_bot = $bt['logins_bot'];
+                                    if ($bt > 0) {
+                                        mysql_query('UPDATE `stats` SET `zv` = "' . $pl['id'] . '",`team` = "2" WHERE `id` = "' . $bt . '" LIMIT 1');
+                                        $xx2++;
+                                    }
+                                }
+                            }
+                            unset($plb, $spb, $logins_bot, $bt);
+                        }
+                        unset($xx2);
+
+                        //���������� �������
+                        $users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "' . $pl['id'] . '"');
+                        $tmc = [];
+                        while ($s = mysql_fetch_array($users)) {
+                            ${'tm' . $s['team']} .= $u->microLogin($s['id'], 1) . ', ';
+                            $tmc[$s['team']]++;
+                        }
+
+                        if ($tm1 == '') {
+                            $tm2 = '<font color="#777"><i>������ ���� �� �������</i></font>';
+                        } else {
+                            $tm1 = rtrim($tm1, ', ');
+                        }
+
+                        if ($tm2 == '') {
+                            $tm2 = '<font color="#777"><i>������ ���� �� �������</i></font>';
+                        } else {
+                            $tm2 = rtrim($tm2, ', ');
+                        }
+                        //
+                        if ($pl['teams'] == 3) {
+                            if ($tm3 == '') {
+                                $tm2 = '<font color="#777"><i>������ ���� �� �������</i></font>';
+                            } else {
+                                $tm3 = rtrim($tm3, ', ');
+                            }
+
+                            $ttl1 = '';
+                            $ttl2 = '';
+                            $ttl3 = '';
+
+                            if ($pl['align1'] == 3) {
+                                $ttl1 = '����';
+                            } elseif ($pl['align1'] == 7) {
+                                $ttl1 = '��������';
+                            } else {
+                                $ttl1 = '����';
+                            }
+                            if ($pl['align2'] == 3) {
+                                $ttl2 = '����';
+                            } elseif ($pl['align2'] == 7) {
+                                $ttl2 = '��������';
+                            } else {
+                                $ttl2 = '����';
+                            }
+                            if ($pl['align3'] == 3) {
+                                $ttl3 = '����';
+                            } elseif ($pl['align3'] == 7) {
+                                $ttl3 = '��������';
+                            } else {
+                                $ttl3 = '����';
+                            }
+
+                            $tm1 = '<img src="https://img.new-combats.com/i/align/align' . $pl['align1'] . '.gif"> ' . $ttl1 . ': ' . $tm1;
+                            $tm2 = '<img src="https://img.new-combats.com/i/align/align' . $pl['align2'] . '.gif"> ' . $ttl2 . ': ' . $tm2;
+                            $tm3 = '<img src="https://img.new-combats.com/i/align/align' . $pl['align3'] . '.gif"> ' . $ttl3 . ': ' . $tm3;
+
+                        }
+                        //
+                        $rad = '';
+                        if (!isset($zi['id']) && $u->room['zvsee'] == 0) {
+                            $rad = '<input type="radio" name="groupClick" id="groupClick" value="' . $pl['id'] . '"> ';
+                        }
+                        if ($pl['comment'] != '') {
+                            $dl = '';
+                            if (($moder['boi'] == 1 || $u->info['admin'] > 0) && $pl['dcom'] == 0) {
+                                $dl .= ' (<a href="main.php?zayvka=1&r=4&delcom=' . $pl['id'] . '&key=' . $u->info['nextAct'] . '&rnd=' . $code . '">������� �����������</a>)';
+                                if (isset($_GET['delcom']) && $_GET['delcom'] == $pl['id'] && $u->newAct($_GET['key']) == true) {
+                                    mysql_query('UPDATE `zayvki` SET `dcom` = "' . $u->info['id'] . '" WHERE `id` = "' . $pl['id'] . '" LIMIT 1');
+                                    $pl['dcom'] = $u->info['id'];
+                                }
+                            }
+                            if ($pl['dcom'] > 0) {
+                                $dl = '<font color="grey"><i>����������� ������ �����������</i></font>';
+                            }
+                            if ($pl['dcom'] > 0) {
+                                if ($moder['boi'] == 1 || $u->info['admin'] > 0) {
+                                    $pl['comment'] = '[ ����� ����������� : <font color="red">' . $pl['comment'] . '</font>]&nbsp;';
+                                } else {
+                                    $pl['comment'] = '';
+                                }
+                            }
+                            $zv_comm = '' . $pl['comment'] . '' . $dl . '';
+                        } else {
+                            $zv_comm = '';
+                        }
+                        if ($pl['teams'] == 3) {
+                            $zv_comm .= ' <a href="https://new-combats.com/lib/turnir-sklonnostei/" target="_blank"><span style="color:#543666;" title="� ������� ��������� ��� ����������: ����, ����, ��������. ���������� ���������� �������� ��������� ������������� �� ���������� ���."><b>(������ ���� �����������)</b></span></a>';
+                        }
+
+                        $zvb .= $rad . '<font class="date">' . date('H:i', $pl['time']) . '</font> ';
+                        $zvb .= '(<font color=green>' . (0 + $tmc[1]) . '/<b>' . $pl['tm1max'] . '</b></font>)';
+                        $zvb .= ' ' . $tm1;
+                        $zvb .= ' <font color="green"><b><i>(';
+                        if ($pl['min_lvl_1'] == $pl['max_lvl_1']) {
+                            $zvb .= $pl['min_lvl_1'];
+                        } else {
+                            $zvb .= $pl['min_lvl_1'] . '-' . $pl['max_lvl_1'];
+                        }
+                        $zvb .= ' ��.)</i></b></font>';
+                        $zvb .= ' <i>������</i> ';
+                        $zvb .= '(<font color=green>' . (0 + $tmc[2]) . '/<b>' . $pl['tm2max'] . '</b></font>)';
+                        $zvb .= ' ' . $tm2;
+                        $zvb .= ' <font color="green"><b><i>(';
+                        if ($pl['min_lvl_2'] == $pl['max_lvl_2']) {
+                            $zvb .= $pl['min_lvl_2'];
+                        } else {
+                            $zvb .= $pl['min_lvl_2'] . '-' . $pl['max_lvl_2'];
+                        }
+                        $zvb .= ' ��.)</i></b></font>';
+                        $zvb .= ' ��� ���: <IMG SRC="https://img.new-combats.com/i/fighttype' . $pl['type'] . '.gif" WIDTH="20" HEIGHT="20" title="��������� ���"> (�������: <b>' . ($pl['timeout'] / 60) . ' ���.</b>) ';
+                        $zvb .= ' <b>' . $zv_comm . '</b> ';
+                        $zvb .= ' <font color="green"><i>(��� �������� ����� <b>' . $tmStart . '</b>)</i></font> ' . $mon . '<BR>';
+                    } elseif ($pl['razdel'] >= 1 && $pl['razdel'] <= 3) {
+                        $uz = mysql_fetch_array(mysql_query('SELECT `u`.`banned`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $pl['id'] . '" AND `st`.`team`="1" LIMIT 1'));
+                        if (isset($uz['id'])) {
+                            $uze = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $pl['id'] . '" AND `st`.`team` = "2" LIMIT 1'));
+                            $d1 = '';
+                            if ($uz['id'] == $u->info['id'] || $uze['id'] == $u->info['id'] || $u->info['level'] <= $c['bot_level']) {
+                                $d1 = 'disabled="disabled"';
+                            }
+                            if (!isset($uze['id']) || $u->info['zv'] == $pl['id']) {
+                                $enm = '';
+                                if (isset($uze['id'])) {
+                                    $enm = ' ������ ' . $u->microLogin($uze['id'], 1) . '';
+                                }
+                                if ($uz['banned'] > 0) {
+                                    $pl['id'] = 0;
+                                    $d1 = 'disabled="disabled"';
+                                    $zvb .= '<span style="text-decoration:line-through;">';
+                                }
+                                $dp1 = '';
+                                if ($pl['money'] > 0) {
+                                    $dp1 = ' ��� �� ������, ������: <b>' . $u->round2($pl['money']) . ' ��.</b>';
+                                }
+                                if ($u->room['zvsee'] == 0) {
+                                    $zvb .= '<input name="btl_go" ' . $d1 . ' type="radio" value="' . $pl['id'] . '" />';
+                                }
+                                $mbcom = '';
+                                if ($pl['comment'] != '') {
+                                    $mbcom = ' <b>' . $pl['comment'] . '</b>';
+                                }
+                                $zvb .= '<font class="date">' . date('H:i', $pl['time']) . '</font> ' . $u->microLogin($uz['id'], 1) . ' ' . $enm . '  ��� ���: <img src="https://img.new-combats.com/i/fighttype' . ($pl['type']) . '.gif"> ( ������� <b>' . round($pl['timeout'] / 60) . ' ���.</b>' . $dp1 . ' ' . $mon . ')' . $mbcom . '<br>';
+                                if ($uz['banned'] > 0) {
+                                    $zvb .= '</span>';
+                                }
+                            }
+                        }
+                    }
+                    $i++;
+                }
+                if ($i == 0) {
+                    //������ ���
+                    if ($u->room['zvsee'] > 0) {
+                        echo '<br><br><br><div align="center"><b>� ������ ������� ��� �� ����� ������</b></div>';
+                    }
+                } else {
+                    if (!isset($zi['id']) && $u->room['zvsee'] == 0) {
+                        if ($_GET['r'] == 5) {
+                            if (!$u->info['no_zv_key']) {
+                                echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '"><br>
+								<img src="https://new-combats.com/show_reg_img/security2.php?id=' . time() . '" width="70" height="20"> ��� �������������: <input style="width:40px;" type="text" value="" name="code21"> 
+								<input class="btn" name="" type="submit" value="������� ������� � ���������" /><br>' . $zvb . ' <img src="https://new-combats.com/show_reg_img/security2.php?id=' . time() . '" width="70" height="20"> ��� �������������: <input style="width:40px;" type="text" value="" name="code22"> 
 								<input class="btn" style="margin-top:1px;" type="submit" value="������� ������� � ���������" />
 								</form></div>';
-								
-							}else{
-								echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r='.$r.'&rnd='.$code.'"><br> 
-								<input class="btn" name="" type="submit" value="������� ������� � ���������" /><br>'.$zvb.' 
+                            } else {
+                                echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '"><br> 
+								<input class="btn" name="" type="submit" value="������� ������� � ���������" /><br>' . $zvb . ' 
 								<input class="btn" style="margin-top:1px;" type="submit" value="������� ������� � ���������" /></form></div>';
-							}
-						}else{
-							if( $zvb != '' && $u->info['level'] > $c['bot_level'] ) {
-								echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r='.$r.'&rnd='.$code.'"><br><input class="btn" name="" type="submit" value="������� �����" /><br>'.$zvb.'<input class="btn" style="margin-top:1px;" type="submit" value="������� �����" /></form></div>';
-							}else{
-								echo '<div style="float:left;">'.$zvb.'</div>';
-							}
-						}
-					}else{
-						echo $zvb;
-					}
-				}
-			}
-		}
-	}
-	
-	public function go($id)
-	{
-		global $u,$c,$code,$zi,$filter;
-		if(!isset($zi['id']))
-		{
-			if($u->info['battle']==0 && $u->info['inTurnirnew']==0)
-			{
-				$z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="'.mysql_real_escape_string(intval($id)).'" /*AND `city` = "'.$u->info['city'].'"*/ AND `start` = "0" AND `cancel` = "0" AND `time` > "'.(time()-60*60*2).'" LIMIT 1'));
-				if(isset($z['id']))
-				{
-					if($z['razdel']>=1 && $z['razdel']<=3)
-					{
-						//�������, ����, ����������
-						$uz1 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$z['id'].'" AND `st`.`team`="1" LIMIT 1'));
-						if(isset($uz1['id']))
-						{
-							$uz2 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$z['id'].'" AND `st`.`team`="2" LIMIT 1'));
-							if( $this->testTravm() == 1 &&  $z['type'] != 1 ) {
-								$this->error = '�� ������������. � ������ �������� �������� �������� ���.';
-								$az = 0;
-							}elseif( $this->testTravm() == 2 ) {
-								$this->error = '�� ������������. � ������ �������� ���������� ���������.';
-								$az = 0;
-							}elseif($u->info['hpNow']<$u->stats['hpAll']/100*30 && ($z['razdel']>=1 || $z['razdel']<=3)) {
-								$this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
-								$az = 0;
-							} elseif($uz1['clan']==$u->info['clan'] && $u->info['clan']!=0 && $u->info['admin'] == 0 && true == false) {
-								$this->error = '�� �� ������ ��������� ������ ��������';
-							} elseif($z['withUser']!='' && $filter->mystr($u->info['login'])!=$filter->mystr($z['withUser']) && $z['razdel']==3) {
-								$this->error = '�� �� ������ ������� ��� ������';
-							} elseif($z['money'] > 0 && $z['money'] > $u->info['money']) {
-								$this->error = '� ��� ������������ �����, ����� ������� ��� ������';
-							}elseif($u->stats['hpNow']<ceil($u->stats['hpMax']/100*30))
-							{
-								$this->error = '�� ������� ���������, ��������������';
-							}elseif(!isset($uz2['id']))
-							{
-								$upd = mysql_query('UPDATE `stats` SET `zv` = "'.$z['id'].'",`team` = "2" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-								if($upd)
-								{
-									$ca = '';
-									if($uz1['clan']!=0)
-									{
-										$pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$uz1['clan'].'" LIMIT 1'));
-										if(isset($pc['id']))
-										{
-											$pc['img'] = $pc['name_mini'].'.gif';
-											$ca = '<img title="'.$pc['name'].'" src="https://img.new-combats.com/i/clan/'.$pc['name_mini'].'.gif">';
-										}
-									}
-									if($uz1['align']!=0)
-									{
-										$ca = '<img src="https://img.new-combats.com/i/align/align'.$uz1['align'].'.gif">'.$ca;
-									}
-									$this->error = '������� ������������� ��� �� '.$ca.' '.$uz1['login'].' ['.$uz1['level'].']<a href="info/'.$uz1['id'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif"></a>';
-									$sa = '';
-									if($u->info['sex']==2)
-									{
-										$sa = '�';
-									}
-									$text = ' [login:'.$u->info['login'].'] ������'.$sa.' ���� ������ �� ���.[reflesh_main_zv_priem:'.$u->info['id'].']';
-									mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','".$uz1['city']."','','','".$uz1['login']."','".$text."','".time()."','6','0')");
-									$zi = $z;
-									$u->info['zv'] = $z['id'];
-									$u->info['team'] = 2;
-								}else{
-									$this->error = '���������� ������� ������.';
-								}
-							}else{
-								$this->error = '������ ��� ���-�� ������ �� ���.';
-							}
-						}else{
-							$this->error = '������ �� ��� �������������.';
-						}
-					}elseif($z['razdel']==4 && $u->info['level']>1)
-					{
-						$tm = 0;
-											//���������
-						if(isset($_GET['tm1']))
-						{
-							$tm = 1;
-						}elseif(isset($_GET['tm2']))
-						{
-							$tm = 2;
-						}else{
-							$this->error = '���-�� ����� �� ���';	
-						}
-						
-						if($tm!=0)
-						{
-							$t1 = $tm;
-							$t2 = 1;
-							$tmmax = 0;
-							if($tm==1){ $t2 = 2; }
-							$cl111 = mysql_query('SELECT `u`.`clan`,`st`.`team`,`st`.`id`,`st`.`zv` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv` = "'.$z['id'].'" LIMIT 200');
-							$cln = 0;
-							while($pc111 = mysql_fetch_array($cl111))
-							{
-								if($pc111['clan']==$u->info['clan'] && $u->info['clan']!=0 && $pc111['team']==$t2)
-								{
-									$cln++;
-								}
-								if($pc111['team']==$t1)
-								{
-									$tmmax++;
-								}
-							}
-							if($cln>0)
-							{
-								$this->error = '�� �� ������ ��������� ������ ��������';
-							}elseif($z['bot2']==1 && $t1==2) {
-								$this->error = '�� �� ������ ��������� �� ������� �����';
-							} elseif($z['money3'] > 0 && $z['money3'] > $u->info['money3']) {
-								$this->error = '� ��� ������������ �����, ����� ������� ��� ������';
-							} elseif(($z['money'] > 0 || $z['money3'] > 0) && $u->info['level'] < 4) {
-								$this->error = '��� �� ������ ���������� � 4-�� ������';
-							}elseif($z['tm'.$t1.'max']>$tmmax)
-							{
-								if($z['min_lvl_'.$t1]>$u->info['level'] || $z['max_lvl_'.$t1]<$u->info['level'])
-								{
-									$this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� '.$z['min_lvl_'.$t1].' - '.$z['max_lvl_'.$t1].' ������';
-								}elseif($u->stats['hpNow']<ceil($u->stats['hpMax']/100*30))
-								{
-									$this->error = '�� ������� ���������, ��������������';
-								}else{
-									$upd = mysql_query('UPDATE `stats` SET `zv` = "'.$z['id'].'",`team` = "'.mysql_real_escape_string((int)$t1).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-									if(!$upd)
-									{
-										$this->error = '������ ������ ������...';
-									}else{
-										$this->error = '�� ������� ��������� ���...';
-										$zi = $z;
-										$u->info['zv'] = $z['id'];
-										$u->info['team'] = mysql_real_escape_string((int)$t1);
-									}
-								}
-							}else{
-								$this->error = '������ ��� ������� ('.($z['tm'.$t1.'max']-$tmmax).')';
-							}
-						}
-					}elseif($z['razdel']==5 && $u->info['level']>1)
-					{
-						//���������
-						$col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$z['id'].'"'));
-						$cols = $col_p[0];
-						if( $cols >= $z['maxplayers'] ) {
-							$this->error = '��������� ������������ ������ ���������� � ���� ������!';
-						}elseif( $this->testTravm() == 1 &&  $z['k'] != 1 ) {
-							$this->error = '�� ������������. � ������ �������� �������� �������� ���.';
-						}elseif( $this->testTravm() == 2 ) {
-								$this->error = '�� ������������. � ������ �������� ���������� ���������.';
-						}elseif( $u->info['no_zv_key'] != true && (!isset($_SESSION['code2']) || $_SESSION['code2'] < 1 || ($_POST['code21'] != $_SESSION['code2'] && $_POST['code22'] != $_SESSION['code2'])) )
-						{
-							$this->error = '������������ ��� �������������';
-						}elseif($z['min_lvl_1']>$u->info['level'] || $z['max_lvl_1']<$u->info['level'])
-						{
-							$this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� '.$z['min_lvl_1'].' - '.$z['max_lvl_1'].' ������';
-						}elseif($u->stats['hpNow']<ceil($u->stats['hpMax']/100*30)) {
-							$this->error = '�� ������� ���������, ��������������';
-						} elseif($z['money'] > 0 && $u->info['level'] < 4) {
-						  $this->error = '��� �� ������ ���������� � 4-�� ������';
-						}else{
-							$t1 = 0;
-							
-							if ($z['type']==33)
-								{
-									
-				//============================================================================================= ��������
-				
-		mysql_query('INSERT INTO `users` (`name`,`align`,`real`,`login`,`host_reg`,`pass`,`ip`,`ipreg`,`city`,`cityreg`,`room`,`timereg`,
+                            }
+                        } else {
+                            if ($zvb != '' && $u->info['level'] > $c['bot_level']) {
+                                echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '"><br><input class="btn" name="" type="submit" value="������� �����" /><br>' . $zvb . '<input class="btn" style="margin-top:1px;" type="submit" value="������� �����" /></form></div>';
+                            } else {
+                                echo '<div style="float:left;">' . $zvb . '</div>';
+                            }
+                        }
+                    } else {
+                        echo $zvb;
+                    }
+                }
+            }
+        }
+    }
+
+    public function go($id)
+    {
+        global $u, $c, $code, $zi, $filter;
+        if (!isset($zi['id'])) {
+            if ($u->info['battle'] == 0 && $u->info['inTurnirnew'] == 0) {
+                $z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="' . mysql_real_escape_string(intval($id)) . '" /*AND `city` = "' . $u->info['city'] . '"*/ AND `start` = "0" AND `cancel` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '" LIMIT 1'));
+                if (isset($z['id'])) {
+                    if ($z['razdel'] >= 1 && $z['razdel'] <= 3) {
+                        //�������, ����, ����������
+                        $uz1 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $z['id'] . '" AND `st`.`team`="1" LIMIT 1'));
+                        if (isset($uz1['id'])) {
+                            $uz2 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $z['id'] . '" AND `st`.`team`="2" LIMIT 1'));
+                            if ($this->testTravm() == 1 && $z['type'] != 1) {
+                                $this->error = '�� ������������. � ������ �������� �������� �������� ���.';
+                                $az = 0;
+                            } elseif ($this->testTravm() == 2) {
+                                $this->error = '�� ������������. � ������ �������� ���������� ���������.';
+                                $az = 0;
+                            } elseif ($u->info['hpNow'] < $u->stats['hpAll'] / 100 * 30 && ($z['razdel'] >= 1 || $z['razdel'] <= 3)) {
+                                $this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
+                                $az = 0;
+                            } elseif ($uz1['clan'] == $u->info['clan'] && $u->info['clan'] != 0 && $u->info['admin'] == 0 && true == false) {
+                                $this->error = '�� �� ������ ��������� ������ ��������';
+                            } elseif ($z['withUser'] != '' && $filter->mystr($u->info['login']) != $filter->mystr($z['withUser']) && $z['razdel'] == 3) {
+                                $this->error = '�� �� ������ ������� ��� ������';
+                            } elseif ($z['money'] > 0 && $z['money'] > $u->info['money']) {
+                                $this->error = '� ��� ������������ �����, ����� ������� ��� ������';
+                            } elseif ($u->stats['hpNow'] < ceil($u->stats['hpMax'] / 100 * 30)) {
+                                $this->error = '�� ������� ���������, ��������������';
+                            } elseif (!isset($uz2['id'])) {
+                                $upd = mysql_query('UPDATE `stats` SET `zv` = "' . $z['id'] . '",`team` = "2" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                if ($upd) {
+                                    $ca = '';
+                                    if ($uz1['clan'] != 0) {
+                                        $pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="' . $uz1['clan'] . '" LIMIT 1'));
+                                        if (isset($pc['id'])) {
+                                            $pc['img'] = $pc['name_mini'] . '.gif';
+                                            $ca = '<img title="' . $pc['name'] . '" src="https://img.new-combats.com/i/clan/' . $pc['name_mini'] . '.gif">';
+                                        }
+                                    }
+                                    if ($uz1['align'] != 0) {
+                                        $ca = '<img src="https://img.new-combats.com/i/align/align' . $uz1['align'] . '.gif">' . $ca;
+                                    }
+                                    $this->error = '������� ������������� ��� �� ' . $ca . ' ' . $uz1['login'] . ' [' . $uz1['level'] . ']<a href="info/' . $uz1['id'] . '" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif"></a>';
+                                    $sa = '';
+                                    if ($u->info['sex'] == 2) {
+                                        $sa = '�';
+                                    }
+                                    $text = ' [login:' . $u->info['login'] . '] ������' . $sa . ' ���� ������ �� ���.[reflesh_main_zv_priem:' . $u->info['id'] . ']';
+                                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('1','" . $uz1['city'] . "','','','" . $uz1['login'] . "','" . $text . "','" . time() . "','6','0')");
+                                    $zi = $z;
+                                    $u->info['zv'] = $z['id'];
+                                    $u->info['team'] = 2;
+                                } else {
+                                    $this->error = '���������� ������� ������.';
+                                }
+                            } else {
+                                $this->error = '������ ��� ���-�� ������ �� ���.';
+                            }
+                        } else {
+                            $this->error = '������ �� ��� �������������.';
+                        }
+                    } elseif ($z['razdel'] == 4 && $u->info['level'] > 1) {
+                        $tm = 0;
+                        //���������
+                        if (isset($_GET['tm1'])) {
+                            $tm = 1;
+                        } elseif (isset($_GET['tm2'])) {
+                            $tm = 2;
+                        } else {
+                            $this->error = '���-�� ����� �� ���';
+                        }
+                        if ($tm != 0) {
+                            $t1 = $tm;
+                            $t2 = 1;
+                            $tmmax = 0;
+                            if ($tm == 1) {
+                                $t2 = 2;
+                            }
+                            $cl111 = mysql_query('SELECT `u`.`clan`,`st`.`team`,`st`.`id`,`st`.`zv` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv` = "' . $z['id'] . '" LIMIT 200');
+                            $cln = 0;
+                            while ($pc111 = mysql_fetch_array($cl111)) {
+                                if ($pc111['clan'] == $u->info['clan'] && $u->info['clan'] != 0 && $pc111['team'] == $t2) {
+                                    $cln++;
+                                }
+                                if ($pc111['team'] == $t1) {
+                                    $tmmax++;
+                                }
+                            }
+                            if ($cln > 0) {
+                                $this->error = '�� �� ������ ��������� ������ ��������';
+                            } elseif ($z['bot2'] == 1 && $t1 == 2) {
+                                $this->error = '�� �� ������ ��������� �� ������� �����';
+                            } elseif ($z['money3'] > 0 && $z['money3'] > $u->info['money3']) {
+                                $this->error = '� ��� ������������ �����, ����� ������� ��� ������';
+                            } elseif (($z['money'] > 0 || $z['money3'] > 0) && $u->info['level'] < 4) {
+                                $this->error = '��� �� ������ ���������� � 4-�� ������';
+                            } elseif ($z['tm' . $t1 . 'max'] > $tmmax) {
+                                if ($z['min_lvl_' . $t1] > $u->info['level'] || $z['max_lvl_' . $t1] < $u->info['level']) {
+                                    $this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� ' . $z['min_lvl_' . $t1] . ' - ' . $z['max_lvl_' . $t1] . ' ������';
+                                } elseif ($u->stats['hpNow'] < ceil($u->stats['hpMax'] / 100 * 30)) {
+                                    $this->error = '�� ������� ���������, ��������������';
+                                } else {
+                                    $upd = mysql_query('UPDATE `stats` SET `zv` = "' . $z['id'] . '",`team` = "' . mysql_real_escape_string((int)$t1) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                    if (!$upd) {
+                                        $this->error = '������ ������ ������...';
+                                    } else {
+                                        $this->error = '�� ������� ��������� ���...';
+                                        $zi = $z;
+                                        $u->info['zv'] = $z['id'];
+                                        $u->info['team'] = mysql_real_escape_string((int)$t1);
+                                    }
+                                }
+                            } else {
+                                $this->error = '������ ��� ������� (' . ($z['tm' . $t1 . 'max'] - $tmmax) . ')';
+                            }
+                        }
+                    } elseif ($z['razdel'] == 5 && $u->info['level'] > 1) {
+                        //���������
+                        $col_p = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $z['id'] . '"'));
+                        $cols = $col_p[0];
+                        if ($cols >= $z['maxplayers']) {
+                            $this->error = '��������� ������������ ������ ���������� � ���� ������!';
+                        } elseif ($this->testTravm() == 1 && $z['k'] != 1) {
+                            $this->error = '�� ������������. � ������ �������� �������� �������� ���.';
+                        } elseif ($this->testTravm() == 2) {
+                            $this->error = '�� ������������. � ������ �������� ���������� ���������.';
+                        } elseif (!$u->info['no_zv_key'] && (!isset($_SESSION['code2']) || $_SESSION['code2'] < 1 || ($_POST['code21'] != $_SESSION['code2'] && $_POST['code22'] != $_SESSION['code2']))) {
+                            $this->error = '������������ ��� �������������';
+                        } elseif ($z['min_lvl_1'] > $u->info['level'] || $z['max_lvl_1'] < $u->info['level']) {
+                            $this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� ' . $z['min_lvl_1'] . ' - ' . $z['max_lvl_1'] . ' ������';
+                        } elseif ($u->stats['hpNow'] < ceil($u->stats['hpMax'] / 100 * 30)) {
+                            $this->error = '�� ������� ���������, ��������������';
+                        } elseif ($z['money'] > 0 && $u->info['level'] < 4) {
+                            $this->error = '��� �� ������ ���������� � 4-�� ������';
+                        } else {
+                            $t1 = 0;
+
+                            if ($z['type'] == 33) {
+
+                                //============================================================================================= ��������
+                                mysql_query('INSERT INTO `users` (`name`,`align`,`real`,`login`,`host_reg`,`pass`,`ip`,`ipreg`,`city`,`cityreg`,`room`,`timereg`,
 		`activ`,`mail`,`bithday`,`sex`,`fnq`,`battle`,`design`,`molch2`,`level`
 		) VALUES (
-			"'.$u->info['name'].'",
-			"'.$u->info['align'].'",
+			"' . $u->info['name'] . '",
+			"' . $u->info['align'] . '",
 			"1",
-			"'.$u->info['login'].'",
+			"' . $u->info['login'] . '",
 			"0",
-			"'.$u->info['pass'].'",
-			"'.mysql_real_escape_string(IP).'",
-			"'.mysql_real_escape_string(IP).'",
+			"' . $u->info['pass'] . '",
+			"' . mysql_real_escape_string(IP) . '",
+			"' . mysql_real_escape_string(IP) . '",
 			"capitalcity",
 			"capitalcity",
 			"422",
-			"'.time().'",			
+			"' . time() . '",			
 			"0",
 			"haot@new-combats.com",
 			"01.01.1980",
-			"'.$u->info['sex'].'",
+			"' . $u->info['sex'] . '",
 			"0",
 			"0",
 			"1",
-			"'.mysql_real_escape_string(time()+86400).'",
+			"' . mysql_real_escape_string(time() + 86400) . '",
 			"8"
-		)');	
-				
-		$uidb = mysql_insert_id();
-				
-				mysql_query('UPDATE `users` SET `inUser` = "'.$uidb.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-				//��� ������
-				$sellclass=rand(1,6);
-				if ($sellclass==1)
-				{
-				//������ ����� 1
-				$us = add_effn($uidb,8); // �����
-				$us = add_effn($uidb,20); // ����������
-				
-				mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('".$uidb."','s1=21|s2=31|s3=16|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=10|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)");
-				$re =$u->addItem(525,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "525" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-								
-				$re =$u->addItem(539,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "539" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(523,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "523" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(523,$uidb); 
-				mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "523" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(290,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "290" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(541,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "541" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(633,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "633" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(647,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "647" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(680,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "680" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-								
-				$re =$u->addItem(685,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "685" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(685,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "685" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(685,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "685" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(1151,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "1151" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(707,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "707" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-					
-				$re =$u->addItem(712,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "712" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				mysql_query('UPDATE `stats` SET `priems`="193|8|217|221|6|213|14|220|141|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="'.$uidb.'" LIMIT 1');
-				//������ ����� �������� 
-				}
-				elseif ($sellclass==2)
-				{
-				//���� ����� 2
-				$us = add_effn($uidb,7); // ����
-				$us = add_effn($uidb,20); // ����������
-				
-				mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('".$uidb."','s1=24|s2=20|s3=24|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=9|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
-				$re =$u->addItem(527,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "527" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(537,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "537" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(567,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "567" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(723,$uidb); 
-				mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "723" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(291,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(544,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "544" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
+		)');
 
-				$re =$u->addItem(626,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "626" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(651,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "651" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(683,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "683" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(686,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "686" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(686,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "686" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(686,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "686" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(706,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "706" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(708,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "708" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-									
-				$re =$u->addItem(717,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "717" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				mysql_query('UPDATE `stats` SET `priems`="193|204|221|138|9|188|240|215|147|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="'.$uidb.'" LIMIT 1');
-				//193|204|221|138|9|188|240|215|147|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
-				}
-				elseif ($sellclass==3)
-				{
-				//���� ����� 3
-				$us = add_effn($uidb,1); // ����
-				$us = add_effn($uidb,20); // ����������
-				
-				mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('".$uidb."','s1=42|s2=3|s3=3|s4=50|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=9|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
-				$re =$u->addItem(533,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "533" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(536,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "536" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(558,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "558" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(722,$uidb); 
-				mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "722" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(291,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(545,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "545" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
+                                $uidb = mysql_insert_id();
+                                mysql_query('UPDATE `users` SET `inUser` = "' . $uidb . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                //��� ������
+                                $sellclass = rand(1, 6);
+                                if ($sellclass == 1) {
+                                    //������ ����� 1
+                                    $us = add_effn($uidb, 8); // �����
+                                    $us = add_effn($uidb, 20); // ����������
 
-				$re =$u->addItem(628,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "628" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(654,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "654" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(684,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "684" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(689,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "689" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(689,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "689" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(689,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "689" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(700,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "700" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(710,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "710" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-					
-				$re =$u->addItem(718,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "718" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				mysql_query('UPDATE `stats` SET `priems`="11|204|233|226|45|14|139|221|6|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="'.$uidb.'" LIMIT 1');
-				
-				}
-				elseif ($sellclass==4)
-				{
-				//����� ����� 4
-				$us = add_effn($uidb,1); // ����
-				$us = add_effn($uidb,20); // ����������
-				
-				mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('".$uidb."','s1=43|s2=15|s3=15|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=10|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)");
-				$re =$u->addItem(528,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "528" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-								
-				$re =$u->addItem(538,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "538" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(552,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "552" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(552,$uidb); 
-				mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "552" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(291,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(543,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "543" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(627,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "627" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(653,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "653" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(681,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "681" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-								
-				$re =$u->addItem(687,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "687" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(687,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "687" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(687,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "687" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(320,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "320" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(709,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "709" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-					
-				$re =$u->addItem(716,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "716" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				mysql_query('UPDATE `stats` SET `priems`="193|139|49|14|6|217|221|204|147|45|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="'.$uidb.'" LIMIT 1');
-				//193|139|49|14|6|217|221|204|147|45|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
-				}
-				elseif ($sellclass==5)
-				{
-				//� ����� ����� 5
-				//������ ������
-				$us = add_effn($uidb,9); // ��������
-				$us = add_effn($uidb,32); // �������� �����
-				$us = add_effn($uidb,54); // ��� ������ �����
-				$us = add_effn($uidb,439); // ��� ������
-				
-				mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('".$uidb."','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=0|mg4=6|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
-				$re =$u->addItem(531,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "531" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(534,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "534" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(1026,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "1026" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(291,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(548,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "548" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
+                                    mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uidb . "','s1=21|s2=31|s3=16|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=10|a2=0|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)");
+                                    $re = $u->addItem(525, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "525" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
 
-				$re =$u->addItem(629,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "629" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(699,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "699" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(711,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "711" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(714,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "714" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-					
-				///------- ���
-				$re =$u->addItem(657,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "657" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(674,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "674" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(692,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "692" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(692,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "692" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(692,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "692" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				///----	
-				mysql_query('UPDATE `stats` SET `priems`="208|117|170|44|113|128|122|249|246|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="'.$uidb.'" LIMIT 1');
-				//208|117|170|44|113|253|122|249|246|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
-				}
-				elseif ($sellclass==6)
-				{
-				//� ������ 6
-				//������ ������
-				$us = add_effn($uidb,9); // ��������
-				$us = add_effn($uidb,32); // �������� �����
-				$us = add_effn($uidb,53); // ��� ������ ������
-				$us = add_effn($uidb,439); // ��� ������
-				
-				
-				mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('".$uidb."','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=6|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
-				$re =$u->addItem(531,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "531" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(534,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "534" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(1026,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "1026" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(291,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(548,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "548" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
+                                    $re = $u->addItem(539, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "539" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
 
-				$re =$u->addItem(629,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "629" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(699,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "699" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(711,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "711" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(714,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "714" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');				
-				///------- ���
-				$re =$u->addItem(658,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "658" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(675,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "675" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				
-				$re =$u->addItem(693,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "693" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(693,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "693" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				$re =$u->addItem(693,$uidb);
-				mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "'.$re.'" LIMIT 1');
-				$price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "693" AND `sid`=1 LIMIT 1'));
-				mysql_query('UPDATE `items_users` SET `1price` = "'.$price['price_1'].'" WHERE `id` = "'.$re.'" LIMIT 1');
-				///----
-				mysql_query('UPDATE `stats` SET `priems`="208|93|98|260|39|263|257|104|30|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="'.$uidb.'" LIMIT 1');
-				//208|93|98|260|39|287|257|104|261|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
-				}
-				// ������ ���������
-							//������ ������
-					
-					$us = add_effn($uidb,37);//������
-					$us = add_effn($uidb,38);//������ ���������
-					$us = add_effn($uidb,283);//��������� -������� ������- �������
-					$us = add_effn($uidb,25);//������ �� ������
-					$us = add_effn($uidb,296);//����� ����� +6
-					//$us = add_effn($uidb,472);//�������� ����������� ������
-				
-				mysql_query('UPDATE `users` SET `money` = -3000 , `money2` = 0 WHERE `id` = "'.$uidb.'" LIMIT 1');
-				//�������� �� � ��������
-				$hpclon=mysql_fetch_array(mysql_query('SELECT `hpAll`,`mpAll` FROM `stats` WHERE `id` = "'.$uidb.'" LIMIT 1'));
-				mysql_query('UPDATE `stats` SET `hpNow` = "'.$hpclon['hpAll'].'" `mpNow` = "'.$hpclon['mpAll'].'" WHERE `id` = "'.$uidb.'" LIMIT 1');
-				$u->info['id']=$uidb;									
-				//=============================================================================================
-				$this->error = '�� ������� � ����� 8�� ������'; //��� ������� � ����� �������� �����
-				echo '<script>location="main.php?battle_id='.$btl_id.'";</script>';
-								}
-							
-							/* ������� ������ */
-							/*if($z['tm1'] > $z['tm2'])
-							{
-								$t1 = 2;
-							}elseif($z['tm1'] < $z['tm2'])
-							{
-								$t1 = 1;
-							}else{
-								$t1 = rand(1,2);
-							}*/
-							
-							/*
-							$tmtest1 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$z['id'].'" AND `team` = 1 LIMIT 1'));
-							$tmtest2 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$z['id'].'" AND `team` = 2 LIMIT 1'));
-							
-							if( $t1 == 1 && $tmtest1[0]-2 > $tmtest2[0] ) {
-								$t1 = 2;
-							}elseif( $t1 == 2 && $tmtest2[0]-2 > $tmtest1[0] ) {
-								$t1 = 1;
-							}
-							*/
-							
-							if($z['invise']==1)
-							{
-								$nxtID = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$z['id'].'"'));
-								$nxtID = $nxtID[0];
-								//$u->info['login2'] = '���� ('.($nxtID+1).')';
-								$u->info['login2'] = '';
-							}else{
-								$u->info['login2'] = '';
-							}
-							
-							$blnc = $u->stats['reting'];
-					
-							$z['tm'.$t1] += $blnc;
-													
-							$upd = mysql_query('UPDATE `stats` SET `zv` = "'.$z['id'].'",`team` = "'.$t1.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							if(!$upd)
-							{
-								$this->error = '������ ������ ������...';
-							}else{
-								mysql_query('UPDATE `users` SET `login2` = "'.$u->info['login2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-								mysql_query('UPDATE `zayvki` SET `tm1` = "'.$z['tm1'].'", `tm2` = "'.$z['tm2'].'" WHERE `id` = "'.$z['id'].'" LIMIT 1');
-								$this->error = '�� ������� ��������� ���...';
-								$zi = $z;
-								$u->info['zv'] = $z['id'];
-								$u->info['team'] = mysql_real_escape_string((int)$t1);
-							}
-						}
-					}
-				}else{
-					$this->error = '������ �� ��� �� �������.';
-				}						
-			}
-		}else{
-			$this->error = '�� �� ������ ������� ���. ������� �������� ���� ������.';
-		}
-	}	
+                                    $re = $u->addItem(523, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "523" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(523, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "523" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(290, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "290" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(541, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "541" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(633, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "633" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(647, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "647" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(680, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "680" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(685, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "685" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(685, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "685" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(685, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "685" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(1151, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "1151" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(707, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "707" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(712, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "712" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    mysql_query('UPDATE `stats` SET `priems`="193|8|217|221|6|213|14|220|141|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="' . $uidb . '" LIMIT 1');
+                                    //������ ����� ��������
+                                } elseif ($sellclass == 2) {
+                                    //���� ����� 2
+                                    $us = add_effn($uidb, 7); // ����
+                                    $us = add_effn($uidb, 20); // ����������
+
+                                    mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uidb . "','s1=24|s2=20|s3=24|s4=30|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=9|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
+                                    $re = $u->addItem(527, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "527" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(537, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "537" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(567, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "567" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(723, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "723" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(291, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(544, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "544" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(626, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "626" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(651, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "651" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(683, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "683" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(686, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "686" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(686, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "686" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(686, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "686" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(706, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "706" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(708, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "708" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(717, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "717" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    mysql_query('UPDATE `stats` SET `priems`="193|204|221|138|9|188|240|215|147|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="' . $uidb . '" LIMIT 1');
+                                    //193|204|221|138|9|188|240|215|147|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
+                                } elseif ($sellclass == 3) {
+                                    //���� ����� 3
+                                    $us = add_effn($uidb, 1); // ����
+                                    $us = add_effn($uidb, 20); // ����������
+
+                                    mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uidb . "','s1=42|s2=3|s3=3|s4=50|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=9|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
+                                    $re = $u->addItem(533, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "533" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(536, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "536" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(558, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "558" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(722, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "722" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(291, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(545, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "545" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(628, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "628" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(654, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "654" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(684, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "684" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(689, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "689" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(689, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "689" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(689, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "689" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(700, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "700" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(710, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "710" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(718, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "718" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    mysql_query('UPDATE `stats` SET `priems`="11|204|233|226|45|14|139|221|6|232|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="' . $uidb . '" LIMIT 1');
+
+                                } elseif ($sellclass == 4) {
+                                    //����� ����� 4
+                                    $us = add_effn($uidb, 1); // ����
+                                    $us = add_effn($uidb, 20); // ����������
+
+                                    mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uidb . "','s1=43|s2=15|s3=15|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=10|a3=0|a4=0|a5=0|mg1=0|mg2=0|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=0|s6=0',-75,-9,100000)");
+                                    $re = $u->addItem(528, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "528" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(538, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "538" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(552, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "552" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(552, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 14 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "552" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(291, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(543, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "543" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(627, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "627" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(653, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "653" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(681, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "681" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(687, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "687" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(687, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "687" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(687, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "687" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(320, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "320" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(709, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "709" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(716, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "716" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    mysql_query('UPDATE `stats` SET `priems`="193|139|49|14|6|217|221|204|147|45|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="' . $uidb . '" LIMIT 1');
+                                    //193|139|49|14|6|217|221|204|147|45|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
+                                } elseif ($sellclass == 5) {
+                                    //� ����� ����� 5
+                                    //������ ������
+                                    $us = add_effn($uidb, 9); // ��������
+                                    $us = add_effn($uidb, 32); // �������� �����
+                                    $us = add_effn($uidb, 54); // ��� ������ �����
+                                    $us = add_effn($uidb, 439); // ��� ������
+
+                                    mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uidb . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=0|mg3=0|mg4=6|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
+                                    $re = $u->addItem(531, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "531" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(534, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "534" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(1026, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "1026" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(291, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(548, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "548" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(629, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "629" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(699, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "699" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(711, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "711" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(714, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "714" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    ///------- ���
+                                    $re = $u->addItem(657, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "657" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(674, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "674" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(692, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "692" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(692, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "692" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(692, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "692" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    ///----
+                                    mysql_query('UPDATE `stats` SET `priems`="208|117|170|44|113|128|122|249|246|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="' . $uidb . '" LIMIT 1');
+                                    //208|117|170|44|113|253|122|249|246|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
+                                } elseif ($sellclass == 6) {
+                                    //� ������ 6
+                                    //������ ������
+                                    $us = add_effn($uidb, 9); // ��������
+                                    $us = add_effn($uidb, 32); // �������� �����
+                                    $us = add_effn($uidb, 53); // ��� ������ ������
+                                    $us = add_effn($uidb, 439); // ��� ������
+
+
+                                    mysql_query("INSERT INTO `stats` (`id`,`stats`,`ability`,`skills`,exp) VALUES ('" . $uidb . "','s1=14|s2=3|s3=3|s4=25|rinv=40|m9=5|m6=10|s7=0|a1=0|a2=0|a3=0|a4=0|a5=3|mg1=0|mg2=6|mg3=0|mg4=0|mg5=0|mg6=0|mg7=0|s5=13|s6=40|a6=0|s8=0|s9=0|s10=0|s11=0|s12=0|s13=0|s14=0|s15=0',-75,-9,100000)");
+                                    $re = $u->addItem(531, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 1 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "531" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(534, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 2 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "534" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(1026, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 3 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "1026" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(291, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 4 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "291" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(548, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 5 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "548" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(629, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 7 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "629" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(699, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 13 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "699" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(711, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 16 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "711" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(714, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 17 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "714" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    ///------- ���
+                                    $re = $u->addItem(658, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 8 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "658" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(675, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 9 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "675" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+
+                                    $re = $u->addItem(693, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 10 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "693" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(693, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 11 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "693" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $re = $u->addItem(693, $uidb);
+                                    mysql_query('UPDATE `items_users` SET `inodet` = 12 WHERE `id` = "' . $re . '" LIMIT 1');
+                                    $price = mysql_fetch_array(mysql_query('SELECT `price_1` FROM `items_shop` WHERE `item_id` = "693" AND `sid`=1 LIMIT 1'));
+                                    mysql_query('UPDATE `items_users` SET `1price` = "' . $price['price_1'] . '" WHERE `id` = "' . $re . '" LIMIT 1');
+                                    ///----
+                                    mysql_query('UPDATE `stats` SET `priems`="208|93|98|260|39|263|257|104|30|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0" WHERE `id`="' . $uidb . '" LIMIT 1');
+                                    //208|93|98|260|39|287|257|104|261|147|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
+                                }
+                                // ������ ���������
+                                //������ ������
+
+                                $us = add_effn($uidb, 37);//������
+                                $us = add_effn($uidb, 38);//������ ���������
+                                $us = add_effn($uidb, 283);//��������� -������� ������- �������
+                                $us = add_effn($uidb, 25);//������ �� ������
+                                $us = add_effn($uidb, 296);//����� ����� +6
+
+                                mysql_query('UPDATE `users` SET `money` = -3000 , `money2` = 0 WHERE `id` = "' . $uidb . '" LIMIT 1');
+                                //�������� �� � ��������
+                                $hpclon = mysql_fetch_array(mysql_query('SELECT `hpAll`,`mpAll` FROM `stats` WHERE `id` = "' . $uidb . '" LIMIT 1'));
+                                mysql_query('UPDATE `stats` SET `hpNow` = "' . $hpclon['hpAll'] . '" `mpNow` = "' . $hpclon['mpAll'] . '" WHERE `id` = "' . $uidb . '" LIMIT 1');
+                                $u->info['id'] = $uidb;
+                                //=============================================================================================
+                                $this->error = '�� ������� � ����� 8�� ������'; //��� ������� � ����� �������� �����
+                                echo '<script>location="main.php?battle_id=' . $btl_id . '";</script>';
+                            }
+
+                            if ($z['invise'] == 1) {
+                                $nxtID = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $z['id'] . '"'));
+                                $nxtID = $nxtID[0];
+                            }
+                            $u->info['login2'] = '';
+
+                            $blnc = $u->stats['reting'];
+
+                            $z['tm' . $t1] += $blnc;
+
+                            $upd = mysql_query('UPDATE `stats` SET `zv` = "' . $z['id'] . '",`team` = "' . $t1 . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                            if (!$upd) {
+                                $this->error = '������ ������ ������...';
+                            } else {
+                                mysql_query('UPDATE `users` SET `login2` = "' . $u->info['login2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
+                                mysql_query('UPDATE `zayvki` SET `tm1` = "' . $z['tm1'] . '", `tm2` = "' . $z['tm2'] . '" WHERE `id` = "' . $z['id'] . '" LIMIT 1');
+                                $this->error = '�� ������� ��������� ���...';
+                                $zi = $z;
+                                $u->info['zv'] = $z['id'];
+                                $u->info['team'] = mysql_real_escape_string((int)$t1);
+                            }
+                        }
+                    }
+                } else {
+                    $this->error = '������ �� ��� �� �������.';
+                }
+            }
+        } else {
+            $this->error = '�� �� ������ ������� ���. ������� �������� ���� ������.';
+        }
+    }
 }
+
 $zv = new zayvki;
-$zv->test(); //��������� ������
-?>
+$zv->test(); //��������� ������
\ No newline at end of file
diff --git a/cron_killusers.php b/cron_killusers.php
index 87ca01b3..21708c1d 100644
--- a/cron_killusers.php
+++ b/cron_killusers.php
@@ -35,31 +35,6 @@ function send_chat($type,$from,$text,$time) {
 	mysql_query('INSERT INTO `chat` (`text`,`city`,`login`,`to`,`type`,`new`,`time`,`room`) VALUES ("'.mysql_real_escape_string($text).'","capitalcity","'.mysql_real_escape_string($from).'","","'.$type.'","1","'.mysql_real_escape_string($time).'","3")');
 }
 
-$kp = array(
-	0 => 1,
-	1 => 1,
-	2 => 3,
-	3 => 3,
-	4 => 3,
-	5 => 7,
-	6 => 7,
-	7 => 7,
-	8 => 14,
-	9 => 14,
-	10 => 30,
-	11 => 30,
-	12 => 30,
-	13 => 30,
-	14 => 30,
-	15 => 30,
-	16 => 60,
-	17 => 60,
-	18 => 60,
-	19 => 60,
-	20 => 60,
-	21 => 60
-);
-
 $kp = array(
 	0 => 1,
 	1 => 1,
diff --git a/inf.php b/inf.php
index b0f502ea..2ee62c9f 100644
--- a/inf.php
+++ b/inf.php
@@ -18,39 +18,39 @@ $uplogin = $uplogin[0];
 $uplogin = preg_replace('/%20/'," ",$uplogin);
 
 function utf8_win($s) {
-	$s=str_replace("%D0%B0","а",$s); $s=str_replace("%D0%90","А",$s);
-	$s=str_replace("%D0%B1","б",$s); $s=str_replace("%D0%91","Б",$s);
-	$s=str_replace("%D0%B2","в",$s); $s=str_replace("%D0%92","В",$s);
-	$s=str_replace("%D0%B3","г",$s); $s=str_replace("%D0%93","Г",$s);
-	$s=str_replace("%D0%B4","д",$s); $s=str_replace("%D0%94","Д",$s);
-	$s=str_replace("%D0%B5","е",$s); $s=str_replace("%D0%95","Е",$s);
-	$s=str_replace("%D1%91","ё",$s); $s=str_replace("%D0%81","Ё",$s);
-	$s=str_replace("%D0%B6","ж",$s); $s=str_replace("%D0%96","Ж",$s);
-	$s=str_replace("%D0%B7","з",$s); $s=str_replace("%D0%97","З",$s);
-	$s=str_replace("%D0%B8","и",$s); $s=str_replace("%D0%98","И",$s);
-	$s=str_replace("%D0%B9","й",$s); $s=str_replace("%D0%99","Й",$s);
-	$s=str_replace("%D0%BA","к",$s); $s=str_replace("%D0%9A","К",$s);
-	$s=str_replace("%D0%BB","л",$s); $s=str_replace("%D0%9B","Л",$s);
-	$s=str_replace("%D0%BC","м",$s); $s=str_replace("%D0%9C","М",$s);
-	$s=str_replace("%D0%BD","н",$s); $s=str_replace("%D0%9D","Н",$s);
-	$s=str_replace("%D0%BE","о",$s); $s=str_replace("%D0%9E","О",$s);
-	$s=str_replace("%D0%BF","п",$s); $s=str_replace("%D0%9F","П",$s);
-	$s=str_replace("%D1%80","р",$s); $s=str_replace("%D0%A0","Р",$s);
-	$s=str_replace("%D1%81","с",$s); $s=str_replace("%D0%A1","С",$s);
-	$s=str_replace("%D1%82","т",$s); $s=str_replace("%D0%A2","Т",$s);
-	$s=str_replace("%D1%83","у",$s); $s=str_replace("%D0%A3","У",$s);
-	$s=str_replace("%D1%84","ф",$s); $s=str_replace("%D0%A4","Ф",$s);
-	$s=str_replace("%D1%85","х",$s); $s=str_replace("%D0%A5","Х",$s);
-	$s=str_replace("%D1%86","ц",$s); $s=str_replace("%D0%A6","Ц",$s);
-	$s=str_replace("%D1%87","ч",$s); $s=str_replace("%D0%A7","Ч",$s);
-	$s=str_replace("%D1%88","ш",$s); $s=str_replace("%D0%A8","Ш",$s);
-	$s=str_replace("%D1%89","щ",$s); $s=str_replace("%D0%A9","Щ",$s);
-	$s=str_replace("%D1%8A","ъ",$s); $s=str_replace("%D0%AA","Ъ",$s);
-	$s=str_replace("%D1%8B","ы",$s); $s=str_replace("%D0%AB","Ы",$s);
-	$s=str_replace("%D1%8C","ь",$s); $s=str_replace("%D0%AC","Ь",$s);
-	$s=str_replace("%D1%8D","э",$s); $s=str_replace("%D0%AD","Э",$s);
-	$s=str_replace("%D1%8E","ю",$s); $s=str_replace("%D0%AE","Ю",$s);
-	$s=str_replace("%D1%8F","я",$s); $s=str_replace("%D0%AF","Я",$s);
+	$s=str_replace("%D0%B0","�",$s); $s=str_replace("%D0%90","�",$s);
+	$s=str_replace("%D0%B1","�",$s); $s=str_replace("%D0%91","�",$s);
+	$s=str_replace("%D0%B2","�",$s); $s=str_replace("%D0%92","�",$s);
+	$s=str_replace("%D0%B3","�",$s); $s=str_replace("%D0%93","�",$s);
+	$s=str_replace("%D0%B4","�",$s); $s=str_replace("%D0%94","�",$s);
+	$s=str_replace("%D0%B5","�",$s); $s=str_replace("%D0%95","�",$s);
+	$s=str_replace("%D1%91","�",$s); $s=str_replace("%D0%81","�",$s);
+	$s=str_replace("%D0%B6","�",$s); $s=str_replace("%D0%96","�",$s);
+	$s=str_replace("%D0%B7","�",$s); $s=str_replace("%D0%97","�",$s);
+	$s=str_replace("%D0%B8","�",$s); $s=str_replace("%D0%98","�",$s);
+	$s=str_replace("%D0%B9","�",$s); $s=str_replace("%D0%99","�",$s);
+	$s=str_replace("%D0%BA","�",$s); $s=str_replace("%D0%9A","�",$s);
+	$s=str_replace("%D0%BB","�",$s); $s=str_replace("%D0%9B","�",$s);
+	$s=str_replace("%D0%BC","�",$s); $s=str_replace("%D0%9C","�",$s);
+	$s=str_replace("%D0%BD","�",$s); $s=str_replace("%D0%9D","�",$s);
+	$s=str_replace("%D0%BE","�",$s); $s=str_replace("%D0%9E","�",$s);
+	$s=str_replace("%D0%BF","�",$s); $s=str_replace("%D0%9F","�",$s);
+	$s=str_replace("%D1%80","�",$s); $s=str_replace("%D0%A0","�",$s);
+	$s=str_replace("%D1%81","�",$s); $s=str_replace("%D0%A1","�",$s);
+	$s=str_replace("%D1%82","�",$s); $s=str_replace("%D0%A2","�",$s);
+	$s=str_replace("%D1%83","�",$s); $s=str_replace("%D0%A3","�",$s);
+	$s=str_replace("%D1%84","�",$s); $s=str_replace("%D0%A4","�",$s);
+	$s=str_replace("%D1%85","�",$s); $s=str_replace("%D0%A5","�",$s);
+	$s=str_replace("%D1%86","�",$s); $s=str_replace("%D0%A6","�",$s);
+	$s=str_replace("%D1%87","�",$s); $s=str_replace("%D0%A7","�",$s);
+	$s=str_replace("%D1%88","�",$s); $s=str_replace("%D0%A8","�",$s);
+	$s=str_replace("%D1%89","�",$s); $s=str_replace("%D0%A9","�",$s);
+	$s=str_replace("%D1%8A","�",$s); $s=str_replace("%D0%AA","�",$s);
+	$s=str_replace("%D1%8B","�",$s); $s=str_replace("%D0%AB","�",$s);
+	$s=str_replace("%D1%8C","�",$s); $s=str_replace("%D0%AC","�",$s);
+	$s=str_replace("%D1%8D","�",$s); $s=str_replace("%D0%AD","�",$s);
+	$s=str_replace("%D1%8E","�",$s); $s=str_replace("%D0%AE","�",$s);
+	$s=str_replace("%D1%8F","�",$s); $s=str_replace("%D0%AF","�",$s);
 	return $s;
 }
 
@@ -104,7 +104,7 @@ if(!isset($inf['id']))
 	}
 	if($inf['haos']>1)
 	{
-		//снимаем хаос
+		//������� ����
 		if($inf['haos']<time())
 		{
 			$inf['align'] = 0;
@@ -118,9 +118,9 @@ if(!isset($inf['id']))
 			$upd = mysql_query('UPDATE `stats` SET `wipe` = "1" WHERE `id` = "'.$inf['id'].'" LIMIT 1');
 			if($upd)
 			{
-				$uer = 'Сброс характеристик прошел успешно<br>';
+				$uer = '����� ������������� ������ �������<br>';
 			}else{
-				$uer = 'Ошибка сброса...<br>';
+				$uer = '������ ������...<br>';
 			}
 		}
 	}
@@ -131,9 +131,9 @@ if(!isset($inf['id']))
 			$upd = mysql_query('UPDATE `users` SET `molch3` = "'.$inf['molch1'].'" WHERE `id` = "'.$inf['id'].'" LIMIT 1');
 			if($upd)
 			{
-				$uer = 'Все прошло успешно...<br>';
+				$uer = '��� ������ �������...<br>';
 			}else{
-				$uer = 'Ошибка...<br>';
+				$uer = '������...<br>';
 			}
 		}
 	}
@@ -145,14 +145,14 @@ if( $inf['room'] == 303 && $u->info['admin'] == 0 ) {
 	
 if(!isset($inf['id']))
 {
-	die('Ошибка. Персонаж не найден.');
+	die('������. �������� �� ������.');
 	die('<html><head>
 	<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
 	<meta http-equiv="Content-Language" content="ru">
 	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
-	<TITLE>Произошла ошибка</TITLE></HEAD><BODY text="#FFFFFF" style="padding-top:0px; margin-top:7px; height:100%; background-color:#dedede;"><p><font color=black>
-	Произошла ошибка: <pre>Указанный персонаж не найден...</pre>
-	<b><p><a href = "javascript:window.history.go(-1);">Назад</b></a>
+	<TITLE>��������� ������</TITLE></HEAD><BODY text="#FFFFFF" style="padding-top:0px; margin-top:7px; height:100%; background-color:#dedede;"><p><font color=black>
+	��������� ������: <pre>��������� �������� �� ������...</pre>
+	<b><p><a href = "javascript:window.history.go(-1);">�����</b></a>
 	<HR>
 	<p align="right">&copy; <a href="https://new-combats.com/">'.$c['title'].'</a></p>
 	'.$c['counters'].'
@@ -237,7 +237,7 @@ if($id_zodiak==null)
   $id_zodiak = 1;
 }
 
-$name_zodiak = array(1=>'Овен',2=>'Телец',3=>'Близнецы',4=>'Рак',5=>'Лев',6=>'Дева',7=>'Весы',8=>'Скорпион',9=>'Стрелец',10=>'Козерог',11=>'Водолей',12=>'Рыбы');
+$name_zodiak = array(1=>'����',2=>'�����',3=>'��������',4=>'���',5=>'���',6=>'����',7=>'����',8=>'��������',9=>'�������',10=>'�������',11=>'�������',12=>'����');
 $name_zodiak = $name_zodiak[$id_zodiak];
 
 function statInfo($s)
@@ -432,8 +432,8 @@ if( $inf['inTurnir'] > 0 && ($u->info['inTurnir'] == $inf['inTurnir'] || $u->inf
 <html>
 <head>
 <meta charset="windows-1251"/>
-<title>Информация о <? echo $inf['login']; ?></title>
-<meta "description" name content="Просматривайте информацию о игровых персонажах браузерной игры Бойцовский Клуб.Играйте в новый проект потивам браузерной игры combats.com версии 2."/>
+<title>���������� � <? echo $inf['login']; ?></title>
+<meta "description" name content="�������������� ���������� � ������� ���������� ���������� ���� ���������� ����.������� � ����� ������ ������� ���������� ���� combats.com ������ 2."/>
 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=yes"/>
 <script type="text/javascript" src="/js/jquery.js"></script>
 <script type="text/javascript" src="/js/jquery.zclip.js"></script>
@@ -671,7 +671,7 @@ progress {
 var lafstReg = {};
 function lookGift(e,id,nm,img,txt,from) {
   if(from == 1) {
-	 from = '<i>Невидимка</i>'; 
+	 from = '<i>���������</i>'; 
   }
   if(!e) { e = window.event; }
   var body2 = document.body;
@@ -681,10 +681,10 @@ function lookGift(e,id,nm,img,txt,from) {
   if(gf != undefined) {
 		gf.style.top = mY+'px';
 		gf.style.left = mX+'px';
-		if( from == '<i>Анонима</i>' ) {
-			from = '</a><i>Анонима</i><a>';
+		if( from == '<i>�������</i>' ) {
+			from = '</a><i>�������</i><a>';
 		}
-		gf.innerHTML = `<b><span style="float:left;">${nm}</span> <span style="float:right;">&nbsp; <a href="javascript:void(0);" onClick="closeGift();">X</a></span></b><br><div align="center" style="padding:5px;background-color:#dcdedc;"><img src="https://img.new-combats.com/i/items/${img}"></div>${txt}<div>Подарок от <a target="_blank" href="/info/${from}">${from}</a></div>`;
+		gf.innerHTML = `<b><span style="float:left;">${nm}</span> <span style="float:right;">&nbsp; <a href="javascript:void(0);" onClick="closeGift();">X</a></span></b><br><div align="center" style="padding:5px;background-color:#dcdedc;"><img src="https://img.new-combats.com/i/items/${img}"></div>${txt}<div>������� �� <a target="_blank" href="/info/${from}">${from}</a></div>`;
 		gf.innerHTML = `<small>${gf.innerHTML}</small>`;
 		gf.style.display = '';
 	}
@@ -700,13 +700,13 @@ function closeGift() {
 function tstlgnthm() {
 	if( window.opener && ( window.opener.textmsg != undefined || window.opener.parent.textmsg != undefined ) ) {
 		/*
-		<img onclick="window.opener.chat.toUser(\'' + data.login + '\',\'private\');" title="Приват" width="20" height="15" class="cp" src="https://' + cfg.img + '/images/lock3.gif">
+		<img onclick="window.opener.chat.toUser(\'' + data.login + '\',\'private\');" title="������" width="20" height="15" class="cp" src="https://' + cfg.img + '/images/lock3.gif">
 		*/
 		if( window.opener.textmsg != undefined ) {
-			$('#lgnthm').html( '<img onclick="window.opener.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="Написать персонажу" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
+			$('#lgnthm').html( '<img onclick="window.opener.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="�������� ���������" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
 			return
 		}
-		$('#lgnthm').html( '<img onclick="window.opener.parent.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="Написать персонажу" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
+		$('#lgnthm').html( '<img onclick="window.opener.parent.chat.addto(\'<?=$inf['login']?>\',\'private\');" style="cursor:pointer" title="�������� ���������" src="https://img.new-combats.com/i/lock3.gif" width="20" height="15">' + $('#lgnthm').html() );
 		return
 	}
 
@@ -728,10 +728,10 @@ if(isset($uer)){ echo '<div align="left"><font color=\'red\'>'.$uer.'</font></di
 		$st = array(); $st2 = array(); $st = $u->getStats($inf['id'],1,0,true); $st2 = $st[1]; $st = $st[0]; 
 		
         //if( $u->info['admin'] > 0 ) {
-		//	echo '<div>Мощность персонажа: '.$st['reting'].'</div>';
+		//	echo '<div>�������� ���������: '.$st['reting'].'</div>';
 		//}
 		
-		$rgd = $u->regen($inf['id'],$st,1); $us = $u->getInfoPers($inf['id'],1,$st); if( isset($bs['id']) && $bs['type_btl'] == 2 && ($u->info['x'] != $inf['x'] || $u->info['y'] != $inf['y'])) { $us[0] = '<div align="center" style="width:255px;height300px;"><br><br><br><br><br><br><br><br>Информация скрыта,<br>Вы в разных комнатах.<br><br><br><br><br><br><br></div>'; } if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?></div>
+		$rgd = $u->regen($inf['id'],$st,1); $us = $u->getInfoPers($inf['id'],1,$st); if( isset($bs['id']) && $bs['type_btl'] == 2 && ($u->info['x'] != $inf['x'] || $u->info['y'] != $inf['y'])) { $us[0] = '<div align="center" style="width:255px;height300px;"><br><br><br><br><br><br><br><br>���������� ������,<br>�� � ������ ��������.<br><br><br><br><br><br><br></div>'; } if($us!=false){ echo $us[0]; }else{ echo 'information is lost.'; } ?></div>
         <!-- pos2 -->
         <div align="left"></div><div align="left"></div><script>tstlgnthm();lafstReg[<? echo $inf['id']; ?>] = 1;
 		<?
@@ -771,14 +771,14 @@ $kp = array(
 ?>
 <!-- pos1 -->
 <?
-		//Персонаж онлайн
+		//�������� ������
 		if( $inf['admin'] > 0 ) {
 			if($inf['battle']>0)
 			{
 				$btl3 = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = '.$inf['battle'].''));  
 				if(isset($btl3['id']) && $btl3['time_over']==0)
 				{
-					echo '<center><small><br>Персонаж сейчас в <a target="_blank" href="/logs.php?log='.$btl3['id'].'">поединке</a></small></center>';
+					echo '<center><small><br>�������� ������ � <a target="_blank" href="/logs.php?log='.$btl3['id'].'">��������</a></small></center>';
 				}
 			}
 		}elseif( $inf['room'] != 303 ) {
@@ -787,7 +787,7 @@ $kp = array(
 			
 			if($inf['online']>time()-520 && $inf['banned']==0 && $inf['invis']!=1 && $inf['invis'] < time())
 			{
-				echo 'Персонаж сейчас находится в клубе.<br><b>"'.$room['name'].'"</b>';
+				echo '�������� ������ ��������� � �����.<br><b>"'.$room['name'].'"</b>';
 			}else{
 				if($inf['admin']==0 || $inf['admin']==2)
 				{
@@ -795,73 +795,73 @@ $kp = array(
 					{
 						$inf['online'] = $inf['timeREG'];
 					}
-					echo 'Персонаж не в клубе';
+					echo '�������� �� � �����';
 					if(date('Y',$inf['online']) == date('Y')) {
-						echo ', но был тут:<br>'.date('d.m.Y H:i',$inf['online']).'<img title="Время сервера" src="https://img.new-combats.com/i/clok3_2.png">';
+						echo ', �� ��� ���:<br>'.date('d.m.Y H:i',$inf['online']).'<img title="����� �������" src="https://img.new-combats.com/i/clok3_2.png">';
 						$out = '';
 						$time_still = time()-$inf['online'];
 						$tmp = floor($time_still/2592000);
 						$id=0;
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." мес. ";}
+							if ($id<3) {$out .= $tmp." ���. ";}
 							$time_still = $time_still-$tmp*2592000;
 						}
 						$tmp = floor($time_still/604800);
 						if ($tmp > 0) { 
 						$id++;
-						if ($id<3) {$out .= $tmp." нед. ";}
+						if ($id<3) {$out .= $tmp." ���. ";}
 						$time_still = $time_still-$tmp*604800;
 						}
 						$tmp = floor($time_still/86400);
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." дн. ";}
+							if ($id<3) {$out .= $tmp." ��. ";}
 							$time_still = $time_still-$tmp*86400;
 						}
 						$tmp = floor($time_still/3600);
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." ч. ";}
+							if ($id<3) {$out .= $tmp." �. ";}
 							$time_still = $time_still-$tmp*3600;
 						}
 						$tmp = floor($time_still/60);
 						if ($tmp > 0) { 
 							$id++;
-							if ($id<3) {$out .= $tmp." мин. ";}
+							if ($id<3) {$out .= $tmp." ���. ";}
 						}
 						if($out=='')
 						{
-							$out = $time_still.' сек.';
+							$out = $time_still.' ���.';
 						}
-						echo '<br>('.$out.' назад)';
+						echo '<br>('.$out.' �����)';
 					}
 				}elseif($inf['admin']>0)
 				{
-					echo 'Персонаж не в клубе.';
+					echo '�������� �� � �����.';
 				}
 			}
 			if($inf['inUser']>0 AND $inf['id']!=12059 )
 			{
-				echo '<br>Персонаж вселился в <a target="_blank" href="/info/'.$inf['inUser'].'">бота</a>';
+				echo '<br>�������� �������� � <a target="_blank" href="/info/'.$inf['inUser'].'">����</a>';
 			}
 			if($inf['battle']>0)
 			{
 				$btl3 = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = '.$inf['battle'].''));  
 				if(isset($btl3['id']) && $btl3['time_over']==0)
 				{
-					echo '<br>Персонаж сейчас в <a target="_blank" href="/logs.php?log='.$btl3['id'].'">поединке</a>';
+					echo '<br>�������� ������ � <a target="_blank" href="/logs.php?log='.$btl3['id'].'">��������</a>';
 				}
 			}
 			echo '</small></center>';
 		}else{
 			if( $inf['res_x']-time() > 0 ) {
-				echo '<center style="padding-top:3px;">Появится через <b>'.($u->timeOut(($inf['res_x']-time()))).'</b><br><small></center>';
+				echo '<center style="padding-top:3px;">�������� ����� <b>'.($u->timeOut(($inf['res_x']-time()))).'</b><br><small></center>';
 			}else{
-				echo '<center style="padding-top:3px;">Появится в ближайшее время...<br><small></center>';
+				echo '<center style="padding-top:3px;">�������� � ��������� �����...<br><small></center>';
 			}
 		}
-		//Эффект админ
+		//������ �����
 		if($u->info['admin'] > 0) {
 			
 			if(isset($_GET['cancel_eff'])) {
@@ -875,7 +875,7 @@ $kp = array(
 				if($pl['v1'] != 'priem') {
 					$eff = mysql_fetch_array(mysql_query('SELECT `id2`,`img`,`actionTime` FROM `eff_main` WHERE `id2` = "'.$pl['id_eff'].'" LIMIT 1'));
 					$pl['img2'] = $eff['img'];
-					$pl['name'] .= "\r".'Действует еще '.$u->timeOut($pl['timeUse']-time()+$eff['actionTime']).'';
+					$pl['name'] .= "\r".'��������� ��� '.$u->timeOut($pl['timeUse']-time()+$eff['actionTime']).'';
 				}
 				$r .= '<img onDblClick="location.href=\'/info/'.$pl['uid'].'&cancel_eff='.$pl['id'].'\'" style="padding:1px;" title="'.$pl['name'].'" src="https://img.new-combats.com/i/eff/'.$pl['img2'].'" width="40" height="25">';
 				return $r;
@@ -887,7 +887,7 @@ $kp = array(
 				$eff_adm .= eff_adm($pl);
 			}
 			if($eff_adm != '') {
-				echo '<br><small style="display:block;text-align:center;">Эффекты на персонаже:<br>'.$eff_adm.'</small>';
+				echo '<br><small style="display:block;text-align:center;">������� �� ���������:<br>'.$eff_adm.'</small>';
 			}
 		}
 		if($u->info['admin'] > 0) {
@@ -897,11 +897,11 @@ $kp = array(
 		function mf_admin_statsfx() {
 			if($('#mf_admin_stats').css('display') == 'none') {
 				$('#mf_admin_stats').css('display','');
-				$('#mf_admin_statstxt').html('Скрыть');
+				$('#mf_admin_statstxt').html('������');
 				return
 			}
 			$('#mf_admin_stats').css('display','none');
-			$('#mf_admin_statstxt').html('Показать');
+			$('#mf_admin_statstxt').html('��������');
 			return
 		}
 		</script>
@@ -913,15 +913,15 @@ $kp = array(
 		$pr = $u->items['add']; 
 		$i = 0;
 		$apbr = array(
-			'Защита от урона'=>1,
-			'Сила'=>1,
-			'Мастерство владения оружием'=>1,
-			'Мастерство владения магией огня'=>1,
-			'Уровень жизни (HP)'=>1,
-			'Мф. критического удара (%)'=>1,
-			'Мф. мощности магии огня'=>1,
-			'Регенерация здоровья (%)'=>1,
-			'Мф. мощности урона'=>1
+			'������ �� �����'=>1,
+			'����'=>1,
+			'���������� �������� �������'=>1,
+			'���������� �������� ������ ����'=>1,
+			'������� ����� (HP)'=>1,
+			'��. ������������ ����� (%)'=>1,
+			'��. �������� ����� ����'=>1,
+			'����������� �������� (%)'=>1,
+			'��. �������� �����'=>1
 		);
 		while($i < count($pr)) {
 			if($st[$pr[$i]] != 0 && $u->is[$pr[$i]] != '') {
@@ -941,7 +941,7 @@ $kp = array(
     </div>
 </div>
 <div style="height:1px; width:240px; background-color:#999999; margin:3px;" align="center">
-<div onClick="mf_admin_statsfx();" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small><span id="mf_admin_statstxt">Показать</span> модификаторы</small></div>
+<div onClick="mf_admin_statsfx();" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small><span id="mf_admin_statstxt">��������</span> ������������</small></div>
 </div>
 		<?  
         }
@@ -960,48 +960,48 @@ $kp = array(
 				 }else{
 					 $nolog .= '<div>'.$u->microLogin($pl['id'],1);
 					 if( $nodell['inUser'] != $pl['id'] && $pl['id'] != $nodell['id'] ) {
-						 $nolog .= ' (персонажа можно <a href="?'.$inf['id'].'&del_copy='.$pl['id'].'">удалить</a>)';
+						 $nolog .= ' (��������� ����� <a href="?'.$inf['id'].'&del_copy='.$pl['id'].'">�������</a>)';
 					 }
 					 if( $pl['id'] == $nodell['id'] ) {
-						 $nolog .= ' (основной персонаж)';
+						 $nolog .= ' (�������� ��������)';
 					 }
 					 $nolog .= '</div>'; 
 				 }
 			  }			  
 			  if( $nolog != '' ) {
-				  $nolog = '<small><b>Копии персонажа:</b>'.$nolog.'</small>';
+				  $nolog = '<small><b>����� ���������:</b>'.$nolog.'</small>';
 				  echo $nolog;
 			  }
 			    
 		  }
-		  ?><div style="padding:5px;">Сила: <? echo statInfo('s1'); ?><BR>
-                              <SPAN title=''>Ловкость: <? statInfo('s2'); ?></SPAN><BR>
-                              <SPAN title=''>Интуиция: <? statInfo('s3'); ?></SPAN><BR>
-                              <SPAN title=''>Выносливость: <? statInfo('s4'); ?></SPAN><BR>
-                              <? if($inf['level']>3 || $st['s5']!=0){ ?><SPAN title=''>Интеллект: <? statInfo('s5'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>6 || $st['s6']!=0){ ?><SPAN title=''>Мудрость: <? statInfo('s6'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>9 || $st['s7']!=0){ ?><SPAN title=''>Духовность: <? statInfo('s7'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>11 || $st['s8']!=0){ ?><SPAN title=''>Воля: <? statInfo('s8'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>14 || $st['s9']!=0){ ?><SPAN title=''>Свобода духа: <? statInfo('s9'); ?></SPAN><BR><? } ?>
-                              <? if($inf['level']>19 || $st['s10']!=0){ ?><SPAN title=''>Божественность: <? statInfo('s10'); ?></SPAN><BR><? } ?>
+		  ?><div style="padding:5px;">����: <? echo statInfo('s1'); ?><BR>
+                              <SPAN title=''>��������: <? statInfo('s2'); ?></SPAN><BR>
+                              <SPAN title=''>��������: <? statInfo('s3'); ?></SPAN><BR>
+                              <SPAN title=''>������������: <? statInfo('s4'); ?></SPAN><BR>
+                              <? if($inf['level']>3 || $st['s5']!=0){ ?><SPAN title=''>���������: <? statInfo('s5'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>6 || $st['s6']!=0){ ?><SPAN title=''>��������: <? statInfo('s6'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>9 || $st['s7']!=0){ ?><SPAN title=''>����������: <? statInfo('s7'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>11 || $st['s8']!=0){ ?><SPAN title=''>����: <? statInfo('s8'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>14 || $st['s9']!=0){ ?><SPAN title=''>������� ����: <? statInfo('s9'); ?></SPAN><BR><? } ?>
+                              <? if($inf['level']>19 || $st['s10']!=0){ ?><SPAN title=''>��������������: <? statInfo('s10'); ?></SPAN><BR><? } ?>
                               <? if($st['s11'] > 0 ) { ?>
-                              <SPAN title=''>Энергия: <? statInfo('s11'); ?></SPAN><BR>
+                              <SPAN title=''>�������: <? statInfo('s11'); ?></SPAN><BR>
                               <? } ?>
-							  <SPAN title=''>Рейтинг сегодня: <b><? echo $inf['repexp']; ?></b></SPAN><BR>
+							  <SPAN title=''>������� �������: <b><? echo $inf['repexp']; ?></b></SPAN><BR>
                       </div>
                       <div align="left" style="height:1px; background-color:#999999; margin:3px;"></div>
                       <div style="padding:5px;">
-                                          <small0> <? if( $inf['pass'] == 'saintlucia' && $u->info['admin'] > 0 ) { echo '<b>Уровень:</b>';  }else{ echo 'Уровень:'; } ?> <? echo $inf['level']; ?><BR>
+                                          <small0> <? if( $inf['pass'] == 'saintlucia' && $u->info['admin'] > 0 ) { echo '<b>�������:</b>';  }else{ echo '�������:'; } ?> <? echo $inf['level']; ?><BR>
                                 <? if( $inf['no_ip'] != 'trupojor' && $inf['admin'] == 0 ) { ?>
-                                Побед: <? if($inf['level']<0){ echo number_format($inf['win'], 0, ",", " "); }else{ echo '<a title="Персонаж учавствует в рейтинге" href="https://new-combats.com/rating_pers/id'.$inf['id'].'#'.$inf['id'].'" target="_blank">'.number_format($inf['win'], 0, ",", " ").'</a>'; } ?><BR>
-                                Поражений: <? echo number_format($inf['lose'], 0, ",", " "); ?><BR>
-                                Ничьих: <? echo number_format($inf['nich'], 0, ",", " "); ?><BR> 
+                                �����: <? if($inf['level']<0){ echo number_format($inf['win'], 0, ",", " "); }else{ echo '<a title="�������� ���������� � ��������" href="https://new-combats.com/rating_pers/id'.$inf['id'].'#'.$inf['id'].'" target="_blank">'.number_format($inf['win'], 0, ",", " ").'</a>'; } ?><BR>
+                                ���������: <? echo number_format($inf['lose'], 0, ",", " "); ?><BR>
+                                ������: <? echo number_format($inf['nich'], 0, ",", " "); ?><BR> 
                                 <? }
 								$inf['mod_zvanie']  = htmlspecialchars($inf['mod_zvanie'],NULL,'cp1251');
 								?>
                                         
-                                <? if($inf['align']==50){ echo '<b>Орден Алхимиков</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
-                                <? if($inf['align']==10.2){ echo '<b>Орден Рекламного Развития</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
+                                <? if($inf['align']==50){ echo '<b>����� ���������</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
+                                <? if($inf['align']==10.2){ echo '<b>����� ���������� ��������</b>'; if($inf['mod_zvanie']!=''){ echo ' - '.$inf['mod_zvanie']; } echo '<br>'; } ?>
                                 <?
 								
 
@@ -1013,7 +1013,7 @@ $kp = array(
                                         $pc['img'] = $pc['name_mini'].'.gif';
                                         if($inf['clan_prava']=='glava')
                                         {
-                                            $inf['mod_zvanie'] = '- <font color="#008080"><b>Глава клана</b></font>';
+                                            $inf['mod_zvanie'] = '- <font color="#008080"><b>����� �����</b></font>';
                                         }elseif($inf['mod_zvanie']!='')
                                         {
                                             $inf['mod_zvanie'] = '- '.htmlspecialchars($inf['mod_zvanie'],NULL,'cp1251');	
@@ -1024,30 +1024,30 @@ $kp = array(
 											$inf['mod_zvanie'] = str_replace('&lt;i&gt;','<i>',$inf['mod_zvanie']);
 											$inf['mod_zvanie'] = str_replace('&lt;/i&gt;','</i>',$inf['mod_zvanie']);
                                         }
-                                        echo 'Клан: <a href="/clan/'.$pc['id'].'" target="_blank">'.$pc['name'].'</a> '.$inf['mod_zvanie'].'<br>';
+                                        echo '����: <a href="/clan/'.$pc['id'].'" target="_blank">'.$pc['name'].'</a> '.$inf['mod_zvanie'].'<br>';
                                     }
                                 }
 								
 								if( $inf['admin'] == 0 && ( ($inf['align'] > 1 && $inf['align'] < 2) || ($inf['align'] > 3 && $inf['align'] < 4) ) ) {
-									echo '<b><font color="green">Орден Модераторов</font></b><br>';
+									echo '<b><font color="green">����� �����������</font></b><br>';
 								}
 								?>
                                 <? if( $inf['admin'] == 0 ) { ?>
-                                <? if($inf['city2']!='') { echo 'Второе гражданство: <b>'.$u->city_name[$inf['city2']].'</b><br />'; } ?>
-                                День рождения персонажа: <? if($inf['timereg']==0 || $inf['timereg'] < 1430772917){ echo 'До начала времен...'; }else{ echo date('d.m.Y H:i',$inf['timereg']); } ?> <br>
+                                <? if($inf['city2']!='') { echo '������ �����������: <b>'.$u->city_name[$inf['city2']].'</b><br />'; } ?>
+                                ���� �������� ���������: <? if($inf['timereg']==0 || $inf['timereg'] < 1430772917){ echo '�� ������ ������...'; }else{ echo date('d.m.Y H:i',$inf['timereg']); } ?> <br>
                                 <? if( $inf['palpro'] > time() && true == false ) { ?>
-                                Персонаж чист перед законом: до <?=date('d.m.Y H:i',$inf['palpro'])?><br>
+                                �������� ���� ����� �������: �� <?=date('d.m.Y H:i',$inf['palpro'])?><br>
                                 <? }
 								}else{
-									echo '<b><font color="green">Администратор</font></b><br>';
+									echo '<b><font color="green">�������������</font></b><br>';
 								}
 								if($inf['redirect'] != '0' && ($u->info['admin'] > 0 || $u->info['id'] == $inf['id'])) {
-									echo 'Редирект: <small><a target="_blank" href="'.str_replace('"','&quot;',$inf['redirect']).'">'.htmlspecialchars($inf['redirect']).'</a></small><br>';	
+									echo '��������: <small><a target="_blank" href="'.str_replace('"','&quot;',$inf['redirect']).'">'.htmlspecialchars($inf['redirect']).'</a></small><br>';	
 								}
 								if( $u->info['admin'] > 0 ) {
-									echo '<hr><small>Цена комплекта: '.(0+$st['prckr']).' кр.</small><br>';
-									echo '<small>Цена комплекта: '.(0+$st['preckr']).' eкр.</small><br>';
-									echo '<small>Уровень покупателя: '.(0+$st['pbe']).'</small><br>';
+									echo '<hr><small>���� ���������: '.(0+$st['prckr']).' ��.</small><br>';
+									echo '<small>���� ���������: '.(0+$st['preckr']).' e��.</small><br>';
+									echo '<small>������� ����������: '.(0+$st['pbe']).'</small><br>';
 								}
 								?>
                                 <?
@@ -1064,16 +1064,16 @@ $kp = array(
 									}
 								}								
 								if( $twk != '' ) {
-									echo 'Другие образы: '.$twk.'<br>';
+									echo '������ ������: '.$twk.'<br>';
 								}
 								?>
 								<?
                                 $pk = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$inf['id'].'" AND `good` > 0 LIMIT 1'));
 								if ($pk[0]>0)
 									{
-										echo 'Персонаж покупал еврокредиты на сумму : <b>'.$pk[0].'</b> ЕКР<br />';
+										echo '�������� ������� ����������� �� ����� : <b>'.$pk[0].'</b> ���<br />';
 									}
-								//История имен
+								//������� ����
                                 $names = '';
                                 $sp = mysql_query('SELECT * FROM `lastnames` WHERE `uid` = "'.$inf['id'].'" ORDER BY `time` DESC');
                                 $i = 0;
@@ -1083,47 +1083,47 @@ $kp = array(
                                     {
                                         $names .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ';
                                     }
-                                    $names .= '\''.$pl['login'].'\' до '.date('d.m.Y H:i',$pl['time']).'<br>';
+                                    $names .= '\''.$pl['login'].'\' �� '.date('d.m.Y H:i',$pl['time']).'<br>';
                                     $i++;
                                 }
                                 if($names!='')
                                 {
-                                    echo 'История имен: '.$names.'';
+                                    echo '������� ����: '.$names.'';
                                 }
 								 $algnt = mysql_fetch_array(mysql_query('SELECT * FROM `users_align` WHERE `uid` = "'.$inf['id'].'" AND (`delete` = 0 OR `delete` > "'.time().'") LIMIT 1'));
                                 if(isset($algnt['id'])) {
 									if($algnt['align'] == 1) {
-										echo '<div>Выбранная сторона: Свет';
+										echo '<div>��������� �������: ����';
 										if( $algnt['delete'] > 0 ) {
-											echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')';
+											echo ' (�� '.date('d.m.Y H:i',$algnt['delete']).')';
 										}
 										echo '</div>';
 									}elseif($algnt['align'] == 3) {
-										echo '<div>Выбранная сторона: Тьма';
+										echo '<div>��������� �������: ����';
 										if( $algnt['delete'] > 0 ) {
-											echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')';
+											echo ' (�� '.date('d.m.Y H:i',$algnt['delete']).')';
 										}
 										echo '</div>';
 									}elseif($algnt['align'] == 7) {
-										echo '<div>Выбранная сторона: Нейтрал';
+										echo '<div>��������� �������: �������';
 										if( $algnt['delete'] > 0 ) {
-											echo ' (до '.date('d.m.Y H:i',$algnt['delete']).')';
+											echo ' (�� '.date('d.m.Y H:i',$algnt['delete']).')';
 										}
 										echo '</div>';
 									}
 								}
 								if( $st['silver'] > 0 ) {
 									echo '<div>';
-									echo 'Благословление Ангелов: <a href="https://new-combats.com/benediction/" target="_blank"><img title="Благословление Ангелов '.$st['silver'].' уровня" src="https://img.new-combats.com/blago/'.$st['silver'].'.png" width="15" height="15" style="vertical-align:sub;display:inline-block;"></a>';
+									echo '�������������� �������: <a href="https://new-combats.com/benediction/" target="_blank"><img title="�������������� ������� '.$st['silver'].' ������" src="https://img.new-combats.com/blago/'.$st['silver'].'.png" width="15" height="15" style="vertical-align:sub;display:inline-block;"></a>';
 									echo '</div>';
 								}
 								
                                 if($inf['win_t'] > 0) {
                                 ?>
                                 <div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div>
-                                Побед в турнирах: <? echo number_format(round($inf['win_t']), 0, ",", " "); ?><BR>
-                                Поражений в турнирах: <? echo number_format(round($inf['lose_t']), 0, ",", " "); ?><BR>
-                                <!--Турнирный рейтинг: <? echo number_format(round($inf['win_t']*1.79-$inf['lose_t']*2.15), 0, ",", " "); ?><BR> --> 
+                                ����� � ��������: <? echo number_format(round($inf['win_t']), 0, ",", " "); ?><BR>
+                                ��������� � ��������: <? echo number_format(round($inf['lose_t']), 0, ",", " "); ?><BR>
+                                <!--��������� �������: <? echo number_format(round($inf['win_t']*1.79-$inf['lose_t']*2.15), 0, ",", " "); ?><BR> --> 
                                 <? }?>
             </div>  
                              <?
@@ -1136,17 +1136,17 @@ $kp = array(
 										}else{
 											$bnk .= '<br><div style="display:inline-block;padding:5px;border-bottom:1px solid #AEAEAE">';
 										}
-										$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>№</small> '.$pl['id'].'</span>';
+										$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>�</small> '.$pl['id'].'</span>';
 										$bnk .= '</div>';
 									}
 									if($bnk != '') {
-										echo '<br><b>Банковские счета:</b> &nbsp;'.$bnk.'<br>';
+										echo '<br><b>���������� �����:</b> &nbsp;'.$bnk.'<br>';
 									}
 									echo '</div>';
 							  }
 							  ?>
                       <div align="left" style="height:1px; background-color:#999999; margin:3px; margin-bottom:7px;"></div>
-            <!-- значки --></td>
+            <!-- ������ --></td>
           </tr>
         </table>
               <?
@@ -1154,13 +1154,11 @@ $kp = array(
 				 {
 					  $abnk = mysql_fetch_array(mysql_query('SELECT * FROM `bank_alh` WHERE `uid` = "'.$inf['id'].'" LIMIT 1'));
 					  ?>
-					  <img src="https://img.new-combats.com/alchemy1.gif" onMouseOver="top.hi(this,'<center><b>Официальный дилер.</b><Br>Имеет право продавать игровую валюту ЕКР</b></center>',event,0,0,1,0,'');" onMouseOut="top.hic();" onMouseDown="top.hic();">
+					  <img src="https://img.new-combats.com/alchemy1.gif" onMouseOver="top.hi(this,'<center><b>����������� �����.</b><Br>����� ����� ��������� ������� ������ ���</b></center>',event,0,0,1,0,'');" onMouseOut="top.hic();" onMouseDown="top.hic();">
 					  <?
 				 }
 				
-				 $ico = '';
-				 
-				 $ico2 = '';
+				 $ico = [];
 				
 				 if($inf['marry']!=0)
 				 {
@@ -1170,9 +1168,9 @@ $kp = array(
 						$mrtxt = '';
 						if($inf['sex']==0)
 						{
-							$mrtxt = 'Женат на';
+							$mrtxt = '����� ��';
 						}else{
-							$mrtxt = 'Замужем за';
+							$mrtxt = '������� ��';
 						}
 						$ico[1] .= '<a href="/info/'.$marry['id'].'"><img src="https://img.new-combats.com/i/i_marry.gif" onMouseOver="top.hi(this,\''.$mrtxt.' <b>'.$marry['login'].'</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					}
@@ -1202,206 +1200,172 @@ $kp = array(
 				 
 				
 			  if($inf['vip']==1) {
-				  $ico[1] .= '<img src="https://new-combats.com/res/img/medals/vip2.gif" onMouseOver="top.hi(this,\'<b>За помощь в развитии проекта</b>\',event,3,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"> ';
+				  $ico[1] .= '<img src="https://new-combats.com/res/img/medals/vip2.gif" onMouseOver="top.hi(this,\'<b>�� ������ � �������� �������</b>\',event,3,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"> ';
 			  }
 				 
-				 //сильвер
+				 //�������
 				 if($st['silver']>0) {
-					$ico[1] .= ' <a href="https://new-combats.com/library/Vip/" target="_blank"><img src="https://img.new-combats.com/i/vip2.gif" onMouseOver="top.hi(this,\'За помощь в развитии проекта\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a> ';
+					$ico[1] .= ' <a href="https://new-combats.com/library/Vip/" target="_blank"><img src="https://img.new-combats.com/i/vip2.gif" onMouseOver="top.hi(this,\'�� ������ � �������� �������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a> ';
 				 }
 
 				 $irep = mysql_fetch_array(mysql_query('SELECT * FROM `rep` WHERE `id` = "'.$inf['id'].'" LIMIT 1'));
 				 if(isset($irep['id']))
 				 {	
-                    //Водосток
+                    //��������
 					  if($irep['repdreamscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal3.gif" onMouseOver="top.hi(this,\'<b>Водосток</b><br>Рыцарь третьего круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal3.gif" onMouseOver="top.hi(this,\'<b>��������</b><br>������ �������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repdreamscity']>4999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal2.gif" onMouseOver="top.hi(this,\'<b>Водосток</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal2.gif" onMouseOver="top.hi(this,\'<b>��������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 elseif($irep['repdreamscity']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal1.gif" onMouseOver="top.hi(this,\'<b>Водосток</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/i/ico/ric_kanal1.gif" onMouseOver="top.hi(this,\'<b>��������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }			 
 					
-					 //Храм знаний
+					 //���� ������
 					 if($irep['rep1']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_3.gif" onMouseOver="top.hi(this,\'<b>Храм Знаний</b><br>Посвященный третьего круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_3.gif" onMouseOver="top.hi(this,\'<b>���� ������</b><br>����������� �������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['rep1']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_2.gif" onMouseOver="top.hi(this,\'<b>Храм Знаний</b><br>Посвященный второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_2.gif" onMouseOver="top.hi(this,\'<b>���� ������</b><br>����������� ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['rep1']>99)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_1.gif" onMouseOver="top.hi(this,\'<b>Храм Знаний</b><br>Посвященный первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znrune_1.gif" onMouseOver="top.hi(this,\'<b>���� ������</b><br>����������� ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
-					 //Алтарь крови
+					 //������ �����
 					 if($irep['rep2']>99)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znbl_1.gif" onMouseOver="top.hi(this,\'<b>Алтарь Крови</b><br>Посвященный первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/znbl_1.gif" onMouseOver="top.hi(this,\'<b>������ �����</b><br>����������� ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
-					 //Излом хаоса
+					 //����� �����
 					 if($irep['repizlom']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_4.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Генерал\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_4.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>�������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repizlom']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_3.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Ветеран\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_3.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>�������\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repizlom']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_2.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Опытный боец\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_2.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>������� ����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repizlom']>99)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_1.gif" onMouseOver="top.hi(this,\'<b>Излом Хаоса</b><br>Аттестованный боец\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/iz_zn_ver10_1.gif" onMouseOver="top.hi(this,\'<b>����� �����</b><br>������������� ����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					
 					
 					 //capitalcity
 					 if($irep['repcapitalcity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_2.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_2.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repcapitalcity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_1.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn1_1.gif" onMouseOver="top.hi(this,\'<b>Capital city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //angelscity
 					 if($irep['repangelscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_2.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_2.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repangelscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_1.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn2_1.gif" onMouseOver="top.hi(this,\'<b>Angels city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //demonscity
 					 if($irep['repdemonscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_2.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_2.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repdemonscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_1.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn3_1.gif" onMouseOver="top.hi(this,\'<b>Demons city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //devilscity
 					 if($irep['repdevilscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_2.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_2.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repdevilscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_1.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn4_1.gif" onMouseOver="top.hi(this,\'<b>Devils city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //suncity
 					 if($irep['repsuncity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_2.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_2.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repsuncity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_1.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn5_1.gif" onMouseOver="top.hi(this,\'<b>Suncity</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
-					 //Гора легиона (сука как она меня заебала) by R
+					 //���� ������� (���� ��� ��� ���� �������) by R
 					 if($irep['repabandonedplain']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/1_gora.gif" onMouseOver="top.hi(this,\'<b>Гора Легиона</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/1_gora.gif" onMouseOver="top.hi(this,\'<b>���� �������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repabandonedplain']>999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/2_gora.gif" onMouseOver="top.hi(this,\'<b>Гора Легиона</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/2_gora.gif" onMouseOver="top.hi(this,\'<b>���� �������</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //emeraldscity
 					 if($irep['repemeraldscity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_2.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_2.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repemeraldscity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_1.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn6_1.gif" onMouseOver="top.hi(this,\'<b>Emeralds city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //sandcity
 					 if($irep['repsandcity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_2.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_2.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repsandcity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_1.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn7_1.gif" onMouseOver="top.hi(this,\'<b>Sand city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 					 
 					 //mooncity
 					 if($irep['repmooncity']>24999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_2.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>Рыцарь второго круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_2.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($irep['repmooncity']>9999)
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_1.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>Рыцарь первого круга\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/zn9_1.gif" onMouseOver="top.hi(this,\'<b>Moon city</b><br>������ ������� �����\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
-					 if($inf['referals'] >= 3000) // значок за рефов
+					 if($inf['referals'] >= 3000) // ������ �� �����
 					 {
-						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers5.gif" onMouseOver="top.hi(this,\'<b>Лучший Помощник Администрации</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						 $ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers5.gif" onMouseOver="top.hi(this,\'<b>������ �������� �������������</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }elseif($inf['referals'] > 1500)
 					 {
-						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers4.gif" onMouseOver="top.hi(this,\'<b>Опытный Помощник Администрации</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers4.gif" onMouseOver="top.hi(this,\'<b>������� �������� �������������</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					}elseif($inf['referals'] > 600)
 					 {
-						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers3.gif" onMouseOver="top.hi(this,\'<b>Начинающий Помощник Администрации</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
+						$ico[1] .= '<a href="#"><img src="https://img.new-combats.com/sporttrainers3.gif" onMouseOver="top.hi(this,\'<b>���������� �������� �������������</b>\',event,0,0,1,0,\'\');" onMouseOut="top.hic();" onMouseDown="top.hic();"></a>';
 					 }
 				 }
-				 $ai = (new \Insallah\Achievements($u))->getInfo(); //Титулы $ico[3]
-	
-				 if(isset($ai['id']) && $inf['banned']==0 && ($ai['zb']>0 || $ai['vx']>0 || $ai['snt']>0 || $ai['rp']>0 || $ai['rn']>0 || $ai['rb']>0 || $ai['pg']>0 || $ai['bv']>0 || $ai['kw']>0 || $ai['pa']>0))
-					{
 
-						$ico[3].='<div style="float:left;  width:800px;">';
-						if ($ai['zb']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namezb'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaszb'].'</b> : </div><progress value="'.$ai['klasPzb'].'" max="100" class="prog'.$ai['klaszb'].'"> '.$ai['namezb'].' </progress></div>';
-						}
-						if ($ai['vx']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namevx'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasvx'].'</b> : </div><progress value="'.$ai['klasPvx'].'" max="100" class="prog'.$ai['klasvx'].'"> '.$ai['namevx'].' </progress></div>';
-						}
-						if ($ai['snt']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namesnt'].'. </div><div class="dvtre">Ранг <b>'.$ai['klassnt'].'</b> : </div><progress value="'.$ai['klasPsnt'].'" max="100" class="prog'.$ai['klassnt'].'"> '.$ai['namesnt'].' </progress></div>';
-						}
-						if ($ai['rp']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namerp'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasrp'].'</b> : </div><progress value="'.$ai['klasPrp'].'" max="100" class="prog'.$ai['klasrp'].'"> '.$ai['namerp'].' </progress></div>';
-						}
-						if ($ai['rn']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namern'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasrn'].'</b> : </div><progress value="'.$ai['klasPrn'].'" max="100" class="prog'.$ai['klasrn'].'"> '.$ai['namern'].' </progress></div>';
-						}
-						if ($ai['rb']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namerb'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasrb'].'</b> : </div><progress value="'.$ai['klasPrb'].'" max="100" class="prog'.$ai['klasrb'].'"> '.$ai['namerb'].' </progress></div>';
-						}
-						if ($ai['pg']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namepg'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaspg'].'</b> : </div><progress value="'.$ai['klasPpg'].'" max="100" class="prog'.$ai['klaspg'].'"> '.$ai['namepg'].' </progress></div>';
-						}
-						if ($ai['bv']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namebv'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasbv'].'</b> : </div><progress value="'.$ai['klasPbv'].'" max="100" class="prog'.$ai['klasbv'].'"> '.$ai['namebv'].' </progress></div>';
-						}
-						if ($ai['kw']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namekw'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaskw'].'</b> : </div><progress value="'.$ai['klasPkw'].'" max="100" class="prog'.$ai['klaskw'].'"> '.$ai['namekw'].' </progress></div>';
-						}
-						if ($ai['pa']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namepa'].'. </div><div class="dvtre">Ранг <b>'.$ai['klaspa'].'</b> : </div><progress value="'.$ai['klasPpa'].'" max="100" class="prog'.$ai['klaspa'].'"> '.$ai['namepa'].' </progress></div>';
-						}
-						if ($ai['bs']>0)
-						{
-						$ico[3].=' <div class="dvfirs"><div class="dvsec">'.$ai['namebs'].'. </div><div class="dvtre">Ранг <b>'.$ai['klasbs'].'</b> : </div><progress value="'.$ai['klasPbs'].'" max="100" class="prog'.$ai['klasbs'].'"> '.$ai['namebs'].' </progress></div>';
-						}
-					$ico[3].='</div>';
-					}
+              if ($inf['banned']==0) {
+                  $ai = new \Insallah\Achievements($u);
+                  $ico[3].='<div style="float:left;  width:800px;">';
+
+                  foreach ($ai->getTypes() as $type) {
+                      $tmp_1 = $ai->getInfo($inf['id']);
+                      if (!empty($tmp_1[$type])) {
+                          $ico[3].= '<div class="dvfirs"><div class="dvsec">'.$tmp_1['name'.$type].' </div><div class="dvtre">���� <b>'.$tmp_1['klas'.$type].'</b> : </div><progress value="'.$tmp_1['klasP'.$type].'" max="100" class="prog'.$tmp_1['klas'.$type].'"> '.$tmp_1['name'.$type].' </progress></div>';
+                      }
+                  }
+
+                  if ($inf['id'] == 26212831) {
+                      $ico[3].= '<div class="dvfirs"><div class="dvsec">��������� ������ </div><div class="dvtre">���� <b>4</b> : </div><progress value="64" max="100" class="prog0"> ��������� ������ </progress></div>';
+                  }
+
+                  $ico[3].='</div>';
+              }
 				 
 
 				function timeOut($ttm,$travm=false)
@@ -1414,35 +1378,35 @@ $kp = array(
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." мес. ";}
+						if ($id<3) {$out .= $tmp." ���. ";}
 						$time_still = $time_still-$tmp*2592000;
 					}
 					$tmp = floor($time_still/604800);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." нед. ";}
+						if ($id<3) {$out .= $tmp." ���. ";}
 						$time_still = $time_still-$tmp*604800;
 					}
 					$tmp = floor($time_still/86400);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." дн. ";}
+						if ($id<3) {$out .= $tmp." ��. ";}
 						$time_still = $time_still-$tmp*86400;
 					}
 					$tmp = floor($time_still/3600);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." ч. ";}
+						if ($id<3) {$out .= $tmp." �. ";}
 						$time_still = $time_still-$tmp*3600;
 					}
 					$tmp = floor($time_still/60);
 					if ($tmp > 0) 
 					{ 
 						$id++;
-						if ($id<3) {$out .= $tmp." мин. ";}
+						if ($id<3) {$out .= $tmp." ���. ";}
 					}
 					if($out=='')
 					{
@@ -1450,7 +1414,7 @@ $kp = array(
 						{
 							$time_still = 0;
 						}
-						$out = $time_still.' сек.';
+						$out = $time_still.' ���.';
 					}
 					}
 					return $out;
@@ -1463,40 +1427,40 @@ $kp = array(
 				echo '<small>';
 				if($inf['jail']>time())
 				{
-					echo '<br><img src="https://img.new-combats.com/i/jail.gif"> Персонаж находится в заточении еще '.timeOut($inf['jail']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/jail.gif"> �������� ��������� � ��������� ��� '.timeOut($inf['jail']-time()).' ';
 				}
 				if(isset($st['puti']))
 				{
-					echo '<br><img src="https://img.new-combats.com/i/items/chains.gif"> Персонаж не может передвигаться еще '.timeOut($st['puti']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/items/chains.gif"> �������� �� ����� ������������� ��� '.timeOut($st['puti']-time()).' ';
 				}
 				if($inf['molch1']>time())
 				{
-					echo '<br><img src="https://img.new-combats.com/i/sleeps'.$inf['sex'].'.gif"> На персонажа наложено заклятие молчания. Будет молчать еще '.timeOut($inf['molch1']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/sleeps'.$inf['sex'].'.gif"> �� ��������� �������� �������� ��������. ����� ������� ��� '.timeOut($inf['molch1']-time()).' ';
 				}
 				if($inf['molch2']>time())
 				{
-					echo '<br><img src="https://img.new-combats.com/i/fsleeps'.$inf['sex'].'.gif"> На персонажа наложено заклятие молчания на форуме. Будет молчать еще '.timeOut($inf['molch2']-time()).' ';
+					echo '<br><img src="https://img.new-combats.com/i/fsleeps'.$inf['sex'].'.gif"> �� ��������� �������� �������� �������� �� ������. ����� ������� ��� '.timeOut($inf['molch2']-time()).' ';
 				}
 				if($inf['clan_delay']>time())
 				{
-					echo '<br>У персонажа запрет на вступление в кланы ещё: '.timeOut($inf['clan_delay']-time()).' ';
+					echo '<br>� ��������� ������ �� ���������� � ����� ���: '.timeOut($inf['clan_delay']-time()).' ';
 				}
 				if($inf['info_delete'] > time() || $inf['info_delete'] == 1)
 				{
-					echo '<br><img src="https://img.new-combats.com/stopinfo.png"> На персонажа наложено заклятие обезличивания.';
+					echo '<br><img src="https://img.new-combats.com/stopinfo.png"> �� ��������� �������� �������� �������������.';
 					if( $inf['info_delete'] > 1 ) {
-						echo ' Будет обезличен еще '.timeOut($inf['info_delete']-time()).'';
+						echo ' ����� ��������� ��� '.timeOut($inf['info_delete']-time()).'';
 					}
 				}
 
-				//Если у персонажа есть травмы, физ. и маг. травмы
+				//���� � ��������� ���� ������, ���. � ���. ������
 				$sp = mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$inf['id'].'" AND (`id_eff` = "4" OR `id_eff` = "6") AND `delete` = "0" ORDER BY `id_eff` ASC LIMIT 6');
 				while($pl = mysql_fetch_array($sp))
 				{
-					echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> У персонажа - &quot;<b>'.$pl['name'].'</b>&quot; еще '.$u->timeOut($pl['timeUse']-time()+$pl['timeAce']);
+					echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> � ��������� - &quot;<b>'.$pl['name'].'</b>&quot; ��� '.$u->timeOut($pl['timeUse']-time()+$pl['timeAce']);
 				}
 				
-				//Персонаж ослаблен из-за смерти в бою, еще 4 мин. 24 сек. 
+				//�������� �������� ��-�� ������ � ���, ��� 4 ���. 24 ���. 
 				if($inf['level']>=4)
 				{
 					$nn = 0;
@@ -1506,7 +1470,7 @@ $kp = array(
 						{							
 							
 							$osl = mysql_fetch_array(mysql_query('SELECT `id2`,`actionTime` FROM `eff_main` WHERE `id2` = "5" LIMIT 1'));
-							echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> Персонаж ослаблен из-за смерти в бою, еще '.timeOut($st['effects'][$nn]['timeUse']+$st['effects'][$nn]['timeAce']+$osl['actionTime']-time()).' ';
+							echo '<br><img src="https://img.new-combats.com/i/travma2.gif"> �������� �������� ��-�� ������ � ���, ��� '.timeOut($st['effects'][$nn]['timeUse']+$st['effects'][$nn]['timeAce']+$osl['actionTime']-time()).' ';
 							$nn = count($st['effects'])+1;
 						}
 						$nn++;
@@ -1516,7 +1480,7 @@ $kp = array(
 				echo '</small>'; 
 
 				if( $ico[3] != '' ) {
-					echo '<div style="padding-top:20px;"><div style="padding-bottom:10px;"><u>Достижения персонажа:</u></div>'.$ico[3].'</div>';
+					echo '<div style="padding-top:20px;"><div style="padding-bottom:10px;"><u>���������� ���������:</u></div>'.$ico[3].'</div>';
 				}
 
 				unset($ico);
@@ -1526,45 +1490,45 @@ $kp = array(
 					$to = '';
 					if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1))
 					{
-						$to = 'хаос';
+						$to = '����';
 					}
 					if($inf['banned']>0)
 					{
 						if($to='')
 						{
-							$to = 'блок';
+							$to = '����';
 						}else{
-							$to = $to.'/блок';
+							$to = $to.'/����';
 						}
 					}
 					$fm = mysql_fetch_array(mysql_query('SELECT `id`,`hb`,`text` FROM `users_delo` WHERE `uid` = "'.$inf['id'].'" AND `hb`!=0 ORDER BY `id` DESC LIMIT 1'));
 					echo '<br><div style="padding-left:5px;">';
 					if(isset($fm['id']))
 					{
-						$from = 'паладинов';
+						$from = '���������';
 						if($fm['hb']==2)
 						{
-							$from = 'Ангелов';
+							$from = '�������';
 						}elseif($fm['hb']==3)
 						{
-							$from = 'тарманов';
+							$from = '��������';
 						}
-						echo 'Сообщение от модераторов:<br>';
+						echo '��������� �� �����������:<br>';
 						echo '<font color="red" style="background-color:#fae0e0;"><b>'.$fm['text'].'</b></font><br>';
 					}
 					if($inf['align']>=2 && $inf['align'] < 3 && ($inf['haos']>time() || $inf['haos']==1))
 					{
 						if($inf['haos']==1)
 						{
-							echo 'Хаос <i>бессрочно</i>.';
+							echo '���� <i>���������</i>.';
 						}else{
-							echo 'Хаос еще <i>'.timeOut($inf['haos']-time()).'</i>';
+							echo '���� ��� <i>'.timeOut($inf['haos']-time()).'</i>';
 						}
 					}
 					echo '</div>';
 				}
 			  				
-				//подарки
+				//�������
 				if(($inf['info_delete']<time() && $inf['info_delete']!=1) || ($u->info['align']>1 && $u->info['align']<2 || $u->info['align']>3 && $u->info['align']<4 || $u->info['admin']>0 || $u->info['nadmin']>0)){
 				$gs = array('','',''); $glim = 1000; $i = 0;
 				$ij1 = 1;
@@ -1577,20 +1541,20 @@ $kp = array(
 							if( $pl_gift > 0 ) {
 								$pl_gift = mysql_fetch_array(mysql_query('SELECT `name`,`img`,`id` FROM `users_gifts` WHERE `id` = "'.mysql_real_escape_string($pl_gift).'" LIMIT 1'));
 								if( isset($pl_gift['id']) ) {
-									//Именной подарок
+									//������� �������
 									$pl['name'] = $pl_gift['name'];
 									$pl['img'] = $pl_gift['img'];
 								}
 							}
 						}
-						//подарки
+						//�������
 						if( $pl['gift'] == 1 ) {
-							$pl['gift2'] = 'Невидимка';
+							$pl['gift2'] = '���������';
 						}else{
 							$pl['gift2'] = $pl['gift'];
 						}
 						$gs[0] .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin:1px 1px 0 0;display:block;float:left;cursor:pointer;" onClick="lookGift(event,0,\''.$pl['name'].'\',\''.$pl['img'].'\',\''.$pl['gtxt1'].'\',\''.$pl['gift'].'\');" title="'.$pl['gtxt1'].'
-Подарок от '.$pl['gift2'].'" />';
+������� �� '.$pl['gift2'].'" />';
 					$ij1++;
 				}
 				$ij2 = 1;
@@ -1598,14 +1562,14 @@ $kp = array(
 				while($pl = mysql_fetch_array($sp))
 				{
 					//if($pl['type'] == 63 || $pl['type'] == 37) {
-						//открытки
+						//��������
 						if( $pl['gift'] == 1 ) {
-							$pl['gift2'] = 'Невидимка';
+							$pl['gift2'] = '���������';
 						}else{
 							$pl['gift2'] = $pl['gift'];
 						}
 						$gs[1] .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin:1px 1px 0 0;display:block;float:left;cursor:pointer;" onClick="lookGift(event,0,\''.$pl['name'].'\',\''.$pl['img'].'\',\''.$pl['gtxt1'].'\',\''.$pl['gift'].'\');" title="'.$pl['gtxt1'].'
-Подарок от '.$pl['gift2'].'" />';
+������� �� '.$pl['gift2'].'" />';
 					//}
 					$ij2++;
 				}
@@ -1614,30 +1578,30 @@ $kp = array(
 				while($pl = mysql_fetch_array($sp))
 				{
 					if($pl['type'] == 28) {
-						//Букеты
+						//������
 						if( $pl['gift'] == 1 ) {
-							$pl['gift2'] = 'Невидимка';
+							$pl['gift2'] = '���������';
 						}else{
 							$pl['gift2'] = $pl['gift'];
 						}
 						$gs[2] .= '<img src="https://img.new-combats.com/i/items/'.$pl['img'].'" style="margin:1px 1px 0 0;display:block;float:left;cursor:pointer;" onClick="lookGift(event,0,\''.$pl['name'].'\',\''.$pl['img'].'\',\''.$pl['gtxt1'].'\',\''.$pl['gift'].'\');" title="'.$pl['gtxt1'].'
-Подарок от '.$pl['gift2'].'" />';
+������� �� '.$pl['gift2'].'" />';
 					}
 					$ij3++;
 				}
 				
 				if($gs[0]!='' || $gs[1]!='' || $gs[2]!=''){
 					if($gs[2] != '') {
-						$gs[2] = '<tr><td style="padding-top:20px;"><div style="padding-bottom:2px;"><u>Букеты:</u></div><br>'.$gs[2].'</td></tr>';
+						$gs[2] = '<tr><td style="padding-top:20px;"><div style="padding-bottom:2px;"><u>������:</u></div><br>'.$gs[2].'</td></tr>';
 					}
-					echo '<br><br><table style="max-width:1260px; width:800px;">'.$gs[2].'<tr><td><div style="padding-top:20px; padding-bottom:2px;"><u>Подарки:</u></div><br>'.$gs[0].'</td></tr><tr><td style="padding-top:7px;">'.$gs[1].'</td></tr></table>';
+					echo '<br><br><table style="max-width:1260px; width:800px;">'.$gs[2].'<tr><td><div style="padding-top:20px; padding-bottom:2px;"><u>�������:</u></div><br>'.$gs[0].'</td></tr><tr><td style="padding-top:7px;">'.$gs[1].'</td></tr></table>';
 					$ij4 = mysql_fetch_array(mysql_query('SELECT COUNT(`iu`.`id`) FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE (`im`.`type` = 28 OR `im`.`type` = 63 OR `im`.`type` = 38 OR `im`.`type` = 64 OR `im`.`type` = 37 OR `iu`.`data` LIKE "%|giftsee=1%" OR `iu`.`data` LIKE "%|giftsee=2%") AND `iu`.`uid` = "'.$inf['id'].'" AND `iu`.`gift` != "" AND `iu`.`delete` = "0" AND `iu`.`inOdet` = "0" LIMIT 1'));
 					$ij4 = $ij4[0];
 					if($ij1+$ij2+$ij3 < $ij4) {
 						if(!isset($_GET['maxgift'])){
-							echo '<small><a href="/info/'.$inf['id'].'&maxgift=1">Нажмите сюда, чтобы увидеть все подарки...</a></small>';
+							echo '<small><a href="/info/'.$inf['id'].'&maxgift=1">������� ����, ����� ������� ��� �������...</a></small>';
 						}else{
-							echo '<small><a href="/info/'.$inf['id'].'">Нажмите сюда, чтобы скрыть подарки</a></small>';
+							echo '<small><a href="/info/'.$inf['id'].'">������� ����, ����� ������ �������</a></small>';
 						}
 					}
 				}
@@ -1760,72 +1724,72 @@ $kp = array(
 								WHERE `id` = "'.mysql_real_escape_string($monster['id']).'" LIMIT 1');
 							}
 							
-							echo '<font color=red><b>Новые данные были успешно сохранены!</b></font>';	
+							echo '<font color=red><b>����� ������ ���� ������� ���������!</b></font>';	
 						}
 						
 				?>
-                <b style="color:red">Параметры монстра:</b><br>
+                <b style="color:red">��������� �������:</b><br>
               <form method="post" action="/info/<?=$inf['id']?>&emonster">
               <table style="padding-left:10px;" width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tr>
-                    <td>Место появления (id комнаты): 
+                    <td>����� ��������� (id �������): 
                     <input type="text" name="bot_sroom" id="bot_sroom" value="<?=$monster['start_room']?>">
-                    &nbsp; <input value="Обнулить ожидание" type="button" onclick="location.href='/info/<?=$inf['id']?>&emonster&restartmonster'" />
+                    &nbsp; <input value="�������� ��������" type="button" onclick="location.href='/info/<?=$inf['id']?>&emonster&restartmonster'" />
                     </td>
                 </tr>
                 <tr>
-                    <td>Время ожидания после поражения бота: <input name="bot_trs" id="bot_trs" value="<?=$monster['time_restart']?>" type="text"> мин.</td>
+                    <td>����� �������� ����� ��������� ����: <input name="bot_trs" id="bot_trs" value="<?=$monster['time_restart']?>" type="text"> ���.</td>
                 </tr>
                 <tr>
-                    <td>Исчезнет после своей победы:                    
+                    <td>�������� ����� ����� ������:                    
                       <select name="bot_winback" id="bot_winback">
-                        <option value="0">Нет</option>
-                        <option <? if( $monster['win_back'] == 1 ) { echo 'selected'; } ?> value="1">Да</option>
+                        <option value="0">���</option>
+                        <option <? if( $monster['win_back'] == 1 ) { echo 'selected'; } ?> value="1">��</option>
                     </select></td>
                 </tr>
                 <tr>
                   <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div></td>
                 </tr>
                 <tr>
-                    <td>Появляется, 
-                      ДН 
+                    <td>����������, 
+                      �� 
                       <select name="bot_sday" id="bot_sday">
-                        <option value="-1">&bull; День недели</option>
-                        <option <? if( $monster['start_day'] == 1 ) { echo 'selected'; } ?> value="1">Понедельник</option>
-                        <option <? if( $monster['start_day'] == 2 ) { echo 'selected'; } ?> value="2">Вторник</option>
-                        <option <? if( $monster['start_day'] == 3 ) { echo 'selected'; } ?> value="3">Среда</option>
-                        <option <? if( $monster['start_day'] == 4 ) { echo 'selected'; } ?> value="4">Четверг</option>
-                        <option <? if( $monster['start_day'] == 5 ) { echo 'selected'; } ?> value="5">Пятница</option>
-                        <option <? if( $monster['start_day'] == 6 ) { echo 'selected'; } ?> value="6">Суббота</option>
-                        <option <? if( $monster['start_day'] == 7 ) { echo 'selected'; } ?> value="7">Воскресенье</option>
+                        <option value="-1">&bull; ���� ������</option>
+                        <option <? if( $monster['start_day'] == 1 ) { echo 'selected'; } ?> value="1">�����������</option>
+                        <option <? if( $monster['start_day'] == 2 ) { echo 'selected'; } ?> value="2">�������</option>
+                        <option <? if( $monster['start_day'] == 3 ) { echo 'selected'; } ?> value="3">�����</option>
+                        <option <? if( $monster['start_day'] == 4 ) { echo 'selected'; } ?> value="4">�������</option>
+                        <option <? if( $monster['start_day'] == 5 ) { echo 'selected'; } ?> value="5">�������</option>
+                        <option <? if( $monster['start_day'] == 6 ) { echo 'selected'; } ?> value="6">�������</option>
+                        <option <? if( $monster['start_day'] == 7 ) { echo 'selected'; } ?> value="7">�����������</option>
                     </select>
-                     Д
+                     �
 					
 					 <select name="bot_sdd" id="bot_sdd">
-					   <option value="-1">&bull; День</option>
+					   <option value="-1">&bull; ����</option>
 					   <? $i = 0; while($i < 31) { $i++; ?>
 					   <option <? if( $monster['start_dd'] == $i ) { echo 'selected'; } ?> value="<?=$i?>">
 					     <?=$i?>
 				       </option>
 					   <? } ?>
 				      </select>
-                      М 
+                      � 
 					  <select name="bot_smm" id="bot_smm">
-                      <option value="-1">&bull; Месяц</option>
+                      <option value="-1">&bull; �����</option>
                         <? $i = 0; while($i < 12) { $i++; ?>
                         <option <? if( $monster['start_mm'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      Ч 
+                      � 
 					 <select name="bot_shh" id="bot_shh">
-                      <option value="-1">&bull; Час</option>
+                      <option value="-1">&bull; ���</option>
                         <? $i = -1; while($i < 23) { $i++; ?>
                         <option <? if( $monster['start_hh'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      Мин 
+                      ��� 
 					 <select name="bot_smin" id="bot_smin">
-                      <option value="-1">&bull; Мин</option>
+                      <option value="-1">&bull; ���</option>
                         <? $i = -1; while($i < 58) { $i++; ?>
                         <option <? if( $monster['start_min'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
@@ -1833,44 +1797,44 @@ $kp = array(
                   </td>
                 </tr>
                 <tr>
-                  <td>Исчезает, &nbsp; &nbsp;ДН 
+                  <td>��������, &nbsp; &nbsp;�� 
                       <select name="bot_bday" id="bot_bday">
-                        <option value="-1">&bull; День недели</option>
-                        <option <? if( $monster['back_day'] == 1 ) { echo 'selected'; } ?> value="1">Понедельник</option>
-                        <option <? if( $monster['back_day'] == 2 ) { echo 'selected'; } ?> value="2">Вторник</option>
-                        <option <? if( $monster['back_day'] == 3 ) { echo 'selected'; } ?> value="3">Среда</option>
-                        <option <? if( $monster['back_day'] == 4 ) { echo 'selected'; } ?> value="4">Четверг</option>
-                        <option <? if( $monster['back_day'] == 5 ) { echo 'selected'; } ?> value="5">Пятница</option>
-                        <option <? if( $monster['back_day'] == 6 ) { echo 'selected'; } ?> value="6">Суббота</option>
-                        <option <? if( $monster['back_day'] == 7 ) { echo 'selected'; } ?> value="7">Воскресенье</option>
+                        <option value="-1">&bull; ���� ������</option>
+                        <option <? if( $monster['back_day'] == 1 ) { echo 'selected'; } ?> value="1">�����������</option>
+                        <option <? if( $monster['back_day'] == 2 ) { echo 'selected'; } ?> value="2">�������</option>
+                        <option <? if( $monster['back_day'] == 3 ) { echo 'selected'; } ?> value="3">�����</option>
+                        <option <? if( $monster['back_day'] == 4 ) { echo 'selected'; } ?> value="4">�������</option>
+                        <option <? if( $monster['back_day'] == 5 ) { echo 'selected'; } ?> value="5">�������</option>
+                        <option <? if( $monster['back_day'] == 6 ) { echo 'selected'; } ?> value="6">�������</option>
+                        <option <? if( $monster['back_day'] == 7 ) { echo 'selected'; } ?> value="7">�����������</option>
                     </select>
-                     Д
+                     �
 					
 					 <select name="bot_bdd" id="bot_bdd">
-					   <option value="-1">&bull; День</option>
+					   <option value="-1">&bull; ����</option>
 					   <? $i = 0; while($i < 31) { $i++; ?>
 					   <option <? if( $monster['back_dd'] == $i ) { echo 'selected'; } ?> value="<?=$i?>">
 					     <?=$i?>
 				       </option>
 					   <? } ?>
 			        </select>
-                      М 
+                      � 
 					  <select name="bot_bmm" id="bot_bmm">
-                      <option value="-1">&bull; Месяц</option>
+                      <option value="-1">&bull; �����</option>
                         <? $i = 0; while($i < 12) { $i++; ?>
                         <option <? if( $monster['back_mm'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      Ч 
+                      � 
 					 <select name="bot_bhh" id="bot_bhh">
-                      <option value="-1">&bull; Час</option>
+                      <option value="-1">&bull; ���</option>
                         <? $i = -1; while($i < 23) { $i++; ?>
                         <option <? if( $monster['back_hh'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
                     </select>
-                      Мин 
+                      ��� 
 					 <select name="bot_bmin" id="bot_bmin">
-                      <option value="-1">&bull; Мин</option>
+                      <option value="-1">&bull; ���</option>
                         <? $i = -1; while($i < 58) { $i++; ?>
                         <option <? if( $monster['back_min'] == $i ) { echo 'selected'; } ?> value="<?=$i?>"><?=$i?></option>
                         <? } ?>
@@ -1880,132 +1844,132 @@ $kp = array(
                   <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div></td>
                 </tr>
                 <tr>
-                  <td>Текст появления (Логин бота <b>{b}</b>, Логины игроков <b>{u}</b>):</td>
+                  <td>����� ��������� (����� ���� <b>{b}</b>, ������ ������� <b>{u}</b>):</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['start_text']?>" name="bot_stext" type="text" id="bot_stext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>Текст исчезновения:</td>
+                  <td>����� ������������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['back_text']?>" name="bot_btext" type="text" id="bot_btext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>Текст победы игрока:</td>
+                  <td>����� ������ ������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_text']?>" name="bot_wintext" type="text" id="bot_wintext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>Текст поражения игрока:</td>
+                  <td>����� ��������� ������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_text']?>" name="bot_losetext" type="text" id="bot_losetext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td>Текст ничьей:</td>
+                  <td>����� ������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['nich_text']?>" name="bot_nichtext" type="text" id="bot_nichtext" size="100" maxlength="250"></td>
                 </tr>
                 <tr>
-                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div>                    <b>Награда (победа игрока):</b></td>
+                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div>                    <b>������� (������ ������):</b></td>
                 </tr>
                 <tr>
-                  <td>Кр.: </td>
+                  <td>��.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_money1']?>" name="bot_winmoney1" type="text" id="bot_winmoney1" size="100" maxlength="17"></td>
                 </tr>
                 <tr>
-                  <td>Екр.: </td>
+                  <td>���.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_money2']?>" name="bot_winmoney2" type="text" id="bot_winmoney2" size="100" maxlength="10"></td>
                 </tr>
                 <tr>
-                  <td>Опыт (За 100% НР монстра): </td>
+                  <td>���� (�� 100% �� �������): </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_exp']?>" name="bot_winexp" type="text" id="bot_winexp" size="100" maxlength="17"></td>
                 </tr>
                 <tr>
-                  <td>Предметы (id@kolvo@data, ...):</td>
+                  <td>�������� (id@kolvo@data, ...):</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_itm']?>" name="bot_winitm" type="text" id="bot_winitm" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>Эффект:</td>
+                  <td>������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_eff']?>" name="bot_wineff" type="text" id="bot_wineff" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>Подвиги:</td>
+                  <td>�������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['win_ico']?>" name="bot_winico" type="text" id="bot_winico" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div><b>Награда (поражение игрока):</b></td>
+                  <td><div align="left" style="height:1px; width:300px; background-color:#999999; margin:3px;"></div><b>������� (��������� ������):</b></td>
                 </tr>
                 <tr>
-                  <td>Кр.: </td>
+                  <td>��.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_money1']?>" name="bot_losemoney1" type="text" id="bot_losemoney1" size="100" maxlength="10"></td>
                 </tr>
                 <tr>
-                  <td>Екр.: </td>
+                  <td>���.: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_money2']?>" name="bot_losemoney2" type="text" id="bot_losemoney2" size="100" maxlength="10"></td>
                 </tr>
                 <tr>
-                  <td>Опыт: </td>
+                  <td>����: </td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_exp']?>" name="bot_loseexp" type="text" id="bot_loseexp" size="100" maxlength="17"></td>
                 </tr>
                 <tr>
-                  <td>Предметы:</td>
+                  <td>��������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_itm']?>" name="bot_loseitm" type="text" id="bot_loseitm" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>Эффект:</td>
+                  <td>������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_eff']?>" name="bot_loseeff" type="text" id="bot_loseeff" size="100" maxlength="500"></td>
                 </tr>
                 <tr>
-                  <td>Подвиги:</td>
+                  <td>�������:</td>
                 </tr>
                 <tr>
                   <td><input value="<?=$monster['lose_ico']?>" name="bot_loseico" type="text" id="bot_loseico" size="100" maxlength="500"></td>
                 </tr>
             </table>
             <div style="padding-left:120px;">
-            	<input type="submit" value="Сохранить" />
+            	<input type="submit" value="���������" />
             </div>
             <br><br>
             </form>
 <div style="height:1px; width:300px; background-color:#999999; margin:3px;" align="center">
-<div onClick="location.href='/info/<?=$inf['id']?>'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>Скрыть</small></div>
+<div onClick="location.href='/info/<?=$inf['id']?>'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>������</small></div>
 </div>
 <?
 					}else{
 ?>
 <div style="height:1px; width:300px; background-color:#999999; margin:3px;" align="center">
-<div onClick="location.href='/info/<?=$inf['id']?>&emonster'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>Настройка монстра</small></div>
+<div onClick="location.href='/info/<?=$inf['id']?>&emonster'" style="border:1px solid #999999; cursor:pointer; background-color:#EAEAEA; width:150px;" align="center"><small>��������� �������</small></div>
 </div>
 <?
 					}
 				}
-				//темные делишки :D
+				//������ ������� :D
 				if($inf['id'] == 1 || $inf['id'] == 15 ) {
 					
 				}elseif($inf['no_ip'] != 'trupojor' && (($u->info['align']>=1.1 && $u->info['align']<=1.99 && $inf['admin']<1) || ($u->info['align']>=3.05 && $u->info['align']<=3.99 && $inf['admin']<1) || $u->info['admin']>0 || $u->info['nadmin']>0)) 
@@ -2040,16 +2004,16 @@ $kp = array(
 					}
 					
 					if($nopal) {
-						//echo '<h3>Вы не можете просматривать информацию старшего по званию...</h3>';
+						//echo '<h3>�� �� ������ ������������� ���������� �������� �� ������...</h3>';
 					} elseif ($u->info['admin']==0 && (($u->info['admin']==0 && (floor($u->info['align'])==1 && $inf['align']>=3.01 && $inf['align']<=3.99) || (floor($u->info['align'])==3 && $inf['align']>=1.1 && $inf['align']<=1.99)) || ($u->info['admin']==0 && $inf['admin']>0)))  
 					{
-						echo '<h3>Персонаж носит вражескую склонность...</h3>';
+						echo '<h3>�������� ����� ��������� ����������...</h3>';
 					}else{
-						echo '<br /><br /><div style="color:#828282;">За игроком замечены следующие темные делишки:<br /><small><span class=dsc>';
+						echo '<br /><br /><div style="color:#828282;">�� ������� �������� ��������� ������ �������:<br /><small><span class=dsc>';
 						if(!isset($_GET['mod_inf'])) {
-							echo '<a href="/info/'.$inf['id'].'&mod_inf">Показать личное дело</a>';
+							echo '<a href="/info/'.$inf['id'].'&mod_inf">�������� ������ ����</a>';
 						}else{
-							//Личное дело персонажа
+							//������ ���� ���������
 							$log = mysql_query('SELECT * FROM `users_delo` WHERE `uid`="'.$inf['id'].'" AND `type`="0" ORDER by `id` DESC LIMIT 21');
 							$i = 0;
 							while ($log_w = mysql_fetch_array($log))
@@ -2057,25 +2021,25 @@ $kp = array(
 								echo ''.date("d.m.Y H:i:s",$log_w['time']).'&nbsp;'.$log_w['text'].' <br />';
 								$i++;
 							}
-							echo '<a href="/info/'.$inf['id'].'">Скрыть личное дело</a>';
+							echo '<a href="/info/'.$inf['id'].'">������ ������ ����</a>';
 						}
 						echo '</small><br>';
-						//Информация для паладинов\тарманов\ангелов
+						//���������� ��� ���������\��������\�������
 						if(($u->info['align']>=1.4 && $u->info['align']<=1.99 && $u->info['align']!=1.6 && $u->info['align']!=1.75 && $inf['admin']<1) || ($u->info['align']>=3.05 && $u->info['align']<=3.99 && $u->info['align']!=3.06 && $inf['admin']<1) || $u->info['admin']>0) 
 						{
 							if ((int)$u->info['align']==1) 
 							{ 
-								$rang = 'Паладинов'; 
+								$rang = '���������'; 
 							} elseif ((int)$u->info['align']==3) 
 							{
-								$rang = 'Тарманов'; 
+								$rang = '��������'; 
 							} else 
 							{ 
-								$rang = 'Ангелов'; 
+								$rang = '�������'; 
 							}					
 
 							if($u->info['admin'] == 1) {
-							  echo 'Комната: '.$inf['room'].'<br />';
+							  echo '�������: '.$inf['room'].'<br />';
 							}
 							if((int)$inf['host_reg'] >= 1){
 								$inf['ref'] = $u->microLogin((int)$inf['host_reg'],1);
@@ -2085,11 +2049,11 @@ $kp = array(
 							if(!isset($inf['ipReg'])){ $inf['ipReg'] = '--'; }	
 							echo '
 							<br />
-							<b style="color:red"><u>Только для '.$rang.'</u></b><br />
-							<i>День рождения: '.$inf['bithday'].'<br />';
+							<b style="color:red"><u>������ ��� '.$rang.'</u></b><br />
+							<i>���� ��������: '.$inf['bithday'].'<br />';
 							
 							if($inf['vip']==1) {
-								echo '<font color=red><b>VIP персонаж</font></b><br>';
+								echo '<font color=red><b>VIP ��������</font></b><br>';
 							}
 							
 							if($u->info['admin'] > 0) {
@@ -2099,7 +2063,7 @@ $kp = array(
 								  
 								  $mls = mysql_fetch_array(mysql_query('SELECT * FROM `users_rbk` WHERE `email` = "'.mysql_real_escape_string($inf['mail']).'" LIMIT 1'));
 								  if(isset($mls['name'])) {
-									 echo '<u>E-mail: '.$inf['mail'].'</u> (РАССЫЛКА)'; 
+									 echo '<u>E-mail: '.$inf['mail'].'</u> (��������)'; 
 								  }else{
 									 echo 'E-mail: '.$inf['mail'].'';
 								  }
@@ -2111,9 +2075,9 @@ $kp = array(
 								  }
 							}else{
 								  if( $inf['activ'] == 0 ) {
-									 echo '<font color=green><b>Персонаж активирован</b></font>';  
+									 echo '<font color=green><b>�������� �����������</b></font>';  
 								  }else{
-									 echo '<font color=red><b>Персонаж не активирован</b></font>'; 
+									 echo '<font color=red><b>�������� �� �����������</b></font>'; 
 								  }
 								  echo '<br>';
 							}
@@ -2121,50 +2085,50 @@ $kp = array(
 								$inf['ipReg'] = $inf['no_ip'];
 								$inf['ip'] = $inf['no_ip'];
 							}
-							echo 'Персонажа пригласили: '.$inf['ref'].'<br />
-							Последний раз заходил в клуб: '.date('d.m.Y H:i',$inf['online']).'<br />
-							'.$pr['login'].'IP при регистрации: '.$inf['ipReg'].'<br />';
+							echo '��������� ����������: '.$inf['ref'].'<br />
+							��������� ��� ������� � ����: '.date('d.m.Y H:i',$inf['online']).'<br />
+							'.$pr['login'].'IP ��� �����������: '.$inf['ipReg'].'<br />';
 							if($inf['no_ip'] == '' || $u->info['admin']>0) {
-								echo 'IP последние: <b>'.$inf['ip'].'</b>';
+								echo 'IP ���������: <b>'.$inf['ip'].'</b>';
 								$auth = mysql_query('SELECT * FROM `logs_auth` WHERE `uid`="'.$inf['id'].'" AND `type`="1" ORDER by `id` DESC LIMIT 10');
 								$country = '';
 								while ($auth_w = mysql_fetch_array($auth)) {
 									echo '<br />'.$auth_w['ip'].' <small><b>('.date('d.m.Y H:i',$auth_w['time']).')</b></small>';
 								}
 							}else{
-								echo 'IP последние: <b>'.$inf['no_ip'].'</b>';
+								echo 'IP ���������: <b>'.$inf['no_ip'].'</b>';
 							}
 							
 							
 function user_browser($agent) {
-	preg_match("/(MSIE|Opera|Firefox|Chrome|Version|Opera Mini|Netscape|Konqueror|SeaMonkey|Camino|Minefield|Iceweasel|K-Meleon|Maxthon)(?:\/| )([0-9.]+)/", $agent, $browser_info); // регулярное выражение, которое позволяет отпределить 90% браузеров
-        list(,$browser,$version) = $browser_info; // получаем данные из массива в переменную
-        if (preg_match("/Opera ([0-9.]+)/i", $agent, $opera)) return 'Opera '.$opera[1]; // определение _очень_старых_ версий Оперы (до 8.50), при желании можно убрать
-        if ($browser == 'MSIE') { // если браузер определён как IE
-                preg_match("/(Maxthon|Avant Browser|MyIE2)/i", $agent, $ie); // проверяем, не разработка ли это на основе IE
-                if ($ie) return $ie[1].' based on IE '.$version; // если да, то возвращаем сообщение об этом
-                return 'IE '.$version; // иначе просто возвращаем IE и номер версии
+	preg_match("/(MSIE|Opera|Firefox|Chrome|Version|Opera Mini|Netscape|Konqueror|SeaMonkey|Camino|Minefield|Iceweasel|K-Meleon|Maxthon)(?:\/| )([0-9.]+)/", $agent, $browser_info); // ���������� ���������, ������� ��������� ����������� 90% ���������
+        list(,$browser,$version) = $browser_info; // �������� ������ �� ������� � ����������
+        if (preg_match("/Opera ([0-9.]+)/i", $agent, $opera)) return 'Opera '.$opera[1]; // ����������� _�����_������_ ������ ����� (�� 8.50), ��� ������� ����� ������
+        if ($browser == 'MSIE') { // ���� ������� �������� ��� IE
+                preg_match("/(Maxthon|Avant Browser|MyIE2)/i", $agent, $ie); // ���������, �� ���������� �� ��� �� ������ IE
+                if ($ie) return $ie[1].' based on IE '.$version; // ���� ��, �� ���������� ��������� �� ����
+                return 'IE '.$version; // ����� ������ ���������� IE � ����� ������
         }
-        if ($browser == 'Firefox') { // если браузер определён как Firefox
-                preg_match("/(Flock|Navigator|Epiphany)\/([0-9.]+)/", $agent, $ff); // проверяем, не разработка ли это на основе Firefox
-                if ($ff) return $ff[1].' '.$ff[2]; // если да, то выводим номер и версию
+        if ($browser == 'Firefox') { // ���� ������� �������� ��� Firefox
+                preg_match("/(Flock|Navigator|Epiphany)\/([0-9.]+)/", $agent, $ff); // ���������, �� ���������� �� ��� �� ������ Firefox
+                if ($ff) return $ff[1].' '.$ff[2]; // ���� ��, �� ������� ����� � ������
         }
-        if ($browser == 'Opera' && $version == '9.80') return 'Opera '.substr($agent,-5); // если браузер определён как Opera 9.80, берём версию Оперы из конца строки
-        if ($browser == 'Version') return 'Safari '.$version; // определяем Сафари
-        if (!$browser && strpos($agent, 'Gecko')) return 'Browser based on Gecko'; // для неопознанных браузеров проверяем, если они на движке Gecko, и возращаем сообщение об этом
-        return $browser.' '.$version; // для всех остальных возвращаем браузер и версию
+        if ($browser == 'Opera' && $version == '9.80') return 'Opera '.substr($agent,-5); // ���� ������� �������� ��� Opera 9.80, ���� ������ ����� �� ����� ������
+        if ($browser == 'Version') return 'Safari '.$version; // ���������� ������
+        if (!$browser && strpos($agent, 'Gecko')) return 'Browser based on Gecko'; // ��� ������������ ��������� ���������, ���� ��� �� ������ Gecko, � ��������� ��������� �� ����
+        return $browser.' '.$version; // ��� ���� ��������� ���������� ������� � ������
 }
 							
 							
 							echo'
 							<br />
-							Браузер: <b style="color:#0E0F0E">'.user_browser($inf['dateEnter']).'</b><br />
+							�������: <b style="color:#0E0F0E">'.user_browser($inf['dateEnter']).'</b><br />
 							';
 														
 							if($inf['no_ip'] == '' || $u->info['admin']>0) {
 								if($mults!='' && $inf['admin']==0){
 									$mults = trim($mults,', ');
-									echo 'Другие ники этого бойца:  '.$mults.'<br />';
+									echo '������ ���� ����� �����:  '.$mults.'<br />';
 								}
 							}
 							
@@ -2173,29 +2137,29 @@ function user_browser($agent) {
 							
 							$sp = mysql_query('SELECT `id`,`login`,`ip`,`ipreg`,`timereg`,`online` FROM `users` WHERE `host_reg` = "'.$inf['id'].'" AND `activ` = "0" ORDER BY `timereg` DESC');
 							while( $pl = mysql_fetch_array($sp) ) {
-								$referalos .= '<br>Дата рег.: '.date('d.m.Y H:i',$pl['timereg']).' / Был тут: '.date('d.m.Y H:i',$pl['online']).' &nbsp; '.$u->microLogin($pl['id'],1).' <small>( '.$pl['ip'].' , '.$pl['ipreg'].' )</small>';
+								$referalos .= '<br>���� ���.: '.date('d.m.Y H:i',$pl['timereg']).' / ��� ���: '.date('d.m.Y H:i',$pl['online']).' &nbsp; '.$u->microLogin($pl['id'],1).' <small>( '.$pl['ip'].' , '.$pl['ipreg'].' )</small>';
 								$rfs++;
 							}
 							
 							if( $referalos == '' ) {
-								$referalos = '<i>Отсутствуют</i>';
+								$referalos = '<i>�����������</i>';
 							}
-							echo '<hr><b>Рефералы бойца:</b>'.$referalos.'<hr>';
+							echo '<hr><b>�������� �����:</b>'.$referalos.'<hr>';
 							if($u->info['admin']>0)
 							{
-								echo 'Доп. возможности: <small><a href="/info/'.$inf['id'].'&wipe&sd4='.$u->info['nextAct'].'">сбросить характеристики</a></small><br>';
+								echo '���. �����������: <small><a href="/info/'.$inf['id'].'&wipe&sd4='.$u->info['nextAct'].'">�������� ��������������</a></small><br>';
 								$on1 = mysql_fetch_array(mysql_query('SELECT `time_all`,`time_today` FROM `online` WHERE `uid` = "'.$inf['id'].'" LIMIT 1'));
-								echo 'Время в онлайне (всего): '.timeOut($on1['time_all']).'<br>Время в онлайне (сегодня): '.timeOut($on1['time_today']).'<br>';
+								echo '����� � ������� (�����): '.timeOut($on1['time_all']).'<br>����� � ������� (�������): '.timeOut($on1['time_today']).'<br>';
 							}	
 							if($inf['molch3']<time() && $inf['molch1'] > time())
 							{
-								echo '<small><a href="/info/'.$inf['id'].'&molchMax&sd4='.$u->info['nextAct'].'">Запретить персонажу отправлять сообщения с молчанкой</a></small><br>';
+								echo '<small><a href="/info/'.$inf['id'].'&molchMax&sd4='.$u->info['nextAct'].'">��������� ��������� ���������� ��������� � ���������</a></small><br>';
 							}
 							
 							echo'	
-							Опыт: '.$inf['exp'].' <br />
-							Число неиспользованных UP-ов: '.$inf['ability'].' <br />
-							<b>Кредитов:</b> '.$inf['money'].'<br><b>ЕвроКредитов:</b> '.$inf['money2'].'<br><b>Зубов:</b> <small>'.$u->zuby($inf['money4']).'</small>';
+							����: '.$inf['exp'].' <br />
+							����� ���������������� UP-��: '.$inf['ability'].' <br />
+							<b>��������:</b> '.$inf['money'].'<br><b>������������:</b> '.$inf['money2'].'<br><b>�����:</b> <small>'.$u->zuby($inf['money4']).'</small>';
 							$bnk = ''; $bmn1 = 0; $bmn2 = 0;
 							$sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "'.$inf['id'].'"');
 							while($pl = mysql_fetch_array($sp)) {
@@ -2204,31 +2168,31 @@ function user_browser($agent) {
 								}else{
 									$bnk .= '<div style="padding:5px;border-bottom:1px solid #AEAEAE">';
 								}
-								$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>№</small> '.$pl['id'].'</span>';
-								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money1'].' кр.</small></span>';
-								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money2'].' екр.</small></span>';
+								$bnk .= '&nbsp; &bull; <span style="display:inline-block;width:75px;"><small>�</small> '.$pl['id'].'</span>';
+								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money1'].' ��.</small></span>';
+								$bnk .= '<span style="display:inline-block;width:100px;"><small>'.$pl['money2'].' ���.</small></span>';
 								if($u->info['admin'] > 0) {
-									$bnk .= '<span style="display:inline-block;"><small>Пароль: '.htmlspecialchars($pl['pass'],NULL,'cp1251').'</small></span>';
+									$bnk .= '<span style="display:inline-block;"><small>������: '.htmlspecialchars($pl['pass'],NULL,'cp1251').'</small></span>';
 								}
 								if($pl['moneyBuy'] > 0) {
-								  $ds = '<b><i><u>Персонаж покупал еврокредиты</u></i></b>&nbsp;&nbsp;Сумма : '.$pl['moneyBuy'].'<br />';
+								  $ds = '<b><i><u>�������� ������� �����������</u></i></b>&nbsp;&nbsp;����� : '.$pl['moneyBuy'].'<br />';
 								}
 								$bmn1 += $pl['money1'];
 								$bmn2 += $pl['money2'];
 								$bnk .= '</div>';
 							}
 							$pk = mysql_fetch_array(mysql_query('SELECT SUM(`ekr`) FROM `pay_operation` WHERE `uid` = "'.$inf['id'].'" AND `good` > 0 LIMIT 1'));
-							echo '<br><b><i><u>Персонаж покупал еврокредиты</u></i></b>&nbsp;&nbsp;Сумма : '.$pk[0].' ЕКР<br />';
+							echo '<br><b><i><u>�������� ������� �����������</u></i></b>&nbsp;&nbsp;����� : '.$pk[0].' ���<br />';
 							if($bnk != '') {
-								echo '<br><b>Банковские счета:</b>'.$bnk.' &nbsp; <small><b>Деньги (Всего в банке):</b> &nbsp; '.$bmn1.' кр. &nbsp; &nbsp; '.$bmn2.' екр.</small><br/>'.$ds;
+								echo '<br><b>���������� �����:</b>'.$bnk.' &nbsp; <small><b>������ (����� � �����):</b> &nbsp; '.$bmn1.' ��. &nbsp; &nbsp; '.$bmn2.' ���.</small><br/>'.$ds;
 							}
 							if($u->info['admin']>0 && $inf['admin']>0) {
 								echo '<br><small>admin: '.$inf['admin'].'</small>';
 							}
 							if($inf['active']!=''){
-							echo '<br><font color=red>Внимание!Если персонаж не получает письма с активацией отправте ему письмо вручную.</red>';
+							echo '<br><font color=red>��������!���� �������� �� �������� ������ � ���������� �������� ��� ������ �������.</red>';
 							echo '<br><input type=text value="'.$inf['mail'].'">';
-							echo "<br><textarea cols=60 rows=5>Здравствуйте! Мы очень рады новому персонажу в нашем Мире! \r\n Ваш персонаж: ".$inf['login']."  \r\n Ссылка для активации: https://capitalcity.new-combats.com/bk?active=".$inf['active'].".\r\n\r\nС уважением, Администрация!</textarea><br>";
+							echo "<br><textarea cols=60 rows=5>������������! �� ����� ���� ������ ��������� � ����� ����! \r\n ��� ��������: ".$inf['login']."  \r\n ������ ��� ���������: https://capitalcity.new-combats.com/bk?active=".$inf['active'].".\r\n\r\n� ���������, �������������!</textarea><br>";
 							}
 							echo '</div>';
 						}
@@ -2239,7 +2203,7 @@ function user_browser($agent) {
         <div style="float:right">
         <table cellspacing=0 cellpadding=0>
           <tr>
-            <td width="111" style='text-align: center; padding-bottom: 18; '><!-- Зодиак -->
+            <td width="111" style='text-align: center; padding-bottom: 18; '><!-- ������ -->
                   <img width="100" height="99" title="<? echo $name_zodiak; ?>" style="margin-bottom: 25; padding:5px;" src='https://img.new-combats.com/i/zodiac/<? echo $id_zodiak; ?>.gif' border=0><BR>
                   <BR>
               	  
@@ -2247,16 +2211,16 @@ function user_browser($agent) {
                     
                     <? }elseif($inf['align']>1 && $inf['align']<2) { ?>
                   <A href='https://paladins.<? echo $c['host']; ?>/' target='_blank'><img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_light.gif' border=0></A><BR>
-                  <A href='https://paladins.<? echo $c['host']; ?>/' target='_blank'><small>Орден Света</small></A>
+                  <A href='https://paladins.<? echo $c['host']; ?>/' target='_blank'><small>����� �����</small></A>
                     <? }elseif($inf['align']>=3.01 && $inf['align']<=3.99) { ?>
                   <A target='_blank' href='https://tarmans.<? echo $c['host']; ?>/'><img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_dark.gif' border=0></A><BR>
-                  <A href='https://tarmans.<? echo $c['host']; ?>/' target='_blank'><small>Армада</small></A>
+                  <A href='https://tarmans.<? echo $c['host']; ?>/' target='_blank'><small>������</small></A>
                     <? }elseif($inf['align']>=2 && $inf['align']<3) { ?>
                   <A target='_blank' href='https://chaos.<? echo $c['host']; ?>/'><img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_haos.gif' border=0></A><BR>
-                  <A href='https://chaos.<? echo $c['host']; ?>/' target='_blank'><small>Цитадель Хаоса</small></A>
+                  <A href='https://chaos.<? echo $c['host']; ?>/' target='_blank'><small>�������� �����</small></A>
                     <? }else{ ?>
                   <A target='_blank' href='https://new-combats.com/news/'> <img width="100" height="97" style="padding:5px;" src='https://img.new-combats.com/i/flag_gray.gif'></a><BR>
-                  <A href='https://new-combats.com/news/' target='_blank'><small>Новости</small></A><br>
+                  <A href='https://new-combats.com/news/' target='_blank'><small>�������</small></A><br>
                     <? } ?>
             </td>
           </tr>
@@ -2276,13 +2240,13 @@ if( $u->info['align'] > 3 && $u->info['align'] < 4 ) {
 if($inf['level'] < 8 && $inf['admin'] == 0 && $u->info['admin'] == 0 && $moder == 0) {
 ?>
 <hr>
-<H3 align="center" style="color:#8f0000">Обезличен до достижения 8 уровня</H3>
+<H3 align="center" style="color:#8f0000">��������� �� ���������� 8 ������</H3>
 <?
 $inf['info_delete'] = time()+86400;
 }elseif($inf['info_delete']!=0)
 {
 ?>
-<H3 align="center" style="color:#8f0000">Персонаж обезличен <? if($inf['info_delete']>1){ echo 'до '.date('d.m.Y H:i',$inf['info_delete']).'.'; }else{ echo '.'; } ?></H3>
+<H3 align="center" style="color:#8f0000">�������� ��������� <? if($inf['info_delete']>1){ echo '�� '.date('d.m.Y H:i',$inf['info_delete']).'.'; }else{ echo '.'; } ?></H3>
 <?
 	if($u->info['align']>1 && $u->info['align']<2 || $u->info['align']>3 && $u->info['align']<4 || $u->info['admin']>0)
 	{
@@ -2294,25 +2258,25 @@ if($inf['info_delete']==0 || (($u->info['align']>1 && $u->info['align']<2) || ($
 ?> 
 <div style="line-height:11pt;"> 
 <hr style="border-color:#999999;">
-<? if($inf['info_delete']==0){ ?><H3 align="center" style="color:#8f0000">Анкетные данные</H3><? } ?>
+<? if($inf['info_delete']==0){ ?><H3 align="center" style="color:#8f0000">�������� ������</H3><? } ?>
 <?
 if($inf['name'] != '') {
 ?>
-<b style="color:#444">Имя:</b> <? echo $inf['name']; ?><BR><? } ?>
-<b style="color:#444">Пол:</b>
-<? $sex[0] = 'Мужской'; $sex[1] = 'Женский'; echo $sex[$inf['sex']]; ?><BR>
+<b style="color:#444">���:</b> <? echo $inf['name']; ?><BR><? } ?>
+<b style="color:#444">���:</b>
+<? $sex[0] = '�������'; $sex[1] = '�������'; echo $sex[$inf['sex']]; ?><BR>
 <? if($inf['city_real']!=''){ ?>
-<b style="color:#444">Город:</b> <? echo $inf['city_real']; ?><BR><? } ?>
+<b style="color:#444">�����:</b> <? echo $inf['city_real']; ?><BR><? } ?>
 <? if($inf['icq']>0 && $inf['icq_hide']==0){ echo '<b>ICQ:</b> '.$inf['icq'].'<br>'; } ?>
 <? if($inf['skype']!='' && $inf['skype_hide']==0){ echo '<b>Skype:</b> '.$inf['skype'].'<br>'; } ?>
 <? if(isset($inf['homepage']) && $inf['homepage']!='' && $inf['level']>4) { 
 $url = ((substr($inf['homepage'],0,4)=='https'?"":"https://").$inf['homepage']);
 ?>
-<b style="color:#444">Домашняя страница:</b> <A HREF="<? echo $url; ?>" target="_blank"><? echo $url; ?></A><BR> <? } ?>
+<b style="color:#444">�������� ��������:</b> <A HREF="<? echo $url; ?>" target="_blank"><? echo $url; ?></A><BR> <? } ?>
 <? if($inf['deviz']!=''){ ?>
-<b style="color:#444">Девиз:</b> <code><? echo $inf['deviz']; ?></code><BR>  <? } ?>
+<b style="color:#444">�����:</b> <code><? echo $inf['deviz']; ?></code><BR>  <? } ?>
 <? if($inf['hobby']!=''){ ?>  
-<b style="color:#444">Увлечения / хобби:</b><BR>
+<b style="color:#444">��������� / �����:</b><BR>
 <? 
 		echo str_replace("\n",'<br>',$inf['hobby']); 
 	}
@@ -2325,7 +2289,7 @@ echo '<br><br><div align="right">'.$c['counters_noFrm'].'</div>';
 ?>
 </div>
 <div align="right"><br>
-<!-- ЛегБК &copy; <?=date('Y')?>, «www.new-combats.com» &nbsp; &nbsp; --></div>
+<!-- ����� &copy; <?=date('Y')?>, �www.new-combats.com� &nbsp; &nbsp; --></div>
 <br /><br />
 </body>
 </html>
diff --git a/items_info.php b/items_info.php
index be05d378..f27850fa 100644
--- a/items_info.php
+++ b/items_info.php
@@ -1,7 +1,7 @@
 <?php
 define('GAME',time());
 
-include('_incl_data/class/__db_connect.php');
+require_once('_incl_data/class/__db_connect.php');
 if (isset($_COOKIE['login']))
 {
 $u = mysql_fetch_array(mysql_query('SELECT `id`,`admin` FROM `users` WHERE `login` = "'.mysql_real_escape_string($_COOKIE['login']).'" AND `pass` = "'.mysql_real_escape_string($_COOKIE['pass']).'" LIMIT 1'));
@@ -196,7 +196,7 @@ $items = array(
 					
 $is = array('oza'=>'������ �� �����','oza1'=>'������ �� �������� �����','oza2'=>'������ �� �������� �����','oza3'=>'������ �� ��������� �����','oza4'=>'������ �� �������� �����','hpAll'=>'������� ����� (HP)','mpAll'=>'������� ����','sex'=>'���','lvl'=>'�������','s1'=>'����','s2'=>'��������','s3'=>'��������','s4'=>'������������','s5'=>'��������','s6'=>'��������','s7'=>'����������','s8'=>'����','s9'=>'������� ����','s10'=>'��������������','m1'=>'��. ������������ ����� (%)','m2'=>'��. ������ ������������ ����� (%)','m3'=>'��. �������� ������������ ����� (%)','m4'=>'��. ����������� (%)','m5'=>'��. ������ ����������� (%)','m6'=>'��. ���������� (%)','m7'=>'��. ����������� (%)','m8'=>'��. ����� ����� (%)','m9'=>'��. ������ ����� (%)','m14'=>'��. ���. ������������ ����� (%)','m15'=>'��. ���. ����������� (%)','m16'=>'��. ���. ����������� (%)','m17'=>'��. ���. ���������� (%)','m18'=>'��. ���. ����� ����� (%)','m19'=>'��. ���. ���������� ������ (%)','m20'=>'��. ����� (%)','m21'=>'��. ���. ��������� (%)','a1'=>'���������� �������� ������, ���������','a2'=>'���������� �������� ��������, ��������','a3'=>'���������� �������� ��������, ��������','a4'=>'���������� �������� ������','a5'=>'���������� �������� ����������� ��������','a6'=>'���������� �������� ������','a7'=>'���������� �������� ����������','aall'=>'���������� �������� �������','mall'=>'���������� �������� ������ ������','m2all'=>'���������� �������� ������','mg1'=>'���������� �������� ������ ����','mg2'=>'���������� �������� ������ �������','mg3'=>'���������� �������� ������ ����','mg4'=>'���������� �������� ������ �����','mg5'=>'���������� �������� ������ �����','mg6'=>'���������� �������� ������ ����','mg7'=>'���������� �������� ����� ������','tj'=>'������� �����','lh'=>'������ �����','minAtack'=>'����������� ����','maxAtack'=>'������������ ����','m10'=>'��. �������� �����','m11'=>'��. �������� ����� ������','m11a'=>'��. �������� �����','pa1'=>'��. �������� �������� �����','pa2'=>'��. �������� �������� �����','pa3'=>'��. �������� �������� �����','pa4'=>'��. �������� ������� �����','pm1'=>'��. �������� ����� ����','pm2'=>'��. �������� ����� �������','pm3'=>'��. �������� ����� ����','pm4'=>'��. �������� ����� �����','pm5'=>'��. �������� ����� �����','pm6'=>'��. �������� ����� ����','pm7'=>'��. �������� ����� �����','za'=>'������ �� �����','zm'=>'������ �� ����� ������','zma'=>'������ �� �����','za1'=>'������ �� �������� �����','za2'=>'������ �� �������� �����','za3'=>'������ �� �������� �����','za4'=>'������ �� ������� �����','zm1'=>'������ �� ����� ����','zm2'=>'������ �� ����� �������','zm3'=>'������ �� ����� ����','zm4'=>'������ �� ����� �����','zm5'=>'������ �� ����� �����','zm6'=>'������ �� ����� ����','zm7'=>'������ �� ����� �����','pza'=>'��������� ������ �� �����','pzm'=>'��������� ������ �� �����','pza1'=>'��������� ������ �� �������� �����','min_heal_proc'=>'������ ������� (%)','silver'=>'�������','notravma'=>'������ �� �����','yron_min'=>'����������� ����','yron_max'=>'������������ ����','pza2'=>'��������� ������ �� �������� �����','pza3'=>'��������� ������ �� ��������� �����','pza4'=>'��������� ������ �� �������� �����','pzm1'=>'��������� ������ �� ����� ����','pzm2'=>'��������� ������ �� ����� �������','pzm3'=>'��������� ������ �� ����� ����','pzm4'=>'��������� ������ �� ����� �����','pzm5'=>'��������� ������ �� ����� �����','pzm6'=>'��������� ������ �� ����� ����','pzm7'=>'��������� ������ �� ����� �����','speedhp'=>'����������� �������� (��)','speedmp'=>'����������� ���� (��)','tya1'=>'������� �����','tya2'=>'������� �����','tya3'=>'�������� �����','tya4'=>'������� �����','tym1'=>'�������� �����','tym2'=>'������������� �����','tym3'=>'������� �����','tym4'=>'�������� �����','tym5'=>'����� �����','tym6'=>'����� ����','tym7'=>'����� �����','min_use_mp'=>'��������� ������ ����','pog'=>'���������� �����','maxves'=>'����������� ������','zona'=>'�������������� ���� �����','zaproc'=>'���������� ����������� �����(%)','zmproc'=>'���������� ����������� ����� (%)','speed_dungeon'=>'�������� ����������� �� �������','free_stats'=>'��������� �������������','antm3'=>'��. ������ �������� ����. �����');
  
-if( !file_exists('.../img.new-combats.com/i/encicl/pict_'.$rz[$rt[$itm['type']]][0].'.jpg') == true ) {
+if( !file_exists('img.new-combats.com/i/encicl/pict_'.$rz[$rt[$itm['type']]][0].'.jpg') == true ) {
 	//subject
 	$rz[$rt[$itm['type']]][0] = 'subject';
 }
@@ -272,7 +272,7 @@ document.write('<table cellspacing=0 cellpadding=0 bgcolor=#f2e5b1 border=0 widt
       <h2><?=$itm['name']?></h2>
       <img src="https://img.new-combats.com/i/encicl/ln3.jpg" width="400" height="1">
       </p>
-    <? if( $img3dShow==false && (file_exists('../img.new-combats.com/i/big/3d'.str_replace('.gif','',str_replace('.png','',$itm['img'])).'.jpg') == true) OR $img3dShow==true ) { ?>  
+    <? if( $img3dShow==false && (file_exists('img.new-combats.com/i/big/3d'.str_replace('.gif','',str_replace('.png','',$itm['img'])).'.jpg') == true) OR $img3dShow==true ) { ?>  
 	<div align="center"> 
         <table width="504"  border="0" cellspacing="0" cellpadding="0">
           <tr>
@@ -282,7 +282,7 @@ document.write('<table cellspacing=0 cellpadding=0 bgcolor=#f2e5b1 border=0 widt
           </tr>
           <tr>
             <td width="12" background="https://img.new-combats.com/i/encicl/line_left_13.gif">&nbsp;</td>
-            <td width="480"><img style="display:block" src="<? if( file_exists('../img.new-combats.com/i/big/3d'.str_replace('.gif','',str_replace('.png','',$itm['img'])).'.jpg') == true ) { ?>https://img.new-combats.com/i/big/3d<?=str_replace('.gif','',str_replace('.png','',$itm['img']))?>.jpg<? }else{ ?>https://img.new-combats.com/i/big/back.jpg<? } ?>" alt="" width="480" height="360" border=1 id="bigim"></td>
+            <td width="480"><img style="display:block" src="<? if( file_exists('img.new-combats.com/i/big/3d'.str_replace('.gif','',str_replace('.png','',$itm['img'])).'.jpg') == true ) { ?>https://img.new-combats.com/i/big/3d<?=str_replace('.gif','',str_replace('.png','',$itm['img']))?>.jpg<? }else{ ?>https://img.new-combats.com/i/big/back.jpg<? } ?>" alt="" width="480" height="360" border=1 id="bigim"></td>
             <td width="12" background="https://img.new-combats.com/i/encicl/line_right_13.gif">&nbsp;</td>
           </tr>
           <tr>
diff --git a/jx/battle/refresh2.php b/jx/battle/refresh2.php
index 84109247..dc1557ef 100644
--- a/jx/battle/refresh2.php
+++ b/jx/battle/refresh2.php
@@ -30,10 +30,6 @@
 		
 		unset($tm);		
 		$js = '';
-		//require_once('../../_incl_data/class/__user.php');
-		//require_once('../../_incl_data/class/__magic.php');
-		//require_once('../../_incl_data/class/_cron_.php');
-		//require_once('../../_incl_data/class/__quest.php');
 		
 		if( $u->info['battle'] == 0 ) {
 			$btl_last = mysql_fetch_array(mysql_query('SELECT `id`,`battle` FROM `battle_users` WHERE `uid` = "'.$u->info['id'].'" AND `finish` = "0" LIMIT 1'));
diff --git a/modules_data/location/__magic.php b/modules_data/location/__magic.php
deleted file mode 100644
index 48cda198..00000000
--- a/modules_data/location/__magic.php
+++ /dev/null
@@ -1,2306 +0,0 @@
-<?php
-if(!defined('GAME'))
-{
-	die();
-}
-
-if(isset($_POST['useitemon'])) {
-	$_GET['login'] = $_POST['useitemon'];
-}
-
-class Magic {
-	
-	public $youuse = 0;
-	public $c_magic = array(4174, 4175, 4176, 4177, 4178, 4179, 4180);
-    public $e_magic = array(4185, 4186, 4187);
-	//���������� ����� ���
-	public function oslablenie($uid)
-	{
-		$ins = mysql_query('INSERT INTO `eff_users` (`id_eff`,`uid`,`name`,`data`,`timeUse`,`no_Ace`) VALUES ("5","'.$uid.'","���������� ����� ���","add_m10=-1000|add_m11=-1000","'.(time()-600+( 60 * 3 )).'",1)');
-		if($ins)
-		{
-			return true;
-		}else{
-			return false;
-		}
-	}
-	
-	//����������� (��������� ������ ����������� � �������� ��������� ����� �������)
-	public $pgtype = array(
-		//����������� �� ����
-		1	=> 1, //����� ����������
-		264	=> 1, //�������� ��������
-		306 => 1, //������ ��������
-		383 => 1, //���������
-		
-		//����������� �� ��������
-		8	=> 2,
-		265	=> 2,
-		308 => 2, //������ ����
-		385 => 2, //���������
-		
-		//����������� �� ��������
-		7	=> 3,
-		266	=> 3,
-		307 => 3, //������ ������������
-		384 => 3, //���������
-		
-		//����������� �� ���������
-		9	=> 4,
-		267	=> 4,
-		309 => 4, //������ ������
-		333 => 4,
-		405 => 4, //���������
-		
-		//����������� �� ������ �� �����
-		14	=> 5,
-		27	=> 5,
-		37	=> 5,
-		361	=> 5,
-		
-		//����������� �� ������ �� �������� �����
-		10 => 6,
-		//����������� �� ������ �� �������� �����
-		12 => 7,
-		//����������� �� ������ �� ��������� �����
-		13 => 8,
-		//����������� �� ������ �� �������� �����
-		11 => 9,
-		
-		//����������� �� ������ �� �����
-		28	=> 10,
-		38	=> 10,
-		362	=> 10,
-		369 => 10,
-		
-		//����������� �� ������ �� ����
-		272 => 11,
-		370 => 11,
-		//����������� �� ������ �� ����
-		334 => 12,
-		275 => 12,
-		372 => 12,
-		//����������� �� ������ �� �������
-		274 => 13,
-		373 => 13,
-		//����������� �� ������ �� �����
-		273 => 14,
-		374 => 14,
-		
-		//�������������� ��������
-		268 => 15,
-		//�������������� ����
-		300 => 16,
-		
-		10000000000000 => 0
-	);
-	
-	//����������� (��������� ������)
-	public $pgtype_second = array(		
-		//����������� �� ������ �� �����
-		14	=> array(6,7,8,9),
-		27	=> array(6,7,8,9),
-		37	=> array(6,7,8,9),
-		361	=> array(6,7,8,9),
-		
-		//����������� �� ������ �� �������� �����
-		10 => array(5,7,8,9),
-		//����������� �� ������ �� �������� �����
-		12 => array(6,5,8,9),
-		//����������� �� ������ �� ��������� �����
-		13 => array(6,7,5,9),
-		//����������� �� ������ �� �������� �����
-		11 => array(6,7,8,5),
-		
-		//����������� �� ������ �� �����
-		//28	=> 10,
-		//38	=> 10,
-		
-		//����������� �� ������ �� ����
-		272 => array( 10 , 11 , 12 , 13 , 14 ),
-		370 => array( 10 , 11 , 12 , 13 , 14 ),
-		//����������� �� ������ �� ����
-		334 => array( 10 , 11 , 12 , 13 , 14 ),
-		275 => array( 10 , 11 , 12 , 13 , 14 ),
-		372 => array( 10 , 11 , 12 , 13 , 14 ),
-		//����������� �� ������ �� �������
-		274 => array( 10 , 11 , 12 , 13 , 14 ),
-		373 => array( 10 , 11 , 12 , 13 , 14 ),
-		//����������� �� ������ �� �����
-		273 => array( 10 , 11 , 12 , 13 , 14 ),
-		374 => array( 10 , 11 , 12 , 13 , 14 ),
-		
-		//�������������� ��������
-		//268 => 15,
-		//�������������� ����
-		//300 => 16,
-		
-		10000000000000 => 0
-	);
-	
-	//��������� �����������
-	//�������� , ������������ ������� , ���������� ������ , ������� ������� ������ ������ ������� � ������ , ��� ����������� ���������
-	public $pgpar = array(
-		1 => array('����', 25, 29, 1.2, 's1', 301),
-		2 => array('��������', 25, 29, 1.2, 's2', 302),
-		3 => array('��������', 25, 29, 1.2, 's3', 303),
-		4 => array('���������', 25, 29, 1.2, 's5', 304),
-		
-		5 => array('������ �� �����', 25, 175, 1.2, 'za', 321),		
-		6 => array('������ �� �������� �����', 25, 98, 1.2, 'za1', 322),
-		7 => array('������ �� �������� �����', 25, 98, 1.2, 'za2', 323),
-		8 => array('������ �� ��������� �����', 25, 98, 1.2, 'za3', 324),
-		9 => array('������ �� �������� �����', 25, 98, 1.2, 'za4', 325),
-		
-		10 => array('������ �� �����', 25, 175, 1.2, 'zm', 326),		
-		11 => array('������ �� ����� ����', 25, 98, 1.2, 'zm1', 327),
-		12 => array('������ �� ����� ����', 25, 98, 1.2, 'zm3', 328),
-		13 => array('������ �� ����� �������', 25, 98, 1.2, 'zm2', 329),
-		14 => array('������ �� ����� �����', 25, 98, 1.2, 'zm4', 330),
-		
-		15 => array('�������������� HP', 25, 294, 1.2, 'speedhp', 331),
-		16 => array('�������������� MP', 25, 294, 1.2, 'speedmp', 332)
-	);
-	
-	//�������� ����� ��� ������������
-	public $pgel = array(
-		//����
-		1	=> array(5), //����� ����������
-		264	=> array(7),  //�������� ��������
-		306 => array(7),
-		383 => array(6),
-		//��������
-		8	=> array(5),
-		265	=> array(7),
-		308 => array(7),
-		385 => array(6),
-		//��������
-		7	=> array(5),
-		266	=> array(7),
-		307 => array(7),
-		384 => array(6),
-		//���������
-		9	=> array(5),
-		267	=> array(7),
-		309 => array(7),
-		333 => array(5),
-		405 => array(6),
-		//������ �� �����
-		14	=> array(12),
-		27	=> array(18),
-		37	=> array(25),
-		361 => array(45),
-		//������ �� �������� �����
-		10	=> array(12),
-		//������ �� �������� �����
-		11	=> array(12),
-		//������ �� �������� �����
-		12	=> array(12),
-		//������ �� ��������� �����
-		13	=> array(12),
-		//������ �� �����
-		369 => array(8),
-		28	=> array(18),
-		38	=> array(25),
-		362	=> array(45),
-		
-		//������ �� ����� ����
-		334 => array(18), //�������� �������
-		//
-		272 => array(12),
-		273 => array(12),
-		274 => array(12),
-		275 => array(12),
-		//
-		370 => array(20),
-		372 => array(20),
-		373 => array(20),
-		374 => array(20),
-		//
-		//�������������� ��
-		268 => array(75),
-		//�������������� ��
-		300 => array(75)
-	);
-	
-	//�������� ������� �����������
-	public $elrazgon = array( 405 => true , 383 => true , 384 => true , 385 => true );
-	
-	public function paguba( $eff ) {
-		//global $u;	
-		if(isset($this->pgtype[$eff['id2']])) {
-			global $u;
-			$re = '';
-			
-			$tp = $this->pgtype[$eff['id2']];
-			$tp_sec = $this->pgtype_second[$eff['id2']];
-			$v = $this->pgpar[$tp];
-			$el = $this->pgel[$eff['id2']];
-			$pgb = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "pgb'.$tp.'" AND `delete` = "0" AND `uid` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));	
-			if( is_array($tp_sec) ) {
-				$i = 0;
-				while( $i < count($tp_sec) ) {
-					if( $tp_sec[$i] > 0 ) {
-						$pgb_ref = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "pgb'.$tp_sec[$i].'" AND `delete` = "0" AND `uid` = "'.$u->info['id'].'" ORDER BY `id` DESC LIMIT 1'));	
-						if( isset($pgb_ref['id']) ) {
-							$lvl = explode('[',$pgb['name']); 
-							$lvl = explode(']',$lvl[1]);
-							$lvl = $lvl[0];
-							mysql_query('UPDATE `eff_users` SET `deactiveTime` = "'.(time()+$eff['actionTime']).'", `timeUse` = "'.(time()+floor($lvl*$this->pgpar[$tp_sec[$i]][3]*86400)).'" WHERE `id` = "'.$pgb_ref['id'].'" LIMIT 1');
-						}
-					}
-					$i++;
-				}
-				unset($pgb_ref,$i);
-			}
-			if(!isset($pgb['id'])) {
-				//����������� ���, �� ��� ����� ���������, ���� 10%
-				$prc11 = 5;
-				if( $this->elrazgon[$eff['id2']] == true ) {
-					$prc11 = 101;
-				}
-				if(rand(0,100) < $prc11) {
-					//��������� �����������
-					$d = 'add_'.$v[4].'=-'.ceil($v[2]/$v[1]*1);
-					mysql_query('INSERT INTO `eff_users` (`v1`,`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`,`deactiveTime`) VALUES ("pgb'.$tp.'","0","'.$v[5].'","'.$u->info['id'].'","�������� ����������� [1]","'.(time()+floor($v[3]*86400)).'","'.$d.'","0","'.(time()+$eff['actionTime']).'")');
-				}
-			}else{
-				$lvl = explode('[',$pgb['name']); 
-				$lvl = explode(']',$lvl[1]);
-				$lvl = $lvl[0]; 
-				$prc11 = 7;
-				if( $this->elrazgon[$eff['id2']] == true ) {
-					$prc11 = 101;
-				}
-				//����������� ���� � �������� �������� ��� ������� 5% , ���� ������ 75% ������� ��������
-				if(rand(0,100)  < $prc11 && $lvl < $v[1]) {
-					//��������� ����� �����������
-					$lvl++;
-					$d = 'add_'.$v[4].'=-'.ceil($v[2]/$v[1]*$lvl);
-					mysql_query('DELETE FROM `eff_users` WHERE `id` = "'.$pgb['id'].'" LIMIT 1');
-					mysql_query('INSERT INTO `eff_users` (`v1`,`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`,`deactiveTime`) VALUES ("pgb'.$tp.'","0","'.$v[5].'","'.$u->info['id'].'","�������� ����������� ['.$lvl.']","'.(time()+floor($lvl*$v[3]*86400)).'","'.$d.'","0","'.(time()+$eff['actionTime']).'")');
-					$pgb = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `v1` = "pgb'.$tp.'" AND `delete` = "0" AND `uid` = "'.$u->info['id'].'" RODER BY `id` DESC LIMIT 1'));			
-				}else{
-					//��������� ����� �����������
-					mysql_query('UPDATE `eff_users` SET `deactiveTime` = "'.(time()+$eff['actionTime']).'", `timeUse` = "'.(time()+floor($lvl*$v[3]*86400)).'" WHERE `id` = "'.$pgb['id'].'" LIMIT 1');
-				}
-				
-				
-				//�������������� ������ �����������
-				$eff['mdata'] = $u->lookStats($eff['mdata']);
-				$eff['mdata']['add_'.$v[4]] += floor($el[0]/$v[1]*$lvl);
-				$eff['mdata'] = $u->impStats($eff['mdata']);
-			}
-		}
-		return $eff;
-	}
-
-
-
-
-
-	public function inBattleLog($txt,$usr) {
-		global $u;
-		$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-		if(isset($lastHOD['id'])) {
-			$id_hod = $lastHOD['id_hod'];
-			if($lastHOD['type']!=6) {
-				$id_hod++;
-			}
-			mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-		}
-	}
-
-
-	
-	//������������� ��������
-	public function useItems($id)
-	{
-		global $u, $c, $code, $btl, $e_magic, $c_magic;
-				
-		$itm = mysql_fetch_array(mysql_query('SELECT `iu`.`id` AS `iuid`,`im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid` = "'.$u->info['id'].'" AND `iu`.`inShop`="0" AND `iu`.`delete`="0" AND `iu`.`id` = "'.mysql_real_escape_string((int)$id).'" LIMIT 1'));
-		$bs_is = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$u->info['inTurnir'].'" LIMIT 1'));
-        if(isset($itm['id']))
-		{
-			
-			if($itm['group'] == 1) {
-				//������ ���������
-				if($u->itemsX($itm['id'])>1) {
-					//����������� ������� �� ������
-					$u->unstack($itm['id'],1);
-					/*$itm = mysql_fetch_array(mysql_query('SELECT `iu`.`id` AS `iuid`,`im`.*, `iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`delete`="1000" AND `iu`.`inGroup` = "'.$itm['id'].'" LIMIT 1'));
-					if(!isset($itm['id'])) {
-						$this->error = '������ ��������� ��������...';
-					}else{
-						$itm['delete'] = 0;
-					}*/
-				}
-			}
-			
-			$st = $u->lookStats($itm['data']);
-
-			if($itm['magic_chance'] > 0 && $itm['magic_chance'] < 100) {
-			  $itm['magic_chance'] += floor($u->stats['s5']*3);
-			  if($itm['magic_chance'] >= 99) { $itm['magic_chance'] = 99; }
-			}
-            if(isset($bs_is['id'])) {
-              if(in_array($itm['item_id'], $e_magic) || in_array($itm['item_id'], $c_magic)) {
-                $itm['magic_chance'] += $bs_is['users'];
-                if($itm['magic_chance'] >= 99) { $itm['magic_chance'] = 99; }
-              }
-            }
-
-			if($itm['iznosNOW'] >= $itm['iznosMAX']) {
-				$u->error = '�� �������� �������...';
-			}elseif( $st['useOnlyInBattle'] == 1 && $u->info['battle'] == 0 ) {
-				//����� ������������ ������ � ��������
-				$u->error = '����� ������������ ������ � ��������';
-			}elseif( $u->info['battle'] > 0 && $itm['btl_zd'] > 0 ) {
-				//����� ������������ ������ � ��������
-				$u->error = '�������� ������������� ��� '.$itm['btl_zd'].' �����';
-			}elseif( $st['useOnlyInBattle'] == 1 && $u->info['battle'] > 0 && $u->stats['hpNow'] < 1 ) {
-				//����� ������������ ������ � ��������
-				$u->error = '�� �������, ������ ������������ �������� � ������';
-			} elseif($itm['magic_chance'] > 0 && rand(0, 100) > $itm['magic_chance']) {
-
-
-				$u->error = '���� &quot;'.$itm['name'].'&quot; ������';
-				$itm['iznosNOW']++;
-				if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-				  mysql_query('UPDATE `items_users` SET `inGroup` = 0, `delete` = 0 WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-				}
-				mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-				$u->addDelo(1, $u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;:<B>(���� ������)</b> �������� ����������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);				
-			
-            } elseif(isset($st['usefromfile'])) {
-				
-				//���������� ��������
-				$st = $u->lookStats($itm['data']);
-				if( isset($st['zazuby']) && $_GET['login'] != $u->info['login'] ) {
-					//unset($st['useOnLogin']);
-					$_GET['login'] = $u->info['login'];
-				}
-				$jl = $_GET['login'];
-				$_GET['login'] = urlencode($_GET['login']);
-				//���������� �� ��������� (��� ����� ����)	
-				$_GET['login'] = str_replace('%',' ',$_GET['login']);
-				$_GET['login'] = str_replace('25','',$_GET['login']);
-				$jl = str_replace('%',' ',$jl);
-				$jl = str_replace('25','',$jl);
-				
-				if(isset($st['useOnLogin']) && $st['useOnLogin']==1) {
-					if( $u->info['inTurnir'] == 0 ) {
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}
-					}else{
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}
-					}
-				}
-				
-				if($st['usefromfile']==1) {
-					if($u->info['battle'] > 0) {
-						if(file_exists('../../_incl_data/class/magic/'.$itm['magic_inci'].'.php'))
-						{
-							require('../../_incl_data/class/magic/'.$itm['magic_inci'].'.php');
-						}else{
-							$u->error = '�� ������� ������������ ('.$itm['magic_inci'].'.b)';
-						}
-					}else{
-						if(file_exists('_incl_data/class/magic/'.$itm['magic_inci'].'.php'))
-						{
-							require('_incl_data/class/magic/'.$itm['magic_inci'].'.php');
-						}else{
-							$u->error = '�� ������� ������������ ('.$itm['magic_inci'].')';
-						}
-					}
-				}else{
-					if($itm['useInBattle'] > 0) {
-						if(file_exists('../../_incl_data/class/priems/'.$st['usefromfile'].'.php'))
-						{
-							require('../../_incl_data/class/priems/'.$st['usefromfile'].'.php');
-						}else{
-							$u->error = '�� ������� ������������ ('.$st['usefromfile'].'.)';
-						}
-					}else{
-						$u->error = '�� ������� ������������ ('.$st['usefromfile'].'!)';
-					}
-				}
-			}elseif($itm['type']==30)
-			{
-				//��������
-				$goodUse = 0; $use = array();
-				if(isset($st['moment']))
-				{
-					//������� ������������ ����������� (�������������� �� ��� ��)
-					if(isset($st['moment_hp'])) {
-						//��������������� ��������
-						if($u->stats['hpNow']<$u->stats['hpAll']) {
-							$goodUse = 1;
-							$use['moment_hp'] = $st['moment_hp'];
-							
-							if($u->stats['hpNow']+$use['moment_hp']>$u->stats['hpAll']) {
-								$use['moment_hp'] = ceil($u->stats['hpAll']-$u->stats['hpNow']);							
-							}
-							
-							$u->error .= '�� ������������ '.($use['moment_hp']).' HP.<br>';
-						}else{
-							$u->error = '���� �������� � ��� ��������� �������������<br>';
-							$goodUse = 0;
-						}
-					}	
-					
-					if(isset($st['moment_mp'])) {
-						//��������������� ��������
-						if($u->stats['mpNow'] < $u->stats['mpAll']) {
-							$goodUse = 1;
-							$use['moment_mp'] = $st['moment_mp'];
-							if($u->stats['mpNow']+$use['moment_mp'] > $u->stats['mpAll']) {
-							  $use['moment_mp'] = ceil($u->stats['mpAll']-$u->stats['mpNow']);							
-							}
-							$u->error .= '�� ������������ '.($use['moment_mp']).' MP.<br />';
-						} else {
-							$u->error = '���� ����� � ��� ��������� �������������';
-							$goodUse = 0;
-						}
-					}					
-					
-					if($itm['iznosNOW']>=$itm['iznosMAX'])
-					{
-						$u->error = '������� ��� ��������...';
-						$goodUse = 0;
-					}
-						
-					if(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-					{
-						$goodUse = 0;
-						$u->error = '�������� �� ����� ������������ ������ �������';
-					}
-								
-					//������� ������ � ��
-					if($goodUse==1)
-					{
-						$itm['iznosNOW']++;
-						$upd = mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-						if($upd) {
-							$u->stats['hpNow'] += $use['moment_hp'];
-							$u->info['hpNow'] += $use['moment_hp'];
-                            $u->stats['mpNow'] += $use['moment_mp'];
-							$u->info['mpNow'] += $use['moment_mp'];
-							if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-								mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->info['hpNow'].'", `mpNow` = "'.$u->info['mpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ������� &quot;'.$itm['name'].'&quot; (+'.$use['moment_hp'].' HP) [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-							$this->youuse++;
-							$u->error = '�� ������� ������������ ������� &quot;'.$itm['name'].'&quot;<br>'.$u->error.'';
-						}else{
-							$u->error = '�� ������� ������������ �������...';
-						}
-					}
-				}else{
-					//�������� � ��������������� ��������
-					$goodUse = 1;
-					if(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-					{
-						$goodUse = 0;
-						$u->error = '�������� �� ����� ������������ ������ �������';
-					}
-					if($goodUse==1)
-					{
-						$upd1 = 1;
-						$upd2 = 1;
-						//��������� ������ ���������
-						if(isset($st['onlyOne']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						if(isset($st['oneType']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `overType` = "'.$itm['overType'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						if($goodUse == 1)
-						{
-							$us = $this->add_eff($u->info['id'],$itm['magic_inc']);
-							if($us[0]==1)
-							{
-								$itm['iznosNOW']++;
-								if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-									mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-								}
-								mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-								$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-								$this->youuse++;
-								$u->error = '�� ������� ������������ ������� &quot;'.$itm['name'].'&quot;<br>'.$us[1].'';
-							}else{
-								$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-							}
-						}else{
-							$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-						}
-					}
-				}
-				//---------------
-			}elseif($itm['type']==29)
-			{
-				//���������� ��������
-				$st = $u->lookStats($itm['data']);
-				if( isset($st['zazuby']) && $_GET['login'] != $u->info['login'] ) {
-					//unset($st['useOnLogin']);
-					$_GET['login'] = $u->info['login'];
-				}
-				$jl = $_GET['login'];
-				$_GET['login'] = urlencode($_GET['login']);
-				//���������� �� ��������� (��� ����� ����)	
-				$_GET['login'] = str_replace('%',' ',$_GET['login']);
-				$_GET['login'] = str_replace('25','',$_GET['login']);
-				$jl = str_replace('%',' ',$jl);
-				$jl = str_replace('25','',$jl);
-				if($itm['magic_inci']=='nextuplvl') {
-					if($itm['iznosNOW']>=$itm['iznosMAX']) {
-						$u->error = '������ ��� ��������...';
-					}elseif( $u->info['battle'] > 0 ) {
-						//
-						$u->error = '�� �� ������ ������������ ������ � ���';
-					}else{
-						if( $u->info['twink'] > 0 ) {
-							$u->error = '����������� ������ �� �������� ���������';
-						}else{
-							mysql_query('UPDATE `users` SET `stopexp` = 0 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							mysql_query('UPDATE `users_twink` SET `stopexp` = 0 WHERE `uid` = "'.$u->info['id'].'" LIMIT 1');
-							$itm['iznosNOW']++;
-							if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-								mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-							}
-							mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-						}
-					}
-				}elseif(isset($st['useOnLogin']) && $st['useOnLogin']==1)
-				{
-					if( $u->info['inTurnir'] == 0 ) {
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`, `st`.`clone`, `u`.`bot_id`, `u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-						}
-					}else{
-						if( $u->info['battle'] > 0 ) {
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND `u`.`battle` = "'.$u->info['battle'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}else{
-							$usr = mysql_fetch_array(mysql_query('SELECT `st`.`atack`,`st`.`clone`,`u`.`bot_id`,`u`.`type_pers`,`u`.`inTurnir`,`st`.`zv`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`inTurnir` > 0 LIMIT 1'));
-						}
-					}
-					if(isset($usr['id']))
-					{
-						//�������� ���������
-						if($itm['iznosNOW']>=$itm['iznosMAX'])
-						{
-							$u->error = '������ ��� ��������...';
-						}elseif($itm['magic_inci']=='snowball')
-						{
-							if( $u->info['battle'] == 0 ) {
-								$usr = mysql_fetch_array(mysql_query('SELECT `st`.`clone`,`u`.`type_pers`,`u`.`bot_id`,`st`.`zv`,`u`.`inTurnir`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`battle` = 0 OR `u`.`battle` = "'.$u->info['battle'].'") AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") LIMIT 1'));
-							}else{
-								$usr = mysql_fetch_array(mysql_query('SELECT `st`.`clone`,`u`.`type_pers`,`u`.`bot_id`,`st`.`zv`,`u`.`inTurnir`,`st`.`bot`,`st`.`hpNow`,`u`.`login`,`st`.`dnow`,`u`.`id`,`u`.`align`,`u`.`admin`,`u`.`clan`,`u`.`level`,`u`.`room`,`u`.`online`,`u`.`battle`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE `u`.`city` = "'.$u->info['city'].'" AND (`u`.`battle` = 0 OR `u`.`battle` = "'.$u->info['battle'].'") AND (`u`.`login`="'.mysql_real_escape_string($_GET['login']).'" OR `u`.`login`="'.mysql_real_escape_string($jl).'") AND `u`.`battle` = "'.$u->info['battle'].'" LIMIT 1'));
-							}
-							if($usr['battle']>0 && $u->info['battle']!=$usr['battle'])
-							{
-								$u->error = '�������� ��������� � ���';
-							}elseif($usr['battle']>0) {
-								//�������� � ��������
-								if($usr['team'] != $u->info['team'] && $usr['hpNow'] > 0) {
-									$txt = 1;
-									
-									//���������
-									if($usr['bot_id'] >= 439 && $usr['bot_id'] <= 460) {
-										$txt = 500;
-									}elseif($usr['bot_id'] == 291 ) {
-										if($usr['hpNow'] < 961) {
-											$txt = 1982;
-										}elseif($usr['hpNow'] > 980 && $usr['hpNow'] < 1981) {
-											$txt = 1982;
-										}
-									}elseif($usr['id'] == 1008 ) {
-										$txt = $u->info['level']*250;
-									}
-									
-									$usr['hpNow'] -= $txt;
-									if($txt<0) {
-										$txt = '+'.$txt;
-									}elseif($txt==0) {
-										$txt = '--';
-									}else{
-										$txt = '-'.$txt;
-									}
-									if($usr['hpNow']<0)
-									{
-										$usr['hpNow'] = 0;
-									}
-									$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $usr['hpNow'];
-											$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-											if(isset($lastHOD['id']))
-											{
-												$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['hpNow']);
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] > $btl->stats[$btl->uids[$usr['id']]]['hpAll']) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $btl->stats[$btl->uids[$usr['id']]]['hpAll'];
-												}
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] < 1) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = 0;
-												}
-												$id_hod = $lastHOD['id_hod'];
-												if($lastHOD['type']!=6)
-												{
-													$id_hod++;
-												}
-												mysql_query('UPDATE `stats` SET `hpNow` = "'.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-												$itm['iznosNOW']++;
-												if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-													mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-												}
-												mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-												$txt = '<font color=#006699>'.$txt.'</font>';
-												if($u->info['sex']==1) {
-														$txt = '������ {u1} ������� ����� ����� � {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-												}else{
-														$txt = '������ {u1} ������ ����� ����� � {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-												}
-												mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-											}
-									
-									unset($txt);
-								}else{
-									$u->error = '������ ������������ �� ������� ���������';
-								}
-							}elseif($u->info['dnow']!=$usr['dnow'])
-							{
-								$u->error = '�������� ��������� � ������ �������';
-							}elseif($usr['id']==$u->info['id'])
-							{
-								$u->error = '������ �������� � ������ ����';
-							}elseif($usr['online']<time()-520 && $usr['battle'] == 0 && $usr['bot'] == 0)
-							{
-								$u->error = '�������� ��������� � �������� ���� ;)';
-							}elseif($usr['room']!=$u->info['room'])
-							{
-								$u->error = '�������� ��������� � ������ �������';
-							}elseif($usr['admin']>0 && $u->info['admin']==0)
-							{
-								$u->error = '������ �������� � �������';
-							}else{
-								$usr['hpNow'] -= 1000;
-								if($usr['hpNow']<0)
-								{
-									$usr['hpNow'] = 0;
-								}
-								$upd = mysql_query('UPDATE `stats` SET `hpNow` = "'.$usr['hpNow'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-								if($upd)
-								{
-									$sx = '��'; $sx2 = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '��'; $sx2 = '�';
-									}
-									$itm['iznosNOW']++;
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									$urs_st = $u->getStats($usr['id']);
-									$rtxt = '[img[items/snowball1.gif]] ����'.$sx.' &quot;'.$u->info['login'].'&quot; ������'.$sx2.' ����� ����� � &quot;'.$usr['login'].'&quot;. <font color=red><b>-1000</b></font> ['.floor($urs_st['hpNow']).'/'.$urs_st['hpAll'].']';
-									mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-									unset($sx,$sx2);
-								}else{
-									$u->error = '�� ������� ������ ������...';
-								}								
-							}
-						}elseif($itm['magic_inci']=='atack')
-						{	
-											//�������� ���������
-						$usta = $u->getStats($usr['id'],0); // ����� ����
-						$rgd = $u->regen($usr['id'],$usta,1);
-						$usta['hpNow'] = $rgd['hpNow'];
-						$usta['mpNow'] = $rgd['mpNow'];
-		                $minHp = floor($usta['hpAll']/100*33); // ����������� ����� �������� ���� ��� ������� ����� �������
-						$batlatest = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$usr['battle'].'" AND `team_win` = -1 LIMIT 1'));
-						$test = mysql_fetch_array(mysql_query('SELECT `id` FROM `battle_last` WHERE `uid` = "'.$u->info['id'].'" AND `battle_id` = "'.$usr['battle'].'" LIMIT 1'));
-                        if(isset($test['id'])) {
-                        	echo '������ ���������, �� ��� ���� � ���� ��������.';
-                        }elseif( time() - $usr['timereg'] < 86400*5 )
-							{
-								$u->error = '�������� �� �������� �����������! ������ ������ ����������� � ��������� ���� � �������...';
-							}elseif($usr['atack']==1 || $usr['atack'] > time())
-							{
-								$u->error = '�� ��������� ����� ���������, ��������� ����� ��...';
-							}elseif($u->info['dnow']!=$usr['dnow'])
-							{
-								$u->error = '�������� ��������� � ������ ������� (������)';
-							}elseif($usr['inTurnirnew'] > 0)
-							{
-								$u->error = '�������� ��������� ������� � �������';
-							}elseif($u->info['battle']>0)
-							{
-								$u->error = '�� ��� ���������� � ���';
-							}elseif($usr['id']==$u->info['id'])
-							{
-								$u->error = '������ �������� �� ������ ����';
-							}elseif($usr['bot']==2) {
-								$u->error = '�� �������� ������� �� ���� '.$usr['login'].'';
-							}elseif($usr['online']<time()-120)
-							{
-								$u->error = '�������� �� � ����';
-							}elseif($usr['admin']==1)
-							{
-								$u->error = '�� ���� ��������, �����?';
-							}elseif($usr['room']!=$u->info['room'] && $u->info['battle'] != $usr['battle'] && $u->info['battle'] > 0)
-							{
-								$u->error = '�������� ��������� � ������ �������!';
-							}elseif($usr['room']!=$u->info['room'])
-							{
-								$u->error = '�������� ��������� � ������ �������';
-							}elseif($batlatest['noatack']==1)
-							{
-								$u->error = '�������� ������� ������! �� �� ������ ���������!';
-							}elseif($minHp>$usta['hpNow'] && !isset($batlatest['id']))
-							{
-							//���� ��
-								$u->error = '�������� ������� ���� ('.floor($usta['hpNow']).'HP)';
-							}elseif($u->info['noatack']!=0)
-							{
-							//���� ��
-								$u->error = '� ���� ������� ��������� ���������.';
-							}else{
-								
-								if($usr['type_pers'] > 0) {
-									$kroww=$usr['type_pers'];
-								}elseif($itm['item_id']=='2391'){
-									$kroww=99;
-								}else{
-									$kroww=0;
-								}
-								
-								$kulak = 0;
-								if( $itm['item_id'] == 4404 ) {
-									$kulak = 1;
-								}
-			                    if($u->info['inTurnir'] > 0) { $bsi = $u->info['inTurnir']; } else { $bsi = 0; }
-								$atc = $this->atackUser($u->info['id'],$usr['id'],$usr['team'],$usr['battle'], 0, $kroww, $kulak, $bsi);
-								if($atc > 0)
-								{
-									//���������� �������� � ���
-									$sx = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '�';
-									}
-									$itm['iznosNOW']++;
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									$rtxt = '[img[items/pal_button8.gif]] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ����� ��������� �� ��������� &quot;'.$usr['login'].'&quot;.';
-									mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','11','0','1')");	
-									//������, ��������� �����
-									die('<script>top.frames[\'main\'].location = "main.php";</script>');
-								}else{
-									if( $u->error == '' ) {
-										$u->error = '�� ������� ������� �� ���������...';
-									}
-								}
-							}
-						 }elseif($itm['magic_inci']=='cureHP') {
-							//����� ��,MP
-								$po = $u->lookStats($itm['data']);
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									$bu = mysql_fetch_array(mysql_query('SELECT * FROM `spells` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
-									if(isset($bu['id'])) {
-										$u->error = '������ ������������ ������ ������ ���...';
-									}elseif( $usr['battle']!=$u->info['battle'] ) {
-										$u->error = '��������� ������������, �������� � ������ ��������...';
-									}elseif( $usr['team']!=$u->info['team'] ) {
-										$u->error = '��������� ������������ �� ����������...';
-									}elseif( $usr['hpNow'] < 1 ) {
-										$u->error = '��������� ������������ �� �������...';
-									}elseif( $u->info['hpNow'] < 1 ) {
-										$u->error = '��������� ������������, �� �������...';
-									}elseif($btl->info['noeff'] > 0 ) {
-										$u->error = '������ �� ������������� ������� ��������������';
-									}elseif( $po['magic_hpNow'] < 1 && $po['magic_mpNow'] < 1 ) {
-										$u->error = '��������� ������������, � ���������� ������ ��� �����...';
-									}elseif(($usr['battle']==$u->info['battle'] && ($u->info['team']==$usr['team'] && ($po['magic_hpNow']>0 || $po['magic_mpNow']>0))) && $usr['hpNow']>=1 && $u->info['hpNow']>=1) {
-										//�������
-										if(isset($po['magic_hpNow'])) {
-											
-											mysql_query('INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES (
-												"'.$u->info['battle'].'","'.$u->info['id'].'","'.time().'","'.$itm['item_id'].'","'.$itm['name'].'","1"
-											)');
-											
-											$txt = $po['magic_hpNow'];
-											
-											if($btl->stats[$btl->uids[$usr['id']]]['hpAll']-$btl->stats[$btl->uids[$usr['id']]]['hpNow'] < $txt) {
-												$txt = floor($btl->stats[$btl->uids[$usr['id']]]['hpAll']-$btl->stats[$btl->uids[$usr['id']]]['hpNow']);
-											}
-                                            //653 - 400
-                                            //253
-											//453 1306
-											$gdhh = round($txt/$btl->stats[$btl->uids[$usr['id']]]['hpAll']*5,2);
-											$gdhd = round($gdhh/$btl->users[$btl->uids[$usr['id']]]['tactic7']*100);
-											if($gdhd > 100) {
-											  $txt = floor($txt/100*$gdhd);
-											}
-											
-											if($btl->users[$btl->uids[$usr['id']]]['tactic7'] >= 1) {
-												if($txt > 0) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] += $txt;
-													$btl->users[$btl->uids[$usr['id']]]['tactic7'] -= $gdhh;
-													if($btl->users[$btl->uids[$usr['id']]]['tactic7'] < 0) {
-														$btl->users[$btl->uids[$usr['id']]]['tactic7'] = 0;
-													}
-												}
-												mysql_query('UPDATE `stats` SET `last_hp` = "'.$txt.'", `hpNow` = `hpNow` + '.$po['magic_hpNow'].', `tactic7` = "'.$btl->users[$btl->uids[$usr['id']]]['tactic7'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-												if($txt > 0) {
-													$txt = '+'.$txt;
-												} elseif($txt == 0){
-													$txt = '--';
-												}
-											} else {
-												$txt = '--';
-											}
-											$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-											if(isset($lastHOD['id']))
-											{
-												$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['hpNow']);
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] > $btl->stats[$btl->uids[$usr['id']]]['hpAll']) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = $btl->stats[$btl->uids[$usr['id']]]['hpAll'];
-												}
-												if($btl->stats[$btl->uids[$usr['id']]]['hpNow'] < 1) {
-													$btl->stats[$btl->uids[$usr['id']]]['hpNow'] = 0;
-												}
-												$id_hod = $lastHOD['id_hod'];
-												if($lastHOD['type'] != 6)
-												{
-													$id_hod++;
-												}
-												$txt = '<font color=#006699>'.$txt.'</font>';
-												if($u->info['id']==$usr['id']) {
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}
-												}else{
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['hpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['hpAll'].']';
-													}
-												}
-												mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-											}									
-										}
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										
-										// ��������� � ��� ���
-										$sx = '��'; $sx2 = '';
-										if($u->info['sex']==1)
-										{
-											$sx = '��'; $sx2 = '�';
-										}
-										$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';										
-									}else{
-										$u->error = '������ ������������ �� ������� ���������';
-									}
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-									//�������
-									if(isset($po['magic_hpNow'])) {
-										mysql_query('UPDATE `stats` SET `hpNow` = `hpNow` + '.$po['magic_hpNow'].' WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-									}									
-									
-									$itm['iznosNOW']++;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									
-									// ��������� � ���
-									$sx = '��'; $sx2 = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '��'; $sx2 = '�';
-									}
-									$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';
-									$rtxt = '[img[items/'.$itm['img'].']] �������� &quot;'.$u->info['login'].'&quot; �����������'.$sx2.' &quot;'.$itm['name'].'&quot; �� &quot;'.$usr['login'].'&quot;.';
-					                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");
-								}
-						}elseif($itm['magic_inci']=='cureMP') {
-							//����� ��,MP
-								$po = $u->lookStats($itm['data']);
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									$bu = mysql_fetch_array(mysql_query('SELECT * FROM `spells` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
-									if(isset($bu['id'])) {
-										$u->error = '������ ������������ ������ ������ ���...';
-									}elseif($btl->info['noeff'] > 0 ) {
-									$u->error = '������ �� ������������� ������� ��������������';
-									}elseif(($usr['battle']==$u->info['battle'] && ($u->info['team']==$usr['team'] && ($po['magic_hpNow']>0 || $po['magic_mpNow']>0))) && $usr['hpNow']>1 && $u->info['hpNow']>=1) {
-										//�������
-										if(isset($po['magic_mpNow'])) {
-											
-											mysql_query('INSERT INTO `spells` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES (
-												"'.$u->info['battle'].'","'.$u->info['id'].'","'.time().'","'.$itm['item_id'].'","'.$itm['name'].'","1"
-											)');
-											
-											$txt = $po['magic_mpNow'];
-											
-											if($btl->stats[$btl->uids[$usr['id']]]['mpAll']-$btl->stats[$btl->uids[$usr['id']]]['mpNow'] < $txt) {
-												$txt = floor($btl->stats[$btl->uids[$usr['id']]]['mpAll']-$btl->stats[$btl->uids[$usr['id']]]['mpNow']);
-											}
-											
-											$gdhh = round($txt/$btl->stats[$btl->uids[$usr['id']]]['mpAll']*5);
-											$gdhd = round($gdhh/$btl->users[$btl->uids[$usr['id']]]['tactic7']*100);
-											if( $gdhd > 100 ) {
-												$txt = floor($txt/100*$gdhd);
-											}
-											
-											if($btl->users[$btl->uids[$usr['id']]]['tactic7'] >= 1) { // ��������� >= 1 , ���� ������� ���
-												if($txt > 0) {
-													$btl->stats[$btl->uids[$usr['id']]]['mpNow'] += $txt;
-													$btl->users[$btl->uids[$usr['id']]]['tactic7'] -= $gdhh;
-													if($btl->users[$btl->uids[$usr['id']]]['tactic7'] < 0) {
-														$btl->users[$btl->uids[$usr['id']]]['tactic7'] = 0;
-													}
-												}
-												mysql_query('UPDATE `stats` SET `mpNow` = `mpNow` + '.$txt.', `tactic7` = "'.$btl->users[$btl->uids[$usr['id']]]['tactic7'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-												if($txt>0) {
-													$txt = '+'.$txt;
-												}elseif($txt==0){
-													$txt = '--';
-												}
-											} else {
-												$txt = '--';
-											}
-											$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$u->info['battle'].'" ORDER BY `id_hod` DESC LIMIT 1'));
-											if(isset($lastHOD['id']))
-											{
-												$btl->stats[$btl->uids[$usr['id']]]['mpNow'] = floor($btl->stats[$btl->uids[$usr['id']]]['mpNow']);
-												if($btl->stats[$btl->uids[$usr['id']]]['mpNow'] > $btl->stats[$btl->uids[$usr['id']]]['mpAll']) {
-													$btl->stats[$btl->uids[$usr['id']]]['mpNow'] = $btl->stats[$btl->uids[$usr['id']]]['mpAll'];
-												}
-												if($btl->stats[$btl->uids[$usr['id']]]['mpNow']<1) {
-													$btl->stats[$btl->uids[$usr['id']]]['mpNow'] = 0;
-												}
-												$id_hod = $lastHOD['id_hod'];
-												if($lastHOD['type']!=6)
-												{
-													$id_hod++;
-												}
-												$txt = '<font color=#006699>'.$txt.'</font>';
-												if($u->info['id']==$usr['id']) {
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� ����. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}
-												}else{
-													if($u->info['sex']==1) {
-														$txt = '{u1} ������������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}else{
-														$txt = '{u1} ����������� &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}. <b>'.$txt.'</b> ['.$btl->stats[$btl->uids[$usr['id']]]['mpNow'].'/'.$btl->stats[$btl->uids[$usr['id']]]['mpAll'].'] (����)';
-													}
-												}
-												mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$u->info['battle'].'","'.($id_hod).'","{tm1} '.$txt.'","login1='.$u->info['login'].'||t1='.$u->info['team'].'||login2='.$usr['login'].'||t2='.$usr['team'].'||time1='.time().'","","","","","6")');
-											}									
-										}
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										
-										// ��������� � ��� ���
-										$sx = '��'; $sx2 = '';
-										if($u->info['sex']==1)
-										{
-											$sx = '��'; $sx2 = '�';
-										}
-										$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';										
-									}else{
-										$u->error = '������ ������������ �� ������� ���������';
-									}
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-									//�������
-									if(isset($po['magic_mpNow'])) {
-										mysql_query('UPDATE `stats` SET `mpNow` = `mpNow` + '.$po['magic_mpNow'].' WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-									}									
-									
-									$itm['iznosNOW']++;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									
-									// ��������� � ���
-									$sx = '��'; $sx2 = '';
-									if($u->info['sex']==1)
-									{
-										$sx = '��'; $sx2 = '�';
-									}
-									$u->error = '������ &quot;'.$itm['name'].'&quot; ��� ������� �����������.';
-									$rtxt = '[img[items/'.$itm['img'].']] �������� &quot;'.$u->info['login'].'&quot; �����������'.$sx2.' &quot;'.$itm['name'].'&quot; �� &quot;'.$usr['login'].'&quot;.';
-					                mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");
-								}
-						}elseif($itm['magic_inci']=='lech_1' or $itm['magic_inci']=='lech_2' or $itm['magic_inci']=='lech_3'){
-						            
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-							
-									$travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="4" and `delete`="0" ORDER BY `v1` DESC LIMIT 1'));
-									//$type_lechenie = $travm['v1'];
-									$itm['magic_inci'] = 'lech_'.$travm['v1'];
-									if($itm['magic_inci']=='lech_1'){
-										$type_lechenie=1; // ��� ������ ������ �����
-										$text_msg='&quot;������ ������&quot;';
-										$text_msg2 = '������';
-									}elseif($itm['magic_inci']=='lech_2'){
-										$type_lechenie=2; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}elseif($itm['magic_inci']=='lech_3'){
-										$type_lechenie=3; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}
-									if($travm){
-										$lech_aa = array( 0 , 2 , 3 , 4 );
-										$travm_cep = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="335" and `delete`="0" and `v1`="'.$type_lechenie.'" LIMIT 1'));
-										if( $travm_cep['timeUse'] < time() - 360 ) {
-											unset($travm_cep);
-										}
-										
-										$cep_users = explode(',',$travm_cep['data']);
-										$it_i = 0;
-										$it_no = 0;
-										$it_users = '';
-										while( $it_i < count($cep_users) ) {
-											$it_u = $cep_users[$it_i];
-											if( $it_u == $u->info['id'] ) {
-												$it_no = 1;
-											}
-											$it_u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`room` FROM `users` WHERE `id` = "'.$it_u.'" LIMIT 1'));
-											if( isset($it_u['id']) ) {
-												$it_users .= ', '.$it_u['login'].'';
-											}
-											$it_i++;
-										}
-										$it_u = ltrim($it_u,', ');
-										
-										$lech_co = round($travm_cep['x']+1);
-										if( $it_no == 1 ) {
-											$u->error = '�� ��� ���� �� �������';
-										}elseif( $lech_co >= $lech_aa[$type_lechenie] ) {
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											
-											$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1');
-									        
-											// ��������� � ���
-											$u->error = '�������� ������� �� '.$text_msg.'.';
-														$rtxt = '[img[items/cure'.$type_lechenie.'.gif]] ������ &quot;'.$u->info['login'].$it_users.'&quot; �������� �� '.$text_msg.' ������ &quot;'.$usr['login'].'&quot;.';
-					                                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-										}else{
-											if( isset($travm_cep['id']) ) {
-												$travm_cep['x']++;
-												$u->error = '�� �������������� � ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����)';
-												mysql_query('UPDATE `eff_users` SET `x` = "'.$travm_cep['x'].'"
-												,`data` = "'.$travm_cep['data'].','.$u->info['id'].'"
-												WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-											}else{
-												$u->error = '�� ������� ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����), � ��������� ������� ���� 5 �����, ����� ��������� ����������';
-												mysql_query('INSERT INTO `eff_users`
-												(
-													`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x`
-												) VALUES (
-													"335","'.$usr['id'].'","���� ���������","'.$u->info['id'].'","28","'.time().'","'.$u->info['id'].'","'.$type_lechenie.'","1"
-												)');
-											}
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											// ��������� � ���
-											$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-
-										}
-									}else{
-										$u->error = '�������� �� ����� ������ ������.';
-									}
-								
-								}
-
-						        
-						}elseif($itm['magic_inci']=='lech_free_1' or $itm['magic_inci']=='lech_free_2' or $itm['magic_inci']=='lech_free_3'){
-						            
-								if($u->info['battle'] > 0) {
-									//���������� ������ � ��������
-									
-								}elseif($u->info['dnow']!=$usr['dnow'])
-								{
-									$u->error = '�������� ��������� � ������ ������� [������]';
-								}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-								{
-									$u->error = '�������� ��������� � �������� ����';
-								}elseif($usr['room']!=$u->info['room'])
-								{
-									$u->error = '�������� ��������� � ������ �������';
-								}elseif($usr['battle']!=$u->info['battle'])
-								{
-									$u->error = '�������� ��������� � ��������';
-								}else{
-							
-									$travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="4" and `delete`="0" ORDER BY `v1` DESC LIMIT 1'));
-									//$type_lechenie = $travm['v1'];
-									//$itm['magic_inci'] = 'lech_free_'.$travm['v1'];
-									if($itm['magic_inci']=='lech_free_1'){
-										$type_lechenie=1; // ��� ������ ������ �����
-										$text_msg='&quot;������ ������&quot;';
-										$text_msg2 = '������';
-									}elseif($itm['magic_inci']=='lech_free_2'){
-										$type_lechenie=2; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}elseif($itm['magic_inci']=='lech_free_3'){
-										$type_lechenie=3; // ��� ������ ������ �����
-										$text_msg='&quot;������� ������&quot;';
-										$text_msg2 = '�������';
-									}
-									if($travm['v1'] != $type_lechenie) {
-										$u->error = '������������ ������ ��� ������ ������.';
-									}elseif($travm['id']){
-										$lech_aa = array( 0 , 0 , 0 , 0 );
-										$travm_cep = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$usr['id'].'" and `id_eff`="335" and `delete`="0" and `v1`="'.$type_lechenie.'" LIMIT 1'));
-										if( $travm_cep['timeUse'] < time() - 360 ) {
-											unset($travm_cep);
-										}
-										
-										$cep_users = explode(',',$travm_cep['data']);
-										$it_i = 0;
-										$it_no = 0;
-										$it_users = '';
-										while( $it_i < count($cep_users) ) {
-											$it_u = $cep_users[$it_i];
-											if( $it_u == $u->info['id'] ) {
-												$it_no = 1;
-											}
-											$it_u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`align`,`clan`,`room` FROM `users` WHERE `id` = "'.$it_u.'" LIMIT 1'));
-											if( isset($it_u['id']) ) {
-												$it_users .= ', '.$it_u['login'].'';
-											}
-											$it_i++;
-										}
-										$it_u = ltrim($it_u,', ');
-										
-										$lech_co = round($travm_cep['x']+1);
-										if( $it_no == 1 ) {
-											$u->error = '�� ��� ���� �� �������';
-										}elseif( $lech_co >= $lech_aa[$type_lechenie] ) {
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											
-											//$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        //mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-									        mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `id_eff` = 4 AND `delete` = 0 LIMIT 1');
-									        
-											// ��������� � ���
-											$u->error = '�������� ������� �� '.$text_msg.'.';
-														$rtxt = '[img[items/cure'.$type_lechenie.'.gif]] ������ &quot;'.$u->info['login'].$it_users.'&quot; �������� �� '.$text_msg.' ������ &quot;'.$usr['login'].'&quot;.';
-					                                    mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-										}else{
-											if( isset($travm_cep['id']) ) {
-												$travm_cep['x']++;
-												$u->error = '�� �������������� � ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����)';
-												mysql_query('UPDATE `eff_users` SET `x` = "'.$travm_cep['x'].'"
-												,`data` = "'.$travm_cep['data'].','.$u->info['id'].'"
-												WHERE `id` = "'.$travm_cep['id'].'" LIMIT 1');
-											}else{
-												$u->error = '�� ������� ���� ��������� ��� &quot;'.$text_msg.'&quot; (��������� '.$text_msg2.' �����), � ��������� ������� ���� 5 �����, ����� ��������� ����������';
-												mysql_query('INSERT INTO `eff_users`
-												(
-													`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`user_use`,`v1`,`x`
-												) VALUES (
-													"335","'.$usr['id'].'","���� ���������","'.$u->info['id'].'","28","'.time().'","'.$u->info['id'].'","'.$type_lechenie.'","1"
-												)');
-											}
-											//mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-									        $itm['iznosNOW']++;
-									        mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-											if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-												mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-											}
-											// ��������� � ���
-											$rtxt = '[img[items/cure_g1.gif]] ������ &quot;'.$u->info['login'].'&quot; ����� ���� ��������� �� ������ &quot;'.$usr['login'].'&quot;.';
-					                        mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-
-										}
-									}else{
-										$u->error = '�������� �� ����� ������ ������.';
-									}
-								
-								}
-
-						        
-						}else{
-							if( $u->info['id'] != $usr['id'] ) {
-								$lsct = mysql_fetch_array(mysql_query('SELECT `id_eff` FROM `eff_users` WHERE `uid` = "'.$usr['id'].'" AND `delete` = "0" AND (`overType` = "'.$itm['overType'].'" OR (`id_eff` = "'.$itm['magic_inc'].'" AND "'.(0+$st['onlyOne']).'" != "0")) LIMIT 1'));
-								$lsct['good'] = 1;
-								//�����
-								if( $lsct['id_eff'] >= 291 && $lsct['id_eff'] <= 296 && $itm['magic_inc'] >= 291 && $itm['magic_inc'] <= 296 ) {
-									if( $lsct['id_eff'] > $itm['magic_inc'] ) {
-										$u->error = '�� ��������� ���� ���� ����� �����!';
-										$lsct['good'] = 0;
-									}
-								}
-							}else{
-								$lsct['good'] = 1;
-							}
-							//������ ���������� �� ���������
-							if($lsct['good'] == 0) {
-								
-							} elseif($u->info['dnow'] != $usr['dnow']) {
-							  $u->error = '�������� ��������� � ������ ������� [������]';
-							}elseif($usr['room']==217 || $usr['room']==218 || $usr['room']==219) {
-	                         $u->error = '�������� '.$u->microLogin($usr['id'],1).' ��������� � ���������!';
-                            } elseif($usr['inTurnir'] != 0 && ($u->info['inTurnir'] != $usr['inTurnir'])) {
-							  $u->error = '��������� � ������� ����� ������...';
-							} elseif($usr['id']==$u->info['id'] && isset($st['useOnlyUser'])) {
-								$u->error = '������ ������������ ��� �������� �� ������ ����';
-							}elseif($usr['online']<time()-120 && $usr['bot'] == 0)
-							{
-								$u->error = '�������� ��������� � �������� ���� ;)';
-							}elseif($usr['room']!=$u->info['room'] && $usr['battle'] != $u->info['battle'] && $u->info['battle'] > 0)
-							{
-								$u->error = '�������� ��������� � ������ ������� ['.$usr['room'].' '.$u->info['room'].']';
-							}elseif($usr['admin']>0 && $u->info['admin']==0 && isset($st['useNoAdmin']))
-							{
-								$u->error = '������ ������������ ������ �������� �� �������';
-							}elseif($usr['battle']>0 && $u->info['battle']!=$usr['battle'])
-							{
-								$u->error = '�������� ��������� � ���';
-							}elseif(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-							{
-								$u->error = '�������� �� ����� ������������ ������ ��������';
-							}else{
-								//��������� ������ ���������
-								$goodUse = 1;
-								//
-								$tpsm = 0;
-								if( $itm['useInBattle'] == 0 && $usr['battle'] > 0 ) {
-									//������ �����
-									$goodUse = 0;
-								}else{
-									if( $usr['battle'] > 0 ) {
-										global $btl;
-										if($u->info['team'] != $btl->users[$btl->uids[$usr['id']]]['team'] ) {
-											if( $itm['useInBattle'] == 1 ) {
-												$goodUse = 0;
-											}
-											$tpsm = 2;
-										}elseif($u->info['team'] == $btl->users[$btl->uids[$usr['id']]]['team'] ) {
-											if( $itm['useInBattle'] == 2 ) {
-												$goodUse = 0;
-											}
-											$tpsm = 1;
-										}
-									}
-								}
-								//
-								if( $goodUse == 1 ) {
-									if(isset($st['onlyOne']))
-									{
-										//������� ������� �������
-										$goodUse = 0;
-										$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"');
-										if($upd1)
-										{										
-											$goodUse = 1;
-										}
-									}
-									if(isset($st['oneType']))
-									{
-										//������� ������� �������									
-										$goodUse = 0;
-										$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$usr['id'].'" AND `delete` = "0" AND `overType` = "'.$itm['overType'].'"');
-										if($upd1)
-										{
-											$goodUse = 1;
-										}
-									}
-								}
-								//
-								if( $goodUse == 1 && $itm['magic_inc'] == 'unclone' ) {
-									//���������� �����
-									if($usr['clone'] > 0 && $usr['hpNow'] >= 1 && $usr['team'] != $u->info['team']) {
-										mysql_query('UPDATE `stats` SET `team` = "'.$u->info['team'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-										if( $u->info['sex'] == 0 ) {
-											$txt_m = '{u1} <b>��������� �����</b> {u2} �� ���� �������.';
-										}else{
-											$txt_m = '{u1} <b>����������</b> ����� {u2} �� ���� �������.';	
-										}
-										$this->inBattleLog($txt_m,$usr);
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.($itm['iznosNOW'] + 1).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										mysql_query('UPDATE `items_users` SET `btl_zd` = "1" WHERE `item_id` = "'.$itm['item_id'].'" AND `inOdet` > 0 AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" LIMIT 20');
-										$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot; �� &quot;'.$usr['login'].'&quot;';
-									}else{
-										$u->error = '�� �� ������ ������������ ������� ���������...';
-									}
-								}elseif($goodUse == 1)
-								{
-									$us = $this->add_eff($usr['id'],$itm['magic_inc']);
-									if($us[0]==1) {
-										$mmmid = mysql_insert_id();
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-											mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										}
-										if($u->info['id']!=$usr['id'])
-										{
-											$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') �� ��������� &quot;'.$usr['login'].'&quot; (id'.$usr['id'].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-											$u->addDelo(1,$usr['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� &quot;'.$u->info['login'].'&quot; (id'.$u->info['id'].') ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') �� ��������� [itm:'.$itm['id'].'].',time(),$usr['city'],'System.inventory',0,0);
-											$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot; �� ��������� &quot;'.$usr['login'].'&quot;<br>'.$us[1].'';
-											//$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ���������� &quot;'.$itm['name'].'&quot; �� ��������� &quot;'.$usr['login'].'&quot;.';
-											//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-										}else{
-											$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') �� ��������� ������ ���� [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-											$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot; �� ������ ����<br>'.$us[1].'';
-											
-											//$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ���������� &quot;'.$itm['name'].'&quot; �� ����.';
-											//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-											
-										}
-										//
-										if( $usr['battle'] > 0 ) {
-											//������� � ���
-											$txt_m = '';
-											if( $u->info['sex'] == 0 ) {
-												if($u->info['id']!=$usr['id']) {
-													$txt_m .= '{u1} �������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}.';
-												}else{
-													$txt_m .= '{u1} �������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����.';	
-												}
-											}else{
-												if($u->info['id']!=$usr['id']) {
-													$txt_m .= '{u1} ��������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� {u2}.';
-												}else{
-													$txt_m .= '{u1} ��������������� ������ &quot;<b>'.$itm['name'].'</b>&quot; �� ����.';	
-												}
-											}
-											$this->inBattleLog($txt_m,$usr);
-											//
-											//�� ���������� ��� ������ ������ �������
-											//306 - ������������� , 307 - �������������
-											if( $tpsm == 1 ) {
-												//306
-												mysql_query('UPDATE `eff_users` SET `v1` = "priem",`v2` = "306",`timeUse` = "77",`hod` = "-1",`img2` = "'.$itm['img'].'" WHERE `id` = "'.$mmmid.'" LIMIT 1');
-											}elseif( $tpsm == 2 ) {
-												//307
-												mysql_query('UPDATE `eff_users` SET `v1` = "priem",`v2` = "307",`timeUse` = "77",`hod` = "-1",`img2` = "'.$itm['img'].'" WHERE `id` = "'.$mmmid.'" LIMIT 1');
-											}
-											//
-										}
-										//
-										$this->youuse++;
-									}else{
-										$u->error = '�� ������� ������������ "'.$itm['name'].'" ... ('.$itm['magin_inc'].' and '.$itm['magic_inci'].', ������ �� ��������)';
-									}
-								}else{
-									$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-								}
-							}
-						}
-					}else{
-						$u->error = '�������� "'.$jl.'" �� ������ � ���� ������ ('.$u->info['city'].')';
-					}
-				}elseif(isset($st['useOnItem']) && $st['useOnItem']==1)
-				{
-					//���������� �� �������
-					
-				}else{
-					//�� ����
-					$goodUse = 1;
-					if(($u->info['align']==2 || $u->info['haos']>time()) && isset($st['nohaos']))
-					{
-						$goodUse = 0;
-						$u->error = '�������� �� ����� ������������ ������ ��������';
-					}
-					
-					if($itm['magic_inci'] == 'sanich2') {
-						if($u->info['battle'] == 0) {						
-							$sz = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "sanich2" AND `time` > '.(time()-1*60).' LIMIT 1',1);
-							if(!isset($sz['id'])) {														
-								$slech = 0;
-								$strm = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `uid` = "'.$u->info['id'].'" AND `id_eff` = 4 AND `delete` = "0" LIMIT 1'));
-								if(isset($strm['id'])) {
-									if($strm['v1'] == 1) {
-										$slech = 1;
-									}elseif($strm['v1'] == 2) {
-										$slech = 2;
-									}elseif($strm['v1'] == 3) {
-										$slech = 3;
-									}
-								}								
-								if($slech > 0) {
-									
-									$goodUse = 0;
-									
-									$slf = '������';
-									if($slech == 2) {
-										$slf = '�������';
-									}elseif($slech == 3) {
-										$slf = '�������';
-									}
-	
-									if($u->info['sex'] == 1) {
-										$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; ������������ &quot;'.$itm['name'].' ������&quot; � �������� �� '.$slf.' ������.';
-									}else{
-										$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; ����������� &quot;'.$itm['name'].' ������&quot; � ��������� �� '.$slf.' ������.';
-									}
-									mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','6','0','1')");	
-								
-									mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$strm['id'].'" LIMIT 1');
-									$u->error = '�� ������� ���������� �� '.$slf.' ������.';
-									$itm['iznosNOW'] += $slech;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									$u->addAction(time(),'sanich2',$slech);
-								}else{
-									$u->error = '� ��������� ��� ���������� ������ ������� ����� ��������';
-								}
-								
-							}else{
-								$u->error = '�������� ������������� '.$u->timeOut(($sz['time']+1*60)-time()).'.';
-							}							
-						}else{
-							$u->error = '���������� ������������ � ���';
-						}
-
-					}elseif($itm['magic_inci'] == 'sanich1' && $u->info['battle'] > 0) {
-						
-						$sz = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "sanich1" AND `time` > '.(time()-3*60).' LIMIT 1',1);
-						if(!isset($sz['id'])) {
-							$goodUse = 0;
-							$u->error = '�� ������� ������������ &quot;'.$itm['name'].'&quot;';
-							$z = 1;
-							while($z <= 5) {
-								$u->info['tactic'.$z]++;
-								if($u->info['tactic'.$z] > 25) {
-									$u->info['tactic'.$z] = 25;
-								}elseif($u->info['tactic'.$z] < 0) {
-									$u->info['tactic'.$z] = 0;
-								}
-								$z++;
-							}
-							if($u->info['sex'] == 1) {
-								$this->inBattleLog('{u1} ������������ &quot;<b>'.$itm['name'].' ������</b>&quot;.');
-							}else{
-								$this->inBattleLog('{u1} ����������� &quot;<b>'.$itm['name'].' ������</b>&quot;.');
-							}
-							mysql_query('UPDATE `stats` SET `tactic1` = "'.$u->info['tactic1'].'",`tactic2` = "'.$u->info['tactic2'].'",`tactic3` = "'.$u->info['tactic3'].'",`tactic4` = "'.$u->info['tactic4'].'",`tactic5` = "'.$u->info['tactic5'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-							$itm['iznosNOW']++;
-							mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-							$u->addAction(time(),'sanich1',$u->info['battle']);
-						}else{
-							$u->error = '�������� ������������� '.$u->timeOut(($sz['time']+3*60)-time()).'.';
-						}
-										
-					}elseif($itm['magic_inci'] == 'sanich3' && $u->info['battle'] > 0) {
-						
-						$sz = $u->testAction('`uid` = "'.$u->info['id'].'" AND `vars` = "sanich3" AND `time` > '.(time()-3*60*60).' LIMIT 1',1);
-						if(!isset($sz['id'])) {
-							
-							$usr = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`level`,`s`.`hpNow`,`s`.`team`,`u`.`login`,`u`.`sex` FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `s`.`id` = `u`.`id` WHERE `u`.`id` = "'.$u->info['enemy'].'" AND `u`.`battle` = "'.$u->info['battle'].'" LIMIT 1')); 
-							if(isset($usr['id']) && $usr['hpNow'] >= 1) {
-								$iznslvl = $usr['level'];
-								
-								$goodUse = 0;
-								$u->error = '�� ������� ������������ &quot;'.$itm['name'].'&quot; �� '.$usr['login'].'';
-								
-								if($u->info['sex'] == 1) {
-									$this->inBattleLog('{u1} ������������ &quot;<b>'.$itm['name'].' ������</b>&quot; �� {u2}.',$usr);
-								}else{
-									$this->inBattleLog('{u1} ����������� &quot;<b>'.$itm['name'].' ������</b>&quot; �� {u2}.',$usr);
-								}
-								
-								mysql_query('UPDATE `stats` SET `hpNow` = "'.$usr['hpNow'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-								mysql_query('UPDATE `stats` SET `hpNow` = "'.$u->stats['hpNow'].'" WHERE `id` = "'.$usr['id'].'" LIMIT 1');
-								$itm['iznosNOW'] += $iznslvl;
-								mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-								$u->addAction(time(),'sanich3',$u->info['battle']);
-							}else{
-								$u->error = '��� ����������� ����������';
-							}
-							
-						}else{
-							$u->error = '�������� ������������� '.$u->timeOut(($sz['time']+3*60*60)-time()).'.';
-						}
-										
-					}elseif($itm['magic_inci']=='lech')
-					{
-						$goodUse = 0;
-						    if($u->info['level']>=2 and $u->info['level']<=7){
-							    $travm = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid`="'.$u->info['id'].'" and `id_eff`="4" and `delete`="0" LIMIT 1'));
-                                    if($travm) {
-										mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `id` = "'.$travm['id'].'" LIMIT 1');
-										$itm['iznosNOW']++;
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-										if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-											mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										}
-									}else{
-										$u->error = '� ��� ���� ������.';
-									}
-							}else{
-							    $u->error = '��� ������� �� �������� ��� ������������� ������.';
-							}
-						}
-									
-					
-					if($goodUse==1)
-					{
-						
-						$upd1 = 1;
-						$upd2 = 1;
-						//��������� ������ ���������
-						if(isset($st['onlyOne']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `id_eff` = "'.$itm['magic_inc'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						if(isset($st['oneType']))
-						{
-							//������� ������� �������
-							$goodUse = 0;
-							$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$u->info['id'].'" AND `delete` = "0" AND `overType` = "'.$itm['overType'].'"');
-							if($upd1)
-							{
-								$goodUse = 1;
-							}
-						}
-						
-						if($itm['magic_inci']=='unclone')
-						{
-							//������ ������������
-							if( $u->info['hpNow'] < 1 ) {
-								$u->error = '��� �� ������� ���������� �����...';
-							}elseif( $u->info['battle'] == 0 ) {
-								$u->error = '����� ������������ ������ � ��������...';
-							}else{
-								//�����������
-								$u->error = '����������...';
-							}
-						}elseif($itm['magic_inci']=='cloneMe')
-						{
-							//������ ������������
-							if( true == false ) {
-								$u->error = '������ ������������ ��������� � ����� �������.';
-							}elseif( $u->info['hpNow'] < 1 ) {
-								$u->error = '�� ������� ����������� ���� ���� ;)';
-							}elseif( $u->info['battle'] == 0 ) {
-								$u->error = '����� ������������ ������ � ��������...';
-							}else{
-								$bot_cou = mysql_fetch_array(mysql_query('SELECT COUNT(`id`) FROM `users` WHERE `login` LIKE "%'.$u->info['login'].' (����%" AND `battle` = "'.$u->info['battle'].'" LIMIT 1'));
-								$bot_cou = $bot_cou[0]+1;
-								//��������� ����
-								$clone = array(
-									'id' => $u->info['id'],
-									'login' => $u->info['login'].' (���� '.$bot_cou.')',
-									'level' => $u->info['level'],
-									'city' => $u->info['city'],
-									'cityreg' => $u->info['cityreg'],
-									'name' => $u->info['name'],
-									'sex' => $u->info['sex'],
-									'deviz' => $u->info['deviz'],
-									'hobby' => $u->info['hobby'],
-									'time_reg' => $u->info['time_reg'],
-									'obraz' => $u->info['obraz'],
-									'stats' => $u->info['stats'],
-									'upLevel' => $u->info['upLevel'],
-									'priems' => $u->info['priems'],
-									'loclon' => true,
-                                    'inTurnir' => $u->info['inTurnir']
-								);
-								$bot = $u->addNewbot(1,NULL,$clone,NULL,true);
-								if( $bot > 0 ) {
-									mysql_query('UPDATE `stats` SET `team` = "'.$u->info['team'].'",`hpNow` = "'.$u->stats['hpNow'].'",`mpNow` = "'.$u->stats['mpNow'].'" WHERE `id` = "'.$bot.'" LIMIT 1');
-									mysql_query('UPDATE `users` SET `battle` = "'.$u->info['battle'].'" WHERE `id` = "'.$bot.'" LIMIT 1');
-									//��������� ���
-									if( $u->info['sex'] == 0 ) {
-										$txt_m = '{u1} ����������� &quot;'.$itm['name'].'&quot; � <b>������� �����</b>.';
-									}else{
-										$txt_m = '{u1} ������������ &quot;'.$itm['name'].'&quot; � <b>�������� �����</b>.';
-									}
-									$this->inBattleLog($txt_m,NULL);
-									if( $u->info['sex'] == 0 ) {
-										$txt_m = '<b>'.$u->info['login'].' (���� '.$bot_cou.')</b>['.$u->info['level'].'] �������� � ��������!';
-									}else{
-										$txt_m = '<b>'.$u->info['login'].' (���� '.$bot_cou.')</b>['.$u->info['level'].'] ��������� � ��������!';
-									}
-									$this->inBattleLog($txt_m,$usr_m);
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.($itm['iznosNOW'] + 1).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									mysql_query('UPDATE `items_users` SET `btl_zd` = "1" WHERE `item_id` = "'.$itm['item_id'].'" AND `inOdet` > 0 AND `uid` = "'.$u->info['id'].'" AND `delete` = "0" LIMIT 20');
-									$u->error = '�������� &quot;'.$itm['name'].'&quot; ���� ������� ������������';
-								}else{
-									$u->error = '��������� ������������ ��������...';
-								}
-								unset($txt_m,$usr_m,$clone,$bot_cou,$bot);
-							}
-						
-                        } elseif($itm['magic_inci'] == 'scan') {
-                          if($u->info['inTurnir'] != 0) {
-                            $sp = mysql_query('SELECT `st`.*, `u`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `inTurnir` = "'.$u->info['inTurnir'].'"');
-                            while($pl = mysql_fetch_array($sp)) {
-                             $rrm = mysql_fetch_array(mysql_query('SELECT * FROM `bs_map` WHERE `x` = "'.$pl['x'].'" AND `y` = "'.$pl['y'].'"'));
-                             $trnt .= $pl['login'].' ������� : '.$rrm['name'].', ';
-                            }
-                            $trnt = rtrim($trnt,', ');
-                            $it_ = $u->addItem(2435, $u->info['id'], 'noodet=1|noremont=1|sudba='.$u->info['login'].'');
-                            mysql_query('UPDATE `items_users` SET `use_text` = 500 WHERE `id` = "'.$it_.'" LIMIT 1');
-                            mysql_query('INSERT INTO `items_text` (`item_id`,`time`,`login`,`text`,`city`,`x`,`type`) VALUES ("'.$it_.'","'.time().'","","'.mysql_real_escape_string($trnt).'","'.$u->info['city'].'","1","1")');
-                            mysql_query('DELETE FROM `items_users` WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-                            $u->error = '�� �������� �������...';
-                            
-                          } else {
-                            $u->error = '������������ ������ � ����� ������...';
-                          }
-                        }elseif($itm['magic_inci']=='tactic') {
-							//������ �������
-							if( $u->stats['hpNow'] >= 1 ) {
-							
-									$bu = mysql_fetch_array(mysql_query('SELECT * FROM `tactic` WHERE `btl` = "'.$u->info['battle'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1'));
-									if(isset($bu['id'])) {
-										$u->error = '������ ������������ ������ ������ ���...';
-									}else{
-										//
-										mysql_query('INSERT INTO `tactic` (`btl`,`uid`,`time`,`item_id`,`var`,`hod`) VALUES ("'.$u->info['battle'].'","'.$u->info['id'].'","'.time().'","'.$itm['item_id'].'","'.$itm['name'].'","1")');
-										//
-										mysql_query('INSERT INTO `battle_actions` (`uid`,`btl`,`time`,`vars`,`vals`) VALUES (
-											"'.$u->info['id'].'","'.$u->info['battle'].'","'.time().'","use_cast_tactic",""
-										)');
-										$u->info['tactic'.$st['addtac']] += $st['addtacv'];
-										mysql_query('UPDATE `stats` SET `tactic'.$st['addtac'].'` = "'.$u->info['tactic'.$st['addtac']].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-										//��������� ���
-										if( $u->info['sex'] == 0 ) {
-											$txt_m = '{u1} �������� ���������� &quot;<b>'.$itm['name'].'</b>&quot;.';
-										}else{
-											$txt_m = '{u1} ��������� ���������� &quot;<b>'.$itm['name'].'</b>&quot;.';
-										}
-										$this->inBattleLog($txt_m,NULL);
-										mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.($itm['iznosNOW'] + 1).'" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-										$u->error = '�������� &quot;'.$itm['name'].'&quot; ���� ������� ������������';
-									}
-							}else{
-								$u->error = '�� �������...';
-							}
-						}elseif($itm['magic_inci']=='add_animal')
-						{
-							if($u->info['animal']>0)
-							{
-								$u->error = '�� ������� ������������ "'.$itm['name'].'", � ��� ��� ���� �����.';
-							}else{
-								$anm = array('type'=>1,'name'=>'','obraz'=>'','stats'=>'','sex'=>0);
-								
-								//�������� ��� �����
-								
-								if($itm['name'] == '�������� ����') {
-									$anm['type'] = 2;
-								}elseif($itm['name'] == '�������� ��������') {
-									$anm['type'] = 3;
-								}elseif($itm['name'] == '�������� ����') {
-									$anm['type'] = 1;
-								}elseif($itm['name'] == '�������� �������') {
-
-									$anm['type'] = 4;
-								}elseif($itm['name'] == '�������� �����') {
-									$anm['type'] = 6;
-								}elseif($itm['name'] == '�������� ���') {
-									$anm['type'] = 5;
-								}
-								
-								if($anm['type']==1)
-								{
-									$anm['name'] = '���';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'20864.gif',2=>'21301.gif',3=>'21139.gif',4=>'20427.gif');
-									$anm['stats'] = 's1=2|s2=5|s3=2|s4=5|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==2)
-								{
-									$anm['name'] = '����';
-									$anm['sex'] = 1;
-									$anm['obraz'] = array(1=>'21415.gif',2=>'21722.gif',3=>'21550.gif');
-									$anm['stats'] = 's1=2|s2=2|s3=5|s4=5|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==3)
-								{
-									$anm['name'] = '�������';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'22277.gif',2=>'22265.gif',3=>'22333.gif',4=>'22298.gif');
-									$anm['stats'] = 's1=3|s2=10|s3=3|s4=4|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==4)
-								{
-									$anm['name'] = '�������';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'22177.gif',2=>'21976.gif',3=>'21877.gif');
-									$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==5)
-								{
-									$anm['name'] = '���';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'22352.gif',2=>'23024.gif',3=>'22900.gif',4=>'22501.gif',5=>'22700.gif');
-									$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';									
-								}elseif($anm['type']==6)
-								{
-									$anm['name'] = '����';
-									$anm['sex'] = 0;
-									$anm['obraz'] = array(1=>'24000.gif',2=>'25000.gif',3=>'27000.gif',4=>'28000.gif');
-									$anm['stats'] = 's1=5|s2=3|s3=3|s4=5|rinv=40|m9=5|m6=10';									
-								}
-								$anm['obraz'] = $anm['obraz'][rand(1,count($anm['obraz']))];
-								$anm['obraz'] = str_replace('.gif','',$anm['obraz']);
-								$anm['obraz'] = str_replace('.jpg','',$anm['obraz']);
-								$anm['obraz'] = str_replace('.png','',$anm['obraz']);
-								$ins = mysql_query('INSERT INTO `users_animal` (`type`,`name`,`uid`,`obraz`,`stats`,`sex`) VALUES ("'.$anm['type'].'","'.$anm['name'].'","'.$u->info['id'].'","'.$anm['obraz'].'","'.$anm['stats'].'","'.$anm['sex'].'")');
-								if($ins)
-								{
-									
-									$u->info['animal'] = mysql_insert_id();
-									mysql_query('UPDATE `users` SET `animal` = "'.$u->info['animal'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
-									$u->error = '�� ������� ������������ "'.$itm['name'].'" � ������� - &quot;�� � ������ �� ���, ���� ���������&quot;.';
-									$itm['iznosNOW']++;
-									mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-									if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-										mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-									}
-									$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-								}else{
-									$u->error = '�� ������� ������������ "'.$itm['name'].'", ���-�� ����� �� ��� ...';
-								}
-							}
-						}elseif($goodUse == 1)
-						{
-							if($itm['magic_inc'] == '') {
-								$itm['magic_inc'] = $itm['magic_inci'];
-							}
-							$us = $this->add_eff($u->info['id'],$itm['magic_inc']);
-							if($us[0]==1)
-							{
-								$itm['iznosNOW']++;
-								mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$itm['iznosNOW'].'" WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-								if($itm['inGroup'] > 0 && $itm['delete'] == 0) {
-									mysql_query('UPDATE `items_users` SET `inGroup` = "0", `delete` = "0" WHERE `id` = "'.$itm['id'].'" LIMIT 1');
-								}
-								$u->addDelo(1,$u->info['id'],'&quot;<font color="maroon">System.inventory</font>&quot;: �������� ����������� ���������� &quot;'.$itm['name'].'&quot; ('.$us[1].') [itm:'.$itm['id'].'].',time(),$u->info['city'],'System.inventory',0,0);
-								$this->youuse++;
-								$u->error = '�� ������� ������������ ���������� &quot;'.$itm['name'].'&quot;<br>'.$us[1].'';
-								//$rtxt = '[img[items/'.$itm['img'].']] &quot;'.$u->info['login'].'&quot; �����������'.$sx.' ���������� &quot;'.$itm['name'].'&quot; �� ����.';
-								//mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('1','".$u->info['city']."','".$u->info['room']."','','','".$rtxt."','".time()."','11','0','1')");	
-							}else{
-								if($u->error != '') {
-									$u->error = '�� ������� ������������ "'.$itm['name'].'"...<br>'.$u->error;
-								}else{
-									$u->error = '�� ������� ������������ "'.$itm['name'].'"...';
-								}
-							}
-						}else{
-							if($u->error != '') {
-								$u->error = '�� ������� ������������ "'.$itm['name'].'"<br>'.$u->error;
-							}else{
-								$u->error = '�� ������� ������������ "'.$itm['name'].'"';
-							}
-						}
-					}
-				 //------------------------------
-				}				
-			}
-			if( $goodUse == 1 ) {
-				mysql_query('UPDATE `items_users` SET `lastUPD` = '.time().' WHERE `id` = "'.$itm['id'].'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
-			}
-		}else{
-			$u->error = '������� �� ������ � ���������';
-		}
-	}
-
-
-	public function add_eff($uid,$id,$is_no = NULL)
-	{
-		$g = array(0=>0,1=>'');
-		$eff = mysql_fetch_array(mysql_query('SELECT * FROM `eff_main` WHERE `id2` = "'.$id.'" LIMIT 1'));	
-		
-		if($is_no != NULL) {
-			//��������� ������ ���������
-			if($eff['onlyOne'] > 0)
-			{
-				//������� ������� �������
-				$goodUse = 0;
-				$upd1 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$uid.'" AND `delete` = "0" AND `id_eff` = "'.$eff['id2'].'"');
-				if($upd1)
-				{
-					$goodUse = 1;
-				}
-			}
-			if($st['oneType'] > 0)
-			{
-				//������� ������� �������
-				$goodUse = 0;
-				$upd2 = mysql_query('UPDATE `eff_users` SET `delete` = "'.time().'" WHERE `uid` = "'.$uid.'" AND `delete` = "0" AND `overType` = "'.$eff['overType'].'"');
-				if($upd2)
-				{
-					$goodUse = 1;
-				}
-			}
-		}
-		if($goodUse == 1 || $is_no == NULL) {
-			if(isset($eff['id2']))
-			{
-				//$eff = $this->paguba($eff);
-				$n = $eff['mname'];
-				$d = $eff['mdata'];
-				$ins = mysql_query('INSERT INTO `eff_users` (`overType`,`id_eff`,`uid`,`name`,`timeUse`,`data`,`no_Ace`) VALUES ("'.$eff['oneType'].'","'.$eff['id2'].'","'.$uid.'","'.$n.'","'.time().'","'.$d.'","'.$eff['noAce'].'")');
-				if($ins)
-				{
-					$g[0] = 1;
-					$g[1] = '...';
-				}
-			}
-		}
-		return $g;
-	}
-	
-	//�������� ����������� � ��������, ���� �����������
-	public function testAlignAtack( $u1 , $u2 , $btl_test ) {
-		$r = true;
-		if( $btl_test['type'] != 500 && $btl_test['dn_id'] == 0 && $btl_test['team_win'] == -1 ) { 
-			$u1 = mysql_fetch_array(mysql_query('SELECT `id`,`align` FROM `users` WHERE `id` = "'.mysql_real_escape_string($u1).'" LIMIT 1'));
-			$u2 = mysql_fetch_array(mysql_query('SELECT `id`,`team` FROM `stats` WHERE `id` = "'.mysql_real_escape_string($u2).'" LIMIT 1'));
-			$u1['align'] = floor($u1['align']);
-			$tm = $tm[$u1['team']];
-			$no_align = array();
-			if( $u1['align'] == 1 ) {
-				$no_align[3] = true;
-			}elseif( $u1['align'] == 3 ) {
-				$no_align[1] = true;
-			}
-			
-			$sp = mysql_query('SELECT `u`.`align`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `st`.`id` = `u`.`id` WHERE `u`.`battle` = "'.$btl_test['id'].'" AND `st`.`team` != "'.$u2['team'].'"');
-			while( $pl = mysql_fetch_array($sp) ) {
-				if( $no_align[floor($pl['align'])] == true ) {
-					$r = false;
-				}
-			}
-		}
-		return $r;
-	}
-	
-	//�������� ������
-	public function testTravma( $uid , $vals ) {
-		$r = false;		
-		$tr_pl = mysql_fetch_array(mysql_query('SELECT `id`,`v1` FROM `eff_users` WHERE `id_eff` = 4 AND `uid` = "'.$uid.'" AND `delete` = "0" ORDER BY `v1` DESC LIMIT 1'));
-		if( isset($tr_pl['id']) && $tr_pl['v1'] >= $vals ) {
-			$r = true;
-		}
-		return $r;
-	}
-	
-	//������� ��������� �� ���������
-	public function atackUser($uid1, $uid2, $tm, $btl, $addExp = 0, $type = 0, $kulak = 0, $bsid = 0) {
-		global $u;
-		$usr = mysql_fetch_array(mysql_query('SELECT `u`.*,`s`.* FROM `users` AS `u` LEFT JOIN `stats` AS `s` ON `u`.`id` = `s`.`id` WHERE `u`.`id` = "'.$uid2.'" LIMIT 1'));
-		$btl_test = mysql_fetch_array(mysql_query('SELECT * FROM `battle` WHERE `id` = "'.$btl.'" AND `team_win` = -1 LIMIT 1'));
-		$good = 0;
-		//������� ��-�� ������� ������ ��������
-		$efsno = mysql_fetch_array(mysql_query('SELECT * FROM `eff_users` WHERE `uid` = "'.$uid2.'"
-		AND `name` LIKE "%����� ������%" AND `delete` = "0"
-		LIMIT 1'));		
-		if( $usr['no_ip'] == 'trupojor' && $usr['level'] != $u->info['level'] ) {
-			$u->error = '������ �������� �� ������� ����� ������!';
-		}elseif( $u->info['level'] > $usr['level']+1 ) {
-			$u->error = '�� ������� ������ ��� ����� ���';
-		}elseif( isset($btl_test['id']) && $btl_test['noatack'] > 0 ) {
-			$u->error = '�������� ������� ������! �� �� ������ ���������!';
-		}elseif($usr['level'] < 8) {
-			$u->error = '������� ��������� ��� ������� �����������...';
-		}elseif($u->info['level'] < 8) {
-			$u->error = '������������ ��� ���� ��� ����...';
-		}elseif( isset($efsno['id']) && $efsno['delete'] > 0 ) {
-			$u->error = '���������� �������, ��������� ���-�� �����...';
-			}elseif($usr['admin']==1 && $u->info['admin'] == 0 ) {
-			$u->error = '�� ���� ��������, �����?';
-		}elseif($this->testTravma($uid2 , 3) == true) {
-			$u->error = '��������� ������ �����������, ������ �������!';
-		} elseif($this->testTravma($uid1 , 2) == true) {
-			$u->error = '�� ������������, ������ �������!';
-        } elseif($bsid != 0 && ($u->info['x'] != $usr['x'] || $u->info['y'] != $usr['y'] )) {
-            $u->error = '�� ���������� � ������ ��������...';
-		} elseif($usr['clan'] != 0 && ($usr['clan'] == $u->info['clan']) && $u->info['admin'] == 0) {
-			$u->error = '����� ����� ����� ��������.';
-		} elseif($btl == 0) {
-			$s01 = $u->getStats($uid1,0);
-			if($s01['hpNow'] < floor($s01['hpAll']/100*33) ) {
-				$u->error = '������ �������, � ���������� �� �������������� ��������';
-			} else {
-				$addExp += $usr['bbexp'];
-				//�������� �� ���������
-				$ins = mysql_query('INSERT INTO `battle` (`kulak`,`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`, `inTurnir`) VALUES (
-																		"'.$kulak.'",
-																		"'.$u->info['city'].'",
-																		"'.time().'",
-																		"'.$u->info['login'].','.$usr['login'].'",
-																		"180",
-																		"'.$type.'",
-																		"0",
-																		"0",
-																		"50",
-																		"9",
-																		"'.$addExp.'",
-																		"0", "'.$bsid.'")');
-				if($ins)
-				{
-					$btl_id = mysql_insert_id();
-					//��������� �� � �� �������
-					if($s01['level']<=7)
-					{
-						$s01['tactic7'] = floor(10/$s01['hpAll']*$s01['hpNow']);
-					}elseif($s01['level']==8)
-					{
-						$s01['tactic7'] = floor(20/$s01['hpAll']*$s01['hpNow']);
-					}elseif($s01['level']==9)
-					{
-						$s01['tactic7'] = floor(30/$s01['hpAll']*$s01['hpNow']);
-					}elseif($s01['level']>=10)
-					{
-						$s01['tactic7'] = floor(40/$s01['hpAll']*$s01['hpNow']);
-					}
-					$s01 = array( 'hpAll' => $s01['hpAll'] , 'hpNow' => $s01['hpNow'] , 'mpAll' => $s01['mpAll'] , 'mpNow' => $s01['mpNow']  );
-					$s02 = $u->getStats($uid2,0);
-					if($s02['level']<=7)
-					{
-						$s02['tactic7'] = floor(10/$s02['hpAll']*$s02['hpNow']);
-					}elseif($s02['level']==8)
-					{
-						$s02['tactic7'] = floor(20/$s02['hpAll']*$s02['hpNow']);
-					}elseif($s02['level']==9)
-					{
-						$s02['tactic7'] = floor(30/$s02['hpAll']*$s02['hpNow']);
-					}elseif($s02['level']>=10)
-					{
-						$s02['tactic7'] = floor(40/$s02['hpAll']*$s02['hpNow']);
-					}
-						
-					//����������, ��������
-					if( $s01['s7'] > 49 ) {
-						mysql_query("
-							INSERT INTO `eff_users` ( `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
-							( 22, '".$s01['id']."', '��������', 'add_spasenie=1', 0, 77, 0, '".$s01['id']."', 0, 'priem', 324, 'preservation.gif', 1, -1, '��������', 0, 0, '', 0, 0, 0, 1, 0);
-						");
-					}					
-					if( $s02['s7'] > 49 ) {
-						mysql_query("
-							INSERT INTO `eff_users` ( `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
-							( 22, '".$s02['id']."', '��������', 'add_spasenie=1', 0, 77, 0, '".$s02['id']."', 0, 'priem', 324, 'preservation.gif', 1, -1, '��������', 0, 0, '', 0, 0, 0, 1, 0);
-						");
-					}
-					//
-					
-					$s02 = array( 'hpAll' => $s02['hpAll'] , 'hpNow' => $s02['hpNow'] , 'mpAll' => $s02['mpAll'] , 'mpNow' => $s02['mpNow']  );				
-					
-					
-					$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$uid1.'" OR `id` = "'.$uid2.'" LIMIT 2');
-							 mysql_query('UPDATE `stats` SET `lider` = "'.$btl_id.'",`tactic7` = "'.$s01['tactic7'].'",`hpNow` = "'.$s01['hpNow'].'",`mpNow` = "'.$s01['mpNow'].'",`team`="1",`zv` = "0" WHERE `id` = "'.$uid1.'" LIMIT 1');
-							 mysql_query('UPDATE `stats` SET `lider` = "'.$btl_id.'",`tactic7` = "'.$s02['tactic7'].'",`hpNow` = "'.$s02['hpNow'].'",`mpNow` = "'.$s02['mpNow'].'",`team`="2",`zv` = "0" WHERE `id` = "'.$uid2.'" LIMIT 1');
-					
-					if( $kulak > 0 || $btl_test['kulak'] > 0 ) {
-						mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE ( `uid` = "'.$uid1.'" OR `uid` = "'.$uid2.'" ) AND `delete` = "0"');
-					}
-					
-					$good = $btl_id;
-                    if($bsid != 0) {
-                        $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$u->info['inTurnir'].'" LIMIT 1'));
-                      if($u->info['sex'] == 0) {
-                        $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} ����� �� {u2} ��������� ��� <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  } else {
-	                    $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} ������ �� {u2} ��������� ��� <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  }
-                      $usr_real = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `clan`, `battle`, `level` FROM `users` WHERE (`inUser` = "'.$usr['id'].'" OR `id` = "'.$usr['id'].'") LIMIT 1'));
-                      if(!isset($usr_real['id'])) { $usr_real = $usr; }
-                      if(isset($usr_real['id'])) {
-                        $usrreal = '';
-                        if($usr_real['align'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/align/align'.$usr_real['align'].'.gif width=12 height=15 >'; }
-                        if($usr_real['clan'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/clan/'.$usr_real['clan'].'.gif width=24 height=15 >'; }
-                        $usrreal .= '<b>'.$usr_real['login'].'</b>['.$usr_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$usr_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-                      } else {
-                        $usrreal = '<i>���������</i>[??]';
-                      }
-                      $me_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$u->info['id'].'" AND `login` = "'.$u->info['login'].'" LIMIT 1'));
-                      if(isset($me_real['id'])) {
-					    $mereal = '';
-					    if($me_real['align'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/align/align'.$me_real['align'].'.gif width=12 height=15 >'; }
-					    if($me_real['clan'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/clan/'.$me_real['clan'].'.gif width=24 height=15 >'; }
-					    $mereal .= '<b>'.$me_real['login'].'</b>['.$me_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$me_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-				      } else {
-					    $mereal = '<i>���������</i>[??]';
-				      }
-                      $text = str_replace('{u1}', $mereal, $text);
-				      $text = str_replace('{u2}', $usrreal, $text);
-                      mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES (
-					  "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$bs['id'].'", "'.$bs['count'].'", "'.$bs['city'].'",
-					  "'.round($bs['money']*0.85,2).'","'.$i.'")');
-				      unset($text, $usrreal, $mereal, $usr_real, $me_real);
-                    }
-				}
-			}
-		}elseif( isset($btl_test['id']) && $btl_test['type'] == 500 && $usr['team'] == 1 ){
-			$u->error = '������ ��������� �� ������� ��������!';
-		}elseif( isset($btl_test['id']) && $btl_test['invis'] > 0 ){
-			$u->error = '������ ����������� � ��������� ���!';
-		}elseif( $btl_test['noatack'] > 0 ) {
-			$u->error = '� ���� �������� ������ �����������!';
-		}else{
-			//����������� � ���
-			$upd = mysql_query('UPDATE `users` SET `battle`="'.$btl.'" WHERE `id` = "'.$uid1.'" LIMIT 1');
-			if($upd)
-			{
-				
-				if( $kulak > 0 || $btl_test['kulak'] > 0 ) {
-					mysql_query('UPDATE `items_users` SET `inOdet` = "0" WHERE `uid` = "'.$uid1.'" AND `delete` = "0"');
-				}
-				
-				$uid1st = $u->getStats($uid1);
-				$uid1u = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`level`,`clan`,`align`,`sex` FROM `users` WHERE `id` = "'.$uid1.'" LIMIT 1'));
-				
-				if($uid1u['level']<=7)
-				{
-					$uid1st['tactic7'] = floor(10/$uid1st['hpAll']*$uid1st['hpNow']);
-				}elseif($uid1u['level']==8)
-				{
-					$uid1st['tactic7'] = floor(20/$uid1st['hpAll']*$uid1st['hpNow']);
-				}elseif($uid1u['level']==9)
-				{
-					$uid1st['tactic7'] = floor(30/$uid1st['hpAll']*$uid1st['hpNow']);
-				}elseif($uid1u['level']>=10)
-				{
-					$uid1st['tactic7'] = floor(40/$uid1st['hpAll']*$uid1st['hpNow']);
-				}else{
-					$uid1st['tactic7'] = floor(10/$uid1st['hpAll']*$uid1st['hpNow']);
-				}
-				
-				//����������, ��������
-				if( $uid1st['s7'] > 49 ) {
-					mysql_query("
-						INSERT INTO `eff_users` ( `id_eff`, `uid`, `name`, `data`, `overType`, `timeUse`, `timeAce`, `user_use`, `delete`, `v1`, `v2`, `img2`, `x`, `hod`, `bj`, `sleeptime`, `no_Ace`, `file_finish`, `tr_life_user`, `deactiveTime`, `deactiveLast`, `mark`, `bs`) VALUES
-						( 22, '".$uid1st['id']."', '��������', 'add_spasenie=1', 0, 77, 0, '".$uid1st['id']."', 0, 'priem', 324, 'preservation.gif', 1, -1, '��������', 0, 0, '', 0, 0, 0, 1, 0);
-					");
-				}
-				
-				
-				$btxt = '';
-				if( $uid1u['align'] > 0 ) {
-					$btxt = $btxt.'<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$uid1u['align'].'.gif >';
-				}
-				if( $uid1u['align2'] > 0 ) {
-					$btxt = $btxt.'<img width=12 height=15 src=https://img.new-combats.com/i/align/align'.$uid1u['align2'].'.gif >';
-				}
-				if( $uid1u['clan'] > 0 ) {
-					$btxt = $btxt.'<img width=24 height=15 src=https://img.new-combats.com/i/clan/'.$uid1u['clan'].'.gif >';
-				}
-				$btxt = $btxt.'<b>{u1}</b>['.$uid1u['level'].']<a href=info/'.$uid1u['id'].' target=_blank ><img width=12 height=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-				if( $uid1u['sex'] == 1 ) {
-					$btxt = $btxt.' ��������� � ��������.';
-				}else{
-					$btxt = $btxt.' �������� � ��������.';
-				}
-				
-				if( $kulak > 0 ) {
-					$btxt .= ' (�������� ���������)';
-				}
-				
-				$lastHOD = mysql_fetch_array(mysql_query('SELECT * FROM `battle_logs` WHERE `battle` = "'.$btl.'" ORDER BY `id_hod` DESC LIMIT 1'));
-				if(isset($lastHOD['id'])) {
-					$id_hod = $lastHOD['id_hod'];
-					if($lastHOD['type']!=6) {
-						$id_hod++;
-					}
-					mysql_query('INSERT INTO `battle_logs` (`time`,`battle`,`id_hod`,`text`,`vars`,`zona1`,`zonb1`,`zona2`,`zonb2`,`type`) VALUES ("'.time().'","'.$btl.'","'.($id_hod).'","{tm1} '.$btxt.'","login1='.$uid1st['login'].'||t1='.$uid1st['team'].'||login2='.$uid1st['login'].'||t2='.$uid1st['team'].'||time1='.time().'","","","","","6")');
-				}
-				
-				// ���� ����� animal_bonus ---------------------------------
-						if($u->info['animal'] > 0) {
-							$a = mysql_fetch_array(mysql_query('SELECT * FROM `users_animal` WHERE `uid` = "'.$u->info['id'].'" AND `id` = "'.$u->info['animal'].'" AND `pet_in_cage` = "0" AND `delete` = "0" LIMIT 1'));
-							if(isset($a['id'])) {
-								if($a['eda']>=1) {
-									$anl = mysql_fetch_array(mysql_query('SELECT `bonus` FROM `levels_animal` WHERE `type` = "'.$a['type'].'" AND `level` = "'.$a['level'].'" LIMIT 1'));
-									$anl = $anl['bonus'];
-									
-									$tpa = array(1=>'cat',2=>'owl',3=>'wisp',4=>'demon',5=>'dog',6=>'pig',7=>'dragon');
-									$tpa2 = array(1=>'����',2=>'����',3=>'��������',4=>'�������',5=>'���',6=>'�����',7=>'�������');
-									$tpa3 = array(1=>'������� ��������',2=>'�������� ����',3=>'���� ������',4=>'������������ ����',5=>'����',6=>'������ �����',7=>'�������');
-									
-									mysql_query('INSERT INTO `eff_users` (`hod`,`v2`,`img2`,`id_eff`,`uid`,`name`,`data`,`overType`,`timeUse`,`v1`,`user_use`) VALUES ("-1","201","summon_pet_'.$tpa[$a['type']].'.gif",22,"'.$u->info['id'].'","'.$tpa3[$a['type']].' ['.$a['level'].']","'.$anl.'","0","77","priem","'.$u->info['id'].'")');
-									
-									/*$anl = $u->lookStats($anl);
-									
-									$vLog = 'time1='.time().'||s1='.$u->info['sex'].'||t1='.$u->info['team'].'||login1='.$u->info['login'].'';
-									$vLog .= '||s2=1||t2='.$u->info['team'].'||login2='.$a['name'].' (����� '.$u->info['login'].')';
-									
-									$mas1 = array('time'=>time(),'battle'=>$btl,'id_hod'=>1,'text'=>'','vars'=>$vLog,'zona1'=>'','zonb1'=>'','zona2'=>'','zonb2'=>'','type'=>'1');
-									
-									$ba = '';
-									$i6 = 0;
-									while($i6<count($u->items['add'])) {
-										if(isset($anl['add_'.$u->items['add'][$i6]])) {
-											if($anl['add_'.$u->items['add'][$i6]] > 0) {
-												$ba .= $u->is[$u->items['add'][$i6]].': +'.$anl['add_'.$u->items['add'][$i6]].', ';
-											}
-										}
-										$i6++;
-									}
-									$ba = trim($ba,', ');
-									if($ba == '') {
-										$ba = '������ ����������';
-									}
-									*/
-									//$mas1['text'] = '{tm1} {u2} ������� �� ���������, � ������� �������� &quot;<b>'.$tpa3[$a['type']].' ['.$a['level'].']</b>&quot; �� {u1}. ('.$ba.')';
-									//$nxtlg[count($nxtlg)] = $mas1;
-									//mysql_query('UPDATE `users_animal` SET `eda` = `eda` - 1 WHERE `id` = "'.$a['id'].'" LIMIT 1');
-									//$btl->add_log($mas1);
-									//$btl->get_comment();*/
-								}else{
-									$u->send('',$u->info['room'],$u->info['city'],'',$u->info['login'],'<b>'.$a['name'].'</b> ��������� � ���...',time(),6,0,0,0,1);
-								}
-							}
-						}
-				// ���� ����� animal_bonus ---------------------------------
-				$ltm = array(1=>2, 2=>1);
-				mysql_query('UPDATE `stats` SET `hpNow` = "'.$uid1st['hpNow'].'",`mpNow` = "'.$uid1st['mpNow'].'",`team`="'.$ltm[$tm].'",`tactic7`="'.(0+$uid1st['tactic7']).'" WHERE `id` = "'.$uid1.'" LIMIT 1');
-				$good = $btl;
-				unset($uid1st);
-                if($bsid != 0) {
-                    $bs = mysql_fetch_array(mysql_query('SELECT * FROM `bs_turnirs` WHERE `id` = "'.$u->info['inTurnir'].'" LIMIT 1'));
-                      if($u->info['sex'] == 0) {
-                        $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} �������� � �������� ������ {u2} <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  } else {
-	                    $text = '<img src="https://img.new-combats.com/i/items/atackk.gif" /> {u1} ��������� � �������� ������ {u2} <a target=_blank href=/logs.php?log='.$btl_id.' >��</a>';
-	                  }
-                      $usr_real = mysql_fetch_array(mysql_query('SELECT `id`, `login`, `align`, `clan`, `battle`, `level` FROM `users` WHERE `inUser` = "'.$usr['id'].'" LIMIT 1'));
-                      if(!isset($usr_real['id'])) { $usr_real = $usr; }
-                      if(isset($usr_real['id'])) {
-                        $usrreal = '';
-                        if($usr_real['align'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/align/align'.$usr_real['align'].'.gif width=12 height=15 >'; }
-                        if($usr_real['clan'] > 0) { $usrreal .= '<img src=https://img.new-combats.com/i/clan/'.$usr_real['clan'].'.gif width=24 height=15 >'; }
-                        $usrreal .= '<b>'.$usr_real['login'].'</b>['.$usr_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$usr_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-                      } else {
-                        $mereal = '<i>���������</i>[??]';
-                      }
-                      $me_real = mysql_fetch_array(mysql_query('SELECT `id`,`login`,`align`,`clan`,`battle`,`level` FROM `users` WHERE `inUser` = "'.$u->info['id'].'" AND `login` = "'.$u->info['login'].'" LIMIT 1'));
-                      if(isset($me_real['id'])) {
-					    $mereal = '';
-					    if($me_real['align'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/align/align'.$me_real['align'].'.gif width=12 height=15 >'; }
-					    if($me_real['clan'] > 0) { $mereal .= '<img src=https://img.new-combats.com/i/clan/'.$me_real['clan'].'.gif width=24 height=15 >'; }
-					    $mereal .= '<b>'.$me_real['login'].'</b>['.$me_real['level'].']<a target=_blank href=https://new-combats.com/info/'.$me_real['id'].' ><img width=12 hiehgt=11 src=https://img.new-combats.com/i/inf_capitalcity.gif ></a>';
-				      } else {
-					    $mereal = '<i>���������</i>[??]';
-				      }
-                      $text = str_replace('{u1}', $mereal, $text);
-				      $text = str_replace('{u2}', $usrreal, $text);
-                      mysql_query('INSERT INTO `bs_logs` (`type`,`text`,`time`,`id_bs`,`count_bs`,`city`,`m`,`u`) VALUES (
-					  "1", "'.mysql_real_escape_string($text).'", "'.time().'", "'.$bs['id'].'", "'.$bs['count'].'", "'.$bs['city'].'",
-					  "'.round($bs['money']*0.85,2).'","'.$i.'")');
-				      unset($text,$usrreal,$mereal,$usr_real,$me_real);
-                    }
-			}
-		}
-		return $good;
-	}
-	
-	//��������� �� ����������� �������
- public function magicCentralAttack() {
-   global $c, $code, $u, $re;
- }
-}
-
-$magic = new Magic;
-
-?>
\ No newline at end of file
diff --git a/modules_data/location/__zv.php b/modules_data/location/__zv.php
index 6edd27c0..f94d3faf 100644
--- a/modules_data/location/__zv.php
+++ b/modules_data/location/__zv.php
@@ -1,782 +1,826 @@
 <?
-if (!defined('GAME')) {
-    die();
+if(!defined('GAME'))
+{
+	die();
 }
 
 class zayvki
 {
-    public $zv_see, $error, $z1n = [4 => '���������', 5 => '���������'], $z2n = [4 => '����������', 5 => '����������'];
-
-    public function test()
-    {
-        global $code, $c, $u;
-        //��������� ��������� � ��������� ��� � ���� ������
-        $sp = mysql_query('SELECT * FROM `zayvki` AS `z` WHERE `z`.`city` = "' . $u->info['city'] . '" AND `z`.`btl_id` = "0" AND `z`.`cancel` = "0"  AND `z`.`start` = "0" AND (`z`.`razdel` = 4 OR `z`.`razdel` = 5) ORDER BY `z`.`id` DESC LIMIT 11');
-        while ($pl = mysql_fetch_array($sp)) {
-            $uz = mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $pl['id'] . '"');
-            $tm1 = [];
-            $tm2 = [];
-            $i = [];
-            $toChat = '';
-            $toWhere = '';
-            while ($t = mysql_fetch_array($uz)) {
-                if (!isset(${'tm' . $t['team']})) {
-                    ${'tm' . $t['team']} = [];
-                }
-                if (!isset($i[$t['team']])) {
-                    $i[$t['team']] = 0;
-                }
-                ${'tm' . $t['team']}[$i[$t['team']]] = $t;
-                $toChat .= '' . $t['login'] . ',';
-                $toWhere .= 'OR `id` = "' . $t['id'] . '" ';
-                $i[$t['team']]++;
-            }
-            if ($pl['time_start'] < time() - $pl['time'] || ($pl['razdel'] == 4 && $i[1] >= $pl['tm1max'] && $i[2] >= $pl['tm2max'])) {
-                $toChat = rtrim($toChat, ',');
-                $toWhere = ltrim($toWhere, 'OR ');
-                if ($pl['razdel'] == 4) {
-                    //������
-                    if (!isset($i[1]) || !isset($i[2])) {
-                        //������ �� �������
-                        $this->cancelGroup($pl, $toChat);
-                    } else {
-                        //�������� ��������
-                        $this->startBattle($pl['id'], $toChat . '|-|' . $toWhere);
-                    }
-                } elseif ($pl['razdel'] == 5) {
-                    //�����
-                    if ($i[1] + $i[2] < 4) {
-                        //������ �� �������
-                        $this->cancelGroup($pl, $toChat);
-                    } else {
-                        //�������� ��������
-                        $this->startBattle($pl['id'], $toChat . '|-|' . $toWhere);
-                    }
-                }
-            }
-        }
-    }
-
-    public function userInfo()
-    {
-        global $u, $c;
-        $r = '';
-        if ($u->stats['mpAll'] > 0) {
-            $pm = $u->stats['mpNow'] / $u->stats['mpAll'] * 100;
-        }
-        $ph = $u->stats['hpNow'] / $u->stats['hpAll'] * 100;
-        $dp = '';
-        if ($u->stats['mpAll'] <= 0) {
-            $dp = 'margin-top:13px;';
-        }
-        $r .= '<table border="0" cellspacing="0" cellpadding="0" height="20">
-<tr><td valign="middle"> &nbsp; <font>' . $u->microLogin($u->info['id'], 1) . '</font> &nbsp; </td>
+	public $zv_see,$error,$z1n = array(4=>'���������',5=>'���������'),$z2n = array(4=>'����������',5=>'����������');
+	
+	public function test()
+	{
+		global $code,$c,$u;
+		//��������� ��������� � ��������� ��� � ���� ������		
+		$sp = mysql_query('SELECT * FROM `zayvki` AS `z` WHERE `z`.`city` = "'.$u->info['city'].'" AND `z`.`btl_id` = "0" AND `z`.`cancel` = "0"  AND `z`.`start` = "0" AND (`z`.`razdel` = 4 OR `z`.`razdel` = 5) ORDER BY `z`.`id` DESC LIMIT 11');
+		while($pl = mysql_fetch_array($sp))
+		{
+			$uz = mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$pl['id'].'"');
+			$tm1 = array();
+			$tm2 = array();
+			$i = array();
+			$toChat = '';
+			$toWhere = '';
+			while($t = mysql_fetch_array($uz))
+			{
+				if(!isset(${'tm'.$t['team']})){ ${'tm'.$t['team']} = array(); }
+				if(!isset($i[$t['team']])){ $i[$t['team']] = 0; }
+				${'tm'.$t['team']}[$i[$t['team']]] = $t;
+				$toChat .= ''.$t['login'].',';
+				$toWhere .= 'OR `id` = "'.$t['id'].'" ';
+				$i[$t['team']]++;
+			}
+			if($pl['time_start'] < time()-$pl['time'] || ($pl['razdel']==4 && $i[1]>=$pl['tm1max'] && $i[2]>=$pl['tm2max']))
+			{
+				$toChat = rtrim($toChat,',');
+				$toWhere = ltrim($toWhere,'OR ');
+				if($pl['razdel']==4)
+				{
+					//������
+					if(!isset($i[1]) || !isset($i[2]))
+					{
+						//������ �� �������
+						$this->cancelGroup($pl,$toChat);
+					}else{
+						//�������� ��������
+						$this->startBattle($pl['id'],$toChat.'|-|'.$toWhere);
+					}
+				}elseif($pl['razdel']==5)
+				{
+					//�����
+					if($i[1]+$i[2]<4)
+					{
+						//������ �� �������
+						$this->cancelGroup($pl,$toChat);
+					}else{
+						//�������� ��������
+						$this->startBattle($pl['id'],$toChat.'|-|'.$toWhere);
+					}
+				}
+			}
+		}
+	}
+	
+	public function userInfo()
+	{
+		global $u,$c;
+			$r = '';
+			if($u->stats['mpAll']>0)
+			{
+				$pm = $u->stats['mpNow']/$u->stats['mpAll']*100;
+			}
+			$ph = $u->stats['hpNow']/$u->stats['hpAll']*100;
+			$dp = '';
+			if($u->stats['mpAll']<=0)
+			{
+				$dp = 'margin-top:13px;';
+			}
+			$r .= '<table border="0" cellspacing="0" cellpadding="0" height="20">
+<tr><td valign="middle"> &nbsp; <font>'.$u->microLogin($u->info['id'],1).'</font> &nbsp; </td>
 <td valign="middle" width="120">
-<div style="position:relative;' . $dp . '"><div id="vhp' . ($u->info['id']) . '" title="������� �����" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> ' . floor($u->stats['hpNow']) . '/' . $u->stats['hpAll'] . '</div>
+<div style="position:relative;'.$dp.'"><div id="vhp'.($u->info['id']).'" title="������� �����" align="left" class="seehp" style="position:absolute; top:-10px; width:120px; height:10px; z-index:12;"> '.floor($u->stats['hpNow']).'/'.$u->stats['hpAll'].'</div>
 <div title="������� �����" class="hpborder" style="position:absolute; top:-10px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-<div class="hp_3 senohp" style="height:9px; width:' . floor(120 / 100 * $ph) . 'px; position:absolute; top:-10px; z-index:11;" id="lhp' . ($u->info['id']) . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+<div class="hp_3 senohp" style="height:9px; width:'.floor(120/100*$ph).'px; position:absolute; top:-10px; z-index:11;" id="lhp'.($u->info['id']).'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 <div title="������� �����" class="hp_none" style="position:absolute; top:-10px; width:120px; height:10px; z-index:10;"><img src="https://img.new-combats.com/1x1.gif" height="10"></div>
 ';
-        if ($u->stats['mpAll'] > 0) {
-            $r .= '<div id="vmp' . ($u->info['id']) . '" title="������� ����" align="left" class="seemp" style="position:absolute; top:0px; width:120px; height:10px; z-index:12;"> ' . floor($u->stats['mpNow']) . '/' . $u->stats['mpAll'] . '</div>
+if($u->stats['mpAll']>0)
+{
+	$r .= '<div id="vmp'.($u->info['id']).'" title="������� ����" align="left" class="seemp" style="position:absolute; top:0px; width:120px; height:10px; z-index:12;"> '.floor($u->stats['mpNow']).'/'.$u->stats['mpAll'].'</div>
 <div title="������� ����" class="hpborder" style="position:absolute; top:0px; width:120px; height:9px; z-index:13;"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
-<div class="hp_mp senohp" style="height:9px; position:absolute; top:0px; width:' . floor(120 / 100 * $pm) . 'px; z-index:11;" id="lmp' . ($u->info['id']) . '"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
+<div class="hp_mp senohp" style="height:9px; position:absolute; top:0px; width:'.floor(120/100*$pm).'px; z-index:11;" id="lmp'.($u->info['id']).'"><img src="https://img.new-combats.com/1x1.gif" height="9" width="1"></div>
 <div title="������� ����" class="hp_none" style="position:absolute; top:0px; width:120px; height:10px; z-index:10;"></div>';
-        }
-        $r .= '</div></td></tr></table>';
-        unset($stt, $ph, $pm);
-        return $r;
-    }
+}
+$r .= '</div></td></tr></table>';
+		unset($stt,$ph,$pm);
+		return $r;
+	}
+	
+	public function cancelGroup($zv,$uids)
+	{
+		$upd = mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `zv` = "'.$zv['id'].'"');
+		if($upd)
+		{
+			$upd = mysql_query('UPDATE `zayvki` SET `cancel` = "'.time().'" WHERE `id` = "'.$zv['id'].'"');
+			if($upd)
+			{
+				$text = ' �� ������� ������ �������� �� �������: ������ �� �������.';
+				mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('".$zv['city']."','','','".$uids."','".$text."','".time()."','11','0')");
+			}
+		}
+	}
+	
+	public function add()
+	{
+		global $u,$c,$code;
+		if(isset($_GET['r']))
+		{
+			$r = round(intval($_GET['r']));
+			if($r>=1 && $r<=5)
+			{
+				$az = 1;
+				if($r==1 && $u->info['level']>0){	$az = 0; $this->error = '�� ��� ������� �� ��������� ;)';	}
+				if(($r==2 || $r==3)  && $u->info['level']<1){	$az = 0; $this->error = '�� ��� �� ������� �� ��������� ;)';	}
+				if(($r==4 || $r==5)  && $u->info['level']<2){	$az = 0; $this->error = '� '.$this->z1n[$r].' ��� ������ � ������� ������.';	}
+				if(!isset($_POST['stavkakredit'])){ $_POST['stavkakredit'] = 0; }
+				$money = (int)($_POST['stavkakredit']*100);
+				$money = round(($money/100),2);
+				if($u->info['hpNow']<$u->stats['hpAll']/100*30 && ($r>=1 || $r<=3))
+				{
+					$this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
+					$az = 0;
+				}elseif($r==3 && $money>0 && $u->info['level']<4)
+				{
+					$this->error = '��� �� ������ ���������� � 4-�� ������';
+					$az = 0;
+				}elseif($r==3 && $money<0.5 && $money>0)
+				{
+					$this->error = '����������� ������ 0.50 ��.';
+					$az = 0;
+				}elseif($r==3 && $money>30)
+				{
+					$this->error = '������������ ������ 30.00 ��.';
+					$az = 0;
+				}elseif($r==3 && $money>$u->info['money'])
+				{
+					$this->error = '� ��� ������������ �����, ����� ������ ������';
+					$az = 0;
+				}
+				if($u->info['zv']>0){ $az = 0; $this->error = '�� ��� �������� � ������.'; }
+				if($az==1)
+				{
+					$nz = array();
+					$nz['city'] = $u->info['city'];
+					$nz['creator'] = $u->info['id'];
+					$nz['type'] = 0;
+					if($_POST['k']==1){	$nz['type'] = 1; }
+					$_POST['timeout'] = round(intval(mysql_real_escape_string($_POST['timeout'])));
+					if($_POST['timeout']==1 || $_POST['timeout']==2 || $_POST['timeout']==3 || $_POST['timeout']==4 || $_POST['timeout']==5)
+					{
+						$nz['timeout'] = $_POST['timeout']*60;
+					}else{
+						$nz['timeout'] = 3*60;
+					}
+					if($r==3)
+					{
+						if($_POST['onlyfor']!='')
+						{
+							$nz['withUser'] = mysql_real_escape_string($_POST['onlyfor']);
+						}
+					}
+					$nz['razdel'] = $r;
+					$nz['time_start'] = 0;
+					$nz['min_lvl_1'] = 0;
+					$nz['min_lvl_2'] = 0;
+					$nz['max_lvl_1'] = 21;
+					$nz['max_lvl_2'] = 21;
+					$nz['tm1max'] = 0;
+					$nz['tm2max'] = 0;
+					$nz['travmaChance'] = 0;
+					$nz['invise'] = 0;
+					$nz['money'] = 0;
+					$nz['comment'] = '';
+					$nz['tm1'] = 0;
+					$nz['tm2'] = 0;
+					$gad = 1;
+					if($r==3)
+					{
+						$nz['money'] = $money;
+					}
+					if($r==5 && $u->info['level']>1)
+					{
+						//��������� ���
+						if($_POST['startime2'])
+						{
+							$nz['time_start'] = (int)$_POST['startime2'];
+							$nz['comment'] = $_POST['cmt'];
+							$nz['comment'] = str_replace('"','&quot;',$nz['comment']);
+							if($nz['time_start']!=300 && $nz['time_start']!=600 && $nz['time_start']!=900 && $nz['time_start']!=1200 && $nz['time_start']!=1800)
+							{
+								$nz['time_start'] = 600;
+							}
+							
+							if(isset($_POST['mut_hidden']))
+							{
+								$nz['invise'] = 1;
+							}
+							
+							$nz['timeout'] = (int)$_POST['timeout'];
+							if($nz['timeout']!=1 && $nz['timeout']!=2 && $nz['timeout']!=3 && $nz['timeout']!=4 && $nz['timeout']!=5)
+							{
+								$nz['timeout'] = 3;
+							}
+							
+							//���������� ������ ��������
+							$lvl = (int)$_POST['levellogin1'];
+							if($lvl == 0)
+							{
+								$nz['min_lvl_1'] = 2;
+								$nz['max_lvl_1'] = 21;
+							}elseif($lvl == 3)
+							{
+								$nz['min_lvl_1'] = $u->info['level'];
+								$nz['max_lvl_1'] = $u->info['level'];
+							}elseif($lvl == 6)
+							{
+								$nz['min_lvl_1'] = $u->info['level']-1;
+								$nz['max_lvl_1'] = $u->info['level']+1;
+							}else{
+								$nz['min_lvl_1'] = 2;
+								$nz['max_lvl_1'] = 2;
+							}
+							
+							if((int)$_POST['k']==1)
+							{
+								//�������� ���
+								$nz['type'] = 1;
+							}
+							
+							$nz['timeout'] = $nz['timeout']*60;
+							
+							$nz['tm1'] = 100*$u->info['level']+10*$u->info['upLevel']+$u->info['exp']+$u->stats['reting'];
+							
+						}else{
+							$gad = 0; $this->error = '���-�� �� ���...<br>';
+						}
+					}elseif($r==4 && $u->info['level']>1)
+					{
+						//��������� ���
+						//'Array ( [startime] => 300 [timeout] => 1 [nlogin1] => 11 [levellogin1] => 0 [nlogin2] => 11 [levellogin2] => 0 [k] => 1 [travma] => on [mut_clever] => on [cmt] => ���� [open] => ������ ��������! :) )';
+						//����� ������� � ��������� ������ �� ��������� ���
+						if($_POST['startime'])
+						{
+							$nz['time_start'] = (int)$_POST['startime'];
+							$nz['comment'] = $_POST['cmt'];
+							$nz['comment'] = str_replace('"','&quot;',$nz['comment']);
+							if($nz['time_start']!=300 && $nz['time_start']!=600 && $nz['time_start']!=900 && $nz['time_start']!=1200 && $nz['time_start']!=1800)
+							{
+								$nz['time_start'] = 600;
+							}
+							
+							$nz['timeout'] = (int)$_POST['timeout'];
+							if($nz['timeout']!=1 && $nz['timeout']!=2 && $nz['timeout']!=3 && $nz['timeout']!=4 && $nz['timeout']!=5)
+							{
+								$nz['timeout'] = 3;
+							}
+							
+							$nz['timeout'] = $nz['timeout']*60;
+							
+							$nz['tm1max'] = (int)$_POST['nlogin1'];
+							if($nz['tm1max']<1 || $nz['tm1max']>99)
+							{
+								$this->error .= '�������� ���-�� ���������<br>';
+								$gad = 0;
+							}
+							
+							$nz['tm2max'] = (int)$_POST['nlogin2'];
+							if($nz['tm2max']<1 || $nz['tm2max']>99)
+							{
+								$this->error .= '�������� ���-�� �����������<br>';
+								$gad = 0;
+							}
+							
+							if($nz['tm1max']+$nz['tm2max']<3)
+							{
+								$this->error .= '������ 1 �� 1 �������� � ������� ���������� ��� ���������� ���<br>';
+								$gad = 0;
+							}
+														
+							//���������� ������ ��������
+							$lvl = (int)$_POST['levellogin1'];
+							if($lvl == 0)
+							{
+								$nz['min_lvl_1'] = 2;
+								$nz['max_lvl_1'] = 21;
+							}elseif($lvl == 1)
+							{
+								$nz['min_lvl_1'] = 2;
+								$nz['max_lvl_1'] = $u->info['level'];
+							}elseif($lvl == 2)
+							{
+								$nz['min_lvl_1'] = 2;
+								$nz['max_lvl_1'] = $u->info['level']-1;
+							}elseif($lvl == 3)
+							{
+								$nz['min_lvl_1'] = $u->info['level'];
+								$nz['max_lvl_1'] = $u->info['level'];
+							}elseif($lvl == 4)
+							{
+								$nz['min_lvl_1'] = $u->info['level'];
+								$nz['max_lvl_1'] = $u->info['level']+1;
+							}elseif($lvl == 5)
+							{
+								$nz['min_lvl_1'] = $u->info['level']-1;
+								$nz['max_lvl_1'] = $u->info['level'];
+							}elseif($lvl == 6)
+							{
+								$nz['min_lvl_1'] = $u->info['level']-1;
+								$nz['max_lvl_1'] = $u->info['level']+1;
+							}elseif($lvl == 6){
+								$nz['min_lvl_1'] = 99;
+							}else{
+								$this->error = '���-�� �� ���...<br>';
+								$gad = 0;
+							}
+							
+							//���������� ������ ����������
+							$lvl = (int)$_POST['levellogin2'];
+							if($lvl == 0)
+							{
+								$nz['min_lvl_2'] = 2;
+								$nz['max_lvl_2'] = 21;
+							}elseif($lvl == 1)
+							{
+								$nz['min_lvl_2'] = 2;
+								$nz['max_lvl_2'] = $u->info['level'];
+							}elseif($lvl == 2)
+							{
+								$nz['min_lvl_2'] = 2;
+								$nz['max_lvl_2'] = $u->info['level']-1;
+							}elseif($lvl == 3)
+							{
+								$nz['min_lvl_2'] = $u->info['level'];
+								$nz['max_lvl_2'] = $u->info['level'];
+							}elseif($lvl == 4)
+							{
+								$nz['min_lvl_2'] = $u->info['level'];
+								$nz['max_lvl_2'] = $u->info['level']+1;
+							}elseif($lvl == 5)
+							{
+								$nz['min_lvl_2'] = $u->info['level']-1;
+								$nz['max_lvl_2'] = $u->info['level'];
+							}elseif($lvl == 6)
+							{
+								$nz['min_lvl_2'] = $u->info['level']-1;
+								$nz['max_lvl_2'] = $u->info['level']+1;
+							}elseif($lvl == 6){
+								$nz['min_lvl_2'] = 99;
+							}else{
+								$this->error = '���-�� �� ���...<br>';
+								$gad = 0;
+							}
+							
+							if($nz['min_lvl_1']<2){ $nz['min_lvl_1'] = 2; }
+							if($nz['max_lvl_1']>21){ $nz['max_lvl_1'] = 21; }
+							if($nz['min_lvl_2']<2){ $nz['min_lvl_2'] = 2; }
+							if($nz['max_lvl_2']>21){ $nz['max_lvl_2'] = 21; }
+														
+							if((int)$_POST['k']==1)
+							{
+								//�������� ���
+								$nz['type'] = 1;
+							}
+							
+						}else{
+							$gad = 0;
+							$this->error = '���-�� �� ���...<br>';
+						}
+					}
+					if($gad==1)
+					{
+						if(!isset($nz['withUser'])){ $nz['withUser'] = ''; }
+						$bt1 = (int)$_POST['bot1'];
+						$bt2 = (int)$_POST['bot2'];
+						if($bt1>99){ $bt1 = 99; }
+						if($bt2>99){ $bt2 = 99; }
+						if($bt1<0){ $bt1 = 0; }
+						if($bt2<0){ $bt2 = 0; }
+						$ins = mysql_query('INSERT INTO `zayvki` (`bot1`,`bot2`,`time`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`tm1max`,`tm2max`,`travmaChance`,`invise`,`razdel`,`comment`,`money`,`withUser`,`tm1`,`tm2`) VALUES (
+																"'.((int)$bt1).'",
+																"'.((int)$bt2).'",
+																"'.time().'",
+																"'.$nz['city'].'",
+																"'.$nz['creator'].'",
+																"'.$nz['type'].'",
+																"'.$nz['time_start'].'",
+																"'.mysql_real_escape_string($nz['timeout']).'",
+																"'.mysql_real_escape_string($nz['min_lvl_1']).'",
+																"'.mysql_real_escape_string($nz['min_lvl_2']).'",															
+																"'.mysql_real_escape_string($nz['max_lvl_1']).'",
+																"'.mysql_real_escape_string($nz['max_lvl_2']).'",
+																"'.mysql_real_escape_string($nz['tm1max']).'",
+																"'.mysql_real_escape_string($nz['tm2max']).'",
+																"'.$nz['travmaChance'].'",
+																"'.$nz['invise'].'",
+																"'.$nz['razdel'].'",
+																"'.mysql_real_escape_string($nz['comment']).'",
+																"'.mysql_real_escape_string($nz['money']).'",
+																"'.$nz['withUser'].'","'.$nz['tm1'].'","'.$nz['tm2'].'")');
+						$zid = mysql_insert_id();
+						if($ins)
+						{
+							mysql_query('UPDATE `stats` SET `zv`="'.$zid.'",`team`="1" WHERE `id`="'.$u->info['id'].'" LIMIT 1');
+							$u->info['zv'] = $zid;
+							$this->error = '������ �� ��� ������';
+						}else{
+							$this->error = '�� �� ������ ������ ������...';
+						}
+					}
+				}
+			}
+		}
+	}
 
-    public function cancelGroup($zv, $uids)
-    {
-        $upd = mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `zv` = "' . $zv['id'] . '"');
-        if ($upd) {
-            $upd = mysql_query('UPDATE `zayvki` SET `cancel` = "' . time() . '" WHERE `id` = "' . $zv['id'] . '"');
-            if ($upd) {
-                $text = ' �� ������� ������ �������� �� �������: ������ �� �������.';
-                mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('" . $zv['city'] . "','','','" . $uids . "','" . $text . "','" . time() . "','11','0')");
-            }
-        }
-    }
+	//������������� ���
+	public function addBot()
+	{
+		global $u,$c,$code;
+		if($u->info['level']>3 && $u->info['admin']==0 && $u->info['id']!=1011840)
+		{
+			$bot = false;	
+		}else{
+			$bot = $u->addNewbot($id['id'],NULL,$u->info['id']);
+		}
+		if($bot==false)
+		{
+			$this->error = '��� � ���������, �������, ������� � ������� ����������� ���������� ������ ��� ���������� ������ 4 ������...<br>�� ������� ������������ ����� ����, ��� ���� ���-�� �� �����������...<br>';
+		}elseif($u->info['hpNow']<$u->stats['hpAll']/100*30 && ($r>=1 || $r<=3))
+		{
+			$this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
+			$az = 0;
+		}elseif($bot==false)
+		{
+			echo '<br><font color=red>Cannot start battle (no prototype "ND0Clone")</font><br>';
+		}else{
+			//������� �������� � �����
+			$expB = 25;
+			$btl = array('players'=>'','timeout'=>60,'type'=>0,'invis'=>0,'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>$expB,'money'=>0);
+			$ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+												"'.$u->info['city'].'",
+												"'.time().'",
+												"'.$btl['players'].'",
+												"'.$btl['timeout'].'",
+												"'.$btl['type'].'",
+												"'.$btl['invis'].'",
+												"'.$btl['noinc'].'",
+												"'.$btl['travmChance'].'",
+												"'.$btl['typeBattle'].'",
+												"'.$btl['addExp'].'",
+												"'.$btl['money'].'")');
+			if($ins)
+			{
+				$btl_id = mysql_insert_id();
+				//��������� ������ � ��������						
+				$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" OR `id` = "'.$bot.'" LIMIT 2');
+				mysql_query('UPDATE `stats` SET `team`="1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+				mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "'.$bot.'" LIMIT 1');
+				//���� ��� ��������, �� ������� ����
+				if($btl['type']==1)
+				{
+					mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
+					mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$bot.'" AND `inOdet`!=0');
+				}
+				
+				//��������� ������, ��� ��� �������
+				$u->info['battle'] = $btl_id;
+				//���������� ��������� � ��� ���� ������
+				mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$u->info['login']."','".time()."','11','0','117')");
+				die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
+			}else{
+				$this->error = 'Cannot start battle (no prototype "ABD0Clone")';
+			}	
+		}
+	}
+	
+	//������
+	public function startIzlom($id2,$lvl)
+	{
+		global $u,$c,$code;
+			$lvl = (int)$lvl;
+			$bots = array(1=>'�������� ���������');
+			$id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "'.$bots[$id2].' ['.$lvl.']" AND `active` = "1" LIMIT 1'));
+			$bot = $u->addNewbot($id['id'],NULL);
+			if(isset($id['id']) && $bot!=false)
+			{
+				//������� �������� � �����
+				$expB = -$bot['expB'];
+				$btl = array('players'=>'','timeout'=>60,'type'=>9,'invis'=>0,'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>$expB,'money'=>0,'izlom'=>(int)$id2,'izlomLvl'=>(int)$lvl);
+				$ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`,`izlom`,`izlomLvl`) VALUES (
+													"'.$u->info['city'].'",
+													"'.time().'",
+													"'.$btl['players'].'",
+													"'.$btl['timeout'].'",
+													"'.$btl['type'].'",
+													"'.$btl['invis'].'",
+													"'.$btl['noinc'].'",
+													"'.$btl['travmChance'].'",
+													"'.$btl['typeBattle'].'",
+													"'.$btl['addExp'].'",
+													"'.$btl['money'].'","'.$btl['izlom'].'","'.$btl['izlomLvl'].'")');
+				if($ins)
+				{
+					$btl_id = mysql_insert_id();
+					//��������� ������ � ��������						
+					$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" OR `id` = "'.$bot['id'].'" LIMIT 2');
+					mysql_query('UPDATE `stats` SET `team`="1" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+					mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "'.$bot['id'].'" LIMIT 1');
+					//���� ��� ��������, �� ������� ����
+					if($btl['type']==1)
+					{
+						mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
+						mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$bot['id'].'" AND `inOdet`!=0');
+					}
+					
+					//��������� ������, ��� ��� �������
+					$u->info['battle'] = $btl_id;
+					//���������� ��������� � ��� ���� ������
+					mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$u->info['login']."','".time()."','11','0','117')");
+					die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
+				}else{
+					$this->error = 'Cannot start battle (no prototype "ABD0'.$id['id'].'")';
+				}				
+			}else{
+				echo '<br><font color=red>Cannot start battle (no prototype "ND0IZ'.$lvl.'")</font><br>';
+			}
+	}
 
-    public function add()
-    {
-        global $u, $c, $code;
-        if (isset($_GET['r'])) {
-            $r = round(intval($_GET['r']));
-            if ($r >= 1 && $r <= 5) {
-                $az = 1;
-                if ($r == 1 && $u->info['level'] > 0) {
-                    $az = 0;
-                    $this->error = '�� ��� ������� �� ��������� ;)';
-                }
-                if (($r == 2 || $r == 3) && $u->info['level'] < 1) {
-                    $az = 0;
-                    $this->error = '�� ��� �� ������� �� ��������� ;)';
-                }
-                if (($r == 4 || $r == 5) && $u->info['level'] < 2) {
-                    $az = 0;
-                    $this->error = '� ' . $this->z1n[$r] . ' ��� ������ � ������� ������.';
-                }
-                if (!isset($_POST['stavkakredit'])) {
-                    $_POST['stavkakredit'] = 0;
-                }
-                $money = (int)($_POST['stavkakredit'] * 100);
-                $money = round(($money / 100), 2);
-                if ($u->info['hpNow'] < $u->stats['hpAll'] / 100 * 30 && ($r >= 1 || $r <= 3)) {
-                    $this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
-                    $az = 0;
-                } elseif ($r == 3 && $money > 0 && $u->info['level'] < 4) {
-                    $this->error = '��� �� ������ ���������� � 4-�� ������';
-                    $az = 0;
-                } elseif ($r == 3 && $money < 0.5 && $money > 0) {
-                    $this->error = '����������� ������ 0.50 ��.';
-                    $az = 0;
-                } elseif ($r == 3 && $money > 30) {
-                    $this->error = '������������ ������ 30.00 ��.';
-                    $az = 0;
-                } elseif ($r == 3 && $money > $u->info['money']) {
-                    $this->error = '� ��� ������������ �����, ����� ������ ������';
-                    $az = 0;
-                }
-                if ($u->info['zv'] > 0) {
-                    $az = 0;
-                    $this->error = '�� ��� �������� � ������.';
-                }
-                if ($az == 1) {
-                    $nz = [];
-                    $nz['city'] = $u->info['city'];
-                    $nz['creator'] = $u->info['id'];
-                    $nz['type'] = 0;
-                    if ($_POST['k'] == 1) {
-                        $nz['type'] = 1;
-                    }
-                    $_POST['timeout'] = round(intval(mysql_real_escape_string($_POST['timeout'])));
-                    if ($_POST['timeout'] == 1 || $_POST['timeout'] == 2 || $_POST['timeout'] == 3 || $_POST['timeout'] == 4 || $_POST['timeout'] == 5) {
-                        $nz['timeout'] = $_POST['timeout'] * 60;
-                    } else {
-                        $nz['timeout'] = 3 * 60;
-                    }
-                    if ($r == 3) {
-                        if ($_POST['onlyfor'] != '') {
-                            $nz['withUser'] = mysql_real_escape_string($_POST['onlyfor']);
-                        }
-                    }
-                    $nz['razdel'] = $r;
-                    $nz['time_start'] = 0;
-                    $nz['min_lvl_1'] = 0;
-                    $nz['min_lvl_2'] = 0;
-                    $nz['max_lvl_1'] = 21;
-                    $nz['max_lvl_2'] = 21;
-                    $nz['tm1max'] = 0;
-                    $nz['tm2max'] = 0;
-                    $nz['travmaChance'] = 0;
-                    $nz['invise'] = 0;
-                    $nz['money'] = 0;
-                    $nz['comment'] = '';
-                    $nz['tm1'] = 0;
-                    $nz['tm2'] = 0;
-                    $gad = 1;
-                    if ($r == 3) {
-                        $nz['money'] = $money;
-                    }
-                    if ($r == 5 && $u->info['level'] > 1) {
-                        //��������� ���
-                        if ($_POST['startime2']) {
-                            $nz['time_start'] = (int)$_POST['startime2'];
-                            $nz['comment'] = $_POST['cmt'];
-                            $nz['comment'] = str_replace('"', '&quot;', $nz['comment']);
-                            if ($nz['time_start'] != 300 && $nz['time_start'] != 600 && $nz['time_start'] != 900 && $nz['time_start'] != 1200 && $nz['time_start'] != 1800) {
-                                $nz['time_start'] = 600;
-                            }
+	public function startBattle($id,$vars = NULL)
+	{
+		global $c,$code,$u;
+		mysql_query('START TRANSACTION');
+		$z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="'.$id.'" AND `start` = "0" AND `cancel` = "0" AND (`time` > "'.(time()-60*60*2).'" OR `razdel` > 3) LIMIT 1'));
+		if(isset($z['id']))
+		{
+			$vars = explode('|-|',$vars);
+			if($z['razdel']>=4 && $zv['razdel']<=5)
+			{
+				//������ ���������� ��� ���������� ���
+				$btl_id = 0;
+				$btl = array('players'=>'','timeout'=>$z['timeout'],'type'=>$z['type'],'invis'=>0,'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>0,'money'=>0);
+				$ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+													"'.$u->info['city'].'",
+													"'.time().'",
+													"'.mysql_real_escape_string($btl['players']).'",
+													"'.mysql_real_escape_string($btl['timeout']).'",
+													"'.mysql_real_escape_string($btl['type']).'",
+													"'.mysql_real_escape_string($btl['invis']).'",
+													"'.mysql_real_escape_string($btl['noinc']).'",
+													"'.mysql_real_escape_string($btl['travmChance']).'",
+													"'.mysql_real_escape_string($btl['typeBattle']).'",
+													"'.mysql_real_escape_string($btl['addExp']).'",
+													"'.mysql_real_escape_string($btl['money'],2).'")');
+				$btl_id = mysql_insert_id();
+				if($btl_id>0)
+				{
+					//��������� ������ � ��������						
+					$upd1  = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "'.$z['id'].'"');
+					$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE '.$vars[1].'');
+					
+					//���� ��� ��������, �� ������� ����
+					if($z['type']==1)
+					{
+						//mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
+					}
+					
+					//��������� ������, ��� ��� �������
+					$upd = mysql_query('UPDATE `zayvki` SET `start` = "'.time().'",`btl_id` = "'.$btl_id.'" WHERE `id` = "'.$z['id'].'" LIMIT 1');
+					$u->info['battle'] = $btl_id;
+					//���������� ��������� � ��� ���� ������
+					mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','-1','".$vars[0]."','".time()."','11','0','117')");
+					die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
+				}
+			}elseif($z['razdel']>=1 && $z['razdel']<=3)
+			{
+				//������ PvP
+				if($u->info['team']==1 && $u->info['zv']==$z['id'])
+				{
+					$zu = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `zv`="'.$z['id'].'" AND `team` = "2" LIMIT 1'));
+					if(isset($zu['id']))
+					{
+						$uz = mysql_fetch_array(mysql_query('SELECT `login`,`money` FROM `users` WHERE `id`="'.$zu['id'].'" LIMIT 1'));
+						//������� ��������						
+						$btl_id = 0;
+						if($uz['money']<$z['money'] || $u->info['money']<$z['money'])
+						{
+							$z['money'] = 0;
+						}
+						$btl = array('players'=>'','timeout'=>$z['timeout'],'type'=>$z['type'],'invis'=>0,'noinc'=>0,'travmChance'=>0,'typeBattle'=>0,'addExp'=>0,'money'=>round($z['money'],2));
+						$ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
+															"'.$u->info['city'].'",
+															"'.time().'",
+															"'.mysql_real_escape_string($btl['players']).'",
+															"'.mysql_real_escape_string($btl['timeout']).'",
+															"'.mysql_real_escape_string($btl['type']).'",
+															"'.mysql_real_escape_string($btl['invis']).'",
+															"'.mysql_real_escape_string($btl['noinc']).'",
+															"'.mysql_real_escape_string($btl['travmChance']).'",
+															"'.mysql_real_escape_string($btl['typeBattle']).'",
+															"'.mysql_real_escape_string($btl['addExp']).'",
+															"'.mysql_real_escape_string($btl['money']).'")');
+						$btl_id = mysql_insert_id();
+						if($ins)
+						{
+							//��������� ������ � ��������						
+							$upd1  = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "'.$z['id'].'" LIMIT 2');
+							$upd2  = mysql_query('UPDATE `users` SET `battle`="'.$btl_id.'" WHERE `id` = "'.$u->info['id'].'" OR `id` = "'.$zu['id'].'" LIMIT 2');
+							
+							//���� ��� ��������, �� ������� ����
+							if($z['type']==1)
+							{
+								mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
+								mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$zu['id'].'" AND `inOdet`!=0');
+							}
+							
+							//��������� ������, ��� ��� �������
+							$upd = mysql_query('UPDATE `zayvki` SET `start` = "'.time().'",`btl_id` = "'.$btl_id.'" WHERE `id` = "'.$z['id'].'" LIMIT 1');
+							$u->info['battle'] = $btl_id;
+							//���������� ��������� � ��� ���� ������
+							mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('".$u->info['city']."','".$u->info['room']."','".$uz['login']."','".time()."','11','0','117')");
+							die('<script>location="main.php?battle_id='.$btl_id.'";</script>');
+						}else{
+							$this->error = '������ �������� �����.';
+						}	
+					}else{
+						$this->error = '�� �� ������ ������ ��������, ���� ������ ����� �� ������.';
+					}
+				}else{
+					$this->error = '�� �� ������ ������ ��������.';
+				}
+			}
+		}	
+		mysql_query('COMMIT');
+	}
 
-                            if (isset($_POST['mut_hidden'])) {
-                                $nz['invise'] = 1;
-                            }
-
-                            $nz['timeout'] = (int)$_POST['timeout'];
-                            if ($nz['timeout'] != 1 && $nz['timeout'] != 2 && $nz['timeout'] != 3 && $nz['timeout'] != 4 && $nz['timeout'] != 5) {
-                                $nz['timeout'] = 3;
-                            }
-
-                            //���������� ������ ��������
-                            $lvl = (int)$_POST['levellogin1'];
-                            if ($lvl == 0) {
-                                $nz['min_lvl_1'] = 2;
-                                $nz['max_lvl_1'] = 21;
-                            } elseif ($lvl == 3) {
-                                $nz['min_lvl_1'] = $u->info['level'];
-                                $nz['max_lvl_1'] = $u->info['level'];
-                            } elseif ($lvl == 6) {
-                                $nz['min_lvl_1'] = $u->info['level'] - 1;
-                                $nz['max_lvl_1'] = $u->info['level'] + 1;
-                            } else {
-                                $nz['min_lvl_1'] = 2;
-                                $nz['max_lvl_1'] = 2;
-                            }
-
-                            if ((int)$_POST['k'] == 1) {
-                                //�������� ���
-                                $nz['type'] = 1;
-                            }
-
-                            $nz['timeout'] = $nz['timeout'] * 60;
-
-                            $nz['tm1'] = 100 * $u->info['level'] + 10 * $u->info['upLevel'] + $u->info['exp'] + $u->stats['reting'];
-
-                        } else {
-                            $gad = 0;
-                            $this->error = '���-�� �� ���...<br>';
-                        }
-                    } elseif ($r == 4 && $u->info['level'] > 1) {
-                        //��������� ���
-                        //'Array ( [startime] => 300 [timeout] => 1 [nlogin1] => 11 [levellogin1] => 0 [nlogin2] => 11 [levellogin2] => 0 [k] => 1 [travma] => on [mut_clever] => on [cmt] => ���� [open] => ������ ��������! :) )';
-                        //����� ������� � ��������� ������ �� ��������� ���
-                        if ($_POST['startime']) {
-                            $nz['time_start'] = (int)$_POST['startime'];
-                            $nz['comment'] = $_POST['cmt'];
-                            $nz['comment'] = str_replace('"', '&quot;', $nz['comment']);
-                            if ($nz['time_start'] != 300 && $nz['time_start'] != 600 && $nz['time_start'] != 900 && $nz['time_start'] != 1200 && $nz['time_start'] != 1800) {
-                                $nz['time_start'] = 600;
-                            }
-
-                            $nz['timeout'] = (int)$_POST['timeout'];
-                            if ($nz['timeout'] != 1 && $nz['timeout'] != 2 && $nz['timeout'] != 3 && $nz['timeout'] != 4 && $nz['timeout'] != 5) {
-                                $nz['timeout'] = 3;
-                            }
-
-                            $nz['timeout'] = $nz['timeout'] * 60;
-
-                            $nz['tm1max'] = (int)$_POST['nlogin1'];
-                            if ($nz['tm1max'] < 1 || $nz['tm1max'] > 99) {
-                                $this->error .= '�������� ���-�� ���������<br>';
-                                $gad = 0;
-                            }
-
-                            $nz['tm2max'] = (int)$_POST['nlogin2'];
-                            if ($nz['tm2max'] < 1 || $nz['tm2max'] > 99) {
-                                $this->error .= '�������� ���-�� �����������<br>';
-                                $gad = 0;
-                            }
-
-                            if ($nz['tm1max'] + $nz['tm2max'] < 3) {
-                                $this->error .= '������ 1 �� 1 �������� � ������� ���������� ��� ���������� ���<br>';
-                                $gad = 0;
-                            }
-
-                            //���������� ������ ��������
-                            $lvl = (int)$_POST['levellogin1'];
-                            if ($lvl == 0) {
-                                $nz['min_lvl_1'] = 2;
-                                $nz['max_lvl_1'] = 21;
-                            } elseif ($lvl == 1) {
-                                $nz['min_lvl_1'] = 2;
-                                $nz['max_lvl_1'] = $u->info['level'];
-                            } elseif ($lvl == 2) {
-                                $nz['min_lvl_1'] = 2;
-                                $nz['max_lvl_1'] = $u->info['level'] - 1;
-                            } elseif ($lvl == 3) {
-                                $nz['min_lvl_1'] = $u->info['level'];
-                                $nz['max_lvl_1'] = $u->info['level'];
-                            } elseif ($lvl == 4) {
-                                $nz['min_lvl_1'] = $u->info['level'];
-                                $nz['max_lvl_1'] = $u->info['level'] + 1;
-                            } elseif ($lvl == 5) {
-                                $nz['min_lvl_1'] = $u->info['level'] - 1;
-                                $nz['max_lvl_1'] = $u->info['level'];
-                            } elseif ($lvl == 6) {
-                                $nz['min_lvl_1'] = $u->info['level'] - 1;
-                                $nz['max_lvl_1'] = $u->info['level'] + 1;
-                            } elseif ($lvl == 6) {
-                                $nz['min_lvl_1'] = 99;
-                            } else {
-                                $this->error = '���-�� �� ���...<br>';
-                                $gad = 0;
-                            }
-
-                            //���������� ������ ����������
-                            $lvl = (int)$_POST['levellogin2'];
-                            if ($lvl == 0) {
-                                $nz['min_lvl_2'] = 2;
-                                $nz['max_lvl_2'] = 21;
-                            } elseif ($lvl == 1) {
-                                $nz['min_lvl_2'] = 2;
-                                $nz['max_lvl_2'] = $u->info['level'];
-                            } elseif ($lvl == 2) {
-                                $nz['min_lvl_2'] = 2;
-                                $nz['max_lvl_2'] = $u->info['level'] - 1;
-                            } elseif ($lvl == 3) {
-                                $nz['min_lvl_2'] = $u->info['level'];
-                                $nz['max_lvl_2'] = $u->info['level'];
-                            } elseif ($lvl == 4) {
-                                $nz['min_lvl_2'] = $u->info['level'];
-                                $nz['max_lvl_2'] = $u->info['level'] + 1;
-                            } elseif ($lvl == 5) {
-                                $nz['min_lvl_2'] = $u->info['level'] - 1;
-                                $nz['max_lvl_2'] = $u->info['level'];
-                            } elseif ($lvl == 6) {
-                                $nz['min_lvl_2'] = $u->info['level'] - 1;
-                                $nz['max_lvl_2'] = $u->info['level'] + 1;
-                            } elseif ($lvl == 6) {
-                                $nz['min_lvl_2'] = 99;
-                            } else {
-                                $this->error = '���-�� �� ���...<br>';
-                                $gad = 0;
-                            }
-
-                            if ($nz['min_lvl_1'] < 2) {
-                                $nz['min_lvl_1'] = 2;
-                            }
-                            if ($nz['max_lvl_1'] > 21) {
-                                $nz['max_lvl_1'] = 21;
-                            }
-                            if ($nz['min_lvl_2'] < 2) {
-                                $nz['min_lvl_2'] = 2;
-                            }
-                            if ($nz['max_lvl_2'] > 21) {
-                                $nz['max_lvl_2'] = 21;
-                            }
-
-                            if ((int)$_POST['k'] == 1) {
-                                //�������� ���
-                                $nz['type'] = 1;
-                            }
-
-                        } else {
-                            $gad = 0;
-                            $this->error = '���-�� �� ���...<br>';
-                        }
-                    }
-                    if ($gad == 1) {
-                        if (!isset($nz['withUser'])) {
-                            $nz['withUser'] = '';
-                        }
-                        $bt1 = (int)$_POST['bot1'];
-                        $bt2 = (int)$_POST['bot2'];
-                        if ($bt1 > 99) {
-                            $bt1 = 99;
-                        }
-                        if ($bt2 > 99) {
-                            $bt2 = 99;
-                        }
-                        if ($bt1 < 0) {
-                            $bt1 = 0;
-                        }
-                        if ($bt2 < 0) {
-                            $bt2 = 0;
-                        }
-                        $ins = mysql_query('INSERT INTO `zayvki` (`bot1`,`bot2`,`time`,`city`,`creator`,`type`,`time_start`,`timeout`,`min_lvl_1`,`min_lvl_2`,`max_lvl_1`,`max_lvl_2`,`tm1max`,`tm2max`,`travmaChance`,`invise`,`razdel`,`comment`,`money`,`withUser`,`tm1`,`tm2`) VALUES (
-																"' . ((int)$bt1) . '",
-																"' . ((int)$bt2) . '",
-																"' . time() . '",
-																"' . $nz['city'] . '",
-																"' . $nz['creator'] . '",
-																"' . $nz['type'] . '",
-																"' . $nz['time_start'] . '",
-																"' . mysql_real_escape_string($nz['timeout']) . '",
-																"' . mysql_real_escape_string($nz['min_lvl_1']) . '",
-																"' . mysql_real_escape_string($nz['min_lvl_2']) . '",															
-																"' . mysql_real_escape_string($nz['max_lvl_1']) . '",
-																"' . mysql_real_escape_string($nz['max_lvl_2']) . '",
-																"' . mysql_real_escape_string($nz['tm1max']) . '",
-																"' . mysql_real_escape_string($nz['tm2max']) . '",
-																"' . $nz['travmaChance'] . '",
-																"' . $nz['invise'] . '",
-																"' . $nz['razdel'] . '",
-																"' . mysql_real_escape_string($nz['comment']) . '",
-																"' . mysql_real_escape_string($nz['money']) . '",
-																"' . $nz['withUser'] . '","' . $nz['tm1'] . '","' . $nz['tm2'] . '")');
-                        $zid = mysql_insert_id();
-                        if ($ins) {
-                            mysql_query('UPDATE `stats` SET `zv`="' . $zid . '",`team`="1" WHERE `id`="' . $u->info['id'] . '" LIMIT 1');
-                            $u->info['zv'] = $zid;
-                            $this->error = '������ �� ��� ������';
-                        } else {
-                            $this->error = '�� �� ������ ������ ������...';
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    //������������� ���
-    public function addBot()
-    {
-        global $u, $c, $code;
-        if ($u->info['level'] > 3 && $u->info['admin'] == 0 && $u->info['id'] != 1011840) {
-            $bot = false;
-        } else {
-            $bot = $u->addNewbot($id['id'], null, $u->info['id']);
-        }
-        if ($bot == false) {
-            $this->error = '��� � ���������, �������, ������� � ������� ����������� ���������� ������ ��� ���������� ������ 4 ������...<br>�� ������� ������������ ����� ����, ��� ���� ���-�� �� �����������...<br>';
-        } elseif ($u->info['hpNow'] < $u->stats['hpAll'] / 100 * 30 && ($r >= 1 || $r <= 3)) {
-            $this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
-            $az = 0;
-        } elseif ($bot == false) {
-            echo '<br><font color=red>Cannot start battle (no prototype "ND0Clone")</font><br>';
-        } else {
-            //������� �������� � �����
-            $expB = 25;
-            $btl = ['players' => '', 'timeout' => 60, 'type' => 0, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0];
-            $ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
-												"' . $u->info['city'] . '",
-												"' . time() . '",
-												"' . $btl['players'] . '",
-												"' . $btl['timeout'] . '",
-												"' . $btl['type'] . '",
-												"' . $btl['invis'] . '",
-												"' . $btl['noinc'] . '",
-												"' . $btl['travmChance'] . '",
-												"' . $btl['typeBattle'] . '",
-												"' . $btl['addExp'] . '",
-												"' . $btl['money'] . '")');
-            if ($ins) {
-                $btl_id = mysql_insert_id();
-                //��������� ������ � ��������
-                $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" OR `id` = "' . $bot . '" LIMIT 2');
-                mysql_query('UPDATE `stats` SET `team`="1" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot . '" LIMIT 1');
-                //���� ��� ��������, �� ������� ����
-                if ($btl['type'] == 1) {
-                    mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $u->info['id'] . '" AND `inOdet`!=0');
-                    mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $bot . '" AND `inOdet`!=0');
-                }
-
-                //��������� ������, ��� ��� �������
-                $u->info['battle'] = $btl_id;
-                //���������� ��������� � ��� ���� ������
-                mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','" . $u->info['room'] . "','" . $u->info['login'] . "','" . time() . "','11','0','117')");
-                die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
-            } else {
-                $this->error = 'Cannot start battle (no prototype "ABD0Clone")';
-            }
-        }
-    }
-
-    //������
-    public function startIzlom($id2, $lvl)
-    {
-        global $u, $c, $code;
-        $lvl = (int)$lvl;
-        $bots = [1 => '�������� ���������'];
-        $id = mysql_fetch_array(mysql_query('SELECT * FROM `test_bot` WHERE `login` = "' . $bots[$id2] . ' [' . $lvl . ']" AND `active` = "1" LIMIT 1'));
-        $bot = $u->addNewbot($id['id'], null);
-        if (isset($id['id']) && $bot != false) {
-            //������� �������� � �����
-            $expB = -$bot['expB'];
-            $btl = ['players' => '', 'timeout' => 60, 'type' => 9, 'invis' => 0, 'noinc' => 0, 'travmChance' => 0, 'typeBattle' => 0, 'addExp' => $expB, 'money' => 0, 'izlom' => (int)$id2, 'izlomLvl' => (int)$lvl];
-            $ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`,`izlom`,`izlomLvl`) VALUES (
-													"' . $u->info['city'] . '",
-													"' . time() . '",
-													"' . $btl['players'] . '",
-													"' . $btl['timeout'] . '",
-													"' . $btl['type'] . '",
-													"' . $btl['invis'] . '",
-													"' . $btl['noinc'] . '",
-													"' . $btl['travmChance'] . '",
-													"' . $btl['typeBattle'] . '",
-													"' . $btl['addExp'] . '",
-													"' . $btl['money'] . '","' . $btl['izlom'] . '","' . $btl['izlomLvl'] . '")');
-            if ($ins) {
-                $btl_id = mysql_insert_id();
-                //��������� ������ � ��������
-                $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" OR `id` = "' . $bot['id'] . '" LIMIT 2');
-                mysql_query('UPDATE `stats` SET `team`="1" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                mysql_query('UPDATE `stats` SET `team`="2" WHERE `id` = "' . $bot['id'] . '" LIMIT 1');
-                //���� ��� ��������, �� ������� ����
-                if ($btl['type'] == 1) {
-                    mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $u->info['id'] . '" AND `inOdet`!=0');
-                    mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $bot['id'] . '" AND `inOdet`!=0');
-                }
-
-                //��������� ������, ��� ��� �������
-                $u->info['battle'] = $btl_id;
-                //���������� ��������� � ��� ���� ������
-                mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','" . $u->info['room'] . "','" . $u->info['login'] . "','" . time() . "','11','0','117')");
-                die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
-            } else {
-                $this->error = 'Cannot start battle (no prototype "ABD0' . $id['id'] . '")';
-            }
-        } else {
-            echo '<br><font color=red>Cannot start battle (no prototype "ND0IZ' . $lvl . '")</font><br>';
-        }
-    }
-
-    public function startBattle($id, $vars = null)
-    {
-        global $c, $code, $u;
-        mysql_query('START TRANSACTION');
-        $z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="' . $id . '" AND `start` = "0" AND `cancel` = "0" AND (`time` > "' . (time() - 60 * 60 * 2) . '" OR `razdel` > 3) LIMIT 1'));
-        if (isset($z['id'])) {
-            $vars = explode('|-|', $vars);
-            if ($z['razdel'] >= 4 && $zv['razdel'] <= 5) {
-                //������ ���������� ��� ���������� ���
-                $btl_id = 0;
-                $btl = [
-                    'players' => '',
-                    'timeout' => $z['timeout'],
-                    'type' => $z['type'],
-                    'invis' => 0,
-                    'noinc' => 0,
-                    'travmChance' => 0,
-                    'typeBattle' => 0,
-                    'addExp' => 0,
-                    'money' => 0];
-                $ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
-													"' . $u->info['city'] . '",
-													"' . time() . '",
-													"' . mysql_real_escape_string($btl['players']) . '",
-													"' . mysql_real_escape_string($btl['timeout']) . '",
-													"' . mysql_real_escape_string($btl['type']) . '",
-													"' . mysql_real_escape_string($btl['invis']) . '",
-													"' . mysql_real_escape_string($btl['noinc']) . '",
-													"' . mysql_real_escape_string($btl['travmChance']) . '",
-													"' . mysql_real_escape_string($btl['typeBattle']) . '",
-													"' . mysql_real_escape_string($btl['addExp']) . '",
-													"' . mysql_real_escape_string($btl['money'], 2) . '")');
-                $btl_id = mysql_insert_id();
-                if ($btl_id > 0) {
-                    //��������� ������ � ��������
-                    $upd1 = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "' . $z['id'] . '"');
-                    $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE ' . $vars[1] . '');
-
-                    //���� ��� ��������, �� ������� ����
-                    if ($z['type'] == 1) {
-                        //mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "'.$u->info['id'].'" AND `inOdet`!=0');
-                    }
-
-                    //��������� ������, ��� ��� �������
-                    $upd = mysql_query('UPDATE `zayvki` SET `start` = "' . time() . '",`btl_id` = "' . $btl_id . '" WHERE `id` = "' . $z['id'] . '" LIMIT 1');
-                    $u->info['battle'] = $btl_id;
-                    //���������� ��������� � ��� ���� ������
-                    mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','-1','" . $vars[0] . "','" . time() . "','11','0','117')");
-                    die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
-                }
-            } elseif ($z['razdel'] >= 1 && $z['razdel'] <= 3) {
-                //������ PvP
-                if ($u->info['team'] == 1 && $u->info['zv'] == $z['id']) {
-                    $zu = mysql_fetch_array(mysql_query('SELECT * FROM `stats` WHERE `zv`="' . $z['id'] . '" AND `team` = "2" LIMIT 1'));
-                    if (isset($zu['id'])) {
-                        $uz = mysql_fetch_array(mysql_query('SELECT `login`,`money` FROM `users` WHERE `id`="' . $zu['id'] . '" LIMIT 1'));
-                        //������� ��������
-                        $btl_id = 0;
-                        if ($uz['money'] < $z['money'] || $u->info['money'] < $z['money']) {
-                            $z['money'] = 0;
-                        }
-                        $btl = [
-                            'players' => '',
-                            'timeout' => $z['timeout'],
-                            'type' => $z['type'],
-                            'invis' => 0,
-                            'noinc' => 0,
-                            'travmChance' => 0,
-                            'typeBattle' => 0,
-                            'addExp' => 0,
-                            'money' => round($z['money'], 2)
-                        ];
-                        $ins = mysql_query('INSERT INTO `battle` (`city`,`time_start`,`players`,`timeout`,`type`,`invis`,`noinc`,`travmChance`,`typeBattle`,`addExp`,`money`) VALUES (
-															"' . $u->info['city'] . '",
-															"' . time() . '",
-															"' . mysql_real_escape_string($btl['players']) . '",
-															"' . mysql_real_escape_string($btl['timeout']) . '",
-															"' . mysql_real_escape_string($btl['type']) . '",
-															"' . mysql_real_escape_string($btl['invis']) . '",
-															"' . mysql_real_escape_string($btl['noinc']) . '",
-															"' . mysql_real_escape_string($btl['travmChance']) . '",
-															"' . mysql_real_escape_string($btl['typeBattle']) . '",
-															"' . mysql_real_escape_string($btl['addExp']) . '",
-															"' . mysql_real_escape_string($btl['money']) . '")');
-                        $btl_id = mysql_insert_id();
-                        if ($ins) {
-                            //��������� ������ � ��������
-                            $upd1 = mysql_query('UPDATE `stats` SET `zv`="0" WHERE `zv` = "' . $z['id'] . '" LIMIT 2');
-                            $upd2 = mysql_query('UPDATE `users` SET `battle`="' . $btl_id . '" WHERE `id` = "' . $u->info['id'] . '" OR `id` = "' . $zu['id'] . '" LIMIT 2');
-
-                            //���� ��� ��������, �� ������� ����
-                            if ($z['type'] == 1) {
-                                mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $u->info['id'] . '" AND `inOdet`!=0');
-                                mysql_query('UPDATE `items_users` SET `inOdet`="0" WHERE `uid` = "' . $zu['id'] . '" AND `inOdet`!=0');
-                            }
-
-                            //��������� ������, ��� ��� �������
-                            $upd = mysql_query('UPDATE `zayvki` SET `start` = "' . time() . '",`btl_id` = "' . $btl_id . '" WHERE `id` = "' . $z['id'] . '" LIMIT 1');
-                            $u->info['battle'] = $btl_id;
-                            //���������� ��������� � ��� ���� ������
-                            mysql_query("INSERT INTO `chat` (`city`,`room`,`to`,`time`,`type`,`toChat`,`sound`) VALUES ('" . $u->info['city'] . "','" . $u->info['room'] . "','" . $uz['login'] . "','" . time() . "','11','0','117')");
-                            die('<script>location="main.php?battle_id=' . $btl_id . '";</script>');
-                        } else {
-                            $this->error = '������ �������� �����.';
-                        }
-                    } else {
-                        $this->error = '�� �� ������ ������ ��������, ���� ������ ����� �� ������.';
-                    }
-                } else {
-                    $this->error = '�� �� ������ ������ ��������.';
-                }
-            }
-        }
-        mysql_query('COMMIT');
-    }
-
-    public function cancelzv()
-    {
-        global $u, $c, $code, $zi;
-        if (isset($_GET['cancelzv'], $zi['id']) && $zi['razdel'] >= 1 && $zi['razdel'] <= 3) {
-            $enemy = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team` = "2" LIMIT 1'));
-            if (isset($enemy['id'])) {
-                if ($zi['razdel'] >= 1 && $zi['razdel'] <= 3) {
-                    if ($u->info['team'] == 1) {
-                        //���������� �� ������ + ����� ��������� � ���
-                        $upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "' . $enemy['id'] . '" LIMIT 1');
-                        if ($upd) {
-                            $this->error = '�� �������� ' . $enemy['login'] . ' � ��������';
-                            //���������� ��������� � ���
-                            $sa = '';
-                            if ($u->info['sex'] == 2) {
-                                $sa = '�';
-                            }
-                            $text = ' [login:' . $u->info['login'] . '] �������' . $sa . ' ��� � ��������.';
-                            mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('" . $enemy['city'] . "','" . $enemy['room'] . "','','" . $enemy['login'] . "','" . $text . "','" . time() . "','10','0')");
-                        }
-                    } elseif ($u->info['id'] == $enemy['id'] && $zi['start'] == 0) {
-                        //���������� �� ������ + ����� ��������� � ���
-                        $upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "' . $enemy['id'] . '" LIMIT 1');
-                        if ($upd) {
-                            $uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`login`,`u`.`city`,`u`.`room`,`u`.`id`,`st`.`zv`,`st`.`team` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team` = "1" LIMIT 1'));
-                            if (isset($uz['id'])) {
-                                $this->error = '�� �������� ���� ������ �� ���.';
-                                //���������� ��������� � ���
-                                $sa = '';
-                                if ($u->info['sex'] == 2) {
-                                    $sa = '�';
-                                }
-                                $text = ' [login:' . $u->info['login'] . '] �������' . $sa . ' ���� ������ �� ���.';
-                                mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('" . $uz['city'] . "','" . $uz['room'] . "','','" . $uz['login'] . "','" . $text . "','" . time() . "','10','0')");
-                            }
-                            $u->info['zv'] = 0;
-                            $u->info['team'] = 0;
-                        }
-                    }
-                }
-            } else {
-                if ($zi['razdel'] >= 1 && $zi['razdel'] <= 3 && $u->info['team'] == 1) {
-                    //������� ������ �� ���
-                    $upd = mysql_query('UPDATE `zayvki` SET `cancel` = "' . time() . '" WHERE `id` = "' . $zi['id'] . '" LIMIT 1');
-                    if ($upd) {
-                        mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                        $this->error = '�� �������� ���� ������';
-                        $zi = false;
-                        $u->info['zv'] = 0;
-                    }
-                }
-            }
-
-        }
-    }
-
-    public function see()
-    {
-        global $u, $c, $code, $zi, $cron;
-        if (isset($_GET['r']) && ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id']))) {
-            $r = round(intval($_GET['r']));
-            if ($r >= 1 && $r <= 5) {
-                $this->zv_see = 1;
-                if ($u->room['FR'] == 0) {
-                    echo '<br><br><br><b><font color="black"><center>������ ������ ����� ������ � �������� ����������� �����</center></font></b>';
-                    $this->zv_see = 0;
-                } elseif ($r == 1 && $u->info['level'] > 0) {
-                    echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>';
-                    $this->zv_see = 0;
-                } elseif ($r > 1 && $r < 6 && $u->info['level'] < 1) {
-                    echo '<br><br><br><b><font color="black"><center>�� ��� �� ������� �� ��������� ;)</center></font></b>';
-                    $this->zv_see = 0;
-                } elseif ($r > 3 && $r < 6 && $u->info['level'] < 2) {
-                    echo '<br><br><br><b><font color="black"><center>� ' . $this->z1n[$r] . ' ��� ������ � ������� ������.</center></font></b>';
-                    $this->zv_see = 0;
-                } elseif ($r == 1 && $u->info['level'] > 0) {
-                    echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>';
-                    $this->zv_see = 0;
-                } elseif ($u->info['zv'] > 0 && $u->info['battle'] == 0) {
-                    if ($zi['razdel'] == 1 || $zi['razdel'] == 2 || $zi['razdel'] == 3) {
-                        echo '
+	public function cancelzv()
+	{
+		global $u,$c,$code,$zi;
+		if(isset($_GET['cancelzv'],$zi['id']) && $zi['razdel']>=1 && $zi['razdel']<=3)
+		{
+			$enemy = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team` = "2" LIMIT 1'));
+			if(isset($enemy['id']))
+			{
+				if($zi['razdel']>=1 && $zi['razdel']<=3)
+				{
+					if($u->info['team']==1)
+					{
+						//���������� �� ������ + ����� ��������� � ���
+						$upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "'.$enemy['id'].'" LIMIT 1');
+						if($upd)
+						{
+							$this->error = '�� �������� '.$enemy['login'].' � ��������';
+							//���������� ��������� � ���
+							$sa = '';
+							if($u->info['sex']==2)
+							{
+								$sa = '�';
+							}
+							$text = ' [login:'.$u->info['login'].'] �������'.$sa.' ��� � ��������.';
+							mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('".$enemy['city']."','".$enemy['room']."','','".$enemy['login']."','".$text."','".time()."','10','0')");
+						}
+					}elseif($u->info['id']==$enemy['id'] && $zi['start']==0)
+					{
+						//���������� �� ������ + ����� ��������� � ���
+						$upd = mysql_query('UPDATE `stats` SET `zv` = "0",`team`="0" WHERE `id` = "'.$enemy['id'].'" LIMIT 1');
+						if($upd)
+						{
+							$uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`login`,`u`.`city`,`u`.`room`,`u`.`id`,`st`.`zv`,`st`.`team` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team` = "1" LIMIT 1'));
+							if(isset($uz['id']))
+							{
+								$this->error = '�� �������� ���� ������ �� ���.';
+								//���������� ��������� � ���
+								$sa = '';
+								if($u->info['sex']==2)
+								{
+									$sa = '�';
+								}
+								$text = ' [login:'.$u->info['login'].'] �������'.$sa.' ���� ������ �� ���.';
+								mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('".$uz['city']."','".$uz['room']."','','".$uz['login']."','".$text."','".time()."','10','0')");
+							}
+							$u->info['zv'] = 0;
+							$u->info['team'] = 0;
+						}
+					}
+				}
+			}else{
+				if($zi['razdel']>=1 && $zi['razdel']<=3 && $u->info['team']==1)
+				{
+					//������� ������ �� ���
+					$upd = mysql_query('UPDATE `zayvki` SET `cancel` = "'.time().'" WHERE `id` = "'.$zi['id'].'" LIMIT 1');
+					if($upd)
+					{
+						mysql_query('UPDATE `stats` SET `zv` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+						$this->error = '�� �������� ���� ������';
+						$zi = false;
+						$u->info['zv'] = 0;
+					}
+				}
+			}
+			
+		}
+	}
+	
+	public function see()
+	{
+		global $u,$c,$code,$zi,$cron;
+		if(isset($_GET['r']) && ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) )
+		{
+			$r = round(intval($_GET['r']));
+			if($r>=1 && $r<=5)
+			{
+				$this->zv_see = 1;
+				if($u->room['FR']==0)
+				{
+					echo '<br><br><br><b><font color="black"><center>������ ������ ����� ������ � �������� ����������� �����</center></font></b>'; $this->zv_see = 0;
+				}elseif($r==1 && $u->info['level']>0)
+				{
+					echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>'; $this->zv_see = 0;
+				}elseif($r>1 && $r<6 && $u->info['level']<1)
+				{
+					echo '<br><br><br><b><font color="black"><center>�� ��� �� ������� �� ��������� ;)</center></font></b>'; $this->zv_see = 0;
+				}elseif($r>3 && $r<6 && $u->info['level']<2)
+				{
+					echo '<br><br><br><b><font color="black"><center>� '.$this->z1n[$r].' ��� ������ � ������� ������.</center></font></b>'; $this->zv_see = 0;
+				}elseif($r==1 && $u->info['level']>0)
+				{
+					echo '<br><br><br><b><font color="black"><center>�� ��� ������� �� ��������� ;)</center></font></b>'; $this->zv_see = 0;
+				}elseif($u->info['zv']>0 && $u->info['battle']==0)
+				{
+					if($zi['razdel']==1 || $zi['razdel']==2 || $zi['razdel']==3)
+					{
+						echo '
 						<table width="100%" border="0" cellspacing="0" cellpadding="0">
 						  <tr>
 							<td valign="top">';
-
-                        if ($u->info['team'] == 1) {
-                            $uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team`="2" LIMIT 1'));
-                            if (!isset($uz['id'])) {
-                                //���� ����� �� ������
-                                echo '<div style="float:left;"><div style="float:left;">�� ��� ������ ������ �� ���  <INPUT onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&cancelzv\';" TYPE=submit name=close value="�������� ������"></div>';
-                            } else {
-                                //���� ���-�� ������
-                                $sa = '';
-                                if ($uz['sex'] == 2) {
-                                    $sa = '�';
-                                }
-                                echo '<script> zv_Priem = ' . (0 + $uz['id']) . ';</script><font color="red"><b>���� ������ ������' . $sa . ' ' . $ca . '</font></b> ' . $u->microLogin($uz['id'], 1) . '</a><font color="red"><b> ������ ����������� ���? </b></font><INPUT onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&startBattle\';" TYPE=submit name=close value="�����������"> <INPUT onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&cancelzv\';" TYPE=submit name=close value="��������">';
-                            }
-                        } else {
-                            $uz = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $zi['id'] . '" AND `st`.`team`="1" LIMIT 1'));
-                            if (isset($uz['id'])) {
-                                echo '������� ������������� ��� �� ' . $u->microLogin($uz['id'], 1) . ' <INPUT onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&rnd=' . $code . '&cancelzv\';" TYPE=submit name=close value="�������� ������">';
-                            } else {
-                                //������� ������
-
-                            }
-                        }
-
-                        echo '</td>
+							
+							if($u->info['team']==1)
+							{
+								$uz = mysql_fetch_array(mysql_query('SELECT `u`.`sex`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team`="2" LIMIT 1'));
+								if(!isset($uz['id']))
+								{
+									//���� ����� �� ������
+									echo '<div style="float:left;"><div style="float:left;">�� ��� ������ ������ �� ���  <INPUT onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&cancelzv\';" TYPE=submit name=close value="�������� ������"></div>';
+								}else{
+									//���� ���-�� ������
+									$sa = '';
+									if($uz['sex']==2)
+									{
+										$sa = '�';
+									}
+									echo '<script> zv_Priem = '.(0+$uz['id']).';</script><font color="red"><b>���� ������ ������'.$sa.' '.$ca.'</font></b> '.$u->microLogin($uz['id'],1).'</a><font color="red"><b> ������ ����������� ���? </b></font><INPUT onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&startBattle\';" TYPE=submit name=close value="�����������"> <INPUT onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&cancelzv\';" TYPE=submit name=close value="��������">';
+								}
+							}else{
+								$uz = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$zi['id'].'" AND `st`.`team`="1" LIMIT 1'));
+								if(isset($uz['id']))
+								{
+									echo '������� ������������� ��� �� '.$u->microLogin($uz['id'],1).' <INPUT onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&rnd='.$code.'&cancelzv\';" TYPE=submit name=close value="�������� ������">';
+								}else{
+									//������� ������
+									
+								}
+							}
+							
+							echo '</td>
 							<td align="right" valign="top">
-								<div style="float:right;"><INPUT onClick="location=\'main.php?zayvka&r=' . $_GET['r'] . '&rnd=' . $code . '\';" TYPE=button name=tmp value="��������"></div>
+								<div style="float:right;"><INPUT onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"></div>
 							</td>
 						  </tr>
-						</table></div>';
-                    } else {
-                        $tm_start = floor(($zi['time'] + $zi['time_start'] - time()) / 6) / 10;
-                        $tm_start = $this->rzv($tm_start);
-                        echo '<div style="float:right;"><INPUT onClick="location=\'main.php?zayvka&r=' . $_GET['r'] . '&rnd=' . $code . '\';" TYPE=button name=tmp value="��������"></div>
-						<b>������� ������ ' . $this->z2n[$zi['razdel']] . ' ���</b>';
-                        $sv0 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $zi['id'] . '" LIMIT 100'));
-                        if ($sv0[0] <= 1) {
-                            if (isset($_GET['cancelzvnow'])) {
-                                echo ' <b><font color="red">������ �� ��� ��������</font></b>';
-                                $u->info['zv'] = 0;
-                                mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                            } else {
-                                echo ' <a href="main.php?zayvka&r=' . $_GET['r'] . '&cancelzvnow&rnd=' . $code . '" title="�������� ������">��������</a>';
-                            }
-                        }
-                        unset($sv0);
-                        echo '<br>��� ��� �������� ����� ' . $tm_start . ' ���.';
-                    }
-                } elseif ($r == 1 || $r == 2 || $r == 3) {
-                    //�������,����������,����������
-                    $zi = [1 => '���� �� �� �������� ������� ������, �� ��� ��� ��� ������������ ������ ��� ���������� ����.', 2 => '����� �� ������ ����� ���� ���������� ���������� ��� ��������.', 3 => '���� �� �������������� � ���-�� ������������ � ��������, �� ����� ����� ������ ������.'];
-                    $dv = '';
-                    if ($r == 3) {
-                        $dv = '<br>����� ����������
+						</table></div>';						
+					}else{
+						$tm_start = floor(($zi['time']+$zi['time_start']-time())/6)/10;
+						$tm_start = $this->rzv($tm_start);
+						echo '<div style="float:right;"><INPUT onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"></div>
+						<b>������� ������ '.$this->z2n[$zi['razdel']].' ���</b>';
+						$sv0 = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$zi['id'].'" LIMIT 100'));
+						if($sv0[0] <= 1)
+						{
+							if(isset($_GET['cancelzvnow']))
+							{
+								echo ' <b><font color="red">������ �� ��� ��������</font></b>';
+								$u->info['zv'] = 0;
+								mysql_query('UPDATE `stats` SET `zv` = "0",`team` = "0" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+							}else{
+								echo ' <a href="main.php?zayvka&r='.$_GET['r'].'&cancelzvnow&rnd='.$code.'" title="�������� ������">��������</a>';
+							}
+						}
+						unset($sv0);
+						echo '<br>��� ��� �������� ����� '.$tm_start.' ���.';
+					}
+				}elseif($r==1 || $r==2 || $r==3)
+				{
+					//�������,����������,����������
+					$zi = array(1=>'���� �� �� �������� ������� ������, �� ��� ��� ��� ������������ ������ ��� ���������� ����.',2=>'����� �� ������ ����� ���� ���������� ���������� ��� ��������.',3=>'���� �� �������������� � ���-�� ������������ � ��������, �� ����� ����� ������ ������.');
+					$dv = '';
+					if($r==3)
+					{
+						$dv = '<br>����� ����������
 									  <INPUT TYPE=text NAME=onlyfor maxlength=30 size=12>
 									  <BR>
 									  ��� �� ������, ������
 									  <INPUT TYPE=text NAME=stavkakredit size=6 maxlength=10>
 									  <INPUT TYPE=submit name=open value="������ ������">
 									  &nbsp;';
-                    } else {
-                        $dv = '<INPUT TYPE=submit name=open value="������ ������">';
-                        if ($u->info['level'] < 4 || $u->info['admin'] > 0 || $u->info['id'] == 1011840) {
-                            $dv .= ' <INPUT onClick="location=\'main.php?zayvka=1&r=' . $_GET['r'] . '&bot=' . $u->info['nextAct'] . '\';" TYPE=button name=clone value="������������� ���">';
-                        }
-                    }
-                    echo '
-					<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '\'>
-					<input type="hidden" name="add_new_zv" id="add_new_zv" value="' . floor(time() / 3) . '" />
+					}else{
+						$dv = '<INPUT TYPE=submit name=open value="������ ������">';
+						if($u->info['level']<4 || $u->info['admin']>0 || $u->info['id']==1011840)
+						{
+							$dv .= ' <INPUT onClick="location=\'main.php?zayvka=1&r='.$_GET['r'].'&bot='.$u->info['nextAct'].'\';" TYPE=button name=clone value="������������� ���">';
+						}
+					}
+					echo '
+					<FORM style="margin:0px; padding:0px; border:0px;" METHOD=\'POST\' ACTION=\'main.php?zayvka=1&r='.$r.'&rnd='.$code.'\'>
+					<input type="hidden" name="add_new_zv" id="add_new_zv" value="'.floor(time()/3).'" />
 					<TABLE width=100% cellspacing=0 cellpadding=0>
 						  <TR>
-							<TD valign=top>' . $zi[$r] . '<BR>
+							<TD valign=top>'.$zi[$r].'<BR>
 								<table cellspacing=0 cellpadding=0>
 								  <tr>
 									<td><FIELDSET>
@@ -794,23 +838,25 @@ class zayvki
 										<OPTION value=0>� �������
 										<OPTION value=1>��������
 									</SELECT>
-									  ' . $dv . '
+									  '.$dv.'
 									</FIELDSET></td>
 								  </tr>
 								</table></TD>
-							<TD align=right valign=top><INPUT onClick="location=\'main.php?zayvka&r=' . $_GET['r'] . '&rnd=' . $code . '\';" TYPE=button name=tmp value="��������"></TD>
+							<TD align=right valign=top><INPUT onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'\';" TYPE=button name=tmp value="��������"></TD>
 						  </TR>
 						</TABLE>
 						</FORM>';
-                } elseif ($r == 4) {
-                    //���������
-                    echo '<INPUT onClick="location=\'main.php?zayvka&r=' . $_GET['r'] . '&new_group&rnd=' . $code . '\';" TYPE=button name=tmp value="������ ����� ������"  style="margin:3px;">
-						  <INPUT onClick="location=\'main.php?zayvka&r=' . $_GET['r'] . '&rnd=' . $code . '&sort=\'+document.all.value+\'\';" TYPE=button name=tmp value="��������"  style="float:right;">';
-                } elseif ($r == 5) {
-                    //���������
-                    echo '��������� ��� - ������������� ����������, ��� ������ ����������� �������������. ��� �� ��������, ���� ��������� ������ 4-� �������.<br>
+				}elseif($r==4)
+				{
+					//���������
+					echo '<INPUT onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&new_group&rnd='.$code.'\';" TYPE=button name=tmp value="������ ����� ������"  style="margin:3px;">
+						  <INPUT onClick="location=\'main.php?zayvka&r='.$_GET['r'].'&rnd='.$code.'&sort=\'+document.all.value+\'\';" TYPE=button name=tmp value="��������"  style="float:right;">';
+				}elseif($r==5)
+				{
+					//���������
+					echo '��������� ��� - ������������� ����������, ��� ������ ����������� �������������. ��� �� ��������, ���� ��������� ������ 4-� �������.<br>
 						  <a href="#" onclick="if(document.getElementById(\'haot\').style.display==\'\'){ document.getElementById(\'haot\').style.display=\'none\' }else{ document.getElementById(\'haot\').style.display=\'\'; } return false;">������ ������ �� ��������� ���</a>
-						  <form action="main.php?zayvka=1&r=' . $_GET['r'] . '&start_haot&rnd=' . $code . '" method="post" style="margin:0px; padding:0px;">
+						  <form action="main.php?zayvka=1&r='.$_GET['r'].'&start_haot&rnd='.$code.'" method="post" style="margin:0px; padding:0px;">
 						  <div style="display:none;" id="haot">
 										  <br>
 										  <FIELDSET>
@@ -860,376 +906,442 @@ class zayvki
 										  </FIELDSET>
 										</DIV>
 						  </div></form>';
-                }
-            } elseif ($r == 6) {
-                //�������
-                echo '������� ���...';
-            } elseif ($r == 7) {
-                //�����������
-                $btl = '';
-                $dt = time();
-                $slogin = $u->info['login'];
-                $see = '<TABLE width=100% cellspacing=0 cellpadding=0><TR>
+				}				
+			}elseif($r==6)
+			{
+				//�������
+				echo '������� ���...';
+			}elseif($r==7)
+			{
+				//�����������
+				$btl = '';
+				$dt = time();
+				$slogin = $u->info['login'];
+				$see = '<TABLE width=100% cellspacing=0 cellpadding=0><TR>
 <TD valign=top>&nbsp;<A HREF="#">� ���������� ����</A></TD>
-<TD valign=top align=center><H3>������ � ����������� ���� �� ' . date('d.m.Y', $dt) . '</H3></TD>
+<TD valign=top align=center><H3>������ � ����������� ���� �� '.date('d.m.Y',$dt).'</H3></TD>
 <TD  valign=top align=right><A HREF="#">��������� ���� �</A>&nbsp;</TD>
 </TR><TR><TD colspan=3 align=center>
-<form method="POST" action="main.php?zayvka=1&r=7&rnd=' . $code . '">
-�������� ������ ��� ���������: <INPUT TYPE=text NAME=filter value="' . $slogin . '"> �� <INPUT TYPE=text NAME=logs size=12 value="' . date('d.m.Y', $dt) . '"> <INPUT TYPE=submit value="������!">
+<form method="POST" action="main.php?zayvka=1&r=7&rnd='.$code.'">
+�������� ������ ��� ���������: <INPUT TYPE=text NAME=filter value="'.$slogin.'"> �� <INPUT TYPE=text NAME=logs size=12 value="'.date('d.m.Y',$dt).'"> <INPUT TYPE=submit value="������!">
 </form>
 </TD>
 </TR></TABLE>';
-                if ($btl == '') {
-                    $see .= '<CENTER><BR><BR><B>� ���� ���� �� ���� ����, ��� ��, ��������� ����� ������� ������...</B><BR><BR><BR></CENTER><HR><BR>';
-                } else {
-                    $see .= $btl;
-                }
-
-                echo $see;
-            } else {
-                if ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) {
-                    echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
-                }
-            }
-        } else {
-            if ((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id'])) {
-                echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
-            }
-        }
-    }
-
-    public function rzv($v)
-    {
-        $v = explode('.', $v);
-        if (!isset($v[1])) {
-            $v = $v[0] . '.0';
-        } else {
-            $v = $v[0] . '.' . $v[1];
-        }
-        return $v;
-    }
-
-    public function rzInfo($id)
-    {
-        global $u;
-        $r = '';
-        $w = mysql_num_rows(mysql_query('SELECT * FROM `zayvki` WHERE `time` > ' . (time() - 7200) . ' AND `city` = "' . $u->info['city'] . '" AND `cancel` = "0" AND `start` = "0" AND `razdel` = "' . $id . '" AND (`min_lvl_1` <= ' . $u->info['level'] . ' OR `min_lvl_2` <= ' . $u->info['level'] . ') AND (`max_lvl_1` >= ' . $u->info['level'] . ' OR `max_lvl_2` >= ' . $u->info['level'] . ')'));
-        if ($w > 0) {
-            $r = ' <small><font color="grey">(' . $w . ')</font></small>';
-        }
-        return $r;
-    }
-
-    public function testzvu($id, $tm, $bt)
-    {
-        $r = 0;
-        if ($bt == 0) {
-            $r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $id . '" AND `team` = "' . $tm . '"'));
-        } else {
-            $r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "' . $id . '" AND `team` = "' . $tm . '" AND `bot` = "2"'));
-        }
-        return $r;
-    }
-
-    public function seeZv()
-    {
-        global $u, $c, $code, $zi;
-        if (isset($_GET['r']) && $this->zv_see == 1) {
-            $r = round(intval($_GET['r']));
-            if ($r >= 1 && $r <= 5) {
-                //������ ������
-                $i = 0;
-                $cl = mysql_query('SELECT * FROM `zayvki` WHERE `razdel` = "' . mysql_real_escape_string($r) . '" AND `start` = "0" AND `cancel` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '" AND `city` = "' . $u->info['city'] . '" ORDER BY `id` DESC');
-                $zvb = '';
-                if ($r == 4 || $r == 5) {
-                    /*echo '<table cellspacing="0" cellpadding="0" align="right"><tr><td>
+				if($btl=='')
+				{
+					$see .= '<CENTER><BR><BR><B>� ���� ���� �� ���� ����, ��� ��, ��������� ����� ������� ������...</B><BR><BR><BR></CENTER><HR><BR>';
+				}else{
+					$see .= $btl;
+				}
+				
+				echo $see;
+			}else{
+				if((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id']))
+				{
+					echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
+				}
+			}
+		}else{
+			if((!isset($_GET['new_group']) && !isset($_POST['groupClick'])) || isset($zi['id']))
+			{
+				echo '<BR><BR><CENTER><B>�������� ������</B></CENTER>';
+			}
+		}
+	}
+	
+	public function rzv($v)
+	{
+		$v = explode('.',$v);
+		if(!isset($v[1]))
+		{
+			$v = $v[0].'.0';
+		}else{
+			$v = $v[0].'.'.$v[1];
+		}
+		return $v;
+	}
+	
+	public function rzInfo($id)
+	{
+		global $u;
+		$r = '';
+		$w = mysql_num_rows(mysql_query('SELECT * FROM `zayvki` WHERE `time` > '.(time()-7200).' AND `city` = "'.$u->info['city'].'" AND `cancel` = "0" AND `start` = "0" AND `razdel` = "'.$id.'" AND (`min_lvl_1` <= '.$u->info['level'].' OR `min_lvl_2` <= '.$u->info['level'].') AND (`max_lvl_1` >= '.$u->info['level'].' OR `max_lvl_2` >= '.$u->info['level'].')'));
+		if($w>0)
+		{
+			$r = ' <small><font color="grey">('.$w.')</font></small>';
+		}
+		return $r;
+	}
+	
+	public function testzvu($id,$tm,$bt)
+	{
+		$r = 0;
+		if($bt==0)
+		{
+			$r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "'.$id.'" AND `team` = "'.$tm.'"'));
+		}else{
+			$r = mysql_num_rows(mysql_query('SELECT `id` FROM `stats` WHERE `zv` = "'.$id.'" AND `team` = "'.$tm.'" AND `bot` = "2"'));
+		}
+		return $r;
+	}
+	
+	public function seeZv()
+	{
+		global $u,$c,$code,$zi;
+		if(isset($_GET['r']) && $this->zv_see==1)
+		{
+			$r = round(intval($_GET['r']));
+			if($r>=1 && $r<=5)
+			{
+				//������ ������
+				$i = 0;
+				$cl = mysql_query('SELECT * FROM `zayvki` WHERE `razdel` = "'.mysql_real_escape_string($r).'" AND `start` = "0" AND `cancel` = "0" AND `time` > "'.(time()-60*60*2).'" AND `city` = "'.$u->info['city'].'" ORDER BY `id` DESC');
+				$zvb = '';
+				if($r==4 || $r==5)
+				{
+						/*echo '<table cellspacing="0" cellpadding="0" align="right"><tr><td>
 						<FIELDSET><LEGEND>���������� ������</LEGEND>
 						&nbsp;<INPUT TYPE=radio ID=A1 name="all" value=0 checked> <LABEL FOR=A1>����� ������</LABEL><BR>
 						&nbsp;<INPUT TYPE=radio ID=A2 name="all" value=1> <LABEL FOR=A2>���</LABEL>
 						</FIELDSET>
 						</td></tr></table><br>';*/
-                }
-                while ($pl = mysql_fetch_array($cl)) {
-                    if ($pl['razdel'] == 5) {
-                        //������ ���������� ���
-                        $tm = '';
-                        $tmStart = floor(($pl['time'] + $pl['time_start'] - time()) / 6) / 10;
-                        $tmStart = $this->rzv($tmStart);
-
-                        $users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "' . $pl['id'] . '"');
-                        while ($s = mysql_fetch_array($users)) {
-                            $tm .= $u->microLogin($uz['id'], 1) . ', ';
-                        }
-
-                        $rad = '';
-
-                        $tm = rtrim($tm, ', ');
-
-                        if (!isset($zi['id'])) {
-                            $rad = '<input type="radio" name="btl_go" id="btl_go' . $pl['id'] . '" value="' . $pl['id'] . '"> ';
-                        }
-
-                        $n1tv = '';
-
-                        if ($pl['invise'] == 1) {
-                            //��������� ���
-                            $tm = '<i>���������</i>';
-                            $n1tv = ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="���������">';
-                        }
-
-                        $zvb .= '' . $rad . '<font class="date">' . date('H:i', $pl['time']) . '</font> (' . $tm . ') (' . $pl['min_lvl_1'] . '-' . $pl['max_lvl_1'] . ') <IMG SRC="https://img.new-combats.com/i/fighttype' . $pl['type'] . '.gif" WIDTH="20" HEIGHT="20" title="��������� ���">' . $n1tv . ' <font class="dsc"><i>��� �������� ����� <B>' . $tmStart . '</B> ���., ������� ' . ($pl['timeout'] / 60) . ' ���. </font></i><BR>';
-
-                    } elseif ($pl['razdel'] == 4) {
-                        //������ ���������� ���
-                        $tm1 = '';
-                        $tm2 = '';
-                        $tmStart = floor(($pl['time'] + $pl['time_start'] - time()) / 6) / 10;
-                        $tmStart = $this->rzv($tmStart);
-
-                        //�������� � ������, ���������� ��� ����������
-                        //���� �������� ��� ���������
-                        $rndo = rand(0, 1000);
-                        if ($rndo < 250) {
-                            $apo = [];
-                            if (rand(0, 100) < 51) {
-                                $apo['team'] = 1;
-                            } else {
-                                $apo['team'] = 2;
-                            }
-                            if ($this->testzvu($pl['id'], $apo['team'], 0) < $pl['tm' . $apo['team'] . 'max'] && $this->testzvu($pl['id'], $apo['team'], 1) < $pl['bot' . $apo['team']]) {
-                                $spj = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE (`u`.`level` >= ' . $pl['min_lvl_' . $apo['team']] . ' AND `u`.`level` <= ' . $pl['max_lvl_' . $apo['team']] . ') AND `st`.`bot` = "2" AND `u`.`battle` = "0" AND `st`.`zv` = "0" LIMIT 1'));
-                                if (isset($spj['id'])) {
-                                    mysql_query('UPDATE `stats` SET `hpNow` = "3000",`mpNow` = "3000",`zv` = "' . $pl['id'] . '",`team` = "' . $apo['team'] . '" WHERE `id` = "' . $spj['id'] . '" LIMIT 1');
-                                }
-                            }
-                        }
-
-                        //���������� �������
-                        $users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "' . $pl['id'] . '"');
-                        while ($s = mysql_fetch_array($users)) {
-                            ${'tm' . $s['team']} .= $u->microLogin($s['id'], 1) . ', ';
-                        }
-
-                        if ($tm1 == '') {
-                            $tm1 = '������ ���� �� �������';
-                        } else {
-                            $tm1 = rtrim($tm1, ', ');
-                        }
-
-                        if ($tm2 == '') {
-                            $tm2 = '������ ���� �� �������';
-                        } else {
-                            $tm2 = rtrim($tm2, ', ');
-                        }
-                        $rad = '';
-                        if (!isset($zi['id'])) {
-                            $rad = '<input type="radio" name="groupClick" id="groupClick" value="' . $pl['id'] . '"> ';
-                        }
-                        $zvb .= '' . $rad . '<font class="date">' . date('H:i', $pl['time']) . '</font> <B>' . $pl['tm1max'] . ' (</b>' . $pl['min_lvl_1'] . '-' . $pl['max_lvl_1'] . '<b>) �� ' . $pl['tm2max'] . ' (</b>' . $pl['min_lvl_2'] . '-' . $pl['max_lvl_2'] . '<b>)</B> (' . $tm1 . ') <font class="dsc"><i><span style=\'color:red; font-weight:bold;\'>������</span></font></i> (' . $tm2 . ') <IMG SRC="https://img.new-combats.com/i/fighttype' . $pl['type'] . '.gif" WIDTH="20" HEIGHT="20" title="��������� ���"> <font class="dsc"><i>��� �������� ����� <B>' . $tmStart . '</B> ���., ������� ' . ($pl['timeout'] / 60) . ' ���. </font></i><BR>';
-                    } elseif ($pl['razdel'] >= 1 && $pl['razdel'] <= 3) {
-                        $uz = mysql_fetch_array(mysql_query('SELECT `u`.`banned`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $pl['id'] . '" AND `st`.`team`="1" LIMIT 1'));
-                        if (isset($uz['id'])) {
-                            $uze = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $pl['id'] . '" AND `st`.`team` = "2" LIMIT 1'));
-                            $d1 = '';
-                            if ($uz['id'] == $u->info['id'] || $uze['id'] == $u->info['id']) {
-                                $d1 = 'disabled="disabled"';
-                            }
-                            if (!isset($uze['id']) || $u->info['zv'] == $pl['id']) {
-                                $enm = '';
-
-                                if (isset($uze['id'])) {
-                                    $enm = ' ������ ' . $u->microLogin($uze['id'], 1) . '';
-                                }
-                                if ($uz['banned'] > 0) {
-                                    $pl['id'] = 0;
-                                    $d1 = 'disabled="disabled"';
-                                    $zvb .= '<span style="text-decoration:line-through;">';
-                                }
-                                $dp1 = '';
-                                if ($pl['money'] > 0) {
-                                    $dp1 = ' ��� �� ������, ������: <b>' . $u->round2($pl['money']) . ' ��.</b>';
-                                }
-                                $zvb .= '<input name="btl_go" ' . $d1 . ' type="radio" value="' . $pl['id'] . '" /> <font class="date">' . date('H:i', $pl['time']) . '</font> ' . $u->microLogin($uz['id'], 1) . ' ' . $enm . '  ��� ���: <img src="https://img.new-combats.com/i/fighttype' . ($pl['type']) . '.gif"> (������� ' . round($pl['timeout'] / 60) . ' ���.' . $dp1 . ')<br>';
-                                if ($uz['banned'] > 0) {
-                                    $zvb .= '</span>';
-                                }
-                            }
-                        }
-                    }
-                    $i++;
-                }
-                if ($i == 0) {
-                    //������ ���
-                } else {
-                    if (!isset($zi['id'])) {
-                        echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r=' . $r . '&rnd=' . $code . '"><input name="" type="submit" value="������� �����" /><br>' . $zvb . '<input style="margin-top:1px;" type="submit" value="������� �����" /></form></div>';
-                    } else {
-                        echo $zvb;
-                    }
-                }
-            }
-        }
-    }
-
-    public function go($id)
-    {
-        global $u, $c, $code, $zi, $filter;
-        if (!isset($zi['id'])) {
-            if ($u->info['battle'] == 0) {
-                $z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="' . mysql_real_escape_string(intval($id)) . '" AND `city` = "' . $u->info['city'] . '" AND `start` = "0" AND `cancel` = "0" AND `time` > "' . (time() - 60 * 60 * 2) . '" LIMIT 1'));
-                if (isset($z['id'])) {
-                    if ($z['razdel'] >= 1 && $z['razdel'] <= 3) {
-                        //�������, ����, ����������
-                        $uz1 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $z['id'] . '" AND `st`.`team`="1" LIMIT 1'));
-                        if (isset($uz1['id'])) {
-                            $uz2 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="' . $z['id'] . '" AND `st`.`team`="2" LIMIT 1'));
-                            if ($u->info['hpNow'] < $u->stats['hpAll'] / 100 * 30 && ($z['razdel'] >= 1 || $z['razdel'] <= 3)) {
-                                $this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
-                                $az = 0;
-                            } elseif ($uz1['clan'] == $u->info['clan'] && $u->info['clan'] != 0) {
-                                $this->error = '�� �� ������ ��������� ������ ��������';
-                            } elseif ($z['money'] > 0 && $u->info['level'] < 4) {
-                                $this->error = '��� �� ������ ���������� � 4-�� ������';
-                            } elseif ($z['withUser'] != '' && $filter->mystr($u->info['login']) != $filter->mystr($z['withUser']) && $z['razdel'] == 3) {
-                                $this->error = '�� �� ������ ������� ��� ������';
-                            } elseif ($z['money'] > 0 && $z['money'] > $u->info['money']) {
-                                $this->error = '� ��� ������������ �����, ����� ������� ��� ������';
-                            } elseif ($u->stats['hpNow'] < ceil($u->stats['hpMax'] / 100 * 30)) {
-                                $this->error = '�� ������� ���������, ��������������';
-                            } elseif (!isset($uz2['id'])) {
-                                $upd = mysql_query('UPDATE `stats` SET `zv` = "' . $z['id'] . '",`team` = "2" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                                if ($upd) {
-                                    $ca = '';
-                                    if ($uz1['clan'] != 0) {
-                                        $pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="' . $uz1['clan'] . '" LIMIT 1'));
-                                        if (isset($pc['id'])) {
-                                            $pc['img'] = $pc['name_mini'] . '.gif';
-                                            $ca = '<img title="' . $pc['name'] . '" src="https://img.new-combats.com/i/clan/' . $pc['name_mini'] . '.gif">';
-                                        }
-                                    }
-                                    if ($uz1['align'] != 0) {
-                                        $ca = '<img src="https://img.new-combats.com/i/align/align' . $uz1['align'] . '.gif">' . $ca;
-                                    }
-                                    $this->error = '������� ������������� ��� �� ' . $ca . ' ' . $uz1['login'] . ' [' . $uz1['level'] . ']<a href="info/' . $uz1['id'] . '" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" title="���. � ' . $uz1['login'] . '"></a>';
-                                    $sa = '';
-                                    if ($u->info['sex'] == 2) {
-                                        $sa = '�';
-                                    }
-                                    $text = ' [login:' . $u->info['login'] . '] ������' . $sa . ' ���� ������ �� ���.[reflesh_main_zv_priem:' . $u->info['id'] . ']';
-                                    mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('" . $uz1['city'] . "','" . $uz1['room'] . "','','" . $uz1['login'] . "','" . $text . "','" . time() . "','10','0')");
-                                    $zi = $z;
-                                    $u->info['zv'] = $z['id'];
-                                    $u->info['team'] = 2;
-                                } else {
-                                    $this->error = '���������� ������� ������.';
-                                }
-                            } else {
-                                $this->error = '������ ��� ���-�� ������ �� ���.';
-                            }
-                        } else {
-                            $this->error = '������ �� ��� �������������.';
-                        }
-                    } elseif ($z['razdel'] == 4 && $u->info['level'] > 1) {
-                        $tm = 0;
-                        //���������
-                        if (isset($_GET['tm1'])) {
-                            $tm = 1;
-                        } elseif (isset($_GET['tm2'])) {
-                            $tm = 2;
-                        } else {
-                            $this->error = '���-�� ����� �� ���';
-                        }
-
-                        if ($tm != 0) {
-                            $t1 = $tm;
-                            $t2 = 1;
-                            $tmmax = 0;
-                            if ($tm == 1) {
-                                $t2 = 2;
-                            }
-                            $cl111 = mysql_query('SELECT `u`.`clan`,`st`.`team`,`st`.`id`,`st`.`zv` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv` = "' . $z['id'] . '" LIMIT 200');
-                            $cln = 0;
-                            while ($pc111 = mysql_fetch_array($cl111)) {
-                                if ($pc111['clan'] == $u->info['clan'] && $u->info['clan'] != 0 && $pc111['team'] == $t2) {
-                                    $cln++;
-                                }
-                                if ($pc111['team'] == $t1) {
-                                    $tmmax++;
-                                }
-                            }
-                            if ($cln > 0) {
-                                $this->error = '�� �� ������ ��������� ������ ��������';
-                            } elseif ($z['tm' . $t1 . 'max'] > $tmmax) {
-                                if ($z['min_lvl_' . $t1] > $u->info['level'] || $z['max_lvl_' . $t1] < $u->info['level']) {
-                                    $this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� ' . $z['min_lvl_' . $t1] . ' - ' . $z['max_lvl_' . $t1] . ' ������';
-                                } elseif ($u->stats['hpNow'] < ceil($u->stats['hpMax'] / 100 * 30)) {
-                                    $this->error = '�� ������� ���������, ��������������';
-                                } else {
-                                    $upd = mysql_query('UPDATE `stats` SET `zv` = "' . $z['id'] . '",`team` = "' . mysql_real_escape_string((int)$t1) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                                    if (!$upd) {
-                                        $this->error = '������ ������ ������...';
-                                    } else {
-                                        $this->error = '�� ������� ��������� ���...';
-                                        $zi = $z;
-                                        $u->info['zv'] = $z['id'];
-                                        $u->info['team'] = mysql_real_escape_string((int)$t1);
-                                    }
-                                }
-                            } else {
-                                $this->error = '������ ��� ������� (' . ($z['tm' . $t1 . 'max'] - $tmmax) . ')';
-                            }
-                        }
-                    } elseif ($z['razdel'] == 5 && $u->info['level'] > 1) {
-                        //���������
-                        if ($z['min_lvl_1'] > $u->info['level'] || $z['max_lvl_1'] < $u->info['level']) {
-                            $this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� ' . $z['min_lvl_1'] . ' - ' . $z['max_lvl_1'] . ' ������';
-                        } elseif ($u->stats['hpNow'] < ceil($u->stats['hpMax'] / 100 * 30)) {
-                            $this->error = '�� ������� ���������, ��������������';
-                        } else {
-                            $t1 = 1;
-
-                            /* ������� ������ */
-                            if ($z['tm1'] > $z['tm2']) {
-                                $t1 = 2;
-                            } elseif ($z['tm1'] < $z['tm2']) {
-                                $t1 = 1;
-                            } else {
-                                $t1 = rand(1, 2);
-                            }
-
-                            if ($z['invise'] == 1) {
-                                $nxtID = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "' . $z['id'] . '"'));
-                                $nxtID = $nxtID[0];
-                                $u->info['login2'] = '���� (' . ($nxtID + 1) . ')';
-                            } else {
-                                $u->info['login2'] = '';
-                            }
-
-                            $blnc = 100 * $u->info['level'] + 10 * $u->info['upLevel'] + $u->info['exp'] + $u->stats['reting'];
-
-                            $z['tm' . $t1] += $blnc;
-
-                            $upd = mysql_query('UPDATE `stats` SET `zv` = "' . $z['id'] . '",`team` = "' . $t1 . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                            if (!$upd) {
-                                $this->error = '������ ������ ������...';
-                            } else {
-                                mysql_query('UPDATE `users` SET `login2` = "' . $u->info['login2'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                                mysql_query('UPDATE `zayvki` SET `tm1` = "' . $z['tm1'] . '", `tm2` = "' . $z['tm2'] . '" WHERE `id` = "' . $z['id'] . '" LIMIT 1');
-                                $this->error = '�� ������� ��������� ���...';
-                                $zi = $z;
-                                $u->info['zv'] = $z['id'];
-                                $u->info['team'] = mysql_real_escape_string((int)$t1);
-                            }
-                        }
-                    }
-                } else {
-                    $this->error = '������ �� ��� �� �������.';
-                }
-            }
-        } else {
-            $this->error = '�� �� ������ ������� ���. ������� �������� ���� ������.';
-        }
-    }
+				}
+				while($pl = mysql_fetch_array($cl))
+				{
+					if($pl['razdel']==5)
+					{
+						//������ ���������� ���
+						$tm = '';
+						$tmStart = floor(($pl['time']+$pl['time_start']-time())/6)/10;
+						$tmStart = $this->rzv($tmStart);
+						
+						$users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "'.$pl['id'].'"');
+						while($s = mysql_fetch_array($users))
+						{
+							$tm .= $u->microLogin($uz['id'],1).', ';
+						}
+						
+						$rad = '';
+						
+						$tm = rtrim($tm,', ');
+						
+						if(!isset($zi['id']))
+						{
+							$rad = '<input type="radio" name="btl_go" id="btl_go'.$pl['id'].'" value="'.$pl['id'].'"> ';
+						}
+						
+						$n1tv = '';
+						
+						if($pl['invise']==1)
+						{
+							//��������� ���
+							$tm = '<i>���������</i>';
+							$n1tv = ' <img src="https://img.new-combats.com/i/fighttypehidden0.gif" title="���������">';
+						}
+						
+						$zvb .= ''.$rad.'<font class="date">'.date('H:i',$pl['time']).'</font> ('.$tm.') ('.$pl['min_lvl_1'].'-'.$pl['max_lvl_1'].') <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif" WIDTH="20" HEIGHT="20" title="��������� ���">'.$n1tv.' <font class="dsc"><i>��� �������� ����� <B>'.$tmStart.'</B> ���., ������� '.($pl['timeout']/60).' ���. </font></i><BR>';						
+						
+					}elseif($pl['razdel']==4)
+					{
+						//������ ���������� ���
+						$tm1 = '';
+						$tm2 = '';
+						$tmStart = floor(($pl['time']+$pl['time_start']-time())/6)/10;
+						$tmStart = $this->rzv($tmStart);
+						
+						//�������� � ������, ���������� ��� ����������
+								//���� �������� ��� ���������
+								$rndo = rand(0,1000);
+								if($rndo < 250)
+								{
+									$apo = array();
+									if(rand(0,100)<51)
+									{
+										$apo['team'] = 1;
+									}else{
+										$apo['team'] = 2;
+									}
+									if($this->testzvu($pl['id'],$apo['team'],0) < $pl['tm'.$apo['team'].'max'] && $this->testzvu($pl['id'],$apo['team'],1) < $pl['bot'.$apo['team']])
+									{
+										$spj = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON (`u`.`id` = `st`.`id`) WHERE (`u`.`level` >= '.$pl['min_lvl_'.$apo['team']].' AND `u`.`level` <= '.$pl['max_lvl_'.$apo['team']].') AND `st`.`bot` = "2" AND `u`.`battle` = "0" AND `st`.`zv` = "0" LIMIT 1'));
+										if(isset($spj['id']))
+										{
+											mysql_query('UPDATE `stats` SET `hpNow` = "3000",`mpNow` = "3000",`zv` = "'.$pl['id'].'",`team` = "'.$apo['team'].'" WHERE `id` = "'.$spj['id'].'" LIMIT 1');
+										}
+									}
+								}
+						
+						//���������� �������
+						$users = mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`level`,`u`.`align`,`u`.`clan`,`u`.`admin`,`st`.`team` FROM `users` AS `u` LEFT JOIN `stats` AS `st` ON `u`.`id` = `st`.`id` WHERE `st`.`zv` = "'.$pl['id'].'"');
+						while($s = mysql_fetch_array($users))
+						{
+							${'tm'.$s['team']} .= $u->microLogin($s['id'],1).', ';
+						}					
+						
+						if($tm1=='')
+						{
+							$tm1 = '������ ���� �� �������';
+						}else{
+							$tm1 = rtrim($tm1,', ');
+						}
+						
+						if($tm2=='')
+						{
+							$tm2 = '������ ���� �� �������';
+						}else{
+							$tm2 = rtrim($tm2,', ');
+						}
+						$rad = '';
+						if(!isset($zi['id']))
+						{
+							$rad = '<input type="radio" name="groupClick" id="groupClick" value="'.$pl['id'].'"> ';
+						}
+						$zvb .= ''.$rad.'<font class="date">'.date('H:i',$pl['time']).'</font> <B>'.$pl['tm1max'].' (</b>'.$pl['min_lvl_1'].'-'.$pl['max_lvl_1'].'<b>) �� '.$pl['tm2max'].' (</b>'.$pl['min_lvl_2'].'-'.$pl['max_lvl_2'].'<b>)</B> ('.$tm1.') <font class="dsc"><i><span style=\'color:red; font-weight:bold;\'>������</span></font></i> ('.$tm2.') <IMG SRC="https://img.new-combats.com/i/fighttype'.$pl['type'].'.gif" WIDTH="20" HEIGHT="20" title="��������� ���"> <font class="dsc"><i>��� �������� ����� <B>'.$tmStart.'</B> ���., ������� '.($pl['timeout']/60).' ���. </font></i><BR>';
+					}elseif($pl['razdel']>=1 && $pl['razdel']<=3)
+					{
+						$uz = mysql_fetch_array(mysql_query('SELECT `u`.`banned`,`u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$pl['id'].'" AND `st`.`team`="1" LIMIT 1'));
+						if(isset($uz['id']))
+						{
+							$uze = mysql_fetch_array(mysql_query('SELECT `u`.*,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$pl['id'].'" AND `st`.`team` = "2" LIMIT 1'));
+							$d1 = '';
+							if($uz['id']==$u->info['id'] || $uze['id']==$u->info['id'])
+							{
+								$d1 = 'disabled="disabled"';
+							}
+							if(!isset($uze['id']) || $u->info['zv']==$pl['id'])
+							{
+								$enm = '';
+								
+								if(isset($uze['id']))
+								{									
+									$enm = ' ������ '.$u->microLogin($uze['id'],1).'';
+								}
+								if($uz['banned']>0)
+								{
+									$pl['id'] = 0;
+									$d1 = 'disabled="disabled"';
+									$zvb .= '<span style="text-decoration:line-through;">';
+								}
+								$dp1 = '';
+								if($pl['money']>0)
+								{
+									$dp1 = ' ��� �� ������, ������: <b>'.$u->round2($pl['money']).' ��.</b>';
+								}
+								$zvb .= '<input name="btl_go" '.$d1.' type="radio" value="'.$pl['id'].'" /> <font class="date">'.date('H:i',$pl['time']).'</font> '.$u->microLogin($uz['id'],1).' '.$enm.'  ��� ���: <img src="https://img.new-combats.com/i/fighttype'.($pl['type']).'.gif"> (������� '.round($pl['timeout']/60).' ���.'.$dp1.')<br>';
+								if($uz['banned']>0){	$zvb .= '</span>';	  }
+							}
+						}
+					}
+					$i++;
+				}
+				if($i==0)
+				{
+					//������ ���
+				}else{
+					if(!isset($zi['id']))
+					{
+						echo '<div style="float:left;"><form method="post" style="margin:0px;padding:0px;" action="main.php?zayvka=1&r='.$r.'&rnd='.$code.'"><input name="" type="submit" value="������� �����" /><br>'.$zvb.'<input style="margin-top:1px;" type="submit" value="������� �����" /></form></div>';
+					}else{
+						echo $zvb;
+					}
+				}
+			}
+		}
+	}
+	
+	public function go($id)
+	{
+		global $u,$c,$code,$zi,$filter;
+		if(!isset($zi['id']))
+		{
+			if($u->info['battle']==0)
+			{
+				$z = mysql_fetch_array(mysql_query('SELECT * FROM `zayvki` WHERE `id`="'.mysql_real_escape_string(intval($id)).'" AND `city` = "'.$u->info['city'].'" AND `start` = "0" AND `cancel` = "0" AND `time` > "'.(time()-60*60*2).'" LIMIT 1'));
+				if(isset($z['id']))
+				{
+					if($z['razdel']>=1 && $z['razdel']<=3)
+					{
+						//�������, ����, ����������
+						$uz1 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$z['id'].'" AND `st`.`team`="1" LIMIT 1'));
+						if(isset($uz1['id']))
+						{
+							$uz2 = mysql_fetch_array(mysql_query('SELECT `u`.`id`,`u`.`login`,`u`.`align`,`u`.`clan`,`u`.`admin`,`u`.`city`,`u`.`room`,`u`.`online`,`u`.`level`,`u`.`battle`,`u`.`money`,`st`.* FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv`="'.$z['id'].'" AND `st`.`team`="2" LIMIT 1'));
+							if($u->info['hpNow']<$u->stats['hpAll']/100*30 && ($z['razdel']>=1 || $z['razdel']<=3))
+							{
+								$this->error = '�� ��� ������� ��������� ����� ������ ����� ���';
+								$az = 0;
+							}elseif($uz1['clan']==$u->info['clan'] && $u->info['clan']!=0)
+							{
+								$this->error = '�� �� ������ ��������� ������ ��������';
+							}elseif($z['money']>0 && $u->info['level']<4)
+							{
+								$this->error = '��� �� ������ ���������� � 4-�� ������';
+							}elseif($z['withUser']!='' && $filter->mystr($u->info['login'])!=$filter->mystr($z['withUser']) && $z['razdel']==3)
+							{
+								$this->error = '�� �� ������ ������� ��� ������';
+							}elseif($z['money']>0 && $z['money']>$u->info['money'])
+							{
+								$this->error = '� ��� ������������ �����, ����� ������� ��� ������';
+							}elseif($u->stats['hpNow']<ceil($u->stats['hpMax']/100*30))
+							{
+								$this->error = '�� ������� ���������, ��������������';
+							}elseif(!isset($uz2['id']))
+							{
+								$upd = mysql_query('UPDATE `stats` SET `zv` = "'.$z['id'].'",`team` = "2" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+								if($upd)
+								{
+									$ca = '';
+									if($uz1['clan']!=0)
+									{
+										$pc = mysql_fetch_array(mysql_query('SELECT * FROM `clan` WHERE `id`="'.$uz1['clan'].'" LIMIT 1'));
+										if(isset($pc['id']))
+										{
+											$pc['img'] = $pc['name_mini'].'.gif';
+											$ca = '<img title="'.$pc['name'].'" src="https://img.new-combats.com/i/clan/'.$pc['name_mini'].'.gif">';
+										}
+									}
+									if($uz1['align']!=0)
+									{
+										$ca = '<img src="https://img.new-combats.com/i/align/align'.$uz1['align'].'.gif">'.$ca;
+									}
+									$this->error = '������� ������������� ��� �� '.$ca.' '.$uz1['login'].' ['.$uz1['level'].']<a href="info/'.$uz1['id'].'" target="_blank"><img src="https://img.new-combats.com/i/inf_capitalcity.gif" title="���. � '.$uz1['login'].'"></a>';
+									$sa = '';
+									if($u->info['sex']==2)
+									{
+										$sa = '�';
+									}
+									$text = ' [login:'.$u->info['login'].'] ������'.$sa.' ���� ������ �� ���.[reflesh_main_zv_priem:'.$u->info['id'].']';
+									mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`) VALUES ('".$uz1['city']."','".$uz1['room']."','','".$uz1['login']."','".$text."','".time()."','10','0')");
+									$zi = $z;
+									$u->info['zv'] = $z['id'];
+									$u->info['team'] = 2;
+								}else{
+									$this->error = '���������� ������� ������.';
+								}
+							}else{
+								$this->error = '������ ��� ���-�� ������ �� ���.';
+							}
+						}else{
+							$this->error = '������ �� ��� �������������.';
+						}
+					}elseif($z['razdel']==4 && $u->info['level']>1)
+					{
+						$tm = 0;
+						//���������
+						if(isset($_GET['tm1']))
+						{
+							$tm = 1;
+						}elseif(isset($_GET['tm2']))
+						{
+							$tm = 2;
+						}else{
+							$this->error = '���-�� ����� �� ���';	
+						}
+						
+						if($tm!=0)
+						{
+							$t1 = $tm;
+							$t2 = 1;
+							$tmmax = 0;
+							if($tm==1){ $t2 = 2; }
+							$cl111 = mysql_query('SELECT `u`.`clan`,`st`.`team`,`st`.`id`,`st`.`zv` FROM `stats` AS `st` LEFT JOIN `users` AS `u` ON (`st`.`id` = `u`.`id`) WHERE `st`.`zv` = "'.$z['id'].'" LIMIT 200');
+							$cln = 0;
+							while($pc111 = mysql_fetch_array($cl111))
+							{
+								if($pc111['clan']==$u->info['clan'] && $u->info['clan']!=0 && $pc111['team']==$t2)
+								{
+									$cln++;
+								}
+								if($pc111['team']==$t1)
+								{
+									$tmmax++;
+								}
+							}
+							if($cln>0)
+							{
+								$this->error = '�� �� ������ ��������� ������ ��������';
+							}elseif($z['tm'.$t1.'max']>$tmmax)
+							{
+								if($z['min_lvl_'.$t1]>$u->info['level'] || $z['max_lvl_'.$t1]<$u->info['level'])
+								{
+									$this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� '.$z['min_lvl_'.$t1].' - '.$z['max_lvl_'.$t1].' ������';
+								}elseif($u->stats['hpNow']<ceil($u->stats['hpMax']/100*30))
+								{
+									$this->error = '�� ������� ���������, ��������������';
+								}else{
+									$upd = mysql_query('UPDATE `stats` SET `zv` = "'.$z['id'].'",`team` = "'.mysql_real_escape_string((int)$t1).'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+									if(!$upd)
+									{
+										$this->error = '������ ������ ������...';
+									}else{
+										$this->error = '�� ������� ��������� ���...';
+										$zi = $z;
+										$u->info['zv'] = $z['id'];
+										$u->info['team'] = mysql_real_escape_string((int)$t1);
+									}
+								}
+							}else{
+								$this->error = '������ ��� ������� ('.($z['tm'.$t1.'max']-$tmmax).')';
+							}
+						}
+					}elseif($z['razdel']==5 && $u->info['level']>1)
+					{
+						//���������
+						if($z['min_lvl_1']>$u->info['level'] || $z['max_lvl_1']<$u->info['level'])
+						{
+							$this->error = '�� �� ��������� �� ������, �� ��� ������� ����� ����� ��������� '.$z['min_lvl_1'].' - '.$z['max_lvl_1'].' ������';
+						}elseif($u->stats['hpNow']<ceil($u->stats['hpMax']/100*30))
+						{
+							$this->error = '�� ������� ���������, ��������������';
+						}else{
+							$t1 = 1;
+							
+							/* ������� ������ */
+							if($z['tm1']>$z['tm2'])
+							{
+								$t1 = 2;
+							}elseif($z['tm1']<$z['tm2'])
+							{
+								$t1 = 1;
+							}else{
+								$t1 = rand(1,2);
+							}
+							
+							if($z['invise']==1)
+							{
+								$nxtID = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `stats` WHERE `zv` = "'.$z['id'].'"'));
+								$nxtID = $nxtID[0];
+								$u->info['login2'] = '���� ('.($nxtID+1).')';
+							}else{
+								$u->info['login2'] = '';
+							}
+							
+							$blnc = 100*$u->info['level']+10*$u->info['upLevel']+$u->info['exp']+$u->stats['reting'];
+					
+							$z['tm'.$t1] += $blnc;
+													
+							$upd = mysql_query('UPDATE `stats` SET `zv` = "'.$z['id'].'",`team` = "'.$t1.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+							if(!$upd)
+							{
+								$this->error = '������ ������ ������...';
+							}else{
+								mysql_query('UPDATE `users` SET `login2` = "'.$u->info['login2'].'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
+								mysql_query('UPDATE `zayvki` SET `tm1` = "'.$z['tm1'].'", `tm2` = "'.$z['tm2'].'" WHERE `id` = "'.$z['id'].'" LIMIT 1');
+								$this->error = '�� ������� ��������� ���...';
+								$zi = $z;
+								$u->info['zv'] = $z['id'];
+								$u->info['team'] = mysql_real_escape_string((int)$t1);
+							}
+						}
+					}
+				}else{
+					$this->error = '������ �� ��� �� �������.';
+				}						
+			}
+		}else{
+			$this->error = '�� �� ������ ������� ���. ������� �������� ���� ������.';
+		}
+	}	
 }
 
 $zv = new zayvki;
diff --git a/modules_data/location/ab/hram.php b/modules_data/location/ab/hram.php
index 8138fa06..381e5e15 100644
--- a/modules_data/location/ab/hram.php
+++ b/modules_data/location/ab/hram.php
@@ -4,18 +4,18 @@ if (!defined('GAME') || $u->room['file'] != 'ab/hram') {
 }
 
 require_once $_SERVER['DOCUMENT_ROOT'] . '/_incl_data/class/Insallah/Runes/Runes.php';
-$qst_hram = true;
 
+$qst_hram = true;
 
 if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
     if ($_GET['r'] == 1) {
         $_GET['itm'] = (int)$_GET['itm'];
-        //Переплавка вещей
+        //���������� �����
         $resz = $u->plavka($_GET['itm'], 1);
         $re = '<font color=red><b>' . $resz . '</b></font>';
         unset($resz);
     } elseif ($_GET['r'] == 2) {
-        //Переплавка рун
+        //���������� ���
         $resz = '';
         $itm123 = explode('x', $_GET['itm']);
 
@@ -28,15 +28,17 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
         $itm2 = mysql_fetch_array(mysql_query(sprintf($q, $itm2, $u->info['id'])));
         $itm3 = mysql_fetch_array(mysql_query(sprintf($q, $itm3, $u->info['id'])));
 
-        if ($itm1['iid'] == $itm2['iid'] || $itm2['iid'] == $itm3['iid'] || $itm1['iid'] == $itm3['iid']) {
-            $resz = 'Не удалось расплавить одну руну, она не сгорела.';
-        } elseif (!isset($itm1['id']) || !isset($itm2['id']) || !isset($itm3['id'])) {
-            $resz = 'Недостаточно компонентов для преобразования.';
-        }
+
+
+        if (!isset($itm1['id']) || !isset($itm2['id']) || !isset($itm3['id'])) {
+            $resz = '������������ ����������� ��� ��������������.';
+        } elseif ($itm1['iid'] == $itm2['iid'] || $itm2['iid'] == $itm3['iid'] || $itm1['iid'] == $itm3['iid']) {
+            $resz = '�� ������� ���������� ���� ����, ��� �� �������.';
+        } 
         if (empty($resz)) {
             $check = \Insallah\Runes::checkParts($itm1['item_id'], $itm2['item_id'], $itm3['item_id'], $u->rep['rep1']);
             if (empty($check)) {
-                $resz = 'Заготовки должны быть одного уровня или у вас недостаточен уровень прокачки храма знаний!';
+                $resz = '����������� ������ ���� ������ ������ ��� � ��� ������������ ������� �������� ����� ������!';
             } else {
                 mysql_query(sprintf($check['query'], $u->info['id']));
                 $newRune = \Insallah\Runes::get($check['rune_level']);
@@ -46,13 +48,13 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
                     mysql_query(sprintf('update items_users set `delete` = unix_timestamp() where id in (%d, %d, %d)',
                         $itm1['iid'], $itm2['iid'], $itm3['iid']));
                     if (date('w') == 0 || date('w') == 6 || date('w') == 2) {
-                        $u->repexp_add($u->info['id'], 10); //Репутация плавка рун +10
+                        $u->repexp_add($u->info['id'], 10); //��������� ������ ��� +10
                     }
                 }
             }
         }
     } elseif ($itm1['level'] == 1) {
-        //$resz = 'Унируны нельзя преобразовывать';
+        //$resz = '������� ������ ���������������';
         $itm4 = [];
         $sp = mysql_query('SELECT * FROM `items_main` WHERE `level` = "' . $itm1['level'] . '" AND `type` = 31
                 AND `id` != "' . $itm1['item_id'] . '" AND `id` != "' . $itm2['item_id'] . '" AND `id` != "' . $itm3['item_id'] . '" AND `id` < 6000');
@@ -62,7 +64,7 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
         $itm4 = $itm4[rand(0, count($itm4) - 1)];
         mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm3['iid'] . '" OR `id` = "' . $itm2['iid'] . '" OR `id` = "' . $itm1['iid'] . '"');
         $u->addItem($itm4['id'], $u->info['id']);
-        $resz = 'Удачно преобразованы руны &quot;' . $itm1['name'] . '&quot;,&quot;' . $itm2['name'] . '&quot; и &quot;' . $itm3['name'] . '&quot; в &quot;' . $itm4['name'] . '&quot;.';
+        $resz = '������ ������������� ���� &quot;' . $itm1['name'] . '&quot;,&quot;' . $itm2['name'] . '&quot; � &quot;' . $itm3['name'] . '&quot; � &quot;' . $itm4['name'] . '&quot;.';
     } else {
         $itm4 = [];
         $sp = mysql_query('SELECT * FROM `items_main` WHERE `level` = "' . $itm1['level'] . '" AND `type` = 31
@@ -73,7 +75,7 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
         $itm4 = $itm4[rand(0, count($itm4) - 1)];
         mysql_query('UPDATE `items_users` SET `delete` = "' . time() . '" WHERE `id` = "' . $itm3['iid'] . '" OR `id` = "' . $itm2['iid'] . '" OR `id` = "' . $itm1['iid'] . '"');
         $u->addItem($itm4['id'], $u->info['id']);
-        $resz = 'Удачно преобразованы руны &quot;' . $itm1['name'] . '&quot;,&quot;' . $itm2['name'] . '&quot; и &quot;' . $itm3['name'] . '&quot; в &quot;' . $itm4['name'] . '&quot;.';
+        $resz = '������ ������������� ���� &quot;' . $itm1['name'] . '&quot;,&quot;' . $itm2['name'] . '&quot; � &quot;' . $itm3['name'] . '&quot; � &quot;' . $itm4['name'] . '&quot;.';
     }
 
     $re = '<font color=red><b>' . $resz . '</b></font>';
@@ -137,10 +139,10 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
     <TABLE width="100%" cellspacing="0" cellpadding="0">
         <tr>
             <td valign="top">
-                <div align="center" class="pH3">Храм Знаний <? if ($_GET['r'] == 2) {
-                        echo ', Алтарь рун';
+                <div align="center" class="pH3">���� ������ <? if ($_GET['r'] == 2) {
+                        echo ', ������ ���';
                     } elseif ($_GET['r'] == 1) {
-                        echo ', Алтарь предметов';
+                        echo ', ������ ���������';
                     } ?></div>
                 <div align="left"><? if ($re != '') {
                         echo '<font color="red"><b>' . $re . '</b></font>';
@@ -168,8 +170,8 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
                                                                                                      id="greyText"
                                                                                                      class="menutop"
                                                                                                      onclick="location='main.php?loc=3.180.0.267&rnd=<? echo $code; ?>';"
-                                                                                                     title="<? thisInfRm('3.180.0.267', 1); ?>">Центральная
-                                                                    площадь</a></td>
+                                                                                                     title="<? thisInfRm('3.180.0.267', 1); ?>">�����������
+                                                                    �������</a></td>
                                                         </tr>
                                                     </table>
                                                 </td>
@@ -185,23 +187,24 @@ if (isset($_GET['itm']) && $qst_hram && $_GET['itm'] > 0) {
                     </tr>
                 </table>
                 <br/><br/>
-                <input type="button" class="btn" value="Обновить"
-                       onclick="location.href = '<?= 'main.php?r=' . floor($_GET['r']) ?>';"/> &nbsp;
-                <input class="btn" type="button" value="Вернуться" onclick="location.href = 'main.php';"/>
-                <br><br>
+                <input type="button" class="btn" value="��������" onclick="location.href = '<? if (isset($_GET['r'])) {
+                    echo 'main.php?r=' . floor($_GET['r']);
+                } else {
+                    echo 'main.php';
+                } ?>';"/><? if (isset($_GET['r'])) { ?> &nbsp; <input class="btn" type="button" value="���������"
+                                                                      onclick="location.href = 'main.php';"/><? } ?><br><br>
             </td>
-        </tr>
     </table>
     <div id="textgo" style="visibility:hidden;"></div>
-    <?php
+    <?
 }
 if (!isset($_GET['r'])) {
-//Диалоговый перс
+//���������� ����
     ?>
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
             <td width="250" valign="top"><? $usee = $u->getInfoPers($u->info['id'], 0);
-                if ($usee) {
+                if ($usee != false) {
                     echo $usee[0];
                 } else {
                     echo 'information is lost.';
@@ -209,103 +212,111 @@ if (!isset($_GET['r'])) {
             <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
             <td valign="top">
                 <div align="right">
-                    <?= !empty($re) ? '<span style="color: red; font-weight: bold">' . $re . '</span>' : '' ?>
-                    <div style="max-width: 500px;">
-                        <div style="position:relative; cursor: pointer;" id="ione"><img
-                                    src="https://img.new-combats.com/city/ap_bg13_1.jpg" alt=""
-                                    name="img_ione" width="500" height="268" border="1"
-                                    id="img_ione"/>
-                            <div id="buttons_on_image"
-                                 style="cursor:pointer; font-weight:bold; color:#D8D8D8; font-size:10px;">
-                                &nbsp; <span onmousemove="this.runtimeStyle.color = 'white';"
-                                             onmouseout="this.runtimeStyle.color = this.parentElement.style.color;"
-                                             onclick="window.open('https://new-combats.com/forum', 'forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')">Форум</span>
-                                &nbsp;
-                            </div>
-                            <script language="javascript" type="text/javascript">
-                                <!--
-                                if (document.getElementById('ione')) {
-                                    document.getElementById('ione').appendChild(document.getElementById('buttons_on_image'));
-                                    document.getElementById('buttons_on_image').style.position = 'absolute';
-                                    document.getElementById('buttons_on_image').style.bottom = '8px';
-                                    document.getElementById('buttons_on_image').style.right = '23px';
-                                } else {
-                                    document.getElementById('buttons_on_image').style.display = 'none';
-                                }
-                                -->
-                            </script>
-                            <div style="position: absolute; left: 437px; top: 96px; width: 48px; height: 33px; z-index: 94;">
-                                <img <? thisInfRm('1.180.0.323'); ?>
-                                        src="https://img.new-combats.com/city/ap_exit.gif"
-                                        width="57" height="26" class="aFilter"/></div>
-                            <div style="position: absolute; left: 191px; top: 12px; width: 75px; height: 68px; z-index: 94;">
-                                <img onclick="location.href='main.php?talk=11'"
-                                     src="https://img.new-combats.com/city/1269_igsetee.png"
-                                     width="120" height="220" class="aFilter"
-                                     title="Диалог с Арквиерро"/></div>
-                            <div style="position: absolute; left: 30px; top: 127px; width: 48px; height: 33px; z-index: 94;">
-                                <img <? if ($qst_hram == false) {
-                                    echo 'onclick="alert(\'Арквиерро: Вы не допущены к котлам! (Выполните задание)\');"';
-                                } else { ?> onclick="location.href='main.php?r=1'" <? } ?>
-                                        title="Алтарь Предметов"
-                                        src="https://img.new-combats.com/city/ap_altar1.gif"
-                                        width="147" height="93" class="aFilter"/></div>
-                            <div style="position: absolute; left: 333px; top: 129px; width: 48px; height: 33px; z-index: 94;">
-                                <img <? if ($qst_hram == false) {
-                                    echo 'onclick="alert(\'Арквиерро: Вы не допущены к котлам! (Выполните задание)\');"';
-                                } else { ?> onclick="location.href='main.php?r=2'" <? } ?>
-                                        title="Алтарь Рун"
-                                        src="https://img.new-combats.com/city/ap_altar2.gif"
-                                        width="147" height="93" class="aFilter"/></div>
-                            <div style="position: absolute; left: 437px; top: 96px; width: 48px; height: 33px; z-index: 94;">
-                                <img <? thisInfRm('3.180.0.267'); ?>
-                                        src="https://img.new-combats.com/city/ap_exit.gif"
-                                        width="57" height="26" class="aFilter"/></div>
+                    <table border="0" cellpadding="0" cellspacing="0">
+                        <tr align="right" valign="top">
+                            <td><? if ($re != '') {
+                                    echo '<font color="red"><b>' . $re . '</b></font>';
+                                } ?>
+                                <table width="500" border="0" cellspacing="0" cellpadding="0">
+                                    <tr>
+                                        <td>
+                                            <div style="position:relative; cursor: pointer;" id="ione"><img
+                                                        src="https://img.new-combats.com/city/ap_bg13_1.jpg" alt=""
+                                                        name="img_ione" width="500" height="268" border="1"
+                                                        id="img_ione"/>
+                                                <div id="buttons_on_image"
+                                                     style="cursor:pointer; font-weight:bold; color:#D8D8D8; font-size:10px;">
+                                                    &nbsp; <span onmousemove="this.runtimeStyle.color = 'white';"
+                                                                 onmouseout="this.runtimeStyle.color = this.parentElement.style.color;"
+                                                                 onclick="window.open('https://new-combats.com/forum', 'forum', 'location=yes,menubar=yes,status=yes,resizable=yes,toolbar=yes,scrollbars=yes,scrollbars=yes')">�����</span>
+                                                    &nbsp;
+                                                </div>
+                                                <script language="javascript" type="text/javascript">
+                                                    <!--
+                                                    if (document.getElementById('ione')) {
+                                                        document.getElementById('ione').appendChild(document.getElementById('buttons_on_image'));
+                                                        document.getElementById('buttons_on_image').style.position = 'absolute';
+                                                        document.getElementById('buttons_on_image').style.bottom = '8px';
+                                                        document.getElementById('buttons_on_image').style.right = '23px';
+                                                    } else {
+                                                        document.getElementById('buttons_on_image').style.display = 'none';
+                                                    }
+                                                    -->
+                                                </script>
+                                                <div style="position: absolute; left: 437px; top: 96px; width: 48px; height: 33px; z-index: 94;">
+                                                    <img <? thisInfRm('1.180.0.323'); ?>
+                                                            src="https://img.new-combats.com/city/ap_exit.gif"
+                                                            width="57" height="26" class="aFilter"/></div>
+                                                <div style="position: absolute; left: 191px; top: 12px; width: 75px; height: 68px; z-index: 94;">
+                                                    <img onclick="location.href='main.php?talk=11'"
+                                                         src="https://img.new-combats.com/city/1269_igsetee.png"
+                                                         width="120" height="220" class="aFilter"
+                                                         title="������ � ���������"/></div>
+                                                <div style="position: absolute; left: 30px; top: 127px; width: 48px; height: 33px; z-index: 94;">
+                                                    <img <? if ($qst_hram == false) {
+                                                        echo 'onclick="alert(\'���������: �� �� �������� � ������! (��������� �������)\');"';
+                                                    } else { ?> onclick="location.href='main.php?r=1'" <? } ?>
+                                                            title="������ ���������"
+                                                            src="https://img.new-combats.com/city/ap_altar1.gif"
+                                                            width="147" height="93" class="aFilter"/></div>
+                                                <div style="position: absolute; left: 333px; top: 129px; width: 48px; height: 33px; z-index: 94;">
+                                                    <img <? if ($qst_hram == false) {
+                                                        echo 'onclick="alert(\'���������: �� �� �������� � ������! (��������� �������)\');"';
+                                                    } else { ?> onclick="location.href='main.php?r=2'" <? } ?>
+                                                            title="������ ���"
+                                                            src="https://img.new-combats.com/city/ap_altar2.gif"
+                                                            width="147" height="93" class="aFilter"/></div>
+                                                <div style="position: absolute; left: 437px; top: 96px; width: 48px; height: 33px; z-index: 94;">
+                                                    <img <? thisInfRm('3.180.0.267'); ?>
+                                                            src="https://img.new-combats.com/city/ap_exit.gif"
+                                                            width="57" height="26" class="aFilter"/></div>
 
 
-                            <div id="snow"></div>
-                            <?= $goline ?> </div>
-                    </div>
-                    <div style="display:none; height:0px " id="moveto"></div>
-                    <INPUT class="btn"
-                           onclick="window.open('/forum?read=974&rnd=1', 'help', 'height=500,width=1024,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')"
-                           value="Подсказка для новичков" style="color:red;" type="button">
-                    </small>
+                                                <div id="snow"></div>
+                                                <? echo $goline; ?> </div>
+                                        </td>
+                                    </tr>
+                                </table>
+                                <div style="display:none; height:0px " id="moveto"></div>
+                                <INPUT class="btn"
+                                       onclick="window.open('/forum?read=974&rnd=1', 'help', 'height=500,width=1024,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes')"
+                                       value="��������� ��� ��������" style="color:red;" type="button">
+                                </small>
                 </div>
             </td>
             <td></td>
         </tr>
     </table>
-    <hr>
     <small>
+        <hr/>
         <br/>
-        <strong>Внимание!</strong> Никогда и никому не говорите пароль от своего персонажа. Не вводите пароль на
-        других
-        сайтах, типа &quot;новый город&quot;, &quot;лотерея&quot;, &quot;там, где все дают на халяву&quot;. Пароль
-        не
-        нужен ни паладинам, ни кланам, ни администрации, <U>только взломщикам</U> для кражи вашего героя.<br/>
-        <em>Администрация.</em></small> <br/>
-    <?= $rowonmax ?>
-    <br/>
-    <?php
+        <strong>��������!</strong> ������� � ������ �� �������� ������ �� ������ ���������. �� ������� ������ �� ������
+        ������, ���� &quot;����� �����&quot;, &quot;�������&quot;, &quot;���, ��� ��� ���� �� ������&quot;. ������ ��
+        ����� �� ���������, �� ������, �� �������������, <U>������ ����������</U> ��� ����� ������ �����.<br/>
+        <em>�������������.</em></small> <br/>
+    <? echo $rowonmax; ?><br/>
+    </div></td>
+    </tr>
+    </table>
+    <?
 } elseif ($_GET['r'] == 1) {
     $itmAll = '';
     $itmAllSee = '';
     $itmAll = $u->genInv(11, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` NOT LIKE "%fromshop=2%" ORDER BY `lastUPD` DESC');
     if ($itmAll[0] == 0) {
-        $itmAllSee = '<tr><td align="center" bgcolor="#e2e0e0">ПУСТО (нет подходящих предметов)</td></tr>';
+        $itmAllSee = '<tr><td align="center" bgcolor="#e2e0e0">����� (��� ���������� ���������)</td></tr>';
     } else {
         $itmAllSee = $itmAll[2];
     }
-//Удачно растворен предмет "Укрепленный Костыль". Получена руна "Моно Бауни".
+//������ ��������� ������� "����������� �������". �������� ���� "���� �����".
     ?>
     <script>
         function takeItRun(img, id, vl) {
             if (id != urlras) {
                 urlras = id;
-                document.getElementById('use_item').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="Предмет для переплавки"/><br><a href="javascript:void(0);" onClick="cancelItRun()">Отменить</a>';
+                document.getElementById('use_item').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="������� ��� ����������"/><br><a href="javascript:void(0);" onClick="cancelItRun()">��������</a>';
                 if (vl == 0) {
-                    document.getElementById('add_rep').innerHTML = ' + ' + vl + '<br><div><b><font color="red"><small>(Необходим предмет подходящего уровня, иначе вы не получите репутацию)</small></font></b></div>';
+                    document.getElementById('add_rep').innerHTML = ' + ' + vl + '<br><div><b><font color="red"><small>(��������� ������� ����������� ������, ����� �� �� �������� ���������)</small></font></b></div>';
                 } else {
                     document.getElementById('add_rep').innerHTML = ' + ' + vl;
                 }
@@ -316,7 +327,7 @@ if (!isset($_GET['r'])) {
 
         function cancelItRun() {
             urlras = 0;
-            document.getElementById('use_item').innerHTML = 'Предмет не выбран';
+            document.getElementById('use_item').innerHTML = '������� �� ������';
             document.getElementById('add_rep').innerHTML = '';
         }
 
@@ -325,20 +336,19 @@ if (!isset($_GET['r'])) {
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
             <td align="center" valign="top" bgcolor="#D6D6D6"><?= $u->microLogin($u->info['id'], 1) ?></td>
-            <td align="center" valign="top" bgcolor="#D6D6D6"><B>Подходящие предметы в инвентаре</B></td>
+            <td align="center" valign="top" bgcolor="#D6D6D6"><B>���������� �������� � ���������</B></td>
         </tr>
         <tr>
             <td width="300" valign="top">
-                <b>Репутация: <? echo 0 + $u->rep['rep1']; ?></b><span id="add_rep"></span>
+                <b>���������: <? echo 0 + $u->rep['rep1']; ?></b><span id="add_rep"></span>
                 <br/><br/>
-                <center><span id="use_item">Предмет не выбран</span><br/><br/>
-                    <input class="btn" type="button" value="Растворить"
-                           onclick="location = '?r=<?= $_GET['r'] . '&rnd=' . $code . '&itm='; ?>'+urlras;"/>
-                </center>
+                <center><span id="use_item">������� �� ������</span><br/><br/>
+                    <input class="btn" type="button" value="����������"
+                           onclick="location = '?r=<?= $_GET['r'] . '&rnd=' . $code . '&itm='; ?>'+urlras;"/></center>
                 <br/>
                 <br/><small>
-                    <font color="red">Внимание!</font><br/>
-                    Предметы при растворении и заготовки при слиянии необратимо теряются.</small>
+                    <font color="red">��������!</font><br/>
+                    �������� ��� ����������� � ��������� ��� ������� ���������� ��������.</small>
             </td>
             <td valign="top">
                 <!-- -->
@@ -346,7 +356,7 @@ if (!isset($_GET['r'])) {
                     <? if ($u->info['invBlock'] == 0) {
                         echo $itmAllSee;
                     } else {
-                        echo '<div align="center" style="padding:10px;background-color:#A5A5A5;"><form method="post" action="main.php?inv=1&otdel=' . $_GET['otdel'] . '&relockinvent"><b>Рюкзак закрыт.</b><br><img title="Замок для рюкзака" src="https://img.new-combats.com/i/items/box_lock.gif"> Введите пароль: <input id="relockInv" name="relockInv" type="password"><input type="submit" value="Открыть"></form></div>';
+                        echo '<div align="center" style="padding:10px;background-color:#A5A5A5;"><form method="post" action="main.php?inv=1&otdel=' . $_GET['otdel'] . '&relockinvent"><b>������ ������.</b><br><img title="����� ��� �������" src="https://img.new-combats.com/i/items/box_lock.gif"> ������� ������: <input id="relockInv" name="relockInv" type="password"><input type="submit" value="�������"></form></div>';
                     } ?>
                 </table>
                 <!-- -->
@@ -358,17 +368,17 @@ if (!isset($_GET['r'])) {
     $itmAllSee = '';
     $itmAll = $u->genInv(14, '`iu`.`uid`="' . $u->info['id'] . '" AND `iu`.`delete` = "0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = 31 OR`im`.`type` = 72) ORDER BY `lastUPD` DESC');
     if ($itmAll[0] == 0) {
-        $itmAllSee = '<tr><td align="center" bgcolor="#e2e0e0">ПУСТО (нет подходящих предметов)</td></tr>';
+        $itmAllSee = '<tr><td align="center" bgcolor="#e2e0e0">����� (��� ���������� ���������)</td></tr>';
     } else {
         $itmAllSee = $itmAll[2];
     }
-//Удачно растворен предмет "Укрепленный Костыль". Получена руна "Моно Бауни".
+//������ ��������� ������� "����������� �������". �������� ���� "���� �����".
     ?>
     <script>
         function takeItRun(img, id, vl) {
             if (id != urlras) {
                 urlras = id;
-                document.getElementById('use_item').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="Предмет для переплавки"/><br><a href="javascript:void(0);" onClick="cancelItRun()">Отменить</a>';
+                document.getElementById('use_item').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="������� ��� ����������"/><br><a href="javascript:void(0);" onClick="cancelItRun()">��������</a>';
             } else {
                 cancelItRun();
             }
@@ -376,7 +386,7 @@ if (!isset($_GET['r'])) {
 
         function cancelItRun() {
             urlras = 0;
-            document.getElementById('use_item').innerHTML = 'Пусто';
+            document.getElementById('use_item').innerHTML = '�����';
             document.getElementById('add_rep').innerHTML = '';
         }
 
@@ -386,7 +396,7 @@ if (!isset($_GET['r'])) {
         function takeItRun2(img, id, vl) {
             if (id != urlras2) {
                 urlras2 = id;
-                document.getElementById('use_item2').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="Предмет для переплавки"/><br><a href="javascript:void(0);" onClick="cancelItRun2()">Отменить</a>';
+                document.getElementById('use_item2').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="������� ��� ����������"/><br><a href="javascript:void(0);" onClick="cancelItRun2()">��������</a>';
             } else {
                 cancelItRun2();
             }
@@ -394,7 +404,7 @@ if (!isset($_GET['r'])) {
 
         function cancelItRun2() {
             urlras2 = 0;
-            document.getElementById('use_item2').innerHTML = 'Пусто';
+            document.getElementById('use_item2').innerHTML = '�����';
         }
 
         urlras2 = 0;
@@ -403,7 +413,7 @@ if (!isset($_GET['r'])) {
         function takeItRun3(img, id, vl) {
             if (id != urlras3) {
                 urlras3 = id;
-                document.getElementById('use_item3').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="Предмет для переплавки"/><br><a href="javascript:void(0);" onClick="cancelItRun3()">Отменить</a>';
+                document.getElementById('use_item3').innerHTML = '<img src="https://<?=$c['img'];?>/i/items/' + img + '" title="������� ��� ����������"/><br><a href="javascript:void(0);" onClick="cancelItRun3()">��������</a>';
             } else {
                 cancelItRun3();
             }
@@ -411,7 +421,7 @@ if (!isset($_GET['r'])) {
 
         function cancelItRun3() {
             urlras3 = 0;
-            document.getElementById('use_item3').innerHTML = 'Пусто';
+            document.getElementById('use_item3').innerHTML = '�����';
         }
 
         urlras3 = 0;
@@ -436,30 +446,30 @@ if (!isset($_GET['r'])) {
     <table width="100%" border="0" cellspacing="0" cellpadding="0">
         <tr>
             <td align="center" valign="top" bgcolor="#D6D6D6"><?= $u->microLogin($u->info['id'], 1) ?></td>
-            <td align="center" valign="top" bgcolor="#D6D6D6"><b>Подходящие предметы в инвентаре</b></td>
+            <td align="center" valign="top" bgcolor="#D6D6D6"><b>���������� �������� � ���������</b></td>
         </tr>
         <tr>
             <td width="300" valign="top">
-                <b>Репутация: <? echo 0 + $u->rep['rep1']; ?></b><span id="add_rep"></span>
+                <b>���������: <? echo 0 + $u->rep['rep1']; ?></b><span id="add_rep"></span>
                 <br/><br/>
                 <center>
 
                     <table border="0" cellspacing="0" cellpadding="0">
                         <tr>
-                            <td width="80" align="center"><span id="use_item">Пусто</span></td>
-                            <td width="80" align="center"><span id="use_item2">Пусто</span></td>
-                            <td width="80" align="center"><span id="use_item3">Пусто</span></td>
+                            <td width="80" align="center"><span id="use_item">�����</span></td>
+                            <td width="80" align="center"><span id="use_item2">�����</span></td>
+                            <td width="80" align="center"><span id="use_item3">�����</span></td>
                         </tr>
                     </table>
 
                     <br/><br/>
-                    <input class="btn" type="button" value="Преобразовать"
+                    <input class="btn" type="button" value="�������������"
                            onclick="location.href = '?r=<?= $_GET['r'] . '&rnd=' . $code . '&itm='; ?>'+urlras+'x'+urlras2+'x'+urlras3;"/>
                 </center>
                 <br/>
                 <br/><small>
-                    <font color="red">Внимание!</font><br/>
-                    Предметы при растворении и заготовки при слиянии необратимо теряются.</small>
+                    <font color="red">��������!</font><br/>
+                    �������� ��� ����������� � ��������� ��� ������� ���������� ��������.</small>
             </td>
             <td valign="top">
                 <!-- -->
@@ -467,11 +477,12 @@ if (!isset($_GET['r'])) {
                     <? if ($u->info['invBlock'] == 0) {
                         echo $itmAllSee;
                     } else {
-                        echo '<div align="center" style="padding:10px;background-color:#A5A5A5;"><form method="post" action="main.php?inv=1&otdel=' . $_GET['otdel'] . '&relockinvent"><b>Рюкзак закрыт.</b><br><img title="Замок для рюкзака" src="https://img.new-combats.com/i/items/box_lock.gif"> Введите пароль: <input id="relockInv" name="relockInv" type="password"><input type="submit" value="Открыть"></form></div>';
+                        echo '<div align="center" style="padding:10px;background-color:#A5A5A5;"><form method="post" action="main.php?inv=1&otdel=' . $_GET['otdel'] . '&relockinvent"><b>������ ������.</b><br><img title="����� ��� �������" src="https://img.new-combats.com/i/items/box_lock.gif"> ������� ������: <input id="relockInv" name="relockInv" type="password"><input type="submit" value="�������"></form></div>';
                     } ?>
                 </table>
                 <!-- -->
             </td>
         </tr>
     </table>
-<? }
\ No newline at end of file
+
+<? } ?>
\ No newline at end of file
diff --git a/modules_data/location/an/bank.php b/modules_data/location/an/bank.php
index 8102b9cb..6e335989 100644
--- a/modules_data/location/an/bank.php
+++ b/modules_data/location/an/bank.php
@@ -6,7 +6,7 @@ require_once '_incl_data/mails.php';
 
 if ($u->room['file'] == 'an/bank') {
     $noc = 60; //120 kr = 1 ekr.
-    $con = 20; //1 екр. = 30 кр.
+    $con = 20; //1 ���. = 30 ��.
     function getNum($v)
     {
         $plid = $v;
@@ -46,26 +46,26 @@ if ($u->room['file'] == 'an/bank') {
     if (isset($_GET['enter']) && !isset($u->bank['id'])) {
         $bank = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string((int)$_POST['bank']) . '" LIMIT 1'));
         if (!isset($bank['id'])) {
-            $re2 = 'Неверный номер счета.';
+            $re2 = '�������� ����� �����.';
         } elseif ($bank['pass'] != $_POST['pass']) {
             $pl = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > "' . (time() - 60 * 60) . '" AND `vars` = "bank_bad_pass_' . mysql_real_escape_string($bank['id']) . '" LIMIT 5'));
             if ($pl[0] >= 3) {
-                $re2 = 'Ваш счет был заблокирован на 1 час';
+                $re2 = '��� ���� ��� ������������ �� 1 ���';
             } else {
                 if ($pl[0] == 0) {
-                    $re2 = 'Неверный номер счета или пароль. Если вы трижды введете неверный номер счета или пароль, счет будет заблокирован на час';
+                    $re2 = '�������� ����� ����� ��� ������. ���� �� ������ ������� �������� ����� ����� ��� ������, ���� ����� ������������ �� ���';
                 } else {
-                    $pp = [0 => 'ок', 1 => 'ка', 2 => 'ки', 3 => 'ки'];
-                    $re2 = 'Неверный номер счета или пароль. У вас осталось ' . (3 - $pl[0]) . ' попыт' . $pp[3 - $pl[0]] . ', в противном случаи счет будет заблокирован на час';
+                    $pp = [0 => '��', 1 => '��', 2 => '��', 3 => '��'];
+                    $re2 = '�������� ����� ����� ��� ������. � ��� �������� ' . (3 - $pl[0]) . ' �����' . $pp[3 - $pl[0]] . ', � ��������� ������ ���� ����� ������������ �� ���';
                 }
                 mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_bad_pass_' . mysql_real_escape_string($bank['id']) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")');
             }
         } else {
 
             if ($u->info['allLock'] > time()) {
-                echo '<script>setTimeout(function(){alert("Вам запрещено пользоваться услугами банка до ' . date('d.m.y H:i', $u->info['allLock']) . '")},250);</script>';
+                echo '<script>setTimeout(function(){alert("��� ��������� ������������ �������� ����� �� ' . date('d.m.y H:i', $u->info['allLock']) . '")},250);</script>';
             } else {
-                //вошли!
+                //�����!
                 $bank['useNow'] = time() + 12 * 60 * 60;
                 mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `id` != "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1');
                 mysql_query('UPDATE `bank` SET `useNow` = "' . $bank['useNow'] . '" WHERE `id` = "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
@@ -77,27 +77,27 @@ if ($u->room['file'] == 'an/bank') {
         //echo $_GET['schet'].'<br>';
         $b_pass = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string(getNumId($_GET['schet'])) . '" ORDER BY `id` DESC LIMIT 1'));
         if ($b_pass['repass'] >= time()) {
-            $re2 = 'Номера счетов и пароли к ним можно выслать только один раз в сутки';
+            $re2 = '������ ������ � ������ � ��� ����� ������� ������ ���� ��� � �����';
         } else {
             mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_res","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")');
-            $re2 = 'Выслан номер счета и пароль на email, указанный в анкете';
+            $re2 = '������ ����� ����� � ������ �� email, ��������� � ������';
             mysql_query('UPDATE `bank` SET `repass` = "' . (time() + 24 * 3600) . '" WHERE `id` = "' . $b_pass['id'] . '" LIMIT 1');
-            $subject = 'Восстановление пароля от счета в банке персонажа ' . $u->info['login'];
-            $message = 'Номер счета: ' . getNum($b_pass['id']) . '<br>Пароль: ' . $b_pass['pass'] .
-                '<br><br>С уважением,<br>Администрация Бойцовского Клуба';
+            $subject = '�������������� ������ �� ����� � ����� ��������� ' . $u->info['login'];
+            $message = '����� �����: ' . getNum($b_pass['id']) . '<br>������: ' . $b_pass['pass'] .
+                '<br><br>� ���������,<br>������������� ����������� �����';
             mails($u->info['mail'], $message, $subject);
             unset($subject, $message);
         }
     } elseif (isset($_GET['open']) && !isset($u->bank['id'])) {
         if ($_POST['rdn01'] == 2 && ($u->info['level'] >= 8 || $u->info['money4'] < 15)) {
-            $re2 = 'Недостаточно зубов!';
+            $re2 = '������������ �����!';
         } elseif ($u->info['money'] >= 3 || ($u->info['level'] < 8 && $u->info['money4'] >= 15)) {
             if ($_POST['pass1'] == '' || $_POST['pass1'] == ' ') {
-                $re2 = 'Вы не указали пароль!';
+                $re2 = '�� �� ������� ������!';
             } elseif ($_POST['pass1'] != $_POST['pass2']) {
-                $re2 = 'Пароли не совпадают!';
+                $re2 = '������ �� ���������!';
             } elseif ($u->info['money'] - 3 < 0 && $_POST['rdn01'] != 2) {
-                $re2 = 'У вас недостаточно кр.';
+                $re2 = '� ��� ������������ ��.';
             } elseif ($u->info['align'] != 2) {
                 $pass = rand(10000, 91191);
                 $pass = htmlspecialchars($_POST['pass1'], null, 'cp1251');
@@ -110,19 +110,19 @@ if ($u->room['file'] == 'an/bank') {
                         $u->info['money'] -= 3;
                     }
                     $upd = mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '",`money4` = "' . $u->info['money4'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                    $re2 = 'Счет №<b>' . getNum($bank) . '</b> был успешно открыт.<br>Пароль от счета: <b>' . $pass . '</b><br><small><br>(Сменить пароль можно в разделе "Управление счетом" после авторизации)';
-                    $u->addDelo(3, $u->info['id'], 'Вы успешно открыли счет №' . getNum($bank) . '', time(), $u->info['city'], 'Bank.System', 3, 0, '');
+                    $re2 = '���� �<b>' . getNum($bank) . '</b> ��� ������� ������.<br>������ �� �����: <b>' . $pass . '</b><br><small><br>(������� ������ ����� � ������� "���������� ������" ����� �����������)';
+                    $u->addDelo(3, $u->info['id'], '�� ������� ������� ���� �' . getNum($bank) . '', time(), $u->info['city'], 'Bank.System', 3, 0, '');
                 } else {
-                    $re2 = 'Банк отказал в получении банковского счета.';
+                    $re2 = '���� ������� � ��������� ����������� �����.';
                 }
             } else {
-                $re2 = 'Хаосники не могут создавать новые счета в банке.';
+                $re2 = '�������� �� ����� ��������� ����� ����� � �����.';
             }
         } else {
             if ($u->info['level'] < 8) {
-                $re2 = 'Для открытия счета необходимо иметь при себе <b>3.00 кр.</b> или <b>' . $u->zuby(15) . '</b>';
+                $re2 = '��� �������� ����� ���������� ����� ��� ���� <b>3.00 ��.</b> ��� <b>' . $u->zuby(15) . '</b>';
             } else {
-                $re2 = 'Для открытия счета необходимо иметь при себе <b>3.00 кр.</b>';
+                $re2 = '��� �������� ����� ���������� ����� ��� ���� <b>3.00 ��.</b>';
             }
         }
     } elseif (isset($_GET['exit']) && isset($u->bank['id'])) {
@@ -137,7 +137,7 @@ if ($u->room['file'] == 'an/bank') {
     if (isset($u->bank['id'])) {
         if (isset($_POST['sd4']) && $u->newAct($_POST['sd4'])) {
             if (isset($_POST['transfer_kredit2']) && $u->info['admin'] > 0) {
-                //перевод екредитов с одного счета на другой
+                //������� ��������� � ������ ����� �� ������
                 $ub = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string((int)$_POST['num2']) . '" LIMIT 1'));
                 if (isset($ub['id']) && $ub['id'] != $u->bank['id']) {
                     $ut = mysql_fetch_array(mysql_query('SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($ub['uid']) . '" LIMIT 1'));
@@ -148,7 +148,7 @@ if ($u->room['file'] == 'an/bank') {
                         $mn += $prc;
                         if ($u->bank['money2'] >= $mn) {
                             if ($mn < 0.01 || $mn > 1000000000) {
-                                $re2 = 'Неверно указана сумма';
+                                $re2 = '������� ������� �����';
                             } else {
                                 $upd = mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($u->bank['money2'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                                 if ($upd) {
@@ -159,10 +159,10 @@ if ($u->room['file'] == 'an/bank') {
                                     mysql_query('UPDATE `users` SET `frg` = `frg` + ' . floor($mn) . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
 
                                     mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($ub['money2']) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
-                                    $re2 = 'Вы удачно перевели <b>' . ($mn - $prc) . ' екр.</b> (комиссия <b>' . $prc . ' екр.</b>) на счет №' . getNum($ub['id']) . ' персонажу &quot;<b>' . $ut['login'] . '</b>&quot;';
-                                    $u->addDelo(3, $ut['id'], 'Получено <b>' . ($mn - $prc) . ' екр.</b> со счета №' . getNum($u->bank['id']) . ' от персонажа &quot;' . $u->info['login'] . '&quot;, комиссия <b>' . $prc . ' екр.</b> <i>(Итого: ' . $ub['money1'] . ' кр., ' . $ub['money2'] . ' екр.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
-                                    $u->addDelo(3, $u->info['id'], 'Передано <b>' . ($mn - $prc) . ' екр.</b> на счет №' . getNum($ub['id']) . ' персонажу &quot;' . $ut['login'] . '&quot;, комиссия <b>' . $prc . ' екр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
-                                    $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] перевел со своего банковского счета №' . $u->bank['id'] . ' на счет №' . $ub['id'] . ' к персонажу &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' екр.';
+                                    $re2 = '�� ������ �������� <b>' . ($mn - $prc) . ' ���.</b> (�������� <b>' . $prc . ' ���.</b>) �� ���� �' . getNum($ub['id']) . ' ��������� &quot;<b>' . $ut['login'] . '</b>&quot;';
+                                    $u->addDelo(3, $ut['id'], '�������� <b>' . ($mn - $prc) . ' ���.</b> �� ����� �' . getNum($u->bank['id']) . ' �� ��������� &quot;' . $u->info['login'] . '&quot;, �������� <b>' . $prc . ' ���.</b> <i>(�����: ' . $ub['money1'] . ' ��., ' . $ub['money2'] . ' ���.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
+                                    $u->addDelo(3, $u->info['id'], '�������� <b>' . ($mn - $prc) . ' ���.</b> �� ���� �' . getNum($ub['id']) . ' ��������� &quot;' . $ut['login'] . '&quot;, �������� <b>' . $prc . ' ���.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
+                                    $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] ������� �� ������ ����������� ����� �' . $u->bank['id'] . ' �� ���� �' . $ub['id'] . ' � ��������� &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' ���.';
                                     $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
                                     $u->addDelo(1, $ut['id'], $log, time(), $ut['city'], 'Bank.System', 0, 0, '');
                                     if ($ut['id'] != $u->info['id']) {
@@ -170,25 +170,25 @@ if ($u->room['file'] == 'an/bank') {
                                         if ($u->info['align'] == 50) {
                                             $alg = '<img src=https://img.new-combats.com/i/align/align50.gif >';
                                         }
-                                        $text = '&quot;' . $alg . '[login:' . $u->info['login'] . ']&quot; перевел' . ($u->info['sex'] == 0 ? "" : "а") . ' вам <b>' . ($mn - $prc) . ' екр.</b> со своего банковского счета №' . getNum($u->bank['id']) . ' на ваш банковский счет №' . getNum($ub['id']) . '.';
+                                        $text = '&quot;' . $alg . '[login:' . $u->info['login'] . ']&quot; �������' . ($u->info['sex'] == 0 ? "" : "�") . ' ��� <b>' . ($mn - $prc) . ' ���.</b> �� ������ ����������� ����� �' . getNum($u->bank['id']) . ' �� ��� ���������� ���� �' . getNum($ub['id']) . '.';
 
                                         mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time() . "','12','0','1')");
                                     }
                                 } else {
-                                    $re2 = 'Не удалось выполнить операцию';
+                                    $re2 = '�� ������� ��������� ��������';
                                 }
                             }
                         } else {
-                            $re2 = 'У вас нет <b>' . $mn . ' екр.</b> на счете';
+                            $re2 = '� ��� ��� <b>' . $mn . ' ���.</b> �� �����';
                         }
                     } else {
-                        $re2 = 'Нельзя перевести кредиты на этот счет';
+                        $re2 = '������ ��������� ������� �� ���� ����';
                     }
                 } else {
-                    $re2 = 'Нельзя перевести кредиты на этот счет';
+                    $re2 = '������ ��������� ������� �� ���� ����';
                 }
             } elseif (isset($_POST['transfer_kredit']) && $u->info['align'] != 2) {
-                //перевод кредитов с одного счета на другой
+                //������� �������� � ������ ����� �� ������
                 if ($u->info['level'] >= 4 || $u->info['admin'] > 0) {
                     $ub = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string((int)$_POST['num']) . '" LIMIT 1'));
                     if (isset($ub['id']) && $ub['id'] != $u->bank['id']) {
@@ -200,41 +200,41 @@ if ($u->room['file'] == 'an/bank') {
                             $mn += $prc;
                             if ($u->bank['money1'] >= $mn) {
                                 if ($mn < 0.01 || $mn > 1000000000) {
-                                    $re2 = 'Неверно указана сумма';
+                                    $re2 = '������� ������� �����';
                                 } else {
                                     $upd = mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                                     if ($upd) {
                                         $u->bank['money1'] -= $mn;
                                         $ub['money1'] += $mn - $prc;
                                         mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($ub['money1']) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
-                                        $re2 = 'Вы удачно перевели <b>' . ($mn - $prc) . ' кр.</b> (комиссия <b>' . $prc . ' кр.</b>) на счет №' . getNum($ub['id']) . ' персонажу &quot;<b>' . $ut['login'] . '</b>&quot;';
-                                        $u->addDelo(3, $ut['id'], 'Получено <b>' . ($mn - $prc) . ' кр.</b> со счета №' . getNum($u->bank['id']) . ' от персонажа &quot;' . $u->info['login'] . '&quot;, комиссия <b>' . $prc . ' кр.</b> <i>(Итого: ' . $ub['money1'] . ' кр., ' . $ub['money2'] . ' екр.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
-                                        $u->addDelo(3, $u->info['id'], 'Передано <b>' . ($mn - $prc) . ' кр.</b> на счет №' . getNum($ub['id']) . ' персонажу &quot;' . $ut['login'] . '&quot;, комиссия <b>' . $prc . ' кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
-                                        $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] перевел со своего банковского счета №' . $u->bank['id'] . ' на счет №' . $ub['id'] . ' к персонажу &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' кр. Дополнительно снято ' . $prc . ' кр. за услуги банка.';
+                                        $re2 = '�� ������ �������� <b>' . ($mn - $prc) . ' ��.</b> (�������� <b>' . $prc . ' ��.</b>) �� ���� �' . getNum($ub['id']) . ' ��������� &quot;<b>' . $ut['login'] . '</b>&quot;';
+                                        $u->addDelo(3, $ut['id'], '�������� <b>' . ($mn - $prc) . ' ��.</b> �� ����� �' . getNum($u->bank['id']) . ' �� ��������� &quot;' . $u->info['login'] . '&quot;, �������� <b>' . $prc . ' ��.</b> <i>(�����: ' . $ub['money1'] . ' ��., ' . $ub['money2'] . ' ���.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
+                                        $u->addDelo(3, $u->info['id'], '�������� <b>' . ($mn - $prc) . ' ��.</b> �� ���� �' . getNum($ub['id']) . ' ��������� &quot;' . $ut['login'] . '&quot;, �������� <b>' . $prc . ' ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
+                                        $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] ������� �� ������ ����������� ����� �' . $u->bank['id'] . ' �� ���� �' . $ub['id'] . ' � ��������� &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' ��. ������������� ����� ' . $prc . ' ��. �� ������ �����.';
                                         $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
                                         $u->addDelo(1, $ut['id'], $log, time(), $ut['city'], 'Bank.System', 0, 0, '');
                                         if ($ut['id'] != $u->info['id']) {
-                                            $text = '&quot;[login:' . $u->info['login'] . ']&quot; перевел' . ($u->info['sex'] == 0 ? "" : "а") . ' вам <b>' . ($mn - $prc) . ' кр.</b> со своего банковского счета №' . getNum($u->bank['id']) . ' на ваш банковский счет №' . getNum($ub['id']) . '.';
+                                            $text = '&quot;[login:' . $u->info['login'] . ']&quot; �������' . ($u->info['sex'] == 0 ? "" : "�") . ' ��� <b>' . ($mn - $prc) . ' ��.</b> �� ������ ����������� ����� �' . getNum($u->bank['id']) . ' �� ��� ���������� ���� �' . getNum($ub['id']) . '.';
                                             mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time() . "','6','0','1')");
                                         }
                                     } else {
-                                        $re2 = 'Не удалось выполнить операцию';
+                                        $re2 = '�� ������� ��������� ��������';
                                     }
                                 }
                             } else {
-                                $re2 = 'У вас нет <b>' . $mn . ' кр.</b> на счете';
+                                $re2 = '� ��� ��� <b>' . $mn . ' ��.</b> �� �����';
                             }
                         } else {
-                            $re2 = 'Нельзя перевести кредиты на этот счет';
+                            $re2 = '������ ��������� ������� �� ���� ����';
                         }
                     } else {
-                        $re2 = 'Нельзя перевести кредиты на этот счет';
+                        $re2 = '������ ��������� ������� �� ���� ����';
                     }
                 } else {
-                    $re2 = 'Передача кредитов возможна только с 4-го уровня';
+                    $re2 = '�������� �������� �������� ������ � 4-�� ������';
                 }
             } elseif ($u->info['align'] != 2 && $u->info['haos'] < time() && $u->info['haos'] != 1 && $u->info['align'] != 50 && isset($_POST['convert_kredit']) && 1 == 2) {
-                //обменять кр. на екр.
+                //�������� ��. �� ���.
                 if ($u->info['palpro'] > time()) {
                     $mn = ceil((int)($_POST['convert_sum2'] * 100));
                     $mn = round(($mn / 100), 2);
@@ -244,9 +244,9 @@ if ($u->room['file'] == 'an/bank') {
                     $sm_lim = 50;
                     if (isset($sm['id']) && $sm['vals'] + $mne > $sm_lim) {
                         if ($sm['vals'] < $sm_lim) {
-                            $re2 = 'На сегодня Вы можете обменять еще на <b>' . ($sm_lim - $sm['vals']) . ' екр.</b>. (Примерно ' . round((($sm_lim - $sm['vals']) * $noc), 2) . ' кр.), текущий обмен на <b>' . $mne . ' екр.</b>.';
+                            $re2 = '�� ������� �� ������ �������� ��� �� <b>' . ($sm_lim - $sm['vals']) . ' ���.</b>. (�������� ' . round((($sm_lim - $sm['vals']) * $noc), 2) . ' ��.), ������� ����� �� <b>' . $mne . ' ���.</b>.';
                         } else {
-                            $re2 = 'На сегодня Вы исчерпали свой лимит обмена кр. на екр. (' . $sm_lim . ' екр.)';
+                            $re2 = '�� ������� �� ��������� ���� ����� ������ ��. �� ���. (' . $sm_lim . ' ���.)';
                         }
                     } elseif ($mn > 0 && $mne > 0 && $mn >= round((0.01 * ($noc * 1.03) + 5), 2)) {
                         if ($u->bank['money1'] >= $mn) {
@@ -255,109 +255,109 @@ if ($u->room['file'] == 'an/bank') {
                             } else {
                                 mysql_query('UPDATE `actions` SET `vals` = "' . ($sm['vals'] + $mne) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1');
                             }
-                            $re2 = 'Вы успешно обменяли <b>' . $mn . ' кр.</b> на <b>' . $mne . ' екр.</b>';
+                            $re2 = '�� ������� �������� <b>' . $mn . ' ��.</b> �� <b>' . $mne . ' ���.</b>';
                             $u->bank['money1'] -= $mn;
                             $u->bank['money2'] += $mne;
 
                             mysql_query('UPDATE `users` SET `catch` = `catch` + "' . round($mne, 2) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
 
                             mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '", `money2` = "' . mysql_real_escape_string($u->bank['money2']) . '" WHERE `id` = "' . mysql_real_escape_string($u->bank['id']) . '" LIMIT 1');
-                            $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] обменял <b>' . $mn . ' кр.</b> на <b>' . $mne . ' екр.</b>, Банковский счет №' . $u->bank['id'] . '.';
+                            $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] ������� <b>' . $mn . ' ��.</b> �� <b>' . $mne . ' ���.</b>, ���������� ���� �' . $u->bank['id'] . '.';
                             $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
-                            $u->addDelo(3, $u->info['id'], 'Вы успешно обменяли <b>' . ceil((int)($_POST['convert_sum2'] * 100 / 100)) . ' кр.</b> на <b>' . $mne . ' екр.</b>, комиссия <b>' . round((ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2) . ' кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $u->addDelo(3, $u->info['id'], '�� ������� �������� <b>' . ceil((int)($_POST['convert_sum2'] * 100 / 100)) . ' ��.</b> �� <b>' . $mne . ' ���.</b>, �������� <b>' . round((ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2) . ' ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
                         } else {
-                            $re2 = 'У вас нет <b>' . $mn . ' кр.</b> на счете';
+                            $re2 = '� ��� ��� <b>' . $mn . ' ��.</b> �� �����';
                         }
                     } else {
-                        $re2 = 'Минимальная сумма для обмена составляет ' . round((0.01 * ($noc * 1.03) + 5), 2) . ' кр.';
+                        $re2 = '����������� ����� ��� ������ ���������� ' . round((0.01 * ($noc * 1.03) + 5), 2) . ' ��.';
                     }
                 } else {
-                    $re2 = 'Вы должны пройти проверку на чистоту у Паладинов или Тарманов.';
+                    $re2 = '�� ������ ������ �������� �� ������� � ��������� ��� ��������.';
                 }
             } elseif (isset($_POST['convert_ekredit'])) {
-                //обменять екр. на кр.
+                //�������� ���. �� ��.
                 $mn = ceil((int)($_POST['convert_sum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->bank['money2'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма';
+                        $re2 = '������� ������� �����';
                     } else {
                         $upd = mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1'] + ($mn * $con)) . '",`money2` = "' . mysql_real_escape_string($u->bank['money2'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money1'] += $mn * $con;
                             $u->bank['money2'] -= $mn;
-                            $u->addDelo(3, $u->info['id'], 'Вы обменяли <b>' . $mn . ' екр.</b> на <b>' . ($mn * $con) . ' кр.</b>, комиссия <b>0 кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con), $u->bank['id']);
-                            $re2 = 'Вы удачно обменяли <b>' . $mn . ' екр.</b> на <b>' . ($mn * $con) . ' кр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� �������� <b>' . $mn . ' ���.</b> �� <b>' . ($mn * $con) . ' ��.</b>, �������� <b>0 ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con), $u->bank['id']);
+                            $re2 = '�� ������ �������� <b>' . $mn . ' ���.</b> �� <b>' . ($mn * $con) . ' ��.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет <b>' . $mn . ' екр.</b> на счете';
+                    $re2 = '� ��� ��� <b>' . $mn . ' ���.</b> �� �����';
                 }
             } elseif (isset($_POST['get_kredit'])) {
-                //положить деньги на счет
+                //�������� ������ �� ����
                 $mn = floor((int)($_POST['get_sum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->bank['money1'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма';
+                        $re2 = '������� ������� �����';
                     } else {
                         $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money'] + $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money1'] -= $mn;
                             $u->info['money'] += $mn;
                             mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
-                            $u->addDelo(3, $u->info['id'], 'Вы сняли со счета <b>' . $mn . ' кр.</b>, комиссия <b>0 кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
-                            $re2 = 'Вы удачно сняли со счета <b>' . $mn . ' кр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� ����� �� ����� <b>' . $mn . ' ��.</b>, �������� <b>0 ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $re2 = '�� ������ ����� �� ����� <b>' . $mn . ' ��.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет <b>' . $mn . ' кр.</b> на счете';
+                    $re2 = '� ��� ��� <b>' . $mn . ' ��.</b> �� �����';
                 }
             } elseif (isset($_POST['add_kredit'])) {
-                //положить деньги на счет
+                //�������� ������ �� ����
                 $mn = floor((int)($_POST['add_sum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->info['money'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма';
+                        $re2 = '������� ������� �����';
                     } else {
                         $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money'] - $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money1'] += $mn;
                             $u->info['money'] -= $mn;
                             mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
-                            $u->addDelo(3, $u->info['id'], 'Вы положили на счет <b>' . $mn . ' кр.</b>, комиссия <b>0 кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
-                            $re2 = 'Вы удачно положили на свой счет <b>' . $mn . ' кр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� �������� �� ���� <b>' . $mn . ' ��.</b>, �������� <b>0 ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $re2 = '�� ������ �������� �� ���� ���� <b>' . $mn . ' ��.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет при себе <b>' . $mn . ' кр.</b>';
+                    $re2 = '� ��� ��� ��� ���� <b>' . $mn . ' ��.</b>';
                 }
             } elseif (isset($_POST['change_psw2'])) {
-                //смена пароля счета
+                //����� ������ �����
                 $sm = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vals` = "id=' . $u->bank['id'] . '&new_pass=' . $u->bank['pass'] . '" AND `vars` = "bank_new_pass" AND `time` > "' . (time() - 24 * 60 * 60) . '" LIMIT 1', 1);
                 if ($_POST['new_psw1'] != $_POST['new_psw2']) {
-                    $re2 = 'Пароли не совпадают';
+                    $re2 = '������ �� ���������';
                 } elseif (iconv_strlen($_POST['new_psw1']) < 6 || iconv_strlen($_POST['new_psw1']) > 32) {
-                    $re2 = 'Пароль не может быть короче 6 или длинее 32 символов';
+                    $re2 = '������ �� ����� ���� ������ 6 ��� ������ 32 ��������';
                 } elseif (isset($sm['id'])) {
-                    $re2 = 'Нельзя менять пароль чаще одного раза в день';
+                    $re2 = '������ ������ ������ ���� ������ ���� � ����';
                 } else {
-                    //меняем
+                    //������
                     $upd = mysql_query('UPDATE `bank` SET `pass` = "' . mysql_real_escape_string($_POST['new_psw1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                     if ($upd) {
                         $u->addAction(time(), 'bank_new_pass', 'id=' . $u->bank['id'] . '&new_pass=' . $_POST['new_psw1'] . '');
                         $u->bank['pass'] = $_POST['new_psw1'];
-                        $re2 = 'Пароль от счета №<b>' . getNum($u->bank['id']) . '</b> был успешно изменен<br>Новый пароль: <b>' . $u->bank['pass'] . '</b>';
-                        $u->addDelo(3, $u->info['id'], 'Был изменен пароль от счета.', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                        $re2 = '������ �� ����� �<b>' . getNum($u->bank['id']) . '</b> ��� ������� �������<br>����� ������: <b>' . $u->bank['pass'] . '</b>';
+                        $u->addDelo(3, $u->info['id'], '��� ������� ������ �� �����.', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
                     } else {
-                        $re2 = 'Вам отказали в смене пароля';
+                        $re2 = '��� �������� � ����� ������';
                     }
                 }
             }
@@ -425,7 +425,7 @@ if ($u->room['file'] == 'an/bank') {
             <td>
                 <div align="center">
                     <div align="center" class="pH3">
-                        <h3>Банк<br/></h3>
+                        <h3>����<br/></h3>
                     </div>
                 </div>
             </td>
@@ -453,8 +453,8 @@ if ($u->room['file'] == 'an/bank') {
                                                                                                          id="greyText"
                                                                                                          class="menutop"
                                                                                                          onclick="location='main.php?loc=2.180.0.236&rnd=<? echo $code; ?>';"
-                                                                                                         title="<? thisInfRm('2.180.0.236', 1); ?>">Страшилкина
-                                                                        улица</a></td>
+                                                                                                         title="<? thisInfRm('2.180.0.236', 1); ?>">�����������
+                                                                        �����</a></td>
                                                             </tr>
                                                         </table>
                                                     </td>
@@ -474,7 +474,7 @@ if ($u->room['file'] == 'an/bank') {
     <TR>
         <form name="F1" method="post">
             <TD valign="top" align="left">
-                <!--Магазин--></TD>
+                <!--�������--></TD>
         </FORM>
     </TR>
     <TR>
@@ -484,12 +484,12 @@ if ($u->room['file'] == 'an/bank') {
     }
     if (!isset($u->bank['id'])) {
         ?>
-        Мы предоставляем следующие услуги:
+        �� ������������� ��������� ������:
         <OL>
-            <LI>Открытие счета
-            <LI>Возможность положить/снять кредиты/еврокредиты со счета
-            <LI>Перевести кредиты/еврокредиты с одного счета на другой
-            <LI>Обменный пункт. Обмен еврокредитов на кредиты
+            <LI>�������� �����
+            <LI>����������� ��������/����� �������/����������� �� �����
+            <LI>��������� �������/����������� � ������ ����� �� ������
+            <LI>�������� �����. ����� ������������ �� �������
         </OL>
         <script type="text/javascript" src="js/jquery.js"></script>
         <script>
@@ -502,22 +502,22 @@ if ($u->room['file'] == 'an/bank') {
             }
         </script>
         <FORM action="main.php?open&rnd=<? echo $code; ?>" method="POST">
-            Хотите открыть свой счет? Услуга платная: <INPUT onclick="hidecreatefx();" TYPE="button"
-                                                             value="Открыть счет">
+            ������ ������� ���� ����? ������ �������: <INPUT onclick="hidecreatefx();" TYPE="button"
+                                                             value="������� ����">
             <div id="hidecreate" style="display:none">
                 <FIELDSET style="width:300px;">
-                    <LEGEND><B>Открытие счета</B></LEGEND>
+                    <LEGEND><B>�������� �����</B></LEGEND>
                     <small>
                         <? if ($u->info['level'] < 8) { ?>
                             <center>
-                                <input name="rdn01" type="radio" value="1"> <b>3.00 кр.</b> &nbsp; &nbsp; <input
+                                <input name="rdn01" type="radio" value="1"> <b>3.00 ��.</b> &nbsp; &nbsp; <input
                                         name="rdn01" type="radio" value="2"> <?= $u->zuby(15) ?> &nbsp; &nbsp; &nbsp;
                             </center>
                             <hr/>
                         <? } else {
                             ?>
                             <center>
-                                <input checked="checked" name="rdn01" type="radio" value="1"> <b>3.00 кр.</b> &nbsp;
+                                <input checked="checked" name="rdn01" type="radio" value="1"> <b>3.00 ��.</b> &nbsp;
                                 &nbsp; &nbsp;
                             </center>
                             <hr/>
@@ -535,17 +535,17 @@ if ($u->room['file'] == 'an/bank') {
                         </style>
                         <table width="300" border="0" cellspacing="0" cellpadding="0">
                             <tr>
-                                <td>Пароль счета:</td>
+                                <td>������ �����:</td>
                                 <td><INPUT style='width:90;' type="password" value="" name="pass1"></td>
                             </tr>
                             <tr>
-                                <td>Еще раз:</td>
+                                <td>��� ���:</td>
                                 <td><INPUT style='width:90;' type="password" value="" name="pass2"></td>
                             </tr>
                         </table>
                     </small>
                     <center>
-                        <INPUT TYPE="submit" value="Открыть счет">
+                        <INPUT TYPE="submit" value="������� ����">
                     </center>
                 </FIELDSET>
             </div>
@@ -553,13 +553,13 @@ if ($u->room['file'] == 'an/bank') {
         <form action="main.php?enter&rnd=<? echo $code; ?>" method="POST">
             <br/>
             <FIELDSET style="width:300px;">
-                <LEGEND><B>Управление счетом</B></LEGEND>
+                <LEGEND><B>���������� ������</B></LEGEND>
                 <TABLE width="300">
                     <TR>
                         <TD valign=top>
                             <TABLE>
                                 <TR>
-                                    <TD>Номер счета</td>
+                                    <TD>����� �����</td>
                                     <TD colspan=2><select name="bank" size=0 style="width: 90px">
                                             <?
                                             $sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `block` = "0"');
@@ -573,11 +573,11 @@ if ($u->room['file'] == 'an/bank') {
                                         </select></td>
                                 </tr>
                                 <TR>
-                                    <TD>Пароль</td>
+                                    <TD>������</td>
                                     <td><INPUT style='width:90;' type="password" value="" name="pass"></td>
                                 </tr>
                                 <TR>
-                                    <TD colspan=3 align=center><INPUT TYPE="submit" value="Войти"></td>
+                                    <TD colspan=3 align=center><INPUT TYPE="submit" value="�����"></td>
                                 </tr>
                             </TABLE>
                         </TD>
@@ -588,8 +588,8 @@ if ($u->room['file'] == 'an/bank') {
             <input type=hidden name='res' value=<? echo $code; ?>>
             <br/>
             <br/>
-            Забыли пароль? Можно его выслать на email, номер счета:<input type=text name='schet'> <input type="submit"
-                                                                                                         value="Выслать"/></TD>
+            ������ ������? ����� ��� ������� �� email, ����� �����:<input type=text name='schet'> <input type="submit"
+                                                                                                         value="�������"/></TD>
         </form>
         </TR>
         </TABLE>
@@ -616,34 +616,34 @@ if ($u->room['file'] == 'an/bank') {
 
             .pay td:hover img {
                 filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80); /* IE 5.5+*/
-                -moz-opacity: 0.8; /* Mozilla 1.6 и ниже */
+                -moz-opacity: 0.8; /* Mozilla 1.6 � ���� */
                 -khtml-opacity: 0.8; /* Konqueror 3.1, Safari 1.1 */
                 opacity: 0.8; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9 */
                 cursor: pointer;
             }
         </style>
-        <!-- управление счетом -->
+        <!-- ���������� ������ -->
         <FORM action="main.php" method="POST">
             <INPUT TYPE=hidden name="sd4" value="<? echo $u->info['nextAct']; ?>">
             <TABLE width=100%>
                 <TR>
-                    <TD valign=top width=30%><H4>Управление счетом</H4> &nbsp;
-                        <b>Счёт №:</b> <? echo getNum($u->bank['id']); ?> <a href="?exit=<? echo $code; ?>"
-                                                                             title="Окончить работу c текущим счетом">[x]</a><br>
+                    <TD valign=top width=30%><H4>���������� ������</H4> &nbsp;
+                        <b>���� �:</b> <? echo getNum($u->bank['id']); ?> <a href="?exit=<? echo $code; ?>"
+                                                                             title="�������� ������ c ������� ������">[x]</a><br>
                     </TD>
                     <TD valign=top align=center width=40%>
                         <TABLE>
                             <TR>
                                 <TD>
                                     <FIELDSET>
-                                        <LEGEND><B>У вас на счете</B></LEGEND>
+                                        <LEGEND><B>� ��� �� �����</B></LEGEND>
                                         <TABLE>
                                             <TR>
-                                                <TD>Кредитов:</TD>
+                                                <TD>��������:</TD>
                                                 <TD><B><? echo $u->round2($u->bank['money1']); ?></B></TD>
                                             </TR>
                                             <TR>
-                                                <TD>Еврокредитов:</TD>
+                                                <TD>������������:</TD>
                                                 <TD><B><? echo $u->round2($u->bank['money2']); ?></B></TD>
                                             </TR>
                                             <TR>
@@ -652,8 +652,8 @@ if ($u->room['file'] == 'an/bank') {
                                                 </TD>
                                             </TR>
                                             <TR>
-                                                <TD>При себе наличных:</TD>
-                                                <TD><B><? echo $u->round2($u->info['money']); ?> кр.</B></TD>
+                                                <TD>��� ���� ��������:</TD>
+                                                <TD><B><? echo $u->round2($u->info['money']); ?> ��.</B></TD>
                                             </TR>
                                         </TABLE>
                                     </FIELDSET>
@@ -661,8 +661,8 @@ if ($u->room['file'] == 'an/bank') {
                             </TR>
                         </TABLE>
                     </TD>
-                    <TD valign=top align=right width=30%><FONT COLOR=red>Внимание!</FONT> Некоторые услуги банка
-                        платные, о размере взымаемой комиссии написано в соответствующем разделе.
+                    <TD valign=top align=right width=30%><FONT COLOR=red>��������!</FONT> ��������� ������ �����
+                        �������, � ������� ��������� �������� �������� � ��������������� �������.
                     </TD>
                 </TR>
             </TABLE>
@@ -685,7 +685,7 @@ if ($u->room['file'] == 'an/bank') {
                                     <fieldset style="background-color:#DDEAD7"
                                     ">
                                     <legend><img src="https://img.new-combats.com/i/align/align50.gif" width="12"
-                                                 height="15"/> <b style="color:#5F3710">Приобретение Екр. онлайн</b>
+                                                 height="15"/> <b style="color:#5F3710">������������ ���. ������</b>
                                     </legend>
                                     <style>
                                         #pay_btn {
@@ -700,8 +700,8 @@ if ($u->room['file'] == 'an/bank') {
                                             cursor: pointer;
                                         }
                                     </style>
-                                    Сумма екр.: <input id="pay_in" style="padding-left:2px;width:77px;" value="1.00">
-                                    <input id="pay_btn" name="pay_btn" value="Оплатить" type="button"
+                                    ����� ���.: <input id="pay_in" style="padding-left:2px;width:77px;" value="1.00">
+                                    <input id="pay_btn" name="pay_btn" value="��������" type="button"
                                            onclick="window.open('/pay.back.php?ekr='+$('#pay_in').val()+'&code=1&ref=0','_blank');"
                                            style="padding:5px;"/>
                                     </div>
@@ -712,12 +712,12 @@ if ($u->room['file'] == 'an/bank') {
                             <tr>
                                 <td valign="top" width="50%">
                                     <fieldset>
-                                        <legend><b>Пополнить счет</b></legend>
-                                        Сумма
+                                        <legend><b>��������� ����</b></legend>
+                                        �����
                                         <input type="text" name="add_sum" id="add_sum" size="6" maxlength="10"/>
-                                        кр.
-                                        <input type="submit" name="add_kredit" value="Положить кредиты на счет"
-                                               onclick="if(Math.round(document.getElementById('add_sum')).value==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите положить на свой счет '+(Math.floor(document.getElementById('add_sum').value*100)/100).toFixed(2)+' кр. ?')}"/>
+                                        ��.
+                                        <input type="submit" name="add_kredit" value="�������� ������� �� ����"
+                                               onclick="if(Math.round(document.getElementById('add_sum')).value==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ �������� �� ���� ���� '+(Math.floor(document.getElementById('add_sum').value*100)/100).toFixed(2)+' ��. ?')}"/>
                                         <br/>
                                     </fieldset>
                                 </td>
@@ -725,34 +725,34 @@ if ($u->room['file'] == 'an/bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Перевести кредиты на другой счет</b></legend>
-                                        Сумма
+                                        <legend><b>��������� ������� �� ������ ����</b></legend>
+                                        �����
                                         <input id="vl1" value="" type="text" name="tansfer_sum" size="6"
                                                maxlength="10"/>
-                                        кр.<br/>
-                                        Номер счета куда перевести кредиты
+                                        ��.<br/>
+                                        ����� ����� ���� ��������� �������
                                         <input value="" type="text" id="vl2" name="num" size="12" maxlength="15"/>
                                         <br/>
                                         <input type="submit" name="transfer_kredit"
-                                               value="Перевести кредиты на другой счет"
-                                               onclick="if(Math.round(document.getElementById('vl1')).value==0 || Math.round(document.getElementById('vl2').value)==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите перевести со своего счета '+(Math.floor(document.getElementById('vl1').value*100)/100).toFixed(2)+' кр. на счет номер '+Math.floor(document.getElementById('vl2').value)+' ?')}"/>
+                                               value="��������� ������� �� ������ ����"
+                                               onclick="if(Math.round(document.getElementById('vl1')).value==0 || Math.round(document.getElementById('vl2').value)==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ ��������� �� ������ ����� '+(Math.floor(document.getElementById('vl1').value*100)/100).toFixed(2)+' ��. �� ���� ����� '+Math.floor(document.getElementById('vl2').value)+' ?')}"/>
                                         <br/>
-                                        <small>Комиссия составляет <b>3.00 %</b> от суммы, но не менее <b>1.00
-                                                кр</b>.</small>
+                                        <small>�������� ���������� <b>3.00 %</b> �� �����, �� �� ����� <b>1.00
+                                                ��</b>.</small>
                                     </fieldset>
                                 </td>
                             </tr>
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Обменный пункт</b></legend>
-                                        Обменять еврокредиты на кредиты.<br/>
-                                        Курс <b>1 екр.</b> = <b><? echo $con; ?>.00 кр.</b><br/>
-                                        Сумма
+                                        <legend><b>�������� �����</b></legend>
+                                        �������� ����������� �� �������.<br/>
+                                        ���� <b>1 ���.</b> = <b><? echo $con; ?>.00 ��.</b><br/>
+                                        �����
                                         <input type="text" name="convert_sum" id="convert_sum" size="6" maxlength="10"/>
-                                        екр.
+                                        ���.
                                         <input type="submit" name="convert_ekredit"
-                                               value="Обменять" <? /*onclick="return confirm('Вы хотите обменять '+(Math.floor(document.getElementById('convert_sum').value*100)/100).toFixed(2)+' екр. на '+(Math.floor(document.getElementById('convert_sum').value*100)/100*<? echo (0+$con); ?>).toFixed(2)+' кр. ?');" */ ?> />
+                                               value="��������" <? /*onclick="return confirm('�� ������ �������� '+(Math.floor(document.getElementById('convert_sum').value*100)/100).toFixed(2)+' ���. �� '+(Math.floor(document.getElementById('convert_sum').value*100)/100*<? echo (0+$con); ?>).toFixed(2)+' ��. ?');" */ ?> />
                                     </fieldset>
                                 </td>
                             </tr>
@@ -760,17 +760,17 @@ if ($u->room['file'] == 'an/bank') {
                                 <tr>
                                     <td valign="top">
                                         <fieldset style="background-color:#DDEAD7">
-                                            <legend><b>Обменный пункт</b></legend>
-                                            Обменять кредиты на еврокредиты.<br/>
-                                            Курс <b><? echo $noc; ?> кр.</b> = <b>1.00 екр.</b><br/>
-                                            Сумма
+                                            <legend><b>�������� �����</b></legend>
+                                            �������� ������� �� �����������.<br/>
+                                            ���� <b><? echo $noc; ?> ��.</b> = <b>1.00 ���.</b><br/>
+                                            �����
                                             <input type="text" name="convert_sum2" id="convert_sum2" size="6"
                                                    maxlength="10"/>
-                                            кр.
+                                            ��.
                                             <br/>
-                                            <small>Комиссия составляет <b>3.00 %</b> от суммы, а так-же <b>5.00 кр</b>.</small>
-                                            <input type="submit" name="convert_kredit" value="Обменять"
-                                                   onclick="return confirm('Вы хотите обменять '+(5+Math.floor((document.getElementById('convert_sum2').value)*103)/100).toFixed(2)+' кр. на '+(Math.floor(document.getElementById('convert_sum2').value*100)/100/<? echo $noc; ?>).toFixed(2)+' екр. ?');"/>
+                                            <small>�������� ���������� <b>3.00 %</b> �� �����, � ���-�� <b>5.00 ��</b>.</small>
+                                            <input type="submit" name="convert_kredit" value="��������"
+                                                   onclick="return confirm('�� ������ �������� '+(5+Math.floor((document.getElementById('convert_sum2').value)*103)/100).toFixed(2)+' ��. �� '+(Math.floor(document.getElementById('convert_sum2').value*100)/100/<? echo $noc; ?>).toFixed(2)+' ���. ?');"/>
                                         </fieldset>
                                     </td>
                                 </tr>
@@ -780,19 +780,19 @@ if ($u->room['file'] == 'an/bank') {
                                 <tr>
                                     <td valign="top">
                                         <fieldset>
-                                            <legend><b>Перевести еврокредиты на другой счет</b></legend>
-                                            Сумма
+                                            <legend><b>��������� ����������� �� ������ ����</b></legend>
+                                            �����
                                             <input id="vl12" value="" type="text" name="tansfer_sum2" size="6"
                                                    maxlength="10"/>
-                                            екр.<br/>
-                                            Номер счета куда перевести кредиты
+                                            ���.<br/>
+                                            ����� ����� ���� ��������� �������
                                             <input value="" type="text" id="vl22" name="num2" size="12" maxlength="15"/>
                                             <br/>
                                             <input type="submit" name="transfer_kredit2"
-                                                   value="Перевести еврокредиты на другой счет"
-                                                   onclick="if(Math.round(document.getElementById('vl12')).value==0 || Math.round(document.getElementById('vl22').value)==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите перевести со своего счета '+(Math.floor(document.getElementById('vl12').value*100)/100).toFixed(2)+' екр. на счет номер '+Math.floor(document.getElementById('vl22').value)+' ?')}"/>
+                                                   value="��������� ����������� �� ������ ����"
+                                                   onclick="if(Math.round(document.getElementById('vl12')).value==0 || Math.round(document.getElementById('vl22').value)==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ ��������� �� ������ ����� '+(Math.floor(document.getElementById('vl12').value*100)/100).toFixed(2)+' ���. �� ���� ����� '+Math.floor(document.getElementById('vl22').value)+' ?')}"/>
                                             <br/>
-                                            Комиссия составляет <b>0.00 %</b> от суммы, но не менее <b>0.01 екр</b>.
+                                            �������� ���������� <b>0.00 %</b> �� �����, �� �� ����� <b>0.01 ���</b>.
                                         </fieldset>
                                     </td>
                                 </tr>
@@ -800,27 +800,27 @@ if ($u->room['file'] == 'an/bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Настройки</b></legend>
-                                        У вас разрешена высылка номера счета и пароля на email. Если вы не уверены в
-                                        своем email, или убеждены, что не забудете свой номер счета и пароль к нему, то
-                                        можете запретить высылку пароля на email. Это убережет вас от кражи кредитов с
-                                        вашего счета в случае взлома вашего email. Но если вы сами забудете свой номер
-                                        счета и/или пароль, вам уже никто не поможет!<br/>
+                                        <legend><b>���������</b></legend>
+                                        � ��� ��������� ������� ������ ����� � ������ �� email. ���� �� �� ������� �
+                                        ����� email, ��� ��������, ��� �� �������� ���� ����� ����� � ������ � ����, ��
+                                        ������ ��������� ������� ������ �� email. ��� �������� ��� �� ����� �������� �
+                                        ������ ����� � ������ ������ ������ email. �� ���� �� ���� �������� ���� �����
+                                        ����� �/��� ������, ��� ��� ����� �� �������!<br/>
                                         <input type="submit" name="stop_send_email2"
-                                               value="Запретить высылку пароля на email"/>
+                                               value="��������� ������� ������ �� email"/>
                                         <hr/>
-                                        <b>Сменить пароль</b><br/>
+                                        <b>������� ������</b><br/>
                                         <table>
                                             <tr>
-                                                <td>Новый пароль</td>
+                                                <td>����� ������</td>
                                                 <td><input type="password" name="new_psw1"/></td>
                                             </tr>
                                             <tr>
-                                                <td>Введите новый пароль повторно</td>
+                                                <td>������� ����� ������ ��������</td>
                                                 <td><input type="password" name="new_psw2"/></td>
                                             </tr>
                                         </table>
-                                        <input type="submit" name="change_psw2" value="Сменить пароль"/>
+                                        <input type="submit" name="change_psw2" value="������� ������"/>
                                         <br/>
                                         <div id="keypad4" align="center" style="display: none;"></div>
                                     </fieldset>
@@ -836,12 +836,12 @@ if ($u->room['file'] == 'an/bank') {
                             <tr>
                                 <td valign="top" width="50%">
                                     <fieldset>
-                                        <legend><b>Снять со счета</b></legend>
-                                        Сумма
+                                        <legend><b>����� �� �����</b></legend>
+                                        �����
                                         <input type="text" name="get_sum" id="get_sum" size="6" maxlength="10"/>
-                                        кр.
-                                        <input type="submit" name="get_kredit" value="Снять кредиты со счета"
-                                               onclick="if(Math.round(document.getElementById('get_sum')).value==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите снять со своего счета '+(Math.floor(document.getElementById('get_sum').value*100)/100).toFixed(2)+' кр. ?')}"/>
+                                        ��.
+                                        <input type="submit" name="get_kredit" value="����� ������� �� �����"
+                                               onclick="if(Math.round(document.getElementById('get_sum')).value==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ ����� �� ������ ����� '+(Math.floor(document.getElementById('get_sum').value*100)/100).toFixed(2)+' ��. ?')}"/>
                                         <br/>
                                     </fieldset>
                                 </td>
@@ -852,33 +852,33 @@ if ($u->room['file'] == 'an/bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Курс еврокредита к мировой валюте</b></legend>
+                                        <legend><b>���� ����������� � ������� ������</b></legend>
                                         <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                             <?
                                             $pl = mysql_fetch_array(mysql_query('SELECT * FROM `bank_table` ORDER BY `time` DESC LIMIT 1'));
                                             if (isset($pl['id'])) {
                                                 ?>
                                                 <tr>
-                                                    <td><small>Данные на <b><?= date('d.m.y H:i', $pl['time']) ?></b>
-                                                            без учета комиссий</small></td>
+                                                    <td><small>������ �� <b><?= date('d.m.y H:i', $pl['time']) ?></b>
+                                                            ��� ����� ��������</small></td>
                                                 </tr>
                                                 <?
                                                 $pl['RUB'] = 1;
 
                                                 $i = 0;
                                                 $true = [
-                                                    ['USD', 'долларов США'],
-                                                    ['EUR', 'ЕВРО'],
-                                                    ['RUB', 'российских рублей'],
-                                                    ['UAH', 'укр. гривен'],
-                                                    ['BYR', 'белорусских рублей'],
-                                                    ['AZN', 'азербайджанских манат'],
-                                                    ['GBP', 'англ. фунтов стерлингов']
+                                                    ['USD', '�������� ���'],
+                                                    ['EUR', '����'],
+                                                    ['RUB', '���������� ������'],
+                                                    ['UAH', '���. ������'],
+                                                    ['BYR', '����������� ������'],
+                                                    ['AZN', '��������������� �����'],
+                                                    ['GBP', '����. ������ ����������']
                                                 ];
                                                 while ($i < count($true)) {
                                                     ?>
                                                     <tr>
-                                                        <td><span>1 екр. = </span><span
+                                                        <td><span>1 ���. = </span><span
                                                                     style="display:inline-block;width:100px"><b><?= round(($pl['cur'] / $pl[$true[$i][0]]), 4) ?></b></span><span><?= $true[$i][1] ?></span>
                                                         </td>
                                                     </tr>
@@ -889,8 +889,8 @@ if ($u->room['file'] == 'an/bank') {
                                                 ?>
                                                 <tr>
                                                     <td><small>
-                                                            <center><font color=grey>Не удалось получить
-                                                                    информацию</font></center>
+                                                            <center><font color=grey>�� ������� ��������
+                                                                    ����������</font></center>
                                                         </small></td>
                                                 </tr>
                                             <? } ?>
@@ -901,7 +901,7 @@ if ($u->room['file'] == 'an/bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Последние операции</b></legend>
+                                        <legend><b>��������� ��������</b></legend>
                                         <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                             <?
                                             $sp = mysql_query('SELECT * FROM `users_delo` WHERE `uid` = "' . $u->info['id'] . '" AND `dop` = "' . $u->bank['id'] . '" AND `type` = "3" ORDER BY `time` DESC LIMIT 21');
@@ -925,7 +925,7 @@ if ($u->room['file'] == 'an/bank') {
                 </tr>
             </table>
         </FORM>
-        <small>Сумма указанная в окне оповещения и суммы взымаемая\начисляемая могут различаться.</small>
+        <small>����� ��������� � ���� ���������� � ����� ���������\����������� ����� �����������.</small>
         <?
     }
 }
diff --git a/modules_data/location/bank.php b/modules_data/location/bank.php
index d7923e63..3bb4aeb0 100644
--- a/modules_data/location/bank.php
+++ b/modules_data/location/bank.php
@@ -6,7 +6,7 @@ require_once '_incl_data/mails.php';
 
 if ($u->room['file'] == 'bank') {
     $noc = $c['crtoecr'] * 2; //120 kr = 1 ekr.
-    $con = $c['ecrtocr'] * 2.5; //1 екр. = 30 кр.
+    $con = $c['ecrtocr'] * 2.5; //1 ���. = 30 ��.
     function getNum($v)
     {
         $plid = $v;
@@ -46,26 +46,26 @@ if ($u->room['file'] == 'bank') {
     if (isset($_GET['enter']) && !isset($u->bank['id'])) {
         $bank = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string((int)$_POST['bank']) . '" LIMIT 1'));
         if (!isset($bank['id'])) {
-            $re2 = 'Неверный номер счета.';
+            $re2 = '�������� ����� �����.';
         } elseif ($bank['pass'] != $_POST['pass']) {
             $pl = mysql_fetch_array(mysql_query('SELECT COUNT(*) FROM `actions` WHERE `uid` = "' . $u->info['id'] . '" AND `time` > "' . (time() - 60 * 60) . '" AND `vars` = "bank_bad_pass_' . mysql_real_escape_string($bank['id']) . '" LIMIT 5'));
             if ($pl[0] >= 3) {
-                $re2 = 'Ваш счет был заблокирован на 1 час';
+                $re2 = '��� ���� ��� ������������ �� 1 ���';
             } else {
                 if ($pl[0] == 0) {
-                    $re2 = 'Неверный номер счета или пароль. Если вы трижды введете неверный номер счета или пароль, счет будет заблокирован на час';
+                    $re2 = '�������� ����� ����� ��� ������. ���� �� ������ ������� �������� ����� ����� ��� ������, ���� ����� ������������ �� ���';
                 } else {
-                    $pp = [0 => 'ок', 1 => 'ка', 2 => 'ки', 3 => 'ки'];
-                    $re2 = 'Неверный номер счета или пароль. У вас осталось ' . (3 - $pl[0]) . ' попыт' . $pp[3 - $pl[0]] . ', в противном случаи счет будет заблокирован на час';
+                    $pp = [0 => '��', 1 => '��', 2 => '��', 3 => '��'];
+                    $re2 = '�������� ����� ����� ��� ������. � ��� �������� ' . (3 - $pl[0]) . ' �����' . $pp[3 - $pl[0]] . ', � ��������� ������ ���� ����� ������������ �� ���';
                 }
                 mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_bad_pass_' . mysql_real_escape_string($bank['id']) . '","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")');
             }
         } else {
 
             if ($u->info['allLock'] > time()) {
-                echo '<script>setTimeout(function(){alert("Вам запрещено пользоваться услугами банка до ' . date('d.m.y H:i', $u->info['allLock']) . '")},250);</script>';
+                echo '<script>setTimeout(function(){alert("��� ��������� ������������ �������� ����� �� ' . date('d.m.y H:i', $u->info['allLock']) . '")},250);</script>';
             } else {
-                //вошли!
+                //�����!
                 $bank['useNow'] = time() + 12 * 60 * 60;
                 mysql_query('UPDATE `bank` SET `useNow` = "0" WHERE `id` != "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" AND `useNow`!="0" LIMIT 1');
                 mysql_query('UPDATE `bank` SET `useNow` = "' . $bank['useNow'] . '" WHERE `id` = "' . $bank['id'] . '" AND `uid` = "' . $u->info['id'] . '" LIMIT 1');
@@ -76,27 +76,27 @@ if ($u->room['file'] == 'bank') {
     } elseif (isset($_GET['res'])) {
         $b_pass = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `id` = "' . mysql_real_escape_string(getNumId($_GET['schet'])) . '" ORDER BY `id` DESC LIMIT 1'));
         if ($b_pass['repass'] >= time()) {
-            $re2 = 'Номера счетов и пароли к ним можно выслать только один раз в сутки';
+            $re2 = '������ ������ � ������ � ��� ����� ������� ������ ���� ��� � �����';
         } else {
             mysql_query('INSERT INTO `actions` (`uid`,`time`,`city`,`room`,`vars`,`ip`) VALUES ("' . $u->info['id'] . '","' . time() . '","' . $u->info['city'] . '","' . $u->info['room'] . '","bank_res","' . mysql_real_escape_string($_SERVER['HTTP_X_REAL_IP']) . '")');
-            $re2 = 'Выслан номер счета и пароль на email, указанный в анкете';
+            $re2 = '������ ����� ����� � ������ �� email, ��������� � ������';
             mysql_query('UPDATE `bank` SET `repass` = "' . (time() + 24 * 3600) . '" WHERE `id` = "' . $b_pass['id'] . '" LIMIT 1');
-            $subject = 'Восстановление пароля от счета в банке персонажа ' . $u->info['login'];
-            $message = 'Номер счета: ' . getNum($b_pass['id']) . '<br>Пароль: ' . $b_pass['pass'] .
-                '<br><br>С уважением,<br>Администрация Бойцовского Клуба';
+            $subject = '�������������� ������ �� ����� � ����� ��������� ' . $u->info['login'];
+            $message = '����� �����: ' . getNum($b_pass['id']) . '<br>������: ' . $b_pass['pass'] .
+                '<br><br>� ���������,<br>������������� ����������� �����';
             mails($u->info['mail'], $message, $subject);
             unset($subject, $message);
         }
     } elseif (isset($_GET['open']) && !isset($u->bank['id'])) {
         if ($_POST['rdn01'] == 2 && ($u->info['level'] >= 8 || $u->info['money4'] < 15)) {
-            $re2 = 'Недостаточно зубов!';
+            $re2 = '������������ �����!';
         } elseif ($u->info['money'] >= 3 || ($u->info['level'] < 8 && $u->info['money4'] >= 15 && $c['zuby'] == true)) {
             if ($_POST['pass1'] == '' || $_POST['pass1'] == ' ') {
-                $re2 = 'Вы не указали пароль!';
+                $re2 = '�� �� ������� ������!';
             } elseif ($_POST['pass1'] != $_POST['pass2']) {
-                $re2 = 'Пароли не совпадают!';
+                $re2 = '������ �� ���������!';
             } elseif ($u->info['money'] - 3 < 0 && $_POST['rdn01'] != 2) {
-                $re2 = 'У вас недостаточно кр.';
+                $re2 = '� ��� ������������ ��.';
             } elseif ($u->info['align'] != 2) {
                 $pass = rand(10000, 91191);
                 $pass = htmlspecialchars($_POST['pass1'], null, 'cp1251');
@@ -109,19 +109,19 @@ if ($u->room['file'] == 'bank') {
                         $u->info['money'] -= 3;
                     }
                     $upd = mysql_query('UPDATE `users` SET `money` = "' . $u->info['money'] . '",`money4` = "' . $u->info['money4'] . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
-                    $re2 = 'Счет №<b>' . getNum($bank) . '</b> был успешно открыт.<br>Пароль от счета: <b>' . $pass . '</b><br><small><br>(Сменить пароль можно в разделе "Управление счетом" после авторизации)';
-                    $u->addDelo(3, $u->info['id'], 'Вы успешно открыли счет №' . getNum($bank) . '', time(), $u->info['city'], 'Bank.System', 3, 0, '');
+                    $re2 = '���� �<b>' . getNum($bank) . '</b> ��� ������� ������.<br>������ �� �����: <b>' . $pass . '</b><br><small><br>(������� ������ ����� � ������� "���������� ������" ����� �����������)';
+                    $u->addDelo(3, $u->info['id'], '�� ������� ������� ���� �' . getNum($bank) . '', time(), $u->info['city'], 'Bank.System', 3, 0, '');
                 } else {
-                    $re2 = 'Банк отказал в получении банковского счета.';
+                    $re2 = '���� ������� � ��������� ����������� �����.';
                 }
             } else {
-                $re2 = 'Хаосники не могут создавать новые счета в банке.';
+                $re2 = '�������� �� ����� ��������� ����� ����� � �����.';
             }
         } else {
             if ($u->info['level'] < 8 && $c['zuby'] == true) {
-                $re2 = 'Для открытия счета необходимо иметь при себе <b>3.00 кр.</b> или <b>' . $u->zuby(15) . '</b>';
+                $re2 = '��� �������� ����� ���������� ����� ��� ���� <b>3.00 ��.</b> ��� <b>' . $u->zuby(15) . '</b>';
             } else {
-                $re2 = 'Для открытия счета необходимо иметь при себе <b>3.00 кр.</b>';
+                $re2 = '��� �������� ����� ���������� ����� ��� ���� <b>3.00 ��.</b>';
             }
         }
     } elseif (isset($_GET['exit']) && isset($u->bank['id'])) {
@@ -136,7 +136,7 @@ if ($u->room['file'] == 'bank') {
     if (isset($u->bank['id'])) {
         if (isset($_POST['sd4']) && $u->newAct($_POST['sd4'])) {
             if (isset($_POST['transfer_kredit2']) && $u->info['admin'] > 0) {
-                //перевод екредитов с одного счета на другой
+                //������� ��������� � ������ ����� �� ������
                 $ub = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string((int)$_POST['num2']) . '" LIMIT 1'));
                 if (isset($ub['id']) && $ub['id'] != $u->bank['id']) {
                     $ut = mysql_fetch_array(mysql_query('SELECT `id`,`level`,`city`,`room`,`login` FROM `users` WHERE `id` = "' . mysql_real_escape_string($ub['uid']) . '" LIMIT 1'));
@@ -147,7 +147,7 @@ if ($u->room['file'] == 'bank') {
                         $mn += $prc;
                         if ($u->bank['money2'] >= $mn) {
                             if ($mn < 0.01 || $mn > 1000000000) {
-                                $re2 = 'Неверно указана сумма';
+                                $re2 = '������� ������� �����';
                             } else {
                                 $upd = mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($u->bank['money2'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                                 if ($upd) {
@@ -158,10 +158,10 @@ if ($u->room['file'] == 'bank') {
                                     mysql_query('UPDATE `users` SET `frg` = `frg` + ' . floor($mn) . ' WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
 
                                     mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($ub['money2']) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
-                                    $re2 = 'Вы удачно перевели <b>' . ($mn - $prc) . ' екр.</b> (комиссия <b>' . $prc . ' екр.</b>) на счет №' . getNum($ub['id']) . ' персонажу &quot;<b>' . $ut['login'] . '</b>&quot;';
-                                    $u->addDelo(3, $ut['id'], 'Получено <b>' . ($mn - $prc) . ' екр.</b> со счета №' . getNum($u->bank['id']) . ' от персонажа &quot;' . $u->info['login'] . '&quot;, комиссия <b>' . $prc . ' екр.</b> <i>(Итого: ' . $ub['money1'] . ' кр., ' . $ub['money2'] . ' екр.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
-                                    $u->addDelo(3, $u->info['id'], 'Передано <b>' . ($mn - $prc) . ' екр.</b> на счет №' . getNum($ub['id']) . ' персонажу &quot;' . $ut['login'] . '&quot;, комиссия <b>' . $prc . ' екр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
-                                    $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] перевел со своего банковского счета №' . $u->bank['id'] . ' на счет №' . $ub['id'] . ' к персонажу &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' екр.';
+                                    $re2 = '�� ������ �������� <b>' . ($mn - $prc) . ' ���.</b> (�������� <b>' . $prc . ' ���.</b>) �� ���� �' . getNum($ub['id']) . ' ��������� &quot;<b>' . $ut['login'] . '</b>&quot;';
+                                    $u->addDelo(3, $ut['id'], '�������� <b>' . ($mn - $prc) . ' ���.</b> �� ����� �' . getNum($u->bank['id']) . ' �� ��������� &quot;' . $u->info['login'] . '&quot;, �������� <b>' . $prc . ' ���.</b> <i>(�����: ' . $ub['money1'] . ' ��., ' . $ub['money2'] . ' ���.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
+                                    $u->addDelo(3, $u->info['id'], '�������� <b>' . ($mn - $prc) . ' ���.</b> �� ���� �' . getNum($ub['id']) . ' ��������� &quot;' . $ut['login'] . '&quot;, �������� <b>' . $prc . ' ���.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
+                                    $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] ������� �� ������ ����������� ����� �' . $u->bank['id'] . ' �� ���� �' . $ub['id'] . ' � ��������� &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' ���.';
                                     $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
                                     $u->addDelo(1, $ut['id'], $log, time(), $ut['city'], 'Bank.System', 0, 0, '');
                                     if ($ut['id'] != $u->info['id']) {
@@ -169,25 +169,25 @@ if ($u->room['file'] == 'bank') {
                                         if ($u->info['align'] == 50) {
                                             $alg = '<img src=https://img.new-combats.com/i/align/align50.gif >';
                                         }
-                                        $text = '&quot;' . $alg . '[login:' . $u->info['login'] . ']&quot; перевел' . ($u->info['sex'] == 0 ? "" : "а") . ' вам <b>' . ($mn - $prc) . ' екр.</b> со своего банковского счета №' . getNum($u->bank['id']) . ' на ваш банковский счет №' . getNum($ub['id']) . '.';
+                                        $text = '&quot;' . $alg . '[login:' . $u->info['login'] . ']&quot; �������' . ($u->info['sex'] == 0 ? "" : "�") . ' ��� <b>' . ($mn - $prc) . ' ���.</b> �� ������ ����������� ����� �' . getNum($u->bank['id']) . ' �� ��� ���������� ���� �' . getNum($ub['id']) . '.';
 
                                         mysql_query("INSERT INTO `chat` (`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES ('" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time() . "','12','0','1')");
                                     }
                                 } else {
-                                    $re2 = 'Не удалось выполнить операцию';
+                                    $re2 = '�� ������� ��������� ��������';
                                 }
                             }
                         } else {
-                            $re2 = 'У вас нет <b>' . $mn . ' екр.</b> на счете';
+                            $re2 = '� ��� ��� <b>' . $mn . ' ���.</b> �� �����';
                         }
                     } else {
-                        $re2 = 'Нельзя перевести кредиты на этот счет';
+                        $re2 = '������ ��������� ������� �� ���� ����';
                     }
                 } else {
-                    $re2 = 'Нельзя перевести кредиты на этот счет';
+                    $re2 = '������ ��������� ������� �� ���� ����';
                 }
             } elseif (isset($_POST['transfer_kredit']) && $u->info['align'] != 2) {
-                //перевод кредитов с одного счета на другой
+                //������� �������� � ������ ����� �� ������
                 if ($u->info['level'] >= 4 || $u->info['admin'] > 0) {
                     $ub = mysql_fetch_array(mysql_query('SELECT * FROM `bank` WHERE `id` = "' . mysql_real_escape_string((int)$_POST['num']) . '" LIMIT 1'));
                     if (isset($ub['id']) && $ub['id'] != $u->bank['id']) {
@@ -199,41 +199,41 @@ if ($u->room['file'] == 'bank') {
                             $mn += $prc;
                             if ($u->bank['money1'] >= $mn) {
                                 if ($mn < 0.01 || $mn > 1000000000) {
-                                    $re2 = 'Неверно указана сумма';
+                                    $re2 = '������� ������� �����';
                                 } else {
                                     $upd = mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                                     if ($upd) {
                                         $u->bank['money1'] -= $mn;
                                         $ub['money1'] += $mn - $prc;
                                         mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($ub['money1']) . '" WHERE `id` = "' . $ub['id'] . '" LIMIT 1');
-                                        $re2 = 'Вы удачно перевели <b>' . ($mn - $prc) . ' кр.</b> (комиссия <b>' . $prc . ' кр.</b>) на счет №' . getNum($ub['id']) . ' персонажу &quot;<b>' . $ut['login'] . '</b>&quot;';
-                                        $u->addDelo(3, $ut['id'], 'Получено <b>' . ($mn - $prc) . ' кр.</b> со счета №' . getNum($u->bank['id']) . ' от персонажа &quot;' . $u->info['login'] . '&quot;, комиссия <b>' . $prc . ' кр.</b> <i>(Итого: ' . $ub['money1'] . ' кр., ' . $ub['money2'] . ' екр.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
-                                        $u->addDelo(3, $u->info['id'], 'Передано <b>' . ($mn - $prc) . ' кр.</b> на счет №' . getNum($ub['id']) . ' персонажу &quot;' . $ut['login'] . '&quot;, комиссия <b>' . $prc . ' кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
-                                        $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] перевел со своего банковского счета №' . $u->bank['id'] . ' на счет №' . $ub['id'] . ' к персонажу &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' кр. Дополнительно снято ' . $prc . ' кр. за услуги банка.';
+                                        $re2 = '�� ������ �������� <b>' . ($mn - $prc) . ' ��.</b> (�������� <b>' . $prc . ' ��.</b>) �� ���� �' . getNum($ub['id']) . ' ��������� &quot;<b>' . $ut['login'] . '</b>&quot;';
+                                        $u->addDelo(3, $ut['id'], '�������� <b>' . ($mn - $prc) . ' ��.</b> �� ����� �' . getNum($u->bank['id']) . ' �� ��������� &quot;' . $u->info['login'] . '&quot;, �������� <b>' . $prc . ' ��.</b> <i>(�����: ' . $ub['money1'] . ' ��., ' . $ub['money2'] . ' ���.)</i>', time(), $ut['city'], 'Bank.System', mysql_real_escape_string($mn - $prc), 0, $ub['id']);
+                                        $u->addDelo(3, $u->info['id'], '�������� <b>' . ($mn - $prc) . ' ��.</b> �� ���� �' . getNum($ub['id']) . ' ��������� &quot;' . $ut['login'] . '&quot;, �������� <b>' . $prc . ' ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn), $u->bank['id']);
+                                        $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] ������� �� ������ ����������� ����� �' . $u->bank['id'] . ' �� ���� �' . $ub['id'] . ' � ��������� &quot;' . $ut['login'] . '&quot;&nbsp;[' . $ut['level'] . '] ' . ($mn - $prc) . ' ��. ������������� ����� ' . $prc . ' ��. �� ������ �����.';
                                         $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
                                         $u->addDelo(1, $ut['id'], $log, time(), $ut['city'], 'Bank.System', 0, 0, '');
                                         if ($ut['id'] != $u->info['id']) {
-                                            $text = '&quot;[login:' . $u->info['login'] . ']&quot; перевел' . ($u->info['sex'] == 0 ? "" : "а") . ' вам <b>' . ($mn - $prc) . ' кр.</b> со своего банковского счета №' . getNum($u->bank['id']) . ' на ваш банковский счет №' . getNum($ub['id']) . '.';
+                                            $text = '&quot;[login:' . $u->info['login'] . ']&quot; �������' . ($u->info['sex'] == 0 ? "" : "�") . ' ��� <b>' . ($mn - $prc) . ' ��.</b> �� ������ ����������� ����� �' . getNum($u->bank['id']) . ' �� ��� ���������� ���� �' . getNum($ub['id']) . '.';
                                             mysql_query("INSERT INTO `chat` (`new`,`city`,`room`,`login`,`to`,`text`,`time`,`type`,`toChat`,`typeTime`) VALUES (1,'" . $ut['city'] . "','" . $ut['room'] . "','','" . $ut['login'] . "','" . $text . "','" . time() . "','6','0','1')");
                                         }
                                     } else {
-                                        $re2 = 'Не удалось выполнить операцию';
+                                        $re2 = '�� ������� ��������� ��������';
                                     }
                                 }
                             } else {
-                                $re2 = 'У вас нет <b>' . $mn . ' кр.</b> на счете';
+                                $re2 = '� ��� ��� <b>' . $mn . ' ��.</b> �� �����';
                             }
                         } else {
-                            $re2 = 'Нельзя перевести кредиты на этот счет';
+                            $re2 = '������ ��������� ������� �� ���� ����';
                         }
                     } else {
-                        $re2 = 'Нельзя перевести кредиты на этот счет';
+                        $re2 = '������ ��������� ������� �� ���� ����';
                     }
                 } else {
-                    $re2 = 'Передача кредитов возможна только с 4-го уровня';
+                    $re2 = '�������� �������� �������� ������ � 4-�� ������';
                 }
             } elseif ($u->info['align'] != 2 && $u->info['haos'] < time() && $u->info['haos'] != 1 && $u->info['align'] != 50 && isset($_POST['convert_kredit']) && $c['crtoecr'] > 0) {
-                //обменять кр. на екр.
+                //�������� ��. �� ���.
                 if ($u->info['palpro'] > time()) {
                     $mn = ceil((int)($_POST['convert_sum2'] * 100));
                     $mn = round(($mn / 100), 2);
@@ -243,9 +243,9 @@ if ($u->room['file'] == 'bank') {
                     $sm_lim = 100;
                     if (isset($sm['id']) && $sm['vals'] + $mne > $sm_lim) {
                         if ($sm['vals'] < $sm_lim) {
-                            $re2 = 'На сегодня Вы можете обменять еще на <b>' . ($sm_lim - $sm['vals']) . ' екр.</b>. (Примерно ' . round((($sm_lim - $sm['vals']) * $noc), 2) . ' кр.), текущий обмен на <b>' . $mne . ' екр.</b>.';
+                            $re2 = '�� ������� �� ������ �������� ��� �� <b>' . ($sm_lim - $sm['vals']) . ' ���.</b>. (�������� ' . round((($sm_lim - $sm['vals']) * $noc), 2) . ' ��.), ������� ����� �� <b>' . $mne . ' ���.</b>.';
                         } else {
-                            $re2 = 'На сегодня Вы исчерпали свой лимит обмена кр. на екр. (' . $sm_lim . ' екр.)';
+                            $re2 = '�� ������� �� ��������� ���� ����� ������ ��. �� ���. (' . $sm_lim . ' ���.)';
                         }
                     } elseif ($mn > 0 && $mne > 0 && $mn >= round((0.01 * ($noc * 1.03) + 5), 2)) {
                         if ($u->bank['money1'] >= $mn) {
@@ -254,153 +254,153 @@ if ($u->room['file'] == 'bank') {
                             } else {
                                 mysql_query('UPDATE `actions` SET `vals` = "' . ($sm['vals'] + $mne) . '" WHERE `id` = "' . $sm['id'] . '" LIMIT 1');
                             }
-                            $re2 = 'Вы успешно обменяли <b>' . $mn . ' кр.</b> на <b>' . $mne . ' екр.</b>';
+                            $re2 = '�� ������� �������� <b>' . $mn . ' ��.</b> �� <b>' . $mne . ' ���.</b>';
                             $u->bank['money1'] -= $mn;
                             $u->bank['money2'] += $mne;
 
                             mysql_query('UPDATE `users` SET `catch` = `catch` + "' . round($mne, 2) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
 
                             mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '", `money2` = "' . mysql_real_escape_string($u->bank['money2']) . '",`shara` = `shara` + "' . mysql_real_escape_string($mne) . '" WHERE `id` = "' . mysql_real_escape_string($u->bank['id']) . '" LIMIT 1');
-                            $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] обменял <b>' . $mn . ' кр.</b> на <b>' . $mne . ' екр.</b>, Банковский счет №' . $u->bank['id'] . '.';
+                            $log = '&quot;' . $u->info['login'] . '&quot;&nbsp;[' . $u->info['level'] . '] ������� <b>' . $mn . ' ��.</b> �� <b>' . $mne . ' ���.</b>, ���������� ���� �' . $u->bank['id'] . '.';
                             $u->addDelo(1, $u->info['id'], $log, time(), $u->info['city'], 'Bank.System', 0, 0, '');
-                            $u->addDelo(3, $u->info['id'], 'Вы успешно обменяли <b>' . ceil((int)($_POST['convert_sum2'] * 100 / 100)) . ' кр.</b> на <b>' . $mne . ' екр.</b>, комиссия <b>' . round((ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2) . ' кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $u->addDelo(3, $u->info['id'], '�� ������� �������� <b>' . ceil((int)($_POST['convert_sum2'] * 100 / 100)) . ' ��.</b> �� <b>' . $mne . ' ���.</b>, �������� <b>' . round((ceil((int)($_POST['convert_sum2'] * 100 / 100)) / 100 * 3 + 5), 2) . ' ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
                         } else {
-                            $re2 = 'У вас нет <b>' . $mn . ' кр.</b> на счете';
+                            $re2 = '� ��� ��� <b>' . $mn . ' ��.</b> �� �����';
                         }
                     } else {
-                        $re2 = 'Минимальная сумма для обмена составляет ' . round((0.01 * ($noc * 1.03) + 5), 2) . ' кр.';
+                        $re2 = '����������� ����� ��� ������ ���������� ' . round((0.01 * ($noc * 1.03) + 5), 2) . ' ��.';
                     }
                 } else {
-                    $re2 = 'Вы должны пройти проверку на чистоту у Паладинов или Тарманов.';
+                    $re2 = '�� ������ ������ �������� �� ������� � ��������� ��� ��������.';
                 }
             } elseif (isset($_POST['convert_ekredit'])) {
-                //обменять екр. на кр.
+                //�������� ���. �� ��.
                 $mn = ceil((int)($_POST['convert_sum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->bank['money2'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма';
+                        $re2 = '������� ������� �����';
                     } else {
                         $upd = mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1'] + ($mn * $con)) . '",`money2` = "' . mysql_real_escape_string($u->bank['money2'] - $mn) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money1'] += $mn * $con;
                             $u->bank['money2'] -= $mn;
-                            $u->addDelo(3, $u->info['id'], 'Вы обменяли <b>' . $mn . ' екр.</b> на <b>' . ($mn * $con) . ' кр.</b>, комиссия <b>0 кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con), $u->bank['id']);
-                            $re2 = 'Вы удачно обменяли <b>' . $mn . ' екр.</b> на <b>' . ($mn * $con) . ' кр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� �������� <b>' . $mn . ' ���.</b> �� <b>' . ($mn * $con) . ' ��.</b>, �������� <b>0 ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, mysql_real_escape_string($mn * $con), $u->bank['id']);
+                            $re2 = '�� ������ �������� <b>' . $mn . ' ���.</b> �� <b>' . ($mn * $con) . ' ��.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет <b>' . $mn . ' екр.</b> на счете';
+                    $re2 = '� ��� ��� <b>' . $mn . ' ���.</b> �� �����';
                 }
             } elseif (isset($_POST['get_kredit'])) {
-                //положить деньги на счет
+                //�������� ������ �� ����
                 $mn = floor((int)($_POST['get_sum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->bank['money1'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма (Снять ' . ((int)$_POST['get_sum']) . ' кр.)';
+                        $re2 = '������� ������� ����� (����� ' . ((int)$_POST['get_sum']) . ' ��.)';
                     } else {
                         $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money'] + $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money1'] -= $mn;
                             $u->info['money'] += $mn;
                             mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
-                            $u->addDelo(3, $u->info['id'], 'Вы сняли со счета <b>' . $mn . ' кр.</b>, комиссия <b>0 кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
-                            $re2 = 'Вы удачно сняли со счета <b>' . $mn . ' кр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� ����� �� ����� <b>' . $mn . ' ��.</b>, �������� <b>0 ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $re2 = '�� ������ ����� �� ����� <b>' . $mn . ' ��.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет <b>' . $mn . ' кр.</b> на счете';
+                    $re2 = '� ��� ��� <b>' . $mn . ' ��.</b> �� �����';
                 }
             } elseif (isset($_POST['get_ekredit'])) {
-                //положить деньги на счет
+                //�������� ������ �� ����
                 $mn = floor((int)($_POST['get_esum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->bank['money2'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма (Снять ' . ((int)$_POST['get_esum']) . ' Екр.)';
+                        $re2 = '������� ������� ����� (����� ' . ((int)$_POST['get_esum']) . ' ���.)';
                     } else {
                         $upd = mysql_query('UPDATE `users` SET `money2` = "' . mysql_real_escape_string($u->info['money2'] + $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money2'] -= $mn;
                             $u->info['money2'] += $mn;
                             mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($u->bank['money2']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
-                            $u->addDelo(3, $u->info['id'], 'Вы сняли со счета <b>' . $mn . ' Екр.</b>, комиссия <b>0 Екр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
-                            $re2 = 'Вы удачно сняли со счета <b>' . $mn . ' Екр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� ����� �� ����� <b>' . $mn . ' ���.</b>, �������� <b>0 ���.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $re2 = '�� ������ ����� �� ����� <b>' . $mn . ' ���.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет <b>' . $mn . ' Екр.</b> на счете';
+                    $re2 = '� ��� ��� <b>' . $mn . ' ���.</b> �� �����';
                 }
             } elseif (isset($_POST['add_ekredit'])) {
-                //положить деньги на счет
+                //�������� ������ �� ����
                 $mn = floor((int)($_POST['add_esum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->info['money2'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма (Пополнение счета)';
+                        $re2 = '������� ������� ����� (���������� �����)';
                     } else {
                         $upd = mysql_query('UPDATE `users` SET `money2` = "' . mysql_real_escape_string($u->info['money2'] - $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money2'] += $mn;
                             $u->info['money2'] -= $mn;
                             mysql_query('UPDATE `bank` SET `money2` = "' . mysql_real_escape_string($u->bank['money2']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
-                            $u->addDelo(3, $u->info['id'], 'Вы положили на счет <b>' . $mn . ' Eкр.</b>, комиссия <b>0 Екр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
-                            $re2 = 'Вы удачно положили на свой счет <b>' . $mn . ' Екр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� �������� �� ���� <b>' . $mn . ' E��.</b>, �������� <b>0 ���.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $re2 = '�� ������ �������� �� ���� ���� <b>' . $mn . ' ���.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет при себе <b>' . $mn . ' Екр.</b>';
+                    $re2 = '� ��� ��� ��� ���� <b>' . $mn . ' ���.</b>';
                 }
             } elseif (isset($_POST['add_kredit'])) {
-                //положить деньги на счет
+                //�������� ������ �� ����
                 $mn = floor((int)($_POST['add_sum'] * 100));
                 $mn = round(($mn / 100), 2);
                 if ($u->info['money'] >= $mn) {
                     if ($mn < 0.01 || $mn > 1000000000) {
-                        $re2 = 'Неверно указана сумма (Пополнение счета)';
+                        $re2 = '������� ������� ����� (���������� �����)';
                     } else {
                         $upd = mysql_query('UPDATE `users` SET `money` = "' . mysql_real_escape_string($u->info['money'] - $mn) . '" WHERE `id` = "' . $u->info['id'] . '" LIMIT 1');
                         if ($upd) {
                             $u->bank['money1'] += $mn;
                             $u->info['money'] -= $mn;
                             mysql_query('UPDATE `bank` SET `money1` = "' . mysql_real_escape_string($u->bank['money1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
-                            $u->addDelo(3, $u->info['id'], 'Вы положили на счет <b>' . $mn . ' кр.</b>, комиссия <b>0 кр.</b> <i>(Итого: ' . $u->bank['money1'] . ' кр., ' . $u->bank['money2'] . ' екр.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
-                            $re2 = 'Вы удачно положили на свой счет <b>' . $mn . ' кр.</b>';
+                            $u->addDelo(3, $u->info['id'], '�� �������� �� ���� <b>' . $mn . ' ��.</b>, �������� <b>0 ��.</b> <i>(�����: ' . $u->bank['money1'] . ' ��., ' . $u->bank['money2'] . ' ���.)</i>', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                            $re2 = '�� ������ �������� �� ���� ���� <b>' . $mn . ' ��.</b>';
                         } else {
-                            $re2 = 'Не удалось выполнить операцию';
+                            $re2 = '�� ������� ��������� ��������';
                         }
                     }
                 } else {
-                    $re2 = 'У вас нет при себе <b>' . $mn . ' кр.</b>';
+                    $re2 = '� ��� ��� ��� ���� <b>' . $mn . ' ��.</b>';
                 }
             } elseif (isset($_POST['change_psw2'])) {
-                //смена пароля счета
+                //����� ������ �����
                 $sm = $u->testAction('`uid` = "' . $u->info['id'] . '" AND `vals` = "id=' . $u->bank['id'] . '&new_pass=' . $u->bank['pass'] . '" AND `vars` = "bank_new_pass" AND `time` > "' . (time() - 24 * 60 * 60) . '" LIMIT 1', 1);
                 if ($_POST['new_psw1'] != $_POST['new_psw2']) {
-                    $re2 = 'Пароли не совпадают';
+                    $re2 = '������ �� ���������';
                 } elseif (iconv_strlen($_POST['new_psw1']) < 6 || iconv_strlen($_POST['new_psw1']) > 32) {
-                    $re2 = 'Пароль не может быть короче 6 или длинее 32 символов';
+                    $re2 = '������ �� ����� ���� ������ 6 ��� ������ 32 ��������';
                 } elseif (isset($sm['id'])) {
-                    $re2 = 'Нельзя менять пароль чаще одного раза в день';
+                    $re2 = '������ ������ ������ ���� ������ ���� � ����';
                 } else {
-                    //меняем
+                    //������
                     $upd = mysql_query('UPDATE `bank` SET `pass` = "' . mysql_real_escape_string($_POST['new_psw1']) . '" WHERE `id` = "' . $u->bank['id'] . '" LIMIT 1');
                     if ($upd) {
                         $u->addAction(time(), 'bank_new_pass', 'id=' . $u->bank['id'] . '&new_pass=' . $_POST['new_psw1'] . '');
                         $u->bank['pass'] = $_POST['new_psw1'];
-                        $re2 = 'Пароль от счета №<b>' . getNum($u->bank['id']) . '</b> был успешно изменен<br>Новый пароль: <b>' . $u->bank['pass'] . '</b>';
-                        $u->addDelo(3, $u->info['id'], 'Был изменен пароль от счета.', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
+                        $re2 = '������ �� ����� �<b>' . getNum($u->bank['id']) . '</b> ��� ������� �������<br>����� ������: <b>' . $u->bank['pass'] . '</b>';
+                        $u->addDelo(3, $u->info['id'], '��� ������� ������ �� �����.', time(), $u->info['city'], 'Bank.System', 0, 0, $u->bank['id']);
                     } else {
-                        $re2 = 'Вам отказали в смене пароля';
+                        $re2 = '��� �������� � ����� ������';
                     }
                 }
             }
@@ -468,7 +468,7 @@ if ($u->room['file'] == 'bank') {
             <td>
                 <div align="center">
                     <div align="center" class="pH3">
-                        <h3>Банк<br/></h3>
+                        <h3>����<br/></h3>
                     </div>
                 </div>
             </td>
@@ -496,8 +496,8 @@ if ($u->room['file'] == 'bank') {
                                                                                                          id="greyText"
                                                                                                          class="menutop"
                                                                                                          onclick="location='main.php?loc=1.180.0.11&rnd=<? echo $code; ?>';"
-                                                                                                         title="<? thisInfRm('1.180.0.11', 1); ?>">Страшилкина
-                                                                        улица</a></td>
+                                                                                                         title="<? thisInfRm('1.180.0.11', 1); ?>">�����������
+                                                                        �����</a></td>
                                                             </tr>
                                                         </table>
                                                     </td>
@@ -517,7 +517,7 @@ if ($u->room['file'] == 'bank') {
     <TR>
         <form name="F1" method="post">
             <TD valign="top" align="left">
-                <!--Магазин--></TD>
+                <!--�������--></TD>
         </FORM>
     </TR>
     <TR>
@@ -527,12 +527,12 @@ if ($u->room['file'] == 'bank') {
     }
     if (!isset($u->bank['id'])) {
         ?>
-        Мы предоставляем следующие услуги:
+        �� ������������� ��������� ������:
         <OL>
-            <LI>Открытие счета
-            <LI>Возможность положить/снять кредиты/еврокредиты со счета
-            <LI>Перевести кредиты/еврокредиты с одного счета на другой
-            <LI>Обменный пункт. Обмен еврокредитов на кредиты
+            <LI>�������� �����
+            <LI>����������� ��������/����� �������/����������� �� �����
+            <LI>��������� �������/����������� � ������ ����� �� ������
+            <LI>�������� �����. ����� ������������ �� �������
         </OL>
         <script type="text/javascript" src="js/jquery.js"></script>
         <script>
@@ -545,22 +545,22 @@ if ($u->room['file'] == 'bank') {
             }
         </script>
         <FORM action="main.php?open&rnd=<? echo $code; ?>" method="POST">
-            Хотите открыть свой счет? Услуга платная: <INPUT onclick="hidecreatefx();" TYPE="button"
-                                                             value="Открыть счет">
+            ������ ������� ���� ����? ������ �������: <INPUT onclick="hidecreatefx();" TYPE="button"
+                                                             value="������� ����">
             <div id="hidecreate" style="display:none">
                 <FIELDSET style="width:300px;">
-                    <LEGEND><B>Открытие счета</B></LEGEND>
+                    <LEGEND><B>�������� �����</B></LEGEND>
                     <small>
                         <? if ($u->info['level'] < 8 && $c['zuby'] == true) { ?>
                             <center>
-                                <input name="rdn01" type="radio" value="1"> <b>3.00 кр.</b> &nbsp; &nbsp; <input
+                                <input name="rdn01" type="radio" value="1"> <b>3.00 ��.</b> &nbsp; &nbsp; <input
                                         name="rdn01" type="radio" value="2"> <?= $u->zuby(15) ?> &nbsp; &nbsp; &nbsp;
                             </center>
                             <hr/>
                         <? } else {
                             ?>
                             <center>
-                                <input checked="checked" name="rdn01" type="radio" value="1"> <b>3.00 кр.</b> &nbsp;
+                                <input checked="checked" name="rdn01" type="radio" value="1"> <b>3.00 ��.</b> &nbsp;
                                 &nbsp; &nbsp;
                             </center>
                             <hr/>
@@ -578,17 +578,17 @@ if ($u->room['file'] == 'bank') {
                         </style>
                         <table width="300" border="0" cellspacing="0" cellpadding="0">
                             <tr>
-                                <td>Пароль счета:</td>
+                                <td>������ �����:</td>
                                 <td><INPUT style='width:90;' type="password" value="" name="pass1"></td>
                             </tr>
                             <tr>
-                                <td>Еще раз:</td>
+                                <td>��� ���:</td>
                                 <td><INPUT style='width:90;' type="password" value="" name="pass2"></td>
                             </tr>
                         </table>
                     </small>
                     <center>
-                        <INPUT TYPE="submit" value="Открыть счет">
+                        <INPUT TYPE="submit" value="������� ����">
                     </center>
                 </FIELDSET>
             </div>
@@ -596,13 +596,13 @@ if ($u->room['file'] == 'bank') {
         <form action="main.php?enter&rnd=<? echo $code; ?>" method="POST">
             <br/>
             <FIELDSET style="width:300px;">
-                <LEGEND><B>Управление счетом</B></LEGEND>
+                <LEGEND><B>���������� ������</B></LEGEND>
                 <TABLE width="300">
                     <TR>
                         <TD valign=top>
                             <TABLE>
                                 <TR>
-                                    <TD>Номер счета</td>
+                                    <TD>����� �����</td>
                                     <TD colspan=2><select name="bank" size=0 style="width: 90px">
                                             <?
                                             $sp = mysql_query('SELECT * FROM `bank` WHERE `uid` = "' . $u->info['id'] . '" AND `block` = "0"');
@@ -616,11 +616,11 @@ if ($u->room['file'] == 'bank') {
                                         </select></td>
                                 </tr>
                                 <TR>
-                                    <TD>Пароль</td>
+                                    <TD>������</td>
                                     <td><INPUT style='width:90;' type="password" value="" name="pass"></td>
                                 </tr>
                                 <TR>
-                                    <TD colspan=3 align=center><INPUT TYPE="submit" value="Войти"></td>
+                                    <TD colspan=3 align=center><INPUT TYPE="submit" value="�����"></td>
                                 </tr>
                             </TABLE>
                         </TD>
@@ -631,8 +631,8 @@ if ($u->room['file'] == 'bank') {
             <input type=hidden name='res' value=<? echo $code; ?>>
             <br/>
             <br/>
-            Забыли пароль? Можно его выслать на email, номер счета:<input type=text name='schet'> <input type="submit"
-                                                                                                         value="Выслать"/></TD>
+            ������ ������? ����� ��� ������� �� email, ����� �����:<input type=text name='schet'> <input type="submit"
+                                                                                                         value="�������"/></TD>
         </form>
         </TR>
         </TABLE>
@@ -659,34 +659,34 @@ if ($u->room['file'] == 'bank') {
 
             .pay td:hover img {
                 filter: progid:DXImageTransform.Microsoft.Alpha(opacity=80); /* IE 5.5+*/
-                -moz-opacity: 0.8; /* Mozilla 1.6 и ниже */
+                -moz-opacity: 0.8; /* Mozilla 1.6 � ���� */
                 -khtml-opacity: 0.8; /* Konqueror 3.1, Safari 1.1 */
                 opacity: 0.8; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9 */
                 cursor: pointer;
             }
         </style>
-        <!-- управление счетом -->
+        <!-- ���������� ������ -->
         <FORM action="main.php" method="POST">
             <INPUT TYPE=hidden name="sd4" value="<? echo $u->info['nextAct']; ?>">
             <TABLE width=100%>
                 <TR>
-                    <TD valign=top width=30%><H4>Управление счетом</H4> &nbsp;
-                        <b>Счёт №:</b> <? echo getNum($u->bank['id']); ?> <a href="?exit=<? echo $code; ?>"
-                                                                             title="Окончить работу c текущим счетом">[x]</a><br>
+                    <TD valign=top width=30%><H4>���������� ������</H4> &nbsp;
+                        <b>���� �:</b> <? echo getNum($u->bank['id']); ?> <a href="?exit=<? echo $code; ?>"
+                                                                             title="�������� ������ c ������� ������">[x]</a><br>
                     </TD>
                     <TD valign=top align=center width=40%>
                         <TABLE>
                             <TR>
                                 <TD>
                                     <FIELDSET>
-                                        <LEGEND><B>У вас на счете</B></LEGEND>
+                                        <LEGEND><B>� ��� �� �����</B></LEGEND>
                                         <TABLE>
                                             <TR>
-                                                <TD>Кредитов:</TD>
+                                                <TD>��������:</TD>
                                                 <TD><B><? echo $u->round2($u->bank['money1']); ?></B></TD>
                                             </TR>
                                             <TR>
-                                                <TD>Еврокредитов:</TD>
+                                                <TD>������������:</TD>
                                                 <TD><B><? echo $u->round2($u->bank['money2']); ?></B></TD>
                                             </TR>
                                             <TR>
@@ -695,12 +695,12 @@ if ($u->room['file'] == 'bank') {
                                                 </TD>
                                             </TR>
                                             <TR>
-                                                <TD>При себе наличных:</TD>
-                                                <TD><B><? echo $u->round2($u->info['money']); ?> кр.</B></TD>
+                                                <TD>��� ���� ��������:</TD>
+                                                <TD><B><? echo $u->round2($u->info['money']); ?> ��.</B></TD>
                                             </TR>
                                             <TR>
-                                                <TD>При себе наличных:</TD>
-                                                <TD><B><? echo $u->round2($u->info['money2']); ?> Екр.</B></TD>
+                                                <TD>��� ���� ��������:</TD>
+                                                <TD><B><? echo $u->round2($u->info['money2']); ?> ���.</B></TD>
                                             </TR>
 
                                         </TABLE>
@@ -709,8 +709,8 @@ if ($u->room['file'] == 'bank') {
                             </TR>
                         </TABLE>
                     </TD>
-                    <TD valign=top align=right width=30%><FONT COLOR=red>Внимание!</FONT> Некоторые услуги банка
-                        платные, о размере взымаемой комиссии написано в соответствующем разделе.
+                    <TD valign=top align=right width=30%><FONT COLOR=red>��������!</FONT> ��������� ������ �����
+                        �������, � ������� ��������� �������� �������� � ��������������� �������.
                     </TD>
                 </TR>
             </TABLE>
@@ -731,18 +731,18 @@ if ($u->room['file'] == 'bank') {
                             <tr>
                                 <td valign="top" width="50%">
                                     <fieldset>
-                                        <legend><b>Пополнить счет</b></legend>
-                                        Сумма
+                                        <legend><b>��������� ����</b></legend>
+                                        �����
                                         <input type="text" name="add_sum" id="add_sum" size="6" maxlength="10"/>
-                                        кр.
-                                        <input type="submit" name="add_kredit" value="Положить кредиты на счет"
-                                               onclick="if(Math.round(document.getElementById('add_sum')).value==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите положить на свой счет '+(Math.floor(document.getElementById('add_sum').value*100)/100).toFixed(2)+' кр. ?')}"/>
+                                        ��.
+                                        <input type="submit" name="add_kredit" value="�������� ������� �� ����"
+                                               onclick="if(Math.round(document.getElementById('add_sum')).value==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ �������� �� ���� ���� '+(Math.floor(document.getElementById('add_sum').value*100)/100).toFixed(2)+' ��. ?')}"/>
                                         <br/>
-                                        Сумма
+                                        �����
                                         <input type="text" name="add_esum" id="add_esum" size="6" maxlength="10"/>
-                                        Екр.
-                                        <input type="submit" name="add_ekredit" value="Положить кредиты на счет"
-                                               onclick="if(Math.round(document.getElementById('add_esum')).value==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите положить на свой счет '+(Math.floor(document.getElementById('add_esum').value*100)/100).toFixed(2)+' Екр. ?')}"/>
+                                        ���.
+                                        <input type="submit" name="add_ekredit" value="�������� ������� �� ����"
+                                               onclick="if(Math.round(document.getElementById('add_esum')).value==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ �������� �� ���� ���� '+(Math.floor(document.getElementById('add_esum').value*100)/100).toFixed(2)+' ���. ?')}"/>
                                         <br/>
                                     </fieldset>
                                 </td>
@@ -750,34 +750,34 @@ if ($u->room['file'] == 'bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Перевести кредиты на другой счет</b></legend>
-                                        Сумма
+                                        <legend><b>��������� ������� �� ������ ����</b></legend>
+                                        �����
                                         <input id="vl1" value="" type="text" name="tansfer_sum" size="6"
                                                maxlength="10"/>
-                                        кр.<br/>
-                                        Номер счета куда перевести кредиты
+                                        ��.<br/>
+                                        ����� ����� ���� ��������� �������
                                         <input value="" type="text" id="vl2" name="num" size="12" maxlength="15"/>
                                         <br/>
                                         <input type="submit" name="transfer_kredit"
-                                               value="Перевести кредиты на другой счет"
-                                               onclick="if(Math.round(document.getElementById('vl1')).value==0 || Math.round(document.getElementById('vl2').value)==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите перевести со своего счета '+(Math.floor(document.getElementById('vl1').value*100)/100).toFixed(2)+' кр. на счет номер '+Math.floor(document.getElementById('vl2').value)+' ?')}"/>
+                                               value="��������� ������� �� ������ ����"
+                                               onclick="if(Math.round(document.getElementById('vl1')).value==0 || Math.round(document.getElementById('vl2').value)==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ ��������� �� ������ ����� '+(Math.floor(document.getElementById('vl1').value*100)/100).toFixed(2)+' ��. �� ���� ����� '+Math.floor(document.getElementById('vl2').value)+' ?')}"/>
                                         <br/>
-                                        <small>Комиссия составляет <b>3.00 %</b> от суммы, но не менее <b>1.00
-                                                кр</b>.</small>
+                                        <small>�������� ���������� <b>3.00 %</b> �� �����, �� �� ����� <b>1.00
+                                                ��</b>.</small>
                                     </fieldset>
                                 </td>
                             </tr>
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Обменный пункт</b></legend>
-                                        Обменять еврокредиты на кредиты.<br/>
-                                        Курс <b>1 екр.</b> = <b><? echo $con; ?>.00 кр.</b><br/>
-                                        Сумма
+                                        <legend><b>�������� �����</b></legend>
+                                        �������� ����������� �� �������.<br/>
+                                        ���� <b>1 ���.</b> = <b><? echo $con; ?>.00 ��.</b><br/>
+                                        �����
                                         <input type="text" name="convert_sum" id="convert_sum" size="6" maxlength="10"/>
-                                        екр.
+                                        ���.
                                         <input type="submit" name="convert_ekredit"
-                                               value="Обменять" <? /*onclick="return confirm('Вы хотите обменять '+(Math.floor(document.getElementById('convert_sum').value*100)/100).toFixed(2)+' екр. на '+(Math.floor(document.getElementById('convert_sum').value*100)/100*<? echo (0+$con); ?>).toFixed(2)+' кр. ?');" */ ?> />
+                                               value="��������" <? /*onclick="return confirm('�� ������ �������� '+(Math.floor(document.getElementById('convert_sum').value*100)/100).toFixed(2)+' ���. �� '+(Math.floor(document.getElementById('convert_sum').value*100)/100*<? echo (0+$con); ?>).toFixed(2)+' ��. ?');" */ ?> />
                                     </fieldset>
                                 </td>
                             </tr>
@@ -785,17 +785,17 @@ if ($u->room['file'] == 'bank') {
                                 <tr>
                                     <td valign="top">
                                         <fieldset style="background-color:#DDEAD7">
-                                            <legend><b>Обменный пункт</b></legend>
-                                            Обменять кредиты на еврокредиты.<br/>
-                                            Курс <b><? echo $noc; ?> кр.</b> = <b>1.00 екр.</b><br/>
-                                            Сумма
+                                            <legend><b>�������� �����</b></legend>
+                                            �������� ������� �� �����������.<br/>
+                                            ���� <b><? echo $noc; ?> ��.</b> = <b>1.00 ���.</b><br/>
+                                            �����
                                             <input type="text" name="convert_sum2" id="convert_sum2" size="6"
                                                    maxlength="10"/>
-                                            кр.
+                                            ��.
                                             <br/>
-                                            <small>Комиссия составляет <b>3.00 %</b> от суммы, а так-же <b>5.00 кр</b>.</small>
-                                            <input type="submit" name="convert_kredit" value="Обменять"
-                                                   onclick="return confirm('Вы хотите обменять '+(5+Math.floor((document.getElementById('convert_sum2').value)*103)/100).toFixed(2)+' кр. на '+(Math.floor(document.getElementById('convert_sum2').value*100)/100/<? echo $noc; ?>).toFixed(2)+' екр. ?');"/>
+                                            <small>�������� ���������� <b>3.00 %</b> �� �����, � ���-�� <b>5.00 ��</b>.</small>
+                                            <input type="submit" name="convert_kredit" value="��������"
+                                                   onclick="return confirm('�� ������ �������� '+(5+Math.floor((document.getElementById('convert_sum2').value)*103)/100).toFixed(2)+' ��. �� '+(Math.floor(document.getElementById('convert_sum2').value*100)/100/<? echo $noc; ?>).toFixed(2)+' ���. ?');"/>
                                         </fieldset>
                                     </td>
                                 </tr>
@@ -805,19 +805,19 @@ if ($u->room['file'] == 'bank') {
                                 <tr>
                                     <td valign="top">
                                         <fieldset>
-                                            <legend><b>Перевести еврокредиты на другой счет</b></legend>
-                                            Сумма
+                                            <legend><b>��������� ����������� �� ������ ����</b></legend>
+                                            �����
                                             <input id="vl12" value="" type="text" name="tansfer_sum2" size="6"
                                                    maxlength="10"/>
-                                            екр.<br/>
-                                            Номер счета куда перевести кредиты
+                                            ���.<br/>
+                                            ����� ����� ���� ��������� �������
                                             <input value="" type="text" id="vl22" name="num2" size="12" maxlength="15"/>
                                             <br/>
                                             <input type="submit" name="transfer_kredit2"
-                                                   value="Перевести еврокредиты на другой счет"
-                                                   onclick="if(Math.round(document.getElementById('vl12')).value==0 || Math.round(document.getElementById('vl22').value)==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите перевести со своего счета '+(Math.floor(document.getElementById('vl12').value*100)/100).toFixed(2)+' екр. на счет номер '+Math.floor(document.getElementById('vl22').value)+' ?')}"/>
+                                                   value="��������� ����������� �� ������ ����"
+                                                   onclick="if(Math.round(document.getElementById('vl12')).value==0 || Math.round(document.getElementById('vl22').value)==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ ��������� �� ������ ����� '+(Math.floor(document.getElementById('vl12').value*100)/100).toFixed(2)+' ���. �� ���� ����� '+Math.floor(document.getElementById('vl22').value)+' ?')}"/>
                                             <br/>
-                                            Комиссия составляет <b>0.00 %</b> от суммы, но не менее <b>0.01 екр</b>.
+                                            �������� ���������� <b>0.00 %</b> �� �����, �� �� ����� <b>0.01 ���</b>.
                                         </fieldset>
                                     </td>
                                 </tr>
@@ -825,27 +825,27 @@ if ($u->room['file'] == 'bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Настройки</b></legend>
-                                        У вас разрешена высылка номера счета и пароля на email. Если вы не уверены в
-                                        своем email, или убеждены, что не забудете свой номер счета и пароль к нему, то
-                                        можете запретить высылку пароля на email. Это убережет вас от кражи кредитов с
-                                        вашего счета в случае взлома вашего email. Но если вы сами забудете свой номер
-                                        счета и/или пароль, вам уже никто не поможет!<br/>
+                                        <legend><b>���������</b></legend>
+                                        � ��� ��������� ������� ������ ����� � ������ �� email. ���� �� �� ������� �
+                                        ����� email, ��� ��������, ��� �� �������� ���� ����� ����� � ������ � ����, ��
+                                        ������ ��������� ������� ������ �� email. ��� �������� ��� �� ����� �������� �
+                                        ������ ����� � ������ ������ ������ email. �� ���� �� ���� �������� ���� �����
+                                        ����� �/��� ������, ��� ��� ����� �� �������!<br/>
                                         <input type="submit" name="stop_send_email2"
-                                               value="Запретить высылку пароля на email"/>
+                                               value="��������� ������� ������ �� email"/>
                                         <hr/>
-                                        <b>Сменить пароль</b><br/>
+                                        <b>������� ������</b><br/>
                                         <table>
                                             <tr>
-                                                <td>Новый пароль</td>
+                                                <td>����� ������</td>
                                                 <td><input type="password" name="new_psw1"/></td>
                                             </tr>
                                             <tr>
-                                                <td>Введите новый пароль повторно</td>
+                                                <td>������� ����� ������ ��������</td>
                                                 <td><input type="password" name="new_psw2"/></td>
                                             </tr>
                                         </table>
-                                        <input type="submit" name="change_psw2" value="Сменить пароль"/>
+                                        <input type="submit" name="change_psw2" value="������� ������"/>
                                         <br/>
                                         <div id="keypad4" align="center" style="display: none;"></div>
                                     </fieldset>
@@ -861,18 +861,18 @@ if ($u->room['file'] == 'bank') {
                             <tr>
                                 <td valign="top" width="50%">
                                     <fieldset>
-                                        <legend><b>Снять со счета</b></legend>
-                                        Сумма
+                                        <legend><b>����� �� �����</b></legend>
+                                        �����
                                         <input type="text" name="get_sum" id="get_sum" size="6" maxlength="10"/>
-                                        кр.
-                                        <input type="submit" name="get_kredit" value="Снять кредиты со счета"
-                                               onclick="if(Math.round(document.getElementById('get_sum')).value==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите снять со своего счета '+(Math.floor(document.getElementById('get_sum').value*100)/100).toFixed(2)+' кр. ?')}"/>
+                                        ��.
+                                        <input type="submit" name="get_kredit" value="����� ������� �� �����"
+                                               onclick="if(Math.round(document.getElementById('get_sum')).value==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ ����� �� ������ ����� '+(Math.floor(document.getElementById('get_sum').value*100)/100).toFixed(2)+' ��. ?')}"/>
                                         <br/>
-                                        Сумма
+                                        �����
                                         <input type="text" name="get_esum" id="get_esum" size="6" maxlength="10"/>
-                                        Eкр.
-                                        <input type="submit" name="get_ekredit" value="Снять Екр со счета"
-                                               onclick="if(Math.round(document.getElementById('get_esum')).value==0) {alert('Укажите сумму и номер счета'); return false;} else {return confirm('Вы хотите снять со своего счета '+(Math.floor(document.getElementById('get_esum').value*100)/100).toFixed(2)+' Екр. ?')}"/>
+                                        E��.
+                                        <input type="submit" name="get_ekredit" value="����� ��� �� �����"
+                                               onclick="if(Math.round(document.getElementById('get_esum')).value==0) {alert('������� ����� � ����� �����'); return false;} else {return confirm('�� ������ ����� �� ������ ����� '+(Math.floor(document.getElementById('get_esum').value*100)/100).toFixed(2)+' ���. ?')}"/>
                                         <br/>
                                     </fieldset>
                                 </td>
@@ -883,33 +883,33 @@ if ($u->room['file'] == 'bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Курс еврокредита к мировой валюте</b></legend>
+                                        <legend><b>���� ����������� � ������� ������</b></legend>
                                         <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                             <?
                                             $pl = mysql_fetch_array(mysql_query('SELECT * FROM `bank_table` ORDER BY `time` DESC LIMIT 1'));
                                             if (isset($pl['id'])) {
                                                 ?>
                                                 <tr>
-                                                    <td><small>Данные на <b><?= date('d.m.y H:i', $pl['time']) ?></b>
-                                                            без учета комиссий</small></td>
+                                                    <td><small>������ �� <b><?= date('d.m.y H:i', $pl['time']) ?></b>
+                                                            ��� ����� ��������</small></td>
                                                 </tr>
                                                 <?
                                                 $pl['RUB'] = 1;
 
                                                 $i = 0;
                                                 $true = [
-                                                    ['USD', 'долларов США'],
-                                                    ['EUR', 'ЕВРО'],
-                                                    ['RUB', 'российских рублей'],
-                                                    ['UAH', 'укр. гривен'],
-                                                    ['BYR', 'белорусских рублей'],
-                                                    ['AZN', 'азербайджанских манат'],
-                                                    ['GBP', 'англ. фунтов стерлингов']
+                                                    ['USD', '�������� ���'],
+                                                    ['EUR', '����'],
+                                                    ['RUB', '���������� ������'],
+                                                    ['UAH', '���. ������'],
+                                                    ['BYR', '����������� ������'],
+                                                    ['AZN', '��������������� �����'],
+                                                    ['GBP', '����. ������ ����������']
                                                 ];
                                                 while ($i < count($true)) {
                                                     ?>
                                                     <tr>
-                                                        <td><span>1 екр. = </span><span
+                                                        <td><span>1 ���. = </span><span
                                                                     style="display:inline-block;width:100px"><b><?= round(($pl['cur'] / $pl[$true[$i][0]]), 4) ?></b></span><span><?= $true[$i][1] ?></span>
                                                         </td>
                                                     </tr>
@@ -921,25 +921,25 @@ if ($u->room['file'] == 'bank') {
                                                 <tr>
                                                     <td><small>
                                                             <center><font color=green><b> 10UAH = 1
-                                                                        Еврокредит </b></font></center>
+                                                                        ���������� </b></font></center>
                                                         </small></td>
                                                 </tr>
                                                 <tr>
                                                     <td><small>
                                                             <center><font color=green><b>0.35USD = 1
-                                                                        Еврокредит </b></font></center>
+                                                                        ���������� </b></font></center>
                                                         </small></td>
                                                 </tr>
                                                 <tr>
                                                     <td><small>
                                                             <center><font color=green><b> 20RUB = 1
-                                                                        Еврокредит </b></font></center>
+                                                                        ���������� </b></font></center>
                                                         </small></td>
                                                 </tr>
                                                 <tr>
                                                     <td><small>
                                                             <center><font color=green><b>0.29EUR = 1
-                                                                        Еврокредит </b></font></center>
+                                                                        ���������� </b></font></center>
                                                         </small></td>
                                                 </tr>
                                             <? } ?>
@@ -950,7 +950,7 @@ if ($u->room['file'] == 'bank') {
                             <tr>
                                 <td valign="top">
                                     <fieldset>
-                                        <legend><b>Последние операции</b></legend>
+                                        <legend><b>��������� ��������</b></legend>
                                         <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                             <?
                                             $sp = mysql_query('SELECT * FROM `users_delo` WHERE `uid` = "' . $u->info['id'] . '" AND `dop` = "' . $u->bank['id'] . '" AND `type` = "3" ORDER BY `time` DESC LIMIT 21');
@@ -974,7 +974,7 @@ if ($u->room['file'] == 'bank') {
                 </tr>
             </table>
         </FORM>
-        <small>Сумма указанная в окне оповещения и суммы взымаемая\начисляемая могут различаться.</small>
+        <small>����� ��������� � ���� ���������� � ����� ���������\����������� ����� �����������.</small>
         <?
     }
 }
diff --git a/modules_data/location/bk.php.bac b/modules_data/location/bk.php.bac
index 001cc30b..de9a8d99 100644
--- a/modules_data/location/bk.php.bac
+++ b/modules_data/location/bk.php.bac
@@ -134,7 +134,7 @@ if($u->room['file']=='bk'){
     <td width="250" valign="top">      
         <? $usee = $u->getInfoPers($u->info['id'],0); if($usee!=false){ echo $usee[0]; }else{ echo 'information is lost.'; } ?>
     </td>
-    <td width="230" valign="top" style="padding-top:19px;"><? include('modules_data/stats_loc.php'); ?></td>
+    <td width="230" valign="top" style="padding-top:19px;"><? require_once('modules_data/stats_loc.php'); ?></td>
     <td valign="top"><div align="right">
       <? if($u->error!=''){ echo '<font color="red"><b>'.$u->error.'</b></font>'; } ?>
       <table  border="0" cellpadding="0" cellspacing="0">
@@ -146,7 +146,7 @@ if($u->room['file']=='bk'){
                     <td id="ViewLocation"><?php
                     if(true == false){
 					?><script><?php
-					include('modules_data/location/fight-club.database.php');
+					require_once('modules_data/location/fight-club.database.php');
 					?>
 					var json = <?php echo json_encode($Response); ?>;
 					var tgo = <?php echo ($tmGo*10); ?>;
diff --git a/modules_data/location/btl_.php b/modules_data/location/btl_.php
index f2cc203f..7e4d0661 100644
--- a/modules_data/location/btl_.php
+++ b/modules_data/location/btl_.php
@@ -762,7 +762,7 @@ function timedCount() { //reflesh_btn
 </script>
 <?
 require_once('_incl_data/class/_cron_.php');
-require_once('_incl_data/class/__battle.php');
+require_once('_incl_data/class/__battle.php');		
 require_once('jx/battle/refresh1.php'); ?>
 </div>
 <?
diff --git a/modules_data/location/remont.php b/modules_data/location/remont.php
index bc06ffc3..fea44483 100644
--- a/modules_data/location/remont.php
+++ b/modules_data/location/remont.php
@@ -6,7 +6,7 @@ if(!defined('GAME'))
 
 if($u->room['file']=='remont')
 {
-	//Предметы которые можно подогнать (гос)
+	//�������� ������� ����� ��������� (���)
 	$itm_podgon = array(
 		784,
 		788,
@@ -15,14 +15,14 @@ if($u->room['file']=='remont')
 		1240
 	);
 
-	//Комплекты подгона
+	//��������� �������
 	$com_podgon = array(
-		'Комплект Скорпиона' => true,
-		'Комплект Забытых Времен' => true,
-		'Комплект Утреннего Солнца' => true,
-		'Комплект Паука' => true,
-		'Комплект Злодеяний' => true,
-		'Комплект Кровавой Луны' => true
+		'�������� ���������' => true,
+		'�������� ������� ������' => true,
+		'�������� ��������� ������' => true,
+		'�������� �����' => true,
+		'�������� ���������' => true,
+		'�������� �������� ����' => true
 	);
 
 	$r = 1;
@@ -39,7 +39,7 @@ if($u->room['file']=='remont')
 	}
 
 	if(isset($_GET['upgrade']) && true == false) {
-		//улучшение предмета
+		//��������� ��������
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['upgrade']).'" LIMIT 1'));
 		if(isset($ir['id'])) {
 			$po = array();
@@ -61,7 +61,7 @@ if($u->room['file']=='remont')
 			}
 			$pcena = round($pcena+$pcena/100*(37.795*($po['upgrade']+1)));
 			if($pcena == 0) {
-				$re = '<div align="left">Данный предмет не подходит...</div>';
+				$re = '<div align="left">������ ������� �� ��������...</div>';
 			}elseif($pcena <= $u->info['money']) {
 				if($po['upgrade'] < 5) {
 					$fadd = array(0,0,0,0);
@@ -90,17 +90,17 @@ if($u->room['file']=='remont')
 
 					if($po['upgrade'] <= 3) {
 						$fadd = array(
-							round($fadd[0]/100*$faddp), //статы
-							floor($fadd[1]/100*$faddp), //мф.
-							floor($fadd[2]/100*$faddp), //броня
-							ceil($fadd[3]/100*$faddp)  //НР
+							round($fadd[0]/100*$faddp), //�����
+							floor($fadd[1]/100*$faddp), //��.
+							floor($fadd[2]/100*$faddp), //�����
+							ceil($fadd[3]/100*$faddp)  //��
 						);
 					}else{
 						$fadd = array(
-							ceil($fadd[0]/100*$faddp), //статы
-							ceil($fadd[1]/100*$faddp), //мф.
-							ceil($fadd[2]/100*$faddp), //броня
-							ceil($fadd[3]/100*$faddp)  //НР
+							ceil($fadd[0]/100*$faddp), //�����
+							ceil($fadd[1]/100*$faddp), //��.
+							ceil($fadd[2]/100*$faddp), //�����
+							ceil($fadd[3]/100*$faddp)  //��
 						);
 					}
 
@@ -110,9 +110,9 @@ if($u->room['file']=='remont')
 					$po['add_hpAll']	+= $fadd[3];
 
 					$po['upgrade']++;
-					$re = '<div align="left">Предмет &quot;'.$ir['name'].'&quot; был успешно улучшен ('.$po['upgrade'].'/5) за '.$pcena.' кр.</div>';
+					$re = '<div align="left">������� &quot;'.$ir['name'].'&quot; ��� ������� ������� ('.$po['upgrade'].'/5) �� '.$pcena.' ��.</div>';
 
-					$u->addDelo(2,$u->info['id'],'&quot;<font color="#4863A0">System.remont.itemUpgrade</font>&quot;: Предмет &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] был успешно улучшен ('.$po['upgrade'].'/5) за '.$pcena.' кр..',time(),$u->info['city'],'System.remont.itemUpgrade',0,0);
+					$u->addDelo(2,$u->info['id'],'&quot;<font color="#4863A0">System.remont.itemUpgrade</font>&quot;: ������� &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] ��� ������� ������� ('.$po['upgrade'].'/5) �� '.$pcena.' ��..',time(),$u->info['city'],'System.remont.itemUpgrade',0,0);
 
 					$po = $u->impStats($po);
 					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`1price` = "'.$ir['1price'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
@@ -120,16 +120,16 @@ if($u->room['file']=='remont')
 					$u->info['money'] -= $pcena;
 
 				}else{
-					$re = '<div align="left">Предмет улучшен до максимума</div>';
+					$re = '<div align="left">������� ������� �� ���������</div>';
 				}
 			}else{
-				$re = '<div align="left">У вас не достаточно средств для модификации предмета</div>';
+				$re = '<div align="left">� ��� �� ���������� ������� ��� ����������� ��������</div>';
 			}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 	}elseif(isset($_GET['modif']) && true == false) {
-		//модификация
+		//�����������
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND
 		`iu`.`data` NOT LIKE "%modif%" AND `im`.`type` > 0 AND `im`.`type` < 16 AND	(`iu`.`data` LIKE "%add_s1%" OR `iu`.`data` LIKE "%add_s2%" OR `iu`.`data` LIKE "%add_s3%" OR `iu`.`data` LIKE "%add_s5%" OR `iu`.`data` LIKE "%add_hpAll%" OR `iu`.`data` LIKE "%add_mib%")
 		AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['modif']).'" LIMIT 1'));
@@ -154,12 +154,12 @@ if($u->room['file']=='remont')
 			}
 			$pcena = round($pcena);
 			if($pcena == 0) {
-				$re = '<div align="left">Данный предмет не подходит...</div>';
+				$re = '<div align="left">������ ������� �� ��������...</div>';
 			}elseif($pcena <= $u->info['money']) {
 				if($u->stats['s5'] > 24) {
 					$fadd = array(0,0,0);
 
-					//добавляем статы
+					//��������� �����
 					if(isset($po['add_s1']) || isset($po['add_s2']) || isset($po['add_s3']) || isset($po['add_s5'])) {
 						$rnd1 = rand(0,(1000-$u->stats['s5']));
 						if($rnd1 > 500) {
@@ -183,7 +183,7 @@ if($u->room['file']=='remont')
 						}
 					}
 
-					//добавляем НР
+					//��������� ��
 					if(isset($po['add_m1']) || isset($po['add_m2']) || isset($po['add_m4']) || isset($po['add_m5'])) {
 						$rnd1 = rand(0,(1000-$u->stats['s5']));
 						if($rnd1 > 500) {
@@ -208,7 +208,7 @@ if($u->room['file']=='remont')
 						$fadd[1] = rand($fadd[1],20);
 					}
 
-					//добавляем броню
+					//��������� �����
 					if(isset($po['add_mib1']) || isset($po['add_mib2']) || isset($po['add_mib3']) || isset($po['add_mib4'])) {
 						$rnd1 = rand(0,(1000-$u->stats['s5']));
 						if($rnd1 > 500) {
@@ -233,15 +233,15 @@ if($u->room['file']=='remont')
 					}
 
 					if($fadd[0] > 0) {
-						//статы
+						//�����
 						$po['mf_stats'] += $fadd[0];
 					}
 					if($fadd[1] > 0) {
-						//НР
+						//��
 						$po['add_hpAll'] += $fadd[1];
 					}
 					if($fadd[2] > 0) {
-						//броня
+						//�����
 						$po['mf_mib'] += $fadd[2];
 					}
 					$po['modif'] = 1;
@@ -251,50 +251,50 @@ if($u->room['file']=='remont')
 					mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
 					$u->info['money'] -= $pcena;
 
-					$re = '<div align="left">Предмет &quot;'.$ir['name'].'&quot; был успешно модифицирован (Характеристики: +'.$fadd[0].', Здоровье: +'.$fadd[1].', Броня: +'.$fadd[2].') за '.$pcena.' кр.</div>';
+					$re = '<div align="left">������� &quot;'.$ir['name'].'&quot; ��� ������� ������������� (��������������: +'.$fadd[0].', ��������: +'.$fadd[1].', �����: +'.$fadd[2].') �� '.$pcena.' ��.</div>';
 
 				}else{
-					$re = '<div align="left">Для модифицирования предмета требуется характеристика Интелект: 25</div>';
+					$re = '<div align="left">��� ��������������� �������� ��������� �������������� ��������: 25</div>';
 				}
 			}else{
-				$re = '<div align="left">У вас не достаточно средств для модификации предмета</div>';
+				$re = '<div align="left">� ��� �� ���������� ������� ��� ����������� ��������</div>';
 			}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 	}elseif(isset($_GET['ubeff']) && true == false) {
-		// Берем в переменную текущий предмет.
+		// ����� � ���������� ������� �������.
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['ubeff']).'" LIMIT 1'));
 
-		// Предмет существует.
+		// ������� ����������.
 		if(isset($ir['id'])) {
 			$po = array();
-			$po = $u->lookStats($ir['data']); // Тут мы храним характеристики предмета.
+			$po = $u->lookStats($ir['data']); // ��� �� ������ �������������� ��������.
 			if($po['tr_lvl'] > $ir['level']) {
-				$pl['level'] = $po['tr_lvl']; // Если уровень предмета, меньше чем уровень требований с характеристик, то идет обновление уровня предмета.
+				$pl['level'] = $po['tr_lvl']; // ���� ������� ��������, ������ ��� ������� ���������� � �������������, �� ���� ���������� ������ ��������.
 			}
 
-			$pcena = 5*$pl['level']+35; // цена увеличивается, для продажи в гос. маг.
+			$pcena = 5*$pl['level']+35; // ���� �������������, ��� ������� � ���. ���.
 
-			if(isset($po['rune_id'])) { // Если в предмете существует РУНА, увеличиваем цену.
+			if(isset($po['rune_id'])) { // ���� � �������� ���������� ����, ����������� ����.
 				$pcena += 3;
 			}
 
-			if(isset($po['upatack_id'])) { // Если в предмете имеется Заточка, увеличиваем цену.
+			if(isset($po['upatack_id'])) { // ���� � �������� ������� �������, ����������� ����.
 				$pcena += 14;
 			}
-			if($po['rune_id'] > 0){ // Последовательность действий.
-				$re = '<div align="left">Для дезинтеграции сначала извлеките руну</div>';
+			if($po['rune_id'] > 0){ // ������������������ ��������.
+				$re = '<div align="left">��� ������������� ������� ��������� ����</div>';
 			} else
-			if($u->info['money'] >= 2000) { // Проверка, хватает ли средств.
-				$pcena -= 14; // Уменьшаем цену после извлеченния заточки.
-				if(isset($po['upatack_id'])) { // Добавляем заточку в инвентарь.
-					// Берем в переменную свиток заточки, который находится в предмете.
+			if($u->info['money'] >= 2000) { // ��������, ������� �� �������.
+				$pcena -= 14; // ��������� ���� ����� ����������� �������.
+				if(isset($po['upatack_id'])) { // ��������� ������� � ���������.
+					// ����� � ���������� ������ �������, ������� ��������� � ��������.
 					$upattack = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`id` = "'.mysql_real_escape_string((int)$po["upatack"]).'" LIMIT 1'));
-					if(isset($upattack) && $upattack['item_id'] && $upattack['delete']>0){ // Если старый предмет не удален из базы, мы его восстанавливаем.
+					if(isset($upattack) && $upattack['item_id'] && $upattack['delete']>0){ // ���� ������ ������� �� ������ �� ����, �� ��� ���������������.
 						mysql_query('UPDATE `items_users` SET `delete` = "'.mysql_real_escape_string(0).'" WHERE `id` = "'.$po["upatack"].'" LIMIT 1');
 						mysql_query('UPDATE `items_users` SET `data` = CONCAT(`data`,"noremont=1") WHERE `id` = "'.$po["upatack"].'" LIMIT 1');
-					} else { // Если старый предмет не существует, создаем новый.
+					} else { // ���� ������ ������� �� ����������, ������� �����.
 						$u->addItem($po['upatack_id'],$u->info['id'],'|noremont=1', NULL, NULL, true);
 						$irs .= ','.$po['upatack_name'];
 					}
@@ -305,7 +305,7 @@ if($u->room['file']=='remont')
 				}
 
 
-				// Обнуляем инфу к стандартным данным - $ir['item_id']
+				// �������� ���� � ����������� ������ - $ir['item_id']
 				$item_default = mysql_fetch_array(mysql_query('SELECT `data` FROM `items_main_data` WHERE `items_id` = "'.mysql_real_escape_string((int)$ir['item_id']).'" LIMIT 1'));
 				$item_default = $u->lookStats($item_default['data']);
 				$upattack = $u->lookStats($upattack['data']);
@@ -326,15 +326,15 @@ if($u->room['file']=='remont')
 				unset($upattack);
 				$po = $u->impStats($po);
 
-				// Заточка tr_lvl=4|tr_s5=10|tr_mg7=4|uptype=21|upatack=4|tr_a4=4|srok=432000
+				// ������� tr_lvl=4|tr_s5=10|tr_mg7=4|uptype=21|upatack=4|tr_a4=4|srok=432000
 				/*
 				if(isset($po['spell_id'])) {
-					//Извлечение чарки
+					//���������� �����
 					$u->addItem($po['spell_id'],$u->info['id']);
 					$irs .= ','.$po['spell_name'];
 				}
 
-				//обнуление предмета (кроме улучшений , гравировки)
+				//��������� �������� (����� ��������� , ����������)
 
 				$pon = '';
 				if(isset($po['gravi'])) {
@@ -377,16 +377,16 @@ if($u->room['file']=='remont')
 				WHERE `id` = "'.$iidis.'" AND `uid` = "'.$u->info['id'].'" LIMIT 1');
 
 				$u->info['money'] -= $pcena;
-				$re = '<div align="left">Предмет &quot;'.$ir['name'].'&quot; был успешно дезинтегрирован ('.$ir['name'].''.$irs.') за '.$pcena.' кр.</div>';
+				$re = '<div align="left">������� &quot;'.$ir['name'].'&quot; ��� ������� ��������������� ('.$ir['name'].''.$irs.') �� '.$pcena.' ��.</div>';
 				*/
 				var_info($po);
 				mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
 				mysql_query('UPDATE `users` SET `money` = `money` - 100 WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
 			}else{
-				$re = '<div align="left">У вас не достаточно средств для дезинтеграции</div>';
+				$re = '<div align="left">� ��� �� ���������� ������� ��� �������������</div>';
 			}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 	}elseif(isset($_GET['unrune'])) {
         require_once $_SERVER['DOCUMENT_ROOT'] . '/_incl_data/class/Insallah/Runes/Runes.php';
@@ -402,26 +402,30 @@ if($u->room['file']=='remont')
 				if($u->stats['repair_r']>=1) {
 					$pcena = 0;
 				}
+
 				if($pcena <= $u->info['money'] ) {
-                    /** Самое новое изъятие рун. ;)*/
+                    /** ����� ����� ������� ���. ;)*/
                     $item_and_rune = \Insallah\Runes::removeRuneData($po);
+//                    echo "<small style='color: sienna'>";
+//                    echo $item_and_rune['item'].'<hr>'.$item_and_rune['rune'] . '<hr>' . sprintf("update items_users set data = '%s' where id = %d", $item_and_rune['item'], $ir['id']);
+//                    echo "</small>";
                     if (!empty($item_and_rune)) {
-                        # Добавляем предмет без руны
+                        # ��������� ������� ��� ����
                         mysql_query(sprintf("update items_users set data = '%s' where id = %d", $item_and_rune['item'], $ir['id']));
-                        # Отнимаем деньги
+                        # �������� ������
                         $u->info['money'] -= $pcena;
                         mysql_query(sprintf("update users set money = money - %f where id = %d", $pcena, $u->info['id']));
-                        # Добавляем руну
+                        # ��������� ����
                         $u->addItem($item_and_rune['rune_id'],$u->info['id'],$item_and_rune['rune'], null, null, true);
                     } else {
-                        /** Если пытаемся извлечь любую руну кроме 6001, 6002, 6003. */
-                        $re = 'Руна слилась с предметом и не извлекается...';
+                        /** ���� �������� ������� ����� ���� ����� 6001, 6002, 6003. */
+                        $re = '���� ������� � ��������� � �� �����������...';
                     }
 				  }else{
-					$re = '<div align="left">У вас не достаточно средств для извлечения, цена извлечения руны '.$pcena.'</div>';
+					$re = '<div align="left">� ��� �� ���������� ������� ��� ����������, ���� ���������� ���� '.$pcena.'</div>';
 				}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 		}elseif(isset($_GET['ubeff'])) {
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%upatack_id%" AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['ubeff']).'" LIMIT 1'));
@@ -459,9 +463,9 @@ if($u->room['file']=='remont')
 					}
 
 					$u->addItem($po['upatack_id'],$u->info['id'],NULL,NULL,NULL,1);
-					$re = '<div align="left">Заточка &quot;'.$po['upatack_name'].'&quot; была успешно извлечена из предмета &quot;'.$ir['name'].'&quot; за '.$pcena.' кр.</div>';
+					$re = '<div align="left">������� &quot;'.$po['upatack_name'].'&quot; ���� ������� ��������� �� �������� &quot;'.$ir['name'].'&quot; �� '.$pcena.' ��.</div>';
 
-					$u->addDelo(2,$u->info['id'],'&quot;<font color="#4863A0">System.remont.ubeff</font>&quot;: Руна &quot;'.$po['upatack_name'].'&quot; была успешно извлечена из предмета &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] за '.$pcena.' кр.',time(),$u->info['city'],'System.remont.ubeff',0,0);
+					$u->addDelo(2,$u->info['id'],'&quot;<font color="#4863A0">System.remont.ubeff</font>&quot;: ���� &quot;'.$po['upatack_name'].'&quot; ���� ������� ��������� �� �������� &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] �� '.$pcena.' ��.',time(),$u->info['city'],'System.remont.ubeff',0,0);
 					unset($po['upatack'],$po['upatack_id'],$po['upatack_name'],$po['upatack_lvl']);
 					$po = $u->impStats($po);
 					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
@@ -469,10 +473,10 @@ if($u->room['file']=='remont')
 					$u->info['money'] -= $pcena;
 
 				}else{
-					$re = '<div align="left">У вас не достаточно средств для извлечения, стоимость извлечения заточки '.$pcena.' кр</div>';
+					$re = '<div align="left">� ��� �� ���������� ������� ��� ����������, ��������� ���������� ������� '.$pcena.' ��</div>';
 				}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 	} elseif(isset($_GET['un_grav'])) {
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['un_grav']).'" LIMIT 1'));
@@ -492,20 +496,20 @@ if($u->room['file']=='remont')
 				$po['gravi'] = str_replace('|','',$po['gravi']);
 				$tst = str_replace(' ','',$po['gravi']);
 				$tst = str_replace('	','',$po['gravi']);
-				$po['gravi'] = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "", $po['gravi']);
+				$po['gravi'] = preg_replace("/[^a-zA-Z�-��-�0-9\s]/", "", $po['gravi']);
 				if($po['gravi'] != '' && $tst != '') {
 					$po = $u->impStats($po);
 					mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
 					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
-					$re = '<div align="left">На предмете &quot;'.$ir['name'].'&quot; был успешно выгровирован текст за '.$pcena.' кр.</div>';
+					$re = '<div align="left">�� �������� &quot;'.$ir['name'].'&quot; ��� ������� ������������ ����� �� '.$pcena.' ��.</div>';
 				}else{
-					$re = '<div align="left">Пустой текст, либо состоит из символов которые нельзя использовать</div>';
+					$re = '<div align="left">������ �����, ���� ������� �� �������� ������� ������ ������������</div>';
 				}
 			}else{
-				$re = '<div align="left">У вас не достаточно средств для гравировки</div>';
+				$re = '<div align="left">� ��� �� ���������� ������� ��� ����������</div>';
 			}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 	}elseif(isset($_GET['grav'])) {
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['grav']).'" LIMIT 1'));
@@ -525,20 +529,20 @@ if($u->room['file']=='remont')
 				$po['gravi'] = str_replace('|','',$po['gravi']);
 				$tst = str_replace(' ','',$po['gravi']);
 				$tst = str_replace('	','',$po['gravi']);
-				$po['gravi'] = preg_replace("/[^a-zA-ZА-Яа-я0-9\s]/", "", $po['gravi']);
+				$po['gravi'] = preg_replace("/[^a-zA-Z�-��-�0-9\s]/", "", $po['gravi']);
 				if($po['gravi'] != '' && $tst != '') {
 					$po = $u->impStats($po);
 					mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
 					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
-					$re = '<div align="left">На предмете &quot;'.$ir['name'].'&quot; был успешно выгровирован текст за '.$pcena.' кр.</div>';
+					$re = '<div align="left">�� �������� &quot;'.$ir['name'].'&quot; ��� ������� ������������ ����� �� '.$pcena.' ��.</div>';
 				}else{
-					$re = '<div align="left">Пустой текст, либо состоит из символов которые нельзя использовать</div>';
+					$re = '<div align="left">������ �����, ���� ������� �� �������� ������� ������ ������������</div>';
 				}
 			}else{
-				$re = '<div align="left">У вас не достаточно средств для гравировки</div>';
+				$re = '<div align="left">� ��� �� ���������� ������� ��� ����������</div>';
 			}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 	}elseif(isset($_GET['podgon'])) {
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = 5 AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['podgon']).'" LIMIT 1'));
@@ -558,15 +562,15 @@ if($u->room['file']=='remont')
 					$po = $u->impStats($po);
 					mysql_query('UPDATE `users` SET `money` = `money` - "'.$pcena.'" WHERE `id` = "'.$u->info['id'].'" LIMIT 1');
 					mysql_query('UPDATE `items_users` SET `data` = "'.$po.'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
-					$re = '<div align="left">Предмет &quot;'.$ir['name'].'&quot; был успешно подогнан за '.$pcena.' кр. (Добавлено +'.$prhp.'HP)</div>';
+					$re = '<div align="left">������� &quot;'.$ir['name'].'&quot; ��� ������� �������� �� '.$pcena.' ��. (��������� +'.$prhp.'HP)</div>';
 				}else{
-					$re = '<div align="left">У вас не достаточно средств для подгонки</div>';
+					$re = '<div align="left">� ��� �� ���������� ������� ��� ��������</div>';
 				}
 			}else{
-				$re = '<div align="left">Предмет уже был подогнан</div>';
+				$re = '<div align="left">������� ��� ��� ��������</div>';
 			}
 		}else{
-			$re = '<div align="left">Подходящий предмет не найден в инвентаре</div>';
+			$re = '<div align="left">���������� ������� �� ������ � ���������</div>';
 		}
 	}elseif(isset($_GET['remon']))
 	{
@@ -580,46 +584,46 @@ if($u->room['file']=='remont')
 		}
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['remon']).'" LIMIT 1'));
 
-		$rem_price=round($ir['price1']*0.1/100,2);//цена ремонта за 1ед поломки
-		$rem_all=round($ir['price1']*$ir['iznosNOW']*0.1/100,2);//цена ремонта full
+		$rem_price=round($ir['price1']*0.1/100,2);//���� ������� �� 1�� �������
+		$rem_all=round($ir['price1']*$ir['iznosNOW']*0.1/100,2);//���� ������� full
 
 		if( $u->stats['repair_discount'] >= 1) {
 			$rem_price = round($rem_price/100*25,2);
 			$rem_all = round($rem_all/100*25,2);
 		}
 
-		if($rem_price<0.01){$rem_price=0.01;} //кэп поможет
-		if($rem_all<0.01){$rem_all=0.01;} //кэп поможет
+		if($rem_price<0.01){$rem_price=0.01;} //��� �������
+		if($rem_all<0.01){$rem_all=0.01;} //��� �������
 
 		if(isset($ir['id']))
 		{
 			$po = $u->lookStats($ir['data']);
 			if(isset($po['noremont']))
 			{
-				$re2 = 'Предмет не подлежит ремонту в этой мастерской.';
+				$re2 = '������� �� �������� ������� � ���� ����������.';
 			}else{
 				if($t == 1)
 				{
 				    $rem_cell=$rem_price;
 					$t = 0;
 					$rm = 1;
-					$re2 .= ' 1 ед.';
+					$re2 .= ' 1 ��.';
 				}elseif($t == 2)
 				{
 					$t = 0;
 					$rm = 10;
 					$rem_cell=$rem_price*10;
-					$re2 .= ' 10 ед.';
+					$re2 .= ' 10 ��.';
 				}elseif($t == 3)
 				{
 				    $rem_cell=$rem_all;
 					$t = 0;
 					$rm = $ir['iznosNOW'];
-					$re2 .= $rm. ' ед.';
+					$re2 .= $rm. ' ��.';
 				}
 				if($rem_cell>$u->info['money'])
 				{
-					$re2 = 'У вас недостаточно средст для ремонта.';
+					$re2 = '� ��� ������������ ������ ��� �������.';
 				}else{
 					if($rm > $ir['iznosNOW'])
 					{
@@ -643,21 +647,21 @@ if($u->room['file']=='remont')
 							$ir['iznosMAX'] = 1;
 						}
 						mysql_query('UPDATE `items_users` SET `iznosNOW` = "'.$ir['iznosNOW'].'",`iznosMAX` = "'.$ir['iznosMAX'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
-						$re2 = 'Удачно произведен ремонт '.$re2.' предмета &quot;'.$ir['name'].'&quot; за '.$rem_cell.' кр.';
+						$re2 = '������ ���������� ������ '.$re2.' �������� &quot;'.$ir['name'].'&quot; �� '.$rem_cell.' ��.';
 						$dop = 0;
 						if(ceil($il)>ceil($ir['iznosMAX']))
 						{
-							$re2 .= '<br>К сожалению, максимальная долговечность предмета из-за ремонта уменьшилась.';
+							$re2 .= '<br>� ���������, ������������ ������������� �������� ��-�� ������� �����������.';
 							$dop = 1;
 						}
-						$u->addDelo(2,$u->info['id'],'&quot;<font color="grey">System.remont</font>&quot;: Предмет &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] был <b>отремонтирован</b>, максимальная долговечность уменьшилась: '.$dop.' ('.$rm.' ед. за '.$t.' кр.).',time(),$u->info['city'],'System.remont',0,0);
+						$u->addDelo(2,$u->info['id'],'&quot;<font color="grey">System.remont</font>&quot;: ������� &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] ��� <b>��������������</b>, ������������ ������������� �����������: '.$dop.' ('.$rm.' ��. �� '.$t.' ��.).',time(),$u->info['city'],'System.remont',0,0);
 					}else{
-						$re2 = 'Что-то здесь не так...';
+						$re2 = '���-�� ����� �� ���...';
 					}
 				}
 			}
 		}else{
-			$re2 = 'Предмет подходящий для ремонта не найден в инвентаре';
+			$re2 = '������� ���������� ��� ������� �� ������ � ���������';
 		}
 	}elseif(isset($_GET['remonz']))
 	{
@@ -671,16 +675,16 @@ if($u->room['file']=='remont')
 		}
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['remonz']).'" LIMIT 1'));
 
-		$rem_price=round($ir['price1']*0.1/100,2);//цена ремонта за 1ед поломки
-		$rem_all=round($ir['price1']*$ir['iznosNOW']*0.1/100,2);//цена ремонта full
-		if($rem_price<0.01){$rem_price=0.01;} //кэп поможет
+		$rem_price=round($ir['price1']*0.1/100,2);//���� ������� �� 1�� �������
+		$rem_all=round($ir['price1']*$ir['iznosNOW']*0.1/100,2);//���� ������� full
+		if($rem_price<0.01){$rem_price=0.01;} //��� �������
 
 		if(isset($ir['id']))
 		{
 			$po = $u->lookStats($ir['data']);
 			if(isset($po['noremont']))
 			{
-				$re2 = 'Предмет не подлежит ремонту в этой мастерской.';
+				$re2 = '������� �� �������� ������� � ���� ����������.';
 			}else{
 
 				if( $ir['1price'] > 0 ) {
@@ -695,23 +699,23 @@ if($u->room['file']=='remont')
 				    $rem_cell=$rem_price;
 					$t = 0;
 					$rm = 1;
-					$re2 .= ' 1 ед.';
+					$re2 .= ' 1 ��.';
 				}elseif($t == 2)
 				{
 					$t = 0;
 					$rm = 10;
 					$rem_cell=$rem_price*10;
-					$re2 .= ' 10 ед.';
+					$re2 .= ' 10 ��.';
 				}elseif($t == 3)
 				{
 				    $rem_cell=$rem_all;
 					$t = 0;
 					$rm = $ir['iznosNOW'];
-					$re2 .= $rm. ' ед.';
+					$re2 .= $rm. ' ��.';
 				}
 				if($rem_cell>$u->info['money4'])
 				{
-					$re2 = 'У вас недостаточно зубов для ремонта.';
+					$re2 = '� ��� ������������ ����� ��� �������.';
 				}else{
 					if($rm > $ir['iznosNOW'])
 					{
@@ -736,21 +740,21 @@ if($u->room['file']=='remont')
 						}
 						$po = $u->impStats($po);
 						mysql_query('UPDATE `items_users` SET `data` = "'.$po.'",`iznosNOW` = "'.$ir['iznosNOW'].'",`iznosMAX` = "'.$ir['iznosMAX'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
-						$re2 = 'Удачно произведен ремонт '.$re2.' предмета &quot;'.$ir['name'].'&quot; за '.$u->zuby($rem_cell,1).'.';
+						$re2 = '������ ���������� ������ '.$re2.' �������� &quot;'.$ir['name'].'&quot; �� '.$u->zuby($rem_cell,1).'.';
 						$dop = 0;
 						if(ceil($il)>ceil($ir['iznosMAX']))
 						{
-							$re2 .= '<br>К сожалению, максимальная долговечность предмета из-за ремонта уменьшилась.';
+							$re2 .= '<br>� ���������, ������������ ������������� �������� ��-�� ������� �����������.';
 							$dop = 1;
 						}
-						$u->addDelo(2,$u->info['id'],'&quot;<font color="grey">System.remont</font>&quot;: Предмет &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] был <b>отремонтирован</b>, максимальная долговечность уменьшилась: '.$dop.' ('.$rm.' ед. за '.$t.' зубов.).',time(),$u->info['city'],'System.remont',0,0);
+						$u->addDelo(2,$u->info['id'],'&quot;<font color="grey">System.remont</font>&quot;: ������� &quot;'.$ir['name'].'&quot; [itm:'.$ir['id'].'] ��� <b>��������������</b>, ������������ ������������� �����������: '.$dop.' ('.$rm.' ��. �� '.$t.' �����.).',time(),$u->info['city'],'System.remont',0,0);
 					}else{
-						$re2 = 'Что-то здесь не так...';
+						$re2 = '���-�� ����� �� ���...';
 					}
 				}
 			}
 		}else{
-			$re2 = 'Предмет подходящий для ремонта не найден в инвентаре';
+			$re2 = '������� ���������� ��� ������� �� ������ � ���������';
 		}
 	}elseif(isset($_GET['upgradelvl'])) {
 		$ir = mysql_fetch_array(mysql_query('SELECT `im`.*,`iu`.* FROM `items_users` AS `iu` LEFT JOIN `items_main` AS `im` ON (`im`.`id` = `iu`.`item_id`) WHERE `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`id` = "'.mysql_real_escape_string((int)$_GET['upgradelvl']).'" LIMIT 1'));
@@ -758,62 +762,62 @@ if($u->room['file']=='remont')
 			$ur = mysql_fetch_array(mysql_query('SELECT * FROM `items_upgrade` WHERE `iid` = "'.$ir['item_id'].'" LIMIT 1'));
 			if(isset($ur['id'])) {
 				if($ur['price1'] > 0 && $u->info['money'] < $ur['price1']) {
-					$re2 = 'Недостаточно кр. у персонажа';
+					$re2 = '������������ ��. � ���������';
 				}elseif($ur['price2'] > 0 && $u->bank['money2'] < $ur['price2']) {
-					$re2 = 'Недостаточно екр. на счету, пополните банковский счет';
+					$re2 = '������������ ���. �� �����, ��������� ���������� ����';
 				}else{
 					$ui1 = mysql_fetch_array(mysql_query('SELECT * FROM `items_main` WHERE `id` = "'.$ur['iup'].'" LIMIT 1'));
 					$ui2 = mysql_fetch_array(mysql_query('SELECT * FROM `items_main_data` WHERE `items_id` = "'.$ur['iup'].'" LIMIT 1'));
 					if(isset($ui1['id'],$ui2['id'])) {
 						mysql_query('UPDATE `items_users` SET `item_id` = "'.$ui1['id'].'",`1price` = "'.$ui1['price1'].'",`2price` = "'.$ui1['price2'].'",`iznosMAX` = "'.$ui1['iznosMAXi'].'",`data` = "'.$ui2['data'].'" WHERE `id` = "'.$ir['id'].'" LIMIT 1');
-						$re2 = 'Предмет &quot;'.$ir['name'].'&quot; был успешно улучшен до следующего уровня за '.$ur['price2'].' екр.';
+						$re2 = '������� &quot;'.$ir['name'].'&quot; ��� ������� ������� �� ���������� ������ �� '.$ur['price2'].' ���.';
 						$u->bank['money2'] -= $ur['price2'];
 						mysql_query('UPDATE `bank` SET `money2` = "'.$u->bank['money2'].'" WHERE `id` = "'.$u->bank['id'].'" LIMIT 1');
 					}else{
-						$re2 = 'Неудалось улучшить данный предмет';
+						$re2 = '��������� �������� ������ �������';
 					}
 				}
 			}else{
-				$re2 = 'Предмет подходящий для улучшения не найден';
+				$re2 = '������� ���������� ��� ��������� �� ������';
 			}
 		}else{
-			$re2 = 'Предмет подходящий для улучшения не найден в инвентаре';
+			$re2 = '������� ���������� ��� ��������� �� ������ � ���������';
 		}
 	}
 
 	$see = '';
 	if($r==1){
-		//ремонт предметов
+		//������ ���������
 		$see = $u->genInv(4,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`iznosNOW` >= 1 ORDER BY `lastUPD` DESC');
 		$see = $see[2];
 	}elseif($r==5){
-		//подгонка брони
+		//�������� �����
 		$see = $u->genInv(56,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `im`.`inslot` = "5" AND `iu`.`data` NOT LIKE "%podgon%" ORDER BY `lastUPD` DESC');
 		$see = $see[2];
 	}elseif($r==2){
-		//гравировка оружия
+		//���������� ������
 		$see = $u->genInv(57,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`im`.`type` = "18" OR `im`.`type` = "19" OR `im`.`type` = "20" OR `im`.`type` = "21" OR `im`.`type` = "22" OR `im`.`type` = "23" OR `im`.`type` = "24" OR `im`.`type` = "26" OR `im`.`type` = "27" OR `im`.`type` = "28") ORDER BY `lastUPD` DESC');
 		$see = $see[2];
 	}elseif($r==4){
-		//вытаскивание рун
+		//������������ ���
 		$see = $u->genInv(58,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%rune_id%" ORDER BY `lastUPD` DESC');
 		$see = $see[2];
 	}elseif($r==3){
-		//дезинтеграция
+		//�������������
 		$see = $u->genInv(59,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%upatack_id%") ORDER BY `lastUPD` DESC');
 		$see = $see[2];
 	}elseif($r==7){
-		//модификация
+		//�����������
 		$see = $u->genInv(60,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` NOT LIKE "%modif%" AND `im`.`type` > 0 AND `im`.`type` < 16 AND
 		(`iu`.`data` LIKE "%add_s1%" OR `iu`.`data` LIKE "%add_s2%" OR `iu`.`data` LIKE "%add_s3%" OR `iu`.`data` LIKE "%add_s5%" OR `iu`.`data` LIKE "%add_hpAll%" OR `iu`.`data` LIKE "%add_mib%") ORDER BY `lastUPD` DESC');
 		$see = $see[2];
 	}elseif($r==6) {
-		//Усиление
+		//��������
 		$see = $u->genInv(61,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND `iu`.`data` LIKE "%modif%" AND `iu`.`data` NOT LIKE "%upgrade=5%" ORDER BY `lastUPD` DESC');
 		$see = $see[2];
 	}elseif($r==8) {
 		if(isset($u->bank['id'])) {
-			//Улучшения
+			//���������
 			$see = $u->genInv(62,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (SELECT `id` FROM `items_upgrade` WHERE `iid` = `iu`.`item_id` AND `activ` = 1 LIMIT 1) > 0 ORDER BY `lastUPD` DESC');
 			$see = $see[2];
 		}
@@ -825,10 +829,10 @@ if($u->room['file']=='remont')
             $i++;
         }
         if(isset($u->bank['id']) && !isset($_GET['upgradelvlcom'])) {
-			//Подгонка под комплект
+			//�������� ��� ��������
             $see = $u->genInv(63,'`iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%|art=1%" '.$itmos.')');
         }else{
-			//Подгонка под комплект
+			//�������� ��� ��������
             $see = $u->genInv(64,'`iu`.`id` = "'.mysql_real_escape_string($_GET['upgradelvlcom']).'" AND `iu`.`uid`="'.$u->info['id'].'" AND `iu`.`delete`="0" AND `iu`.`inOdet`="0" AND `iu`.`inShop`="0" AND (`iu`.`data` LIKE "%|art=1%" '.$itmos.')');
         }
         $see = $see[2];
@@ -879,7 +883,7 @@ if($u->room['file']=='remont')
 }
     </style>
 	<TABLE width="100%" cellspacing="0" cellpadding="0">
-	<tr><td valign="top"><div align="center" class="pH3">Ремонтная мастерская</div>
+	<tr><td valign="top"><div align="center" class="pH3">��������� ����������</div>
 	<?php
 	echo '<b style="color:red">'.$error.'</b>';
 	?>
@@ -887,12 +891,12 @@ if($u->room['file']=='remont')
 	  <tr>
 	    <td><table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="d2d2d2">
 	      <tr>
-	        <td><b>&nbsp;&nbsp;Залы:&nbsp;</b></td>
-	        <td nowrap="nowrap" align="center" <? if($r==1){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==1){ echo '<b>Ремонт</b>'; }else{ echo '<a href="?r=1&rnd='.$code.'">Ремонт</a>'; } ?>&nbsp;&nbsp;</td>
-	        <td nowrap="nowrap" align="center" <? if($r==2){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==2){ echo '<b>Гравировка</b>'; }else{ echo '<a href="?r=2&rnd='.$code.'">Гравировка</a>'; } ?>&nbsp;&nbsp;</td>
-			<td nowrap="nowrap" align="center" <? if($r==3){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==3){ echo '<b>Дезинтеграция</b>'; }else{ echo '<a href="?r=3&rnd='.$code.'">Дезинтеграция</a>'; } ?>&nbsp;&nbsp;</td>
-	        <td nowrap="nowrap" align="center" <? if($r==4){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==4){ echo '<b>Руны</b>'; }else{ echo '<a href="?r=4&rnd='.$code.'">Руны</a>'; } ?>&nbsp;&nbsp;</td>
-			<td nowrap="nowrap" align="center" <? if($r==5){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==5){ echo '<b>Подгонка</b>'; }else{ echo '<a href="?r=5&rnd='.$code.'">Подгонка</a>'; } ?>&nbsp;&nbsp;</td>
+	        <td><b>&nbsp;&nbsp;����:&nbsp;</b></td>
+	        <td nowrap="nowrap" align="center" <? if($r==1){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==1){ echo '<b>������</b>'; }else{ echo '<a href="?r=1&rnd='.$code.'">������</a>'; } ?>&nbsp;&nbsp;</td>
+	        <td nowrap="nowrap" align="center" <? if($r==2){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==2){ echo '<b>����������</b>'; }else{ echo '<a href="?r=2&rnd='.$code.'">����������</a>'; } ?>&nbsp;&nbsp;</td>
+			<td nowrap="nowrap" align="center" <? if($r==3){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==3){ echo '<b>�������������</b>'; }else{ echo '<a href="?r=3&rnd='.$code.'">�������������</a>'; } ?>&nbsp;&nbsp;</td>
+	        <td nowrap="nowrap" align="center" <? if($r==4){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==4){ echo '<b>����</b>'; }else{ echo '<a href="?r=4&rnd='.$code.'">����</a>'; } ?>&nbsp;&nbsp;</td>
+			<td nowrap="nowrap" align="center" <? if($r==5){ echo 'bgcolor="#A5A5A5"'; } ?> >&nbsp;&nbsp;<? if($r==5){ echo '<b>��������</b>'; }else{ echo '<a href="?r=5&rnd='.$code.'">��������</a>'; } ?>&nbsp;&nbsp;</td>
 			<td nowrap="nowrap" style="position: absolute; right: 290px;"><?=$u->microLogin($u->info['id'],1) ?></td>
             <td width="90%">&nbsp;</td>
 	        </tr>
@@ -901,26 +905,26 @@ if($u->room['file']=='remont')
 	  <tr>
 	    <?
 		$rn = array(
-			1 => 'Починка поврежденных предметов',
-			2 => 'Нанесение надписей на оружие (20 символов)',
-			3 => 'Разделение на состаные части улучшенных предметов',
-			4 => 'Извлечение рун',
-			5 => 'Подогнать броню',
-			6 => 'Улучшение модифицированных предметов',
-			7 => 'Модификация предметов',
-			8 => 'Улучшение уровня предмета',
-			9 => 'Подгонка предмета под комплект'
+			1 => '������� ������������ ���������',
+			2 => '��������� �������� �� ������ (20 ��������)',
+			3 => '���������� �� �������� ����� ���������� ���������',
+			4 => '���������� ���',
+			5 => '��������� �����',
+			6 => '��������� ���������������� ���������',
+			7 => '����������� ���������',
+			8 => '��������� ������ ��������',
+			9 => '�������� �������� ��� ��������'
 		);
 		$rn2 = array(
-			1 => 'У вас в рюкзаке нет поврежденных предметов',
-			2 => 'У вас в рюкзаке нет оружия, на которое можно нанести гравировку',
-			3 => 'У вас в рюкзаке нет улучшенных предметов',
-			4 => 'У вас в рюкзаке нет улучшенных предметов',
-			5 => 'У вас в рюкзаке нет подходящих предметов',
-			6 => 'У вас в рюкзаке нет подходящих предметов',
-			7 => 'У вас в рюкзаке нет подходящих предметов',
-			8 => 'У вас в рюкзаке нет подходящих предметов',
-			9 => 'У вас в рюкзаке нет подходящих предметов'
+			1 => '� ��� � ������� ��� ������������ ���������',
+			2 => '� ��� � ������� ��� ������, �� ������� ����� ������� ����������',
+			3 => '� ��� � ������� ��� ���������� ���������',
+			4 => '� ��� � ������� ��� ���������� ���������',
+			5 => '� ��� � ������� ��� ���������� ���������',
+			6 => '� ��� � ������� ��� ���������� ���������',
+			7 => '� ��� � ������� ��� ���������� ���������',
+			8 => '� ��� � ������� ��� ���������� ���������',
+			9 => '� ��� � ������� ��� ���������� ���������'
 		);
 		?>
         <td bgcolor="#A5A5A5"><small><b><? echo $rn[$r]; ?></b></small></td>
@@ -928,39 +932,40 @@ if($u->room['file']=='remont')
 	  <tr>
 	    <td style="border:1px solid #A5A5A5;padding:0px;">
         <?
-		if($r == 2) {
-			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i><b>Орден Света</b> предупреждает, что за нецензурные или оскорбительные надписи Вы будете наказаны.</i></div>';
+
+        if($r == 2) {
+			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i><b>����� �����</b> �������������, ��� �� ����������� ��� �������������� ������� �� ������ ��������.</i></div>';
 		}elseif($r == 8) {
-			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i>Все усиления предмета (заточки, руны, чарки и т.д.) обнуляются без возможности возврата</i></div>';
+			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i>��� �������� �������� (�������, ����, ����� � �.�.) ���������� ��� ����������� ��������</i></div>';
 		}elseif($r == 5) {
-			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i>Внимание! Броня будет связана с вами общей судьбой!</i></div>';
+			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i>��������! ����� ����� ������� � ���� ����� �������!</i></div>';
 		}elseif($r == 3) {
-			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i><b>Внимание!</b> При дезинтеграция изымается свиток заточки, руны и зачарование сохраняется.</i></div>';
+			echo '<div style="background-color:#c8c8c8;border-bottom:1px solid #a5a5a5;padding:2px;"><i><b>��������!</b> ��� ������������� ��������� ������ �������, ���� � ����������� �����������.</i></div>';
 		}
 		?>
 		<table width="100%" border="0" cellspacing="0" cellpadding="0">
 		<?
 		if(($r == 8 || $r == 9) && !isset($u->bank['id'])) {
-			//Улучшение предметов за кр.\екр.
+			//��������� ��������� �� ��.\���.
 		?>
         <?
 		if(isset($_POST['bank']) && isset($u->bank['id']))
 		{
-			echo '<font color="red"><b>Банковский счет пуст, вход в магазин запрещен</b></font>';
+			echo '<font color="red"><b>���������� ���� ����, ���� � ������� ��������</b></font>';
 		}elseif(isset($_POST['bank']) && !isset($u->bank['id']))
 		{
-			echo '<font color="red"><b>Неверный пароль от банковского счета.</b></font>';
+			echo '<font color="red"><b>�������� ������ �� ����������� �����.</b></font>';
 		}
 		?>
         <form name="F1" method="post">
-        <br /><center>Зайдите на свой банковский счет, для улучшения некоторых предметов требуются екр.</center>
+        <br /><center>������� �� ���� ���������� ����, ��� ��������� ��������� ��������� ��������� ���.</center>
         <div>
           <table style="padding-bottom:20px;" align="center" width="300" border="0" cellspacing="0" cellpadding="0">
             <tr>
-              <td bgcolor="#B1A996"><div align="center"><strong>Счёт в банке</strong></div></td>
+              <td bgcolor="#B1A996"><div align="center"><strong>���� � �����</strong></div></td>
             </tr>
             <tr>
-              <td bgcolor="#DDD5C2" style="padding:5px;"><div align="center"><small>Выберите счёт и введите пароль<br />
+              <td bgcolor="#DDD5C2" style="padding:5px;"><div align="center"><small>�������� ���� � ������� ������<br />
                         <select name="bank" id="bank">
 						<?
                         $scet = mysql_query('SELECT `id` FROM `bank` WHERE `block` = "0" AND `uid` = "'.$u->info['id'].'"');
@@ -1022,11 +1027,11 @@ if($u->room['file']=='remont')
 						}
 					}
 					if( $com2['com'] > 0 && ($sti['complect'] == $com2['com'] || $sti['complect2'] == $com2['com']) ) {
-						$er2 = 'Предмет уже использует данный комплект.';
+						$er2 = '������� ��� ���������� ������ ��������.';
 					}elseif( !isset($com2['id']) ) {
-						$er2 = 'Вы не можете подогнать предмет под данный комплект.';
+						$er2 = '�� �� ������ ��������� ������� ��� ������ ��������.';
 					}elseif( $epr > $u->bank['money2'] ) {
-					 	$er2 = 'У вас недостаточно екр., требуется '.$epr.' екр.';
+					 	$er2 = '� ��� ������������ ���., ��������� '.$epr.' ���.';
 					 }else{
 						$sti['complect2'] = $com2['com'];
 						if($wrk == 1 && ($sti['sudba'] == '0' || !isset($sti['sudba']))) {
@@ -1035,7 +1040,7 @@ if($u->room['file']=='remont')
 						$sti_imp = $u->impStats($sti);
 						mysql_query('UPDATE `bank` SET `money2` = `money2` - "'.$epr.'" WHERE `id` = "'.$u->bank['id'].'" LIMIT 1');
 						mysql_query('UPDATE `items_users` SET `data` = "'.mysql_real_escape_string($sti_imp).'" WHERE `id` = "'.$itmu['id'].'" LIMIT 1');
-					 	$er2 = 'Предмет &quot;'.$itmm['name'].'&quot; успешно подогнан под &quot;'.$com2['name'].'&quot; за '.$epr.' екр.';
+					 	$er2 = '������� &quot;'.$itmm['name'].'&quot; ������� �������� ��� &quot;'.$com2['name'].'&quot; �� '.$epr.' ���.';
 					 }
 				  }
 				?>
@@ -1058,12 +1063,12 @@ if($u->room['file']=='remont')
 							}
 						}
 						echo $html;
-						?><br /><br />Тип работ:<br />
-                        <label><input type="radio" name="work2" value="1" />Личная <img src="https://img.new-combats.com/i/desteny.gif" title="Предмет будет связан общей судьбой с вами" width="16" height="18" /> за <?=round($itmm['price2']*0.2,2)?> екр. </label><br>
+						?><br /><br />��� �����:<br />
+                        <label><input type="radio" name="work2" value="1" />������ <img src="https://img.new-combats.com/i/desteny.gif" title="������� ����� ������ ����� ������� � ����" width="16" height="18" /> �� <?=round($itmm['price2']*0.2,2)?> ���. </label><br>
                         <? if(!isset($sti['sudba'])) { ?>
-                        <label><input type="radio" name="work2" value="2" />Общая за <?=round($itmm['price2']*0.4,2)?> екр. </label><br>
+                        <label><input type="radio" name="work2" value="2" />����� �� <?=round($itmm['price2']*0.4,2)?> ���. </label><br>
                         <? } ?>
-                        <center><br /><input type="submit" value="Подтвердить" class="btnnew" /></center>
+                        <center><br /><input type="submit" value="�����������" class="btnnew" /></center>
                         </form>
                         </div>
                     </td>
@@ -1097,7 +1102,7 @@ if($u->room['file']=='remont')
 	<table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#DEDEDE">
 	<tr>
 	<td bgcolor="#D3D3D3"><img src="https://img.new-combats.com/i/move/links.gif" width="9" height="7" /></td>
-	<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.9&rnd=<? echo $code; ?>';" title="<? thisInfRm('1.180.0.9',1); ?>">Центральная Площадь</a></td>
+	<td bgcolor="#D3D3D3" nowrap><a href="#" id="greyText" class="menutop" onclick="location='main.php?loc=1.180.0.9&rnd=<? echo $code; ?>';" title="<? thisInfRm('1.180.0.9',1); ?>">����������� �������</a></td>
 	</tr>
 	</table>
 	</td>
@@ -1108,9 +1113,9 @@ if($u->room['file']=='remont')
 	<div><br />
       <div align="right">
       <small>
-	  Масса: <?=$u->aves['now']?>/<?=$u->aves['max']?> &nbsp;<br />
-	  У вас в наличии: <b style="color:#339900;"><?php echo round($u->info['money'],2); ?> кр.</b> &nbsp;<br><br><br><br>
-	 <b> <font color=red>Внимание! </font><font color=darkgreen>Если у вас активирована бесплатная дезинтеграция "Рун" и "Заточек", все равно при себе необходимо иметь сумму стоимости дезинтеграции</font></b>
+	  �����: <?=$u->aves['now']?>/<?=$u->aves['max']?> &nbsp;<br />
+	  � ��� � �������: <b style="color:#339900;"><?php echo round($u->info['money'],2); ?> ��.</b> &nbsp;<br><br><br><br>
+	 <b> <font color=red>��������! </font><font color=darkgreen>���� � ��� ������������ ���������� ������������� "���" � "�������", ��� ����� ��� ���� ���������� ����� ����� ��������� �������������</font></b>
       </small>
       </div>
       	<p><small>
diff --git a/modules_data/location/tournaments_lobby.php b/modules_data/location/tournaments_lobby.php
index 46be7346..6d925ca3 100644
--- a/modules_data/location/tournaments_lobby.php
+++ b/modules_data/location/tournaments_lobby.php
@@ -1,21 +1,40 @@
 <?php
+
 use Insallah\Db, Insallah\TournamentModel;
 
 $db = new Db();
 $members = [];
-$user = $db::getRow('select id, room, level from users where login = ?', [$_COOKIE['login']]);
+$user = $db::getRow('select id, room, level, login from users where login = ?', [$_COOKIE['login']]);
 $tournamentStartTime = $db::getValue('select start_time from tournaments where tid = ?', [$user['level']]);
 foreach (TournamentModel::getFreeFighters($user['level']) as $member) {
-    $members[] = TournamentModel::uidToLogin($member['uid']);
+    $members[] = TournamentModel::uidToLogin($member);
 }
+
 ?>
 
 <strong>������ ��� <?= $user['level'] ?> �������.</strong><br>
-����� ������ ������: <?= date('G:i', $tournamentStartTime) ?>
-<?php if (date('j', time()) !== date('j', $tournamentStartTime)): ?>
-    (�� �������!)
-<?php endif; ?>
+
+<?php
+if (empty($members) || empty($tournamentStartTime)): ?>
+    ������� - ���. ���������� - ���. ��� �� ���� �������? ��-��, ����� ����� �� ������ �� ����������!
+    <?php
+    exit(); endif; ?>
+<?php
+if ((int)$tournamentStartTime === -1): ?>
+    ������ �������!
+<?php
+else: ?>
+    ����� ������ ������: <?= date('G:i', $tournamentStartTime) ?>
+    <?php
+    if (date('j', time()) !== date('j', $tournamentStartTime)): ?>
+        (�� �������!)
+    <?php
+    endif; ?>
+<?php
+endif; ?>
+
 <br>
+<?= $user['login'] ?><br>
 ���������: <?= implode(', ', $members) ?>
 
 
diff --git a/modules_data/titul.php b/modules_data/titul.php
index fbf4200e..46a99c8f 100644
--- a/modules_data/titul.php
+++ b/modules_data/titul.php
@@ -1,5 +1,6 @@
 <?php
 
+use Insallah\Achievements;
 use Insallah\Db;
 
 if (!defined('GAME')) {
diff --git a/tournament_test.php b/tournament_test.php
deleted file mode 100644
index a8145be4..00000000
--- a/tournament_test.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-use Insallah\Db, Insallah\Tournament, Insallah\TournamentModel;
-
-require_once '_incl_data/__config.php';
-require_once '_incl_data/class/Insallah/Core/Db.php';
-require_once '_incl_data/class/Insallah/Tournament/Tournament.php';
-require_once '_incl_data/class/Insallah/Tournament/TournamentModel.php';
-
-$db = new Db();
-$uid = $db::getValue('select id from users where login = ?', [$_COOKIE['login']]);
-
-$tournamentsList = $db::getRows('select * from tournaments');
-$tournaments = '<ul>';
-foreach ($tournamentsList as $tournament) {
-    $level = $tournament['tid'];
-    $time = $tournament['start_time'];
-    $tournament_members_id = TournamentModel::getFreeFighters($tournament['tid']);
-    $members = [];
-    foreach ($tournament_members_id as $member) {
-        $members[] = TournamentModel::uidToLogin($member['uid']);
-    }
-    $tournaments .= "<li>������ ��� {$tournament['tid']} �������.<br>
-����� ������ ������: " . date('G:i', $tournament['start_time']) . "<br>
-���������:" . implode(', ', $members) . '</li>';
-}
-$tournaments .= '</ul>';
-
-if (array_key_exists('tournament_start', $_POST)) {
-    (new Tournament())->join($uid);
-}
-?>
-
-<h3>������ ��� <?=$_COOKIE['login']?></h3>
-<?= $tournaments ?>
-<?php if (!TournamentModel::getTournamentIdByUserId($uid)): ?>
-    <form method="post">
-        <input type="submit" name="tournament_start" value="������� ������� � �������">
-    </form>
-<?php else: ?>
-    �� ��� ����������� � �������!
-<?php endif; ?>
\ No newline at end of file
-- 
2.45.2